summaryrefslogtreecommitdiff
path: root/chromium/third_party/ffmpeg
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-13 13:24:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-14 10:57:25 +0000
commitaf3d4809763ef308f08ced947a73b624729ac7ea (patch)
tree4402b911e30383f6c6dace1e8cf3b8e85355db3a /chromium/third_party/ffmpeg
parent0e8ff63a407fe323e215bb1a2c423c09a4747c8a (diff)
downloadqtwebengine-chromium-af3d4809763ef308f08ced947a73b624729ac7ea.tar.gz
BASELINE: Update Chromium to 47.0.2526.14
Also adding in sources needed for spellchecking. Change-Id: Idd44170fa1616f26315188970a8d5ba7d472b18a Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/third_party/ffmpeg')
-rw-r--r--chromium/third_party/ffmpeg/.travis.yml19
-rwxr-xr-xchromium/third_party/ffmpeg/BUILD.gn142
-rw-r--r--chromium/third_party/ffmpeg/CREDITS.chromium1023
-rw-r--r--chromium/third_party/ffmpeg/Changelog46
-rw-r--r--chromium/third_party/ffmpeg/LICENSE.md745
-rw-r--r--chromium/third_party/ffmpeg/MAINTAINERS30
-rw-r--r--chromium/third_party/ffmpeg/Makefile10
-rw-r--r--chromium/third_party/ffmpeg/README.chromium2
-rw-r--r--chromium/third_party/ffmpeg/RELEASE2
-rw-r--r--chromium/third_party/ffmpeg/arch.mak2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/config.h95
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.asm1981
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm1981
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h91
-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.h99
-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.h99
-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.h93
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h93
-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/mipsel/config.h99
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h93
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h97
-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/ia32/config.asm103
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h105
-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.asm103
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h105
-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.h91
-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.h99
-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.h99
-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.h93
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h93
-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/mipsel/config.h99
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h93
-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/config.h95
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.asm1981
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm1981
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h1998
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/avconfig.h7
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h4
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h91
-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.h99
-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.h99
-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.h93
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h93
-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/mipsel/config.h99
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h93
-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.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h97
-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/ia32/config.asm103
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h105
-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.asm103
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h105
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/config.h91
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h99
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h99
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/config.h93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h99
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h93
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/ffversion.h2
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/ffmpeg.sigs6
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/README11
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py37
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py360
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py193
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/enum.py6
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py237
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/license_texts/full_lgpl.txt502
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/license_texts/jpeg.txt36
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/license_texts/mips.txt36
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/license_texts/oggparse_ahlberg_rullgayrd_2005.txt21
-rw-r--r--chromium/third_party/ffmpeg/cmdutils.c129
-rw-r--r--chromium/third_party/ffmpeg/cmdutils.h16
-rw-r--r--chromium/third_party/ffmpeg/common.mak5
-rwxr-xr-xchromium/third_party/ffmpeg/compat/windows/mslink9
-rwxr-xr-xchromium/third_party/ffmpeg/configure378
-rw-r--r--chromium/third_party/ffmpeg/doc/APIchanges64
-rw-r--r--chromium/third_party/ffmpeg/doc/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/doc/codecs.texi17
-rw-r--r--chromium/third_party/ffmpeg/doc/decoders.texi26
-rw-r--r--chromium/third_party/ffmpeg/doc/demuxers.texi62
-rw-r--r--chromium/third_party/ffmpeg/doc/developer.texi8
-rw-r--r--chromium/third_party/ffmpeg/doc/encoders.texi118
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/avio_dir_cmd.c (renamed from chromium/third_party/ffmpeg/doc/examples/avio_list_dir.c)92
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c10
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c52
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/filtering_audio.c1
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/filtering_video.c6
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/http_multiclient.c155
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/muxing.c4
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/qsvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/remuxing.c2
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/transcode_aac.c2
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/transcoding.c5
-rw-r--r--chromium/third_party/ffmpeg/doc/ffmpeg.texi24
-rw-r--r--chromium/third_party/ffmpeg/doc/ffplay.texi12
-rw-r--r--chromium/third_party/ffmpeg/doc/fftools-common-opts.texi6
-rw-r--r--chromium/third_party/ffmpeg/doc/filter_design.txt2
-rw-r--r--chromium/third_party/ffmpeg/doc/filters.texi1440
-rw-r--r--chromium/third_party/ffmpeg/doc/general.texi34
-rw-r--r--chromium/third_party/ffmpeg/doc/git-howto.texi55
-rw-r--r--chromium/third_party/ffmpeg/doc/indevs.texi181
-rw-r--r--chromium/third_party/ffmpeg/doc/mips.txt4
-rw-r--r--chromium/third_party/ffmpeg/doc/multithreading.txt2
-rw-r--r--chromium/third_party/ffmpeg/doc/muxers.texi25
-rw-r--r--chromium/third_party/ffmpeg/doc/platform.texi6
-rw-r--r--chromium/third_party/ffmpeg/doc/protocols.texi24
-rw-r--r--chromium/third_party/ffmpeg/doc/scaler.texi16
-rw-r--r--chromium/third_party/ffmpeg/doc/texi2pod.pl2
-rw-r--r--chromium/third_party/ffmpeg/doc/utils.texi8
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg.c472
-rwxr-xr-xchromium/third_party/ffmpeg/ffmpeg.gyp14
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg.h17
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_filter.c129
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_generated.gni406
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_generated.gypi188
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_opt.c187
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_options.gni1
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_vda.c134
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_vdpau.c3
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_videotoolbox.c187
-rw-r--r--chromium/third_party/ffmpeg/ffplay.c343
-rw-r--r--chromium/third_party/ffmpeg/ffprobe.c46
-rw-r--r--chromium/third_party/ffmpeg/ffserver.c335
-rw-r--r--chromium/third_party/ffmpeg/ffserver_config.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/012v.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/4xm.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/8bps.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/8svx.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/Makefile129
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/a64multienc.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac.h72
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_ac3_parser.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_defines.h114
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_parser.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_tablegen.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_tablegen.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aac_tablegen_decl.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aaccoder.c587
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec.c3032
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c443
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec_template.c3229
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdectab.h41
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc.c405
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc.h26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_is.c141
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_is.h50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_pred.c344
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_pred.h47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_quantization.h260
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_tns.c219
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_tns.h55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_utils.h152
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenctab.c108
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenctab.h113
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps.c255
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps.h32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_fixed.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.h403
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_float.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_tablegen.c73
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacps_tablegen_template.c107
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdata.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp.c216
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp.h31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp_fixed.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp_float.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c230
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsy.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr.c1420
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr.h57
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed.c585
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.h32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.h101
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen_common.h129
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbr_template.c1535
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacsbrdata.h523
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aactab.c939
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aactab.h40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S361
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_init.c93
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_neon.S361
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aasc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3_parser.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcm.c76
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcmenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adxdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adxenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aic.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alac.c48
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alacenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/allcodecs.c37
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alsdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/amrnbdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/amrwbdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/anm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ansi.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/apedec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/api-flac-test.c266
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/Makefile34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_arm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_armv6.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ass.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/asvdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/asvenc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac1.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aura.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_aacdec.c3032
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_gsmdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_mpegvideo.c133
-rwxr-xr-xchromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_utils.c635
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avcodec.h980
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avdct.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avpacket.c124
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avrndec.c58
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avs.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avuidec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avuienc.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bethsoftvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bfi.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bink.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/binkaudio.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bintext.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/blockdsp.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/blockdsp.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmp.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmpenc.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmvaudio.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bmvvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/brenderpix.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bytestream.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/c93.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cavsdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbrt_fixed_tablegen.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.h16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen_template.c (renamed from chromium/third_party/ffmpeg/libavcodec/vda_internal.h)26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ccaption_dec.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cdgraphics.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cdxl.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cinepak.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cinepakenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cljrdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cljrenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cllc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cngdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cngenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/codec_desc.c163
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cook.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cpia.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/crystalhd.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cscd.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cyuv.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/d3d11va.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dca_parser.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcadec.c35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dcaenc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dct32.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dds.c699
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dfa.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/diracdec.c35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhddata.c377
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhddec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dpcm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dpx.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dpxenc.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsicinaudio.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dss_sp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dv_profile.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dv_profile.h9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c95
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvdec.c39
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dvenc.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxtory.c572
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxv.c462
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_hevc.c144
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eacmv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eamad.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eatgq.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eatgv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/eatqi.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/elsdec.c422
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/elsdec.h60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/error_resilience.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/escape124.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/escape130.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/evrcdec.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/exr.c130
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/faxcompr.c106
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fft-test.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1.h15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1dec.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1enc.c66
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fic.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flac.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flac.h8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flacenc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flashsv.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flashsvenc.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flicvideo.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fmtconvert.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fmtconvert.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fraps.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/frwu.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g2meet.c770
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g722dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g722enc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g723_1.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g726.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g729.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g729_parser.c82
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/g729dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/get_bits.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gif.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gifdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gsm_parser.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gsmdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gsmdec_template.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h261dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h261enc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h263.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h263dec.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264.c71
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264.h47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mb.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c47
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_picture.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_ps.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_refs.c42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_sei.c200
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_slice.c241
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264dsp_template.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264pred.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264pred.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hap.c55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hap.h98
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hapdec.c441
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hapenc.c331
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc.c984
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc.h90
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c170
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_data.c75
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_filter.c193
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c212
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c72
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_parse.c291
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_parser.c299
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_ps.c755
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_ps_enc.c116
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_refs.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_sei.c111
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hnm4video.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpeldsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hpeldsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hq_hqa.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hqx.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hqxdsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.c178
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.h28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/idcinvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/idctdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/idctdsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/iff.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imgconvert.c175
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imgconvert.h16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/imx_dump_header_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo2.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo3.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo4.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/indeo5.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/intelh263dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/internal.h45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/interplayvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ituh263dec.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ituh263enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/j2kenc.c218
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000.c68
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000.h14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c415
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c306
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeglsenc.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/kgv1dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/kmvc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lagarith.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lcldec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lclenc.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libaacplus.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libcelt_dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libdcadec.c60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libfaac.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c77
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libgsmdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libgsmenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libilbc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libkvazaar.c248
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libmp3lame.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopenh264enc.c98
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopusdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libopusenc.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libschroedingerdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libschroedingerenc.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libshine.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libspeexdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libspeexenc.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libtheoraenc.c28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libtwolame.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvo-aacenc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvo-amrwbenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpx.c59
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpx.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpxdec.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpxenc.c132
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libwavpackenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libwebpenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libwebpenc_animencoder.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx264.c169
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx265.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libxavs.c116
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libxvid.c106
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ljpegenc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/loco.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lpc.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lpc.h18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lzf.c90
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/lzf.h29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mace.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mathops.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mathtables.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdct_template.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/me_cmp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/me_cmp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/metasound.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/metasound_data.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mimic.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/Makefile40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/aaccoder_mips.c342
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/aacsbr_mips.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_init_mips.c56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mips.h37
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mmi.c147
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_msa.c86
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/constants.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/constants.h65
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264chroma_init_mips.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_init_mips.c51
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mips.h241
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mmi.c2222
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264pred_init_mips.c52
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mips.h48
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mmi.c780
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_init_mips.c113
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_mmi.c2637
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_mips.h10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_msa.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_init_mips.c73
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_mips.h87
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_msa.c1498
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_init_mips.c71
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mips.h53
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mmi.c190
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_msa.c149
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/iirfilter_mips.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_init_mips.c56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_mips.h60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_msa.c686
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_init_mips.c56
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mips.h38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c443
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_msa.c250
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_init_mips.c40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_init_mips.c69
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mips.h39
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mmi.c79
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_msa.c143
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_init_mips.c167
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_mips.h261
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_msa.c6518
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/sbrdsp_mips.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_mmi.c816
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_msa.c573
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp8_idct_msa.c160
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp8_lpf_msa.c690
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp8_mc_msa.c2332
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_init_mips.c113
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_mips.h172
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9_idct_msa.c2138
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9_intra_msa.c533
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9_lpf_msa.c2599
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9_mc_msa.c4510
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_init_mips.c176
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_mips.h237
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/xvid_idct_mmi.c253
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/xvididct_init_mips.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/xvididct_mips.h30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpega_dump_header_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegdec.c52
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegdec.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.c37
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parser.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpdec.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mmaldec.c49
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mmvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion-test.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion_est.c142
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion_est.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motion_est_template.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motionpixels.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/movtextdec.c475
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/movtextenc.c276
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mp3_header_decompress_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpc7.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpc8.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c108
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c32
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_fixed.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_float.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegpicture.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegutils.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo.c133
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo.h16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c145
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_parser.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mqcenc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msmpeg4enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msrle.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss1.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss2.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss3.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss4.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msvideo1.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mvcdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mxpegdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nellymoserdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/noise_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nuv.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nvenc.c194
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/old_codec_ids.h397
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/on2avc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/options.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/options_table.h97
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus.h10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opus_celt.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/opusdec.c102
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pafaudio.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pafvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pamenc.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/parser.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcm-bluray.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcm.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcx.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pcxenc.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pgssubdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pictordec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pixblockdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pixblockdsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngdec.c229
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngdsp.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngenc.c439
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pnm_parser.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pnmdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pnmenc.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ppc/idctdsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresdec2.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresdec_lgpl.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/psymodel.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pthread.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pthread_frame.c60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ptx.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qcelpdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qdm2.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qdrw.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qpeg.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qpeldsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qpeldsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsv.c160
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsv_internal.h35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec.c436
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec.h27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec_h264.c314
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec_h2645.c222
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec_mpeg2.c97
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec_vc1.c94
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc.c245
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc.h18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc_h264.c27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc_hevc.c272
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc_mpeg2.c117
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qtrle.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qtrleenc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/r210dec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/r210enc.c29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra144enc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ra288.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ralf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ratecontrol.c30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rawdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rawenc.c27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/remove_extradata_bsf.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/resample.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/reverse.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rl2.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqaudioenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqvideodec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rpza.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv10.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv30.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv34.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv34.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv40.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/s302m.c18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/s302menc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/s3tc.c102
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/s3tc.h55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/samidec.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sanm.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbr.h79
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbrdsp.c78
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbrdsp.h36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbrdsp_fixed.c286
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sbrdsp_template.c97
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgidec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgienc.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sgirledec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/shorten.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin.h13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin_fixed.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin_fixed_tablegen.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.h28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen_template.c54
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sipr.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/smacker.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/smc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snappy.c183
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snappy.h60
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snow.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snowdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/snowenc.c69
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sonic.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sp5xdec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/srtdec.c149
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/startcode.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sunrast.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sunrastenc.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq1dec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq1enc.c81
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq1enc.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq3.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tableprint.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/takdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/targa.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/targa_y216dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/targaenc.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tdsc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/textdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/texturedsp.c610
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/texturedsp.h64
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/texturedspenc.c659
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiertexseqv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiffenc.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tmv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truemotion1.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truemotion2.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truespeech.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tscc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tscc2.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tta.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ttaenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/twinvq.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/twinvq.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/twinvqdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/txd.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ulti.c2
-rwxr-xr-xchromium/third_party/ffmpeg/libavcodec/utils.c635
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utvideodec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utvideoenc.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210dec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210enc.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210enc.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210x.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v308dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v308enc.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v408dec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v408enc.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v410dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v410enc.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi.h16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_hevc.c490
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h42
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vb.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vble.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1_block.c44
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1_loopfilter.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1_mc.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1dec.c192
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vcr1.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_h264.c154
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vda_vt_internal.h55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau.c38
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau.h7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c437
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/version.h124
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videodsp_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videotoolbox.c690
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videotoolbox.h126
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vima.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmdaudio.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmdvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmnc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbis_parser.c21
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbis_parser_internal.h40
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisdec.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vorbisenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp5.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp6.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8dsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp8dsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9.c327
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9_parser.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9dsp.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9dsp.h5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9dsp_template.c30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vqavideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wavpack.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wavpackenc.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/webp.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wma.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wma.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wma_freqs.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmadec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmaenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmaprodec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmavoice.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2dec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2enc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wnv1.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ws-snd1.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/Makefile29
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp.asm215
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp_init.c55
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/audiodsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/blockdsp.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/blockdsp_init.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/bswapdsp.asm23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dct32.asm3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/dct_init.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm84
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/diracdsp_yasm.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fft.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/flac_dsp_gpl.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/g722dsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevc_idct.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm49
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hevc_sao.asm10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/huffyuvdsp.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/idctdsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/jpeg2000dsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lossless_audiodsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/me_cmp.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/me_cmp_init.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/pngdsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/qpeldsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm37
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/svq1enc.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/v210.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/v210enc.asm4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm64
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/w64xmmtest.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xan.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xbmdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xbmenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xfaceenc.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xl.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xvididct.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xvididct.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xwddec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xwdenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xxan.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/y41pdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/y41penc.c13
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/yuv4dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/yuv4enc.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/zerocodec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/zmbv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/zmbvenc.c14
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/caca.c26
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_common.h6
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow.c34
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/dshow_pin.c12
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/fbdev_common.c2
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/iec61883.c1
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/lavfi.c11
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/libdc1394.c4
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/openal-dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/opengl_enc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l.c3
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/v4l2.c24
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/vfwcap.c2
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/xcbgrab.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/Makefile40
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_adelay.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aecho.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_afade.c467
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_alimiter.c361
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_amerge.c112
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_apad.c42
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aphaser.c124
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aresample.c38
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_astats.c162
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_asyncts.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_biquads.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_bs2b.c9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_channelmap.c14
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_chorus.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_compand.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_dcshift.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c740
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c128
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_flanger.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_ladspa.c19
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_pan.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_resample.c51
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_sidechaincompress.c338
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_volume.c16
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/allfilters.c35
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/asrc_abuffer.h91
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/asrc_flite.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/asrc_sine.c48
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/audio.c94
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/audio.h20
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avcodec.c137
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avcodec.h69
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c241
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c40
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_concat.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showcqt.c58
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c561
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c281
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c261
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfilter.c37
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfilter.h459
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c59
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffer.c179
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersink.c169
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersink.h57
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersrc.c122
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/buffersrc.h34
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/drawutils.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dualinput.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dualinput.h1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_drawgraph.c355
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_ebur128.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_perms.c18
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_reverse.c259
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/formats.c46
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/framesync.c9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/framesync.h7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/graphdump.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/graphparser.c23
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/internal.h56
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/psnr.h33
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/removegrain.h40
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/src_movie.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/ssim.h36
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/version.h29
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_aspect.c2
-rwxr-xr-xchromium/third_party/ffmpeg/libavfilter/vf_atadenoise.c420
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_blend.c453
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c54
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_crop.c55
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_deband.c312
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_decimate.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c64
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_delogo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_deshake.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c10
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_elbg.c59
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_eq.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_extractplanes.c17
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fade.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fieldmatch.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_find_rect.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_framepack.c9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_framerate.c732
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_fspp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_histeq.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_histogram.c210
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_idet.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_il.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_interlace.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_kerndeint.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut.c93
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_mcdeint.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c15
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_mpdecimate.c3
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_neighbor.c324
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_noise.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_ocr.c151
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_overlay.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_palettegen.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_paletteuse.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_psnr.c147
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_random.c144
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_removegrain.c660
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_rotate.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_sab.c58
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale.c171
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c30
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_smartblur.c62
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_spp.c104
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_ssim.c397
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_stack.c273
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_stereo3d.c303
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_super2xsai.c54
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_swapuv.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_thumbnail.c58
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_transpose.c48
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c50
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_uspp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vectorscope.c730
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vignette.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_w3fdif.c67
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_waveform.c1357
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_yadif.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/video.c47
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_cellauto.c11
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_life.c5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c166
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c221
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/Makefile8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/af_volume.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_idet.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_interlace.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr.asm140
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr_init.c39
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_pullup.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain.asm1218
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain_init.c88
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_spp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim.asm247
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim_init.c43
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/4xm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/Makefile12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aadec.c314
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ac3dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/act.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aiffenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/allformats.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/anm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/apetag.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/apngdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/apngenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aqtitledec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asf.h40
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asfdec_f.c (renamed from chromium/third_party/ffmpeg/libavformat/asfdec.c)215
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asfdec_o.c1755
-rw-r--r--chromium/third_party/ffmpeg/libavformat/asfenc.c32
-rw-r--r--chromium/third_party/ffmpeg/libavformat/assdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/async.c560
-rw-r--r--chromium/third_party/ffmpeg/libavformat/autorename_libavformat_flacdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/autorename_libavformat_options.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/autorename_libavformat_utils.c137
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avformat.h20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avidec.c33
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avienc.c28
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avio.c61
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avio.h50
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aviobuf.c21
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avisynth.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/brstm.c253
-rw-r--r--chromium/third_party/ffmpeg/libavformat/caf.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cafdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cafenc.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/concatdec.c110
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dnxhddec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dtsdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dump.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dv.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dxa.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/electronicarts.c137
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ffmdec.c13
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ffmenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/file.c161
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flac_picture.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flacdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flvdec.c22
-rw-r--r--chromium/third_party/ffmpeg/libavformat/format.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ftp.c358
-rw-r--r--chromium/third_party/ffmpeg/libavformat/gifdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hevc.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hls.c111
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hlsenc.c271
-rw-r--r--chromium/third_party/ffmpeg/libavformat/http.c229
-rw-r--r--chromium/third_party/ffmpeg/libavformat/id3v2.c20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/iff.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2.c11
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2.h7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2dec.c50
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2enc.c16
-rw-r--r--chromium/third_party/ffmpeg/libavformat/internal.h20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ipmovie.c56
-rw-r--r--chromium/third_party/ffmpeg/libavformat/isom.c18
-rw-r--r--chromium/third_party/ffmpeg/libavformat/isom.h8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ivfenc.c30
-rw-r--r--chromium/third_party/ffmpeg/libavformat/jacosubdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/jvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/latmenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/libsmbclient.c63
-rw-r--r--chromium/third_party/ffmpeg/libavformat/libssh.c196
-rw-r--r--chromium/third_party/ffmpeg/libavformat/lrcdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskadec.c16
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskaenc.c185
-rw-r--r--chromium/third_party/ffmpeg/libavformat/md5enc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/microdvddec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mlvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mov.c261
-rw-r--r--chromium/third_party/ffmpeg/libavformat/movenc.c70
-rw-r--r--chromium/third_party/ffmpeg/libavformat/movenc.h8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mp3dec.c141
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpc8.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpeg.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegts.c70
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegtsenc.c56
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpjpeg.c18
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpjpegdec.c55
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpl2dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpsubdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/msnwc_tcp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mux.c58
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxf.c15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxf.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfdec.c57
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxg.c14
-rw-r--r--chromium/third_party/ffmpeg/libavformat/network.c27
-rw-r--r--chromium/third_party/ffmpeg/libavformat/network.h20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nutdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nutenc.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggdec.c22
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggenc.c11
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsedirac.c11
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparseogm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsetheora.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/options.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/options_table.h8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/os_support.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/pjsdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/psxstr.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/qcp.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rawdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rawenc.c20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rdt.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/realtextdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/redspark.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riff.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riff.h7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riffdec.c37
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riffenc.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rmdec.c84
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmp.h3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmppkt.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtmpproto.c43
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_hevc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_latm.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_qt.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpenc_chain.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtpenc_jpeg.c43
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtsp.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/samidec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sdp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/segment.c19
-rw-r--r--chromium/third_party/ffmpeg/libavformat/spdifenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/srtdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/stldec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subtitles.c31
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subtitles.h5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subviewer1dec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subviewerdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/swfdec.c16
-rw-r--r--chromium/third_party/ffmpeg/libavformat/takdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tcp.c31
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tedcaptionsdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tee.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tls_gnutls.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/url.h27
-rw-r--r--chromium/third_party/ffmpeg/libavformat/utils.c137
-rw-r--r--chromium/third_party/ffmpeg/libavformat/version.h20
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vplayerdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wavdec.c29
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wavenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webmdashenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webvttdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webvttenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtvdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/xwma.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/yop.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/yuv4mpeg.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/yuv4mpegdec.c31
-rw-r--r--chromium/third_party/ffmpeg/libavformat/yuv4mpegenc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavresample/resample.c55
-rw-r--r--chromium/third_party/ffmpeg/libavresample/version.h8
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/audio_convert.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/audio_mix.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavresample/x86/dither.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/Makefile12
-rw-r--r--chromium/third_party/ffmpeg/libavutil/adler32.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/aes.c4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/arm/intmath.h8
-rw-r--r--chromium/third_party/ffmpeg/libavutil/audio_fifo.c19
-rw-r--r--chromium/third_party/ffmpeg/libavutil/audio_fifo.h16
-rw-r--r--chromium/third_party/ffmpeg/libavutil/audioconvert.h6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avstring.c4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avutil.h15
-rw-r--r--chromium/third_party/ffmpeg/libavutil/blowfish.c15
-rw-r--r--chromium/third_party/ffmpeg/libavutil/blowfish.h10
-rw-r--r--chromium/third_party/ffmpeg/libavutil/channel_layout.c39
-rw-r--r--chromium/third_party/ffmpeg/libavutil/channel_layout.h1
-rw-r--r--chromium/third_party/ffmpeg/libavutil/color_utils.c166
-rw-r--r--chromium/third_party/ffmpeg/libavutil/color_utils.h17
-rw-r--r--chromium/third_party/ffmpeg/libavutil/common.h22
-rw-r--r--chromium/third_party/ffmpeg/libavutil/cpu.h6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/crc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavutil/des.c13
-rw-r--r--chromium/third_party/ffmpeg/libavutil/des.h25
-rw-r--r--chromium/third_party/ffmpeg/libavutil/eval.c3
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fifo.c29
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fifo.h10
-rw-r--r--chromium/third_party/ffmpeg/libavutil/fixed_dsp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/float_dsp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/frame.c18
-rw-r--r--chromium/third_party/ffmpeg/libavutil/frame.h131
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hmac.c53
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hmac.h5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/imgutils.c4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/internal.h16
-rw-r--r--chromium/third_party/ffmpeg/libavutil/intmath.h27
-rw-r--r--chromium/third_party/ffmpeg/libavutil/log.h4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mathematics.c21
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mem.c20
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mem_internal.h45
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h418
-rw-r--r--chromium/third_party/ffmpeg/libavutil/old_pix_fmts.h177
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opt.c209
-rw-r--r--chromium/third_party/ffmpeg/libavutil/opt.h70
-rw-r--r--chromium/third_party/ffmpeg/libavutil/parseutils.c4
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixdesc.c951
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixdesc.h58
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixfmt.h160
-rw-r--r--chromium/third_party/ffmpeg/libavutil/rc4.c13
-rw-r--r--chromium/third_party/ffmpeg/libavutil/rc4.h25
-rw-r--r--chromium/third_party/ffmpeg/libavutil/reverse.c40
-rw-r--r--chromium/third_party/ffmpeg/libavutil/softfloat.c61
-rw-r--r--chromium/third_party/ffmpeg/libavutil/softfloat.h57
-rw-r--r--chromium/third_party/ffmpeg/libavutil/tea.c213
-rw-r--r--chromium/third_party/ffmpeg/libavutil/tea.h71
-rw-r--r--chromium/third_party/ffmpeg/libavutil/utils.c7
-rw-r--r--chromium/third_party/ffmpeg/libavutil/version.h63
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/asm.h5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/bswap.h2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/intmath.h7
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/pixelutils.asm2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/timer.h7
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm144
-rw-r--r--chromium/third_party/ffmpeg/libavutil/x86/x86util.asm29
-rw-r--r--chromium/third_party/ffmpeg/libavutil/xtea.c12
-rw-r--r--chromium/third_party/ffmpeg/libavutil/xtea.h10
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/postprocess.c3
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/postprocess.h6
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/postprocess_template.c2
-rw-r--r--chromium/third_party/ffmpeg/libpostproc/version.h8
-rw-r--r--chromium/third_party/ffmpeg/library.mak3
-rw-r--r--chromium/third_party/ffmpeg/libswresample/dither.c2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/options.c4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/soxr_resample.c34
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample-test.c2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.c15
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample_internal.h4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/audio_convert.asm12
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/rematrix.asm8
-rw-r--r--chromium/third_party/ffmpeg/libswresample/x86/resample.asm7
-rw-r--r--chromium/third_party/ffmpeg/libswscale/Makefile7
-rw-r--r--chromium/third_party/ffmpeg/libswscale/alphablend.c169
-rw-r--r--chromium/third_party/ffmpeg/libswscale/gamma.c72
-rw-r--r--chromium/third_party/ffmpeg/libswscale/hscale.c274
-rw-r--r--chromium/third_party/ffmpeg/libswscale/input.c36
-rw-r--r--chromium/third_party/ffmpeg/libswscale/options.c8
-rw-r--r--chromium/third_party/ffmpeg/libswscale/output.c158
-rw-r--r--chromium/third_party/ffmpeg/libswscale/ppc/yuv2rgb_altivec.c5
-rw-r--r--chromium/third_party/ffmpeg/libswscale/rgb2rgb.c2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/rgb2rgb.h2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c22
-rw-r--r--chromium/third_party/ffmpeg/libswscale/slice.c347
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale-test.c2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale.c139
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale.h22
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale_internal.h158
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c20
-rw-r--r--chromium/third_party/ffmpeg/libswscale/utils.c240
-rw-r--r--chromium/third_party/ffmpeg/libswscale/version.h13
-rw-r--r--chromium/third_party/ffmpeg/libswscale/vscale.c287
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c8
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/swscale.c32
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c30
-rw-r--r--chromium/third_party/ffmpeg/tools/crypto_bench.c97
-rw-r--r--chromium/third_party/ffmpeg/tools/graph2dot.c3
-rw-r--r--chromium/third_party/ffmpeg/tools/ismindex.c2
1414 files changed, 124636 insertions, 27161 deletions
diff --git a/chromium/third_party/ffmpeg/.travis.yml b/chromium/third_party/ffmpeg/.travis.yml
new file mode 100644
index 00000000000..5f3c533027f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/.travis.yml
@@ -0,0 +1,19 @@
+language: c
+sudo: false
+addons:
+ apt:
+ packages:
+ - yasm
+ - diffutils
+compiler:
+ - clang
+ - gcc
+cache:
+ directories:
+ - ffmpeg-samples
+script:
+ - mkdir -p ffmpeg-samples
+ - ./configure --samples=ffmpeg-samples --cc=$CC
+ - make -j 8
+ - make fate-rsync
+ - make check -j 8
diff --git a/chromium/third_party/ffmpeg/BUILD.gn b/chromium/third_party/ffmpeg/BUILD.gn
index 90c7752bbd1..5964a6a1e8f 100755
--- a/chromium/third_party/ffmpeg/BUILD.gn
+++ b/chromium/third_party/ffmpeg/BUILD.gn
@@ -90,6 +90,47 @@ if (is_win) {
}
}
+# gn orders flags on a target before flags from configs. The default config
+# adds -Wall, and these flags have to be after -Wall -- so they need to come
+# from a config and can't be on the target directly.
+config("ffmpegsumo_warnings") {
+ if (is_clang) {
+ cflags = [
+ "-Wno-absolute-value",
+ # ffmpeg uses its own deprecated functions.
+ "-Wno-deprecated-declarations",
+ # ffmpeg doesn't care about pointer constness.
+ "-Wno-incompatible-pointer-types",
+ # ffmpeg doesn't follow usual parentheses conventions.
+ "-Wno-logical-op-parentheses",
+ # ffmpeg doesn't care about pointer signedness.
+ "-Wno-parentheses",
+ # ffmpeg doesn't care about pointer signedness.
+ "-Wno-pointer-sign",
+ # ffmpeg doesn't believe in exhaustive switch statements.
+ "-Wno-switch",
+ # matroskadec.c has a "failed:" label that's only used if some
+ # CONFIG_ flags we don't set are set.
+ "-Wno-unused-label",
+ # ffmpeg has a lot of unused variables.
+ "-Wno-unused-variable",
+ # This fires on `av_assert0(!"valid element size")` in utils.c
+ "-Wno-string-conversion",
+ # This fires on `pos_min` and `pos_max` in
+ # autorename_libavformat_utils.c
+ "-Wno-sometimes-uninitialized",
+ # ffmpeg contains static functions in header files, which lead
+ # to unused function warnings. There are a few legit unused
+ # functions too.
+ "-Wno-unused-function",
+ ]
+ if (is_win) {
+ # This corresponds to /wd4273 below.
+ cflags += [ "-Wno-inconsistent-dllimport" ]
+ }
+ }
+}
+
source_set("ffmpeg_internal") {
sources = ffmpeg_c_sources + ffmpeg_gas_sources + [
"$platform_config_root/config.h",
@@ -118,7 +159,13 @@ source_set("ffmpeg_internal") {
deps = []
configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ # These must be after no_chromium_code for warning flags to be ordered
+ # correctly.
+ "//build/config/compiler:no_incompatible_pointer_warnings",
+ ":ffmpegsumo_warnings",
+ ]
# Since we are not often debugging FFmpeg, and performance is
# unacceptable without optimization, freeze the optimizations to -O2.
@@ -129,11 +176,7 @@ source_set("ffmpeg_internal") {
# In addition to the above reasons, /Od optimization won't remove symbols
# that are under "if (0)" style sections. Which lead to link time errors
# when for example it tries to link an ARM symbol on X86.
- if (is_debug) {
- configs -= [ "//build/config/compiler:no_optimize" ]
- } else {
- configs -= [ "//build/config/compiler:optimize" ]
- }
+ configs -= [ "//build/config/compiler:default_optimization" ]
if (is_win) {
# Setting the optimizations to 'speed' or to 'max' on Windows results in
# a lot of unresolved symbols. The only supported mode is 'size' (see
@@ -143,45 +186,6 @@ source_set("ffmpeg_internal") {
configs += [ "//build/config/compiler:optimize_max" ]
}
- # gn orders flags on a target before flags from configs. The default config
- # adds -Wall, and these flags have to be after -Wall -- so they need to come
- # from a config and can't be on the target directly.
- config("ffmpegsumo_warnings") {
- if (is_clang) {
- cflags = [
- "-Wno-absolute-value",
- # ffmpeg uses its own deprecated functions.
- "-Wno-deprecated-declarations",
- # ffmpeg doesn't care about pointer constness.
- "-Wno-incompatible-pointer-types",
- # ffmpeg doesn't follow usual parentheses conventions.
- "-Wno-logical-op-parentheses",
- # ffmpeg doesn't care about pointer signedness.
- "-Wno-parentheses",
- # ffmpeg doesn't care about pointer signedness.
- "-Wno-pointer-sign",
- # ffmpeg doesn't believe in exhaustive switch statements.
- "-Wno-switch",
- # matroskadec.c has a "failed:" label that's only used if some
- # CONFIG_ flags we don't set are set.
- "-Wno-unused-label",
- # ffmpeg has a lot of unused variables.
- "-Wno-unused-variable",
- # This fires on `av_assert0(!"valid element size")` in utils.c
- "-Wno-string-conversion",
- # This fires on `pos_min` and `pos_max` in
- # autorename_libavformat_utils.c
- "-Wno-sometimes-uninitialized",
- ]
- if (is_win) {
- # This corresponds to /wd4273 below.
- cflags += [ "-Wno-inconsistent-dllimport" ]
- }
- }
- }
-
- configs += [ ":ffmpegsumo_warnings" ]
-
if (is_posix) {
cflags += [
"-fPIC",
@@ -240,11 +244,11 @@ source_set("ffmpeg_internal") {
# Export all symbols when building as component.
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
}
-# TODO(ajwong): How to handle openbsd? Especially w/o the is_posix?
-# if (is_openbsd) {
-# # OpenBSD's gcc (4.2.1) does not support this flag
-# cflags -= [ "-fno-signed-zeros" ]
-# }
+ # TODO(ajwong): How to handle openbsd? Especially w/o the is_posix?
+ # if (is_openbsd) {
+ # # OpenBSD's gcc (4.2.1) does not support this flag
+ # cflags -= [ "-fno-signed-zeros" ]
+ # }
}
if (is_mac) {
if (is_component_ffmpeg) {
@@ -254,14 +258,14 @@ source_set("ffmpeg_internal") {
defines += [ "_DARWIN_C_SOURCE" ]
-# TODO(ajwong): What does this do in mac? There isn't anything in ffmpeg.gyp that
-# uses mac_real_dsym
-# ['mac_breakpad == 1', {
-# 'variables': {
-# # A real .dSYM is needed for dump_syms to operate on.
-# 'mac_real_dsym': 1,
-# },
-# }],
+ # TODO(ajwong): What does this do in mac? There isn't anything in ffmpeg.gyp that
+ # uses mac_real_dsym
+ # ['mac_breakpad == 1', {
+ # 'variables': {
+ # # A real .dSYM is needed for dump_syms to operate on.
+ # 'mac_real_dsym': 1,
+ # },
+ # }],
if (current_cpu != "x64") {
# This is needed because even though FFmpeg now builds
# with -fPIC, it's not quite a complete PIC build, only
@@ -269,7 +273,7 @@ source_set("ffmpeg_internal") {
# relocations for read-only segments for this target to be
# able to generated the shared library on Mac.
#
-#TODO(ajwong): Check if this can be current_cpu == "x86"
+ #TODO(ajwong): Check if this can be current_cpu == "x86"
# Note -read_only_relocs cannot be used in x86_64
#
# This makes Mark sad, but he's okay with it since it is
@@ -283,15 +287,14 @@ source_set("ffmpeg_internal") {
"-Wl,-read_only_relocs,suppress",
]
}
-# TODO(ajwong): How to handle SDKROOT?
-# 'libraries': [
-# '$(SDKROOT)/usr/lib/libz.dylib',
-# ],
-# TODO(ajwong): How to handle @loader_path?
-# 'xcode_settings': {
-# 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
-# }
- lib_dirs = [ target_gen_dir ]
+ # TODO(ajwong): How to handle SDKROOT?
+ # 'libraries': [
+ # '$(SDKROOT)/usr/lib/libz.dylib',
+ # ],
+ # TODO(ajwong): How to handle @loader_path?
+ # 'xcode_settings': {
+ # 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
+ # }
} else if (is_win) {
defines += [
"inline=__inline",
@@ -364,8 +367,7 @@ if (is_component_ffmpeg) {
} else if (is_win) {
# Windows component build needs the .def file to export ffmpeg symbols.
deps += [ ":ffmpeg_generate_def" ]
- ldflags +=
- [ "/DEF:" + rebase_path("$target_gen_dir/ffmpeg.def", root_build_dir) ]
+ sources = [ "$target_gen_dir/ffmpeg.def" ]
}
}
} else {
diff --git a/chromium/third_party/ffmpeg/CREDITS.chromium b/chromium/third_party/ffmpeg/CREDITS.chromium
new file mode 100644
index 00000000000..48916cf1462
--- /dev/null
+++ b/chromium/third_party/ffmpeg/CREDITS.chromium
@@ -0,0 +1,1023 @@
+#FFmpeg:
+
+Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
+or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
+files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
+FFmpeg.
+
+Some optional parts of FFmpeg are licensed under the GNU General Public License
+version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of
+these parts are used by default, you have to explicitly pass `--enable-gpl` to
+configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
+
+Specifically, the GPL parts of FFmpeg are:
+
+- libpostproc
+- optional x86 optimizations in the files
+ - `libavcodec/x86/flac_dsp_gpl.asm`
+ - `libavcodec/x86/idct_mmx.c`
+ - `libavfilter/x86/vf_removegrain.asm`
+- libutvideo encoding/decoding wrappers in
+ `libavcodec/libutvideo*.cpp`
+- the X11 grabber in `libavdevice/x11grab.c`
+- the swresample test app in
+ `libswresample/swresample-test.c`
+- the `texi2pod.pl` tool
+- the following filters in libavfilter:
+ - `f_ebur128.c`
+ - `vf_blackframe.c`
+ - `vf_boxblur.c`
+ - `vf_colormatrix.c`
+ - `vf_cover_rect.c`
+ - `vf_cropdetect.c`
+ - `vf_delogo.c`
+ - `vf_eq.c`
+ - `vf_find_rect.c`
+ - `vf_fspp.c`
+ - `vf_geq.c`
+ - `vf_histeq.c`
+ - `vf_hqdn3d.c`
+ - `vf_interlace.c`
+ - `vf_kerndeint.c`
+ - `vf_mcdeint.c`
+ - `vf_mpdecimate.c`
+ - `vf_owdenoise.c`
+ - `vf_perspective.c`
+ - `vf_phase.c`
+ - `vf_pp.c`
+ - `vf_pp7.c`
+ - `vf_pullup.c`
+ - `vf_sab.c`
+ - `vf_smartblur.c`
+ - `vf_repeatfields.c`
+ - `vf_spp.c`
+ - `vf_stereo3d.c`
+ - `vf_super2xsai.c`
+ - `vf_tinterlace.c`
+ - `vf_uspp.c`
+ - `vsrc_mptestsrc.c`
+
+Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
+the configure parameter `--enable-version3` will activate this licensing option
+for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts,
+`COPYING.GPLv3` to learn the exact legal terms that apply in this case.
+
+There are a handful of files under other licensing terms, namely:
+
+* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and
+ `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for
+ licensing details. Specifically note that you must credit the IJG in the
+ documentation accompanying your program if you only distribute executables.
+ You must also indicate any changes including additions and deletions to
+ those three files in the documentation.
+* `tests/reference.pnm` is under the expat license.
+
+
+external libraries
+==================
+
+FFmpeg can be combined with a number of external libraries, which sometimes
+affect the licensing of binaries resulting from the combination.
+
+compatible libraries
+--------------------
+
+The following libraries are under GPL:
+- frei0r
+- libcdio
+- librubberband
+- libutvideo
+- libvidstab
+- libx264
+- libx265
+- libxavs
+- libxvid
+
+When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
+passing `--enable-gpl` to configure.
+
+The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
+license is incompatible with the LGPL v2.1 and the GPL v2, but not with
+version 3 of those licenses. So to combine these libraries with FFmpeg, the
+license version needs to be upgraded by passing `--enable-version3` to configure.
+
+incompatible libraries
+----------------------
+
+The Fraunhofer AAC library, FAAC and aacplus are under licenses which
+are incompatible with the GPLv2 and v3. We do not know for certain if their
+licenses are compatible with the LGPL.
+If you wish to enable these libraries, 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 unredistributeable.
+
+
+********************************************************************************
+
+libavcodec/arm/vp8dsp_armv6.S
+
+VP8 ARMv6 optimisations
+
+Copyright (c) 2010 Google Inc.
+Copyright (c) 2010 Rob Clark <rob@ti.com>
+Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
+
+This file is part of FFmpeg.
+
+FFmpeg is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+FFmpeg is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with FFmpeg; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+This code was partially ported from libvpx, which uses this license:
+
+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.
+
+* Neither the name of Google nor the names of its contributors may
+be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+********************************************************************************
+
+libavformat/oggparsespeex.c
+
+Copyright (C) 2008 Reimar Döffinger
+
+ 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/faandct.c
+
+Floating point AAN DCT
+this implementation is based upon the IJG integer AAN DCT (see jfdctfst.c)
+
+Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
+Copyright (c) 2003 Roman Shaposhnik
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************************************
+
+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.
+
+********************************************************************************
+
+libswresample/swresample.h
+
+Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
+
+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
+
+This file is part of the Independent JPEG Group's software.
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and
+you, its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1994-1996, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to
+these conditions:
+(1) If any part of the source code for this software is distributed, then
+this README file must be included, with this copyright and no-warranty
+notice unaltered; and any additions, deletions, or changes to the original
+files must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work
+of the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG
+code, not just to the unmodified library. If you use our work, you ought
+to acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company
+name in advertising or publicity relating to this software or products
+derived from it. This software may be referred to only as "the Independent
+JPEG Group's software".
+
+We specifically permit and encourage the use of this software as the basis
+of commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+********************************************************************************
+
+libavcodec/fft_fixed_32.c
+libavcodec/fft_init_table.c
+libavcodec/fft_table.h
+libavcodec/mdct_fixed_32.c
+libavcodec/mips/aacdec_mips.c
+libavcodec/mips/aacdec_mips.h
+libavcodec/mips/aacpsdsp_mips.c
+libavcodec/mips/aacsbr_mips.c
+libavcodec/mips/aacsbr_mips.h
+libavcodec/mips/amrwbdec_mips.h
+libavcodec/mips/compute_antialias_fixed.h
+libavcodec/mips/compute_antialias_float.h
+libavcodec/mips/lsp_mips.h
+libavcodec/mips/sbrdsp_mips.c
+libavutil/fixed_dsp.c
+libavutil/fixed_dsp.h
+libavutil/mips/float_dsp_mips.c
+libavutil/mips/libm_mips.h
+libavutil/softfloat_tables.h
+
+Copyright (c) 2012
+MIPS Technologies, Inc., California.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Authors:
+Branimir Vasic (bvasic@mips.com)
+Darko Laus (darko@mips.com)
+Djordje Pesut (djordje@mips.com)
+Goran Cordasic (goran@mips.com)
+Nedeljko Babic (nedeljko.babic imgtec com)
+Mirjana Vulin (mvulin@mips.com)
+Stanislav Ocovaj (socovaj@mips.com)
+Zoran Lukic (zoranl@mips.com)
+
+********************************************************************************
+
+libavformat/oggdec.c
+libavformat/oggdec.h
+libavformat/oggparseogm.c
+libavformat/oggparsevorbis.c
+
+Copyright (C) 2005 Michael Ahlberg, MĂƒÂ¥ns RullgĂƒÂ¥rd
+
+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.
+
+********************************************************************************
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library 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.
+
+ This library 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 this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it! \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/Changelog b/chromium/third_party/ffmpeg/Changelog
index c93889a2bf5..77607e5905d 100644
--- a/chromium/third_party/ffmpeg/Changelog
+++ b/chromium/third_party/ffmpeg/Changelog
@@ -2,8 +2,52 @@ Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
+- DXV decoding
+- extrastereo filter
+- ocr filter
+- alimiter filter
+
+
+version 2.8:
- colorkey video filter
-- BFSTM demuxer
+- BFSTM/BCSTM demuxer
+- little-endian ADPCM_THP decoder
+- Hap decoder and encoder
+- DirectDraw Surface image/texture decoder
+- ssim filter
+- optional new ASF demuxer
+- showvolume filter
+- Many improvements to the JPEG 2000 decoder
+- Go2Meeting decoding support
+- adrawgraph audio and drawgraph video filter
+- removegrain video filter
+- Intel QSV-accelerated MPEG-2 video and HEVC encoding
+- Intel QSV-accelerated MPEG-2 video and HEVC decoding
+- Intel QSV-accelerated VC-1 video decoding
+- libkvazaar HEVC encoder
+- erosion, dilation, deflate and inflate video filters
+- Dynamic Audio Normalizer as dynaudnorm filter
+- Reverse video and areverse audio filter
+- Random filter
+- deband filter
+- AAC fixed-point decoding
+- sidechaincompress audio filter
+- bitstream filter for converting HEVC from MP4 to Annex B
+- acrossfade audio filter
+- allyuv and allrgb video sources
+- atadenoise video filter
+- OS X VideoToolbox support
+- aphasemeter filter
+- showfreqs filter
+- vectorscope filter
+- waveform filter
+- hstack and vstack filter
+- Support DNx100 (1440x1080@8)
+- VAAPI hevc hwaccel
+- VDPAU hevc hwaccel
+- framerate filter
+- Switched default encoders for webm to VP9 and Opus
+- Removed experimental flag from the JPEG 2000 encoder
version 2.7:
diff --git a/chromium/third_party/ffmpeg/LICENSE.md b/chromium/third_party/ffmpeg/LICENSE.md
index 0e2baffaf6a..4c4a84534a4 100644
--- a/chromium/third_party/ffmpeg/LICENSE.md
+++ b/chromium/third_party/ffmpeg/LICENSE.md
@@ -16,6 +16,7 @@ Specifically, the GPL parts of FFmpeg are:
- optional x86 optimizations in the files
- `libavcodec/x86/flac_dsp_gpl.asm`
- `libavcodec/x86/idct_mmx.c`
+ - `libavfilter/x86/vf_removegrain.asm`
- libutvideo encoding/decoding wrappers in
`libavcodec/libutvideo*.cpp`
- the X11 grabber in `libavdevice/x11grab.c`
@@ -84,6 +85,7 @@ compatible libraries
The following libraries are under GPL:
- frei0r
- libcdio
+- librubberband
- libutvideo
- libvidstab
- libx264
@@ -110,746 +112,3 @@ 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 unredistributeable.
-
-
-==================
-FULL LICENSE TEXTS
-==================
-
-VP8 ARMv6 optimisations
-
-Copyright (c) 2010 Google Inc.
-Copyright (c) 2010 Rob Clark <rob@ti.com>
-Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
-
-This file is part of FFmpeg.
-
-FFmpeg is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-FFmpeg is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with FFmpeg; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-This code was partially ported from libvpx, which uses this license:
-
-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.
-
- * Neither the name of Google nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==================
-
-Copyright (c) 2012
- MIPS Technologies, Inc., California.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-==================
-
-Floating point AAN DCT
-this implementation is based upon the IJG integer AAN DCT (see jfdctfst.c)
-
-Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
-Copyright (c) 2003 Roman Shaposhnik
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-==================
-
-Copyright (C) 2005 Michael Ahlberg, MĂ¥ns RullgĂ¥rd
-
-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.
-
-==================
-
-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.
-
-==================
-
-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.
-
-==================
-
-Copyright (C) 2008 Reimar Döffinger
-
-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.
-
-==================
-
-This file is part of the Independent JPEG Group's software.
-
-The authors make NO WARRANTY or representation, either express or implied,
-with respect to this software, its quality, accuracy, merchantability, or
-fitness for a particular purpose. This software is provided "AS IS", and
-you, its user, assume the entire risk as to its quality and accuracy.
-
-This software is copyright (C) 1991-1996, Thomas G. Lane.
-All Rights Reserved except as specified below.
-
-Permission is hereby granted to use, copy, modify, and distribute this
-software (or portions thereof) for any purpose, without fee, subject to
-these conditions:
-(1) If any part of the source code for this software is distributed, then
-this README file must be included, with this copyright and no-warranty
-notice unaltered; and any additions, deletions, or changes to the original
-files must be clearly indicated in accompanying documentation.
-(2) If only executable code is distributed, then the accompanying
-documentation must state that "this software is based in part on the work
-of the Independent JPEG Group".
-(3) Permission for use of this software is granted only if the user accepts
-full responsibility for any undesirable consequences; the authors accept
-NO LIABILITY for damages of any kind.
-
-These conditions apply to any software derived from or based on the IJG
-code, not just to the unmodified library. If you use our work, you ought
-to acknowledge us.
-
-Permission is NOT granted for the use of any IJG author's name or company
-name in advertising or publicity relating to this software or products
-derived from it. This software may be referred to only as "the Independent
-JPEG Group's software".
-
-We specifically permit and encourage the use of this software as the basis
-of commercial products, provided that all warranty or liability claims are
-assumed by the product vendor.
-
-==================
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library 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.
-
- This library 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 this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it! \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/MAINTAINERS b/chromium/third_party/ffmpeg/MAINTAINERS
index fa9e966f6ca..4a50430b146 100644
--- a/chromium/third_party/ffmpeg/MAINTAINERS
+++ b/chromium/third_party/ffmpeg/MAINTAINERS
@@ -14,7 +14,6 @@ patches and related discussions.
Project Leader
==============
-Michael Niedermayer
final design decisions
@@ -43,7 +42,7 @@ QuickTime faststart:
Miscellaneous Areas
===================
-documentation Stefano Sabatini, Mike Melanson, Timothy Gu
+documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Lou Logan
build system (configure, makefiles) Diego Biurrun, Mans Rullgard
project server ĂrpĂ¡d Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Lou Logan
presets Robert Swain
@@ -138,6 +137,7 @@ Codecs:
4xm.c Michael Niedermayer
8bps.c Roberto Togni
8svx.c Jaikrishnan Menon
+ aacenc*, aaccoder.c Rostislav Pehlivanov
aasc.c Kostya Shishkov
ac3* Justin Ruggles
alacenc.c Jaikrishnan Menon
@@ -171,6 +171,7 @@ Codecs:
dvbsubdec.c Anshul Maheshwari
dxa.c Kostya Shishkov
eacmv*, eaidct*, eat* Peter Ross
+ evrc* Paul B Mahol
exif.c, exif.h Thilo Borgmann
ffv1* Michael Niedermayer
ffwavesynth.c Nicolas George
@@ -200,6 +201,7 @@ Codecs:
libcelt_dec.c Nicolas George
libdirac* David Conrad
libgsm.c Michel Bardiaux
+ libkvazaar.c Arttu Ylä-Outinen
libopenjpeg.c Jaikrishnan Menon
libopenjpegenc.c Michael Bradshaw
libschroedinger* David Conrad
@@ -237,6 +239,7 @@ Codecs:
qdm2.c, qdm2data.h Roberto Togni, Benjamin Larsson
qdrw.c Kostya Shishkov
qpeg.c Kostya Shishkov
+ qsv* Ivan Uskov
qtrle.c Mike Melanson
ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni
resample2.c Michael Niedermayer
@@ -298,11 +301,12 @@ Codecs:
Hardware acceleration:
crystalhd.c Philip Langdale
- dxva2* Laurent Aimar
+ dxva2* Hendrik Leppkes, Laurent Aimar
libstagefright.cpp Mohamed Naufal
vaapi* Gwenole Beauchesne
vda* Sebastien Zwickert
- vdpau* Carl Eugen Hoyos
+ vdpau* Philip Langdale, Carl Eugen Hoyos
+ videotoolbox* Sebastien Zwickert
libavdevice
@@ -334,6 +338,7 @@ Generic parts:
graphdump.c Nicolas George
Filters:
+ f_drawgraph.c Paul B Mahol
af_adelay.c Paul B Mahol
af_aecho.c Paul B Mahol
af_afade.c Paul B Mahol
@@ -344,15 +349,21 @@ Filters:
af_astreamsync.c Nicolas George
af_atempo.c Pavel Koshevoy
af_biquads.c Paul B Mahol
+ af_chorus.c Paul B Mahol
af_compand.c Paul B Mahol
af_ladspa.c Paul B Mahol
af_pan.c Nicolas George
+ af_sidechaincompress.c Paul B Mahol
af_silenceremove.c Paul B Mahol
+ avf_aphasemeter.c Paul B Mahol
avf_avectorscope.c Paul B Mahol
avf_showcqt.c Muhammad Faiz
vf_blend.c Paul B Mahol
+ vf_colorchannelmixer.c Paul B Mahol
vf_colorbalance.c Paul B Mahol
vf_colorkey.c Timo Rothenpieler
+ vf_colorlevels.c Paul B Mahol
+ vf_deband.c Paul B Mahol
vf_dejudder.c Nicholas Robbins
vf_delogo.c Jean Delvare (CC <khali@linux-fr.org>)
vf_drawbox.c/drawgrid Andrey Utkin
@@ -363,12 +374,16 @@ Filters:
vf_il.c Paul B Mahol
vf_lenscorrection.c Daniel Oberhoff
vf_mergeplanes.c Paul B Mahol
+ vf_neighbor.c Paul B Mahol
vf_psnr.c Paul B Mahol
+ vf_random.c Paul B Mahol
vf_scale.c Michael Niedermayer
vf_separatefields.c Paul B Mahol
+ vf_ssim.c Paul B Mahol
vf_stereo3d.c Paul B Mahol
vf_telecine.c Paul B Mahol
vf_yadif.c Michael Niedermayer
+ vf_zoompan.c Paul B Mahol
Sources:
vsrc_mandelbrot.c Michael Niedermayer
@@ -385,6 +400,7 @@ Generic parts:
Muxers/Demuxers:
4xm.c Mike Melanson
+ aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
adtsenc.c Robert Swain
afc.c Paul B Mahol
aiffdec.c Baptiste Coudurier, Matthieu Bouron
@@ -502,6 +518,7 @@ Muxers/Demuxers:
wvenc.c Paul B Mahol
Protocols:
+ async.c Zhang Rui
bluray.c Petri Hintukainen
ftp.c Lukasz Marek
http.c Ronald S. Bultje
@@ -537,7 +554,7 @@ Amiga / PowerPC Colin Ward
Linux / PowerPC Luca Barbato
Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa
-Windows MSVC Matthew Oliver
+Windows MSVC Matthew Oliver, Hendrik Leppkes
Windows ICL Matthew Oliver
ADI/Blackfin DSP Marc Hoffman
Sparc Roman Shaposhnik
@@ -547,11 +564,11 @@ x86 Michael Niedermayer
Releases
========
+2.8 Michael Niedermayer
2.7 Michael Niedermayer
2.6 Michael Niedermayer
2.5 Michael Niedermayer
2.4 Michael Niedermayer
-2.2 Michael Niedermayer
If you want to maintain an older release, please contact us
@@ -582,6 +599,7 @@ Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
+Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E
Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
diff --git a/chromium/third_party/ffmpeg/Makefile b/chromium/third_party/ffmpeg/Makefile
index fd59628a428..b0ab3ed0cc5 100644
--- a/chromium/third_party/ffmpeg/Makefile
+++ b/chromium/third_party/ffmpeg/Makefile
@@ -31,7 +31,10 @@ $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_o
OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
-OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
+ifndef CONFIG_VIDEOTOOLBOX
+OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
+endif
+OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
OBJS-ffserver += ffserver_config.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
@@ -60,6 +63,7 @@ include $(SRC_PATH)/common.mak
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
+FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
all: $(AVPROGS)
@@ -81,7 +85,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS \
- LOONGSON3-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
+ MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
define RESET
$(1) :=
@@ -175,7 +179,7 @@ clean::
distclean::
$(RM) $(DISTCLEANSUFFIXES)
- $(RM) config.* .config libavutil/avconfig.h .version version.h libavutil/ffversion.h libavcodec/codec_names.h
+ $(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h
config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
diff --git a/chromium/third_party/ffmpeg/README.chromium b/chromium/third_party/ffmpeg/README.chromium
index 6d9cd00165a..1170adcb25a 100644
--- a/chromium/third_party/ffmpeg/README.chromium
+++ b/chromium/third_party/ffmpeg/README.chromium
@@ -1,7 +1,7 @@
Name: ffmpeg
URL: http://ffmpeg.org/
License: LGPL 2.1
-License File: LICENSE.md
+License File: CREDITS.chromium
Upstream Git: git://source.ffmpeg.org/ffmpeg.git
Last Upstream Merge: 98b95e746668a67250baa5533d61dda7aa26bff5, June 17 2015
diff --git a/chromium/third_party/ffmpeg/RELEASE b/chromium/third_party/ffmpeg/RELEASE
index 3359b98d07c..847967f1eb1 100644
--- a/chromium/third_party/ffmpeg/RELEASE
+++ b/chromium/third_party/ffmpeg/RELEASE
@@ -1 +1 @@
-2.6.git
+2.8.git
diff --git a/chromium/third_party/ffmpeg/arch.mak b/chromium/third_party/ffmpeg/arch.mak
index 4508c2a242d..98fde4a3ee5 100644
--- a/chromium/third_party/ffmpeg/arch.mak
+++ b/chromium/third_party/ffmpeg/arch.mak
@@ -8,7 +8,7 @@ OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS) $(MIPSDSPR1-OBJS-yes)
OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
OBJS-$(HAVE_MSA) += $(MSA-OBJS) $(MSA-OBJS-yes)
-OBJS-$(HAVE_LOONGSON3) += $(LOONGSON3-OBJS) $(LOONGSON3-OBJS-yes)
+OBJS-$(HAVE_MMI) += $(MMI-OBJS) $(MMI-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/config.h
index ba43c1ae677..f3fe8cf3a2a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/ssd/blink3/src/third_party/android_tools/ndk/platforms/android-16/arch-arm --cross-prefix=/ssd/blink3/src/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --target-os=linux --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='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=softfp' --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
+#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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-arm --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --target-os=linux --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='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=softfp' --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 0
#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 0
#define CONFIG_VP8_PARSER 0
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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
new file mode 100644
index 00000000000..d6f3843286d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-21/arch-arm64 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- --target-os=linux --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 1
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 1
+#define HAVE_NEON 1
+#define HAVE_VFP 1
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 1
+#define HAVE_NEON_EXTERNAL 1
+#define HAVE_VFP_EXTERNAL 1
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 1
+#define HAVE_NEON_INLINE 1
+#define HAVE_VFP_INLINE 1
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 1
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 1
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 1
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 1
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 1
+#define CONFIG_MPEGAUDIODSP 1
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 1
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 1
+#define CONFIG_MP3_DEMUXER 1
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 1
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..5805969f1b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75760-g382b031"
+#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.asm
new file mode 100644
index 00000000000..1b3ca66fde2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.asm
@@ -0,0 +1,1981 @@
+%define ARCH_AARCH64 0
+%define ARCH_ALPHA 0
+%define ARCH_ARM 0
+%define ARCH_AVR32 0
+%define ARCH_AVR32_AP 0
+%define ARCH_AVR32_UC 0
+%define ARCH_BFIN 0
+%define ARCH_IA64 0
+%define ARCH_M68K 0
+%define ARCH_MIPS 0
+%define ARCH_MIPS64 0
+%define ARCH_PARISC 0
+%define ARCH_PPC 0
+%define ARCH_PPC64 0
+%define ARCH_S390 0
+%define ARCH_SH4 0
+%define ARCH_SPARC 0
+%define ARCH_SPARC64 0
+%define ARCH_TILEGX 0
+%define ARCH_TILEPRO 0
+%define ARCH_TOMI 0
+%define ARCH_X86 1
+%define ARCH_X86_32 1
+%define ARCH_X86_64 0
+%define HAVE_ARMV5TE 0
+%define HAVE_ARMV6 0
+%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
+%define HAVE_NEON 0
+%define HAVE_VFP 0
+%define HAVE_VFPV3 0
+%define HAVE_SETEND 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 0
+%define HAVE_LDBRX 0
+%define HAVE_POWER8 0
+%define HAVE_PPC4XX 0
+%define HAVE_VSX 0
+%define HAVE_AMD3DNOW 1
+%define HAVE_AMD3DNOWEXT 1
+%define HAVE_AVX 1
+%define HAVE_AVX2 1
+%define HAVE_FMA3 1
+%define HAVE_FMA4 1
+%define HAVE_MMX 1
+%define HAVE_MMXEXT 1
+%define HAVE_SSE 1
+%define HAVE_SSE2 1
+%define HAVE_SSE3 1
+%define HAVE_SSE4 1
+%define HAVE_SSE42 1
+%define HAVE_SSSE3 1
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
+%define HAVE_MIPSFPU 0
+%define HAVE_MIPS32R2 0
+%define HAVE_MIPS32R5 0
+%define HAVE_MIPS64R6 0
+%define HAVE_MIPSDSPR1 0
+%define HAVE_MIPSDSPR2 0
+%define HAVE_MSA 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
+%define HAVE_ARMV5TE_EXTERNAL 0
+%define HAVE_ARMV6_EXTERNAL 0
+%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
+%define HAVE_NEON_EXTERNAL 0
+%define HAVE_VFP_EXTERNAL 0
+%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_SETEND_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_POWER8_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
+%define HAVE_VSX_EXTERNAL 0
+%define HAVE_AMD3DNOW_EXTERNAL 1
+%define HAVE_AMD3DNOWEXT_EXTERNAL 1
+%define HAVE_AVX_EXTERNAL 1
+%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
+%define HAVE_FMA4_EXTERNAL 1
+%define HAVE_MMX_EXTERNAL 1
+%define HAVE_MMXEXT_EXTERNAL 1
+%define HAVE_SSE_EXTERNAL 1
+%define HAVE_SSE2_EXTERNAL 1
+%define HAVE_SSE3_EXTERNAL 1
+%define HAVE_SSE4_EXTERNAL 1
+%define HAVE_SSE42_EXTERNAL 1
+%define HAVE_SSSE3_EXTERNAL 1
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
+%define HAVE_MIPSFPU_EXTERNAL 0
+%define HAVE_MIPS32R2_EXTERNAL 0
+%define HAVE_MIPS32R5_EXTERNAL 0
+%define HAVE_MIPS64R6_EXTERNAL 0
+%define HAVE_MIPSDSPR1_EXTERNAL 0
+%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
+%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
+%define HAVE_ARMV5TE_INLINE 0
+%define HAVE_ARMV6_INLINE 0
+%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
+%define HAVE_NEON_INLINE 0
+%define HAVE_VFP_INLINE 0
+%define HAVE_VFPV3_INLINE 0
+%define HAVE_SETEND_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_POWER8_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
+%define HAVE_VSX_INLINE 0
+%define HAVE_AMD3DNOW_INLINE 1
+%define HAVE_AMD3DNOWEXT_INLINE 1
+%define HAVE_AVX_INLINE 1
+%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
+%define HAVE_FMA4_INLINE 1
+%define HAVE_MMX_INLINE 1
+%define HAVE_MMXEXT_INLINE 1
+%define HAVE_SSE_INLINE 1
+%define HAVE_SSE2_INLINE 1
+%define HAVE_SSE3_INLINE 1
+%define HAVE_SSE4_INLINE 1
+%define HAVE_SSE42_INLINE 1
+%define HAVE_SSSE3_INLINE 1
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
+%define HAVE_MIPSFPU_INLINE 0
+%define HAVE_MIPS32R2_INLINE 0
+%define HAVE_MIPS32R5_INLINE 0
+%define HAVE_MIPS64R6_INLINE 0
+%define HAVE_MIPSDSPR1_INLINE 0
+%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
+%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_SIMD_ALIGN_16 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+%define HAVE_INLINE_ASM 1
+%define HAVE_SYMVER 0
+%define HAVE_YASM 1
+%define HAVE_BIGENDIAN 0
+%define HAVE_FAST_UNALIGNED 1
+%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
+%define HAVE_DLFCN_H 1
+%define HAVE_D3D11_H 0
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UDPLITE_H 0
+%define HAVE_UNISTD_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
+%define HAVE_INTRINSICS_NEON 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
+%define HAVE_COSF 1
+%define HAVE_ERF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 0
+%define HAVE_LOG2F 0
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 0
+%define HAVE_CLOCK_GETTIME 1
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 0
+%define HAVE_COTASKMEMFREE 0
+%define HAVE_CRYPTGENRANDOM 0
+%define HAVE_DLOPEN 1
+%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
+%define HAVE_FORK 1
+%define HAVE_GETADDRINFO 0
+%define HAVE_GETHRTIME 0
+%define HAVE_GETOPT 1
+%define HAVE_GETPROCESSAFFINITYMASK 0
+%define HAVE_GETPROCESSMEMORYINFO 0
+%define HAVE_GETPROCESSTIMES 0
+%define HAVE_GETRUSAGE 1
+%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
+%define HAVE_GETTIMEOFDAY 1
+%define HAVE_GLOB 0
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_GMTIME_R 1
+%define HAVE_INET_ATON 0
+%define HAVE_ISATTY 1
+%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+%define HAVE_KBHIT 0
+%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
+%define HAVE_LZO1X_999_COMPRESS 0
+%define HAVE_MACH_ABSOLUTE_TIME 0
+%define HAVE_MAPVIEWOFFILE 0
+%define HAVE_MEMALIGN 1
+%define HAVE_MKSTEMP 1
+%define HAVE_MMAP 1
+%define HAVE_MPROTECT 1
+%define HAVE_NANOSLEEP 1
+%define HAVE_PEEKNAMEDPIPE 0
+%define HAVE_POSIX_MEMALIGN 1
+%define HAVE_PTHREAD_CANCEL 0
+%define HAVE_SCHED_GETAFFINITY 0
+%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
+%define HAVE_SETMODE 0
+%define HAVE_SETRLIMIT 1
+%define HAVE_SLEEP 0
+%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_AS_DN_DIRECTIVE 0
+%define HAVE_AS_FUNC 0
+%define HAVE_AS_OBJECT_ARCH 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_CONDITION_VARIABLE_PTR 0
+%define HAVE_SOCKLEN_T 0
+%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+%define HAVE_STRUCT_IP_MREQ_SOURCE 0
+%define HAVE_STRUCT_IPV6_MREQ 0
+%define HAVE_STRUCT_POLLFD 0
+%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+%define HAVE_STRUCT_SOCKADDR_IN6 0
+%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+%define HAVE_STRUCT_SOCKADDR_STORAGE 0
+%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_TEXI2HTML 0
+%define HAVE_THREADS 1
+%define HAVE_VAAPI_X11 0
+%define HAVE_VDPAU_X11 0
+%define HAVE_XLIB 0
+%define CONFIG_BSFS 0
+%define CONFIG_DECODERS 1
+%define CONFIG_DEMUXERS 1
+%define CONFIG_ENCODERS 0
+%define CONFIG_FILTERS 0
+%define CONFIG_HWACCELS 0
+%define CONFIG_INDEVS 0
+%define CONFIG_MUXERS 0
+%define CONFIG_OUTDEVS 0
+%define CONFIG_PARSERS 1
+%define CONFIG_PROTOCOLS 0
+%define CONFIG_DOC 0
+%define CONFIG_HTMLPAGES 0
+%define CONFIG_MANPAGES 0
+%define CONFIG_PODPAGES 0
+%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+%define CONFIG_DECODING_ENCODING_EXAMPLE 1
+%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_EXTRACT_MVS_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+%define CONFIG_METADATA_EXAMPLE 1
+%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_QSVDEC_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
+%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+%define CONFIG_SCALING_VIDEO_EXAMPLE 0
+%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
+%define CONFIG_AVISYNTH 0
+%define CONFIG_BZLIB 0
+%define CONFIG_CRYSTALHD 0
+%define CONFIG_DECKLINK 0
+%define CONFIG_FREI0R 0
+%define CONFIG_GNUTLS 0
+%define CONFIG_ICONV 0
+%define CONFIG_LADSPA 0
+%define CONFIG_LIBAACPLUS 0
+%define CONFIG_LIBASS 0
+%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
+%define CONFIG_LIBCACA 0
+%define CONFIG_LIBCDIO 0
+%define CONFIG_LIBCELT 0
+%define CONFIG_LIBDC1394 0
+%define CONFIG_LIBDCADEC 0
+%define CONFIG_LIBFAAC 0
+%define CONFIG_LIBFDK_AAC 0
+%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
+%define CONFIG_LIBFREETYPE 0
+%define CONFIG_LIBFRIBIDI 0
+%define CONFIG_LIBGME 0
+%define CONFIG_LIBGSM 0
+%define CONFIG_LIBIEC61883 0
+%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
+%define CONFIG_LIBMFX 0
+%define CONFIG_LIBMODPLUG 0
+%define CONFIG_LIBMP3LAME 0
+%define CONFIG_LIBNUT 0
+%define CONFIG_LIBOPENCORE_AMRNB 0
+%define CONFIG_LIBOPENCORE_AMRWB 0
+%define CONFIG_LIBOPENCV 0
+%define CONFIG_LIBOPENH264 0
+%define CONFIG_LIBOPENJPEG 0
+%define CONFIG_LIBOPUS 0
+%define CONFIG_LIBPULSE 0
+%define CONFIG_LIBQUVI 0
+%define CONFIG_LIBRTMP 0
+%define CONFIG_LIBSCHROEDINGER 0
+%define CONFIG_LIBSHINE 0
+%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
+%define CONFIG_LIBSOXR 0
+%define CONFIG_LIBSPEEX 0
+%define CONFIG_LIBSSH 0
+%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
+%define CONFIG_LIBTHEORA 0
+%define CONFIG_LIBTWOLAME 0
+%define CONFIG_LIBUTVIDEO 0
+%define CONFIG_LIBV4L2 0
+%define CONFIG_LIBVIDSTAB 0
+%define CONFIG_LIBVO_AACENC 0
+%define CONFIG_LIBVO_AMRWBENC 0
+%define CONFIG_LIBVORBIS 0
+%define CONFIG_LIBVPX 0
+%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
+%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
+%define CONFIG_LIBXAVS 0
+%define CONFIG_LIBXCB 0
+%define CONFIG_LIBXCB_SHM 0
+%define CONFIG_LIBXCB_SHAPE 0
+%define CONFIG_LIBXCB_XFIXES 0
+%define CONFIG_LIBXVID 0
+%define CONFIG_LIBZMQ 0
+%define CONFIG_LIBZVBI 0
+%define CONFIG_LZMA 0
+%define CONFIG_MMAL 0
+%define CONFIG_NVENC 0
+%define CONFIG_OPENAL 0
+%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
+%define CONFIG_OPENSSL 0
+%define CONFIG_SDL 0
+%define CONFIG_SECURETRANSPORT 0
+%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
+%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 0
+%define CONFIG_SMALL 1
+%define CONFIG_STATIC 1
+%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_D3D11VA 0
+%define CONFIG_DXVA2 0
+%define CONFIG_VAAPI 0
+%define CONFIG_VDA 0
+%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
+%define CONFIG_AVCODEC 1
+%define CONFIG_AVDEVICE 0
+%define CONFIG_AVFILTER 0
+%define CONFIG_AVFORMAT 1
+%define CONFIG_AVRESAMPLE 0
+%define CONFIG_AVUTIL 1
+%define CONFIG_POSTPROC 0
+%define CONFIG_SWRESAMPLE 0
+%define CONFIG_SWSCALE 0
+%define CONFIG_FFPLAY 0
+%define CONFIG_FFPROBE 0
+%define CONFIG_FFSERVER 0
+%define CONFIG_FFMPEG 0
+%define CONFIG_DCT 1
+%define CONFIG_DWT 0
+%define CONFIG_ERROR_RESILIENCE 0
+%define CONFIG_FAAN 1
+%define CONFIG_FAST_UNALIGNED 1
+%define CONFIG_FFT 1
+%define CONFIG_LSP 0
+%define CONFIG_LZO 0
+%define CONFIG_MDCT 1
+%define CONFIG_PIXELUTILS 0
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+%define CONFIG_MEMALIGN_HACK 0
+%define CONFIG_MEMORY_POISONING 0
+%define CONFIG_NEON_CLOBBER_TEST 0
+%define CONFIG_PIC 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
+%define CONFIG_THUMB 0
+%define CONFIG_VALGRIND_BACKTRACE 0
+%define CONFIG_XMM_CLOBBER_TEST 0
+%define CONFIG_AANDCTTABLES 0
+%define CONFIG_AC3DSP 0
+%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_AUDIODSP 0
+%define CONFIG_BLOCKDSP 0
+%define CONFIG_BSWAPDSP 0
+%define CONFIG_CABAC 0
+%define CONFIG_DVPROFILE 0
+%define CONFIG_EXIF 0
+%define CONFIG_FAANDCT 0
+%define CONFIG_FAANIDCT 0
+%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
+%define CONFIG_FMTCONVERT 0
+%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
+%define CONFIG_GCRYPT 0
+%define CONFIG_GMP 0
+%define CONFIG_GOLOMB 1
+%define CONFIG_GPLV3 0
+%define CONFIG_H263DSP 0
+%define CONFIG_H264CHROMA 0
+%define CONFIG_H264DSP 0
+%define CONFIG_H264PRED 0
+%define CONFIG_H264QPEL 0
+%define CONFIG_HPELDSP 0
+%define CONFIG_HUFFMAN 0
+%define CONFIG_HUFFYUVDSP 0
+%define CONFIG_HUFFYUVENCDSP 0
+%define CONFIG_IDCTDSP 0
+%define CONFIG_IIRFILTER 0
+%define CONFIG_IMDCT15 1
+%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
+%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
+%define CONFIG_LGPLV3 0
+%define CONFIG_LLAUDDSP 0
+%define CONFIG_LLVIDDSP 0
+%define CONFIG_LPC 0
+%define CONFIG_LZF 0
+%define CONFIG_ME_CMP 0
+%define CONFIG_MPEG_ER 0
+%define CONFIG_MPEGAUDIO 1
+%define CONFIG_MPEGAUDIODSP 1
+%define CONFIG_MPEGVIDEO 0
+%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
+%define CONFIG_PIXBLOCKDSP 0
+%define CONFIG_QPELDSP 0
+%define CONFIG_QSV 0
+%define CONFIG_QSVDEC 0
+%define CONFIG_QSVENC 0
+%define CONFIG_RANGECODER 0
+%define CONFIG_RIFFDEC 1
+%define CONFIG_RIFFENC 0
+%define CONFIG_RTPDEC 0
+%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
+%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
+%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
+%define CONFIG_TPELDSP 0
+%define CONFIG_VIDEODSP 0
+%define CONFIG_VP3DSP 0
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 0
+%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
+%define CONFIG_AAC_ADTSTOASC_BSF 0
+%define CONFIG_CHOMP_BSF 0
+%define CONFIG_DUMP_EXTRADATA_BSF 0
+%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+%define CONFIG_IMX_DUMP_HEADER_BSF 0
+%define CONFIG_MJPEG2JPEG_BSF 0
+%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+%define CONFIG_MOV2TEXTSUB_BSF 0
+%define CONFIG_NOISE_BSF 0
+%define CONFIG_REMOVE_EXTRADATA_BSF 0
+%define CONFIG_TEXT2MOVSUB_BSF 0
+%define CONFIG_AASC_DECODER 0
+%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
+%define CONFIG_AMV_DECODER 0
+%define CONFIG_ANM_DECODER 0
+%define CONFIG_ANSI_DECODER 0
+%define CONFIG_APNG_DECODER 0
+%define CONFIG_ASV1_DECODER 0
+%define CONFIG_ASV2_DECODER 0
+%define CONFIG_AURA_DECODER 0
+%define CONFIG_AURA2_DECODER 0
+%define CONFIG_AVRP_DECODER 0
+%define CONFIG_AVRN_DECODER 0
+%define CONFIG_AVS_DECODER 0
+%define CONFIG_AVUI_DECODER 0
+%define CONFIG_AYUV_DECODER 0
+%define CONFIG_BETHSOFTVID_DECODER 0
+%define CONFIG_BFI_DECODER 0
+%define CONFIG_BINK_DECODER 0
+%define CONFIG_BMP_DECODER 0
+%define CONFIG_BMV_VIDEO_DECODER 0
+%define CONFIG_BRENDER_PIX_DECODER 0
+%define CONFIG_C93_DECODER 0
+%define CONFIG_CAVS_DECODER 0
+%define CONFIG_CDGRAPHICS_DECODER 0
+%define CONFIG_CDXL_DECODER 0
+%define CONFIG_CINEPAK_DECODER 0
+%define CONFIG_CLJR_DECODER 0
+%define CONFIG_CLLC_DECODER 0
+%define CONFIG_COMFORTNOISE_DECODER 0
+%define CONFIG_CPIA_DECODER 0
+%define CONFIG_CSCD_DECODER 0
+%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
+%define CONFIG_DFA_DECODER 0
+%define CONFIG_DIRAC_DECODER 0
+%define CONFIG_DNXHD_DECODER 0
+%define CONFIG_DPX_DECODER 0
+%define CONFIG_DSICINVIDEO_DECODER 0
+%define CONFIG_DVVIDEO_DECODER 0
+%define CONFIG_DXA_DECODER 0
+%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
+%define CONFIG_EACMV_DECODER 0
+%define CONFIG_EAMAD_DECODER 0
+%define CONFIG_EATGQ_DECODER 0
+%define CONFIG_EATGV_DECODER 0
+%define CONFIG_EATQI_DECODER 0
+%define CONFIG_EIGHTBPS_DECODER 0
+%define CONFIG_EIGHTSVX_EXP_DECODER 0
+%define CONFIG_EIGHTSVX_FIB_DECODER 0
+%define CONFIG_ESCAPE124_DECODER 0
+%define CONFIG_ESCAPE130_DECODER 0
+%define CONFIG_EXR_DECODER 0
+%define CONFIG_FFV1_DECODER 0
+%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
+%define CONFIG_FLASHSV_DECODER 0
+%define CONFIG_FLASHSV2_DECODER 0
+%define CONFIG_FLIC_DECODER 0
+%define CONFIG_FLV_DECODER 0
+%define CONFIG_FOURXM_DECODER 0
+%define CONFIG_FRAPS_DECODER 0
+%define CONFIG_FRWU_DECODER 0
+%define CONFIG_G2M_DECODER 0
+%define CONFIG_GIF_DECODER 0
+%define CONFIG_H261_DECODER 0
+%define CONFIG_H263_DECODER 0
+%define CONFIG_H263I_DECODER 0
+%define CONFIG_H263P_DECODER 0
+%define CONFIG_H264_DECODER 0
+%define CONFIG_H264_CRYSTALHD_DECODER 0
+%define CONFIG_H264_MMAL_DECODER 0
+%define CONFIG_H264_QSV_DECODER 0
+%define CONFIG_H264_VDA_DECODER 0
+%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
+%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
+%define CONFIG_HNM4_VIDEO_DECODER 0
+%define CONFIG_HQ_HQA_DECODER 0
+%define CONFIG_HQX_DECODER 0
+%define CONFIG_HUFFYUV_DECODER 0
+%define CONFIG_IDCIN_DECODER 0
+%define CONFIG_IFF_BYTERUN1_DECODER 0
+%define CONFIG_IFF_ILBM_DECODER 0
+%define CONFIG_INDEO2_DECODER 0
+%define CONFIG_INDEO3_DECODER 0
+%define CONFIG_INDEO4_DECODER 0
+%define CONFIG_INDEO5_DECODER 0
+%define CONFIG_INTERPLAY_VIDEO_DECODER 0
+%define CONFIG_JPEG2000_DECODER 0
+%define CONFIG_JPEGLS_DECODER 0
+%define CONFIG_JV_DECODER 0
+%define CONFIG_KGV1_DECODER 0
+%define CONFIG_KMVC_DECODER 0
+%define CONFIG_LAGARITH_DECODER 0
+%define CONFIG_LOCO_DECODER 0
+%define CONFIG_MDEC_DECODER 0
+%define CONFIG_MIMIC_DECODER 0
+%define CONFIG_MJPEG_DECODER 0
+%define CONFIG_MJPEGB_DECODER 0
+%define CONFIG_MMVIDEO_DECODER 0
+%define CONFIG_MOTIONPIXELS_DECODER 0
+%define CONFIG_MPEG_XVMC_DECODER 0
+%define CONFIG_MPEG1VIDEO_DECODER 0
+%define CONFIG_MPEG2VIDEO_DECODER 0
+%define CONFIG_MPEG4_DECODER 0
+%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG4_VDPAU_DECODER 0
+%define CONFIG_MPEGVIDEO_DECODER 0
+%define CONFIG_MPEG_VDPAU_DECODER 0
+%define CONFIG_MPEG1_VDPAU_DECODER 0
+%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
+%define CONFIG_MSA1_DECODER 0
+%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MSMPEG4V1_DECODER 0
+%define CONFIG_MSMPEG4V2_DECODER 0
+%define CONFIG_MSMPEG4V3_DECODER 0
+%define CONFIG_MSRLE_DECODER 0
+%define CONFIG_MSS1_DECODER 0
+%define CONFIG_MSS2_DECODER 0
+%define CONFIG_MSVIDEO1_DECODER 0
+%define CONFIG_MSZH_DECODER 0
+%define CONFIG_MTS2_DECODER 0
+%define CONFIG_MVC1_DECODER 0
+%define CONFIG_MVC2_DECODER 0
+%define CONFIG_MXPEG_DECODER 0
+%define CONFIG_NUV_DECODER 0
+%define CONFIG_PAF_VIDEO_DECODER 0
+%define CONFIG_PAM_DECODER 0
+%define CONFIG_PBM_DECODER 0
+%define CONFIG_PCX_DECODER 0
+%define CONFIG_PGM_DECODER 0
+%define CONFIG_PGMYUV_DECODER 0
+%define CONFIG_PICTOR_DECODER 0
+%define CONFIG_PNG_DECODER 0
+%define CONFIG_PPM_DECODER 0
+%define CONFIG_PRORES_DECODER 0
+%define CONFIG_PRORES_LGPL_DECODER 0
+%define CONFIG_PTX_DECODER 0
+%define CONFIG_QDRAW_DECODER 0
+%define CONFIG_QPEG_DECODER 0
+%define CONFIG_QTRLE_DECODER 0
+%define CONFIG_R10K_DECODER 0
+%define CONFIG_R210_DECODER 0
+%define CONFIG_RAWVIDEO_DECODER 0
+%define CONFIG_RL2_DECODER 0
+%define CONFIG_ROQ_DECODER 0
+%define CONFIG_RPZA_DECODER 0
+%define CONFIG_RV10_DECODER 0
+%define CONFIG_RV20_DECODER 0
+%define CONFIG_RV30_DECODER 0
+%define CONFIG_RV40_DECODER 0
+%define CONFIG_S302M_DECODER 0
+%define CONFIG_SANM_DECODER 0
+%define CONFIG_SGI_DECODER 0
+%define CONFIG_SGIRLE_DECODER 0
+%define CONFIG_SMACKER_DECODER 0
+%define CONFIG_SMC_DECODER 0
+%define CONFIG_SMVJPEG_DECODER 0
+%define CONFIG_SNOW_DECODER 0
+%define CONFIG_SP5X_DECODER 0
+%define CONFIG_SUNRAST_DECODER 0
+%define CONFIG_SVQ1_DECODER 0
+%define CONFIG_SVQ3_DECODER 0
+%define CONFIG_TARGA_DECODER 0
+%define CONFIG_TARGA_Y216_DECODER 0
+%define CONFIG_TDSC_DECODER 0
+%define CONFIG_THEORA_DECODER 0
+%define CONFIG_THP_DECODER 0
+%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+%define CONFIG_TIFF_DECODER 0
+%define CONFIG_TMV_DECODER 0
+%define CONFIG_TRUEMOTION1_DECODER 0
+%define CONFIG_TRUEMOTION2_DECODER 0
+%define CONFIG_TSCC_DECODER 0
+%define CONFIG_TSCC2_DECODER 0
+%define CONFIG_TXD_DECODER 0
+%define CONFIG_ULTI_DECODER 0
+%define CONFIG_UTVIDEO_DECODER 0
+%define CONFIG_V210_DECODER 0
+%define CONFIG_V210X_DECODER 0
+%define CONFIG_V308_DECODER 0
+%define CONFIG_V408_DECODER 0
+%define CONFIG_V410_DECODER 0
+%define CONFIG_VB_DECODER 0
+%define CONFIG_VBLE_DECODER 0
+%define CONFIG_VC1_DECODER 0
+%define CONFIG_VC1_CRYSTALHD_DECODER 0
+%define CONFIG_VC1_VDPAU_DECODER 0
+%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
+%define CONFIG_VCR1_DECODER 0
+%define CONFIG_VMDVIDEO_DECODER 0
+%define CONFIG_VMNC_DECODER 0
+%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP5_DECODER 0
+%define CONFIG_VP6_DECODER 0
+%define CONFIG_VP6A_DECODER 0
+%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
+%define CONFIG_VP8_DECODER 0
+%define CONFIG_VP9_DECODER 0
+%define CONFIG_VQA_DECODER 0
+%define CONFIG_WEBP_DECODER 0
+%define CONFIG_WMV1_DECODER 0
+%define CONFIG_WMV2_DECODER 0
+%define CONFIG_WMV3_DECODER 0
+%define CONFIG_WMV3_CRYSTALHD_DECODER 0
+%define CONFIG_WMV3_VDPAU_DECODER 0
+%define CONFIG_WMV3IMAGE_DECODER 0
+%define CONFIG_WNV1_DECODER 0
+%define CONFIG_XAN_WC3_DECODER 0
+%define CONFIG_XAN_WC4_DECODER 0
+%define CONFIG_XBM_DECODER 0
+%define CONFIG_XFACE_DECODER 0
+%define CONFIG_XL_DECODER 0
+%define CONFIG_XWD_DECODER 0
+%define CONFIG_Y41P_DECODER 0
+%define CONFIG_YOP_DECODER 0
+%define CONFIG_YUV4_DECODER 0
+%define CONFIG_ZERO12V_DECODER 0
+%define CONFIG_ZEROCODEC_DECODER 0
+%define CONFIG_ZLIB_DECODER 0
+%define CONFIG_ZMBV_DECODER 0
+%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
+%define CONFIG_AAC_LATM_DECODER 0
+%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
+%define CONFIG_ALAC_DECODER 0
+%define CONFIG_ALS_DECODER 0
+%define CONFIG_AMRNB_DECODER 0
+%define CONFIG_AMRWB_DECODER 0
+%define CONFIG_APE_DECODER 0
+%define CONFIG_ATRAC1_DECODER 0
+%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
+%define CONFIG_BINKAUDIO_DCT_DECODER 0
+%define CONFIG_BINKAUDIO_RDFT_DECODER 0
+%define CONFIG_BMV_AUDIO_DECODER 0
+%define CONFIG_COOK_DECODER 0
+%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+%define CONFIG_DSICINAUDIO_DECODER 0
+%define CONFIG_DSS_SP_DECODER 0
+%define CONFIG_EAC3_DECODER 0
+%define CONFIG_EVRC_DECODER 0
+%define CONFIG_FFWAVESYNTH_DECODER 0
+%define CONFIG_FLAC_DECODER 0
+%define CONFIG_G723_1_DECODER 0
+%define CONFIG_G729_DECODER 0
+%define CONFIG_GSM_DECODER 0
+%define CONFIG_GSM_MS_DECODER 0
+%define CONFIG_IAC_DECODER 0
+%define CONFIG_IMC_DECODER 0
+%define CONFIG_MACE3_DECODER 0
+%define CONFIG_MACE6_DECODER 0
+%define CONFIG_METASOUND_DECODER 0
+%define CONFIG_MLP_DECODER 0
+%define CONFIG_MP1_DECODER 0
+%define CONFIG_MP1FLOAT_DECODER 0
+%define CONFIG_MP2_DECODER 0
+%define CONFIG_MP2FLOAT_DECODER 0
+%define CONFIG_MP3_DECODER 1
+%define CONFIG_MP3FLOAT_DECODER 0
+%define CONFIG_MP3ADU_DECODER 0
+%define CONFIG_MP3ADUFLOAT_DECODER 0
+%define CONFIG_MP3ON4_DECODER 0
+%define CONFIG_MP3ON4FLOAT_DECODER 0
+%define CONFIG_MPC7_DECODER 0
+%define CONFIG_MPC8_DECODER 0
+%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
+%define CONFIG_PAF_AUDIO_DECODER 0
+%define CONFIG_QCELP_DECODER 0
+%define CONFIG_QDM2_DECODER 0
+%define CONFIG_RA_144_DECODER 0
+%define CONFIG_RA_288_DECODER 0
+%define CONFIG_RALF_DECODER 0
+%define CONFIG_SHORTEN_DECODER 0
+%define CONFIG_SIPR_DECODER 0
+%define CONFIG_SMACKAUD_DECODER 0
+%define CONFIG_SONIC_DECODER 0
+%define CONFIG_TAK_DECODER 0
+%define CONFIG_TRUEHD_DECODER 0
+%define CONFIG_TRUESPEECH_DECODER 0
+%define CONFIG_TTA_DECODER 0
+%define CONFIG_TWINVQ_DECODER 0
+%define CONFIG_VMDAUDIO_DECODER 0
+%define CONFIG_VORBIS_DECODER 1
+%define CONFIG_WAVPACK_DECODER 0
+%define CONFIG_WMALOSSLESS_DECODER 0
+%define CONFIG_WMAPRO_DECODER 0
+%define CONFIG_WMAV1_DECODER 0
+%define CONFIG_WMAV2_DECODER 0
+%define CONFIG_WMAVOICE_DECODER 0
+%define CONFIG_WS_SND1_DECODER 0
+%define CONFIG_PCM_ALAW_DECODER 1
+%define CONFIG_PCM_BLURAY_DECODER 0
+%define CONFIG_PCM_DVD_DECODER 0
+%define CONFIG_PCM_F32BE_DECODER 0
+%define CONFIG_PCM_F32LE_DECODER 1
+%define CONFIG_PCM_F64BE_DECODER 0
+%define CONFIG_PCM_F64LE_DECODER 0
+%define CONFIG_PCM_LXF_DECODER 0
+%define CONFIG_PCM_MULAW_DECODER 1
+%define CONFIG_PCM_S8_DECODER 0
+%define CONFIG_PCM_S8_PLANAR_DECODER 0
+%define CONFIG_PCM_S16BE_DECODER 1
+%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+%define CONFIG_PCM_S16LE_DECODER 1
+%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S24BE_DECODER 1
+%define CONFIG_PCM_S24DAUD_DECODER 0
+%define CONFIG_PCM_S24LE_DECODER 1
+%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S32BE_DECODER 0
+%define CONFIG_PCM_S32LE_DECODER 0
+%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+%define CONFIG_PCM_U8_DECODER 1
+%define CONFIG_PCM_U16BE_DECODER 0
+%define CONFIG_PCM_U16LE_DECODER 0
+%define CONFIG_PCM_U24BE_DECODER 0
+%define CONFIG_PCM_U24LE_DECODER 0
+%define CONFIG_PCM_U32BE_DECODER 0
+%define CONFIG_PCM_U32LE_DECODER 0
+%define CONFIG_PCM_ZORK_DECODER 0
+%define CONFIG_INTERPLAY_DPCM_DECODER 0
+%define CONFIG_ROQ_DPCM_DECODER 0
+%define CONFIG_SOL_DPCM_DECODER 0
+%define CONFIG_XAN_DPCM_DECODER 0
+%define CONFIG_ADPCM_4XM_DECODER 0
+%define CONFIG_ADPCM_ADX_DECODER 0
+%define CONFIG_ADPCM_AFC_DECODER 0
+%define CONFIG_ADPCM_CT_DECODER 0
+%define CONFIG_ADPCM_DTK_DECODER 0
+%define CONFIG_ADPCM_EA_DECODER 0
+%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+%define CONFIG_ADPCM_EA_R1_DECODER 0
+%define CONFIG_ADPCM_EA_R2_DECODER 0
+%define CONFIG_ADPCM_EA_R3_DECODER 0
+%define CONFIG_ADPCM_EA_XAS_DECODER 0
+%define CONFIG_ADPCM_G722_DECODER 0
+%define CONFIG_ADPCM_G726_DECODER 0
+%define CONFIG_ADPCM_G726LE_DECODER 0
+%define CONFIG_ADPCM_IMA_AMV_DECODER 0
+%define CONFIG_ADPCM_IMA_APC_DECODER 0
+%define CONFIG_ADPCM_IMA_DK3_DECODER 0
+%define CONFIG_ADPCM_IMA_DK4_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+%define CONFIG_ADPCM_IMA_ISS_DECODER 0
+%define CONFIG_ADPCM_IMA_OKI_DECODER 0
+%define CONFIG_ADPCM_IMA_QT_DECODER 0
+%define CONFIG_ADPCM_IMA_RAD_DECODER 0
+%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+%define CONFIG_ADPCM_IMA_WAV_DECODER 0
+%define CONFIG_ADPCM_IMA_WS_DECODER 0
+%define CONFIG_ADPCM_MS_DECODER 0
+%define CONFIG_ADPCM_SBPRO_2_DECODER 0
+%define CONFIG_ADPCM_SBPRO_3_DECODER 0
+%define CONFIG_ADPCM_SBPRO_4_DECODER 0
+%define CONFIG_ADPCM_SWF_DECODER 0
+%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
+%define CONFIG_ADPCM_XA_DECODER 0
+%define CONFIG_ADPCM_YAMAHA_DECODER 0
+%define CONFIG_SSA_DECODER 0
+%define CONFIG_ASS_DECODER 0
+%define CONFIG_CCAPTION_DECODER 0
+%define CONFIG_DVBSUB_DECODER 0
+%define CONFIG_DVDSUB_DECODER 0
+%define CONFIG_JACOSUB_DECODER 0
+%define CONFIG_MICRODVD_DECODER 0
+%define CONFIG_MOVTEXT_DECODER 0
+%define CONFIG_MPL2_DECODER 0
+%define CONFIG_PGSSUB_DECODER 0
+%define CONFIG_PJS_DECODER 0
+%define CONFIG_REALTEXT_DECODER 0
+%define CONFIG_SAMI_DECODER 0
+%define CONFIG_SRT_DECODER 0
+%define CONFIG_STL_DECODER 0
+%define CONFIG_SUBRIP_DECODER 0
+%define CONFIG_SUBVIEWER_DECODER 0
+%define CONFIG_SUBVIEWER1_DECODER 0
+%define CONFIG_TEXT_DECODER 0
+%define CONFIG_VPLAYER_DECODER 0
+%define CONFIG_WEBVTT_DECODER 0
+%define CONFIG_XSUB_DECODER 0
+%define CONFIG_LIBCELT_DECODER 0
+%define CONFIG_LIBDCADEC_DECODER 0
+%define CONFIG_LIBFDK_AAC_DECODER 0
+%define CONFIG_LIBGSM_DECODER 0
+%define CONFIG_LIBGSM_MS_DECODER 0
+%define CONFIG_LIBILBC_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+%define CONFIG_LIBOPENJPEG_DECODER 0
+%define CONFIG_LIBOPUS_DECODER 0
+%define CONFIG_LIBSCHROEDINGER_DECODER 0
+%define CONFIG_LIBSPEEX_DECODER 0
+%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+%define CONFIG_LIBUTVIDEO_DECODER 0
+%define CONFIG_LIBVORBIS_DECODER 0
+%define CONFIG_LIBVPX_VP8_DECODER 0
+%define CONFIG_LIBVPX_VP9_DECODER 0
+%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+%define CONFIG_BINTEXT_DECODER 0
+%define CONFIG_XBIN_DECODER 0
+%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
+%define CONFIG_AC3_DEMUXER 0
+%define CONFIG_ACT_DEMUXER 0
+%define CONFIG_ADF_DEMUXER 0
+%define CONFIG_ADP_DEMUXER 0
+%define CONFIG_ADX_DEMUXER 0
+%define CONFIG_AEA_DEMUXER 0
+%define CONFIG_AFC_DEMUXER 0
+%define CONFIG_AIFF_DEMUXER 0
+%define CONFIG_AMR_DEMUXER 0
+%define CONFIG_ANM_DEMUXER 0
+%define CONFIG_APC_DEMUXER 0
+%define CONFIG_APE_DEMUXER 0
+%define CONFIG_APNG_DEMUXER 0
+%define CONFIG_AQTITLE_DEMUXER 0
+%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
+%define CONFIG_ASS_DEMUXER 0
+%define CONFIG_AST_DEMUXER 0
+%define CONFIG_AU_DEMUXER 0
+%define CONFIG_AVI_DEMUXER 0
+%define CONFIG_AVISYNTH_DEMUXER 0
+%define CONFIG_AVR_DEMUXER 0
+%define CONFIG_AVS_DEMUXER 0
+%define CONFIG_BETHSOFTVID_DEMUXER 0
+%define CONFIG_BFI_DEMUXER 0
+%define CONFIG_BINTEXT_DEMUXER 0
+%define CONFIG_BINK_DEMUXER 0
+%define CONFIG_BIT_DEMUXER 0
+%define CONFIG_BMV_DEMUXER 0
+%define CONFIG_BFSTM_DEMUXER 0
+%define CONFIG_BRSTM_DEMUXER 0
+%define CONFIG_BOA_DEMUXER 0
+%define CONFIG_C93_DEMUXER 0
+%define CONFIG_CAF_DEMUXER 0
+%define CONFIG_CAVSVIDEO_DEMUXER 0
+%define CONFIG_CDG_DEMUXER 0
+%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
+%define CONFIG_CONCAT_DEMUXER 0
+%define CONFIG_DATA_DEMUXER 0
+%define CONFIG_DAUD_DEMUXER 0
+%define CONFIG_DFA_DEMUXER 0
+%define CONFIG_DIRAC_DEMUXER 0
+%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
+%define CONFIG_DSICIN_DEMUXER 0
+%define CONFIG_DSS_DEMUXER 0
+%define CONFIG_DTS_DEMUXER 0
+%define CONFIG_DTSHD_DEMUXER 0
+%define CONFIG_DV_DEMUXER 0
+%define CONFIG_DVBSUB_DEMUXER 0
+%define CONFIG_DXA_DEMUXER 0
+%define CONFIG_EA_DEMUXER 0
+%define CONFIG_EA_CDATA_DEMUXER 0
+%define CONFIG_EAC3_DEMUXER 0
+%define CONFIG_EPAF_DEMUXER 0
+%define CONFIG_FFM_DEMUXER 0
+%define CONFIG_FFMETADATA_DEMUXER 0
+%define CONFIG_FILMSTRIP_DEMUXER 0
+%define CONFIG_FLAC_DEMUXER 0
+%define CONFIG_FLIC_DEMUXER 0
+%define CONFIG_FLV_DEMUXER 0
+%define CONFIG_LIVE_FLV_DEMUXER 0
+%define CONFIG_FOURXM_DEMUXER 0
+%define CONFIG_FRM_DEMUXER 0
+%define CONFIG_G722_DEMUXER 0
+%define CONFIG_G723_1_DEMUXER 0
+%define CONFIG_G729_DEMUXER 0
+%define CONFIG_GIF_DEMUXER 0
+%define CONFIG_GSM_DEMUXER 0
+%define CONFIG_GXF_DEMUXER 0
+%define CONFIG_H261_DEMUXER 0
+%define CONFIG_H263_DEMUXER 0
+%define CONFIG_H264_DEMUXER 0
+%define CONFIG_HEVC_DEMUXER 0
+%define CONFIG_HLS_DEMUXER 0
+%define CONFIG_HNM_DEMUXER 0
+%define CONFIG_ICO_DEMUXER 0
+%define CONFIG_IDCIN_DEMUXER 0
+%define CONFIG_IDF_DEMUXER 0
+%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_ILBC_DEMUXER 0
+%define CONFIG_IMAGE2_DEMUXER 0
+%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+%define CONFIG_INGENIENT_DEMUXER 0
+%define CONFIG_IPMOVIE_DEMUXER 0
+%define CONFIG_IRCAM_DEMUXER 0
+%define CONFIG_ISS_DEMUXER 0
+%define CONFIG_IV8_DEMUXER 0
+%define CONFIG_IVF_DEMUXER 0
+%define CONFIG_JACOSUB_DEMUXER 0
+%define CONFIG_JV_DEMUXER 0
+%define CONFIG_LATM_DEMUXER 0
+%define CONFIG_LMLM4_DEMUXER 0
+%define CONFIG_LOAS_DEMUXER 0
+%define CONFIG_LRC_DEMUXER 0
+%define CONFIG_LVF_DEMUXER 0
+%define CONFIG_LXF_DEMUXER 0
+%define CONFIG_M4V_DEMUXER 0
+%define CONFIG_MATROSKA_DEMUXER 1
+%define CONFIG_MGSTS_DEMUXER 0
+%define CONFIG_MICRODVD_DEMUXER 0
+%define CONFIG_MJPEG_DEMUXER 0
+%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
+%define CONFIG_MM_DEMUXER 0
+%define CONFIG_MMF_DEMUXER 0
+%define CONFIG_MOV_DEMUXER 1
+%define CONFIG_MP3_DEMUXER 1
+%define CONFIG_MPC_DEMUXER 0
+%define CONFIG_MPC8_DEMUXER 0
+%define CONFIG_MPEGPS_DEMUXER 0
+%define CONFIG_MPEGTS_DEMUXER 0
+%define CONFIG_MPEGTSRAW_DEMUXER 0
+%define CONFIG_MPEGVIDEO_DEMUXER 0
+%define CONFIG_MPJPEG_DEMUXER 0
+%define CONFIG_MPL2_DEMUXER 0
+%define CONFIG_MPSUB_DEMUXER 0
+%define CONFIG_MSNWC_TCP_DEMUXER 0
+%define CONFIG_MTV_DEMUXER 0
+%define CONFIG_MV_DEMUXER 0
+%define CONFIG_MVI_DEMUXER 0
+%define CONFIG_MXF_DEMUXER 0
+%define CONFIG_MXG_DEMUXER 0
+%define CONFIG_NC_DEMUXER 0
+%define CONFIG_NISTSPHERE_DEMUXER 0
+%define CONFIG_NSV_DEMUXER 0
+%define CONFIG_NUT_DEMUXER 0
+%define CONFIG_NUV_DEMUXER 0
+%define CONFIG_OGG_DEMUXER 1
+%define CONFIG_OMA_DEMUXER 0
+%define CONFIG_PAF_DEMUXER 0
+%define CONFIG_PCM_ALAW_DEMUXER 0
+%define CONFIG_PCM_MULAW_DEMUXER 0
+%define CONFIG_PCM_F64BE_DEMUXER 0
+%define CONFIG_PCM_F64LE_DEMUXER 0
+%define CONFIG_PCM_F32BE_DEMUXER 0
+%define CONFIG_PCM_F32LE_DEMUXER 0
+%define CONFIG_PCM_S32BE_DEMUXER 0
+%define CONFIG_PCM_S32LE_DEMUXER 0
+%define CONFIG_PCM_S24BE_DEMUXER 0
+%define CONFIG_PCM_S24LE_DEMUXER 0
+%define CONFIG_PCM_S16BE_DEMUXER 0
+%define CONFIG_PCM_S16LE_DEMUXER 0
+%define CONFIG_PCM_S8_DEMUXER 0
+%define CONFIG_PCM_U32BE_DEMUXER 0
+%define CONFIG_PCM_U32LE_DEMUXER 0
+%define CONFIG_PCM_U24BE_DEMUXER 0
+%define CONFIG_PCM_U24LE_DEMUXER 0
+%define CONFIG_PCM_U16BE_DEMUXER 0
+%define CONFIG_PCM_U16LE_DEMUXER 0
+%define CONFIG_PCM_U8_DEMUXER 0
+%define CONFIG_PJS_DEMUXER 0
+%define CONFIG_PMP_DEMUXER 0
+%define CONFIG_PVA_DEMUXER 0
+%define CONFIG_PVF_DEMUXER 0
+%define CONFIG_QCP_DEMUXER 0
+%define CONFIG_R3D_DEMUXER 0
+%define CONFIG_RAWVIDEO_DEMUXER 0
+%define CONFIG_REALTEXT_DEMUXER 0
+%define CONFIG_REDSPARK_DEMUXER 0
+%define CONFIG_RL2_DEMUXER 0
+%define CONFIG_RM_DEMUXER 0
+%define CONFIG_ROQ_DEMUXER 0
+%define CONFIG_RPL_DEMUXER 0
+%define CONFIG_RSD_DEMUXER 0
+%define CONFIG_RSO_DEMUXER 0
+%define CONFIG_RTP_DEMUXER 0
+%define CONFIG_RTSP_DEMUXER 0
+%define CONFIG_SAMI_DEMUXER 0
+%define CONFIG_SAP_DEMUXER 0
+%define CONFIG_SBG_DEMUXER 0
+%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
+%define CONFIG_SEGAFILM_DEMUXER 0
+%define CONFIG_SHORTEN_DEMUXER 0
+%define CONFIG_SIFF_DEMUXER 0
+%define CONFIG_SLN_DEMUXER 0
+%define CONFIG_SMACKER_DEMUXER 0
+%define CONFIG_SMJPEG_DEMUXER 0
+%define CONFIG_SMUSH_DEMUXER 0
+%define CONFIG_SOL_DEMUXER 0
+%define CONFIG_SOX_DEMUXER 0
+%define CONFIG_SPDIF_DEMUXER 0
+%define CONFIG_SRT_DEMUXER 0
+%define CONFIG_STR_DEMUXER 0
+%define CONFIG_STL_DEMUXER 0
+%define CONFIG_SUBVIEWER1_DEMUXER 0
+%define CONFIG_SUBVIEWER_DEMUXER 0
+%define CONFIG_SUP_DEMUXER 0
+%define CONFIG_SWF_DEMUXER 0
+%define CONFIG_TAK_DEMUXER 0
+%define CONFIG_TEDCAPTIONS_DEMUXER 0
+%define CONFIG_THP_DEMUXER 0
+%define CONFIG_TIERTEXSEQ_DEMUXER 0
+%define CONFIG_TMV_DEMUXER 0
+%define CONFIG_TRUEHD_DEMUXER 0
+%define CONFIG_TTA_DEMUXER 0
+%define CONFIG_TXD_DEMUXER 0
+%define CONFIG_TTY_DEMUXER 0
+%define CONFIG_VC1_DEMUXER 0
+%define CONFIG_VC1T_DEMUXER 0
+%define CONFIG_VIVO_DEMUXER 0
+%define CONFIG_VMD_DEMUXER 0
+%define CONFIG_VOBSUB_DEMUXER 0
+%define CONFIG_VOC_DEMUXER 0
+%define CONFIG_VPLAYER_DEMUXER 0
+%define CONFIG_VQF_DEMUXER 0
+%define CONFIG_W64_DEMUXER 0
+%define CONFIG_WAV_DEMUXER 1
+%define CONFIG_WC3_DEMUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+%define CONFIG_WEBVTT_DEMUXER 0
+%define CONFIG_WSAUD_DEMUXER 0
+%define CONFIG_WSVQA_DEMUXER 0
+%define CONFIG_WTV_DEMUXER 0
+%define CONFIG_WV_DEMUXER 0
+%define CONFIG_XA_DEMUXER 0
+%define CONFIG_XBIN_DEMUXER 0
+%define CONFIG_XMV_DEMUXER 0
+%define CONFIG_XWMA_DEMUXER 0
+%define CONFIG_YOP_DEMUXER 0
+%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+%define CONFIG_LIBGME_DEMUXER 0
+%define CONFIG_LIBMODPLUG_DEMUXER 0
+%define CONFIG_LIBNUT_DEMUXER 0
+%define CONFIG_LIBQUVI_DEMUXER 0
+%define CONFIG_A64MULTI_ENCODER 0
+%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
+%define CONFIG_AMV_ENCODER 0
+%define CONFIG_APNG_ENCODER 0
+%define CONFIG_ASV1_ENCODER 0
+%define CONFIG_ASV2_ENCODER 0
+%define CONFIG_AVRP_ENCODER 0
+%define CONFIG_AVUI_ENCODER 0
+%define CONFIG_AYUV_ENCODER 0
+%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
+%define CONFIG_CLJR_ENCODER 0
+%define CONFIG_COMFORTNOISE_ENCODER 0
+%define CONFIG_DNXHD_ENCODER 0
+%define CONFIG_DPX_ENCODER 0
+%define CONFIG_DVVIDEO_ENCODER 0
+%define CONFIG_FFV1_ENCODER 0
+%define CONFIG_FFVHUFF_ENCODER 0
+%define CONFIG_FLASHSV_ENCODER 0
+%define CONFIG_FLASHSV2_ENCODER 0
+%define CONFIG_FLV_ENCODER 0
+%define CONFIG_GIF_ENCODER 0
+%define CONFIG_H261_ENCODER 0
+%define CONFIG_H263_ENCODER 0
+%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
+%define CONFIG_HUFFYUV_ENCODER 0
+%define CONFIG_JPEG2000_ENCODER 0
+%define CONFIG_JPEGLS_ENCODER 0
+%define CONFIG_LJPEG_ENCODER 0
+%define CONFIG_MJPEG_ENCODER 0
+%define CONFIG_MPEG1VIDEO_ENCODER 0
+%define CONFIG_MPEG2VIDEO_ENCODER 0
+%define CONFIG_MPEG4_ENCODER 0
+%define CONFIG_MSMPEG4V2_ENCODER 0
+%define CONFIG_MSMPEG4V3_ENCODER 0
+%define CONFIG_MSVIDEO1_ENCODER 0
+%define CONFIG_PAM_ENCODER 0
+%define CONFIG_PBM_ENCODER 0
+%define CONFIG_PCX_ENCODER 0
+%define CONFIG_PGM_ENCODER 0
+%define CONFIG_PGMYUV_ENCODER 0
+%define CONFIG_PNG_ENCODER 0
+%define CONFIG_PPM_ENCODER 0
+%define CONFIG_PRORES_ENCODER 0
+%define CONFIG_PRORES_AW_ENCODER 0
+%define CONFIG_PRORES_KS_ENCODER 0
+%define CONFIG_QTRLE_ENCODER 0
+%define CONFIG_R10K_ENCODER 0
+%define CONFIG_R210_ENCODER 0
+%define CONFIG_RAWVIDEO_ENCODER 0
+%define CONFIG_ROQ_ENCODER 0
+%define CONFIG_RV10_ENCODER 0
+%define CONFIG_RV20_ENCODER 0
+%define CONFIG_S302M_ENCODER 0
+%define CONFIG_SGI_ENCODER 0
+%define CONFIG_SNOW_ENCODER 0
+%define CONFIG_SUNRAST_ENCODER 0
+%define CONFIG_SVQ1_ENCODER 0
+%define CONFIG_TARGA_ENCODER 0
+%define CONFIG_TIFF_ENCODER 0
+%define CONFIG_UTVIDEO_ENCODER 0
+%define CONFIG_V210_ENCODER 0
+%define CONFIG_V308_ENCODER 0
+%define CONFIG_V408_ENCODER 0
+%define CONFIG_V410_ENCODER 0
+%define CONFIG_WMV1_ENCODER 0
+%define CONFIG_WMV2_ENCODER 0
+%define CONFIG_XBM_ENCODER 0
+%define CONFIG_XFACE_ENCODER 0
+%define CONFIG_XWD_ENCODER 0
+%define CONFIG_Y41P_ENCODER 0
+%define CONFIG_YUV4_ENCODER 0
+%define CONFIG_ZLIB_ENCODER 0
+%define CONFIG_ZMBV_ENCODER 0
+%define CONFIG_AAC_ENCODER 0
+%define CONFIG_AC3_ENCODER 0
+%define CONFIG_AC3_FIXED_ENCODER 0
+%define CONFIG_ALAC_ENCODER 0
+%define CONFIG_DCA_ENCODER 0
+%define CONFIG_EAC3_ENCODER 0
+%define CONFIG_FLAC_ENCODER 0
+%define CONFIG_G723_1_ENCODER 0
+%define CONFIG_MP2_ENCODER 0
+%define CONFIG_MP2FIXED_ENCODER 0
+%define CONFIG_NELLYMOSER_ENCODER 0
+%define CONFIG_RA_144_ENCODER 0
+%define CONFIG_SONIC_ENCODER 0
+%define CONFIG_SONIC_LS_ENCODER 0
+%define CONFIG_TTA_ENCODER 0
+%define CONFIG_VORBIS_ENCODER 0
+%define CONFIG_WAVPACK_ENCODER 0
+%define CONFIG_WMAV1_ENCODER 0
+%define CONFIG_WMAV2_ENCODER 0
+%define CONFIG_PCM_ALAW_ENCODER 0
+%define CONFIG_PCM_F32BE_ENCODER 0
+%define CONFIG_PCM_F32LE_ENCODER 0
+%define CONFIG_PCM_F64BE_ENCODER 0
+%define CONFIG_PCM_F64LE_ENCODER 0
+%define CONFIG_PCM_MULAW_ENCODER 0
+%define CONFIG_PCM_S8_ENCODER 0
+%define CONFIG_PCM_S8_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16BE_ENCODER 0
+%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16LE_ENCODER 0
+%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S24BE_ENCODER 0
+%define CONFIG_PCM_S24DAUD_ENCODER 0
+%define CONFIG_PCM_S24LE_ENCODER 0
+%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S32BE_ENCODER 0
+%define CONFIG_PCM_S32LE_ENCODER 0
+%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_U8_ENCODER 0
+%define CONFIG_PCM_U16BE_ENCODER 0
+%define CONFIG_PCM_U16LE_ENCODER 0
+%define CONFIG_PCM_U24BE_ENCODER 0
+%define CONFIG_PCM_U24LE_ENCODER 0
+%define CONFIG_PCM_U32BE_ENCODER 0
+%define CONFIG_PCM_U32LE_ENCODER 0
+%define CONFIG_ROQ_DPCM_ENCODER 0
+%define CONFIG_ADPCM_ADX_ENCODER 0
+%define CONFIG_ADPCM_G722_ENCODER 0
+%define CONFIG_ADPCM_G726_ENCODER 0
+%define CONFIG_ADPCM_IMA_QT_ENCODER 0
+%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+%define CONFIG_ADPCM_MS_ENCODER 0
+%define CONFIG_ADPCM_SWF_ENCODER 0
+%define CONFIG_ADPCM_YAMAHA_ENCODER 0
+%define CONFIG_SSA_ENCODER 0
+%define CONFIG_ASS_ENCODER 0
+%define CONFIG_DVBSUB_ENCODER 0
+%define CONFIG_DVDSUB_ENCODER 0
+%define CONFIG_MOVTEXT_ENCODER 0
+%define CONFIG_SRT_ENCODER 0
+%define CONFIG_SUBRIP_ENCODER 0
+%define CONFIG_WEBVTT_ENCODER 0
+%define CONFIG_XSUB_ENCODER 0
+%define CONFIG_LIBFAAC_ENCODER 0
+%define CONFIG_LIBFDK_AAC_ENCODER 0
+%define CONFIG_LIBGSM_ENCODER 0
+%define CONFIG_LIBGSM_MS_ENCODER 0
+%define CONFIG_LIBILBC_ENCODER 0
+%define CONFIG_LIBMP3LAME_ENCODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+%define CONFIG_LIBOPENJPEG_ENCODER 0
+%define CONFIG_LIBOPUS_ENCODER 0
+%define CONFIG_LIBSCHROEDINGER_ENCODER 0
+%define CONFIG_LIBSHINE_ENCODER 0
+%define CONFIG_LIBSPEEX_ENCODER 0
+%define CONFIG_LIBTHEORA_ENCODER 0
+%define CONFIG_LIBTWOLAME_ENCODER 0
+%define CONFIG_LIBUTVIDEO_ENCODER 0
+%define CONFIG_LIBVO_AACENC_ENCODER 0
+%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+%define CONFIG_LIBVORBIS_ENCODER 0
+%define CONFIG_LIBVPX_VP8_ENCODER 0
+%define CONFIG_LIBVPX_VP9_ENCODER 0
+%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ANIM_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
+%define CONFIG_LIBX264_ENCODER 0
+%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
+%define CONFIG_LIBXAVS_ENCODER 0
+%define CONFIG_LIBXVID_ENCODER 0
+%define CONFIG_LIBAACPLUS_ENCODER 0
+%define CONFIG_LIBOPENH264_ENCODER 0
+%define CONFIG_H264_QSV_ENCODER 0
+%define CONFIG_NVENC_ENCODER 0
+%define CONFIG_NVENC_H264_ENCODER 0
+%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
+%define CONFIG_ADELAY_FILTER 0
+%define CONFIG_AECHO_FILTER 0
+%define CONFIG_AEVAL_FILTER 0
+%define CONFIG_AFADE_FILTER 0
+%define CONFIG_AFORMAT_FILTER 0
+%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
+%define CONFIG_ALLPASS_FILTER 0
+%define CONFIG_AMERGE_FILTER 0
+%define CONFIG_AMIX_FILTER 0
+%define CONFIG_ANULL_FILTER 0
+%define CONFIG_APAD_FILTER 0
+%define CONFIG_APERMS_FILTER 0
+%define CONFIG_APHASER_FILTER 0
+%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
+%define CONFIG_ASELECT_FILTER 0
+%define CONFIG_ASENDCMD_FILTER 0
+%define CONFIG_ASETNSAMPLES_FILTER 0
+%define CONFIG_ASETPTS_FILTER 0
+%define CONFIG_ASETRATE_FILTER 0
+%define CONFIG_ASETTB_FILTER 0
+%define CONFIG_ASHOWINFO_FILTER 0
+%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASTATS_FILTER 0
+%define CONFIG_ASTREAMSYNC_FILTER 0
+%define CONFIG_ASYNCTS_FILTER 0
+%define CONFIG_ATEMPO_FILTER 0
+%define CONFIG_ATRIM_FILTER 0
+%define CONFIG_AZMQ_FILTER 0
+%define CONFIG_BANDPASS_FILTER 0
+%define CONFIG_BANDREJECT_FILTER 0
+%define CONFIG_BASS_FILTER 0
+%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
+%define CONFIG_CHANNELMAP_FILTER 0
+%define CONFIG_CHANNELSPLIT_FILTER 0
+%define CONFIG_CHORUS_FILTER 0
+%define CONFIG_COMPAND_FILTER 0
+%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
+%define CONFIG_EARWAX_FILTER 0
+%define CONFIG_EBUR128_FILTER 0
+%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
+%define CONFIG_FLANGER_FILTER 0
+%define CONFIG_HIGHPASS_FILTER 0
+%define CONFIG_JOIN_FILTER 0
+%define CONFIG_LADSPA_FILTER 0
+%define CONFIG_LOWPASS_FILTER 0
+%define CONFIG_PAN_FILTER 0
+%define CONFIG_REPLAYGAIN_FILTER 0
+%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+%define CONFIG_SILENCEDETECT_FILTER 0
+%define CONFIG_SILENCEREMOVE_FILTER 0
+%define CONFIG_TREBLE_FILTER 0
+%define CONFIG_VOLUME_FILTER 0
+%define CONFIG_VOLUMEDETECT_FILTER 0
+%define CONFIG_AEVALSRC_FILTER 0
+%define CONFIG_ANULLSRC_FILTER 0
+%define CONFIG_FLITE_FILTER 0
+%define CONFIG_SINE_FILTER 0
+%define CONFIG_ANULLSINK_FILTER 0
+%define CONFIG_ALPHAEXTRACT_FILTER 0
+%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
+%define CONFIG_ASS_FILTER 0
+%define CONFIG_BBOX_FILTER 0
+%define CONFIG_BLACKDETECT_FILTER 0
+%define CONFIG_BLACKFRAME_FILTER 0
+%define CONFIG_BLEND_FILTER 0
+%define CONFIG_BOXBLUR_FILTER 0
+%define CONFIG_CODECVIEW_FILTER 0
+%define CONFIG_COLORBALANCE_FILTER 0
+%define CONFIG_COLORCHANNELMIXER_FILTER 0
+%define CONFIG_COLORKEY_FILTER 0
+%define CONFIG_COLORLEVELS_FILTER 0
+%define CONFIG_COLORMATRIX_FILTER 0
+%define CONFIG_COPY_FILTER 0
+%define CONFIG_COVER_RECT_FILTER 0
+%define CONFIG_CROP_FILTER 0
+%define CONFIG_CROPDETECT_FILTER 0
+%define CONFIG_CURVES_FILTER 0
+%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
+%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
+%define CONFIG_DELOGO_FILTER 0
+%define CONFIG_DESHAKE_FILTER 0
+%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
+%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
+%define CONFIG_DRAWGRID_FILTER 0
+%define CONFIG_DRAWTEXT_FILTER 0
+%define CONFIG_EDGEDETECT_FILTER 0
+%define CONFIG_ELBG_FILTER 0
+%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
+%define CONFIG_EXTRACTPLANES_FILTER 0
+%define CONFIG_FADE_FILTER 0
+%define CONFIG_FFTFILT_FILTER 0
+%define CONFIG_FIELD_FILTER 0
+%define CONFIG_FIELDMATCH_FILTER 0
+%define CONFIG_FIELDORDER_FILTER 0
+%define CONFIG_FIND_RECT_FILTER 0
+%define CONFIG_FORMAT_FILTER 0
+%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
+%define CONFIG_FRAMESTEP_FILTER 0
+%define CONFIG_FREI0R_FILTER 0
+%define CONFIG_FSPP_FILTER 0
+%define CONFIG_GEQ_FILTER 0
+%define CONFIG_GRADFUN_FILTER 0
+%define CONFIG_HALDCLUT_FILTER 0
+%define CONFIG_HFLIP_FILTER 0
+%define CONFIG_HISTEQ_FILTER 0
+%define CONFIG_HISTOGRAM_FILTER 0
+%define CONFIG_HQDN3D_FILTER 0
+%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
+%define CONFIG_HUE_FILTER 0
+%define CONFIG_IDET_FILTER 0
+%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
+%define CONFIG_INTERLACE_FILTER 0
+%define CONFIG_INTERLEAVE_FILTER 0
+%define CONFIG_KERNDEINT_FILTER 0
+%define CONFIG_LENSCORRECTION_FILTER 0
+%define CONFIG_LUT3D_FILTER 0
+%define CONFIG_LUT_FILTER 0
+%define CONFIG_LUTRGB_FILTER 0
+%define CONFIG_LUTYUV_FILTER 0
+%define CONFIG_MCDEINT_FILTER 0
+%define CONFIG_MERGEPLANES_FILTER 0
+%define CONFIG_MPDECIMATE_FILTER 0
+%define CONFIG_NEGATE_FILTER 0
+%define CONFIG_NOFORMAT_FILTER 0
+%define CONFIG_NOISE_FILTER 0
+%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
+%define CONFIG_OCV_FILTER 0
+%define CONFIG_OVERLAY_FILTER 0
+%define CONFIG_OWDENOISE_FILTER 0
+%define CONFIG_PAD_FILTER 0
+%define CONFIG_PALETTEGEN_FILTER 0
+%define CONFIG_PALETTEUSE_FILTER 0
+%define CONFIG_PERMS_FILTER 0
+%define CONFIG_PERSPECTIVE_FILTER 0
+%define CONFIG_PHASE_FILTER 0
+%define CONFIG_PIXDESCTEST_FILTER 0
+%define CONFIG_PP_FILTER 0
+%define CONFIG_PP7_FILTER 0
+%define CONFIG_PSNR_FILTER 0
+%define CONFIG_PULLUP_FILTER 0
+%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
+%define CONFIG_REMOVELOGO_FILTER 0
+%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
+%define CONFIG_ROTATE_FILTER 0
+%define CONFIG_SAB_FILTER 0
+%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
+%define CONFIG_SELECT_FILTER 0
+%define CONFIG_SENDCMD_FILTER 0
+%define CONFIG_SEPARATEFIELDS_FILTER 0
+%define CONFIG_SETDAR_FILTER 0
+%define CONFIG_SETFIELD_FILTER 0
+%define CONFIG_SETPTS_FILTER 0
+%define CONFIG_SETSAR_FILTER 0
+%define CONFIG_SETTB_FILTER 0
+%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHOWPALETTE_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
+%define CONFIG_SIGNALSTATS_FILTER 0
+%define CONFIG_SMARTBLUR_FILTER 0
+%define CONFIG_SPLIT_FILTER 0
+%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
+%define CONFIG_STEREO3D_FILTER 0
+%define CONFIG_SUBTITLES_FILTER 0
+%define CONFIG_SUPER2XSAI_FILTER 0
+%define CONFIG_SWAPUV_FILTER 0
+%define CONFIG_TBLEND_FILTER 0
+%define CONFIG_TELECINE_FILTER 0
+%define CONFIG_THUMBNAIL_FILTER 0
+%define CONFIG_TILE_FILTER 0
+%define CONFIG_TINTERLACE_FILTER 0
+%define CONFIG_TRANSPOSE_FILTER 0
+%define CONFIG_TRIM_FILTER 0
+%define CONFIG_UNSHARP_FILTER 0
+%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
+%define CONFIG_VFLIP_FILTER 0
+%define CONFIG_VIDSTABDETECT_FILTER 0
+%define CONFIG_VIDSTABTRANSFORM_FILTER 0
+%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
+%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
+%define CONFIG_XBR_FILTER 0
+%define CONFIG_YADIF_FILTER 0
+%define CONFIG_ZMQ_FILTER 0
+%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
+%define CONFIG_CELLAUTO_FILTER 0
+%define CONFIG_COLOR_FILTER 0
+%define CONFIG_FREI0R_SRC_FILTER 0
+%define CONFIG_HALDCLUTSRC_FILTER 0
+%define CONFIG_LIFE_FILTER 0
+%define CONFIG_MANDELBROT_FILTER 0
+%define CONFIG_MPTESTSRC_FILTER 0
+%define CONFIG_NULLSRC_FILTER 0
+%define CONFIG_RGBTESTSRC_FILTER 0
+%define CONFIG_SMPTEBARS_FILTER 0
+%define CONFIG_SMPTEHDBARS_FILTER 0
+%define CONFIG_TESTSRC_FILTER 0
+%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
+%define CONFIG_AVECTORSCOPE_FILTER 0
+%define CONFIG_CONCAT_FILTER 0
+%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
+%define CONFIG_SHOWWAVES_FILTER 0
+%define CONFIG_SHOWWAVESPIC_FILTER 0
+%define CONFIG_AMOVIE_FILTER 0
+%define CONFIG_MOVIE_FILTER 0
+%define CONFIG_H263_VAAPI_HWACCEL 0
+%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_H264_D3D11VA_HWACCEL 0
+%define CONFIG_H264_DXVA2_HWACCEL 0
+%define CONFIG_H264_MMAL_HWACCEL 0
+%define CONFIG_H264_QSV_HWACCEL 0
+%define CONFIG_H264_VAAPI_HWACCEL 0
+%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
+%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_HEVC_D3D11VA_HWACCEL 0
+%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
+%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
+%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
+%define CONFIG_MPEG2_VAAPI_HWACCEL 0
+%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG4_VAAPI_HWACCEL 0
+%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_VC1_D3D11VA_HWACCEL 0
+%define CONFIG_VC1_DXVA2_HWACCEL 0
+%define CONFIG_VC1_VAAPI_HWACCEL 0
+%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
+%define CONFIG_WMV3_D3D11VA_HWACCEL 0
+%define CONFIG_WMV3_DXVA2_HWACCEL 0
+%define CONFIG_WMV3_VAAPI_HWACCEL 0
+%define CONFIG_WMV3_VDPAU_HWACCEL 0
+%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
+%define CONFIG_BKTR_INDEV 0
+%define CONFIG_DECKLINK_INDEV 0
+%define CONFIG_DSHOW_INDEV 0
+%define CONFIG_DV1394_INDEV 0
+%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
+%define CONFIG_IEC61883_INDEV 0
+%define CONFIG_JACK_INDEV 0
+%define CONFIG_LAVFI_INDEV 0
+%define CONFIG_OPENAL_INDEV 0
+%define CONFIG_OSS_INDEV 0
+%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
+%define CONFIG_SNDIO_INDEV 0
+%define CONFIG_V4L2_INDEV 0
+%define CONFIG_VFWCAP_INDEV 0
+%define CONFIG_X11GRAB_INDEV 0
+%define CONFIG_X11GRAB_XCB_INDEV 0
+%define CONFIG_LIBCDIO_INDEV 0
+%define CONFIG_LIBDC1394_INDEV 0
+%define CONFIG_A64_MUXER 0
+%define CONFIG_AC3_MUXER 0
+%define CONFIG_ADTS_MUXER 0
+%define CONFIG_ADX_MUXER 0
+%define CONFIG_AIFF_MUXER 0
+%define CONFIG_AMR_MUXER 0
+%define CONFIG_APNG_MUXER 0
+%define CONFIG_ASF_MUXER 0
+%define CONFIG_ASS_MUXER 0
+%define CONFIG_AST_MUXER 0
+%define CONFIG_ASF_STREAM_MUXER 0
+%define CONFIG_AU_MUXER 0
+%define CONFIG_AVI_MUXER 0
+%define CONFIG_AVM2_MUXER 0
+%define CONFIG_BIT_MUXER 0
+%define CONFIG_CAF_MUXER 0
+%define CONFIG_CAVSVIDEO_MUXER 0
+%define CONFIG_CRC_MUXER 0
+%define CONFIG_DASH_MUXER 0
+%define CONFIG_DATA_MUXER 0
+%define CONFIG_DAUD_MUXER 0
+%define CONFIG_DIRAC_MUXER 0
+%define CONFIG_DNXHD_MUXER 0
+%define CONFIG_DTS_MUXER 0
+%define CONFIG_DV_MUXER 0
+%define CONFIG_EAC3_MUXER 0
+%define CONFIG_F4V_MUXER 0
+%define CONFIG_FFM_MUXER 0
+%define CONFIG_FFMETADATA_MUXER 0
+%define CONFIG_FILMSTRIP_MUXER 0
+%define CONFIG_FLAC_MUXER 0
+%define CONFIG_FLV_MUXER 0
+%define CONFIG_FRAMECRC_MUXER 0
+%define CONFIG_FRAMEMD5_MUXER 0
+%define CONFIG_G722_MUXER 0
+%define CONFIG_G723_1_MUXER 0
+%define CONFIG_GIF_MUXER 0
+%define CONFIG_GXF_MUXER 0
+%define CONFIG_H261_MUXER 0
+%define CONFIG_H263_MUXER 0
+%define CONFIG_H264_MUXER 0
+%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
+%define CONFIG_HLS_MUXER 0
+%define CONFIG_ICO_MUXER 0
+%define CONFIG_ILBC_MUXER 0
+%define CONFIG_IMAGE2_MUXER 0
+%define CONFIG_IMAGE2PIPE_MUXER 0
+%define CONFIG_IPOD_MUXER 0
+%define CONFIG_IRCAM_MUXER 0
+%define CONFIG_ISMV_MUXER 0
+%define CONFIG_IVF_MUXER 0
+%define CONFIG_JACOSUB_MUXER 0
+%define CONFIG_LATM_MUXER 0
+%define CONFIG_LRC_MUXER 0
+%define CONFIG_M4V_MUXER 0
+%define CONFIG_MD5_MUXER 0
+%define CONFIG_MATROSKA_MUXER 0
+%define CONFIG_MATROSKA_AUDIO_MUXER 0
+%define CONFIG_MICRODVD_MUXER 0
+%define CONFIG_MJPEG_MUXER 0
+%define CONFIG_MLP_MUXER 0
+%define CONFIG_MMF_MUXER 0
+%define CONFIG_MOV_MUXER 0
+%define CONFIG_MP2_MUXER 0
+%define CONFIG_MP3_MUXER 0
+%define CONFIG_MP4_MUXER 0
+%define CONFIG_MPEG1SYSTEM_MUXER 0
+%define CONFIG_MPEG1VCD_MUXER 0
+%define CONFIG_MPEG1VIDEO_MUXER 0
+%define CONFIG_MPEG2DVD_MUXER 0
+%define CONFIG_MPEG2SVCD_MUXER 0
+%define CONFIG_MPEG2VIDEO_MUXER 0
+%define CONFIG_MPEG2VOB_MUXER 0
+%define CONFIG_MPEGTS_MUXER 0
+%define CONFIG_MPJPEG_MUXER 0
+%define CONFIG_MXF_MUXER 0
+%define CONFIG_MXF_D10_MUXER 0
+%define CONFIG_MXF_OPATOM_MUXER 0
+%define CONFIG_NULL_MUXER 0
+%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
+%define CONFIG_OGG_MUXER 0
+%define CONFIG_OMA_MUXER 0
+%define CONFIG_OPUS_MUXER 0
+%define CONFIG_PCM_ALAW_MUXER 0
+%define CONFIG_PCM_MULAW_MUXER 0
+%define CONFIG_PCM_F64BE_MUXER 0
+%define CONFIG_PCM_F64LE_MUXER 0
+%define CONFIG_PCM_F32BE_MUXER 0
+%define CONFIG_PCM_F32LE_MUXER 0
+%define CONFIG_PCM_S32BE_MUXER 0
+%define CONFIG_PCM_S32LE_MUXER 0
+%define CONFIG_PCM_S24BE_MUXER 0
+%define CONFIG_PCM_S24LE_MUXER 0
+%define CONFIG_PCM_S16BE_MUXER 0
+%define CONFIG_PCM_S16LE_MUXER 0
+%define CONFIG_PCM_S8_MUXER 0
+%define CONFIG_PCM_U32BE_MUXER 0
+%define CONFIG_PCM_U32LE_MUXER 0
+%define CONFIG_PCM_U24BE_MUXER 0
+%define CONFIG_PCM_U24LE_MUXER 0
+%define CONFIG_PCM_U16BE_MUXER 0
+%define CONFIG_PCM_U16LE_MUXER 0
+%define CONFIG_PCM_U8_MUXER 0
+%define CONFIG_PSP_MUXER 0
+%define CONFIG_RAWVIDEO_MUXER 0
+%define CONFIG_RM_MUXER 0
+%define CONFIG_ROQ_MUXER 0
+%define CONFIG_RSO_MUXER 0
+%define CONFIG_RTP_MUXER 0
+%define CONFIG_RTP_MPEGTS_MUXER 0
+%define CONFIG_RTSP_MUXER 0
+%define CONFIG_SAP_MUXER 0
+%define CONFIG_SEGMENT_MUXER 0
+%define CONFIG_STREAM_SEGMENT_MUXER 0
+%define CONFIG_SINGLEJPEG_MUXER 0
+%define CONFIG_SMJPEG_MUXER 0
+%define CONFIG_SMOOTHSTREAMING_MUXER 0
+%define CONFIG_SOX_MUXER 0
+%define CONFIG_SPX_MUXER 0
+%define CONFIG_SPDIF_MUXER 0
+%define CONFIG_SRT_MUXER 0
+%define CONFIG_SWF_MUXER 0
+%define CONFIG_TEE_MUXER 0
+%define CONFIG_TG2_MUXER 0
+%define CONFIG_TGP_MUXER 0
+%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
+%define CONFIG_VC1_MUXER 0
+%define CONFIG_VC1T_MUXER 0
+%define CONFIG_VOC_MUXER 0
+%define CONFIG_W64_MUXER 0
+%define CONFIG_WAV_MUXER 0
+%define CONFIG_WEBM_MUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+%define CONFIG_WEBM_CHUNK_MUXER 0
+%define CONFIG_WEBP_MUXER 0
+%define CONFIG_WEBVTT_MUXER 0
+%define CONFIG_WTV_MUXER 0
+%define CONFIG_WV_MUXER 0
+%define CONFIG_YUV4MPEGPIPE_MUXER 0
+%define CONFIG_LIBNUT_MUXER 0
+%define CONFIG_ALSA_OUTDEV 0
+%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
+%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
+%define CONFIG_OSS_OUTDEV 0
+%define CONFIG_PULSE_OUTDEV 0
+%define CONFIG_SDL_OUTDEV 0
+%define CONFIG_SNDIO_OUTDEV 0
+%define CONFIG_V4L2_OUTDEV 0
+%define CONFIG_XV_OUTDEV 0
+%define CONFIG_AAC_PARSER 1
+%define CONFIG_AAC_LATM_PARSER 0
+%define CONFIG_AC3_PARSER 0
+%define CONFIG_ADX_PARSER 0
+%define CONFIG_BMP_PARSER 0
+%define CONFIG_CAVSVIDEO_PARSER 0
+%define CONFIG_COOK_PARSER 0
+%define CONFIG_DCA_PARSER 0
+%define CONFIG_DIRAC_PARSER 0
+%define CONFIG_DNXHD_PARSER 0
+%define CONFIG_DPX_PARSER 0
+%define CONFIG_DVBSUB_PARSER 0
+%define CONFIG_DVDSUB_PARSER 0
+%define CONFIG_DVD_NAV_PARSER 0
+%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
+%define CONFIG_GSM_PARSER 0
+%define CONFIG_H261_PARSER 0
+%define CONFIG_H263_PARSER 0
+%define CONFIG_H264_PARSER 0
+%define CONFIG_HEVC_PARSER 0
+%define CONFIG_MJPEG_PARSER 0
+%define CONFIG_MLP_PARSER 0
+%define CONFIG_MPEG4VIDEO_PARSER 0
+%define CONFIG_MPEGAUDIO_PARSER 1
+%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
+%define CONFIG_PNG_PARSER 0
+%define CONFIG_PNM_PARSER 0
+%define CONFIG_RV30_PARSER 0
+%define CONFIG_RV40_PARSER 0
+%define CONFIG_TAK_PARSER 0
+%define CONFIG_VC1_PARSER 0
+%define CONFIG_VORBIS_PARSER 1
+%define CONFIG_VP3_PARSER 0
+%define CONFIG_VP8_PARSER 0
+%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
+%define CONFIG_BLURAY_PROTOCOL 0
+%define CONFIG_CACHE_PROTOCOL 0
+%define CONFIG_CONCAT_PROTOCOL 0
+%define CONFIG_CRYPTO_PROTOCOL 0
+%define CONFIG_DATA_PROTOCOL 0
+%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+%define CONFIG_FFRTMPHTTP_PROTOCOL 0
+%define CONFIG_FILE_PROTOCOL 0
+%define CONFIG_FTP_PROTOCOL 0
+%define CONFIG_GOPHER_PROTOCOL 0
+%define CONFIG_HLS_PROTOCOL 0
+%define CONFIG_HTTP_PROTOCOL 0
+%define CONFIG_HTTPPROXY_PROTOCOL 0
+%define CONFIG_HTTPS_PROTOCOL 0
+%define CONFIG_ICECAST_PROTOCOL 0
+%define CONFIG_MMSH_PROTOCOL 0
+%define CONFIG_MMST_PROTOCOL 0
+%define CONFIG_MD5_PROTOCOL 0
+%define CONFIG_PIPE_PROTOCOL 0
+%define CONFIG_RTMP_PROTOCOL 0
+%define CONFIG_RTMPE_PROTOCOL 0
+%define CONFIG_RTMPS_PROTOCOL 0
+%define CONFIG_RTMPT_PROTOCOL 0
+%define CONFIG_RTMPTE_PROTOCOL 0
+%define CONFIG_RTMPTS_PROTOCOL 0
+%define CONFIG_RTP_PROTOCOL 0
+%define CONFIG_SCTP_PROTOCOL 0
+%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
+%define CONFIG_TCP_PROTOCOL 0
+%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+%define CONFIG_TLS_GNUTLS_PROTOCOL 0
+%define CONFIG_TLS_OPENSSL_PROTOCOL 0
+%define CONFIG_UDP_PROTOCOL 0
+%define CONFIG_UDPLITE_PROTOCOL 0
+%define CONFIG_UNIX_PROTOCOL 0
+%define CONFIG_LIBRTMP_PROTOCOL 0
+%define CONFIG_LIBRTMPE_PROTOCOL 0
+%define CONFIG_LIBRTMPS_PROTOCOL 0
+%define CONFIG_LIBRTMPT_PROTOCOL 0
+%define CONFIG_LIBRTMPTE_PROTOCOL 0
+%define CONFIG_LIBSSH_PROTOCOL 0
+%define CONFIG_LIBSMBCLIENT_PROTOCOL 0
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
new file mode 100644
index 00000000000..c1e915b7c6b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-x86 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android- --target-os=linux --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 1
+#define ARCH_X86_32 1
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 1
+#define HAVE_AMD3DNOWEXT 1
+#define HAVE_AVX 1
+#define HAVE_AVX2 1
+#define HAVE_FMA3 1
+#define HAVE_FMA4 1
+#define HAVE_MMX 1
+#define HAVE_MMXEXT 1
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
+#define HAVE_SSE3 1
+#define HAVE_SSE4 1
+#define HAVE_SSE42 1
+#define HAVE_SSSE3 1
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 1
+#define HAVE_AMD3DNOWEXT_EXTERNAL 1
+#define HAVE_AVX_EXTERNAL 1
+#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
+#define HAVE_FMA4_EXTERNAL 1
+#define HAVE_MMX_EXTERNAL 1
+#define HAVE_MMXEXT_EXTERNAL 1
+#define HAVE_SSE_EXTERNAL 1
+#define HAVE_SSE2_EXTERNAL 1
+#define HAVE_SSE3_EXTERNAL 1
+#define HAVE_SSE4_EXTERNAL 1
+#define HAVE_SSE42_EXTERNAL 1
+#define HAVE_SSSE3_EXTERNAL 1
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 1
+#define HAVE_AMD3DNOWEXT_INLINE 1
+#define HAVE_AVX_INLINE 1
+#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
+#define HAVE_FMA4_INLINE 1
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 1
+#define HAVE_SSE_INLINE 1
+#define HAVE_SSE2_INLINE 1
+#define HAVE_SSE3_INLINE 1
+#define HAVE_SSE4_INLINE 1
+#define HAVE_SSE42_INLINE 1
+#define HAVE_SSSE3_INLINE 1
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 1
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 0
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 1
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 1
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 1
+#define CONFIG_MPEGAUDIODSP 1
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 1
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 1
+#define CONFIG_MP3_DEMUXER 1
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 1
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..5805969f1b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75760-g382b031"
+#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
new file mode 100644
index 00000000000..11cb49da6f7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-mips --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android- --target-os=linux --extra-cflags=-mhard-float --arch=mips --extra-cflags=-mips32 --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 1
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 1
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
+#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_SIMD_ALIGN_16 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 0
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 0
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 1
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 0
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 1
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 1
+#define CONFIG_MPEGAUDIODSP 1
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 1
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 1
+#define CONFIG_MP3_DEMUXER 1
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 1
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/avconfig.h
new file mode 100644
index 00000000000..123b3b28aef
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 0
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..629579cf063
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75763-g1651ce3"
+#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
new file mode 100644
index 00000000000..7139c9a8792
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm
@@ -0,0 +1,1981 @@
+%define ARCH_AARCH64 0
+%define ARCH_ALPHA 0
+%define ARCH_ARM 0
+%define ARCH_AVR32 0
+%define ARCH_AVR32_AP 0
+%define ARCH_AVR32_UC 0
+%define ARCH_BFIN 0
+%define ARCH_IA64 0
+%define ARCH_M68K 0
+%define ARCH_MIPS 0
+%define ARCH_MIPS64 0
+%define ARCH_PARISC 0
+%define ARCH_PPC 0
+%define ARCH_PPC64 0
+%define ARCH_S390 0
+%define ARCH_SH4 0
+%define ARCH_SPARC 0
+%define ARCH_SPARC64 0
+%define ARCH_TILEGX 0
+%define ARCH_TILEPRO 0
+%define ARCH_TOMI 0
+%define ARCH_X86 1
+%define ARCH_X86_32 0
+%define ARCH_X86_64 1
+%define HAVE_ARMV5TE 0
+%define HAVE_ARMV6 0
+%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
+%define HAVE_NEON 0
+%define HAVE_VFP 0
+%define HAVE_VFPV3 0
+%define HAVE_SETEND 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 0
+%define HAVE_LDBRX 0
+%define HAVE_POWER8 0
+%define HAVE_PPC4XX 0
+%define HAVE_VSX 0
+%define HAVE_AMD3DNOW 1
+%define HAVE_AMD3DNOWEXT 1
+%define HAVE_AVX 1
+%define HAVE_AVX2 1
+%define HAVE_FMA3 1
+%define HAVE_FMA4 1
+%define HAVE_MMX 1
+%define HAVE_MMXEXT 1
+%define HAVE_SSE 1
+%define HAVE_SSE2 1
+%define HAVE_SSE3 1
+%define HAVE_SSE4 1
+%define HAVE_SSE42 1
+%define HAVE_SSSE3 1
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
+%define HAVE_MIPSFPU 0
+%define HAVE_MIPS32R2 0
+%define HAVE_MIPS32R5 0
+%define HAVE_MIPS64R6 0
+%define HAVE_MIPSDSPR1 0
+%define HAVE_MIPSDSPR2 0
+%define HAVE_MSA 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
+%define HAVE_ARMV5TE_EXTERNAL 0
+%define HAVE_ARMV6_EXTERNAL 0
+%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
+%define HAVE_NEON_EXTERNAL 0
+%define HAVE_VFP_EXTERNAL 0
+%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_SETEND_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_POWER8_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
+%define HAVE_VSX_EXTERNAL 0
+%define HAVE_AMD3DNOW_EXTERNAL 1
+%define HAVE_AMD3DNOWEXT_EXTERNAL 1
+%define HAVE_AVX_EXTERNAL 1
+%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
+%define HAVE_FMA4_EXTERNAL 1
+%define HAVE_MMX_EXTERNAL 1
+%define HAVE_MMXEXT_EXTERNAL 1
+%define HAVE_SSE_EXTERNAL 1
+%define HAVE_SSE2_EXTERNAL 1
+%define HAVE_SSE3_EXTERNAL 1
+%define HAVE_SSE4_EXTERNAL 1
+%define HAVE_SSE42_EXTERNAL 1
+%define HAVE_SSSE3_EXTERNAL 1
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
+%define HAVE_MIPSFPU_EXTERNAL 0
+%define HAVE_MIPS32R2_EXTERNAL 0
+%define HAVE_MIPS32R5_EXTERNAL 0
+%define HAVE_MIPS64R6_EXTERNAL 0
+%define HAVE_MIPSDSPR1_EXTERNAL 0
+%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
+%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
+%define HAVE_ARMV5TE_INLINE 0
+%define HAVE_ARMV6_INLINE 0
+%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
+%define HAVE_NEON_INLINE 0
+%define HAVE_VFP_INLINE 0
+%define HAVE_VFPV3_INLINE 0
+%define HAVE_SETEND_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_POWER8_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
+%define HAVE_VSX_INLINE 0
+%define HAVE_AMD3DNOW_INLINE 1
+%define HAVE_AMD3DNOWEXT_INLINE 1
+%define HAVE_AVX_INLINE 1
+%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
+%define HAVE_FMA4_INLINE 1
+%define HAVE_MMX_INLINE 1
+%define HAVE_MMXEXT_INLINE 1
+%define HAVE_SSE_INLINE 1
+%define HAVE_SSE2_INLINE 1
+%define HAVE_SSE3_INLINE 1
+%define HAVE_SSE4_INLINE 1
+%define HAVE_SSE42_INLINE 1
+%define HAVE_SSSE3_INLINE 1
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
+%define HAVE_MIPSFPU_INLINE 0
+%define HAVE_MIPS32R2_INLINE 0
+%define HAVE_MIPS32R5_INLINE 0
+%define HAVE_MIPS64R6_INLINE 0
+%define HAVE_MIPSDSPR1_INLINE 0
+%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
+%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_SIMD_ALIGN_16 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+%define HAVE_INLINE_ASM 1
+%define HAVE_SYMVER 0
+%define HAVE_YASM 1
+%define HAVE_BIGENDIAN 0
+%define HAVE_FAST_UNALIGNED 1
+%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
+%define HAVE_DLFCN_H 1
+%define HAVE_D3D11_H 0
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UDPLITE_H 0
+%define HAVE_UNISTD_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
+%define HAVE_INTRINSICS_NEON 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
+%define HAVE_COSF 1
+%define HAVE_ERF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 0
+%define HAVE_CLOCK_GETTIME 1
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 0
+%define HAVE_COTASKMEMFREE 0
+%define HAVE_CRYPTGENRANDOM 0
+%define HAVE_DLOPEN 1
+%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
+%define HAVE_FORK 1
+%define HAVE_GETADDRINFO 0
+%define HAVE_GETHRTIME 0
+%define HAVE_GETOPT 1
+%define HAVE_GETPROCESSAFFINITYMASK 0
+%define HAVE_GETPROCESSMEMORYINFO 0
+%define HAVE_GETPROCESSTIMES 0
+%define HAVE_GETRUSAGE 1
+%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
+%define HAVE_GETTIMEOFDAY 1
+%define HAVE_GLOB 0
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_GMTIME_R 1
+%define HAVE_INET_ATON 0
+%define HAVE_ISATTY 1
+%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+%define HAVE_KBHIT 0
+%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
+%define HAVE_LZO1X_999_COMPRESS 0
+%define HAVE_MACH_ABSOLUTE_TIME 0
+%define HAVE_MAPVIEWOFFILE 0
+%define HAVE_MEMALIGN 1
+%define HAVE_MKSTEMP 1
+%define HAVE_MMAP 1
+%define HAVE_MPROTECT 1
+%define HAVE_NANOSLEEP 1
+%define HAVE_PEEKNAMEDPIPE 0
+%define HAVE_POSIX_MEMALIGN 1
+%define HAVE_PTHREAD_CANCEL 0
+%define HAVE_SCHED_GETAFFINITY 1
+%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
+%define HAVE_SETMODE 0
+%define HAVE_SETRLIMIT 1
+%define HAVE_SLEEP 0
+%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_AS_DN_DIRECTIVE 0
+%define HAVE_AS_FUNC 0
+%define HAVE_AS_OBJECT_ARCH 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_CONDITION_VARIABLE_PTR 0
+%define HAVE_SOCKLEN_T 0
+%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+%define HAVE_STRUCT_IP_MREQ_SOURCE 0
+%define HAVE_STRUCT_IPV6_MREQ 0
+%define HAVE_STRUCT_POLLFD 0
+%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+%define HAVE_STRUCT_SOCKADDR_IN6 0
+%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+%define HAVE_STRUCT_SOCKADDR_STORAGE 0
+%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_TEXI2HTML 0
+%define HAVE_THREADS 1
+%define HAVE_VAAPI_X11 0
+%define HAVE_VDPAU_X11 0
+%define HAVE_XLIB 0
+%define CONFIG_BSFS 0
+%define CONFIG_DECODERS 1
+%define CONFIG_DEMUXERS 1
+%define CONFIG_ENCODERS 0
+%define CONFIG_FILTERS 0
+%define CONFIG_HWACCELS 0
+%define CONFIG_INDEVS 0
+%define CONFIG_MUXERS 0
+%define CONFIG_OUTDEVS 0
+%define CONFIG_PARSERS 1
+%define CONFIG_PROTOCOLS 0
+%define CONFIG_DOC 0
+%define CONFIG_HTMLPAGES 0
+%define CONFIG_MANPAGES 0
+%define CONFIG_PODPAGES 0
+%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+%define CONFIG_DECODING_ENCODING_EXAMPLE 1
+%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_EXTRACT_MVS_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+%define CONFIG_METADATA_EXAMPLE 1
+%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_QSVDEC_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
+%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+%define CONFIG_SCALING_VIDEO_EXAMPLE 0
+%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
+%define CONFIG_AVISYNTH 0
+%define CONFIG_BZLIB 0
+%define CONFIG_CRYSTALHD 0
+%define CONFIG_DECKLINK 0
+%define CONFIG_FREI0R 0
+%define CONFIG_GNUTLS 0
+%define CONFIG_ICONV 0
+%define CONFIG_LADSPA 0
+%define CONFIG_LIBAACPLUS 0
+%define CONFIG_LIBASS 0
+%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
+%define CONFIG_LIBCACA 0
+%define CONFIG_LIBCDIO 0
+%define CONFIG_LIBCELT 0
+%define CONFIG_LIBDC1394 0
+%define CONFIG_LIBDCADEC 0
+%define CONFIG_LIBFAAC 0
+%define CONFIG_LIBFDK_AAC 0
+%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
+%define CONFIG_LIBFREETYPE 0
+%define CONFIG_LIBFRIBIDI 0
+%define CONFIG_LIBGME 0
+%define CONFIG_LIBGSM 0
+%define CONFIG_LIBIEC61883 0
+%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
+%define CONFIG_LIBMFX 0
+%define CONFIG_LIBMODPLUG 0
+%define CONFIG_LIBMP3LAME 0
+%define CONFIG_LIBNUT 0
+%define CONFIG_LIBOPENCORE_AMRNB 0
+%define CONFIG_LIBOPENCORE_AMRWB 0
+%define CONFIG_LIBOPENCV 0
+%define CONFIG_LIBOPENH264 0
+%define CONFIG_LIBOPENJPEG 0
+%define CONFIG_LIBOPUS 0
+%define CONFIG_LIBPULSE 0
+%define CONFIG_LIBQUVI 0
+%define CONFIG_LIBRTMP 0
+%define CONFIG_LIBSCHROEDINGER 0
+%define CONFIG_LIBSHINE 0
+%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
+%define CONFIG_LIBSOXR 0
+%define CONFIG_LIBSPEEX 0
+%define CONFIG_LIBSSH 0
+%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
+%define CONFIG_LIBTHEORA 0
+%define CONFIG_LIBTWOLAME 0
+%define CONFIG_LIBUTVIDEO 0
+%define CONFIG_LIBV4L2 0
+%define CONFIG_LIBVIDSTAB 0
+%define CONFIG_LIBVO_AACENC 0
+%define CONFIG_LIBVO_AMRWBENC 0
+%define CONFIG_LIBVORBIS 0
+%define CONFIG_LIBVPX 0
+%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
+%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
+%define CONFIG_LIBXAVS 0
+%define CONFIG_LIBXCB 0
+%define CONFIG_LIBXCB_SHM 0
+%define CONFIG_LIBXCB_SHAPE 0
+%define CONFIG_LIBXCB_XFIXES 0
+%define CONFIG_LIBXVID 0
+%define CONFIG_LIBZMQ 0
+%define CONFIG_LIBZVBI 0
+%define CONFIG_LZMA 0
+%define CONFIG_MMAL 0
+%define CONFIG_NVENC 0
+%define CONFIG_OPENAL 0
+%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
+%define CONFIG_OPENSSL 0
+%define CONFIG_SDL 0
+%define CONFIG_SECURETRANSPORT 0
+%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
+%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 0
+%define CONFIG_SMALL 1
+%define CONFIG_STATIC 1
+%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_D3D11VA 0
+%define CONFIG_DXVA2 0
+%define CONFIG_VAAPI 0
+%define CONFIG_VDA 0
+%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
+%define CONFIG_AVCODEC 1
+%define CONFIG_AVDEVICE 0
+%define CONFIG_AVFILTER 0
+%define CONFIG_AVFORMAT 1
+%define CONFIG_AVRESAMPLE 0
+%define CONFIG_AVUTIL 1
+%define CONFIG_POSTPROC 0
+%define CONFIG_SWRESAMPLE 0
+%define CONFIG_SWSCALE 0
+%define CONFIG_FFPLAY 0
+%define CONFIG_FFPROBE 0
+%define CONFIG_FFSERVER 0
+%define CONFIG_FFMPEG 0
+%define CONFIG_DCT 1
+%define CONFIG_DWT 0
+%define CONFIG_ERROR_RESILIENCE 0
+%define CONFIG_FAAN 1
+%define CONFIG_FAST_UNALIGNED 1
+%define CONFIG_FFT 1
+%define CONFIG_LSP 0
+%define CONFIG_LZO 0
+%define CONFIG_MDCT 1
+%define CONFIG_PIXELUTILS 0
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+%define CONFIG_MEMALIGN_HACK 0
+%define CONFIG_MEMORY_POISONING 0
+%define CONFIG_NEON_CLOBBER_TEST 0
+%define CONFIG_PIC 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
+%define CONFIG_THUMB 0
+%define CONFIG_VALGRIND_BACKTRACE 0
+%define CONFIG_XMM_CLOBBER_TEST 0
+%define CONFIG_AANDCTTABLES 0
+%define CONFIG_AC3DSP 0
+%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_AUDIODSP 0
+%define CONFIG_BLOCKDSP 0
+%define CONFIG_BSWAPDSP 0
+%define CONFIG_CABAC 0
+%define CONFIG_DVPROFILE 0
+%define CONFIG_EXIF 0
+%define CONFIG_FAANDCT 0
+%define CONFIG_FAANIDCT 0
+%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
+%define CONFIG_FMTCONVERT 0
+%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
+%define CONFIG_GCRYPT 0
+%define CONFIG_GMP 0
+%define CONFIG_GOLOMB 1
+%define CONFIG_GPLV3 0
+%define CONFIG_H263DSP 0
+%define CONFIG_H264CHROMA 0
+%define CONFIG_H264DSP 0
+%define CONFIG_H264PRED 0
+%define CONFIG_H264QPEL 0
+%define CONFIG_HPELDSP 0
+%define CONFIG_HUFFMAN 0
+%define CONFIG_HUFFYUVDSP 0
+%define CONFIG_HUFFYUVENCDSP 0
+%define CONFIG_IDCTDSP 0
+%define CONFIG_IIRFILTER 0
+%define CONFIG_IMDCT15 1
+%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
+%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
+%define CONFIG_LGPLV3 0
+%define CONFIG_LLAUDDSP 0
+%define CONFIG_LLVIDDSP 0
+%define CONFIG_LPC 0
+%define CONFIG_LZF 0
+%define CONFIG_ME_CMP 0
+%define CONFIG_MPEG_ER 0
+%define CONFIG_MPEGAUDIO 1
+%define CONFIG_MPEGAUDIODSP 1
+%define CONFIG_MPEGVIDEO 0
+%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
+%define CONFIG_PIXBLOCKDSP 0
+%define CONFIG_QPELDSP 0
+%define CONFIG_QSV 0
+%define CONFIG_QSVDEC 0
+%define CONFIG_QSVENC 0
+%define CONFIG_RANGECODER 0
+%define CONFIG_RIFFDEC 1
+%define CONFIG_RIFFENC 0
+%define CONFIG_RTPDEC 0
+%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
+%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
+%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
+%define CONFIG_TPELDSP 0
+%define CONFIG_VIDEODSP 0
+%define CONFIG_VP3DSP 0
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 0
+%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
+%define CONFIG_AAC_ADTSTOASC_BSF 0
+%define CONFIG_CHOMP_BSF 0
+%define CONFIG_DUMP_EXTRADATA_BSF 0
+%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+%define CONFIG_IMX_DUMP_HEADER_BSF 0
+%define CONFIG_MJPEG2JPEG_BSF 0
+%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+%define CONFIG_MOV2TEXTSUB_BSF 0
+%define CONFIG_NOISE_BSF 0
+%define CONFIG_REMOVE_EXTRADATA_BSF 0
+%define CONFIG_TEXT2MOVSUB_BSF 0
+%define CONFIG_AASC_DECODER 0
+%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
+%define CONFIG_AMV_DECODER 0
+%define CONFIG_ANM_DECODER 0
+%define CONFIG_ANSI_DECODER 0
+%define CONFIG_APNG_DECODER 0
+%define CONFIG_ASV1_DECODER 0
+%define CONFIG_ASV2_DECODER 0
+%define CONFIG_AURA_DECODER 0
+%define CONFIG_AURA2_DECODER 0
+%define CONFIG_AVRP_DECODER 0
+%define CONFIG_AVRN_DECODER 0
+%define CONFIG_AVS_DECODER 0
+%define CONFIG_AVUI_DECODER 0
+%define CONFIG_AYUV_DECODER 0
+%define CONFIG_BETHSOFTVID_DECODER 0
+%define CONFIG_BFI_DECODER 0
+%define CONFIG_BINK_DECODER 0
+%define CONFIG_BMP_DECODER 0
+%define CONFIG_BMV_VIDEO_DECODER 0
+%define CONFIG_BRENDER_PIX_DECODER 0
+%define CONFIG_C93_DECODER 0
+%define CONFIG_CAVS_DECODER 0
+%define CONFIG_CDGRAPHICS_DECODER 0
+%define CONFIG_CDXL_DECODER 0
+%define CONFIG_CINEPAK_DECODER 0
+%define CONFIG_CLJR_DECODER 0
+%define CONFIG_CLLC_DECODER 0
+%define CONFIG_COMFORTNOISE_DECODER 0
+%define CONFIG_CPIA_DECODER 0
+%define CONFIG_CSCD_DECODER 0
+%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
+%define CONFIG_DFA_DECODER 0
+%define CONFIG_DIRAC_DECODER 0
+%define CONFIG_DNXHD_DECODER 0
+%define CONFIG_DPX_DECODER 0
+%define CONFIG_DSICINVIDEO_DECODER 0
+%define CONFIG_DVVIDEO_DECODER 0
+%define CONFIG_DXA_DECODER 0
+%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
+%define CONFIG_EACMV_DECODER 0
+%define CONFIG_EAMAD_DECODER 0
+%define CONFIG_EATGQ_DECODER 0
+%define CONFIG_EATGV_DECODER 0
+%define CONFIG_EATQI_DECODER 0
+%define CONFIG_EIGHTBPS_DECODER 0
+%define CONFIG_EIGHTSVX_EXP_DECODER 0
+%define CONFIG_EIGHTSVX_FIB_DECODER 0
+%define CONFIG_ESCAPE124_DECODER 0
+%define CONFIG_ESCAPE130_DECODER 0
+%define CONFIG_EXR_DECODER 0
+%define CONFIG_FFV1_DECODER 0
+%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
+%define CONFIG_FLASHSV_DECODER 0
+%define CONFIG_FLASHSV2_DECODER 0
+%define CONFIG_FLIC_DECODER 0
+%define CONFIG_FLV_DECODER 0
+%define CONFIG_FOURXM_DECODER 0
+%define CONFIG_FRAPS_DECODER 0
+%define CONFIG_FRWU_DECODER 0
+%define CONFIG_G2M_DECODER 0
+%define CONFIG_GIF_DECODER 0
+%define CONFIG_H261_DECODER 0
+%define CONFIG_H263_DECODER 0
+%define CONFIG_H263I_DECODER 0
+%define CONFIG_H263P_DECODER 0
+%define CONFIG_H264_DECODER 0
+%define CONFIG_H264_CRYSTALHD_DECODER 0
+%define CONFIG_H264_MMAL_DECODER 0
+%define CONFIG_H264_QSV_DECODER 0
+%define CONFIG_H264_VDA_DECODER 0
+%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
+%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
+%define CONFIG_HNM4_VIDEO_DECODER 0
+%define CONFIG_HQ_HQA_DECODER 0
+%define CONFIG_HQX_DECODER 0
+%define CONFIG_HUFFYUV_DECODER 0
+%define CONFIG_IDCIN_DECODER 0
+%define CONFIG_IFF_BYTERUN1_DECODER 0
+%define CONFIG_IFF_ILBM_DECODER 0
+%define CONFIG_INDEO2_DECODER 0
+%define CONFIG_INDEO3_DECODER 0
+%define CONFIG_INDEO4_DECODER 0
+%define CONFIG_INDEO5_DECODER 0
+%define CONFIG_INTERPLAY_VIDEO_DECODER 0
+%define CONFIG_JPEG2000_DECODER 0
+%define CONFIG_JPEGLS_DECODER 0
+%define CONFIG_JV_DECODER 0
+%define CONFIG_KGV1_DECODER 0
+%define CONFIG_KMVC_DECODER 0
+%define CONFIG_LAGARITH_DECODER 0
+%define CONFIG_LOCO_DECODER 0
+%define CONFIG_MDEC_DECODER 0
+%define CONFIG_MIMIC_DECODER 0
+%define CONFIG_MJPEG_DECODER 0
+%define CONFIG_MJPEGB_DECODER 0
+%define CONFIG_MMVIDEO_DECODER 0
+%define CONFIG_MOTIONPIXELS_DECODER 0
+%define CONFIG_MPEG_XVMC_DECODER 0
+%define CONFIG_MPEG1VIDEO_DECODER 0
+%define CONFIG_MPEG2VIDEO_DECODER 0
+%define CONFIG_MPEG4_DECODER 0
+%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG4_VDPAU_DECODER 0
+%define CONFIG_MPEGVIDEO_DECODER 0
+%define CONFIG_MPEG_VDPAU_DECODER 0
+%define CONFIG_MPEG1_VDPAU_DECODER 0
+%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
+%define CONFIG_MSA1_DECODER 0
+%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MSMPEG4V1_DECODER 0
+%define CONFIG_MSMPEG4V2_DECODER 0
+%define CONFIG_MSMPEG4V3_DECODER 0
+%define CONFIG_MSRLE_DECODER 0
+%define CONFIG_MSS1_DECODER 0
+%define CONFIG_MSS2_DECODER 0
+%define CONFIG_MSVIDEO1_DECODER 0
+%define CONFIG_MSZH_DECODER 0
+%define CONFIG_MTS2_DECODER 0
+%define CONFIG_MVC1_DECODER 0
+%define CONFIG_MVC2_DECODER 0
+%define CONFIG_MXPEG_DECODER 0
+%define CONFIG_NUV_DECODER 0
+%define CONFIG_PAF_VIDEO_DECODER 0
+%define CONFIG_PAM_DECODER 0
+%define CONFIG_PBM_DECODER 0
+%define CONFIG_PCX_DECODER 0
+%define CONFIG_PGM_DECODER 0
+%define CONFIG_PGMYUV_DECODER 0
+%define CONFIG_PICTOR_DECODER 0
+%define CONFIG_PNG_DECODER 0
+%define CONFIG_PPM_DECODER 0
+%define CONFIG_PRORES_DECODER 0
+%define CONFIG_PRORES_LGPL_DECODER 0
+%define CONFIG_PTX_DECODER 0
+%define CONFIG_QDRAW_DECODER 0
+%define CONFIG_QPEG_DECODER 0
+%define CONFIG_QTRLE_DECODER 0
+%define CONFIG_R10K_DECODER 0
+%define CONFIG_R210_DECODER 0
+%define CONFIG_RAWVIDEO_DECODER 0
+%define CONFIG_RL2_DECODER 0
+%define CONFIG_ROQ_DECODER 0
+%define CONFIG_RPZA_DECODER 0
+%define CONFIG_RV10_DECODER 0
+%define CONFIG_RV20_DECODER 0
+%define CONFIG_RV30_DECODER 0
+%define CONFIG_RV40_DECODER 0
+%define CONFIG_S302M_DECODER 0
+%define CONFIG_SANM_DECODER 0
+%define CONFIG_SGI_DECODER 0
+%define CONFIG_SGIRLE_DECODER 0
+%define CONFIG_SMACKER_DECODER 0
+%define CONFIG_SMC_DECODER 0
+%define CONFIG_SMVJPEG_DECODER 0
+%define CONFIG_SNOW_DECODER 0
+%define CONFIG_SP5X_DECODER 0
+%define CONFIG_SUNRAST_DECODER 0
+%define CONFIG_SVQ1_DECODER 0
+%define CONFIG_SVQ3_DECODER 0
+%define CONFIG_TARGA_DECODER 0
+%define CONFIG_TARGA_Y216_DECODER 0
+%define CONFIG_TDSC_DECODER 0
+%define CONFIG_THEORA_DECODER 0
+%define CONFIG_THP_DECODER 0
+%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+%define CONFIG_TIFF_DECODER 0
+%define CONFIG_TMV_DECODER 0
+%define CONFIG_TRUEMOTION1_DECODER 0
+%define CONFIG_TRUEMOTION2_DECODER 0
+%define CONFIG_TSCC_DECODER 0
+%define CONFIG_TSCC2_DECODER 0
+%define CONFIG_TXD_DECODER 0
+%define CONFIG_ULTI_DECODER 0
+%define CONFIG_UTVIDEO_DECODER 0
+%define CONFIG_V210_DECODER 0
+%define CONFIG_V210X_DECODER 0
+%define CONFIG_V308_DECODER 0
+%define CONFIG_V408_DECODER 0
+%define CONFIG_V410_DECODER 0
+%define CONFIG_VB_DECODER 0
+%define CONFIG_VBLE_DECODER 0
+%define CONFIG_VC1_DECODER 0
+%define CONFIG_VC1_CRYSTALHD_DECODER 0
+%define CONFIG_VC1_VDPAU_DECODER 0
+%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
+%define CONFIG_VCR1_DECODER 0
+%define CONFIG_VMDVIDEO_DECODER 0
+%define CONFIG_VMNC_DECODER 0
+%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP5_DECODER 0
+%define CONFIG_VP6_DECODER 0
+%define CONFIG_VP6A_DECODER 0
+%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
+%define CONFIG_VP8_DECODER 0
+%define CONFIG_VP9_DECODER 0
+%define CONFIG_VQA_DECODER 0
+%define CONFIG_WEBP_DECODER 0
+%define CONFIG_WMV1_DECODER 0
+%define CONFIG_WMV2_DECODER 0
+%define CONFIG_WMV3_DECODER 0
+%define CONFIG_WMV3_CRYSTALHD_DECODER 0
+%define CONFIG_WMV3_VDPAU_DECODER 0
+%define CONFIG_WMV3IMAGE_DECODER 0
+%define CONFIG_WNV1_DECODER 0
+%define CONFIG_XAN_WC3_DECODER 0
+%define CONFIG_XAN_WC4_DECODER 0
+%define CONFIG_XBM_DECODER 0
+%define CONFIG_XFACE_DECODER 0
+%define CONFIG_XL_DECODER 0
+%define CONFIG_XWD_DECODER 0
+%define CONFIG_Y41P_DECODER 0
+%define CONFIG_YOP_DECODER 0
+%define CONFIG_YUV4_DECODER 0
+%define CONFIG_ZERO12V_DECODER 0
+%define CONFIG_ZEROCODEC_DECODER 0
+%define CONFIG_ZLIB_DECODER 0
+%define CONFIG_ZMBV_DECODER 0
+%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
+%define CONFIG_AAC_LATM_DECODER 0
+%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
+%define CONFIG_ALAC_DECODER 0
+%define CONFIG_ALS_DECODER 0
+%define CONFIG_AMRNB_DECODER 0
+%define CONFIG_AMRWB_DECODER 0
+%define CONFIG_APE_DECODER 0
+%define CONFIG_ATRAC1_DECODER 0
+%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
+%define CONFIG_BINKAUDIO_DCT_DECODER 0
+%define CONFIG_BINKAUDIO_RDFT_DECODER 0
+%define CONFIG_BMV_AUDIO_DECODER 0
+%define CONFIG_COOK_DECODER 0
+%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+%define CONFIG_DSICINAUDIO_DECODER 0
+%define CONFIG_DSS_SP_DECODER 0
+%define CONFIG_EAC3_DECODER 0
+%define CONFIG_EVRC_DECODER 0
+%define CONFIG_FFWAVESYNTH_DECODER 0
+%define CONFIG_FLAC_DECODER 0
+%define CONFIG_G723_1_DECODER 0
+%define CONFIG_G729_DECODER 0
+%define CONFIG_GSM_DECODER 0
+%define CONFIG_GSM_MS_DECODER 0
+%define CONFIG_IAC_DECODER 0
+%define CONFIG_IMC_DECODER 0
+%define CONFIG_MACE3_DECODER 0
+%define CONFIG_MACE6_DECODER 0
+%define CONFIG_METASOUND_DECODER 0
+%define CONFIG_MLP_DECODER 0
+%define CONFIG_MP1_DECODER 0
+%define CONFIG_MP1FLOAT_DECODER 0
+%define CONFIG_MP2_DECODER 0
+%define CONFIG_MP2FLOAT_DECODER 0
+%define CONFIG_MP3_DECODER 1
+%define CONFIG_MP3FLOAT_DECODER 0
+%define CONFIG_MP3ADU_DECODER 0
+%define CONFIG_MP3ADUFLOAT_DECODER 0
+%define CONFIG_MP3ON4_DECODER 0
+%define CONFIG_MP3ON4FLOAT_DECODER 0
+%define CONFIG_MPC7_DECODER 0
+%define CONFIG_MPC8_DECODER 0
+%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
+%define CONFIG_PAF_AUDIO_DECODER 0
+%define CONFIG_QCELP_DECODER 0
+%define CONFIG_QDM2_DECODER 0
+%define CONFIG_RA_144_DECODER 0
+%define CONFIG_RA_288_DECODER 0
+%define CONFIG_RALF_DECODER 0
+%define CONFIG_SHORTEN_DECODER 0
+%define CONFIG_SIPR_DECODER 0
+%define CONFIG_SMACKAUD_DECODER 0
+%define CONFIG_SONIC_DECODER 0
+%define CONFIG_TAK_DECODER 0
+%define CONFIG_TRUEHD_DECODER 0
+%define CONFIG_TRUESPEECH_DECODER 0
+%define CONFIG_TTA_DECODER 0
+%define CONFIG_TWINVQ_DECODER 0
+%define CONFIG_VMDAUDIO_DECODER 0
+%define CONFIG_VORBIS_DECODER 1
+%define CONFIG_WAVPACK_DECODER 0
+%define CONFIG_WMALOSSLESS_DECODER 0
+%define CONFIG_WMAPRO_DECODER 0
+%define CONFIG_WMAV1_DECODER 0
+%define CONFIG_WMAV2_DECODER 0
+%define CONFIG_WMAVOICE_DECODER 0
+%define CONFIG_WS_SND1_DECODER 0
+%define CONFIG_PCM_ALAW_DECODER 1
+%define CONFIG_PCM_BLURAY_DECODER 0
+%define CONFIG_PCM_DVD_DECODER 0
+%define CONFIG_PCM_F32BE_DECODER 0
+%define CONFIG_PCM_F32LE_DECODER 1
+%define CONFIG_PCM_F64BE_DECODER 0
+%define CONFIG_PCM_F64LE_DECODER 0
+%define CONFIG_PCM_LXF_DECODER 0
+%define CONFIG_PCM_MULAW_DECODER 1
+%define CONFIG_PCM_S8_DECODER 0
+%define CONFIG_PCM_S8_PLANAR_DECODER 0
+%define CONFIG_PCM_S16BE_DECODER 1
+%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+%define CONFIG_PCM_S16LE_DECODER 1
+%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S24BE_DECODER 1
+%define CONFIG_PCM_S24DAUD_DECODER 0
+%define CONFIG_PCM_S24LE_DECODER 1
+%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S32BE_DECODER 0
+%define CONFIG_PCM_S32LE_DECODER 0
+%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+%define CONFIG_PCM_U8_DECODER 1
+%define CONFIG_PCM_U16BE_DECODER 0
+%define CONFIG_PCM_U16LE_DECODER 0
+%define CONFIG_PCM_U24BE_DECODER 0
+%define CONFIG_PCM_U24LE_DECODER 0
+%define CONFIG_PCM_U32BE_DECODER 0
+%define CONFIG_PCM_U32LE_DECODER 0
+%define CONFIG_PCM_ZORK_DECODER 0
+%define CONFIG_INTERPLAY_DPCM_DECODER 0
+%define CONFIG_ROQ_DPCM_DECODER 0
+%define CONFIG_SOL_DPCM_DECODER 0
+%define CONFIG_XAN_DPCM_DECODER 0
+%define CONFIG_ADPCM_4XM_DECODER 0
+%define CONFIG_ADPCM_ADX_DECODER 0
+%define CONFIG_ADPCM_AFC_DECODER 0
+%define CONFIG_ADPCM_CT_DECODER 0
+%define CONFIG_ADPCM_DTK_DECODER 0
+%define CONFIG_ADPCM_EA_DECODER 0
+%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+%define CONFIG_ADPCM_EA_R1_DECODER 0
+%define CONFIG_ADPCM_EA_R2_DECODER 0
+%define CONFIG_ADPCM_EA_R3_DECODER 0
+%define CONFIG_ADPCM_EA_XAS_DECODER 0
+%define CONFIG_ADPCM_G722_DECODER 0
+%define CONFIG_ADPCM_G726_DECODER 0
+%define CONFIG_ADPCM_G726LE_DECODER 0
+%define CONFIG_ADPCM_IMA_AMV_DECODER 0
+%define CONFIG_ADPCM_IMA_APC_DECODER 0
+%define CONFIG_ADPCM_IMA_DK3_DECODER 0
+%define CONFIG_ADPCM_IMA_DK4_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+%define CONFIG_ADPCM_IMA_ISS_DECODER 0
+%define CONFIG_ADPCM_IMA_OKI_DECODER 0
+%define CONFIG_ADPCM_IMA_QT_DECODER 0
+%define CONFIG_ADPCM_IMA_RAD_DECODER 0
+%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+%define CONFIG_ADPCM_IMA_WAV_DECODER 0
+%define CONFIG_ADPCM_IMA_WS_DECODER 0
+%define CONFIG_ADPCM_MS_DECODER 0
+%define CONFIG_ADPCM_SBPRO_2_DECODER 0
+%define CONFIG_ADPCM_SBPRO_3_DECODER 0
+%define CONFIG_ADPCM_SBPRO_4_DECODER 0
+%define CONFIG_ADPCM_SWF_DECODER 0
+%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
+%define CONFIG_ADPCM_XA_DECODER 0
+%define CONFIG_ADPCM_YAMAHA_DECODER 0
+%define CONFIG_SSA_DECODER 0
+%define CONFIG_ASS_DECODER 0
+%define CONFIG_CCAPTION_DECODER 0
+%define CONFIG_DVBSUB_DECODER 0
+%define CONFIG_DVDSUB_DECODER 0
+%define CONFIG_JACOSUB_DECODER 0
+%define CONFIG_MICRODVD_DECODER 0
+%define CONFIG_MOVTEXT_DECODER 0
+%define CONFIG_MPL2_DECODER 0
+%define CONFIG_PGSSUB_DECODER 0
+%define CONFIG_PJS_DECODER 0
+%define CONFIG_REALTEXT_DECODER 0
+%define CONFIG_SAMI_DECODER 0
+%define CONFIG_SRT_DECODER 0
+%define CONFIG_STL_DECODER 0
+%define CONFIG_SUBRIP_DECODER 0
+%define CONFIG_SUBVIEWER_DECODER 0
+%define CONFIG_SUBVIEWER1_DECODER 0
+%define CONFIG_TEXT_DECODER 0
+%define CONFIG_VPLAYER_DECODER 0
+%define CONFIG_WEBVTT_DECODER 0
+%define CONFIG_XSUB_DECODER 0
+%define CONFIG_LIBCELT_DECODER 0
+%define CONFIG_LIBDCADEC_DECODER 0
+%define CONFIG_LIBFDK_AAC_DECODER 0
+%define CONFIG_LIBGSM_DECODER 0
+%define CONFIG_LIBGSM_MS_DECODER 0
+%define CONFIG_LIBILBC_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+%define CONFIG_LIBOPENJPEG_DECODER 0
+%define CONFIG_LIBOPUS_DECODER 0
+%define CONFIG_LIBSCHROEDINGER_DECODER 0
+%define CONFIG_LIBSPEEX_DECODER 0
+%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+%define CONFIG_LIBUTVIDEO_DECODER 0
+%define CONFIG_LIBVORBIS_DECODER 0
+%define CONFIG_LIBVPX_VP8_DECODER 0
+%define CONFIG_LIBVPX_VP9_DECODER 0
+%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+%define CONFIG_BINTEXT_DECODER 0
+%define CONFIG_XBIN_DECODER 0
+%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 1
+%define CONFIG_AC3_DEMUXER 0
+%define CONFIG_ACT_DEMUXER 0
+%define CONFIG_ADF_DEMUXER 0
+%define CONFIG_ADP_DEMUXER 0
+%define CONFIG_ADX_DEMUXER 0
+%define CONFIG_AEA_DEMUXER 0
+%define CONFIG_AFC_DEMUXER 0
+%define CONFIG_AIFF_DEMUXER 0
+%define CONFIG_AMR_DEMUXER 0
+%define CONFIG_ANM_DEMUXER 0
+%define CONFIG_APC_DEMUXER 0
+%define CONFIG_APE_DEMUXER 0
+%define CONFIG_APNG_DEMUXER 0
+%define CONFIG_AQTITLE_DEMUXER 0
+%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
+%define CONFIG_ASS_DEMUXER 0
+%define CONFIG_AST_DEMUXER 0
+%define CONFIG_AU_DEMUXER 0
+%define CONFIG_AVI_DEMUXER 0
+%define CONFIG_AVISYNTH_DEMUXER 0
+%define CONFIG_AVR_DEMUXER 0
+%define CONFIG_AVS_DEMUXER 0
+%define CONFIG_BETHSOFTVID_DEMUXER 0
+%define CONFIG_BFI_DEMUXER 0
+%define CONFIG_BINTEXT_DEMUXER 0
+%define CONFIG_BINK_DEMUXER 0
+%define CONFIG_BIT_DEMUXER 0
+%define CONFIG_BMV_DEMUXER 0
+%define CONFIG_BFSTM_DEMUXER 0
+%define CONFIG_BRSTM_DEMUXER 0
+%define CONFIG_BOA_DEMUXER 0
+%define CONFIG_C93_DEMUXER 0
+%define CONFIG_CAF_DEMUXER 0
+%define CONFIG_CAVSVIDEO_DEMUXER 0
+%define CONFIG_CDG_DEMUXER 0
+%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
+%define CONFIG_CONCAT_DEMUXER 0
+%define CONFIG_DATA_DEMUXER 0
+%define CONFIG_DAUD_DEMUXER 0
+%define CONFIG_DFA_DEMUXER 0
+%define CONFIG_DIRAC_DEMUXER 0
+%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
+%define CONFIG_DSICIN_DEMUXER 0
+%define CONFIG_DSS_DEMUXER 0
+%define CONFIG_DTS_DEMUXER 0
+%define CONFIG_DTSHD_DEMUXER 0
+%define CONFIG_DV_DEMUXER 0
+%define CONFIG_DVBSUB_DEMUXER 0
+%define CONFIG_DXA_DEMUXER 0
+%define CONFIG_EA_DEMUXER 0
+%define CONFIG_EA_CDATA_DEMUXER 0
+%define CONFIG_EAC3_DEMUXER 0
+%define CONFIG_EPAF_DEMUXER 0
+%define CONFIG_FFM_DEMUXER 0
+%define CONFIG_FFMETADATA_DEMUXER 0
+%define CONFIG_FILMSTRIP_DEMUXER 0
+%define CONFIG_FLAC_DEMUXER 0
+%define CONFIG_FLIC_DEMUXER 0
+%define CONFIG_FLV_DEMUXER 0
+%define CONFIG_LIVE_FLV_DEMUXER 0
+%define CONFIG_FOURXM_DEMUXER 0
+%define CONFIG_FRM_DEMUXER 0
+%define CONFIG_G722_DEMUXER 0
+%define CONFIG_G723_1_DEMUXER 0
+%define CONFIG_G729_DEMUXER 0
+%define CONFIG_GIF_DEMUXER 0
+%define CONFIG_GSM_DEMUXER 0
+%define CONFIG_GXF_DEMUXER 0
+%define CONFIG_H261_DEMUXER 0
+%define CONFIG_H263_DEMUXER 0
+%define CONFIG_H264_DEMUXER 0
+%define CONFIG_HEVC_DEMUXER 0
+%define CONFIG_HLS_DEMUXER 0
+%define CONFIG_HNM_DEMUXER 0
+%define CONFIG_ICO_DEMUXER 0
+%define CONFIG_IDCIN_DEMUXER 0
+%define CONFIG_IDF_DEMUXER 0
+%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_ILBC_DEMUXER 0
+%define CONFIG_IMAGE2_DEMUXER 0
+%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+%define CONFIG_INGENIENT_DEMUXER 0
+%define CONFIG_IPMOVIE_DEMUXER 0
+%define CONFIG_IRCAM_DEMUXER 0
+%define CONFIG_ISS_DEMUXER 0
+%define CONFIG_IV8_DEMUXER 0
+%define CONFIG_IVF_DEMUXER 0
+%define CONFIG_JACOSUB_DEMUXER 0
+%define CONFIG_JV_DEMUXER 0
+%define CONFIG_LATM_DEMUXER 0
+%define CONFIG_LMLM4_DEMUXER 0
+%define CONFIG_LOAS_DEMUXER 0
+%define CONFIG_LRC_DEMUXER 0
+%define CONFIG_LVF_DEMUXER 0
+%define CONFIG_LXF_DEMUXER 0
+%define CONFIG_M4V_DEMUXER 0
+%define CONFIG_MATROSKA_DEMUXER 1
+%define CONFIG_MGSTS_DEMUXER 0
+%define CONFIG_MICRODVD_DEMUXER 0
+%define CONFIG_MJPEG_DEMUXER 0
+%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
+%define CONFIG_MM_DEMUXER 0
+%define CONFIG_MMF_DEMUXER 0
+%define CONFIG_MOV_DEMUXER 1
+%define CONFIG_MP3_DEMUXER 1
+%define CONFIG_MPC_DEMUXER 0
+%define CONFIG_MPC8_DEMUXER 0
+%define CONFIG_MPEGPS_DEMUXER 0
+%define CONFIG_MPEGTS_DEMUXER 0
+%define CONFIG_MPEGTSRAW_DEMUXER 0
+%define CONFIG_MPEGVIDEO_DEMUXER 0
+%define CONFIG_MPJPEG_DEMUXER 0
+%define CONFIG_MPL2_DEMUXER 0
+%define CONFIG_MPSUB_DEMUXER 0
+%define CONFIG_MSNWC_TCP_DEMUXER 0
+%define CONFIG_MTV_DEMUXER 0
+%define CONFIG_MV_DEMUXER 0
+%define CONFIG_MVI_DEMUXER 0
+%define CONFIG_MXF_DEMUXER 0
+%define CONFIG_MXG_DEMUXER 0
+%define CONFIG_NC_DEMUXER 0
+%define CONFIG_NISTSPHERE_DEMUXER 0
+%define CONFIG_NSV_DEMUXER 0
+%define CONFIG_NUT_DEMUXER 0
+%define CONFIG_NUV_DEMUXER 0
+%define CONFIG_OGG_DEMUXER 1
+%define CONFIG_OMA_DEMUXER 0
+%define CONFIG_PAF_DEMUXER 0
+%define CONFIG_PCM_ALAW_DEMUXER 0
+%define CONFIG_PCM_MULAW_DEMUXER 0
+%define CONFIG_PCM_F64BE_DEMUXER 0
+%define CONFIG_PCM_F64LE_DEMUXER 0
+%define CONFIG_PCM_F32BE_DEMUXER 0
+%define CONFIG_PCM_F32LE_DEMUXER 0
+%define CONFIG_PCM_S32BE_DEMUXER 0
+%define CONFIG_PCM_S32LE_DEMUXER 0
+%define CONFIG_PCM_S24BE_DEMUXER 0
+%define CONFIG_PCM_S24LE_DEMUXER 0
+%define CONFIG_PCM_S16BE_DEMUXER 0
+%define CONFIG_PCM_S16LE_DEMUXER 0
+%define CONFIG_PCM_S8_DEMUXER 0
+%define CONFIG_PCM_U32BE_DEMUXER 0
+%define CONFIG_PCM_U32LE_DEMUXER 0
+%define CONFIG_PCM_U24BE_DEMUXER 0
+%define CONFIG_PCM_U24LE_DEMUXER 0
+%define CONFIG_PCM_U16BE_DEMUXER 0
+%define CONFIG_PCM_U16LE_DEMUXER 0
+%define CONFIG_PCM_U8_DEMUXER 0
+%define CONFIG_PJS_DEMUXER 0
+%define CONFIG_PMP_DEMUXER 0
+%define CONFIG_PVA_DEMUXER 0
+%define CONFIG_PVF_DEMUXER 0
+%define CONFIG_QCP_DEMUXER 0
+%define CONFIG_R3D_DEMUXER 0
+%define CONFIG_RAWVIDEO_DEMUXER 0
+%define CONFIG_REALTEXT_DEMUXER 0
+%define CONFIG_REDSPARK_DEMUXER 0
+%define CONFIG_RL2_DEMUXER 0
+%define CONFIG_RM_DEMUXER 0
+%define CONFIG_ROQ_DEMUXER 0
+%define CONFIG_RPL_DEMUXER 0
+%define CONFIG_RSD_DEMUXER 0
+%define CONFIG_RSO_DEMUXER 0
+%define CONFIG_RTP_DEMUXER 0
+%define CONFIG_RTSP_DEMUXER 0
+%define CONFIG_SAMI_DEMUXER 0
+%define CONFIG_SAP_DEMUXER 0
+%define CONFIG_SBG_DEMUXER 0
+%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
+%define CONFIG_SEGAFILM_DEMUXER 0
+%define CONFIG_SHORTEN_DEMUXER 0
+%define CONFIG_SIFF_DEMUXER 0
+%define CONFIG_SLN_DEMUXER 0
+%define CONFIG_SMACKER_DEMUXER 0
+%define CONFIG_SMJPEG_DEMUXER 0
+%define CONFIG_SMUSH_DEMUXER 0
+%define CONFIG_SOL_DEMUXER 0
+%define CONFIG_SOX_DEMUXER 0
+%define CONFIG_SPDIF_DEMUXER 0
+%define CONFIG_SRT_DEMUXER 0
+%define CONFIG_STR_DEMUXER 0
+%define CONFIG_STL_DEMUXER 0
+%define CONFIG_SUBVIEWER1_DEMUXER 0
+%define CONFIG_SUBVIEWER_DEMUXER 0
+%define CONFIG_SUP_DEMUXER 0
+%define CONFIG_SWF_DEMUXER 0
+%define CONFIG_TAK_DEMUXER 0
+%define CONFIG_TEDCAPTIONS_DEMUXER 0
+%define CONFIG_THP_DEMUXER 0
+%define CONFIG_TIERTEXSEQ_DEMUXER 0
+%define CONFIG_TMV_DEMUXER 0
+%define CONFIG_TRUEHD_DEMUXER 0
+%define CONFIG_TTA_DEMUXER 0
+%define CONFIG_TXD_DEMUXER 0
+%define CONFIG_TTY_DEMUXER 0
+%define CONFIG_VC1_DEMUXER 0
+%define CONFIG_VC1T_DEMUXER 0
+%define CONFIG_VIVO_DEMUXER 0
+%define CONFIG_VMD_DEMUXER 0
+%define CONFIG_VOBSUB_DEMUXER 0
+%define CONFIG_VOC_DEMUXER 0
+%define CONFIG_VPLAYER_DEMUXER 0
+%define CONFIG_VQF_DEMUXER 0
+%define CONFIG_W64_DEMUXER 0
+%define CONFIG_WAV_DEMUXER 1
+%define CONFIG_WC3_DEMUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+%define CONFIG_WEBVTT_DEMUXER 0
+%define CONFIG_WSAUD_DEMUXER 0
+%define CONFIG_WSVQA_DEMUXER 0
+%define CONFIG_WTV_DEMUXER 0
+%define CONFIG_WV_DEMUXER 0
+%define CONFIG_XA_DEMUXER 0
+%define CONFIG_XBIN_DEMUXER 0
+%define CONFIG_XMV_DEMUXER 0
+%define CONFIG_XWMA_DEMUXER 0
+%define CONFIG_YOP_DEMUXER 0
+%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+%define CONFIG_LIBGME_DEMUXER 0
+%define CONFIG_LIBMODPLUG_DEMUXER 0
+%define CONFIG_LIBNUT_DEMUXER 0
+%define CONFIG_LIBQUVI_DEMUXER 0
+%define CONFIG_A64MULTI_ENCODER 0
+%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
+%define CONFIG_AMV_ENCODER 0
+%define CONFIG_APNG_ENCODER 0
+%define CONFIG_ASV1_ENCODER 0
+%define CONFIG_ASV2_ENCODER 0
+%define CONFIG_AVRP_ENCODER 0
+%define CONFIG_AVUI_ENCODER 0
+%define CONFIG_AYUV_ENCODER 0
+%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
+%define CONFIG_CLJR_ENCODER 0
+%define CONFIG_COMFORTNOISE_ENCODER 0
+%define CONFIG_DNXHD_ENCODER 0
+%define CONFIG_DPX_ENCODER 0
+%define CONFIG_DVVIDEO_ENCODER 0
+%define CONFIG_FFV1_ENCODER 0
+%define CONFIG_FFVHUFF_ENCODER 0
+%define CONFIG_FLASHSV_ENCODER 0
+%define CONFIG_FLASHSV2_ENCODER 0
+%define CONFIG_FLV_ENCODER 0
+%define CONFIG_GIF_ENCODER 0
+%define CONFIG_H261_ENCODER 0
+%define CONFIG_H263_ENCODER 0
+%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
+%define CONFIG_HUFFYUV_ENCODER 0
+%define CONFIG_JPEG2000_ENCODER 0
+%define CONFIG_JPEGLS_ENCODER 0
+%define CONFIG_LJPEG_ENCODER 0
+%define CONFIG_MJPEG_ENCODER 0
+%define CONFIG_MPEG1VIDEO_ENCODER 0
+%define CONFIG_MPEG2VIDEO_ENCODER 0
+%define CONFIG_MPEG4_ENCODER 0
+%define CONFIG_MSMPEG4V2_ENCODER 0
+%define CONFIG_MSMPEG4V3_ENCODER 0
+%define CONFIG_MSVIDEO1_ENCODER 0
+%define CONFIG_PAM_ENCODER 0
+%define CONFIG_PBM_ENCODER 0
+%define CONFIG_PCX_ENCODER 0
+%define CONFIG_PGM_ENCODER 0
+%define CONFIG_PGMYUV_ENCODER 0
+%define CONFIG_PNG_ENCODER 0
+%define CONFIG_PPM_ENCODER 0
+%define CONFIG_PRORES_ENCODER 0
+%define CONFIG_PRORES_AW_ENCODER 0
+%define CONFIG_PRORES_KS_ENCODER 0
+%define CONFIG_QTRLE_ENCODER 0
+%define CONFIG_R10K_ENCODER 0
+%define CONFIG_R210_ENCODER 0
+%define CONFIG_RAWVIDEO_ENCODER 0
+%define CONFIG_ROQ_ENCODER 0
+%define CONFIG_RV10_ENCODER 0
+%define CONFIG_RV20_ENCODER 0
+%define CONFIG_S302M_ENCODER 0
+%define CONFIG_SGI_ENCODER 0
+%define CONFIG_SNOW_ENCODER 0
+%define CONFIG_SUNRAST_ENCODER 0
+%define CONFIG_SVQ1_ENCODER 0
+%define CONFIG_TARGA_ENCODER 0
+%define CONFIG_TIFF_ENCODER 0
+%define CONFIG_UTVIDEO_ENCODER 0
+%define CONFIG_V210_ENCODER 0
+%define CONFIG_V308_ENCODER 0
+%define CONFIG_V408_ENCODER 0
+%define CONFIG_V410_ENCODER 0
+%define CONFIG_WMV1_ENCODER 0
+%define CONFIG_WMV2_ENCODER 0
+%define CONFIG_XBM_ENCODER 0
+%define CONFIG_XFACE_ENCODER 0
+%define CONFIG_XWD_ENCODER 0
+%define CONFIG_Y41P_ENCODER 0
+%define CONFIG_YUV4_ENCODER 0
+%define CONFIG_ZLIB_ENCODER 0
+%define CONFIG_ZMBV_ENCODER 0
+%define CONFIG_AAC_ENCODER 0
+%define CONFIG_AC3_ENCODER 0
+%define CONFIG_AC3_FIXED_ENCODER 0
+%define CONFIG_ALAC_ENCODER 0
+%define CONFIG_DCA_ENCODER 0
+%define CONFIG_EAC3_ENCODER 0
+%define CONFIG_FLAC_ENCODER 0
+%define CONFIG_G723_1_ENCODER 0
+%define CONFIG_MP2_ENCODER 0
+%define CONFIG_MP2FIXED_ENCODER 0
+%define CONFIG_NELLYMOSER_ENCODER 0
+%define CONFIG_RA_144_ENCODER 0
+%define CONFIG_SONIC_ENCODER 0
+%define CONFIG_SONIC_LS_ENCODER 0
+%define CONFIG_TTA_ENCODER 0
+%define CONFIG_VORBIS_ENCODER 0
+%define CONFIG_WAVPACK_ENCODER 0
+%define CONFIG_WMAV1_ENCODER 0
+%define CONFIG_WMAV2_ENCODER 0
+%define CONFIG_PCM_ALAW_ENCODER 0
+%define CONFIG_PCM_F32BE_ENCODER 0
+%define CONFIG_PCM_F32LE_ENCODER 0
+%define CONFIG_PCM_F64BE_ENCODER 0
+%define CONFIG_PCM_F64LE_ENCODER 0
+%define CONFIG_PCM_MULAW_ENCODER 0
+%define CONFIG_PCM_S8_ENCODER 0
+%define CONFIG_PCM_S8_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16BE_ENCODER 0
+%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16LE_ENCODER 0
+%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S24BE_ENCODER 0
+%define CONFIG_PCM_S24DAUD_ENCODER 0
+%define CONFIG_PCM_S24LE_ENCODER 0
+%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S32BE_ENCODER 0
+%define CONFIG_PCM_S32LE_ENCODER 0
+%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_U8_ENCODER 0
+%define CONFIG_PCM_U16BE_ENCODER 0
+%define CONFIG_PCM_U16LE_ENCODER 0
+%define CONFIG_PCM_U24BE_ENCODER 0
+%define CONFIG_PCM_U24LE_ENCODER 0
+%define CONFIG_PCM_U32BE_ENCODER 0
+%define CONFIG_PCM_U32LE_ENCODER 0
+%define CONFIG_ROQ_DPCM_ENCODER 0
+%define CONFIG_ADPCM_ADX_ENCODER 0
+%define CONFIG_ADPCM_G722_ENCODER 0
+%define CONFIG_ADPCM_G726_ENCODER 0
+%define CONFIG_ADPCM_IMA_QT_ENCODER 0
+%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+%define CONFIG_ADPCM_MS_ENCODER 0
+%define CONFIG_ADPCM_SWF_ENCODER 0
+%define CONFIG_ADPCM_YAMAHA_ENCODER 0
+%define CONFIG_SSA_ENCODER 0
+%define CONFIG_ASS_ENCODER 0
+%define CONFIG_DVBSUB_ENCODER 0
+%define CONFIG_DVDSUB_ENCODER 0
+%define CONFIG_MOVTEXT_ENCODER 0
+%define CONFIG_SRT_ENCODER 0
+%define CONFIG_SUBRIP_ENCODER 0
+%define CONFIG_WEBVTT_ENCODER 0
+%define CONFIG_XSUB_ENCODER 0
+%define CONFIG_LIBFAAC_ENCODER 0
+%define CONFIG_LIBFDK_AAC_ENCODER 0
+%define CONFIG_LIBGSM_ENCODER 0
+%define CONFIG_LIBGSM_MS_ENCODER 0
+%define CONFIG_LIBILBC_ENCODER 0
+%define CONFIG_LIBMP3LAME_ENCODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+%define CONFIG_LIBOPENJPEG_ENCODER 0
+%define CONFIG_LIBOPUS_ENCODER 0
+%define CONFIG_LIBSCHROEDINGER_ENCODER 0
+%define CONFIG_LIBSHINE_ENCODER 0
+%define CONFIG_LIBSPEEX_ENCODER 0
+%define CONFIG_LIBTHEORA_ENCODER 0
+%define CONFIG_LIBTWOLAME_ENCODER 0
+%define CONFIG_LIBUTVIDEO_ENCODER 0
+%define CONFIG_LIBVO_AACENC_ENCODER 0
+%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+%define CONFIG_LIBVORBIS_ENCODER 0
+%define CONFIG_LIBVPX_VP8_ENCODER 0
+%define CONFIG_LIBVPX_VP9_ENCODER 0
+%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ANIM_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
+%define CONFIG_LIBX264_ENCODER 0
+%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
+%define CONFIG_LIBXAVS_ENCODER 0
+%define CONFIG_LIBXVID_ENCODER 0
+%define CONFIG_LIBAACPLUS_ENCODER 0
+%define CONFIG_LIBOPENH264_ENCODER 0
+%define CONFIG_H264_QSV_ENCODER 0
+%define CONFIG_NVENC_ENCODER 0
+%define CONFIG_NVENC_H264_ENCODER 0
+%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
+%define CONFIG_ADELAY_FILTER 0
+%define CONFIG_AECHO_FILTER 0
+%define CONFIG_AEVAL_FILTER 0
+%define CONFIG_AFADE_FILTER 0
+%define CONFIG_AFORMAT_FILTER 0
+%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
+%define CONFIG_ALLPASS_FILTER 0
+%define CONFIG_AMERGE_FILTER 0
+%define CONFIG_AMIX_FILTER 0
+%define CONFIG_ANULL_FILTER 0
+%define CONFIG_APAD_FILTER 0
+%define CONFIG_APERMS_FILTER 0
+%define CONFIG_APHASER_FILTER 0
+%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
+%define CONFIG_ASELECT_FILTER 0
+%define CONFIG_ASENDCMD_FILTER 0
+%define CONFIG_ASETNSAMPLES_FILTER 0
+%define CONFIG_ASETPTS_FILTER 0
+%define CONFIG_ASETRATE_FILTER 0
+%define CONFIG_ASETTB_FILTER 0
+%define CONFIG_ASHOWINFO_FILTER 0
+%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASTATS_FILTER 0
+%define CONFIG_ASTREAMSYNC_FILTER 0
+%define CONFIG_ASYNCTS_FILTER 0
+%define CONFIG_ATEMPO_FILTER 0
+%define CONFIG_ATRIM_FILTER 0
+%define CONFIG_AZMQ_FILTER 0
+%define CONFIG_BANDPASS_FILTER 0
+%define CONFIG_BANDREJECT_FILTER 0
+%define CONFIG_BASS_FILTER 0
+%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
+%define CONFIG_CHANNELMAP_FILTER 0
+%define CONFIG_CHANNELSPLIT_FILTER 0
+%define CONFIG_CHORUS_FILTER 0
+%define CONFIG_COMPAND_FILTER 0
+%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
+%define CONFIG_EARWAX_FILTER 0
+%define CONFIG_EBUR128_FILTER 0
+%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
+%define CONFIG_FLANGER_FILTER 0
+%define CONFIG_HIGHPASS_FILTER 0
+%define CONFIG_JOIN_FILTER 0
+%define CONFIG_LADSPA_FILTER 0
+%define CONFIG_LOWPASS_FILTER 0
+%define CONFIG_PAN_FILTER 0
+%define CONFIG_REPLAYGAIN_FILTER 0
+%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+%define CONFIG_SILENCEDETECT_FILTER 0
+%define CONFIG_SILENCEREMOVE_FILTER 0
+%define CONFIG_TREBLE_FILTER 0
+%define CONFIG_VOLUME_FILTER 0
+%define CONFIG_VOLUMEDETECT_FILTER 0
+%define CONFIG_AEVALSRC_FILTER 0
+%define CONFIG_ANULLSRC_FILTER 0
+%define CONFIG_FLITE_FILTER 0
+%define CONFIG_SINE_FILTER 0
+%define CONFIG_ANULLSINK_FILTER 0
+%define CONFIG_ALPHAEXTRACT_FILTER 0
+%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
+%define CONFIG_ASS_FILTER 0
+%define CONFIG_BBOX_FILTER 0
+%define CONFIG_BLACKDETECT_FILTER 0
+%define CONFIG_BLACKFRAME_FILTER 0
+%define CONFIG_BLEND_FILTER 0
+%define CONFIG_BOXBLUR_FILTER 0
+%define CONFIG_CODECVIEW_FILTER 0
+%define CONFIG_COLORBALANCE_FILTER 0
+%define CONFIG_COLORCHANNELMIXER_FILTER 0
+%define CONFIG_COLORKEY_FILTER 0
+%define CONFIG_COLORLEVELS_FILTER 0
+%define CONFIG_COLORMATRIX_FILTER 0
+%define CONFIG_COPY_FILTER 0
+%define CONFIG_COVER_RECT_FILTER 0
+%define CONFIG_CROP_FILTER 0
+%define CONFIG_CROPDETECT_FILTER 0
+%define CONFIG_CURVES_FILTER 0
+%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
+%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
+%define CONFIG_DELOGO_FILTER 0
+%define CONFIG_DESHAKE_FILTER 0
+%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
+%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
+%define CONFIG_DRAWGRID_FILTER 0
+%define CONFIG_DRAWTEXT_FILTER 0
+%define CONFIG_EDGEDETECT_FILTER 0
+%define CONFIG_ELBG_FILTER 0
+%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
+%define CONFIG_EXTRACTPLANES_FILTER 0
+%define CONFIG_FADE_FILTER 0
+%define CONFIG_FFTFILT_FILTER 0
+%define CONFIG_FIELD_FILTER 0
+%define CONFIG_FIELDMATCH_FILTER 0
+%define CONFIG_FIELDORDER_FILTER 0
+%define CONFIG_FIND_RECT_FILTER 0
+%define CONFIG_FORMAT_FILTER 0
+%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
+%define CONFIG_FRAMESTEP_FILTER 0
+%define CONFIG_FREI0R_FILTER 0
+%define CONFIG_FSPP_FILTER 0
+%define CONFIG_GEQ_FILTER 0
+%define CONFIG_GRADFUN_FILTER 0
+%define CONFIG_HALDCLUT_FILTER 0
+%define CONFIG_HFLIP_FILTER 0
+%define CONFIG_HISTEQ_FILTER 0
+%define CONFIG_HISTOGRAM_FILTER 0
+%define CONFIG_HQDN3D_FILTER 0
+%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
+%define CONFIG_HUE_FILTER 0
+%define CONFIG_IDET_FILTER 0
+%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
+%define CONFIG_INTERLACE_FILTER 0
+%define CONFIG_INTERLEAVE_FILTER 0
+%define CONFIG_KERNDEINT_FILTER 0
+%define CONFIG_LENSCORRECTION_FILTER 0
+%define CONFIG_LUT3D_FILTER 0
+%define CONFIG_LUT_FILTER 0
+%define CONFIG_LUTRGB_FILTER 0
+%define CONFIG_LUTYUV_FILTER 0
+%define CONFIG_MCDEINT_FILTER 0
+%define CONFIG_MERGEPLANES_FILTER 0
+%define CONFIG_MPDECIMATE_FILTER 0
+%define CONFIG_NEGATE_FILTER 0
+%define CONFIG_NOFORMAT_FILTER 0
+%define CONFIG_NOISE_FILTER 0
+%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
+%define CONFIG_OCV_FILTER 0
+%define CONFIG_OVERLAY_FILTER 0
+%define CONFIG_OWDENOISE_FILTER 0
+%define CONFIG_PAD_FILTER 0
+%define CONFIG_PALETTEGEN_FILTER 0
+%define CONFIG_PALETTEUSE_FILTER 0
+%define CONFIG_PERMS_FILTER 0
+%define CONFIG_PERSPECTIVE_FILTER 0
+%define CONFIG_PHASE_FILTER 0
+%define CONFIG_PIXDESCTEST_FILTER 0
+%define CONFIG_PP_FILTER 0
+%define CONFIG_PP7_FILTER 0
+%define CONFIG_PSNR_FILTER 0
+%define CONFIG_PULLUP_FILTER 0
+%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
+%define CONFIG_REMOVELOGO_FILTER 0
+%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
+%define CONFIG_ROTATE_FILTER 0
+%define CONFIG_SAB_FILTER 0
+%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
+%define CONFIG_SELECT_FILTER 0
+%define CONFIG_SENDCMD_FILTER 0
+%define CONFIG_SEPARATEFIELDS_FILTER 0
+%define CONFIG_SETDAR_FILTER 0
+%define CONFIG_SETFIELD_FILTER 0
+%define CONFIG_SETPTS_FILTER 0
+%define CONFIG_SETSAR_FILTER 0
+%define CONFIG_SETTB_FILTER 0
+%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHOWPALETTE_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
+%define CONFIG_SIGNALSTATS_FILTER 0
+%define CONFIG_SMARTBLUR_FILTER 0
+%define CONFIG_SPLIT_FILTER 0
+%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
+%define CONFIG_STEREO3D_FILTER 0
+%define CONFIG_SUBTITLES_FILTER 0
+%define CONFIG_SUPER2XSAI_FILTER 0
+%define CONFIG_SWAPUV_FILTER 0
+%define CONFIG_TBLEND_FILTER 0
+%define CONFIG_TELECINE_FILTER 0
+%define CONFIG_THUMBNAIL_FILTER 0
+%define CONFIG_TILE_FILTER 0
+%define CONFIG_TINTERLACE_FILTER 0
+%define CONFIG_TRANSPOSE_FILTER 0
+%define CONFIG_TRIM_FILTER 0
+%define CONFIG_UNSHARP_FILTER 0
+%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
+%define CONFIG_VFLIP_FILTER 0
+%define CONFIG_VIDSTABDETECT_FILTER 0
+%define CONFIG_VIDSTABTRANSFORM_FILTER 0
+%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
+%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
+%define CONFIG_XBR_FILTER 0
+%define CONFIG_YADIF_FILTER 0
+%define CONFIG_ZMQ_FILTER 0
+%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
+%define CONFIG_CELLAUTO_FILTER 0
+%define CONFIG_COLOR_FILTER 0
+%define CONFIG_FREI0R_SRC_FILTER 0
+%define CONFIG_HALDCLUTSRC_FILTER 0
+%define CONFIG_LIFE_FILTER 0
+%define CONFIG_MANDELBROT_FILTER 0
+%define CONFIG_MPTESTSRC_FILTER 0
+%define CONFIG_NULLSRC_FILTER 0
+%define CONFIG_RGBTESTSRC_FILTER 0
+%define CONFIG_SMPTEBARS_FILTER 0
+%define CONFIG_SMPTEHDBARS_FILTER 0
+%define CONFIG_TESTSRC_FILTER 0
+%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
+%define CONFIG_AVECTORSCOPE_FILTER 0
+%define CONFIG_CONCAT_FILTER 0
+%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
+%define CONFIG_SHOWWAVES_FILTER 0
+%define CONFIG_SHOWWAVESPIC_FILTER 0
+%define CONFIG_AMOVIE_FILTER 0
+%define CONFIG_MOVIE_FILTER 0
+%define CONFIG_H263_VAAPI_HWACCEL 0
+%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_H264_D3D11VA_HWACCEL 0
+%define CONFIG_H264_DXVA2_HWACCEL 0
+%define CONFIG_H264_MMAL_HWACCEL 0
+%define CONFIG_H264_QSV_HWACCEL 0
+%define CONFIG_H264_VAAPI_HWACCEL 0
+%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
+%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_HEVC_D3D11VA_HWACCEL 0
+%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
+%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
+%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
+%define CONFIG_MPEG2_VAAPI_HWACCEL 0
+%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG4_VAAPI_HWACCEL 0
+%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_VC1_D3D11VA_HWACCEL 0
+%define CONFIG_VC1_DXVA2_HWACCEL 0
+%define CONFIG_VC1_VAAPI_HWACCEL 0
+%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
+%define CONFIG_WMV3_D3D11VA_HWACCEL 0
+%define CONFIG_WMV3_DXVA2_HWACCEL 0
+%define CONFIG_WMV3_VAAPI_HWACCEL 0
+%define CONFIG_WMV3_VDPAU_HWACCEL 0
+%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
+%define CONFIG_BKTR_INDEV 0
+%define CONFIG_DECKLINK_INDEV 0
+%define CONFIG_DSHOW_INDEV 0
+%define CONFIG_DV1394_INDEV 0
+%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
+%define CONFIG_IEC61883_INDEV 0
+%define CONFIG_JACK_INDEV 0
+%define CONFIG_LAVFI_INDEV 0
+%define CONFIG_OPENAL_INDEV 0
+%define CONFIG_OSS_INDEV 0
+%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
+%define CONFIG_SNDIO_INDEV 0
+%define CONFIG_V4L2_INDEV 0
+%define CONFIG_VFWCAP_INDEV 0
+%define CONFIG_X11GRAB_INDEV 0
+%define CONFIG_X11GRAB_XCB_INDEV 0
+%define CONFIG_LIBCDIO_INDEV 0
+%define CONFIG_LIBDC1394_INDEV 0
+%define CONFIG_A64_MUXER 0
+%define CONFIG_AC3_MUXER 0
+%define CONFIG_ADTS_MUXER 0
+%define CONFIG_ADX_MUXER 0
+%define CONFIG_AIFF_MUXER 0
+%define CONFIG_AMR_MUXER 0
+%define CONFIG_APNG_MUXER 0
+%define CONFIG_ASF_MUXER 0
+%define CONFIG_ASS_MUXER 0
+%define CONFIG_AST_MUXER 0
+%define CONFIG_ASF_STREAM_MUXER 0
+%define CONFIG_AU_MUXER 0
+%define CONFIG_AVI_MUXER 0
+%define CONFIG_AVM2_MUXER 0
+%define CONFIG_BIT_MUXER 0
+%define CONFIG_CAF_MUXER 0
+%define CONFIG_CAVSVIDEO_MUXER 0
+%define CONFIG_CRC_MUXER 0
+%define CONFIG_DASH_MUXER 0
+%define CONFIG_DATA_MUXER 0
+%define CONFIG_DAUD_MUXER 0
+%define CONFIG_DIRAC_MUXER 0
+%define CONFIG_DNXHD_MUXER 0
+%define CONFIG_DTS_MUXER 0
+%define CONFIG_DV_MUXER 0
+%define CONFIG_EAC3_MUXER 0
+%define CONFIG_F4V_MUXER 0
+%define CONFIG_FFM_MUXER 0
+%define CONFIG_FFMETADATA_MUXER 0
+%define CONFIG_FILMSTRIP_MUXER 0
+%define CONFIG_FLAC_MUXER 0
+%define CONFIG_FLV_MUXER 0
+%define CONFIG_FRAMECRC_MUXER 0
+%define CONFIG_FRAMEMD5_MUXER 0
+%define CONFIG_G722_MUXER 0
+%define CONFIG_G723_1_MUXER 0
+%define CONFIG_GIF_MUXER 0
+%define CONFIG_GXF_MUXER 0
+%define CONFIG_H261_MUXER 0
+%define CONFIG_H263_MUXER 0
+%define CONFIG_H264_MUXER 0
+%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
+%define CONFIG_HLS_MUXER 0
+%define CONFIG_ICO_MUXER 0
+%define CONFIG_ILBC_MUXER 0
+%define CONFIG_IMAGE2_MUXER 0
+%define CONFIG_IMAGE2PIPE_MUXER 0
+%define CONFIG_IPOD_MUXER 0
+%define CONFIG_IRCAM_MUXER 0
+%define CONFIG_ISMV_MUXER 0
+%define CONFIG_IVF_MUXER 0
+%define CONFIG_JACOSUB_MUXER 0
+%define CONFIG_LATM_MUXER 0
+%define CONFIG_LRC_MUXER 0
+%define CONFIG_M4V_MUXER 0
+%define CONFIG_MD5_MUXER 0
+%define CONFIG_MATROSKA_MUXER 0
+%define CONFIG_MATROSKA_AUDIO_MUXER 0
+%define CONFIG_MICRODVD_MUXER 0
+%define CONFIG_MJPEG_MUXER 0
+%define CONFIG_MLP_MUXER 0
+%define CONFIG_MMF_MUXER 0
+%define CONFIG_MOV_MUXER 0
+%define CONFIG_MP2_MUXER 0
+%define CONFIG_MP3_MUXER 0
+%define CONFIG_MP4_MUXER 0
+%define CONFIG_MPEG1SYSTEM_MUXER 0
+%define CONFIG_MPEG1VCD_MUXER 0
+%define CONFIG_MPEG1VIDEO_MUXER 0
+%define CONFIG_MPEG2DVD_MUXER 0
+%define CONFIG_MPEG2SVCD_MUXER 0
+%define CONFIG_MPEG2VIDEO_MUXER 0
+%define CONFIG_MPEG2VOB_MUXER 0
+%define CONFIG_MPEGTS_MUXER 0
+%define CONFIG_MPJPEG_MUXER 0
+%define CONFIG_MXF_MUXER 0
+%define CONFIG_MXF_D10_MUXER 0
+%define CONFIG_MXF_OPATOM_MUXER 0
+%define CONFIG_NULL_MUXER 0
+%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
+%define CONFIG_OGG_MUXER 0
+%define CONFIG_OMA_MUXER 0
+%define CONFIG_OPUS_MUXER 0
+%define CONFIG_PCM_ALAW_MUXER 0
+%define CONFIG_PCM_MULAW_MUXER 0
+%define CONFIG_PCM_F64BE_MUXER 0
+%define CONFIG_PCM_F64LE_MUXER 0
+%define CONFIG_PCM_F32BE_MUXER 0
+%define CONFIG_PCM_F32LE_MUXER 0
+%define CONFIG_PCM_S32BE_MUXER 0
+%define CONFIG_PCM_S32LE_MUXER 0
+%define CONFIG_PCM_S24BE_MUXER 0
+%define CONFIG_PCM_S24LE_MUXER 0
+%define CONFIG_PCM_S16BE_MUXER 0
+%define CONFIG_PCM_S16LE_MUXER 0
+%define CONFIG_PCM_S8_MUXER 0
+%define CONFIG_PCM_U32BE_MUXER 0
+%define CONFIG_PCM_U32LE_MUXER 0
+%define CONFIG_PCM_U24BE_MUXER 0
+%define CONFIG_PCM_U24LE_MUXER 0
+%define CONFIG_PCM_U16BE_MUXER 0
+%define CONFIG_PCM_U16LE_MUXER 0
+%define CONFIG_PCM_U8_MUXER 0
+%define CONFIG_PSP_MUXER 0
+%define CONFIG_RAWVIDEO_MUXER 0
+%define CONFIG_RM_MUXER 0
+%define CONFIG_ROQ_MUXER 0
+%define CONFIG_RSO_MUXER 0
+%define CONFIG_RTP_MUXER 0
+%define CONFIG_RTP_MPEGTS_MUXER 0
+%define CONFIG_RTSP_MUXER 0
+%define CONFIG_SAP_MUXER 0
+%define CONFIG_SEGMENT_MUXER 0
+%define CONFIG_STREAM_SEGMENT_MUXER 0
+%define CONFIG_SINGLEJPEG_MUXER 0
+%define CONFIG_SMJPEG_MUXER 0
+%define CONFIG_SMOOTHSTREAMING_MUXER 0
+%define CONFIG_SOX_MUXER 0
+%define CONFIG_SPX_MUXER 0
+%define CONFIG_SPDIF_MUXER 0
+%define CONFIG_SRT_MUXER 0
+%define CONFIG_SWF_MUXER 0
+%define CONFIG_TEE_MUXER 0
+%define CONFIG_TG2_MUXER 0
+%define CONFIG_TGP_MUXER 0
+%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
+%define CONFIG_VC1_MUXER 0
+%define CONFIG_VC1T_MUXER 0
+%define CONFIG_VOC_MUXER 0
+%define CONFIG_W64_MUXER 0
+%define CONFIG_WAV_MUXER 0
+%define CONFIG_WEBM_MUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+%define CONFIG_WEBM_CHUNK_MUXER 0
+%define CONFIG_WEBP_MUXER 0
+%define CONFIG_WEBVTT_MUXER 0
+%define CONFIG_WTV_MUXER 0
+%define CONFIG_WV_MUXER 0
+%define CONFIG_YUV4MPEGPIPE_MUXER 0
+%define CONFIG_LIBNUT_MUXER 0
+%define CONFIG_ALSA_OUTDEV 0
+%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
+%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
+%define CONFIG_OSS_OUTDEV 0
+%define CONFIG_PULSE_OUTDEV 0
+%define CONFIG_SDL_OUTDEV 0
+%define CONFIG_SNDIO_OUTDEV 0
+%define CONFIG_V4L2_OUTDEV 0
+%define CONFIG_XV_OUTDEV 0
+%define CONFIG_AAC_PARSER 1
+%define CONFIG_AAC_LATM_PARSER 0
+%define CONFIG_AC3_PARSER 0
+%define CONFIG_ADX_PARSER 0
+%define CONFIG_BMP_PARSER 0
+%define CONFIG_CAVSVIDEO_PARSER 0
+%define CONFIG_COOK_PARSER 0
+%define CONFIG_DCA_PARSER 0
+%define CONFIG_DIRAC_PARSER 0
+%define CONFIG_DNXHD_PARSER 0
+%define CONFIG_DPX_PARSER 0
+%define CONFIG_DVBSUB_PARSER 0
+%define CONFIG_DVDSUB_PARSER 0
+%define CONFIG_DVD_NAV_PARSER 0
+%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
+%define CONFIG_GSM_PARSER 0
+%define CONFIG_H261_PARSER 0
+%define CONFIG_H263_PARSER 0
+%define CONFIG_H264_PARSER 0
+%define CONFIG_HEVC_PARSER 0
+%define CONFIG_MJPEG_PARSER 0
+%define CONFIG_MLP_PARSER 0
+%define CONFIG_MPEG4VIDEO_PARSER 0
+%define CONFIG_MPEGAUDIO_PARSER 1
+%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
+%define CONFIG_PNG_PARSER 0
+%define CONFIG_PNM_PARSER 0
+%define CONFIG_RV30_PARSER 0
+%define CONFIG_RV40_PARSER 0
+%define CONFIG_TAK_PARSER 0
+%define CONFIG_VC1_PARSER 0
+%define CONFIG_VORBIS_PARSER 1
+%define CONFIG_VP3_PARSER 0
+%define CONFIG_VP8_PARSER 0
+%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
+%define CONFIG_BLURAY_PROTOCOL 0
+%define CONFIG_CACHE_PROTOCOL 0
+%define CONFIG_CONCAT_PROTOCOL 0
+%define CONFIG_CRYPTO_PROTOCOL 0
+%define CONFIG_DATA_PROTOCOL 0
+%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+%define CONFIG_FFRTMPHTTP_PROTOCOL 0
+%define CONFIG_FILE_PROTOCOL 0
+%define CONFIG_FTP_PROTOCOL 0
+%define CONFIG_GOPHER_PROTOCOL 0
+%define CONFIG_HLS_PROTOCOL 0
+%define CONFIG_HTTP_PROTOCOL 0
+%define CONFIG_HTTPPROXY_PROTOCOL 0
+%define CONFIG_HTTPS_PROTOCOL 0
+%define CONFIG_ICECAST_PROTOCOL 0
+%define CONFIG_MMSH_PROTOCOL 0
+%define CONFIG_MMST_PROTOCOL 0
+%define CONFIG_MD5_PROTOCOL 0
+%define CONFIG_PIPE_PROTOCOL 0
+%define CONFIG_RTMP_PROTOCOL 0
+%define CONFIG_RTMPE_PROTOCOL 0
+%define CONFIG_RTMPS_PROTOCOL 0
+%define CONFIG_RTMPT_PROTOCOL 0
+%define CONFIG_RTMPTE_PROTOCOL 0
+%define CONFIG_RTMPTS_PROTOCOL 0
+%define CONFIG_RTP_PROTOCOL 0
+%define CONFIG_SCTP_PROTOCOL 0
+%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
+%define CONFIG_TCP_PROTOCOL 0
+%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+%define CONFIG_TLS_GNUTLS_PROTOCOL 0
+%define CONFIG_TLS_OPENSSL_PROTOCOL 0
+%define CONFIG_UDP_PROTOCOL 0
+%define CONFIG_UDPLITE_PROTOCOL 0
+%define CONFIG_UNIX_PROTOCOL 0
+%define CONFIG_LIBRTMP_PROTOCOL 0
+%define CONFIG_LIBRTMPE_PROTOCOL 0
+%define CONFIG_LIBRTMPS_PROTOCOL 0
+%define CONFIG_LIBRTMPT_PROTOCOL 0
+%define CONFIG_LIBRTMPTE_PROTOCOL 0
+%define CONFIG_LIBSSH_PROTOCOL 0
+%define CONFIG_LIBSMBCLIENT_PROTOCOL 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
new file mode 100644
index 00000000000..de8d11c6143
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-21/arch-x86_64 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android- --target-os=linux --arch=x86_64 --enable-pic --enable-demuxer='aac,mp3,mov' --enable-parser='aac,mpegaudio' --enable-decoder='aac,mp3'"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 1
+#define ARCH_X86_32 0
+#define ARCH_X86_64 1
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 1
+#define HAVE_AMD3DNOWEXT 1
+#define HAVE_AVX 1
+#define HAVE_AVX2 1
+#define HAVE_FMA3 1
+#define HAVE_FMA4 1
+#define HAVE_MMX 1
+#define HAVE_MMXEXT 1
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
+#define HAVE_SSE3 1
+#define HAVE_SSE4 1
+#define HAVE_SSE42 1
+#define HAVE_SSSE3 1
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 1
+#define HAVE_AMD3DNOWEXT_EXTERNAL 1
+#define HAVE_AVX_EXTERNAL 1
+#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
+#define HAVE_FMA4_EXTERNAL 1
+#define HAVE_MMX_EXTERNAL 1
+#define HAVE_MMXEXT_EXTERNAL 1
+#define HAVE_SSE_EXTERNAL 1
+#define HAVE_SSE2_EXTERNAL 1
+#define HAVE_SSE3_EXTERNAL 1
+#define HAVE_SSE4_EXTERNAL 1
+#define HAVE_SSE42_EXTERNAL 1
+#define HAVE_SSSE3_EXTERNAL 1
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 1
+#define HAVE_AMD3DNOWEXT_INLINE 1
+#define HAVE_AVX_INLINE 1
+#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
+#define HAVE_FMA4_INLINE 1
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 1
+#define HAVE_SSE_INLINE 1
+#define HAVE_SSE2_INLINE 1
+#define HAVE_SSE3_INLINE 1
+#define HAVE_SSE4_INLINE 1
+#define HAVE_SSE42_INLINE 1
+#define HAVE_SSSE3_INLINE 1
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 1
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 1
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 1
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 1
+#define CONFIG_MPEGAUDIODSP 1
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 1
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 1
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 1
+#define CONFIG_MP3_DEMUXER 1
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 1
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 1
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..629579cf063
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75763-g1651ce3"
+#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 af26325edf0..88f2a4e66b5 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 0
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 815893df11c..f3589e6186a 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 260b4864a1d..29d08419d1c 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 6f73e116b6c..1a621896905 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 352601a9048..6320ee3c860 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h
index 444ecc03f0c..c7f574edd13 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 a0e58ce0d47..45fbfaa4db4 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_9dd69ae_4.9.2-r93) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..25d558166aa 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75748-g7dbd5cd"
#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 0c01b06c70a..dd8bf9fcac3 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h
index fa03d611813..252a5425a0b 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 bfa75cd109b..95c156b0dc5 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h
index 2e19f92536e..65f5c3e29dc 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\0-O2\0' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\0-O2\0' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)"
+#define CC_IDENT "clang version 3.8.0 (trunk 245965)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..244fca20fe9 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "N-75752-ga961860"
#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 4d48316ffb0..91f636c25da 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 0
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
+%define HAVE_DIRENT_H 0
%define HAVE_DLFCN_H 0
%define HAVE_D3D11_H 1
%define HAVE_DXVA_H 1
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
%define HAVE_LOCALTIME_R 0
+%define HAVE_LSTAT 0
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 0
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
+%define HAVE_SETCONSOLECTRLHANDLER 1
%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 1
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -327,10 +339,10 @@
%define HAVE_LIBC_MSVCRT 1
%define HAVE_LIBDC1394_1 0
%define HAVE_LIBDC1394_2 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MAKEINFO_HTML 0
-%define HAVE_PERL 0
-%define HAVE_POD2MAN 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
%define HAVE_SDL 0
%define HAVE_SECTION_DATA_REL_RO 0
%define HAVE_TEXI2HTML 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -499,7 +515,7 @@
%define CONFIG_MEMORY_POISONING 0
%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_POD2MAN 0
+%define CONFIG_POD2MAN 1
%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
%define CONFIG_VALGRIND_BACKTRACE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h
index aad3fe828bd..d0aed4dffff 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/c/src/blink/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
+#define HAVE_DIRENT_H 0
#define HAVE_DLFCN_H 0
#define HAVE_D3D11_H 1
#define HAVE_DXVA_H 1
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
#define HAVE_LOCALTIME_R 0
+#define HAVE_LSTAT 0
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
+#define HAVE_SETCONSOLECTRLHANDLER 1
#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 1
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -343,10 +355,10 @@
#define HAVE_LIBC_MSVCRT 1
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MAKEINFO_HTML 0
-#define HAVE_PERL 0
-#define HAVE_POD2MAN 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 0
#define HAVE_TEXI2HTML 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -515,7 +531,7 @@
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_POD2MAN 0
+#define CONFIG_POD2MAN 1
#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..6ca30c7bb4e 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "2.8.git"
#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 2a28a6cfe12..52996d56927 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
+%define HAVE_DIRENT_H 0
%define HAVE_DLFCN_H 0
%define HAVE_D3D11_H 1
%define HAVE_DXVA_H 1
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
%define HAVE_LOCALTIME_R 0
+%define HAVE_LSTAT 0
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 0
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
+%define HAVE_SETCONSOLECTRLHANDLER 1
%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 1
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -327,10 +339,10 @@
%define HAVE_LIBC_MSVCRT 1
%define HAVE_LIBDC1394_1 0
%define HAVE_LIBDC1394_2 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MAKEINFO_HTML 0
-%define HAVE_PERL 0
-%define HAVE_POD2MAN 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
%define HAVE_SDL 0
%define HAVE_SECTION_DATA_REL_RO 0
%define HAVE_TEXI2HTML 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -499,7 +515,7 @@
%define CONFIG_MEMORY_POISONING 0
%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_POD2MAN 0
+%define CONFIG_POD2MAN 1
%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
%define CONFIG_VALGRIND_BACKTRACE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h
index fd730a2df9c..8161646ed31 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/c/src/blink/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib' --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
+#define HAVE_DIRENT_H 0
#define HAVE_DLFCN_H 0
#define HAVE_D3D11_H 1
#define HAVE_DXVA_H 1
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
#define HAVE_LOCALTIME_R 0
+#define HAVE_LSTAT 0
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
+#define HAVE_SETCONSOLECTRLHANDLER 1
#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 1
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -343,10 +355,10 @@
#define HAVE_LIBC_MSVCRT 1
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MAKEINFO_HTML 0
-#define HAVE_PERL 0
-#define HAVE_POD2MAN 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 0
#define HAVE_TEXI2HTML 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -515,7 +531,7 @@
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_POD2MAN 0
+#define CONFIG_POD2MAN 1
#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..6ca30c7bb4e 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "2.8.git"
#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 4862eca2810..92a634bd551 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 0
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 c8030de4c2e..788572cd359 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 c3ad1a3c78f..e15e01bb89c 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 b5d0085bad3..357958b8043 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 7a5abfe5655..4fe54af3bdd 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 1
%define CONFIG_FAANIDCT 1
%define CONFIG_FDCTDSP 1
+%define CONFIG_FLACDSP 1
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 1
%define CONFIG_MPEG_ER 1
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 1
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 1
%define CONFIG_QPELDSP 1
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 1
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 1
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 1
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h
index e0518826a34..b9e4b5c5e7b 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 bfed1ad2627..2c0a301cd44 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 --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
+#define FFMPEG_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 --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-decoder='aac,h264,mp3' --enable-demuxer='aac,mp3,mov' --enable-parser='aac,h264,mpegaudio' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac --enable-decoder=gsm_ms --enable-demuxer=gsm --enable-parser=gsm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_9dd69ae_4.9.2-r93) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..25d558166aa 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75748-g7dbd5cd"
#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 7584c29f454..c35f37ad953 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 1
%define CONFIG_FAANIDCT 1
%define CONFIG_FDCTDSP 1
+%define CONFIG_FLACDSP 1
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 1
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 1
%define CONFIG_MPEG_ER 1
%define CONFIG_MPEGAUDIO 1
%define CONFIG_MPEGAUDIODSP 1
%define CONFIG_MPEGVIDEO 1
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 1
%define CONFIG_QPELDSP 1
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 1
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 1
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 1
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 1
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 1
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 1
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 1
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h
index 93de9cca051..77256e1a9b6 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 1
#define CONFIG_FAANIDCT 1
#define CONFIG_FDCTDSP 1
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 1
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 1
#define CONFIG_MPEG_ER 1
#define CONFIG_MPEGAUDIO 1
#define CONFIG_MPEGAUDIODSP 1
#define CONFIG_MPEGVIDEO 1
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 1
#define CONFIG_QPELDSP 1
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 1
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 1
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 1
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 1
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 1
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 1
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/config.h
index eed24186e91..613e684d98e 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/ssd/blink3/src/third_party/android_tools/ndk/platforms/android-16/arch-arm --cross-prefix=/ssd/blink3/src/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --target-os=linux --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='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=softfp' --enable-pic"
+#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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-arm --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --target-os=linux --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='-mfpu=vfpv3-d16' --extra-cflags='-mfloat-abi=softfp' --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 0
#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 0
#define CONFIG_VP8_PARSER 0
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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
new file mode 100644
index 00000000000..07b604e009a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-21/arch-arm64 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- --target-os=linux --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 1
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 1
+#define HAVE_NEON 1
+#define HAVE_VFP 1
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 1
+#define HAVE_NEON_EXTERNAL 1
+#define HAVE_VFP_EXTERNAL 1
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 1
+#define HAVE_NEON_INLINE 1
+#define HAVE_VFP_INLINE 1
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 1
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 1
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 1
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 0
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 0
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 0
+#define CONFIG_MPEGAUDIODSP 0
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 0
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 0
+#define CONFIG_MP3_DEMUXER 0
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 0
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 0
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..5805969f1b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75760-g382b031"
+#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.asm
new file mode 100644
index 00000000000..97c15f86623
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.asm
@@ -0,0 +1,1981 @@
+%define ARCH_AARCH64 0
+%define ARCH_ALPHA 0
+%define ARCH_ARM 0
+%define ARCH_AVR32 0
+%define ARCH_AVR32_AP 0
+%define ARCH_AVR32_UC 0
+%define ARCH_BFIN 0
+%define ARCH_IA64 0
+%define ARCH_M68K 0
+%define ARCH_MIPS 0
+%define ARCH_MIPS64 0
+%define ARCH_PARISC 0
+%define ARCH_PPC 0
+%define ARCH_PPC64 0
+%define ARCH_S390 0
+%define ARCH_SH4 0
+%define ARCH_SPARC 0
+%define ARCH_SPARC64 0
+%define ARCH_TILEGX 0
+%define ARCH_TILEPRO 0
+%define ARCH_TOMI 0
+%define ARCH_X86 1
+%define ARCH_X86_32 1
+%define ARCH_X86_64 0
+%define HAVE_ARMV5TE 0
+%define HAVE_ARMV6 0
+%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
+%define HAVE_NEON 0
+%define HAVE_VFP 0
+%define HAVE_VFPV3 0
+%define HAVE_SETEND 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 0
+%define HAVE_LDBRX 0
+%define HAVE_POWER8 0
+%define HAVE_PPC4XX 0
+%define HAVE_VSX 0
+%define HAVE_AMD3DNOW 1
+%define HAVE_AMD3DNOWEXT 1
+%define HAVE_AVX 1
+%define HAVE_AVX2 1
+%define HAVE_FMA3 1
+%define HAVE_FMA4 1
+%define HAVE_MMX 1
+%define HAVE_MMXEXT 1
+%define HAVE_SSE 1
+%define HAVE_SSE2 1
+%define HAVE_SSE3 1
+%define HAVE_SSE4 1
+%define HAVE_SSE42 1
+%define HAVE_SSSE3 1
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
+%define HAVE_MIPSFPU 0
+%define HAVE_MIPS32R2 0
+%define HAVE_MIPS32R5 0
+%define HAVE_MIPS64R6 0
+%define HAVE_MIPSDSPR1 0
+%define HAVE_MIPSDSPR2 0
+%define HAVE_MSA 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
+%define HAVE_ARMV5TE_EXTERNAL 0
+%define HAVE_ARMV6_EXTERNAL 0
+%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
+%define HAVE_NEON_EXTERNAL 0
+%define HAVE_VFP_EXTERNAL 0
+%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_SETEND_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_POWER8_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
+%define HAVE_VSX_EXTERNAL 0
+%define HAVE_AMD3DNOW_EXTERNAL 1
+%define HAVE_AMD3DNOWEXT_EXTERNAL 1
+%define HAVE_AVX_EXTERNAL 1
+%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
+%define HAVE_FMA4_EXTERNAL 1
+%define HAVE_MMX_EXTERNAL 1
+%define HAVE_MMXEXT_EXTERNAL 1
+%define HAVE_SSE_EXTERNAL 1
+%define HAVE_SSE2_EXTERNAL 1
+%define HAVE_SSE3_EXTERNAL 1
+%define HAVE_SSE4_EXTERNAL 1
+%define HAVE_SSE42_EXTERNAL 1
+%define HAVE_SSSE3_EXTERNAL 1
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
+%define HAVE_MIPSFPU_EXTERNAL 0
+%define HAVE_MIPS32R2_EXTERNAL 0
+%define HAVE_MIPS32R5_EXTERNAL 0
+%define HAVE_MIPS64R6_EXTERNAL 0
+%define HAVE_MIPSDSPR1_EXTERNAL 0
+%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
+%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
+%define HAVE_ARMV5TE_INLINE 0
+%define HAVE_ARMV6_INLINE 0
+%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
+%define HAVE_NEON_INLINE 0
+%define HAVE_VFP_INLINE 0
+%define HAVE_VFPV3_INLINE 0
+%define HAVE_SETEND_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_POWER8_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
+%define HAVE_VSX_INLINE 0
+%define HAVE_AMD3DNOW_INLINE 1
+%define HAVE_AMD3DNOWEXT_INLINE 1
+%define HAVE_AVX_INLINE 1
+%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
+%define HAVE_FMA4_INLINE 1
+%define HAVE_MMX_INLINE 1
+%define HAVE_MMXEXT_INLINE 1
+%define HAVE_SSE_INLINE 1
+%define HAVE_SSE2_INLINE 1
+%define HAVE_SSE3_INLINE 1
+%define HAVE_SSE4_INLINE 1
+%define HAVE_SSE42_INLINE 1
+%define HAVE_SSSE3_INLINE 1
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
+%define HAVE_MIPSFPU_INLINE 0
+%define HAVE_MIPS32R2_INLINE 0
+%define HAVE_MIPS32R5_INLINE 0
+%define HAVE_MIPS64R6_INLINE 0
+%define HAVE_MIPSDSPR1_INLINE 0
+%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
+%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 0
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 0
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_SIMD_ALIGN_16 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+%define HAVE_INLINE_ASM 1
+%define HAVE_SYMVER 0
+%define HAVE_YASM 1
+%define HAVE_BIGENDIAN 0
+%define HAVE_FAST_UNALIGNED 1
+%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
+%define HAVE_DLFCN_H 1
+%define HAVE_D3D11_H 0
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UDPLITE_H 0
+%define HAVE_UNISTD_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
+%define HAVE_INTRINSICS_NEON 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
+%define HAVE_COSF 1
+%define HAVE_ERF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 0
+%define HAVE_LOG2F 0
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 0
+%define HAVE_CLOCK_GETTIME 1
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 0
+%define HAVE_COTASKMEMFREE 0
+%define HAVE_CRYPTGENRANDOM 0
+%define HAVE_DLOPEN 1
+%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
+%define HAVE_FORK 1
+%define HAVE_GETADDRINFO 0
+%define HAVE_GETHRTIME 0
+%define HAVE_GETOPT 1
+%define HAVE_GETPROCESSAFFINITYMASK 0
+%define HAVE_GETPROCESSMEMORYINFO 0
+%define HAVE_GETPROCESSTIMES 0
+%define HAVE_GETRUSAGE 1
+%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
+%define HAVE_GETTIMEOFDAY 1
+%define HAVE_GLOB 0
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_GMTIME_R 1
+%define HAVE_INET_ATON 0
+%define HAVE_ISATTY 1
+%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+%define HAVE_KBHIT 0
+%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
+%define HAVE_LZO1X_999_COMPRESS 0
+%define HAVE_MACH_ABSOLUTE_TIME 0
+%define HAVE_MAPVIEWOFFILE 0
+%define HAVE_MEMALIGN 1
+%define HAVE_MKSTEMP 1
+%define HAVE_MMAP 1
+%define HAVE_MPROTECT 1
+%define HAVE_NANOSLEEP 1
+%define HAVE_PEEKNAMEDPIPE 0
+%define HAVE_POSIX_MEMALIGN 1
+%define HAVE_PTHREAD_CANCEL 0
+%define HAVE_SCHED_GETAFFINITY 0
+%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
+%define HAVE_SETMODE 0
+%define HAVE_SETRLIMIT 1
+%define HAVE_SLEEP 0
+%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_AS_DN_DIRECTIVE 0
+%define HAVE_AS_FUNC 0
+%define HAVE_AS_OBJECT_ARCH 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 0
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_CONDITION_VARIABLE_PTR 0
+%define HAVE_SOCKLEN_T 0
+%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+%define HAVE_STRUCT_IP_MREQ_SOURCE 0
+%define HAVE_STRUCT_IPV6_MREQ 0
+%define HAVE_STRUCT_POLLFD 0
+%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+%define HAVE_STRUCT_SOCKADDR_IN6 0
+%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+%define HAVE_STRUCT_SOCKADDR_STORAGE 0
+%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_TEXI2HTML 0
+%define HAVE_THREADS 1
+%define HAVE_VAAPI_X11 0
+%define HAVE_VDPAU_X11 0
+%define HAVE_XLIB 0
+%define CONFIG_BSFS 0
+%define CONFIG_DECODERS 1
+%define CONFIG_DEMUXERS 1
+%define CONFIG_ENCODERS 0
+%define CONFIG_FILTERS 0
+%define CONFIG_HWACCELS 0
+%define CONFIG_INDEVS 0
+%define CONFIG_MUXERS 0
+%define CONFIG_OUTDEVS 0
+%define CONFIG_PARSERS 1
+%define CONFIG_PROTOCOLS 0
+%define CONFIG_DOC 0
+%define CONFIG_HTMLPAGES 0
+%define CONFIG_MANPAGES 0
+%define CONFIG_PODPAGES 0
+%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+%define CONFIG_DECODING_ENCODING_EXAMPLE 1
+%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_EXTRACT_MVS_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+%define CONFIG_METADATA_EXAMPLE 1
+%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_QSVDEC_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
+%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+%define CONFIG_SCALING_VIDEO_EXAMPLE 0
+%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
+%define CONFIG_AVISYNTH 0
+%define CONFIG_BZLIB 0
+%define CONFIG_CRYSTALHD 0
+%define CONFIG_DECKLINK 0
+%define CONFIG_FREI0R 0
+%define CONFIG_GNUTLS 0
+%define CONFIG_ICONV 0
+%define CONFIG_LADSPA 0
+%define CONFIG_LIBAACPLUS 0
+%define CONFIG_LIBASS 0
+%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
+%define CONFIG_LIBCACA 0
+%define CONFIG_LIBCDIO 0
+%define CONFIG_LIBCELT 0
+%define CONFIG_LIBDC1394 0
+%define CONFIG_LIBDCADEC 0
+%define CONFIG_LIBFAAC 0
+%define CONFIG_LIBFDK_AAC 0
+%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
+%define CONFIG_LIBFREETYPE 0
+%define CONFIG_LIBFRIBIDI 0
+%define CONFIG_LIBGME 0
+%define CONFIG_LIBGSM 0
+%define CONFIG_LIBIEC61883 0
+%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
+%define CONFIG_LIBMFX 0
+%define CONFIG_LIBMODPLUG 0
+%define CONFIG_LIBMP3LAME 0
+%define CONFIG_LIBNUT 0
+%define CONFIG_LIBOPENCORE_AMRNB 0
+%define CONFIG_LIBOPENCORE_AMRWB 0
+%define CONFIG_LIBOPENCV 0
+%define CONFIG_LIBOPENH264 0
+%define CONFIG_LIBOPENJPEG 0
+%define CONFIG_LIBOPUS 0
+%define CONFIG_LIBPULSE 0
+%define CONFIG_LIBQUVI 0
+%define CONFIG_LIBRTMP 0
+%define CONFIG_LIBSCHROEDINGER 0
+%define CONFIG_LIBSHINE 0
+%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
+%define CONFIG_LIBSOXR 0
+%define CONFIG_LIBSPEEX 0
+%define CONFIG_LIBSSH 0
+%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
+%define CONFIG_LIBTHEORA 0
+%define CONFIG_LIBTWOLAME 0
+%define CONFIG_LIBUTVIDEO 0
+%define CONFIG_LIBV4L2 0
+%define CONFIG_LIBVIDSTAB 0
+%define CONFIG_LIBVO_AACENC 0
+%define CONFIG_LIBVO_AMRWBENC 0
+%define CONFIG_LIBVORBIS 0
+%define CONFIG_LIBVPX 0
+%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
+%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
+%define CONFIG_LIBXAVS 0
+%define CONFIG_LIBXCB 0
+%define CONFIG_LIBXCB_SHM 0
+%define CONFIG_LIBXCB_SHAPE 0
+%define CONFIG_LIBXCB_XFIXES 0
+%define CONFIG_LIBXVID 0
+%define CONFIG_LIBZMQ 0
+%define CONFIG_LIBZVBI 0
+%define CONFIG_LZMA 0
+%define CONFIG_MMAL 0
+%define CONFIG_NVENC 0
+%define CONFIG_OPENAL 0
+%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
+%define CONFIG_OPENSSL 0
+%define CONFIG_SDL 0
+%define CONFIG_SECURETRANSPORT 0
+%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
+%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 0
+%define CONFIG_SMALL 1
+%define CONFIG_STATIC 1
+%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_D3D11VA 0
+%define CONFIG_DXVA2 0
+%define CONFIG_VAAPI 0
+%define CONFIG_VDA 0
+%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
+%define CONFIG_AVCODEC 1
+%define CONFIG_AVDEVICE 0
+%define CONFIG_AVFILTER 0
+%define CONFIG_AVFORMAT 1
+%define CONFIG_AVRESAMPLE 0
+%define CONFIG_AVUTIL 1
+%define CONFIG_POSTPROC 0
+%define CONFIG_SWRESAMPLE 0
+%define CONFIG_SWSCALE 0
+%define CONFIG_FFPLAY 0
+%define CONFIG_FFPROBE 0
+%define CONFIG_FFSERVER 0
+%define CONFIG_FFMPEG 0
+%define CONFIG_DCT 0
+%define CONFIG_DWT 0
+%define CONFIG_ERROR_RESILIENCE 0
+%define CONFIG_FAAN 1
+%define CONFIG_FAST_UNALIGNED 1
+%define CONFIG_FFT 1
+%define CONFIG_LSP 0
+%define CONFIG_LZO 0
+%define CONFIG_MDCT 1
+%define CONFIG_PIXELUTILS 0
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+%define CONFIG_MEMALIGN_HACK 0
+%define CONFIG_MEMORY_POISONING 0
+%define CONFIG_NEON_CLOBBER_TEST 0
+%define CONFIG_PIC 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
+%define CONFIG_THUMB 0
+%define CONFIG_VALGRIND_BACKTRACE 0
+%define CONFIG_XMM_CLOBBER_TEST 0
+%define CONFIG_AANDCTTABLES 0
+%define CONFIG_AC3DSP 0
+%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_AUDIODSP 0
+%define CONFIG_BLOCKDSP 0
+%define CONFIG_BSWAPDSP 0
+%define CONFIG_CABAC 0
+%define CONFIG_DVPROFILE 0
+%define CONFIG_EXIF 0
+%define CONFIG_FAANDCT 0
+%define CONFIG_FAANIDCT 0
+%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
+%define CONFIG_FMTCONVERT 0
+%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
+%define CONFIG_GCRYPT 0
+%define CONFIG_GMP 0
+%define CONFIG_GOLOMB 1
+%define CONFIG_GPLV3 0
+%define CONFIG_H263DSP 0
+%define CONFIG_H264CHROMA 0
+%define CONFIG_H264DSP 0
+%define CONFIG_H264PRED 0
+%define CONFIG_H264QPEL 0
+%define CONFIG_HPELDSP 0
+%define CONFIG_HUFFMAN 0
+%define CONFIG_HUFFYUVDSP 0
+%define CONFIG_HUFFYUVENCDSP 0
+%define CONFIG_IDCTDSP 0
+%define CONFIG_IIRFILTER 0
+%define CONFIG_IMDCT15 0
+%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
+%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
+%define CONFIG_LGPLV3 0
+%define CONFIG_LLAUDDSP 0
+%define CONFIG_LLVIDDSP 0
+%define CONFIG_LPC 0
+%define CONFIG_LZF 0
+%define CONFIG_ME_CMP 0
+%define CONFIG_MPEG_ER 0
+%define CONFIG_MPEGAUDIO 0
+%define CONFIG_MPEGAUDIODSP 0
+%define CONFIG_MPEGVIDEO 0
+%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
+%define CONFIG_PIXBLOCKDSP 0
+%define CONFIG_QPELDSP 0
+%define CONFIG_QSV 0
+%define CONFIG_QSVDEC 0
+%define CONFIG_QSVENC 0
+%define CONFIG_RANGECODER 0
+%define CONFIG_RIFFDEC 1
+%define CONFIG_RIFFENC 0
+%define CONFIG_RTPDEC 0
+%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
+%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
+%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
+%define CONFIG_TPELDSP 0
+%define CONFIG_VIDEODSP 0
+%define CONFIG_VP3DSP 0
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 0
+%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
+%define CONFIG_AAC_ADTSTOASC_BSF 0
+%define CONFIG_CHOMP_BSF 0
+%define CONFIG_DUMP_EXTRADATA_BSF 0
+%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+%define CONFIG_IMX_DUMP_HEADER_BSF 0
+%define CONFIG_MJPEG2JPEG_BSF 0
+%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+%define CONFIG_MOV2TEXTSUB_BSF 0
+%define CONFIG_NOISE_BSF 0
+%define CONFIG_REMOVE_EXTRADATA_BSF 0
+%define CONFIG_TEXT2MOVSUB_BSF 0
+%define CONFIG_AASC_DECODER 0
+%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
+%define CONFIG_AMV_DECODER 0
+%define CONFIG_ANM_DECODER 0
+%define CONFIG_ANSI_DECODER 0
+%define CONFIG_APNG_DECODER 0
+%define CONFIG_ASV1_DECODER 0
+%define CONFIG_ASV2_DECODER 0
+%define CONFIG_AURA_DECODER 0
+%define CONFIG_AURA2_DECODER 0
+%define CONFIG_AVRP_DECODER 0
+%define CONFIG_AVRN_DECODER 0
+%define CONFIG_AVS_DECODER 0
+%define CONFIG_AVUI_DECODER 0
+%define CONFIG_AYUV_DECODER 0
+%define CONFIG_BETHSOFTVID_DECODER 0
+%define CONFIG_BFI_DECODER 0
+%define CONFIG_BINK_DECODER 0
+%define CONFIG_BMP_DECODER 0
+%define CONFIG_BMV_VIDEO_DECODER 0
+%define CONFIG_BRENDER_PIX_DECODER 0
+%define CONFIG_C93_DECODER 0
+%define CONFIG_CAVS_DECODER 0
+%define CONFIG_CDGRAPHICS_DECODER 0
+%define CONFIG_CDXL_DECODER 0
+%define CONFIG_CINEPAK_DECODER 0
+%define CONFIG_CLJR_DECODER 0
+%define CONFIG_CLLC_DECODER 0
+%define CONFIG_COMFORTNOISE_DECODER 0
+%define CONFIG_CPIA_DECODER 0
+%define CONFIG_CSCD_DECODER 0
+%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
+%define CONFIG_DFA_DECODER 0
+%define CONFIG_DIRAC_DECODER 0
+%define CONFIG_DNXHD_DECODER 0
+%define CONFIG_DPX_DECODER 0
+%define CONFIG_DSICINVIDEO_DECODER 0
+%define CONFIG_DVVIDEO_DECODER 0
+%define CONFIG_DXA_DECODER 0
+%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
+%define CONFIG_EACMV_DECODER 0
+%define CONFIG_EAMAD_DECODER 0
+%define CONFIG_EATGQ_DECODER 0
+%define CONFIG_EATGV_DECODER 0
+%define CONFIG_EATQI_DECODER 0
+%define CONFIG_EIGHTBPS_DECODER 0
+%define CONFIG_EIGHTSVX_EXP_DECODER 0
+%define CONFIG_EIGHTSVX_FIB_DECODER 0
+%define CONFIG_ESCAPE124_DECODER 0
+%define CONFIG_ESCAPE130_DECODER 0
+%define CONFIG_EXR_DECODER 0
+%define CONFIG_FFV1_DECODER 0
+%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
+%define CONFIG_FLASHSV_DECODER 0
+%define CONFIG_FLASHSV2_DECODER 0
+%define CONFIG_FLIC_DECODER 0
+%define CONFIG_FLV_DECODER 0
+%define CONFIG_FOURXM_DECODER 0
+%define CONFIG_FRAPS_DECODER 0
+%define CONFIG_FRWU_DECODER 0
+%define CONFIG_G2M_DECODER 0
+%define CONFIG_GIF_DECODER 0
+%define CONFIG_H261_DECODER 0
+%define CONFIG_H263_DECODER 0
+%define CONFIG_H263I_DECODER 0
+%define CONFIG_H263P_DECODER 0
+%define CONFIG_H264_DECODER 0
+%define CONFIG_H264_CRYSTALHD_DECODER 0
+%define CONFIG_H264_MMAL_DECODER 0
+%define CONFIG_H264_QSV_DECODER 0
+%define CONFIG_H264_VDA_DECODER 0
+%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
+%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
+%define CONFIG_HNM4_VIDEO_DECODER 0
+%define CONFIG_HQ_HQA_DECODER 0
+%define CONFIG_HQX_DECODER 0
+%define CONFIG_HUFFYUV_DECODER 0
+%define CONFIG_IDCIN_DECODER 0
+%define CONFIG_IFF_BYTERUN1_DECODER 0
+%define CONFIG_IFF_ILBM_DECODER 0
+%define CONFIG_INDEO2_DECODER 0
+%define CONFIG_INDEO3_DECODER 0
+%define CONFIG_INDEO4_DECODER 0
+%define CONFIG_INDEO5_DECODER 0
+%define CONFIG_INTERPLAY_VIDEO_DECODER 0
+%define CONFIG_JPEG2000_DECODER 0
+%define CONFIG_JPEGLS_DECODER 0
+%define CONFIG_JV_DECODER 0
+%define CONFIG_KGV1_DECODER 0
+%define CONFIG_KMVC_DECODER 0
+%define CONFIG_LAGARITH_DECODER 0
+%define CONFIG_LOCO_DECODER 0
+%define CONFIG_MDEC_DECODER 0
+%define CONFIG_MIMIC_DECODER 0
+%define CONFIG_MJPEG_DECODER 0
+%define CONFIG_MJPEGB_DECODER 0
+%define CONFIG_MMVIDEO_DECODER 0
+%define CONFIG_MOTIONPIXELS_DECODER 0
+%define CONFIG_MPEG_XVMC_DECODER 0
+%define CONFIG_MPEG1VIDEO_DECODER 0
+%define CONFIG_MPEG2VIDEO_DECODER 0
+%define CONFIG_MPEG4_DECODER 0
+%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG4_VDPAU_DECODER 0
+%define CONFIG_MPEGVIDEO_DECODER 0
+%define CONFIG_MPEG_VDPAU_DECODER 0
+%define CONFIG_MPEG1_VDPAU_DECODER 0
+%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
+%define CONFIG_MSA1_DECODER 0
+%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MSMPEG4V1_DECODER 0
+%define CONFIG_MSMPEG4V2_DECODER 0
+%define CONFIG_MSMPEG4V3_DECODER 0
+%define CONFIG_MSRLE_DECODER 0
+%define CONFIG_MSS1_DECODER 0
+%define CONFIG_MSS2_DECODER 0
+%define CONFIG_MSVIDEO1_DECODER 0
+%define CONFIG_MSZH_DECODER 0
+%define CONFIG_MTS2_DECODER 0
+%define CONFIG_MVC1_DECODER 0
+%define CONFIG_MVC2_DECODER 0
+%define CONFIG_MXPEG_DECODER 0
+%define CONFIG_NUV_DECODER 0
+%define CONFIG_PAF_VIDEO_DECODER 0
+%define CONFIG_PAM_DECODER 0
+%define CONFIG_PBM_DECODER 0
+%define CONFIG_PCX_DECODER 0
+%define CONFIG_PGM_DECODER 0
+%define CONFIG_PGMYUV_DECODER 0
+%define CONFIG_PICTOR_DECODER 0
+%define CONFIG_PNG_DECODER 0
+%define CONFIG_PPM_DECODER 0
+%define CONFIG_PRORES_DECODER 0
+%define CONFIG_PRORES_LGPL_DECODER 0
+%define CONFIG_PTX_DECODER 0
+%define CONFIG_QDRAW_DECODER 0
+%define CONFIG_QPEG_DECODER 0
+%define CONFIG_QTRLE_DECODER 0
+%define CONFIG_R10K_DECODER 0
+%define CONFIG_R210_DECODER 0
+%define CONFIG_RAWVIDEO_DECODER 0
+%define CONFIG_RL2_DECODER 0
+%define CONFIG_ROQ_DECODER 0
+%define CONFIG_RPZA_DECODER 0
+%define CONFIG_RV10_DECODER 0
+%define CONFIG_RV20_DECODER 0
+%define CONFIG_RV30_DECODER 0
+%define CONFIG_RV40_DECODER 0
+%define CONFIG_S302M_DECODER 0
+%define CONFIG_SANM_DECODER 0
+%define CONFIG_SGI_DECODER 0
+%define CONFIG_SGIRLE_DECODER 0
+%define CONFIG_SMACKER_DECODER 0
+%define CONFIG_SMC_DECODER 0
+%define CONFIG_SMVJPEG_DECODER 0
+%define CONFIG_SNOW_DECODER 0
+%define CONFIG_SP5X_DECODER 0
+%define CONFIG_SUNRAST_DECODER 0
+%define CONFIG_SVQ1_DECODER 0
+%define CONFIG_SVQ3_DECODER 0
+%define CONFIG_TARGA_DECODER 0
+%define CONFIG_TARGA_Y216_DECODER 0
+%define CONFIG_TDSC_DECODER 0
+%define CONFIG_THEORA_DECODER 0
+%define CONFIG_THP_DECODER 0
+%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+%define CONFIG_TIFF_DECODER 0
+%define CONFIG_TMV_DECODER 0
+%define CONFIG_TRUEMOTION1_DECODER 0
+%define CONFIG_TRUEMOTION2_DECODER 0
+%define CONFIG_TSCC_DECODER 0
+%define CONFIG_TSCC2_DECODER 0
+%define CONFIG_TXD_DECODER 0
+%define CONFIG_ULTI_DECODER 0
+%define CONFIG_UTVIDEO_DECODER 0
+%define CONFIG_V210_DECODER 0
+%define CONFIG_V210X_DECODER 0
+%define CONFIG_V308_DECODER 0
+%define CONFIG_V408_DECODER 0
+%define CONFIG_V410_DECODER 0
+%define CONFIG_VB_DECODER 0
+%define CONFIG_VBLE_DECODER 0
+%define CONFIG_VC1_DECODER 0
+%define CONFIG_VC1_CRYSTALHD_DECODER 0
+%define CONFIG_VC1_VDPAU_DECODER 0
+%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
+%define CONFIG_VCR1_DECODER 0
+%define CONFIG_VMDVIDEO_DECODER 0
+%define CONFIG_VMNC_DECODER 0
+%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP5_DECODER 0
+%define CONFIG_VP6_DECODER 0
+%define CONFIG_VP6A_DECODER 0
+%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
+%define CONFIG_VP8_DECODER 0
+%define CONFIG_VP9_DECODER 0
+%define CONFIG_VQA_DECODER 0
+%define CONFIG_WEBP_DECODER 0
+%define CONFIG_WMV1_DECODER 0
+%define CONFIG_WMV2_DECODER 0
+%define CONFIG_WMV3_DECODER 0
+%define CONFIG_WMV3_CRYSTALHD_DECODER 0
+%define CONFIG_WMV3_VDPAU_DECODER 0
+%define CONFIG_WMV3IMAGE_DECODER 0
+%define CONFIG_WNV1_DECODER 0
+%define CONFIG_XAN_WC3_DECODER 0
+%define CONFIG_XAN_WC4_DECODER 0
+%define CONFIG_XBM_DECODER 0
+%define CONFIG_XFACE_DECODER 0
+%define CONFIG_XL_DECODER 0
+%define CONFIG_XWD_DECODER 0
+%define CONFIG_Y41P_DECODER 0
+%define CONFIG_YOP_DECODER 0
+%define CONFIG_YUV4_DECODER 0
+%define CONFIG_ZERO12V_DECODER 0
+%define CONFIG_ZEROCODEC_DECODER 0
+%define CONFIG_ZLIB_DECODER 0
+%define CONFIG_ZMBV_DECODER 0
+%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
+%define CONFIG_AAC_LATM_DECODER 0
+%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
+%define CONFIG_ALAC_DECODER 0
+%define CONFIG_ALS_DECODER 0
+%define CONFIG_AMRNB_DECODER 0
+%define CONFIG_AMRWB_DECODER 0
+%define CONFIG_APE_DECODER 0
+%define CONFIG_ATRAC1_DECODER 0
+%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
+%define CONFIG_BINKAUDIO_DCT_DECODER 0
+%define CONFIG_BINKAUDIO_RDFT_DECODER 0
+%define CONFIG_BMV_AUDIO_DECODER 0
+%define CONFIG_COOK_DECODER 0
+%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+%define CONFIG_DSICINAUDIO_DECODER 0
+%define CONFIG_DSS_SP_DECODER 0
+%define CONFIG_EAC3_DECODER 0
+%define CONFIG_EVRC_DECODER 0
+%define CONFIG_FFWAVESYNTH_DECODER 0
+%define CONFIG_FLAC_DECODER 0
+%define CONFIG_G723_1_DECODER 0
+%define CONFIG_G729_DECODER 0
+%define CONFIG_GSM_DECODER 0
+%define CONFIG_GSM_MS_DECODER 0
+%define CONFIG_IAC_DECODER 0
+%define CONFIG_IMC_DECODER 0
+%define CONFIG_MACE3_DECODER 0
+%define CONFIG_MACE6_DECODER 0
+%define CONFIG_METASOUND_DECODER 0
+%define CONFIG_MLP_DECODER 0
+%define CONFIG_MP1_DECODER 0
+%define CONFIG_MP1FLOAT_DECODER 0
+%define CONFIG_MP2_DECODER 0
+%define CONFIG_MP2FLOAT_DECODER 0
+%define CONFIG_MP3_DECODER 0
+%define CONFIG_MP3FLOAT_DECODER 0
+%define CONFIG_MP3ADU_DECODER 0
+%define CONFIG_MP3ADUFLOAT_DECODER 0
+%define CONFIG_MP3ON4_DECODER 0
+%define CONFIG_MP3ON4FLOAT_DECODER 0
+%define CONFIG_MPC7_DECODER 0
+%define CONFIG_MPC8_DECODER 0
+%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
+%define CONFIG_PAF_AUDIO_DECODER 0
+%define CONFIG_QCELP_DECODER 0
+%define CONFIG_QDM2_DECODER 0
+%define CONFIG_RA_144_DECODER 0
+%define CONFIG_RA_288_DECODER 0
+%define CONFIG_RALF_DECODER 0
+%define CONFIG_SHORTEN_DECODER 0
+%define CONFIG_SIPR_DECODER 0
+%define CONFIG_SMACKAUD_DECODER 0
+%define CONFIG_SONIC_DECODER 0
+%define CONFIG_TAK_DECODER 0
+%define CONFIG_TRUEHD_DECODER 0
+%define CONFIG_TRUESPEECH_DECODER 0
+%define CONFIG_TTA_DECODER 0
+%define CONFIG_TWINVQ_DECODER 0
+%define CONFIG_VMDAUDIO_DECODER 0
+%define CONFIG_VORBIS_DECODER 1
+%define CONFIG_WAVPACK_DECODER 0
+%define CONFIG_WMALOSSLESS_DECODER 0
+%define CONFIG_WMAPRO_DECODER 0
+%define CONFIG_WMAV1_DECODER 0
+%define CONFIG_WMAV2_DECODER 0
+%define CONFIG_WMAVOICE_DECODER 0
+%define CONFIG_WS_SND1_DECODER 0
+%define CONFIG_PCM_ALAW_DECODER 1
+%define CONFIG_PCM_BLURAY_DECODER 0
+%define CONFIG_PCM_DVD_DECODER 0
+%define CONFIG_PCM_F32BE_DECODER 0
+%define CONFIG_PCM_F32LE_DECODER 1
+%define CONFIG_PCM_F64BE_DECODER 0
+%define CONFIG_PCM_F64LE_DECODER 0
+%define CONFIG_PCM_LXF_DECODER 0
+%define CONFIG_PCM_MULAW_DECODER 1
+%define CONFIG_PCM_S8_DECODER 0
+%define CONFIG_PCM_S8_PLANAR_DECODER 0
+%define CONFIG_PCM_S16BE_DECODER 1
+%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+%define CONFIG_PCM_S16LE_DECODER 1
+%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S24BE_DECODER 1
+%define CONFIG_PCM_S24DAUD_DECODER 0
+%define CONFIG_PCM_S24LE_DECODER 1
+%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S32BE_DECODER 0
+%define CONFIG_PCM_S32LE_DECODER 0
+%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+%define CONFIG_PCM_U8_DECODER 1
+%define CONFIG_PCM_U16BE_DECODER 0
+%define CONFIG_PCM_U16LE_DECODER 0
+%define CONFIG_PCM_U24BE_DECODER 0
+%define CONFIG_PCM_U24LE_DECODER 0
+%define CONFIG_PCM_U32BE_DECODER 0
+%define CONFIG_PCM_U32LE_DECODER 0
+%define CONFIG_PCM_ZORK_DECODER 0
+%define CONFIG_INTERPLAY_DPCM_DECODER 0
+%define CONFIG_ROQ_DPCM_DECODER 0
+%define CONFIG_SOL_DPCM_DECODER 0
+%define CONFIG_XAN_DPCM_DECODER 0
+%define CONFIG_ADPCM_4XM_DECODER 0
+%define CONFIG_ADPCM_ADX_DECODER 0
+%define CONFIG_ADPCM_AFC_DECODER 0
+%define CONFIG_ADPCM_CT_DECODER 0
+%define CONFIG_ADPCM_DTK_DECODER 0
+%define CONFIG_ADPCM_EA_DECODER 0
+%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+%define CONFIG_ADPCM_EA_R1_DECODER 0
+%define CONFIG_ADPCM_EA_R2_DECODER 0
+%define CONFIG_ADPCM_EA_R3_DECODER 0
+%define CONFIG_ADPCM_EA_XAS_DECODER 0
+%define CONFIG_ADPCM_G722_DECODER 0
+%define CONFIG_ADPCM_G726_DECODER 0
+%define CONFIG_ADPCM_G726LE_DECODER 0
+%define CONFIG_ADPCM_IMA_AMV_DECODER 0
+%define CONFIG_ADPCM_IMA_APC_DECODER 0
+%define CONFIG_ADPCM_IMA_DK3_DECODER 0
+%define CONFIG_ADPCM_IMA_DK4_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+%define CONFIG_ADPCM_IMA_ISS_DECODER 0
+%define CONFIG_ADPCM_IMA_OKI_DECODER 0
+%define CONFIG_ADPCM_IMA_QT_DECODER 0
+%define CONFIG_ADPCM_IMA_RAD_DECODER 0
+%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+%define CONFIG_ADPCM_IMA_WAV_DECODER 0
+%define CONFIG_ADPCM_IMA_WS_DECODER 0
+%define CONFIG_ADPCM_MS_DECODER 0
+%define CONFIG_ADPCM_SBPRO_2_DECODER 0
+%define CONFIG_ADPCM_SBPRO_3_DECODER 0
+%define CONFIG_ADPCM_SBPRO_4_DECODER 0
+%define CONFIG_ADPCM_SWF_DECODER 0
+%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
+%define CONFIG_ADPCM_XA_DECODER 0
+%define CONFIG_ADPCM_YAMAHA_DECODER 0
+%define CONFIG_SSA_DECODER 0
+%define CONFIG_ASS_DECODER 0
+%define CONFIG_CCAPTION_DECODER 0
+%define CONFIG_DVBSUB_DECODER 0
+%define CONFIG_DVDSUB_DECODER 0
+%define CONFIG_JACOSUB_DECODER 0
+%define CONFIG_MICRODVD_DECODER 0
+%define CONFIG_MOVTEXT_DECODER 0
+%define CONFIG_MPL2_DECODER 0
+%define CONFIG_PGSSUB_DECODER 0
+%define CONFIG_PJS_DECODER 0
+%define CONFIG_REALTEXT_DECODER 0
+%define CONFIG_SAMI_DECODER 0
+%define CONFIG_SRT_DECODER 0
+%define CONFIG_STL_DECODER 0
+%define CONFIG_SUBRIP_DECODER 0
+%define CONFIG_SUBVIEWER_DECODER 0
+%define CONFIG_SUBVIEWER1_DECODER 0
+%define CONFIG_TEXT_DECODER 0
+%define CONFIG_VPLAYER_DECODER 0
+%define CONFIG_WEBVTT_DECODER 0
+%define CONFIG_XSUB_DECODER 0
+%define CONFIG_LIBCELT_DECODER 0
+%define CONFIG_LIBDCADEC_DECODER 0
+%define CONFIG_LIBFDK_AAC_DECODER 0
+%define CONFIG_LIBGSM_DECODER 0
+%define CONFIG_LIBGSM_MS_DECODER 0
+%define CONFIG_LIBILBC_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+%define CONFIG_LIBOPENJPEG_DECODER 0
+%define CONFIG_LIBOPUS_DECODER 0
+%define CONFIG_LIBSCHROEDINGER_DECODER 0
+%define CONFIG_LIBSPEEX_DECODER 0
+%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+%define CONFIG_LIBUTVIDEO_DECODER 0
+%define CONFIG_LIBVORBIS_DECODER 0
+%define CONFIG_LIBVPX_VP8_DECODER 0
+%define CONFIG_LIBVPX_VP9_DECODER 0
+%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+%define CONFIG_BINTEXT_DECODER 0
+%define CONFIG_XBIN_DECODER 0
+%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AC3_DEMUXER 0
+%define CONFIG_ACT_DEMUXER 0
+%define CONFIG_ADF_DEMUXER 0
+%define CONFIG_ADP_DEMUXER 0
+%define CONFIG_ADX_DEMUXER 0
+%define CONFIG_AEA_DEMUXER 0
+%define CONFIG_AFC_DEMUXER 0
+%define CONFIG_AIFF_DEMUXER 0
+%define CONFIG_AMR_DEMUXER 0
+%define CONFIG_ANM_DEMUXER 0
+%define CONFIG_APC_DEMUXER 0
+%define CONFIG_APE_DEMUXER 0
+%define CONFIG_APNG_DEMUXER 0
+%define CONFIG_AQTITLE_DEMUXER 0
+%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
+%define CONFIG_ASS_DEMUXER 0
+%define CONFIG_AST_DEMUXER 0
+%define CONFIG_AU_DEMUXER 0
+%define CONFIG_AVI_DEMUXER 0
+%define CONFIG_AVISYNTH_DEMUXER 0
+%define CONFIG_AVR_DEMUXER 0
+%define CONFIG_AVS_DEMUXER 0
+%define CONFIG_BETHSOFTVID_DEMUXER 0
+%define CONFIG_BFI_DEMUXER 0
+%define CONFIG_BINTEXT_DEMUXER 0
+%define CONFIG_BINK_DEMUXER 0
+%define CONFIG_BIT_DEMUXER 0
+%define CONFIG_BMV_DEMUXER 0
+%define CONFIG_BFSTM_DEMUXER 0
+%define CONFIG_BRSTM_DEMUXER 0
+%define CONFIG_BOA_DEMUXER 0
+%define CONFIG_C93_DEMUXER 0
+%define CONFIG_CAF_DEMUXER 0
+%define CONFIG_CAVSVIDEO_DEMUXER 0
+%define CONFIG_CDG_DEMUXER 0
+%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
+%define CONFIG_CONCAT_DEMUXER 0
+%define CONFIG_DATA_DEMUXER 0
+%define CONFIG_DAUD_DEMUXER 0
+%define CONFIG_DFA_DEMUXER 0
+%define CONFIG_DIRAC_DEMUXER 0
+%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
+%define CONFIG_DSICIN_DEMUXER 0
+%define CONFIG_DSS_DEMUXER 0
+%define CONFIG_DTS_DEMUXER 0
+%define CONFIG_DTSHD_DEMUXER 0
+%define CONFIG_DV_DEMUXER 0
+%define CONFIG_DVBSUB_DEMUXER 0
+%define CONFIG_DXA_DEMUXER 0
+%define CONFIG_EA_DEMUXER 0
+%define CONFIG_EA_CDATA_DEMUXER 0
+%define CONFIG_EAC3_DEMUXER 0
+%define CONFIG_EPAF_DEMUXER 0
+%define CONFIG_FFM_DEMUXER 0
+%define CONFIG_FFMETADATA_DEMUXER 0
+%define CONFIG_FILMSTRIP_DEMUXER 0
+%define CONFIG_FLAC_DEMUXER 0
+%define CONFIG_FLIC_DEMUXER 0
+%define CONFIG_FLV_DEMUXER 0
+%define CONFIG_LIVE_FLV_DEMUXER 0
+%define CONFIG_FOURXM_DEMUXER 0
+%define CONFIG_FRM_DEMUXER 0
+%define CONFIG_G722_DEMUXER 0
+%define CONFIG_G723_1_DEMUXER 0
+%define CONFIG_G729_DEMUXER 0
+%define CONFIG_GIF_DEMUXER 0
+%define CONFIG_GSM_DEMUXER 0
+%define CONFIG_GXF_DEMUXER 0
+%define CONFIG_H261_DEMUXER 0
+%define CONFIG_H263_DEMUXER 0
+%define CONFIG_H264_DEMUXER 0
+%define CONFIG_HEVC_DEMUXER 0
+%define CONFIG_HLS_DEMUXER 0
+%define CONFIG_HNM_DEMUXER 0
+%define CONFIG_ICO_DEMUXER 0
+%define CONFIG_IDCIN_DEMUXER 0
+%define CONFIG_IDF_DEMUXER 0
+%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_ILBC_DEMUXER 0
+%define CONFIG_IMAGE2_DEMUXER 0
+%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+%define CONFIG_INGENIENT_DEMUXER 0
+%define CONFIG_IPMOVIE_DEMUXER 0
+%define CONFIG_IRCAM_DEMUXER 0
+%define CONFIG_ISS_DEMUXER 0
+%define CONFIG_IV8_DEMUXER 0
+%define CONFIG_IVF_DEMUXER 0
+%define CONFIG_JACOSUB_DEMUXER 0
+%define CONFIG_JV_DEMUXER 0
+%define CONFIG_LATM_DEMUXER 0
+%define CONFIG_LMLM4_DEMUXER 0
+%define CONFIG_LOAS_DEMUXER 0
+%define CONFIG_LRC_DEMUXER 0
+%define CONFIG_LVF_DEMUXER 0
+%define CONFIG_LXF_DEMUXER 0
+%define CONFIG_M4V_DEMUXER 0
+%define CONFIG_MATROSKA_DEMUXER 1
+%define CONFIG_MGSTS_DEMUXER 0
+%define CONFIG_MICRODVD_DEMUXER 0
+%define CONFIG_MJPEG_DEMUXER 0
+%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
+%define CONFIG_MM_DEMUXER 0
+%define CONFIG_MMF_DEMUXER 0
+%define CONFIG_MOV_DEMUXER 0
+%define CONFIG_MP3_DEMUXER 0
+%define CONFIG_MPC_DEMUXER 0
+%define CONFIG_MPC8_DEMUXER 0
+%define CONFIG_MPEGPS_DEMUXER 0
+%define CONFIG_MPEGTS_DEMUXER 0
+%define CONFIG_MPEGTSRAW_DEMUXER 0
+%define CONFIG_MPEGVIDEO_DEMUXER 0
+%define CONFIG_MPJPEG_DEMUXER 0
+%define CONFIG_MPL2_DEMUXER 0
+%define CONFIG_MPSUB_DEMUXER 0
+%define CONFIG_MSNWC_TCP_DEMUXER 0
+%define CONFIG_MTV_DEMUXER 0
+%define CONFIG_MV_DEMUXER 0
+%define CONFIG_MVI_DEMUXER 0
+%define CONFIG_MXF_DEMUXER 0
+%define CONFIG_MXG_DEMUXER 0
+%define CONFIG_NC_DEMUXER 0
+%define CONFIG_NISTSPHERE_DEMUXER 0
+%define CONFIG_NSV_DEMUXER 0
+%define CONFIG_NUT_DEMUXER 0
+%define CONFIG_NUV_DEMUXER 0
+%define CONFIG_OGG_DEMUXER 1
+%define CONFIG_OMA_DEMUXER 0
+%define CONFIG_PAF_DEMUXER 0
+%define CONFIG_PCM_ALAW_DEMUXER 0
+%define CONFIG_PCM_MULAW_DEMUXER 0
+%define CONFIG_PCM_F64BE_DEMUXER 0
+%define CONFIG_PCM_F64LE_DEMUXER 0
+%define CONFIG_PCM_F32BE_DEMUXER 0
+%define CONFIG_PCM_F32LE_DEMUXER 0
+%define CONFIG_PCM_S32BE_DEMUXER 0
+%define CONFIG_PCM_S32LE_DEMUXER 0
+%define CONFIG_PCM_S24BE_DEMUXER 0
+%define CONFIG_PCM_S24LE_DEMUXER 0
+%define CONFIG_PCM_S16BE_DEMUXER 0
+%define CONFIG_PCM_S16LE_DEMUXER 0
+%define CONFIG_PCM_S8_DEMUXER 0
+%define CONFIG_PCM_U32BE_DEMUXER 0
+%define CONFIG_PCM_U32LE_DEMUXER 0
+%define CONFIG_PCM_U24BE_DEMUXER 0
+%define CONFIG_PCM_U24LE_DEMUXER 0
+%define CONFIG_PCM_U16BE_DEMUXER 0
+%define CONFIG_PCM_U16LE_DEMUXER 0
+%define CONFIG_PCM_U8_DEMUXER 0
+%define CONFIG_PJS_DEMUXER 0
+%define CONFIG_PMP_DEMUXER 0
+%define CONFIG_PVA_DEMUXER 0
+%define CONFIG_PVF_DEMUXER 0
+%define CONFIG_QCP_DEMUXER 0
+%define CONFIG_R3D_DEMUXER 0
+%define CONFIG_RAWVIDEO_DEMUXER 0
+%define CONFIG_REALTEXT_DEMUXER 0
+%define CONFIG_REDSPARK_DEMUXER 0
+%define CONFIG_RL2_DEMUXER 0
+%define CONFIG_RM_DEMUXER 0
+%define CONFIG_ROQ_DEMUXER 0
+%define CONFIG_RPL_DEMUXER 0
+%define CONFIG_RSD_DEMUXER 0
+%define CONFIG_RSO_DEMUXER 0
+%define CONFIG_RTP_DEMUXER 0
+%define CONFIG_RTSP_DEMUXER 0
+%define CONFIG_SAMI_DEMUXER 0
+%define CONFIG_SAP_DEMUXER 0
+%define CONFIG_SBG_DEMUXER 0
+%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
+%define CONFIG_SEGAFILM_DEMUXER 0
+%define CONFIG_SHORTEN_DEMUXER 0
+%define CONFIG_SIFF_DEMUXER 0
+%define CONFIG_SLN_DEMUXER 0
+%define CONFIG_SMACKER_DEMUXER 0
+%define CONFIG_SMJPEG_DEMUXER 0
+%define CONFIG_SMUSH_DEMUXER 0
+%define CONFIG_SOL_DEMUXER 0
+%define CONFIG_SOX_DEMUXER 0
+%define CONFIG_SPDIF_DEMUXER 0
+%define CONFIG_SRT_DEMUXER 0
+%define CONFIG_STR_DEMUXER 0
+%define CONFIG_STL_DEMUXER 0
+%define CONFIG_SUBVIEWER1_DEMUXER 0
+%define CONFIG_SUBVIEWER_DEMUXER 0
+%define CONFIG_SUP_DEMUXER 0
+%define CONFIG_SWF_DEMUXER 0
+%define CONFIG_TAK_DEMUXER 0
+%define CONFIG_TEDCAPTIONS_DEMUXER 0
+%define CONFIG_THP_DEMUXER 0
+%define CONFIG_TIERTEXSEQ_DEMUXER 0
+%define CONFIG_TMV_DEMUXER 0
+%define CONFIG_TRUEHD_DEMUXER 0
+%define CONFIG_TTA_DEMUXER 0
+%define CONFIG_TXD_DEMUXER 0
+%define CONFIG_TTY_DEMUXER 0
+%define CONFIG_VC1_DEMUXER 0
+%define CONFIG_VC1T_DEMUXER 0
+%define CONFIG_VIVO_DEMUXER 0
+%define CONFIG_VMD_DEMUXER 0
+%define CONFIG_VOBSUB_DEMUXER 0
+%define CONFIG_VOC_DEMUXER 0
+%define CONFIG_VPLAYER_DEMUXER 0
+%define CONFIG_VQF_DEMUXER 0
+%define CONFIG_W64_DEMUXER 0
+%define CONFIG_WAV_DEMUXER 1
+%define CONFIG_WC3_DEMUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+%define CONFIG_WEBVTT_DEMUXER 0
+%define CONFIG_WSAUD_DEMUXER 0
+%define CONFIG_WSVQA_DEMUXER 0
+%define CONFIG_WTV_DEMUXER 0
+%define CONFIG_WV_DEMUXER 0
+%define CONFIG_XA_DEMUXER 0
+%define CONFIG_XBIN_DEMUXER 0
+%define CONFIG_XMV_DEMUXER 0
+%define CONFIG_XWMA_DEMUXER 0
+%define CONFIG_YOP_DEMUXER 0
+%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+%define CONFIG_LIBGME_DEMUXER 0
+%define CONFIG_LIBMODPLUG_DEMUXER 0
+%define CONFIG_LIBNUT_DEMUXER 0
+%define CONFIG_LIBQUVI_DEMUXER 0
+%define CONFIG_A64MULTI_ENCODER 0
+%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
+%define CONFIG_AMV_ENCODER 0
+%define CONFIG_APNG_ENCODER 0
+%define CONFIG_ASV1_ENCODER 0
+%define CONFIG_ASV2_ENCODER 0
+%define CONFIG_AVRP_ENCODER 0
+%define CONFIG_AVUI_ENCODER 0
+%define CONFIG_AYUV_ENCODER 0
+%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
+%define CONFIG_CLJR_ENCODER 0
+%define CONFIG_COMFORTNOISE_ENCODER 0
+%define CONFIG_DNXHD_ENCODER 0
+%define CONFIG_DPX_ENCODER 0
+%define CONFIG_DVVIDEO_ENCODER 0
+%define CONFIG_FFV1_ENCODER 0
+%define CONFIG_FFVHUFF_ENCODER 0
+%define CONFIG_FLASHSV_ENCODER 0
+%define CONFIG_FLASHSV2_ENCODER 0
+%define CONFIG_FLV_ENCODER 0
+%define CONFIG_GIF_ENCODER 0
+%define CONFIG_H261_ENCODER 0
+%define CONFIG_H263_ENCODER 0
+%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
+%define CONFIG_HUFFYUV_ENCODER 0
+%define CONFIG_JPEG2000_ENCODER 0
+%define CONFIG_JPEGLS_ENCODER 0
+%define CONFIG_LJPEG_ENCODER 0
+%define CONFIG_MJPEG_ENCODER 0
+%define CONFIG_MPEG1VIDEO_ENCODER 0
+%define CONFIG_MPEG2VIDEO_ENCODER 0
+%define CONFIG_MPEG4_ENCODER 0
+%define CONFIG_MSMPEG4V2_ENCODER 0
+%define CONFIG_MSMPEG4V3_ENCODER 0
+%define CONFIG_MSVIDEO1_ENCODER 0
+%define CONFIG_PAM_ENCODER 0
+%define CONFIG_PBM_ENCODER 0
+%define CONFIG_PCX_ENCODER 0
+%define CONFIG_PGM_ENCODER 0
+%define CONFIG_PGMYUV_ENCODER 0
+%define CONFIG_PNG_ENCODER 0
+%define CONFIG_PPM_ENCODER 0
+%define CONFIG_PRORES_ENCODER 0
+%define CONFIG_PRORES_AW_ENCODER 0
+%define CONFIG_PRORES_KS_ENCODER 0
+%define CONFIG_QTRLE_ENCODER 0
+%define CONFIG_R10K_ENCODER 0
+%define CONFIG_R210_ENCODER 0
+%define CONFIG_RAWVIDEO_ENCODER 0
+%define CONFIG_ROQ_ENCODER 0
+%define CONFIG_RV10_ENCODER 0
+%define CONFIG_RV20_ENCODER 0
+%define CONFIG_S302M_ENCODER 0
+%define CONFIG_SGI_ENCODER 0
+%define CONFIG_SNOW_ENCODER 0
+%define CONFIG_SUNRAST_ENCODER 0
+%define CONFIG_SVQ1_ENCODER 0
+%define CONFIG_TARGA_ENCODER 0
+%define CONFIG_TIFF_ENCODER 0
+%define CONFIG_UTVIDEO_ENCODER 0
+%define CONFIG_V210_ENCODER 0
+%define CONFIG_V308_ENCODER 0
+%define CONFIG_V408_ENCODER 0
+%define CONFIG_V410_ENCODER 0
+%define CONFIG_WMV1_ENCODER 0
+%define CONFIG_WMV2_ENCODER 0
+%define CONFIG_XBM_ENCODER 0
+%define CONFIG_XFACE_ENCODER 0
+%define CONFIG_XWD_ENCODER 0
+%define CONFIG_Y41P_ENCODER 0
+%define CONFIG_YUV4_ENCODER 0
+%define CONFIG_ZLIB_ENCODER 0
+%define CONFIG_ZMBV_ENCODER 0
+%define CONFIG_AAC_ENCODER 0
+%define CONFIG_AC3_ENCODER 0
+%define CONFIG_AC3_FIXED_ENCODER 0
+%define CONFIG_ALAC_ENCODER 0
+%define CONFIG_DCA_ENCODER 0
+%define CONFIG_EAC3_ENCODER 0
+%define CONFIG_FLAC_ENCODER 0
+%define CONFIG_G723_1_ENCODER 0
+%define CONFIG_MP2_ENCODER 0
+%define CONFIG_MP2FIXED_ENCODER 0
+%define CONFIG_NELLYMOSER_ENCODER 0
+%define CONFIG_RA_144_ENCODER 0
+%define CONFIG_SONIC_ENCODER 0
+%define CONFIG_SONIC_LS_ENCODER 0
+%define CONFIG_TTA_ENCODER 0
+%define CONFIG_VORBIS_ENCODER 0
+%define CONFIG_WAVPACK_ENCODER 0
+%define CONFIG_WMAV1_ENCODER 0
+%define CONFIG_WMAV2_ENCODER 0
+%define CONFIG_PCM_ALAW_ENCODER 0
+%define CONFIG_PCM_F32BE_ENCODER 0
+%define CONFIG_PCM_F32LE_ENCODER 0
+%define CONFIG_PCM_F64BE_ENCODER 0
+%define CONFIG_PCM_F64LE_ENCODER 0
+%define CONFIG_PCM_MULAW_ENCODER 0
+%define CONFIG_PCM_S8_ENCODER 0
+%define CONFIG_PCM_S8_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16BE_ENCODER 0
+%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16LE_ENCODER 0
+%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S24BE_ENCODER 0
+%define CONFIG_PCM_S24DAUD_ENCODER 0
+%define CONFIG_PCM_S24LE_ENCODER 0
+%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S32BE_ENCODER 0
+%define CONFIG_PCM_S32LE_ENCODER 0
+%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_U8_ENCODER 0
+%define CONFIG_PCM_U16BE_ENCODER 0
+%define CONFIG_PCM_U16LE_ENCODER 0
+%define CONFIG_PCM_U24BE_ENCODER 0
+%define CONFIG_PCM_U24LE_ENCODER 0
+%define CONFIG_PCM_U32BE_ENCODER 0
+%define CONFIG_PCM_U32LE_ENCODER 0
+%define CONFIG_ROQ_DPCM_ENCODER 0
+%define CONFIG_ADPCM_ADX_ENCODER 0
+%define CONFIG_ADPCM_G722_ENCODER 0
+%define CONFIG_ADPCM_G726_ENCODER 0
+%define CONFIG_ADPCM_IMA_QT_ENCODER 0
+%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+%define CONFIG_ADPCM_MS_ENCODER 0
+%define CONFIG_ADPCM_SWF_ENCODER 0
+%define CONFIG_ADPCM_YAMAHA_ENCODER 0
+%define CONFIG_SSA_ENCODER 0
+%define CONFIG_ASS_ENCODER 0
+%define CONFIG_DVBSUB_ENCODER 0
+%define CONFIG_DVDSUB_ENCODER 0
+%define CONFIG_MOVTEXT_ENCODER 0
+%define CONFIG_SRT_ENCODER 0
+%define CONFIG_SUBRIP_ENCODER 0
+%define CONFIG_WEBVTT_ENCODER 0
+%define CONFIG_XSUB_ENCODER 0
+%define CONFIG_LIBFAAC_ENCODER 0
+%define CONFIG_LIBFDK_AAC_ENCODER 0
+%define CONFIG_LIBGSM_ENCODER 0
+%define CONFIG_LIBGSM_MS_ENCODER 0
+%define CONFIG_LIBILBC_ENCODER 0
+%define CONFIG_LIBMP3LAME_ENCODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+%define CONFIG_LIBOPENJPEG_ENCODER 0
+%define CONFIG_LIBOPUS_ENCODER 0
+%define CONFIG_LIBSCHROEDINGER_ENCODER 0
+%define CONFIG_LIBSHINE_ENCODER 0
+%define CONFIG_LIBSPEEX_ENCODER 0
+%define CONFIG_LIBTHEORA_ENCODER 0
+%define CONFIG_LIBTWOLAME_ENCODER 0
+%define CONFIG_LIBUTVIDEO_ENCODER 0
+%define CONFIG_LIBVO_AACENC_ENCODER 0
+%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+%define CONFIG_LIBVORBIS_ENCODER 0
+%define CONFIG_LIBVPX_VP8_ENCODER 0
+%define CONFIG_LIBVPX_VP9_ENCODER 0
+%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ANIM_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
+%define CONFIG_LIBX264_ENCODER 0
+%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
+%define CONFIG_LIBXAVS_ENCODER 0
+%define CONFIG_LIBXVID_ENCODER 0
+%define CONFIG_LIBAACPLUS_ENCODER 0
+%define CONFIG_LIBOPENH264_ENCODER 0
+%define CONFIG_H264_QSV_ENCODER 0
+%define CONFIG_NVENC_ENCODER 0
+%define CONFIG_NVENC_H264_ENCODER 0
+%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
+%define CONFIG_ADELAY_FILTER 0
+%define CONFIG_AECHO_FILTER 0
+%define CONFIG_AEVAL_FILTER 0
+%define CONFIG_AFADE_FILTER 0
+%define CONFIG_AFORMAT_FILTER 0
+%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
+%define CONFIG_ALLPASS_FILTER 0
+%define CONFIG_AMERGE_FILTER 0
+%define CONFIG_AMIX_FILTER 0
+%define CONFIG_ANULL_FILTER 0
+%define CONFIG_APAD_FILTER 0
+%define CONFIG_APERMS_FILTER 0
+%define CONFIG_APHASER_FILTER 0
+%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
+%define CONFIG_ASELECT_FILTER 0
+%define CONFIG_ASENDCMD_FILTER 0
+%define CONFIG_ASETNSAMPLES_FILTER 0
+%define CONFIG_ASETPTS_FILTER 0
+%define CONFIG_ASETRATE_FILTER 0
+%define CONFIG_ASETTB_FILTER 0
+%define CONFIG_ASHOWINFO_FILTER 0
+%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASTATS_FILTER 0
+%define CONFIG_ASTREAMSYNC_FILTER 0
+%define CONFIG_ASYNCTS_FILTER 0
+%define CONFIG_ATEMPO_FILTER 0
+%define CONFIG_ATRIM_FILTER 0
+%define CONFIG_AZMQ_FILTER 0
+%define CONFIG_BANDPASS_FILTER 0
+%define CONFIG_BANDREJECT_FILTER 0
+%define CONFIG_BASS_FILTER 0
+%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
+%define CONFIG_CHANNELMAP_FILTER 0
+%define CONFIG_CHANNELSPLIT_FILTER 0
+%define CONFIG_CHORUS_FILTER 0
+%define CONFIG_COMPAND_FILTER 0
+%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
+%define CONFIG_EARWAX_FILTER 0
+%define CONFIG_EBUR128_FILTER 0
+%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
+%define CONFIG_FLANGER_FILTER 0
+%define CONFIG_HIGHPASS_FILTER 0
+%define CONFIG_JOIN_FILTER 0
+%define CONFIG_LADSPA_FILTER 0
+%define CONFIG_LOWPASS_FILTER 0
+%define CONFIG_PAN_FILTER 0
+%define CONFIG_REPLAYGAIN_FILTER 0
+%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+%define CONFIG_SILENCEDETECT_FILTER 0
+%define CONFIG_SILENCEREMOVE_FILTER 0
+%define CONFIG_TREBLE_FILTER 0
+%define CONFIG_VOLUME_FILTER 0
+%define CONFIG_VOLUMEDETECT_FILTER 0
+%define CONFIG_AEVALSRC_FILTER 0
+%define CONFIG_ANULLSRC_FILTER 0
+%define CONFIG_FLITE_FILTER 0
+%define CONFIG_SINE_FILTER 0
+%define CONFIG_ANULLSINK_FILTER 0
+%define CONFIG_ALPHAEXTRACT_FILTER 0
+%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
+%define CONFIG_ASS_FILTER 0
+%define CONFIG_BBOX_FILTER 0
+%define CONFIG_BLACKDETECT_FILTER 0
+%define CONFIG_BLACKFRAME_FILTER 0
+%define CONFIG_BLEND_FILTER 0
+%define CONFIG_BOXBLUR_FILTER 0
+%define CONFIG_CODECVIEW_FILTER 0
+%define CONFIG_COLORBALANCE_FILTER 0
+%define CONFIG_COLORCHANNELMIXER_FILTER 0
+%define CONFIG_COLORKEY_FILTER 0
+%define CONFIG_COLORLEVELS_FILTER 0
+%define CONFIG_COLORMATRIX_FILTER 0
+%define CONFIG_COPY_FILTER 0
+%define CONFIG_COVER_RECT_FILTER 0
+%define CONFIG_CROP_FILTER 0
+%define CONFIG_CROPDETECT_FILTER 0
+%define CONFIG_CURVES_FILTER 0
+%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
+%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
+%define CONFIG_DELOGO_FILTER 0
+%define CONFIG_DESHAKE_FILTER 0
+%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
+%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
+%define CONFIG_DRAWGRID_FILTER 0
+%define CONFIG_DRAWTEXT_FILTER 0
+%define CONFIG_EDGEDETECT_FILTER 0
+%define CONFIG_ELBG_FILTER 0
+%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
+%define CONFIG_EXTRACTPLANES_FILTER 0
+%define CONFIG_FADE_FILTER 0
+%define CONFIG_FFTFILT_FILTER 0
+%define CONFIG_FIELD_FILTER 0
+%define CONFIG_FIELDMATCH_FILTER 0
+%define CONFIG_FIELDORDER_FILTER 0
+%define CONFIG_FIND_RECT_FILTER 0
+%define CONFIG_FORMAT_FILTER 0
+%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
+%define CONFIG_FRAMESTEP_FILTER 0
+%define CONFIG_FREI0R_FILTER 0
+%define CONFIG_FSPP_FILTER 0
+%define CONFIG_GEQ_FILTER 0
+%define CONFIG_GRADFUN_FILTER 0
+%define CONFIG_HALDCLUT_FILTER 0
+%define CONFIG_HFLIP_FILTER 0
+%define CONFIG_HISTEQ_FILTER 0
+%define CONFIG_HISTOGRAM_FILTER 0
+%define CONFIG_HQDN3D_FILTER 0
+%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
+%define CONFIG_HUE_FILTER 0
+%define CONFIG_IDET_FILTER 0
+%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
+%define CONFIG_INTERLACE_FILTER 0
+%define CONFIG_INTERLEAVE_FILTER 0
+%define CONFIG_KERNDEINT_FILTER 0
+%define CONFIG_LENSCORRECTION_FILTER 0
+%define CONFIG_LUT3D_FILTER 0
+%define CONFIG_LUT_FILTER 0
+%define CONFIG_LUTRGB_FILTER 0
+%define CONFIG_LUTYUV_FILTER 0
+%define CONFIG_MCDEINT_FILTER 0
+%define CONFIG_MERGEPLANES_FILTER 0
+%define CONFIG_MPDECIMATE_FILTER 0
+%define CONFIG_NEGATE_FILTER 0
+%define CONFIG_NOFORMAT_FILTER 0
+%define CONFIG_NOISE_FILTER 0
+%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
+%define CONFIG_OCV_FILTER 0
+%define CONFIG_OVERLAY_FILTER 0
+%define CONFIG_OWDENOISE_FILTER 0
+%define CONFIG_PAD_FILTER 0
+%define CONFIG_PALETTEGEN_FILTER 0
+%define CONFIG_PALETTEUSE_FILTER 0
+%define CONFIG_PERMS_FILTER 0
+%define CONFIG_PERSPECTIVE_FILTER 0
+%define CONFIG_PHASE_FILTER 0
+%define CONFIG_PIXDESCTEST_FILTER 0
+%define CONFIG_PP_FILTER 0
+%define CONFIG_PP7_FILTER 0
+%define CONFIG_PSNR_FILTER 0
+%define CONFIG_PULLUP_FILTER 0
+%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
+%define CONFIG_REMOVELOGO_FILTER 0
+%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
+%define CONFIG_ROTATE_FILTER 0
+%define CONFIG_SAB_FILTER 0
+%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
+%define CONFIG_SELECT_FILTER 0
+%define CONFIG_SENDCMD_FILTER 0
+%define CONFIG_SEPARATEFIELDS_FILTER 0
+%define CONFIG_SETDAR_FILTER 0
+%define CONFIG_SETFIELD_FILTER 0
+%define CONFIG_SETPTS_FILTER 0
+%define CONFIG_SETSAR_FILTER 0
+%define CONFIG_SETTB_FILTER 0
+%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHOWPALETTE_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
+%define CONFIG_SIGNALSTATS_FILTER 0
+%define CONFIG_SMARTBLUR_FILTER 0
+%define CONFIG_SPLIT_FILTER 0
+%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
+%define CONFIG_STEREO3D_FILTER 0
+%define CONFIG_SUBTITLES_FILTER 0
+%define CONFIG_SUPER2XSAI_FILTER 0
+%define CONFIG_SWAPUV_FILTER 0
+%define CONFIG_TBLEND_FILTER 0
+%define CONFIG_TELECINE_FILTER 0
+%define CONFIG_THUMBNAIL_FILTER 0
+%define CONFIG_TILE_FILTER 0
+%define CONFIG_TINTERLACE_FILTER 0
+%define CONFIG_TRANSPOSE_FILTER 0
+%define CONFIG_TRIM_FILTER 0
+%define CONFIG_UNSHARP_FILTER 0
+%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
+%define CONFIG_VFLIP_FILTER 0
+%define CONFIG_VIDSTABDETECT_FILTER 0
+%define CONFIG_VIDSTABTRANSFORM_FILTER 0
+%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
+%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
+%define CONFIG_XBR_FILTER 0
+%define CONFIG_YADIF_FILTER 0
+%define CONFIG_ZMQ_FILTER 0
+%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
+%define CONFIG_CELLAUTO_FILTER 0
+%define CONFIG_COLOR_FILTER 0
+%define CONFIG_FREI0R_SRC_FILTER 0
+%define CONFIG_HALDCLUTSRC_FILTER 0
+%define CONFIG_LIFE_FILTER 0
+%define CONFIG_MANDELBROT_FILTER 0
+%define CONFIG_MPTESTSRC_FILTER 0
+%define CONFIG_NULLSRC_FILTER 0
+%define CONFIG_RGBTESTSRC_FILTER 0
+%define CONFIG_SMPTEBARS_FILTER 0
+%define CONFIG_SMPTEHDBARS_FILTER 0
+%define CONFIG_TESTSRC_FILTER 0
+%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
+%define CONFIG_AVECTORSCOPE_FILTER 0
+%define CONFIG_CONCAT_FILTER 0
+%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
+%define CONFIG_SHOWWAVES_FILTER 0
+%define CONFIG_SHOWWAVESPIC_FILTER 0
+%define CONFIG_AMOVIE_FILTER 0
+%define CONFIG_MOVIE_FILTER 0
+%define CONFIG_H263_VAAPI_HWACCEL 0
+%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_H264_D3D11VA_HWACCEL 0
+%define CONFIG_H264_DXVA2_HWACCEL 0
+%define CONFIG_H264_MMAL_HWACCEL 0
+%define CONFIG_H264_QSV_HWACCEL 0
+%define CONFIG_H264_VAAPI_HWACCEL 0
+%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
+%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_HEVC_D3D11VA_HWACCEL 0
+%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
+%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
+%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
+%define CONFIG_MPEG2_VAAPI_HWACCEL 0
+%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG4_VAAPI_HWACCEL 0
+%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_VC1_D3D11VA_HWACCEL 0
+%define CONFIG_VC1_DXVA2_HWACCEL 0
+%define CONFIG_VC1_VAAPI_HWACCEL 0
+%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
+%define CONFIG_WMV3_D3D11VA_HWACCEL 0
+%define CONFIG_WMV3_DXVA2_HWACCEL 0
+%define CONFIG_WMV3_VAAPI_HWACCEL 0
+%define CONFIG_WMV3_VDPAU_HWACCEL 0
+%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
+%define CONFIG_BKTR_INDEV 0
+%define CONFIG_DECKLINK_INDEV 0
+%define CONFIG_DSHOW_INDEV 0
+%define CONFIG_DV1394_INDEV 0
+%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
+%define CONFIG_IEC61883_INDEV 0
+%define CONFIG_JACK_INDEV 0
+%define CONFIG_LAVFI_INDEV 0
+%define CONFIG_OPENAL_INDEV 0
+%define CONFIG_OSS_INDEV 0
+%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
+%define CONFIG_SNDIO_INDEV 0
+%define CONFIG_V4L2_INDEV 0
+%define CONFIG_VFWCAP_INDEV 0
+%define CONFIG_X11GRAB_INDEV 0
+%define CONFIG_X11GRAB_XCB_INDEV 0
+%define CONFIG_LIBCDIO_INDEV 0
+%define CONFIG_LIBDC1394_INDEV 0
+%define CONFIG_A64_MUXER 0
+%define CONFIG_AC3_MUXER 0
+%define CONFIG_ADTS_MUXER 0
+%define CONFIG_ADX_MUXER 0
+%define CONFIG_AIFF_MUXER 0
+%define CONFIG_AMR_MUXER 0
+%define CONFIG_APNG_MUXER 0
+%define CONFIG_ASF_MUXER 0
+%define CONFIG_ASS_MUXER 0
+%define CONFIG_AST_MUXER 0
+%define CONFIG_ASF_STREAM_MUXER 0
+%define CONFIG_AU_MUXER 0
+%define CONFIG_AVI_MUXER 0
+%define CONFIG_AVM2_MUXER 0
+%define CONFIG_BIT_MUXER 0
+%define CONFIG_CAF_MUXER 0
+%define CONFIG_CAVSVIDEO_MUXER 0
+%define CONFIG_CRC_MUXER 0
+%define CONFIG_DASH_MUXER 0
+%define CONFIG_DATA_MUXER 0
+%define CONFIG_DAUD_MUXER 0
+%define CONFIG_DIRAC_MUXER 0
+%define CONFIG_DNXHD_MUXER 0
+%define CONFIG_DTS_MUXER 0
+%define CONFIG_DV_MUXER 0
+%define CONFIG_EAC3_MUXER 0
+%define CONFIG_F4V_MUXER 0
+%define CONFIG_FFM_MUXER 0
+%define CONFIG_FFMETADATA_MUXER 0
+%define CONFIG_FILMSTRIP_MUXER 0
+%define CONFIG_FLAC_MUXER 0
+%define CONFIG_FLV_MUXER 0
+%define CONFIG_FRAMECRC_MUXER 0
+%define CONFIG_FRAMEMD5_MUXER 0
+%define CONFIG_G722_MUXER 0
+%define CONFIG_G723_1_MUXER 0
+%define CONFIG_GIF_MUXER 0
+%define CONFIG_GXF_MUXER 0
+%define CONFIG_H261_MUXER 0
+%define CONFIG_H263_MUXER 0
+%define CONFIG_H264_MUXER 0
+%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
+%define CONFIG_HLS_MUXER 0
+%define CONFIG_ICO_MUXER 0
+%define CONFIG_ILBC_MUXER 0
+%define CONFIG_IMAGE2_MUXER 0
+%define CONFIG_IMAGE2PIPE_MUXER 0
+%define CONFIG_IPOD_MUXER 0
+%define CONFIG_IRCAM_MUXER 0
+%define CONFIG_ISMV_MUXER 0
+%define CONFIG_IVF_MUXER 0
+%define CONFIG_JACOSUB_MUXER 0
+%define CONFIG_LATM_MUXER 0
+%define CONFIG_LRC_MUXER 0
+%define CONFIG_M4V_MUXER 0
+%define CONFIG_MD5_MUXER 0
+%define CONFIG_MATROSKA_MUXER 0
+%define CONFIG_MATROSKA_AUDIO_MUXER 0
+%define CONFIG_MICRODVD_MUXER 0
+%define CONFIG_MJPEG_MUXER 0
+%define CONFIG_MLP_MUXER 0
+%define CONFIG_MMF_MUXER 0
+%define CONFIG_MOV_MUXER 0
+%define CONFIG_MP2_MUXER 0
+%define CONFIG_MP3_MUXER 0
+%define CONFIG_MP4_MUXER 0
+%define CONFIG_MPEG1SYSTEM_MUXER 0
+%define CONFIG_MPEG1VCD_MUXER 0
+%define CONFIG_MPEG1VIDEO_MUXER 0
+%define CONFIG_MPEG2DVD_MUXER 0
+%define CONFIG_MPEG2SVCD_MUXER 0
+%define CONFIG_MPEG2VIDEO_MUXER 0
+%define CONFIG_MPEG2VOB_MUXER 0
+%define CONFIG_MPEGTS_MUXER 0
+%define CONFIG_MPJPEG_MUXER 0
+%define CONFIG_MXF_MUXER 0
+%define CONFIG_MXF_D10_MUXER 0
+%define CONFIG_MXF_OPATOM_MUXER 0
+%define CONFIG_NULL_MUXER 0
+%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
+%define CONFIG_OGG_MUXER 0
+%define CONFIG_OMA_MUXER 0
+%define CONFIG_OPUS_MUXER 0
+%define CONFIG_PCM_ALAW_MUXER 0
+%define CONFIG_PCM_MULAW_MUXER 0
+%define CONFIG_PCM_F64BE_MUXER 0
+%define CONFIG_PCM_F64LE_MUXER 0
+%define CONFIG_PCM_F32BE_MUXER 0
+%define CONFIG_PCM_F32LE_MUXER 0
+%define CONFIG_PCM_S32BE_MUXER 0
+%define CONFIG_PCM_S32LE_MUXER 0
+%define CONFIG_PCM_S24BE_MUXER 0
+%define CONFIG_PCM_S24LE_MUXER 0
+%define CONFIG_PCM_S16BE_MUXER 0
+%define CONFIG_PCM_S16LE_MUXER 0
+%define CONFIG_PCM_S8_MUXER 0
+%define CONFIG_PCM_U32BE_MUXER 0
+%define CONFIG_PCM_U32LE_MUXER 0
+%define CONFIG_PCM_U24BE_MUXER 0
+%define CONFIG_PCM_U24LE_MUXER 0
+%define CONFIG_PCM_U16BE_MUXER 0
+%define CONFIG_PCM_U16LE_MUXER 0
+%define CONFIG_PCM_U8_MUXER 0
+%define CONFIG_PSP_MUXER 0
+%define CONFIG_RAWVIDEO_MUXER 0
+%define CONFIG_RM_MUXER 0
+%define CONFIG_ROQ_MUXER 0
+%define CONFIG_RSO_MUXER 0
+%define CONFIG_RTP_MUXER 0
+%define CONFIG_RTP_MPEGTS_MUXER 0
+%define CONFIG_RTSP_MUXER 0
+%define CONFIG_SAP_MUXER 0
+%define CONFIG_SEGMENT_MUXER 0
+%define CONFIG_STREAM_SEGMENT_MUXER 0
+%define CONFIG_SINGLEJPEG_MUXER 0
+%define CONFIG_SMJPEG_MUXER 0
+%define CONFIG_SMOOTHSTREAMING_MUXER 0
+%define CONFIG_SOX_MUXER 0
+%define CONFIG_SPX_MUXER 0
+%define CONFIG_SPDIF_MUXER 0
+%define CONFIG_SRT_MUXER 0
+%define CONFIG_SWF_MUXER 0
+%define CONFIG_TEE_MUXER 0
+%define CONFIG_TG2_MUXER 0
+%define CONFIG_TGP_MUXER 0
+%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
+%define CONFIG_VC1_MUXER 0
+%define CONFIG_VC1T_MUXER 0
+%define CONFIG_VOC_MUXER 0
+%define CONFIG_W64_MUXER 0
+%define CONFIG_WAV_MUXER 0
+%define CONFIG_WEBM_MUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+%define CONFIG_WEBM_CHUNK_MUXER 0
+%define CONFIG_WEBP_MUXER 0
+%define CONFIG_WEBVTT_MUXER 0
+%define CONFIG_WTV_MUXER 0
+%define CONFIG_WV_MUXER 0
+%define CONFIG_YUV4MPEGPIPE_MUXER 0
+%define CONFIG_LIBNUT_MUXER 0
+%define CONFIG_ALSA_OUTDEV 0
+%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
+%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
+%define CONFIG_OSS_OUTDEV 0
+%define CONFIG_PULSE_OUTDEV 0
+%define CONFIG_SDL_OUTDEV 0
+%define CONFIG_SNDIO_OUTDEV 0
+%define CONFIG_V4L2_OUTDEV 0
+%define CONFIG_XV_OUTDEV 0
+%define CONFIG_AAC_PARSER 0
+%define CONFIG_AAC_LATM_PARSER 0
+%define CONFIG_AC3_PARSER 0
+%define CONFIG_ADX_PARSER 0
+%define CONFIG_BMP_PARSER 0
+%define CONFIG_CAVSVIDEO_PARSER 0
+%define CONFIG_COOK_PARSER 0
+%define CONFIG_DCA_PARSER 0
+%define CONFIG_DIRAC_PARSER 0
+%define CONFIG_DNXHD_PARSER 0
+%define CONFIG_DPX_PARSER 0
+%define CONFIG_DVBSUB_PARSER 0
+%define CONFIG_DVDSUB_PARSER 0
+%define CONFIG_DVD_NAV_PARSER 0
+%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
+%define CONFIG_GSM_PARSER 0
+%define CONFIG_H261_PARSER 0
+%define CONFIG_H263_PARSER 0
+%define CONFIG_H264_PARSER 0
+%define CONFIG_HEVC_PARSER 0
+%define CONFIG_MJPEG_PARSER 0
+%define CONFIG_MLP_PARSER 0
+%define CONFIG_MPEG4VIDEO_PARSER 0
+%define CONFIG_MPEGAUDIO_PARSER 0
+%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
+%define CONFIG_PNG_PARSER 0
+%define CONFIG_PNM_PARSER 0
+%define CONFIG_RV30_PARSER 0
+%define CONFIG_RV40_PARSER 0
+%define CONFIG_TAK_PARSER 0
+%define CONFIG_VC1_PARSER 0
+%define CONFIG_VORBIS_PARSER 1
+%define CONFIG_VP3_PARSER 0
+%define CONFIG_VP8_PARSER 0
+%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
+%define CONFIG_BLURAY_PROTOCOL 0
+%define CONFIG_CACHE_PROTOCOL 0
+%define CONFIG_CONCAT_PROTOCOL 0
+%define CONFIG_CRYPTO_PROTOCOL 0
+%define CONFIG_DATA_PROTOCOL 0
+%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+%define CONFIG_FFRTMPHTTP_PROTOCOL 0
+%define CONFIG_FILE_PROTOCOL 0
+%define CONFIG_FTP_PROTOCOL 0
+%define CONFIG_GOPHER_PROTOCOL 0
+%define CONFIG_HLS_PROTOCOL 0
+%define CONFIG_HTTP_PROTOCOL 0
+%define CONFIG_HTTPPROXY_PROTOCOL 0
+%define CONFIG_HTTPS_PROTOCOL 0
+%define CONFIG_ICECAST_PROTOCOL 0
+%define CONFIG_MMSH_PROTOCOL 0
+%define CONFIG_MMST_PROTOCOL 0
+%define CONFIG_MD5_PROTOCOL 0
+%define CONFIG_PIPE_PROTOCOL 0
+%define CONFIG_RTMP_PROTOCOL 0
+%define CONFIG_RTMPE_PROTOCOL 0
+%define CONFIG_RTMPS_PROTOCOL 0
+%define CONFIG_RTMPT_PROTOCOL 0
+%define CONFIG_RTMPTE_PROTOCOL 0
+%define CONFIG_RTMPTS_PROTOCOL 0
+%define CONFIG_RTP_PROTOCOL 0
+%define CONFIG_SCTP_PROTOCOL 0
+%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
+%define CONFIG_TCP_PROTOCOL 0
+%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+%define CONFIG_TLS_GNUTLS_PROTOCOL 0
+%define CONFIG_TLS_OPENSSL_PROTOCOL 0
+%define CONFIG_UDP_PROTOCOL 0
+%define CONFIG_UDPLITE_PROTOCOL 0
+%define CONFIG_UNIX_PROTOCOL 0
+%define CONFIG_LIBRTMP_PROTOCOL 0
+%define CONFIG_LIBRTMPE_PROTOCOL 0
+%define CONFIG_LIBRTMPS_PROTOCOL 0
+%define CONFIG_LIBRTMPT_PROTOCOL 0
+%define CONFIG_LIBRTMPTE_PROTOCOL 0
+%define CONFIG_LIBSSH_PROTOCOL 0
+%define CONFIG_LIBSMBCLIENT_PROTOCOL 0
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
new file mode 100644
index 00000000000..408de621c1a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-x86 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android- --target-os=linux --arch=i686 --enable-yasm --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 1
+#define ARCH_X86_32 1
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 1
+#define HAVE_AMD3DNOWEXT 1
+#define HAVE_AVX 1
+#define HAVE_AVX2 1
+#define HAVE_FMA3 1
+#define HAVE_FMA4 1
+#define HAVE_MMX 1
+#define HAVE_MMXEXT 1
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
+#define HAVE_SSE3 1
+#define HAVE_SSE4 1
+#define HAVE_SSE42 1
+#define HAVE_SSSE3 1
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 1
+#define HAVE_AMD3DNOWEXT_EXTERNAL 1
+#define HAVE_AVX_EXTERNAL 1
+#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
+#define HAVE_FMA4_EXTERNAL 1
+#define HAVE_MMX_EXTERNAL 1
+#define HAVE_MMXEXT_EXTERNAL 1
+#define HAVE_SSE_EXTERNAL 1
+#define HAVE_SSE2_EXTERNAL 1
+#define HAVE_SSE3_EXTERNAL 1
+#define HAVE_SSE4_EXTERNAL 1
+#define HAVE_SSE42_EXTERNAL 1
+#define HAVE_SSSE3_EXTERNAL 1
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 1
+#define HAVE_AMD3DNOWEXT_INLINE 1
+#define HAVE_AVX_INLINE 1
+#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
+#define HAVE_FMA4_INLINE 1
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 1
+#define HAVE_SSE_INLINE 1
+#define HAVE_SSE2_INLINE 1
+#define HAVE_SSE3_INLINE 1
+#define HAVE_SSE4_INLINE 1
+#define HAVE_SSE42_INLINE 1
+#define HAVE_SSSE3_INLINE 1
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 1
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 0
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 0
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 0
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 0
+#define CONFIG_MPEGAUDIODSP 0
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 0
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 0
+#define CONFIG_MP3_DEMUXER 0
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 0
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 0
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..5805969f1b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75760-g382b031"
+#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
new file mode 100644
index 00000000000..f8ae2200ea3
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-16/arch-mips --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/bin/mipsel-linux-android- --target-os=linux --extra-cflags=-mhard-float --arch=mips --extra-cflags=-mips32 --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 1
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 0
+#define ARCH_X86_32 0
+#define ARCH_X86_64 0
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 0
+#define HAVE_AMD3DNOWEXT 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_FMA3 0
+#define HAVE_FMA4 0
+#define HAVE_MMX 0
+#define HAVE_MMXEXT 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSE4 0
+#define HAVE_SSE42 0
+#define HAVE_SSSE3 0
+#define HAVE_XOP 0
+#define HAVE_CPUNOP 0
+#define HAVE_I686 0
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 1
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
+#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 0
+#define HAVE_AMD3DNOWEXT_EXTERNAL 0
+#define HAVE_AVX_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_FMA3_EXTERNAL 0
+#define HAVE_FMA4_EXTERNAL 0
+#define HAVE_MMX_EXTERNAL 0
+#define HAVE_MMXEXT_EXTERNAL 0
+#define HAVE_SSE_EXTERNAL 0
+#define HAVE_SSE2_EXTERNAL 0
+#define HAVE_SSE3_EXTERNAL 0
+#define HAVE_SSE4_EXTERNAL 0
+#define HAVE_SSE42_EXTERNAL 0
+#define HAVE_SSSE3_EXTERNAL 0
+#define HAVE_XOP_EXTERNAL 0
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 0
+#define HAVE_AMD3DNOWEXT_INLINE 0
+#define HAVE_AVX_INLINE 0
+#define HAVE_AVX2_INLINE 0
+#define HAVE_FMA3_INLINE 0
+#define HAVE_FMA4_INLINE 0
+#define HAVE_MMX_INLINE 0
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_SSE_INLINE 0
+#define HAVE_SSE2_INLINE 0
+#define HAVE_SSE3_INLINE 0
+#define HAVE_SSE4_INLINE 0
+#define HAVE_SSE42_INLINE 0
+#define HAVE_SSSE3_INLINE 0
+#define HAVE_XOP_INLINE 0
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 0
+#define HAVE_FAST_64BIT 0
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 0
+#define HAVE_LOCAL_ALIGNED_8 0
+#define HAVE_LOCAL_ALIGNED_16 0
+#define HAVE_LOCAL_ALIGNED_32 0
+#define HAVE_SIMD_ALIGN_16 0
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 0
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 0
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 0
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 0
+#define HAVE_LOG2F 0
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 0
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 0
+#define HAVE_EBX_AVAILABLE 0
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 0
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 0
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 0
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 0
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 0
+#define CONFIG_MPEGAUDIODSP 0
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 0
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 0
+#define CONFIG_MP3_DEMUXER 0
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 0
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 0
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/avconfig.h
new file mode 100644
index 00000000000..123b3b28aef
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 0
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..629579cf063
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75763-g1651ce3"
+#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
new file mode 100644
index 00000000000..03df2855ddd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm
@@ -0,0 +1,1981 @@
+%define ARCH_AARCH64 0
+%define ARCH_ALPHA 0
+%define ARCH_ARM 0
+%define ARCH_AVR32 0
+%define ARCH_AVR32_AP 0
+%define ARCH_AVR32_UC 0
+%define ARCH_BFIN 0
+%define ARCH_IA64 0
+%define ARCH_M68K 0
+%define ARCH_MIPS 0
+%define ARCH_MIPS64 0
+%define ARCH_PARISC 0
+%define ARCH_PPC 0
+%define ARCH_PPC64 0
+%define ARCH_S390 0
+%define ARCH_SH4 0
+%define ARCH_SPARC 0
+%define ARCH_SPARC64 0
+%define ARCH_TILEGX 0
+%define ARCH_TILEPRO 0
+%define ARCH_TOMI 0
+%define ARCH_X86 1
+%define ARCH_X86_32 0
+%define ARCH_X86_64 1
+%define HAVE_ARMV5TE 0
+%define HAVE_ARMV6 0
+%define HAVE_ARMV6T2 0
+%define HAVE_ARMV8 0
+%define HAVE_NEON 0
+%define HAVE_VFP 0
+%define HAVE_VFPV3 0
+%define HAVE_SETEND 0
+%define HAVE_ALTIVEC 0
+%define HAVE_DCBZL 0
+%define HAVE_LDBRX 0
+%define HAVE_POWER8 0
+%define HAVE_PPC4XX 0
+%define HAVE_VSX 0
+%define HAVE_AMD3DNOW 1
+%define HAVE_AMD3DNOWEXT 1
+%define HAVE_AVX 1
+%define HAVE_AVX2 1
+%define HAVE_FMA3 1
+%define HAVE_FMA4 1
+%define HAVE_MMX 1
+%define HAVE_MMXEXT 1
+%define HAVE_SSE 1
+%define HAVE_SSE2 1
+%define HAVE_SSE3 1
+%define HAVE_SSE4 1
+%define HAVE_SSE42 1
+%define HAVE_SSSE3 1
+%define HAVE_XOP 1
+%define HAVE_CPUNOP 1
+%define HAVE_I686 1
+%define HAVE_MIPSFPU 0
+%define HAVE_MIPS32R2 0
+%define HAVE_MIPS32R5 0
+%define HAVE_MIPS64R6 0
+%define HAVE_MIPSDSPR1 0
+%define HAVE_MIPSDSPR2 0
+%define HAVE_MSA 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
+%define HAVE_ARMV5TE_EXTERNAL 0
+%define HAVE_ARMV6_EXTERNAL 0
+%define HAVE_ARMV6T2_EXTERNAL 0
+%define HAVE_ARMV8_EXTERNAL 0
+%define HAVE_NEON_EXTERNAL 0
+%define HAVE_VFP_EXTERNAL 0
+%define HAVE_VFPV3_EXTERNAL 0
+%define HAVE_SETEND_EXTERNAL 0
+%define HAVE_ALTIVEC_EXTERNAL 0
+%define HAVE_DCBZL_EXTERNAL 0
+%define HAVE_LDBRX_EXTERNAL 0
+%define HAVE_POWER8_EXTERNAL 0
+%define HAVE_PPC4XX_EXTERNAL 0
+%define HAVE_VSX_EXTERNAL 0
+%define HAVE_AMD3DNOW_EXTERNAL 1
+%define HAVE_AMD3DNOWEXT_EXTERNAL 1
+%define HAVE_AVX_EXTERNAL 1
+%define HAVE_AVX2_EXTERNAL 1
+%define HAVE_FMA3_EXTERNAL 1
+%define HAVE_FMA4_EXTERNAL 1
+%define HAVE_MMX_EXTERNAL 1
+%define HAVE_MMXEXT_EXTERNAL 1
+%define HAVE_SSE_EXTERNAL 1
+%define HAVE_SSE2_EXTERNAL 1
+%define HAVE_SSE3_EXTERNAL 1
+%define HAVE_SSE4_EXTERNAL 1
+%define HAVE_SSE42_EXTERNAL 1
+%define HAVE_SSSE3_EXTERNAL 1
+%define HAVE_XOP_EXTERNAL 1
+%define HAVE_CPUNOP_EXTERNAL 0
+%define HAVE_I686_EXTERNAL 0
+%define HAVE_MIPSFPU_EXTERNAL 0
+%define HAVE_MIPS32R2_EXTERNAL 0
+%define HAVE_MIPS32R5_EXTERNAL 0
+%define HAVE_MIPS64R6_EXTERNAL 0
+%define HAVE_MIPSDSPR1_EXTERNAL 0
+%define HAVE_MIPSDSPR2_EXTERNAL 0
+%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
+%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
+%define HAVE_ARMV5TE_INLINE 0
+%define HAVE_ARMV6_INLINE 0
+%define HAVE_ARMV6T2_INLINE 0
+%define HAVE_ARMV8_INLINE 0
+%define HAVE_NEON_INLINE 0
+%define HAVE_VFP_INLINE 0
+%define HAVE_VFPV3_INLINE 0
+%define HAVE_SETEND_INLINE 0
+%define HAVE_ALTIVEC_INLINE 0
+%define HAVE_DCBZL_INLINE 0
+%define HAVE_LDBRX_INLINE 0
+%define HAVE_POWER8_INLINE 0
+%define HAVE_PPC4XX_INLINE 0
+%define HAVE_VSX_INLINE 0
+%define HAVE_AMD3DNOW_INLINE 1
+%define HAVE_AMD3DNOWEXT_INLINE 1
+%define HAVE_AVX_INLINE 1
+%define HAVE_AVX2_INLINE 1
+%define HAVE_FMA3_INLINE 1
+%define HAVE_FMA4_INLINE 1
+%define HAVE_MMX_INLINE 1
+%define HAVE_MMXEXT_INLINE 1
+%define HAVE_SSE_INLINE 1
+%define HAVE_SSE2_INLINE 1
+%define HAVE_SSE3_INLINE 1
+%define HAVE_SSE4_INLINE 1
+%define HAVE_SSE42_INLINE 1
+%define HAVE_SSSE3_INLINE 1
+%define HAVE_XOP_INLINE 1
+%define HAVE_CPUNOP_INLINE 0
+%define HAVE_I686_INLINE 0
+%define HAVE_MIPSFPU_INLINE 0
+%define HAVE_MIPS32R2_INLINE 0
+%define HAVE_MIPS32R5_INLINE 0
+%define HAVE_MIPS64R6_INLINE 0
+%define HAVE_MIPSDSPR1_INLINE 0
+%define HAVE_MIPSDSPR2_INLINE 0
+%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
+%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
+%define HAVE_ALIGNED_STACK 1
+%define HAVE_FAST_64BIT 1
+%define HAVE_FAST_CLZ 1
+%define HAVE_FAST_CMOV 1
+%define HAVE_LOCAL_ALIGNED_8 1
+%define HAVE_LOCAL_ALIGNED_16 1
+%define HAVE_LOCAL_ALIGNED_32 1
+%define HAVE_SIMD_ALIGN_16 1
+%define HAVE_ATOMICS_GCC 1
+%define HAVE_ATOMICS_SUNCC 0
+%define HAVE_ATOMICS_WIN32 0
+%define HAVE_ATOMIC_CAS_PTR 0
+%define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+%define HAVE_MACHINE_RW_BARRIER 0
+%define HAVE_MEMORYBARRIER 0
+%define HAVE_MM_EMPTY 1
+%define HAVE_RDTSC 0
+%define HAVE_SARESTART 1
+%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+%define HAVE_INLINE_ASM 1
+%define HAVE_SYMVER 0
+%define HAVE_YASM 1
+%define HAVE_BIGENDIAN 0
+%define HAVE_FAST_UNALIGNED 1
+%define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+%define HAVE_ALSA_ASOUNDLIB_H 0
+%define HAVE_ALTIVEC_H 0
+%define HAVE_ARPA_INET_H 0
+%define HAVE_ASM_TYPES_H 1
+%define HAVE_CDIO_PARANOIA_H 0
+%define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+%define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+%define HAVE_DEV_IC_BT8XX_H 0
+%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
+%define HAVE_DLFCN_H 1
+%define HAVE_D3D11_H 0
+%define HAVE_DXVA_H 0
+%define HAVE_ES2_GL_H 0
+%define HAVE_GSM_H 0
+%define HAVE_IO_H 0
+%define HAVE_MACH_MACH_TIME_H 0
+%define HAVE_MACHINE_IOCTL_BT848_H 0
+%define HAVE_MACHINE_IOCTL_METEOR_H 0
+%define HAVE_MALLOC_H 1
+%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+%define HAVE_OPENGL_GL3_H 0
+%define HAVE_POLL_H 1
+%define HAVE_SNDIO_H 0
+%define HAVE_SOUNDCARD_H 0
+%define HAVE_SYS_MMAN_H 1
+%define HAVE_SYS_PARAM_H 1
+%define HAVE_SYS_RESOURCE_H 1
+%define HAVE_SYS_SELECT_H 1
+%define HAVE_SYS_SOUNDCARD_H 0
+%define HAVE_SYS_TIME_H 1
+%define HAVE_SYS_UN_H 1
+%define HAVE_SYS_VIDEOIO_H 0
+%define HAVE_TERMIOS_H 1
+%define HAVE_UDPLITE_H 0
+%define HAVE_UNISTD_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
+%define HAVE_WINDOWS_H 0
+%define HAVE_WINSOCK2_H 0
+%define HAVE_INTRINSICS_NEON 0
+%define HAVE_ATANF 1
+%define HAVE_ATAN2F 1
+%define HAVE_CBRT 1
+%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
+%define HAVE_COSF 1
+%define HAVE_ERF 1
+%define HAVE_EXP2 1
+%define HAVE_EXP2F 1
+%define HAVE_EXPF 1
+%define HAVE_ISINF 1
+%define HAVE_ISNAN 1
+%define HAVE_LDEXPF 1
+%define HAVE_LLRINT 1
+%define HAVE_LLRINTF 1
+%define HAVE_LOG2 1
+%define HAVE_LOG2F 1
+%define HAVE_LOG10F 1
+%define HAVE_LRINT 1
+%define HAVE_LRINTF 1
+%define HAVE_POWF 1
+%define HAVE_RINT 1
+%define HAVE_ROUND 1
+%define HAVE_ROUNDF 1
+%define HAVE_SINF 1
+%define HAVE_TRUNC 1
+%define HAVE_TRUNCF 1
+%define HAVE_ACCESS 1
+%define HAVE_ALIGNED_MALLOC 0
+%define HAVE_CLOCK_GETTIME 1
+%define HAVE_CLOSESOCKET 0
+%define HAVE_COMMANDLINETOARGVW 0
+%define HAVE_COTASKMEMFREE 0
+%define HAVE_CRYPTGENRANDOM 0
+%define HAVE_DLOPEN 1
+%define HAVE_FCNTL 1
+%define HAVE_FLT_LIM 1
+%define HAVE_FORK 1
+%define HAVE_GETADDRINFO 0
+%define HAVE_GETHRTIME 0
+%define HAVE_GETOPT 1
+%define HAVE_GETPROCESSAFFINITYMASK 0
+%define HAVE_GETPROCESSMEMORYINFO 0
+%define HAVE_GETPROCESSTIMES 0
+%define HAVE_GETRUSAGE 1
+%define HAVE_GETSERVBYPORT 0
+%define HAVE_GETSYSTEMTIMEASFILETIME 0
+%define HAVE_GETTIMEOFDAY 1
+%define HAVE_GLOB 0
+%define HAVE_GLXGETPROCADDRESS 0
+%define HAVE_GMTIME_R 1
+%define HAVE_INET_ATON 0
+%define HAVE_ISATTY 1
+%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+%define HAVE_KBHIT 0
+%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
+%define HAVE_LZO1X_999_COMPRESS 0
+%define HAVE_MACH_ABSOLUTE_TIME 0
+%define HAVE_MAPVIEWOFFILE 0
+%define HAVE_MEMALIGN 1
+%define HAVE_MKSTEMP 1
+%define HAVE_MMAP 1
+%define HAVE_MPROTECT 1
+%define HAVE_NANOSLEEP 1
+%define HAVE_PEEKNAMEDPIPE 0
+%define HAVE_POSIX_MEMALIGN 1
+%define HAVE_PTHREAD_CANCEL 0
+%define HAVE_SCHED_GETAFFINITY 1
+%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
+%define HAVE_SETMODE 0
+%define HAVE_SETRLIMIT 1
+%define HAVE_SLEEP 0
+%define HAVE_STRERROR_R 1
+%define HAVE_SYSCONF 1
+%define HAVE_SYSCTL 0
+%define HAVE_USLEEP 1
+%define HAVE_VIRTUALALLOC 0
+%define HAVE_WGLGETPROCADDRESS 0
+%define HAVE_PTHREADS 1
+%define HAVE_OS2THREADS 0
+%define HAVE_W32THREADS 0
+%define HAVE_AS_DN_DIRECTIVE 0
+%define HAVE_AS_FUNC 0
+%define HAVE_AS_OBJECT_ARCH 0
+%define HAVE_ASM_MOD_Q 0
+%define HAVE_ATTRIBUTE_MAY_ALIAS 1
+%define HAVE_ATTRIBUTE_PACKED 1
+%define HAVE_EBP_AVAILABLE 1
+%define HAVE_EBX_AVAILABLE 1
+%define HAVE_GNU_AS 0
+%define HAVE_GNU_WINDRES 0
+%define HAVE_IBM_ASM 0
+%define HAVE_INLINE_ASM_LABELS 1
+%define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+%define HAVE_PRAGMA_DEPRECATED 1
+%define HAVE_RSYNC_CONTIMEOUT 1
+%define HAVE_SYMVER_ASM_LABEL 0
+%define HAVE_SYMVER_GNU_ASM 1
+%define HAVE_VFP_ARGS 0
+%define HAVE_XFORM_ASM 0
+%define HAVE_XMM_CLOBBERS 1
+%define HAVE_CONDITION_VARIABLE_PTR 0
+%define HAVE_SOCKLEN_T 0
+%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+%define HAVE_STRUCT_IP_MREQ_SOURCE 0
+%define HAVE_STRUCT_IPV6_MREQ 0
+%define HAVE_STRUCT_POLLFD 0
+%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+%define HAVE_STRUCT_SOCKADDR_IN6 0
+%define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+%define HAVE_STRUCT_SOCKADDR_STORAGE 0
+%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+%define HAVE_ATOMICS_NATIVE 1
+%define HAVE_DOS_PATHS 0
+%define HAVE_DXVA2API_COBJ 0
+%define HAVE_DXVA2_LIB 0
+%define HAVE_LIBC_MSVCRT 0
+%define HAVE_LIBDC1394_1 0
+%define HAVE_LIBDC1394_2 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
+%define HAVE_SDL 0
+%define HAVE_SECTION_DATA_REL_RO 1
+%define HAVE_TEXI2HTML 0
+%define HAVE_THREADS 1
+%define HAVE_VAAPI_X11 0
+%define HAVE_VDPAU_X11 0
+%define HAVE_XLIB 0
+%define CONFIG_BSFS 0
+%define CONFIG_DECODERS 1
+%define CONFIG_DEMUXERS 1
+%define CONFIG_ENCODERS 0
+%define CONFIG_FILTERS 0
+%define CONFIG_HWACCELS 0
+%define CONFIG_INDEVS 0
+%define CONFIG_MUXERS 0
+%define CONFIG_OUTDEVS 0
+%define CONFIG_PARSERS 1
+%define CONFIG_PROTOCOLS 0
+%define CONFIG_DOC 0
+%define CONFIG_HTMLPAGES 0
+%define CONFIG_MANPAGES 0
+%define CONFIG_PODPAGES 0
+%define CONFIG_TXTPAGES 0
+%define CONFIG_AVIO_READING_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+%define CONFIG_DECODING_ENCODING_EXAMPLE 1
+%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+%define CONFIG_EXTRACT_MVS_EXAMPLE 1
+%define CONFIG_FILTER_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+%define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+%define CONFIG_METADATA_EXAMPLE 1
+%define CONFIG_MUXING_EXAMPLE 0
+%define CONFIG_QSVDEC_EXAMPLE 0
+%define CONFIG_REMUXING_EXAMPLE 1
+%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+%define CONFIG_SCALING_VIDEO_EXAMPLE 0
+%define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+%define CONFIG_TRANSCODING_EXAMPLE 0
+%define CONFIG_AVISYNTH 0
+%define CONFIG_BZLIB 0
+%define CONFIG_CRYSTALHD 0
+%define CONFIG_DECKLINK 0
+%define CONFIG_FREI0R 0
+%define CONFIG_GNUTLS 0
+%define CONFIG_ICONV 0
+%define CONFIG_LADSPA 0
+%define CONFIG_LIBAACPLUS 0
+%define CONFIG_LIBASS 0
+%define CONFIG_LIBBLURAY 0
+%define CONFIG_LIBBS2B 0
+%define CONFIG_LIBCACA 0
+%define CONFIG_LIBCDIO 0
+%define CONFIG_LIBCELT 0
+%define CONFIG_LIBDC1394 0
+%define CONFIG_LIBDCADEC 0
+%define CONFIG_LIBFAAC 0
+%define CONFIG_LIBFDK_AAC 0
+%define CONFIG_LIBFLITE 0
+%define CONFIG_LIBFONTCONFIG 0
+%define CONFIG_LIBFREETYPE 0
+%define CONFIG_LIBFRIBIDI 0
+%define CONFIG_LIBGME 0
+%define CONFIG_LIBGSM 0
+%define CONFIG_LIBIEC61883 0
+%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
+%define CONFIG_LIBMFX 0
+%define CONFIG_LIBMODPLUG 0
+%define CONFIG_LIBMP3LAME 0
+%define CONFIG_LIBNUT 0
+%define CONFIG_LIBOPENCORE_AMRNB 0
+%define CONFIG_LIBOPENCORE_AMRWB 0
+%define CONFIG_LIBOPENCV 0
+%define CONFIG_LIBOPENH264 0
+%define CONFIG_LIBOPENJPEG 0
+%define CONFIG_LIBOPUS 0
+%define CONFIG_LIBPULSE 0
+%define CONFIG_LIBQUVI 0
+%define CONFIG_LIBRTMP 0
+%define CONFIG_LIBSCHROEDINGER 0
+%define CONFIG_LIBSHINE 0
+%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
+%define CONFIG_LIBSOXR 0
+%define CONFIG_LIBSPEEX 0
+%define CONFIG_LIBSSH 0
+%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
+%define CONFIG_LIBTHEORA 0
+%define CONFIG_LIBTWOLAME 0
+%define CONFIG_LIBUTVIDEO 0
+%define CONFIG_LIBV4L2 0
+%define CONFIG_LIBVIDSTAB 0
+%define CONFIG_LIBVO_AACENC 0
+%define CONFIG_LIBVO_AMRWBENC 0
+%define CONFIG_LIBVORBIS 0
+%define CONFIG_LIBVPX 0
+%define CONFIG_LIBWAVPACK 0
+%define CONFIG_LIBWEBP 0
+%define CONFIG_LIBX264 0
+%define CONFIG_LIBX265 0
+%define CONFIG_LIBXAVS 0
+%define CONFIG_LIBXCB 0
+%define CONFIG_LIBXCB_SHM 0
+%define CONFIG_LIBXCB_SHAPE 0
+%define CONFIG_LIBXCB_XFIXES 0
+%define CONFIG_LIBXVID 0
+%define CONFIG_LIBZMQ 0
+%define CONFIG_LIBZVBI 0
+%define CONFIG_LZMA 0
+%define CONFIG_MMAL 0
+%define CONFIG_NVENC 0
+%define CONFIG_OPENAL 0
+%define CONFIG_OPENCL 0
+%define CONFIG_OPENGL 0
+%define CONFIG_OPENSSL 0
+%define CONFIG_SDL 0
+%define CONFIG_SECURETRANSPORT 0
+%define CONFIG_X11GRAB 0
+%define CONFIG_XLIB 0
+%define CONFIG_ZLIB 0
+%define CONFIG_FTRAPV 0
+%define CONFIG_GRAY 0
+%define CONFIG_HARDCODED_TABLES 0
+%define CONFIG_RUNTIME_CPUDETECT 1
+%define CONFIG_SAFE_BITSTREAM_READER 1
+%define CONFIG_SHARED 0
+%define CONFIG_SMALL 1
+%define CONFIG_STATIC 1
+%define CONFIG_SWSCALE_ALPHA 1
+%define CONFIG_D3D11VA 0
+%define CONFIG_DXVA2 0
+%define CONFIG_VAAPI 0
+%define CONFIG_VDA 0
+%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
+%define CONFIG_XVMC 0
+%define CONFIG_GPL 0
+%define CONFIG_NONFREE 0
+%define CONFIG_VERSION3 0
+%define CONFIG_AVCODEC 1
+%define CONFIG_AVDEVICE 0
+%define CONFIG_AVFILTER 0
+%define CONFIG_AVFORMAT 1
+%define CONFIG_AVRESAMPLE 0
+%define CONFIG_AVUTIL 1
+%define CONFIG_POSTPROC 0
+%define CONFIG_SWRESAMPLE 0
+%define CONFIG_SWSCALE 0
+%define CONFIG_FFPLAY 0
+%define CONFIG_FFPROBE 0
+%define CONFIG_FFSERVER 0
+%define CONFIG_FFMPEG 0
+%define CONFIG_DCT 0
+%define CONFIG_DWT 0
+%define CONFIG_ERROR_RESILIENCE 0
+%define CONFIG_FAAN 1
+%define CONFIG_FAST_UNALIGNED 1
+%define CONFIG_FFT 1
+%define CONFIG_LSP 0
+%define CONFIG_LZO 0
+%define CONFIG_MDCT 1
+%define CONFIG_PIXELUTILS 0
+%define CONFIG_NETWORK 0
+%define CONFIG_RDFT 1
+%define CONFIG_FONTCONFIG 0
+%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+%define CONFIG_MEMALIGN_HACK 0
+%define CONFIG_MEMORY_POISONING 0
+%define CONFIG_NEON_CLOBBER_TEST 0
+%define CONFIG_PIC 1
+%define CONFIG_POD2MAN 1
+%define CONFIG_RAISE_MAJOR 0
+%define CONFIG_THUMB 0
+%define CONFIG_VALGRIND_BACKTRACE 0
+%define CONFIG_XMM_CLOBBER_TEST 0
+%define CONFIG_AANDCTTABLES 0
+%define CONFIG_AC3DSP 0
+%define CONFIG_AUDIO_FRAME_QUEUE 0
+%define CONFIG_AUDIODSP 0
+%define CONFIG_BLOCKDSP 0
+%define CONFIG_BSWAPDSP 0
+%define CONFIG_CABAC 0
+%define CONFIG_DVPROFILE 0
+%define CONFIG_EXIF 0
+%define CONFIG_FAANDCT 0
+%define CONFIG_FAANIDCT 0
+%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
+%define CONFIG_FMTCONVERT 0
+%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
+%define CONFIG_GCRYPT 0
+%define CONFIG_GMP 0
+%define CONFIG_GOLOMB 1
+%define CONFIG_GPLV3 0
+%define CONFIG_H263DSP 0
+%define CONFIG_H264CHROMA 0
+%define CONFIG_H264DSP 0
+%define CONFIG_H264PRED 0
+%define CONFIG_H264QPEL 0
+%define CONFIG_HPELDSP 0
+%define CONFIG_HUFFMAN 0
+%define CONFIG_HUFFYUVDSP 0
+%define CONFIG_HUFFYUVENCDSP 0
+%define CONFIG_IDCTDSP 0
+%define CONFIG_IIRFILTER 0
+%define CONFIG_IMDCT15 0
+%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
+%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
+%define CONFIG_LGPLV3 0
+%define CONFIG_LLAUDDSP 0
+%define CONFIG_LLVIDDSP 0
+%define CONFIG_LPC 0
+%define CONFIG_LZF 0
+%define CONFIG_ME_CMP 0
+%define CONFIG_MPEG_ER 0
+%define CONFIG_MPEGAUDIO 0
+%define CONFIG_MPEGAUDIODSP 0
+%define CONFIG_MPEGVIDEO 0
+%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
+%define CONFIG_PIXBLOCKDSP 0
+%define CONFIG_QPELDSP 0
+%define CONFIG_QSV 0
+%define CONFIG_QSVDEC 0
+%define CONFIG_QSVENC 0
+%define CONFIG_RANGECODER 0
+%define CONFIG_RIFFDEC 1
+%define CONFIG_RIFFENC 0
+%define CONFIG_RTPDEC 0
+%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
+%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
+%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
+%define CONFIG_TPELDSP 0
+%define CONFIG_VIDEODSP 0
+%define CONFIG_VP3DSP 0
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 0
+%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
+%define CONFIG_AAC_ADTSTOASC_BSF 0
+%define CONFIG_CHOMP_BSF 0
+%define CONFIG_DUMP_EXTRADATA_BSF 0
+%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+%define CONFIG_IMX_DUMP_HEADER_BSF 0
+%define CONFIG_MJPEG2JPEG_BSF 0
+%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+%define CONFIG_MOV2TEXTSUB_BSF 0
+%define CONFIG_NOISE_BSF 0
+%define CONFIG_REMOVE_EXTRADATA_BSF 0
+%define CONFIG_TEXT2MOVSUB_BSF 0
+%define CONFIG_AASC_DECODER 0
+%define CONFIG_AIC_DECODER 0
+%define CONFIG_ALIAS_PIX_DECODER 0
+%define CONFIG_AMV_DECODER 0
+%define CONFIG_ANM_DECODER 0
+%define CONFIG_ANSI_DECODER 0
+%define CONFIG_APNG_DECODER 0
+%define CONFIG_ASV1_DECODER 0
+%define CONFIG_ASV2_DECODER 0
+%define CONFIG_AURA_DECODER 0
+%define CONFIG_AURA2_DECODER 0
+%define CONFIG_AVRP_DECODER 0
+%define CONFIG_AVRN_DECODER 0
+%define CONFIG_AVS_DECODER 0
+%define CONFIG_AVUI_DECODER 0
+%define CONFIG_AYUV_DECODER 0
+%define CONFIG_BETHSOFTVID_DECODER 0
+%define CONFIG_BFI_DECODER 0
+%define CONFIG_BINK_DECODER 0
+%define CONFIG_BMP_DECODER 0
+%define CONFIG_BMV_VIDEO_DECODER 0
+%define CONFIG_BRENDER_PIX_DECODER 0
+%define CONFIG_C93_DECODER 0
+%define CONFIG_CAVS_DECODER 0
+%define CONFIG_CDGRAPHICS_DECODER 0
+%define CONFIG_CDXL_DECODER 0
+%define CONFIG_CINEPAK_DECODER 0
+%define CONFIG_CLJR_DECODER 0
+%define CONFIG_CLLC_DECODER 0
+%define CONFIG_COMFORTNOISE_DECODER 0
+%define CONFIG_CPIA_DECODER 0
+%define CONFIG_CSCD_DECODER 0
+%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
+%define CONFIG_DFA_DECODER 0
+%define CONFIG_DIRAC_DECODER 0
+%define CONFIG_DNXHD_DECODER 0
+%define CONFIG_DPX_DECODER 0
+%define CONFIG_DSICINVIDEO_DECODER 0
+%define CONFIG_DVVIDEO_DECODER 0
+%define CONFIG_DXA_DECODER 0
+%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
+%define CONFIG_EACMV_DECODER 0
+%define CONFIG_EAMAD_DECODER 0
+%define CONFIG_EATGQ_DECODER 0
+%define CONFIG_EATGV_DECODER 0
+%define CONFIG_EATQI_DECODER 0
+%define CONFIG_EIGHTBPS_DECODER 0
+%define CONFIG_EIGHTSVX_EXP_DECODER 0
+%define CONFIG_EIGHTSVX_FIB_DECODER 0
+%define CONFIG_ESCAPE124_DECODER 0
+%define CONFIG_ESCAPE130_DECODER 0
+%define CONFIG_EXR_DECODER 0
+%define CONFIG_FFV1_DECODER 0
+%define CONFIG_FFVHUFF_DECODER 0
+%define CONFIG_FIC_DECODER 0
+%define CONFIG_FLASHSV_DECODER 0
+%define CONFIG_FLASHSV2_DECODER 0
+%define CONFIG_FLIC_DECODER 0
+%define CONFIG_FLV_DECODER 0
+%define CONFIG_FOURXM_DECODER 0
+%define CONFIG_FRAPS_DECODER 0
+%define CONFIG_FRWU_DECODER 0
+%define CONFIG_G2M_DECODER 0
+%define CONFIG_GIF_DECODER 0
+%define CONFIG_H261_DECODER 0
+%define CONFIG_H263_DECODER 0
+%define CONFIG_H263I_DECODER 0
+%define CONFIG_H263P_DECODER 0
+%define CONFIG_H264_DECODER 0
+%define CONFIG_H264_CRYSTALHD_DECODER 0
+%define CONFIG_H264_MMAL_DECODER 0
+%define CONFIG_H264_QSV_DECODER 0
+%define CONFIG_H264_VDA_DECODER 0
+%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
+%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
+%define CONFIG_HNM4_VIDEO_DECODER 0
+%define CONFIG_HQ_HQA_DECODER 0
+%define CONFIG_HQX_DECODER 0
+%define CONFIG_HUFFYUV_DECODER 0
+%define CONFIG_IDCIN_DECODER 0
+%define CONFIG_IFF_BYTERUN1_DECODER 0
+%define CONFIG_IFF_ILBM_DECODER 0
+%define CONFIG_INDEO2_DECODER 0
+%define CONFIG_INDEO3_DECODER 0
+%define CONFIG_INDEO4_DECODER 0
+%define CONFIG_INDEO5_DECODER 0
+%define CONFIG_INTERPLAY_VIDEO_DECODER 0
+%define CONFIG_JPEG2000_DECODER 0
+%define CONFIG_JPEGLS_DECODER 0
+%define CONFIG_JV_DECODER 0
+%define CONFIG_KGV1_DECODER 0
+%define CONFIG_KMVC_DECODER 0
+%define CONFIG_LAGARITH_DECODER 0
+%define CONFIG_LOCO_DECODER 0
+%define CONFIG_MDEC_DECODER 0
+%define CONFIG_MIMIC_DECODER 0
+%define CONFIG_MJPEG_DECODER 0
+%define CONFIG_MJPEGB_DECODER 0
+%define CONFIG_MMVIDEO_DECODER 0
+%define CONFIG_MOTIONPIXELS_DECODER 0
+%define CONFIG_MPEG_XVMC_DECODER 0
+%define CONFIG_MPEG1VIDEO_DECODER 0
+%define CONFIG_MPEG2VIDEO_DECODER 0
+%define CONFIG_MPEG4_DECODER 0
+%define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG4_VDPAU_DECODER 0
+%define CONFIG_MPEGVIDEO_DECODER 0
+%define CONFIG_MPEG_VDPAU_DECODER 0
+%define CONFIG_MPEG1_VDPAU_DECODER 0
+%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
+%define CONFIG_MSA1_DECODER 0
+%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+%define CONFIG_MSMPEG4V1_DECODER 0
+%define CONFIG_MSMPEG4V2_DECODER 0
+%define CONFIG_MSMPEG4V3_DECODER 0
+%define CONFIG_MSRLE_DECODER 0
+%define CONFIG_MSS1_DECODER 0
+%define CONFIG_MSS2_DECODER 0
+%define CONFIG_MSVIDEO1_DECODER 0
+%define CONFIG_MSZH_DECODER 0
+%define CONFIG_MTS2_DECODER 0
+%define CONFIG_MVC1_DECODER 0
+%define CONFIG_MVC2_DECODER 0
+%define CONFIG_MXPEG_DECODER 0
+%define CONFIG_NUV_DECODER 0
+%define CONFIG_PAF_VIDEO_DECODER 0
+%define CONFIG_PAM_DECODER 0
+%define CONFIG_PBM_DECODER 0
+%define CONFIG_PCX_DECODER 0
+%define CONFIG_PGM_DECODER 0
+%define CONFIG_PGMYUV_DECODER 0
+%define CONFIG_PICTOR_DECODER 0
+%define CONFIG_PNG_DECODER 0
+%define CONFIG_PPM_DECODER 0
+%define CONFIG_PRORES_DECODER 0
+%define CONFIG_PRORES_LGPL_DECODER 0
+%define CONFIG_PTX_DECODER 0
+%define CONFIG_QDRAW_DECODER 0
+%define CONFIG_QPEG_DECODER 0
+%define CONFIG_QTRLE_DECODER 0
+%define CONFIG_R10K_DECODER 0
+%define CONFIG_R210_DECODER 0
+%define CONFIG_RAWVIDEO_DECODER 0
+%define CONFIG_RL2_DECODER 0
+%define CONFIG_ROQ_DECODER 0
+%define CONFIG_RPZA_DECODER 0
+%define CONFIG_RV10_DECODER 0
+%define CONFIG_RV20_DECODER 0
+%define CONFIG_RV30_DECODER 0
+%define CONFIG_RV40_DECODER 0
+%define CONFIG_S302M_DECODER 0
+%define CONFIG_SANM_DECODER 0
+%define CONFIG_SGI_DECODER 0
+%define CONFIG_SGIRLE_DECODER 0
+%define CONFIG_SMACKER_DECODER 0
+%define CONFIG_SMC_DECODER 0
+%define CONFIG_SMVJPEG_DECODER 0
+%define CONFIG_SNOW_DECODER 0
+%define CONFIG_SP5X_DECODER 0
+%define CONFIG_SUNRAST_DECODER 0
+%define CONFIG_SVQ1_DECODER 0
+%define CONFIG_SVQ3_DECODER 0
+%define CONFIG_TARGA_DECODER 0
+%define CONFIG_TARGA_Y216_DECODER 0
+%define CONFIG_TDSC_DECODER 0
+%define CONFIG_THEORA_DECODER 0
+%define CONFIG_THP_DECODER 0
+%define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+%define CONFIG_TIFF_DECODER 0
+%define CONFIG_TMV_DECODER 0
+%define CONFIG_TRUEMOTION1_DECODER 0
+%define CONFIG_TRUEMOTION2_DECODER 0
+%define CONFIG_TSCC_DECODER 0
+%define CONFIG_TSCC2_DECODER 0
+%define CONFIG_TXD_DECODER 0
+%define CONFIG_ULTI_DECODER 0
+%define CONFIG_UTVIDEO_DECODER 0
+%define CONFIG_V210_DECODER 0
+%define CONFIG_V210X_DECODER 0
+%define CONFIG_V308_DECODER 0
+%define CONFIG_V408_DECODER 0
+%define CONFIG_V410_DECODER 0
+%define CONFIG_VB_DECODER 0
+%define CONFIG_VBLE_DECODER 0
+%define CONFIG_VC1_DECODER 0
+%define CONFIG_VC1_CRYSTALHD_DECODER 0
+%define CONFIG_VC1_VDPAU_DECODER 0
+%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
+%define CONFIG_VCR1_DECODER 0
+%define CONFIG_VMDVIDEO_DECODER 0
+%define CONFIG_VMNC_DECODER 0
+%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP5_DECODER 0
+%define CONFIG_VP6_DECODER 0
+%define CONFIG_VP6A_DECODER 0
+%define CONFIG_VP6F_DECODER 0
+%define CONFIG_VP7_DECODER 0
+%define CONFIG_VP8_DECODER 0
+%define CONFIG_VP9_DECODER 0
+%define CONFIG_VQA_DECODER 0
+%define CONFIG_WEBP_DECODER 0
+%define CONFIG_WMV1_DECODER 0
+%define CONFIG_WMV2_DECODER 0
+%define CONFIG_WMV3_DECODER 0
+%define CONFIG_WMV3_CRYSTALHD_DECODER 0
+%define CONFIG_WMV3_VDPAU_DECODER 0
+%define CONFIG_WMV3IMAGE_DECODER 0
+%define CONFIG_WNV1_DECODER 0
+%define CONFIG_XAN_WC3_DECODER 0
+%define CONFIG_XAN_WC4_DECODER 0
+%define CONFIG_XBM_DECODER 0
+%define CONFIG_XFACE_DECODER 0
+%define CONFIG_XL_DECODER 0
+%define CONFIG_XWD_DECODER 0
+%define CONFIG_Y41P_DECODER 0
+%define CONFIG_YOP_DECODER 0
+%define CONFIG_YUV4_DECODER 0
+%define CONFIG_ZERO12V_DECODER 0
+%define CONFIG_ZEROCODEC_DECODER 0
+%define CONFIG_ZLIB_DECODER 0
+%define CONFIG_ZMBV_DECODER 0
+%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
+%define CONFIG_AAC_LATM_DECODER 0
+%define CONFIG_AC3_DECODER 0
+%define CONFIG_AC3_FIXED_DECODER 0
+%define CONFIG_ALAC_DECODER 0
+%define CONFIG_ALS_DECODER 0
+%define CONFIG_AMRNB_DECODER 0
+%define CONFIG_AMRWB_DECODER 0
+%define CONFIG_APE_DECODER 0
+%define CONFIG_ATRAC1_DECODER 0
+%define CONFIG_ATRAC3_DECODER 0
+%define CONFIG_ATRAC3P_DECODER 0
+%define CONFIG_BINKAUDIO_DCT_DECODER 0
+%define CONFIG_BINKAUDIO_RDFT_DECODER 0
+%define CONFIG_BMV_AUDIO_DECODER 0
+%define CONFIG_COOK_DECODER 0
+%define CONFIG_DCA_DECODER 0
+%define CONFIG_DSD_LSBF_DECODER 0
+%define CONFIG_DSD_MSBF_DECODER 0
+%define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+%define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+%define CONFIG_DSICINAUDIO_DECODER 0
+%define CONFIG_DSS_SP_DECODER 0
+%define CONFIG_EAC3_DECODER 0
+%define CONFIG_EVRC_DECODER 0
+%define CONFIG_FFWAVESYNTH_DECODER 0
+%define CONFIG_FLAC_DECODER 0
+%define CONFIG_G723_1_DECODER 0
+%define CONFIG_G729_DECODER 0
+%define CONFIG_GSM_DECODER 0
+%define CONFIG_GSM_MS_DECODER 0
+%define CONFIG_IAC_DECODER 0
+%define CONFIG_IMC_DECODER 0
+%define CONFIG_MACE3_DECODER 0
+%define CONFIG_MACE6_DECODER 0
+%define CONFIG_METASOUND_DECODER 0
+%define CONFIG_MLP_DECODER 0
+%define CONFIG_MP1_DECODER 0
+%define CONFIG_MP1FLOAT_DECODER 0
+%define CONFIG_MP2_DECODER 0
+%define CONFIG_MP2FLOAT_DECODER 0
+%define CONFIG_MP3_DECODER 0
+%define CONFIG_MP3FLOAT_DECODER 0
+%define CONFIG_MP3ADU_DECODER 0
+%define CONFIG_MP3ADUFLOAT_DECODER 0
+%define CONFIG_MP3ON4_DECODER 0
+%define CONFIG_MP3ON4FLOAT_DECODER 0
+%define CONFIG_MPC7_DECODER 0
+%define CONFIG_MPC8_DECODER 0
+%define CONFIG_NELLYMOSER_DECODER 0
+%define CONFIG_ON2AVC_DECODER 0
+%define CONFIG_OPUS_DECODER 0
+%define CONFIG_PAF_AUDIO_DECODER 0
+%define CONFIG_QCELP_DECODER 0
+%define CONFIG_QDM2_DECODER 0
+%define CONFIG_RA_144_DECODER 0
+%define CONFIG_RA_288_DECODER 0
+%define CONFIG_RALF_DECODER 0
+%define CONFIG_SHORTEN_DECODER 0
+%define CONFIG_SIPR_DECODER 0
+%define CONFIG_SMACKAUD_DECODER 0
+%define CONFIG_SONIC_DECODER 0
+%define CONFIG_TAK_DECODER 0
+%define CONFIG_TRUEHD_DECODER 0
+%define CONFIG_TRUESPEECH_DECODER 0
+%define CONFIG_TTA_DECODER 0
+%define CONFIG_TWINVQ_DECODER 0
+%define CONFIG_VMDAUDIO_DECODER 0
+%define CONFIG_VORBIS_DECODER 1
+%define CONFIG_WAVPACK_DECODER 0
+%define CONFIG_WMALOSSLESS_DECODER 0
+%define CONFIG_WMAPRO_DECODER 0
+%define CONFIG_WMAV1_DECODER 0
+%define CONFIG_WMAV2_DECODER 0
+%define CONFIG_WMAVOICE_DECODER 0
+%define CONFIG_WS_SND1_DECODER 0
+%define CONFIG_PCM_ALAW_DECODER 1
+%define CONFIG_PCM_BLURAY_DECODER 0
+%define CONFIG_PCM_DVD_DECODER 0
+%define CONFIG_PCM_F32BE_DECODER 0
+%define CONFIG_PCM_F32LE_DECODER 1
+%define CONFIG_PCM_F64BE_DECODER 0
+%define CONFIG_PCM_F64LE_DECODER 0
+%define CONFIG_PCM_LXF_DECODER 0
+%define CONFIG_PCM_MULAW_DECODER 1
+%define CONFIG_PCM_S8_DECODER 0
+%define CONFIG_PCM_S8_PLANAR_DECODER 0
+%define CONFIG_PCM_S16BE_DECODER 1
+%define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+%define CONFIG_PCM_S16LE_DECODER 1
+%define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S24BE_DECODER 1
+%define CONFIG_PCM_S24DAUD_DECODER 0
+%define CONFIG_PCM_S24LE_DECODER 1
+%define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+%define CONFIG_PCM_S32BE_DECODER 0
+%define CONFIG_PCM_S32LE_DECODER 0
+%define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+%define CONFIG_PCM_U8_DECODER 1
+%define CONFIG_PCM_U16BE_DECODER 0
+%define CONFIG_PCM_U16LE_DECODER 0
+%define CONFIG_PCM_U24BE_DECODER 0
+%define CONFIG_PCM_U24LE_DECODER 0
+%define CONFIG_PCM_U32BE_DECODER 0
+%define CONFIG_PCM_U32LE_DECODER 0
+%define CONFIG_PCM_ZORK_DECODER 0
+%define CONFIG_INTERPLAY_DPCM_DECODER 0
+%define CONFIG_ROQ_DPCM_DECODER 0
+%define CONFIG_SOL_DPCM_DECODER 0
+%define CONFIG_XAN_DPCM_DECODER 0
+%define CONFIG_ADPCM_4XM_DECODER 0
+%define CONFIG_ADPCM_ADX_DECODER 0
+%define CONFIG_ADPCM_AFC_DECODER 0
+%define CONFIG_ADPCM_CT_DECODER 0
+%define CONFIG_ADPCM_DTK_DECODER 0
+%define CONFIG_ADPCM_EA_DECODER 0
+%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+%define CONFIG_ADPCM_EA_R1_DECODER 0
+%define CONFIG_ADPCM_EA_R2_DECODER 0
+%define CONFIG_ADPCM_EA_R3_DECODER 0
+%define CONFIG_ADPCM_EA_XAS_DECODER 0
+%define CONFIG_ADPCM_G722_DECODER 0
+%define CONFIG_ADPCM_G726_DECODER 0
+%define CONFIG_ADPCM_G726LE_DECODER 0
+%define CONFIG_ADPCM_IMA_AMV_DECODER 0
+%define CONFIG_ADPCM_IMA_APC_DECODER 0
+%define CONFIG_ADPCM_IMA_DK3_DECODER 0
+%define CONFIG_ADPCM_IMA_DK4_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+%define CONFIG_ADPCM_IMA_ISS_DECODER 0
+%define CONFIG_ADPCM_IMA_OKI_DECODER 0
+%define CONFIG_ADPCM_IMA_QT_DECODER 0
+%define CONFIG_ADPCM_IMA_RAD_DECODER 0
+%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+%define CONFIG_ADPCM_IMA_WAV_DECODER 0
+%define CONFIG_ADPCM_IMA_WS_DECODER 0
+%define CONFIG_ADPCM_MS_DECODER 0
+%define CONFIG_ADPCM_SBPRO_2_DECODER 0
+%define CONFIG_ADPCM_SBPRO_3_DECODER 0
+%define CONFIG_ADPCM_SBPRO_4_DECODER 0
+%define CONFIG_ADPCM_SWF_DECODER 0
+%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
+%define CONFIG_ADPCM_VIMA_DECODER 0
+%define CONFIG_ADPCM_XA_DECODER 0
+%define CONFIG_ADPCM_YAMAHA_DECODER 0
+%define CONFIG_SSA_DECODER 0
+%define CONFIG_ASS_DECODER 0
+%define CONFIG_CCAPTION_DECODER 0
+%define CONFIG_DVBSUB_DECODER 0
+%define CONFIG_DVDSUB_DECODER 0
+%define CONFIG_JACOSUB_DECODER 0
+%define CONFIG_MICRODVD_DECODER 0
+%define CONFIG_MOVTEXT_DECODER 0
+%define CONFIG_MPL2_DECODER 0
+%define CONFIG_PGSSUB_DECODER 0
+%define CONFIG_PJS_DECODER 0
+%define CONFIG_REALTEXT_DECODER 0
+%define CONFIG_SAMI_DECODER 0
+%define CONFIG_SRT_DECODER 0
+%define CONFIG_STL_DECODER 0
+%define CONFIG_SUBRIP_DECODER 0
+%define CONFIG_SUBVIEWER_DECODER 0
+%define CONFIG_SUBVIEWER1_DECODER 0
+%define CONFIG_TEXT_DECODER 0
+%define CONFIG_VPLAYER_DECODER 0
+%define CONFIG_WEBVTT_DECODER 0
+%define CONFIG_XSUB_DECODER 0
+%define CONFIG_LIBCELT_DECODER 0
+%define CONFIG_LIBDCADEC_DECODER 0
+%define CONFIG_LIBFDK_AAC_DECODER 0
+%define CONFIG_LIBGSM_DECODER 0
+%define CONFIG_LIBGSM_MS_DECODER 0
+%define CONFIG_LIBILBC_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+%define CONFIG_LIBOPENJPEG_DECODER 0
+%define CONFIG_LIBOPUS_DECODER 0
+%define CONFIG_LIBSCHROEDINGER_DECODER 0
+%define CONFIG_LIBSPEEX_DECODER 0
+%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+%define CONFIG_LIBUTVIDEO_DECODER 0
+%define CONFIG_LIBVORBIS_DECODER 0
+%define CONFIG_LIBVPX_VP8_DECODER 0
+%define CONFIG_LIBVPX_VP9_DECODER 0
+%define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+%define CONFIG_BINTEXT_DECODER 0
+%define CONFIG_XBIN_DECODER 0
+%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
+%define CONFIG_AAC_DEMUXER 0
+%define CONFIG_AC3_DEMUXER 0
+%define CONFIG_ACT_DEMUXER 0
+%define CONFIG_ADF_DEMUXER 0
+%define CONFIG_ADP_DEMUXER 0
+%define CONFIG_ADX_DEMUXER 0
+%define CONFIG_AEA_DEMUXER 0
+%define CONFIG_AFC_DEMUXER 0
+%define CONFIG_AIFF_DEMUXER 0
+%define CONFIG_AMR_DEMUXER 0
+%define CONFIG_ANM_DEMUXER 0
+%define CONFIG_APC_DEMUXER 0
+%define CONFIG_APE_DEMUXER 0
+%define CONFIG_APNG_DEMUXER 0
+%define CONFIG_AQTITLE_DEMUXER 0
+%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
+%define CONFIG_ASS_DEMUXER 0
+%define CONFIG_AST_DEMUXER 0
+%define CONFIG_AU_DEMUXER 0
+%define CONFIG_AVI_DEMUXER 0
+%define CONFIG_AVISYNTH_DEMUXER 0
+%define CONFIG_AVR_DEMUXER 0
+%define CONFIG_AVS_DEMUXER 0
+%define CONFIG_BETHSOFTVID_DEMUXER 0
+%define CONFIG_BFI_DEMUXER 0
+%define CONFIG_BINTEXT_DEMUXER 0
+%define CONFIG_BINK_DEMUXER 0
+%define CONFIG_BIT_DEMUXER 0
+%define CONFIG_BMV_DEMUXER 0
+%define CONFIG_BFSTM_DEMUXER 0
+%define CONFIG_BRSTM_DEMUXER 0
+%define CONFIG_BOA_DEMUXER 0
+%define CONFIG_C93_DEMUXER 0
+%define CONFIG_CAF_DEMUXER 0
+%define CONFIG_CAVSVIDEO_DEMUXER 0
+%define CONFIG_CDG_DEMUXER 0
+%define CONFIG_CDXL_DEMUXER 0
+%define CONFIG_CINE_DEMUXER 0
+%define CONFIG_CONCAT_DEMUXER 0
+%define CONFIG_DATA_DEMUXER 0
+%define CONFIG_DAUD_DEMUXER 0
+%define CONFIG_DFA_DEMUXER 0
+%define CONFIG_DIRAC_DEMUXER 0
+%define CONFIG_DNXHD_DEMUXER 0
+%define CONFIG_DSF_DEMUXER 0
+%define CONFIG_DSICIN_DEMUXER 0
+%define CONFIG_DSS_DEMUXER 0
+%define CONFIG_DTS_DEMUXER 0
+%define CONFIG_DTSHD_DEMUXER 0
+%define CONFIG_DV_DEMUXER 0
+%define CONFIG_DVBSUB_DEMUXER 0
+%define CONFIG_DXA_DEMUXER 0
+%define CONFIG_EA_DEMUXER 0
+%define CONFIG_EA_CDATA_DEMUXER 0
+%define CONFIG_EAC3_DEMUXER 0
+%define CONFIG_EPAF_DEMUXER 0
+%define CONFIG_FFM_DEMUXER 0
+%define CONFIG_FFMETADATA_DEMUXER 0
+%define CONFIG_FILMSTRIP_DEMUXER 0
+%define CONFIG_FLAC_DEMUXER 0
+%define CONFIG_FLIC_DEMUXER 0
+%define CONFIG_FLV_DEMUXER 0
+%define CONFIG_LIVE_FLV_DEMUXER 0
+%define CONFIG_FOURXM_DEMUXER 0
+%define CONFIG_FRM_DEMUXER 0
+%define CONFIG_G722_DEMUXER 0
+%define CONFIG_G723_1_DEMUXER 0
+%define CONFIG_G729_DEMUXER 0
+%define CONFIG_GIF_DEMUXER 0
+%define CONFIG_GSM_DEMUXER 0
+%define CONFIG_GXF_DEMUXER 0
+%define CONFIG_H261_DEMUXER 0
+%define CONFIG_H263_DEMUXER 0
+%define CONFIG_H264_DEMUXER 0
+%define CONFIG_HEVC_DEMUXER 0
+%define CONFIG_HLS_DEMUXER 0
+%define CONFIG_HNM_DEMUXER 0
+%define CONFIG_ICO_DEMUXER 0
+%define CONFIG_IDCIN_DEMUXER 0
+%define CONFIG_IDF_DEMUXER 0
+%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_ILBC_DEMUXER 0
+%define CONFIG_IMAGE2_DEMUXER 0
+%define CONFIG_IMAGE2PIPE_DEMUXER 0
+%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+%define CONFIG_INGENIENT_DEMUXER 0
+%define CONFIG_IPMOVIE_DEMUXER 0
+%define CONFIG_IRCAM_DEMUXER 0
+%define CONFIG_ISS_DEMUXER 0
+%define CONFIG_IV8_DEMUXER 0
+%define CONFIG_IVF_DEMUXER 0
+%define CONFIG_JACOSUB_DEMUXER 0
+%define CONFIG_JV_DEMUXER 0
+%define CONFIG_LATM_DEMUXER 0
+%define CONFIG_LMLM4_DEMUXER 0
+%define CONFIG_LOAS_DEMUXER 0
+%define CONFIG_LRC_DEMUXER 0
+%define CONFIG_LVF_DEMUXER 0
+%define CONFIG_LXF_DEMUXER 0
+%define CONFIG_M4V_DEMUXER 0
+%define CONFIG_MATROSKA_DEMUXER 1
+%define CONFIG_MGSTS_DEMUXER 0
+%define CONFIG_MICRODVD_DEMUXER 0
+%define CONFIG_MJPEG_DEMUXER 0
+%define CONFIG_MLP_DEMUXER 0
+%define CONFIG_MLV_DEMUXER 0
+%define CONFIG_MM_DEMUXER 0
+%define CONFIG_MMF_DEMUXER 0
+%define CONFIG_MOV_DEMUXER 0
+%define CONFIG_MP3_DEMUXER 0
+%define CONFIG_MPC_DEMUXER 0
+%define CONFIG_MPC8_DEMUXER 0
+%define CONFIG_MPEGPS_DEMUXER 0
+%define CONFIG_MPEGTS_DEMUXER 0
+%define CONFIG_MPEGTSRAW_DEMUXER 0
+%define CONFIG_MPEGVIDEO_DEMUXER 0
+%define CONFIG_MPJPEG_DEMUXER 0
+%define CONFIG_MPL2_DEMUXER 0
+%define CONFIG_MPSUB_DEMUXER 0
+%define CONFIG_MSNWC_TCP_DEMUXER 0
+%define CONFIG_MTV_DEMUXER 0
+%define CONFIG_MV_DEMUXER 0
+%define CONFIG_MVI_DEMUXER 0
+%define CONFIG_MXF_DEMUXER 0
+%define CONFIG_MXG_DEMUXER 0
+%define CONFIG_NC_DEMUXER 0
+%define CONFIG_NISTSPHERE_DEMUXER 0
+%define CONFIG_NSV_DEMUXER 0
+%define CONFIG_NUT_DEMUXER 0
+%define CONFIG_NUV_DEMUXER 0
+%define CONFIG_OGG_DEMUXER 1
+%define CONFIG_OMA_DEMUXER 0
+%define CONFIG_PAF_DEMUXER 0
+%define CONFIG_PCM_ALAW_DEMUXER 0
+%define CONFIG_PCM_MULAW_DEMUXER 0
+%define CONFIG_PCM_F64BE_DEMUXER 0
+%define CONFIG_PCM_F64LE_DEMUXER 0
+%define CONFIG_PCM_F32BE_DEMUXER 0
+%define CONFIG_PCM_F32LE_DEMUXER 0
+%define CONFIG_PCM_S32BE_DEMUXER 0
+%define CONFIG_PCM_S32LE_DEMUXER 0
+%define CONFIG_PCM_S24BE_DEMUXER 0
+%define CONFIG_PCM_S24LE_DEMUXER 0
+%define CONFIG_PCM_S16BE_DEMUXER 0
+%define CONFIG_PCM_S16LE_DEMUXER 0
+%define CONFIG_PCM_S8_DEMUXER 0
+%define CONFIG_PCM_U32BE_DEMUXER 0
+%define CONFIG_PCM_U32LE_DEMUXER 0
+%define CONFIG_PCM_U24BE_DEMUXER 0
+%define CONFIG_PCM_U24LE_DEMUXER 0
+%define CONFIG_PCM_U16BE_DEMUXER 0
+%define CONFIG_PCM_U16LE_DEMUXER 0
+%define CONFIG_PCM_U8_DEMUXER 0
+%define CONFIG_PJS_DEMUXER 0
+%define CONFIG_PMP_DEMUXER 0
+%define CONFIG_PVA_DEMUXER 0
+%define CONFIG_PVF_DEMUXER 0
+%define CONFIG_QCP_DEMUXER 0
+%define CONFIG_R3D_DEMUXER 0
+%define CONFIG_RAWVIDEO_DEMUXER 0
+%define CONFIG_REALTEXT_DEMUXER 0
+%define CONFIG_REDSPARK_DEMUXER 0
+%define CONFIG_RL2_DEMUXER 0
+%define CONFIG_RM_DEMUXER 0
+%define CONFIG_ROQ_DEMUXER 0
+%define CONFIG_RPL_DEMUXER 0
+%define CONFIG_RSD_DEMUXER 0
+%define CONFIG_RSO_DEMUXER 0
+%define CONFIG_RTP_DEMUXER 0
+%define CONFIG_RTSP_DEMUXER 0
+%define CONFIG_SAMI_DEMUXER 0
+%define CONFIG_SAP_DEMUXER 0
+%define CONFIG_SBG_DEMUXER 0
+%define CONFIG_SDP_DEMUXER 0
+%define CONFIG_SDR2_DEMUXER 0
+%define CONFIG_SEGAFILM_DEMUXER 0
+%define CONFIG_SHORTEN_DEMUXER 0
+%define CONFIG_SIFF_DEMUXER 0
+%define CONFIG_SLN_DEMUXER 0
+%define CONFIG_SMACKER_DEMUXER 0
+%define CONFIG_SMJPEG_DEMUXER 0
+%define CONFIG_SMUSH_DEMUXER 0
+%define CONFIG_SOL_DEMUXER 0
+%define CONFIG_SOX_DEMUXER 0
+%define CONFIG_SPDIF_DEMUXER 0
+%define CONFIG_SRT_DEMUXER 0
+%define CONFIG_STR_DEMUXER 0
+%define CONFIG_STL_DEMUXER 0
+%define CONFIG_SUBVIEWER1_DEMUXER 0
+%define CONFIG_SUBVIEWER_DEMUXER 0
+%define CONFIG_SUP_DEMUXER 0
+%define CONFIG_SWF_DEMUXER 0
+%define CONFIG_TAK_DEMUXER 0
+%define CONFIG_TEDCAPTIONS_DEMUXER 0
+%define CONFIG_THP_DEMUXER 0
+%define CONFIG_TIERTEXSEQ_DEMUXER 0
+%define CONFIG_TMV_DEMUXER 0
+%define CONFIG_TRUEHD_DEMUXER 0
+%define CONFIG_TTA_DEMUXER 0
+%define CONFIG_TXD_DEMUXER 0
+%define CONFIG_TTY_DEMUXER 0
+%define CONFIG_VC1_DEMUXER 0
+%define CONFIG_VC1T_DEMUXER 0
+%define CONFIG_VIVO_DEMUXER 0
+%define CONFIG_VMD_DEMUXER 0
+%define CONFIG_VOBSUB_DEMUXER 0
+%define CONFIG_VOC_DEMUXER 0
+%define CONFIG_VPLAYER_DEMUXER 0
+%define CONFIG_VQF_DEMUXER 0
+%define CONFIG_W64_DEMUXER 0
+%define CONFIG_WAV_DEMUXER 1
+%define CONFIG_WC3_DEMUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+%define CONFIG_WEBVTT_DEMUXER 0
+%define CONFIG_WSAUD_DEMUXER 0
+%define CONFIG_WSVQA_DEMUXER 0
+%define CONFIG_WTV_DEMUXER 0
+%define CONFIG_WV_DEMUXER 0
+%define CONFIG_XA_DEMUXER 0
+%define CONFIG_XBIN_DEMUXER 0
+%define CONFIG_XMV_DEMUXER 0
+%define CONFIG_XWMA_DEMUXER 0
+%define CONFIG_YOP_DEMUXER 0
+%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+%define CONFIG_LIBGME_DEMUXER 0
+%define CONFIG_LIBMODPLUG_DEMUXER 0
+%define CONFIG_LIBNUT_DEMUXER 0
+%define CONFIG_LIBQUVI_DEMUXER 0
+%define CONFIG_A64MULTI_ENCODER 0
+%define CONFIG_A64MULTI5_ENCODER 0
+%define CONFIG_ALIAS_PIX_ENCODER 0
+%define CONFIG_AMV_ENCODER 0
+%define CONFIG_APNG_ENCODER 0
+%define CONFIG_ASV1_ENCODER 0
+%define CONFIG_ASV2_ENCODER 0
+%define CONFIG_AVRP_ENCODER 0
+%define CONFIG_AVUI_ENCODER 0
+%define CONFIG_AYUV_ENCODER 0
+%define CONFIG_BMP_ENCODER 0
+%define CONFIG_CINEPAK_ENCODER 0
+%define CONFIG_CLJR_ENCODER 0
+%define CONFIG_COMFORTNOISE_ENCODER 0
+%define CONFIG_DNXHD_ENCODER 0
+%define CONFIG_DPX_ENCODER 0
+%define CONFIG_DVVIDEO_ENCODER 0
+%define CONFIG_FFV1_ENCODER 0
+%define CONFIG_FFVHUFF_ENCODER 0
+%define CONFIG_FLASHSV_ENCODER 0
+%define CONFIG_FLASHSV2_ENCODER 0
+%define CONFIG_FLV_ENCODER 0
+%define CONFIG_GIF_ENCODER 0
+%define CONFIG_H261_ENCODER 0
+%define CONFIG_H263_ENCODER 0
+%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
+%define CONFIG_HUFFYUV_ENCODER 0
+%define CONFIG_JPEG2000_ENCODER 0
+%define CONFIG_JPEGLS_ENCODER 0
+%define CONFIG_LJPEG_ENCODER 0
+%define CONFIG_MJPEG_ENCODER 0
+%define CONFIG_MPEG1VIDEO_ENCODER 0
+%define CONFIG_MPEG2VIDEO_ENCODER 0
+%define CONFIG_MPEG4_ENCODER 0
+%define CONFIG_MSMPEG4V2_ENCODER 0
+%define CONFIG_MSMPEG4V3_ENCODER 0
+%define CONFIG_MSVIDEO1_ENCODER 0
+%define CONFIG_PAM_ENCODER 0
+%define CONFIG_PBM_ENCODER 0
+%define CONFIG_PCX_ENCODER 0
+%define CONFIG_PGM_ENCODER 0
+%define CONFIG_PGMYUV_ENCODER 0
+%define CONFIG_PNG_ENCODER 0
+%define CONFIG_PPM_ENCODER 0
+%define CONFIG_PRORES_ENCODER 0
+%define CONFIG_PRORES_AW_ENCODER 0
+%define CONFIG_PRORES_KS_ENCODER 0
+%define CONFIG_QTRLE_ENCODER 0
+%define CONFIG_R10K_ENCODER 0
+%define CONFIG_R210_ENCODER 0
+%define CONFIG_RAWVIDEO_ENCODER 0
+%define CONFIG_ROQ_ENCODER 0
+%define CONFIG_RV10_ENCODER 0
+%define CONFIG_RV20_ENCODER 0
+%define CONFIG_S302M_ENCODER 0
+%define CONFIG_SGI_ENCODER 0
+%define CONFIG_SNOW_ENCODER 0
+%define CONFIG_SUNRAST_ENCODER 0
+%define CONFIG_SVQ1_ENCODER 0
+%define CONFIG_TARGA_ENCODER 0
+%define CONFIG_TIFF_ENCODER 0
+%define CONFIG_UTVIDEO_ENCODER 0
+%define CONFIG_V210_ENCODER 0
+%define CONFIG_V308_ENCODER 0
+%define CONFIG_V408_ENCODER 0
+%define CONFIG_V410_ENCODER 0
+%define CONFIG_WMV1_ENCODER 0
+%define CONFIG_WMV2_ENCODER 0
+%define CONFIG_XBM_ENCODER 0
+%define CONFIG_XFACE_ENCODER 0
+%define CONFIG_XWD_ENCODER 0
+%define CONFIG_Y41P_ENCODER 0
+%define CONFIG_YUV4_ENCODER 0
+%define CONFIG_ZLIB_ENCODER 0
+%define CONFIG_ZMBV_ENCODER 0
+%define CONFIG_AAC_ENCODER 0
+%define CONFIG_AC3_ENCODER 0
+%define CONFIG_AC3_FIXED_ENCODER 0
+%define CONFIG_ALAC_ENCODER 0
+%define CONFIG_DCA_ENCODER 0
+%define CONFIG_EAC3_ENCODER 0
+%define CONFIG_FLAC_ENCODER 0
+%define CONFIG_G723_1_ENCODER 0
+%define CONFIG_MP2_ENCODER 0
+%define CONFIG_MP2FIXED_ENCODER 0
+%define CONFIG_NELLYMOSER_ENCODER 0
+%define CONFIG_RA_144_ENCODER 0
+%define CONFIG_SONIC_ENCODER 0
+%define CONFIG_SONIC_LS_ENCODER 0
+%define CONFIG_TTA_ENCODER 0
+%define CONFIG_VORBIS_ENCODER 0
+%define CONFIG_WAVPACK_ENCODER 0
+%define CONFIG_WMAV1_ENCODER 0
+%define CONFIG_WMAV2_ENCODER 0
+%define CONFIG_PCM_ALAW_ENCODER 0
+%define CONFIG_PCM_F32BE_ENCODER 0
+%define CONFIG_PCM_F32LE_ENCODER 0
+%define CONFIG_PCM_F64BE_ENCODER 0
+%define CONFIG_PCM_F64LE_ENCODER 0
+%define CONFIG_PCM_MULAW_ENCODER 0
+%define CONFIG_PCM_S8_ENCODER 0
+%define CONFIG_PCM_S8_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16BE_ENCODER 0
+%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S16LE_ENCODER 0
+%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S24BE_ENCODER 0
+%define CONFIG_PCM_S24DAUD_ENCODER 0
+%define CONFIG_PCM_S24LE_ENCODER 0
+%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_S32BE_ENCODER 0
+%define CONFIG_PCM_S32LE_ENCODER 0
+%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+%define CONFIG_PCM_U8_ENCODER 0
+%define CONFIG_PCM_U16BE_ENCODER 0
+%define CONFIG_PCM_U16LE_ENCODER 0
+%define CONFIG_PCM_U24BE_ENCODER 0
+%define CONFIG_PCM_U24LE_ENCODER 0
+%define CONFIG_PCM_U32BE_ENCODER 0
+%define CONFIG_PCM_U32LE_ENCODER 0
+%define CONFIG_ROQ_DPCM_ENCODER 0
+%define CONFIG_ADPCM_ADX_ENCODER 0
+%define CONFIG_ADPCM_G722_ENCODER 0
+%define CONFIG_ADPCM_G726_ENCODER 0
+%define CONFIG_ADPCM_IMA_QT_ENCODER 0
+%define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+%define CONFIG_ADPCM_MS_ENCODER 0
+%define CONFIG_ADPCM_SWF_ENCODER 0
+%define CONFIG_ADPCM_YAMAHA_ENCODER 0
+%define CONFIG_SSA_ENCODER 0
+%define CONFIG_ASS_ENCODER 0
+%define CONFIG_DVBSUB_ENCODER 0
+%define CONFIG_DVDSUB_ENCODER 0
+%define CONFIG_MOVTEXT_ENCODER 0
+%define CONFIG_SRT_ENCODER 0
+%define CONFIG_SUBRIP_ENCODER 0
+%define CONFIG_WEBVTT_ENCODER 0
+%define CONFIG_XSUB_ENCODER 0
+%define CONFIG_LIBFAAC_ENCODER 0
+%define CONFIG_LIBFDK_AAC_ENCODER 0
+%define CONFIG_LIBGSM_ENCODER 0
+%define CONFIG_LIBGSM_MS_ENCODER 0
+%define CONFIG_LIBILBC_ENCODER 0
+%define CONFIG_LIBMP3LAME_ENCODER 0
+%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+%define CONFIG_LIBOPENJPEG_ENCODER 0
+%define CONFIG_LIBOPUS_ENCODER 0
+%define CONFIG_LIBSCHROEDINGER_ENCODER 0
+%define CONFIG_LIBSHINE_ENCODER 0
+%define CONFIG_LIBSPEEX_ENCODER 0
+%define CONFIG_LIBTHEORA_ENCODER 0
+%define CONFIG_LIBTWOLAME_ENCODER 0
+%define CONFIG_LIBUTVIDEO_ENCODER 0
+%define CONFIG_LIBVO_AACENC_ENCODER 0
+%define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+%define CONFIG_LIBVORBIS_ENCODER 0
+%define CONFIG_LIBVPX_VP8_ENCODER 0
+%define CONFIG_LIBVPX_VP9_ENCODER 0
+%define CONFIG_LIBWAVPACK_ENCODER 0
+%define CONFIG_LIBWEBP_ANIM_ENCODER 0
+%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
+%define CONFIG_LIBX264_ENCODER 0
+%define CONFIG_LIBX264RGB_ENCODER 0
+%define CONFIG_LIBX265_ENCODER 0
+%define CONFIG_LIBXAVS_ENCODER 0
+%define CONFIG_LIBXVID_ENCODER 0
+%define CONFIG_LIBAACPLUS_ENCODER 0
+%define CONFIG_LIBOPENH264_ENCODER 0
+%define CONFIG_H264_QSV_ENCODER 0
+%define CONFIG_NVENC_ENCODER 0
+%define CONFIG_NVENC_H264_ENCODER 0
+%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
+%define CONFIG_ADELAY_FILTER 0
+%define CONFIG_AECHO_FILTER 0
+%define CONFIG_AEVAL_FILTER 0
+%define CONFIG_AFADE_FILTER 0
+%define CONFIG_AFORMAT_FILTER 0
+%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
+%define CONFIG_ALLPASS_FILTER 0
+%define CONFIG_AMERGE_FILTER 0
+%define CONFIG_AMIX_FILTER 0
+%define CONFIG_ANULL_FILTER 0
+%define CONFIG_APAD_FILTER 0
+%define CONFIG_APERMS_FILTER 0
+%define CONFIG_APHASER_FILTER 0
+%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
+%define CONFIG_ASELECT_FILTER 0
+%define CONFIG_ASENDCMD_FILTER 0
+%define CONFIG_ASETNSAMPLES_FILTER 0
+%define CONFIG_ASETPTS_FILTER 0
+%define CONFIG_ASETRATE_FILTER 0
+%define CONFIG_ASETTB_FILTER 0
+%define CONFIG_ASHOWINFO_FILTER 0
+%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASTATS_FILTER 0
+%define CONFIG_ASTREAMSYNC_FILTER 0
+%define CONFIG_ASYNCTS_FILTER 0
+%define CONFIG_ATEMPO_FILTER 0
+%define CONFIG_ATRIM_FILTER 0
+%define CONFIG_AZMQ_FILTER 0
+%define CONFIG_BANDPASS_FILTER 0
+%define CONFIG_BANDREJECT_FILTER 0
+%define CONFIG_BASS_FILTER 0
+%define CONFIG_BIQUAD_FILTER 0
+%define CONFIG_BS2B_FILTER 0
+%define CONFIG_CHANNELMAP_FILTER 0
+%define CONFIG_CHANNELSPLIT_FILTER 0
+%define CONFIG_CHORUS_FILTER 0
+%define CONFIG_COMPAND_FILTER 0
+%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
+%define CONFIG_EARWAX_FILTER 0
+%define CONFIG_EBUR128_FILTER 0
+%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
+%define CONFIG_FLANGER_FILTER 0
+%define CONFIG_HIGHPASS_FILTER 0
+%define CONFIG_JOIN_FILTER 0
+%define CONFIG_LADSPA_FILTER 0
+%define CONFIG_LOWPASS_FILTER 0
+%define CONFIG_PAN_FILTER 0
+%define CONFIG_REPLAYGAIN_FILTER 0
+%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+%define CONFIG_SILENCEDETECT_FILTER 0
+%define CONFIG_SILENCEREMOVE_FILTER 0
+%define CONFIG_TREBLE_FILTER 0
+%define CONFIG_VOLUME_FILTER 0
+%define CONFIG_VOLUMEDETECT_FILTER 0
+%define CONFIG_AEVALSRC_FILTER 0
+%define CONFIG_ANULLSRC_FILTER 0
+%define CONFIG_FLITE_FILTER 0
+%define CONFIG_SINE_FILTER 0
+%define CONFIG_ANULLSINK_FILTER 0
+%define CONFIG_ALPHAEXTRACT_FILTER 0
+%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
+%define CONFIG_ASS_FILTER 0
+%define CONFIG_BBOX_FILTER 0
+%define CONFIG_BLACKDETECT_FILTER 0
+%define CONFIG_BLACKFRAME_FILTER 0
+%define CONFIG_BLEND_FILTER 0
+%define CONFIG_BOXBLUR_FILTER 0
+%define CONFIG_CODECVIEW_FILTER 0
+%define CONFIG_COLORBALANCE_FILTER 0
+%define CONFIG_COLORCHANNELMIXER_FILTER 0
+%define CONFIG_COLORKEY_FILTER 0
+%define CONFIG_COLORLEVELS_FILTER 0
+%define CONFIG_COLORMATRIX_FILTER 0
+%define CONFIG_COPY_FILTER 0
+%define CONFIG_COVER_RECT_FILTER 0
+%define CONFIG_CROP_FILTER 0
+%define CONFIG_CROPDETECT_FILTER 0
+%define CONFIG_CURVES_FILTER 0
+%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
+%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
+%define CONFIG_DEJUDDER_FILTER 0
+%define CONFIG_DELOGO_FILTER 0
+%define CONFIG_DESHAKE_FILTER 0
+%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
+%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
+%define CONFIG_DRAWGRID_FILTER 0
+%define CONFIG_DRAWTEXT_FILTER 0
+%define CONFIG_EDGEDETECT_FILTER 0
+%define CONFIG_ELBG_FILTER 0
+%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
+%define CONFIG_EXTRACTPLANES_FILTER 0
+%define CONFIG_FADE_FILTER 0
+%define CONFIG_FFTFILT_FILTER 0
+%define CONFIG_FIELD_FILTER 0
+%define CONFIG_FIELDMATCH_FILTER 0
+%define CONFIG_FIELDORDER_FILTER 0
+%define CONFIG_FIND_RECT_FILTER 0
+%define CONFIG_FORMAT_FILTER 0
+%define CONFIG_FPS_FILTER 0
+%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
+%define CONFIG_FRAMESTEP_FILTER 0
+%define CONFIG_FREI0R_FILTER 0
+%define CONFIG_FSPP_FILTER 0
+%define CONFIG_GEQ_FILTER 0
+%define CONFIG_GRADFUN_FILTER 0
+%define CONFIG_HALDCLUT_FILTER 0
+%define CONFIG_HFLIP_FILTER 0
+%define CONFIG_HISTEQ_FILTER 0
+%define CONFIG_HISTOGRAM_FILTER 0
+%define CONFIG_HQDN3D_FILTER 0
+%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
+%define CONFIG_HUE_FILTER 0
+%define CONFIG_IDET_FILTER 0
+%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
+%define CONFIG_INTERLACE_FILTER 0
+%define CONFIG_INTERLEAVE_FILTER 0
+%define CONFIG_KERNDEINT_FILTER 0
+%define CONFIG_LENSCORRECTION_FILTER 0
+%define CONFIG_LUT3D_FILTER 0
+%define CONFIG_LUT_FILTER 0
+%define CONFIG_LUTRGB_FILTER 0
+%define CONFIG_LUTYUV_FILTER 0
+%define CONFIG_MCDEINT_FILTER 0
+%define CONFIG_MERGEPLANES_FILTER 0
+%define CONFIG_MPDECIMATE_FILTER 0
+%define CONFIG_NEGATE_FILTER 0
+%define CONFIG_NOFORMAT_FILTER 0
+%define CONFIG_NOISE_FILTER 0
+%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
+%define CONFIG_OCV_FILTER 0
+%define CONFIG_OVERLAY_FILTER 0
+%define CONFIG_OWDENOISE_FILTER 0
+%define CONFIG_PAD_FILTER 0
+%define CONFIG_PALETTEGEN_FILTER 0
+%define CONFIG_PALETTEUSE_FILTER 0
+%define CONFIG_PERMS_FILTER 0
+%define CONFIG_PERSPECTIVE_FILTER 0
+%define CONFIG_PHASE_FILTER 0
+%define CONFIG_PIXDESCTEST_FILTER 0
+%define CONFIG_PP_FILTER 0
+%define CONFIG_PP7_FILTER 0
+%define CONFIG_PSNR_FILTER 0
+%define CONFIG_PULLUP_FILTER 0
+%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
+%define CONFIG_REMOVELOGO_FILTER 0
+%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
+%define CONFIG_ROTATE_FILTER 0
+%define CONFIG_SAB_FILTER 0
+%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
+%define CONFIG_SELECT_FILTER 0
+%define CONFIG_SENDCMD_FILTER 0
+%define CONFIG_SEPARATEFIELDS_FILTER 0
+%define CONFIG_SETDAR_FILTER 0
+%define CONFIG_SETFIELD_FILTER 0
+%define CONFIG_SETPTS_FILTER 0
+%define CONFIG_SETSAR_FILTER 0
+%define CONFIG_SETTB_FILTER 0
+%define CONFIG_SHOWINFO_FILTER 0
+%define CONFIG_SHOWPALETTE_FILTER 0
+%define CONFIG_SHUFFLEPLANES_FILTER 0
+%define CONFIG_SIGNALSTATS_FILTER 0
+%define CONFIG_SMARTBLUR_FILTER 0
+%define CONFIG_SPLIT_FILTER 0
+%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
+%define CONFIG_STEREO3D_FILTER 0
+%define CONFIG_SUBTITLES_FILTER 0
+%define CONFIG_SUPER2XSAI_FILTER 0
+%define CONFIG_SWAPUV_FILTER 0
+%define CONFIG_TBLEND_FILTER 0
+%define CONFIG_TELECINE_FILTER 0
+%define CONFIG_THUMBNAIL_FILTER 0
+%define CONFIG_TILE_FILTER 0
+%define CONFIG_TINTERLACE_FILTER 0
+%define CONFIG_TRANSPOSE_FILTER 0
+%define CONFIG_TRIM_FILTER 0
+%define CONFIG_UNSHARP_FILTER 0
+%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
+%define CONFIG_VFLIP_FILTER 0
+%define CONFIG_VIDSTABDETECT_FILTER 0
+%define CONFIG_VIDSTABTRANSFORM_FILTER 0
+%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
+%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
+%define CONFIG_XBR_FILTER 0
+%define CONFIG_YADIF_FILTER 0
+%define CONFIG_ZMQ_FILTER 0
+%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
+%define CONFIG_CELLAUTO_FILTER 0
+%define CONFIG_COLOR_FILTER 0
+%define CONFIG_FREI0R_SRC_FILTER 0
+%define CONFIG_HALDCLUTSRC_FILTER 0
+%define CONFIG_LIFE_FILTER 0
+%define CONFIG_MANDELBROT_FILTER 0
+%define CONFIG_MPTESTSRC_FILTER 0
+%define CONFIG_NULLSRC_FILTER 0
+%define CONFIG_RGBTESTSRC_FILTER 0
+%define CONFIG_SMPTEBARS_FILTER 0
+%define CONFIG_SMPTEHDBARS_FILTER 0
+%define CONFIG_TESTSRC_FILTER 0
+%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
+%define CONFIG_AVECTORSCOPE_FILTER 0
+%define CONFIG_CONCAT_FILTER 0
+%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
+%define CONFIG_SHOWWAVES_FILTER 0
+%define CONFIG_SHOWWAVESPIC_FILTER 0
+%define CONFIG_AMOVIE_FILTER 0
+%define CONFIG_MOVIE_FILTER 0
+%define CONFIG_H263_VAAPI_HWACCEL 0
+%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_H264_D3D11VA_HWACCEL 0
+%define CONFIG_H264_DXVA2_HWACCEL 0
+%define CONFIG_H264_MMAL_HWACCEL 0
+%define CONFIG_H264_QSV_HWACCEL 0
+%define CONFIG_H264_VAAPI_HWACCEL 0
+%define CONFIG_H264_VDA_HWACCEL 0
+%define CONFIG_H264_VDA_OLD_HWACCEL 0
+%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_HEVC_D3D11VA_HWACCEL 0
+%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_XVMC_HWACCEL 0
+%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG2_XVMC_HWACCEL 0
+%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
+%define CONFIG_MPEG2_VAAPI_HWACCEL 0
+%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_MPEG4_VAAPI_HWACCEL 0
+%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+%define CONFIG_VC1_D3D11VA_HWACCEL 0
+%define CONFIG_VC1_DXVA2_HWACCEL 0
+%define CONFIG_VC1_VAAPI_HWACCEL 0
+%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
+%define CONFIG_WMV3_D3D11VA_HWACCEL 0
+%define CONFIG_WMV3_DXVA2_HWACCEL 0
+%define CONFIG_WMV3_VAAPI_HWACCEL 0
+%define CONFIG_WMV3_VDPAU_HWACCEL 0
+%define CONFIG_ALSA_INDEV 0
+%define CONFIG_AVFOUNDATION_INDEV 0
+%define CONFIG_BKTR_INDEV 0
+%define CONFIG_DECKLINK_INDEV 0
+%define CONFIG_DSHOW_INDEV 0
+%define CONFIG_DV1394_INDEV 0
+%define CONFIG_FBDEV_INDEV 0
+%define CONFIG_GDIGRAB_INDEV 0
+%define CONFIG_IEC61883_INDEV 0
+%define CONFIG_JACK_INDEV 0
+%define CONFIG_LAVFI_INDEV 0
+%define CONFIG_OPENAL_INDEV 0
+%define CONFIG_OSS_INDEV 0
+%define CONFIG_PULSE_INDEV 0
+%define CONFIG_QTKIT_INDEV 0
+%define CONFIG_SNDIO_INDEV 0
+%define CONFIG_V4L2_INDEV 0
+%define CONFIG_VFWCAP_INDEV 0
+%define CONFIG_X11GRAB_INDEV 0
+%define CONFIG_X11GRAB_XCB_INDEV 0
+%define CONFIG_LIBCDIO_INDEV 0
+%define CONFIG_LIBDC1394_INDEV 0
+%define CONFIG_A64_MUXER 0
+%define CONFIG_AC3_MUXER 0
+%define CONFIG_ADTS_MUXER 0
+%define CONFIG_ADX_MUXER 0
+%define CONFIG_AIFF_MUXER 0
+%define CONFIG_AMR_MUXER 0
+%define CONFIG_APNG_MUXER 0
+%define CONFIG_ASF_MUXER 0
+%define CONFIG_ASS_MUXER 0
+%define CONFIG_AST_MUXER 0
+%define CONFIG_ASF_STREAM_MUXER 0
+%define CONFIG_AU_MUXER 0
+%define CONFIG_AVI_MUXER 0
+%define CONFIG_AVM2_MUXER 0
+%define CONFIG_BIT_MUXER 0
+%define CONFIG_CAF_MUXER 0
+%define CONFIG_CAVSVIDEO_MUXER 0
+%define CONFIG_CRC_MUXER 0
+%define CONFIG_DASH_MUXER 0
+%define CONFIG_DATA_MUXER 0
+%define CONFIG_DAUD_MUXER 0
+%define CONFIG_DIRAC_MUXER 0
+%define CONFIG_DNXHD_MUXER 0
+%define CONFIG_DTS_MUXER 0
+%define CONFIG_DV_MUXER 0
+%define CONFIG_EAC3_MUXER 0
+%define CONFIG_F4V_MUXER 0
+%define CONFIG_FFM_MUXER 0
+%define CONFIG_FFMETADATA_MUXER 0
+%define CONFIG_FILMSTRIP_MUXER 0
+%define CONFIG_FLAC_MUXER 0
+%define CONFIG_FLV_MUXER 0
+%define CONFIG_FRAMECRC_MUXER 0
+%define CONFIG_FRAMEMD5_MUXER 0
+%define CONFIG_G722_MUXER 0
+%define CONFIG_G723_1_MUXER 0
+%define CONFIG_GIF_MUXER 0
+%define CONFIG_GXF_MUXER 0
+%define CONFIG_H261_MUXER 0
+%define CONFIG_H263_MUXER 0
+%define CONFIG_H264_MUXER 0
+%define CONFIG_HDS_MUXER 0
+%define CONFIG_HEVC_MUXER 0
+%define CONFIG_HLS_MUXER 0
+%define CONFIG_ICO_MUXER 0
+%define CONFIG_ILBC_MUXER 0
+%define CONFIG_IMAGE2_MUXER 0
+%define CONFIG_IMAGE2PIPE_MUXER 0
+%define CONFIG_IPOD_MUXER 0
+%define CONFIG_IRCAM_MUXER 0
+%define CONFIG_ISMV_MUXER 0
+%define CONFIG_IVF_MUXER 0
+%define CONFIG_JACOSUB_MUXER 0
+%define CONFIG_LATM_MUXER 0
+%define CONFIG_LRC_MUXER 0
+%define CONFIG_M4V_MUXER 0
+%define CONFIG_MD5_MUXER 0
+%define CONFIG_MATROSKA_MUXER 0
+%define CONFIG_MATROSKA_AUDIO_MUXER 0
+%define CONFIG_MICRODVD_MUXER 0
+%define CONFIG_MJPEG_MUXER 0
+%define CONFIG_MLP_MUXER 0
+%define CONFIG_MMF_MUXER 0
+%define CONFIG_MOV_MUXER 0
+%define CONFIG_MP2_MUXER 0
+%define CONFIG_MP3_MUXER 0
+%define CONFIG_MP4_MUXER 0
+%define CONFIG_MPEG1SYSTEM_MUXER 0
+%define CONFIG_MPEG1VCD_MUXER 0
+%define CONFIG_MPEG1VIDEO_MUXER 0
+%define CONFIG_MPEG2DVD_MUXER 0
+%define CONFIG_MPEG2SVCD_MUXER 0
+%define CONFIG_MPEG2VIDEO_MUXER 0
+%define CONFIG_MPEG2VOB_MUXER 0
+%define CONFIG_MPEGTS_MUXER 0
+%define CONFIG_MPJPEG_MUXER 0
+%define CONFIG_MXF_MUXER 0
+%define CONFIG_MXF_D10_MUXER 0
+%define CONFIG_MXF_OPATOM_MUXER 0
+%define CONFIG_NULL_MUXER 0
+%define CONFIG_NUT_MUXER 0
+%define CONFIG_OGA_MUXER 0
+%define CONFIG_OGG_MUXER 0
+%define CONFIG_OMA_MUXER 0
+%define CONFIG_OPUS_MUXER 0
+%define CONFIG_PCM_ALAW_MUXER 0
+%define CONFIG_PCM_MULAW_MUXER 0
+%define CONFIG_PCM_F64BE_MUXER 0
+%define CONFIG_PCM_F64LE_MUXER 0
+%define CONFIG_PCM_F32BE_MUXER 0
+%define CONFIG_PCM_F32LE_MUXER 0
+%define CONFIG_PCM_S32BE_MUXER 0
+%define CONFIG_PCM_S32LE_MUXER 0
+%define CONFIG_PCM_S24BE_MUXER 0
+%define CONFIG_PCM_S24LE_MUXER 0
+%define CONFIG_PCM_S16BE_MUXER 0
+%define CONFIG_PCM_S16LE_MUXER 0
+%define CONFIG_PCM_S8_MUXER 0
+%define CONFIG_PCM_U32BE_MUXER 0
+%define CONFIG_PCM_U32LE_MUXER 0
+%define CONFIG_PCM_U24BE_MUXER 0
+%define CONFIG_PCM_U24LE_MUXER 0
+%define CONFIG_PCM_U16BE_MUXER 0
+%define CONFIG_PCM_U16LE_MUXER 0
+%define CONFIG_PCM_U8_MUXER 0
+%define CONFIG_PSP_MUXER 0
+%define CONFIG_RAWVIDEO_MUXER 0
+%define CONFIG_RM_MUXER 0
+%define CONFIG_ROQ_MUXER 0
+%define CONFIG_RSO_MUXER 0
+%define CONFIG_RTP_MUXER 0
+%define CONFIG_RTP_MPEGTS_MUXER 0
+%define CONFIG_RTSP_MUXER 0
+%define CONFIG_SAP_MUXER 0
+%define CONFIG_SEGMENT_MUXER 0
+%define CONFIG_STREAM_SEGMENT_MUXER 0
+%define CONFIG_SINGLEJPEG_MUXER 0
+%define CONFIG_SMJPEG_MUXER 0
+%define CONFIG_SMOOTHSTREAMING_MUXER 0
+%define CONFIG_SOX_MUXER 0
+%define CONFIG_SPX_MUXER 0
+%define CONFIG_SPDIF_MUXER 0
+%define CONFIG_SRT_MUXER 0
+%define CONFIG_SWF_MUXER 0
+%define CONFIG_TEE_MUXER 0
+%define CONFIG_TG2_MUXER 0
+%define CONFIG_TGP_MUXER 0
+%define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+%define CONFIG_TRUEHD_MUXER 0
+%define CONFIG_UNCODEDFRAMECRC_MUXER 0
+%define CONFIG_VC1_MUXER 0
+%define CONFIG_VC1T_MUXER 0
+%define CONFIG_VOC_MUXER 0
+%define CONFIG_W64_MUXER 0
+%define CONFIG_WAV_MUXER 0
+%define CONFIG_WEBM_MUXER 0
+%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+%define CONFIG_WEBM_CHUNK_MUXER 0
+%define CONFIG_WEBP_MUXER 0
+%define CONFIG_WEBVTT_MUXER 0
+%define CONFIG_WTV_MUXER 0
+%define CONFIG_WV_MUXER 0
+%define CONFIG_YUV4MPEGPIPE_MUXER 0
+%define CONFIG_LIBNUT_MUXER 0
+%define CONFIG_ALSA_OUTDEV 0
+%define CONFIG_CACA_OUTDEV 0
+%define CONFIG_DECKLINK_OUTDEV 0
+%define CONFIG_FBDEV_OUTDEV 0
+%define CONFIG_OPENGL_OUTDEV 0
+%define CONFIG_OSS_OUTDEV 0
+%define CONFIG_PULSE_OUTDEV 0
+%define CONFIG_SDL_OUTDEV 0
+%define CONFIG_SNDIO_OUTDEV 0
+%define CONFIG_V4L2_OUTDEV 0
+%define CONFIG_XV_OUTDEV 0
+%define CONFIG_AAC_PARSER 0
+%define CONFIG_AAC_LATM_PARSER 0
+%define CONFIG_AC3_PARSER 0
+%define CONFIG_ADX_PARSER 0
+%define CONFIG_BMP_PARSER 0
+%define CONFIG_CAVSVIDEO_PARSER 0
+%define CONFIG_COOK_PARSER 0
+%define CONFIG_DCA_PARSER 0
+%define CONFIG_DIRAC_PARSER 0
+%define CONFIG_DNXHD_PARSER 0
+%define CONFIG_DPX_PARSER 0
+%define CONFIG_DVBSUB_PARSER 0
+%define CONFIG_DVDSUB_PARSER 0
+%define CONFIG_DVD_NAV_PARSER 0
+%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
+%define CONFIG_GSM_PARSER 0
+%define CONFIG_H261_PARSER 0
+%define CONFIG_H263_PARSER 0
+%define CONFIG_H264_PARSER 0
+%define CONFIG_HEVC_PARSER 0
+%define CONFIG_MJPEG_PARSER 0
+%define CONFIG_MLP_PARSER 0
+%define CONFIG_MPEG4VIDEO_PARSER 0
+%define CONFIG_MPEGAUDIO_PARSER 0
+%define CONFIG_MPEGVIDEO_PARSER 0
+%define CONFIG_OPUS_PARSER 1
+%define CONFIG_PNG_PARSER 0
+%define CONFIG_PNM_PARSER 0
+%define CONFIG_RV30_PARSER 0
+%define CONFIG_RV40_PARSER 0
+%define CONFIG_TAK_PARSER 0
+%define CONFIG_VC1_PARSER 0
+%define CONFIG_VORBIS_PARSER 1
+%define CONFIG_VP3_PARSER 0
+%define CONFIG_VP8_PARSER 0
+%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
+%define CONFIG_BLURAY_PROTOCOL 0
+%define CONFIG_CACHE_PROTOCOL 0
+%define CONFIG_CONCAT_PROTOCOL 0
+%define CONFIG_CRYPTO_PROTOCOL 0
+%define CONFIG_DATA_PROTOCOL 0
+%define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+%define CONFIG_FFRTMPHTTP_PROTOCOL 0
+%define CONFIG_FILE_PROTOCOL 0
+%define CONFIG_FTP_PROTOCOL 0
+%define CONFIG_GOPHER_PROTOCOL 0
+%define CONFIG_HLS_PROTOCOL 0
+%define CONFIG_HTTP_PROTOCOL 0
+%define CONFIG_HTTPPROXY_PROTOCOL 0
+%define CONFIG_HTTPS_PROTOCOL 0
+%define CONFIG_ICECAST_PROTOCOL 0
+%define CONFIG_MMSH_PROTOCOL 0
+%define CONFIG_MMST_PROTOCOL 0
+%define CONFIG_MD5_PROTOCOL 0
+%define CONFIG_PIPE_PROTOCOL 0
+%define CONFIG_RTMP_PROTOCOL 0
+%define CONFIG_RTMPE_PROTOCOL 0
+%define CONFIG_RTMPS_PROTOCOL 0
+%define CONFIG_RTMPT_PROTOCOL 0
+%define CONFIG_RTMPTE_PROTOCOL 0
+%define CONFIG_RTMPTS_PROTOCOL 0
+%define CONFIG_RTP_PROTOCOL 0
+%define CONFIG_SCTP_PROTOCOL 0
+%define CONFIG_SRTP_PROTOCOL 0
+%define CONFIG_SUBFILE_PROTOCOL 0
+%define CONFIG_TCP_PROTOCOL 0
+%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+%define CONFIG_TLS_GNUTLS_PROTOCOL 0
+%define CONFIG_TLS_OPENSSL_PROTOCOL 0
+%define CONFIG_UDP_PROTOCOL 0
+%define CONFIG_UDPLITE_PROTOCOL 0
+%define CONFIG_UNIX_PROTOCOL 0
+%define CONFIG_LIBRTMP_PROTOCOL 0
+%define CONFIG_LIBRTMPE_PROTOCOL 0
+%define CONFIG_LIBRTMPS_PROTOCOL 0
+%define CONFIG_LIBRTMPT_PROTOCOL 0
+%define CONFIG_LIBRTMPTE_PROTOCOL 0
+%define CONFIG_LIBSSH_PROTOCOL 0
+%define CONFIG_LIBSMBCLIENT_PROTOCOL 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
new file mode 100644
index 00000000000..246ec1e22d3
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h
@@ -0,0 +1,1998 @@
+/* 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-Os\"' --enable-small --enable-cross-compile --sysroot=/d/code/chrome/src/third_party/android_tools/ndk/platforms/android-21/arch-x86_64 --cross-prefix=/d/code/chrome/src/third_party/android_tools/ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android- --target-os=linux --arch=x86_64 --enable-pic"
+#define FFMPEG_LICENSE "LGPL version 2.1 or later"
+#define CONFIG_THIS_YEAR 2015
+#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
+#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
+#define CC_IDENT "gcc 4.9 (GCC) 20140827 (prerelease)"
+#define av_restrict restrict
+#define EXTERN_PREFIX ""
+#define EXTERN_ASM
+#define BUILDSUF ""
+#define SLIBSUF ".so"
+#define HAVE_MMX2 HAVE_MMXEXT
+#define SWS_MAX_FILTER_SIZE 256
+#define ARCH_AARCH64 0
+#define ARCH_ALPHA 0
+#define ARCH_ARM 0
+#define ARCH_AVR32 0
+#define ARCH_AVR32_AP 0
+#define ARCH_AVR32_UC 0
+#define ARCH_BFIN 0
+#define ARCH_IA64 0
+#define ARCH_M68K 0
+#define ARCH_MIPS 0
+#define ARCH_MIPS64 0
+#define ARCH_PARISC 0
+#define ARCH_PPC 0
+#define ARCH_PPC64 0
+#define ARCH_S390 0
+#define ARCH_SH4 0
+#define ARCH_SPARC 0
+#define ARCH_SPARC64 0
+#define ARCH_TILEGX 0
+#define ARCH_TILEPRO 0
+#define ARCH_TOMI 0
+#define ARCH_X86 1
+#define ARCH_X86_32 0
+#define ARCH_X86_64 1
+#define HAVE_ARMV5TE 0
+#define HAVE_ARMV6 0
+#define HAVE_ARMV6T2 0
+#define HAVE_ARMV8 0
+#define HAVE_NEON 0
+#define HAVE_VFP 0
+#define HAVE_VFPV3 0
+#define HAVE_SETEND 0
+#define HAVE_ALTIVEC 0
+#define HAVE_DCBZL 0
+#define HAVE_LDBRX 0
+#define HAVE_POWER8 0
+#define HAVE_PPC4XX 0
+#define HAVE_VSX 0
+#define HAVE_AMD3DNOW 1
+#define HAVE_AMD3DNOWEXT 1
+#define HAVE_AVX 1
+#define HAVE_AVX2 1
+#define HAVE_FMA3 1
+#define HAVE_FMA4 1
+#define HAVE_MMX 1
+#define HAVE_MMXEXT 1
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
+#define HAVE_SSE3 1
+#define HAVE_SSE4 1
+#define HAVE_SSE42 1
+#define HAVE_SSSE3 1
+#define HAVE_XOP 1
+#define HAVE_CPUNOP 1
+#define HAVE_I686 1
+#define HAVE_MIPSFPU 0
+#define HAVE_MIPS32R2 0
+#define HAVE_MIPS32R5 0
+#define HAVE_MIPS64R6 0
+#define HAVE_MIPSDSPR1 0
+#define HAVE_MIPSDSPR2 0
+#define HAVE_MSA 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
+#define HAVE_ARMV5TE_EXTERNAL 0
+#define HAVE_ARMV6_EXTERNAL 0
+#define HAVE_ARMV6T2_EXTERNAL 0
+#define HAVE_ARMV8_EXTERNAL 0
+#define HAVE_NEON_EXTERNAL 0
+#define HAVE_VFP_EXTERNAL 0
+#define HAVE_VFPV3_EXTERNAL 0
+#define HAVE_SETEND_EXTERNAL 0
+#define HAVE_ALTIVEC_EXTERNAL 0
+#define HAVE_DCBZL_EXTERNAL 0
+#define HAVE_LDBRX_EXTERNAL 0
+#define HAVE_POWER8_EXTERNAL 0
+#define HAVE_PPC4XX_EXTERNAL 0
+#define HAVE_VSX_EXTERNAL 0
+#define HAVE_AMD3DNOW_EXTERNAL 1
+#define HAVE_AMD3DNOWEXT_EXTERNAL 1
+#define HAVE_AVX_EXTERNAL 1
+#define HAVE_AVX2_EXTERNAL 1
+#define HAVE_FMA3_EXTERNAL 1
+#define HAVE_FMA4_EXTERNAL 1
+#define HAVE_MMX_EXTERNAL 1
+#define HAVE_MMXEXT_EXTERNAL 1
+#define HAVE_SSE_EXTERNAL 1
+#define HAVE_SSE2_EXTERNAL 1
+#define HAVE_SSE3_EXTERNAL 1
+#define HAVE_SSE4_EXTERNAL 1
+#define HAVE_SSE42_EXTERNAL 1
+#define HAVE_SSSE3_EXTERNAL 1
+#define HAVE_XOP_EXTERNAL 1
+#define HAVE_CPUNOP_EXTERNAL 0
+#define HAVE_I686_EXTERNAL 0
+#define HAVE_MIPSFPU_EXTERNAL 0
+#define HAVE_MIPS32R2_EXTERNAL 0
+#define HAVE_MIPS32R5_EXTERNAL 0
+#define HAVE_MIPS64R6_EXTERNAL 0
+#define HAVE_MIPSDSPR1_EXTERNAL 0
+#define HAVE_MIPSDSPR2_EXTERNAL 0
+#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
+#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
+#define HAVE_ARMV5TE_INLINE 0
+#define HAVE_ARMV6_INLINE 0
+#define HAVE_ARMV6T2_INLINE 0
+#define HAVE_ARMV8_INLINE 0
+#define HAVE_NEON_INLINE 0
+#define HAVE_VFP_INLINE 0
+#define HAVE_VFPV3_INLINE 0
+#define HAVE_SETEND_INLINE 0
+#define HAVE_ALTIVEC_INLINE 0
+#define HAVE_DCBZL_INLINE 0
+#define HAVE_LDBRX_INLINE 0
+#define HAVE_POWER8_INLINE 0
+#define HAVE_PPC4XX_INLINE 0
+#define HAVE_VSX_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 1
+#define HAVE_AMD3DNOWEXT_INLINE 1
+#define HAVE_AVX_INLINE 1
+#define HAVE_AVX2_INLINE 1
+#define HAVE_FMA3_INLINE 1
+#define HAVE_FMA4_INLINE 1
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 1
+#define HAVE_SSE_INLINE 1
+#define HAVE_SSE2_INLINE 1
+#define HAVE_SSE3_INLINE 1
+#define HAVE_SSE4_INLINE 1
+#define HAVE_SSE42_INLINE 1
+#define HAVE_SSSE3_INLINE 1
+#define HAVE_XOP_INLINE 1
+#define HAVE_CPUNOP_INLINE 0
+#define HAVE_I686_INLINE 0
+#define HAVE_MIPSFPU_INLINE 0
+#define HAVE_MIPS32R2_INLINE 0
+#define HAVE_MIPS32R5_INLINE 0
+#define HAVE_MIPS64R6_INLINE 0
+#define HAVE_MIPSDSPR1_INLINE 0
+#define HAVE_MIPSDSPR2_INLINE 0
+#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
+#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
+#define HAVE_ALIGNED_STACK 1
+#define HAVE_FAST_64BIT 1
+#define HAVE_FAST_CLZ 1
+#define HAVE_FAST_CMOV 1
+#define HAVE_LOCAL_ALIGNED_8 1
+#define HAVE_LOCAL_ALIGNED_16 1
+#define HAVE_LOCAL_ALIGNED_32 1
+#define HAVE_SIMD_ALIGN_16 1
+#define HAVE_ATOMICS_GCC 1
+#define HAVE_ATOMICS_SUNCC 0
+#define HAVE_ATOMICS_WIN32 0
+#define HAVE_ATOMIC_CAS_PTR 0
+#define HAVE_ATOMIC_COMPARE_EXCHANGE 1
+#define HAVE_MACHINE_RW_BARRIER 0
+#define HAVE_MEMORYBARRIER 0
+#define HAVE_MM_EMPTY 1
+#define HAVE_RDTSC 0
+#define HAVE_SARESTART 1
+#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
+#define HAVE_INLINE_ASM 1
+#define HAVE_SYMVER 0
+#define HAVE_YASM 1
+#define HAVE_BIGENDIAN 0
+#define HAVE_FAST_UNALIGNED 1
+#define HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#define HAVE_ALSA_ASOUNDLIB_H 0
+#define HAVE_ALTIVEC_H 0
+#define HAVE_ARPA_INET_H 0
+#define HAVE_ASM_TYPES_H 1
+#define HAVE_CDIO_PARANOIA_H 0
+#define HAVE_CDIO_PARANOIA_PARANOIA_H 0
+#define HAVE_DEV_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0
+#define HAVE_DEV_IC_BT8XX_H 0
+#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
+#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
+#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D3D11_H 0
+#define HAVE_DXVA_H 0
+#define HAVE_ES2_GL_H 0
+#define HAVE_GSM_H 0
+#define HAVE_IO_H 0
+#define HAVE_MACH_MACH_TIME_H 0
+#define HAVE_MACHINE_IOCTL_BT848_H 0
+#define HAVE_MACHINE_IOCTL_METEOR_H 0
+#define HAVE_MALLOC_H 1
+#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0
+#define HAVE_OPENGL_GL3_H 0
+#define HAVE_POLL_H 1
+#define HAVE_SNDIO_H 0
+#define HAVE_SOUNDCARD_H 0
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SOUNDCARD_H 0
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_UN_H 1
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_UDPLITE_H 0
+#define HAVE_UNISTD_H 1
+#define HAVE_VALGRIND_VALGRIND_H 0
+#define HAVE_WINDOWS_H 0
+#define HAVE_WINSOCK2_H 0
+#define HAVE_INTRINSICS_NEON 0
+#define HAVE_ATANF 1
+#define HAVE_ATAN2F 1
+#define HAVE_CBRT 1
+#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COSF 1
+#define HAVE_ERF 1
+#define HAVE_EXP2 1
+#define HAVE_EXP2F 1
+#define HAVE_EXPF 1
+#define HAVE_ISINF 1
+#define HAVE_ISNAN 1
+#define HAVE_LDEXPF 1
+#define HAVE_LLRINT 1
+#define HAVE_LLRINTF 1
+#define HAVE_LOG2 1
+#define HAVE_LOG2F 1
+#define HAVE_LOG10F 1
+#define HAVE_LRINT 1
+#define HAVE_LRINTF 1
+#define HAVE_POWF 1
+#define HAVE_RINT 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SINF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_ACCESS 1
+#define HAVE_ALIGNED_MALLOC 0
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CLOSESOCKET 0
+#define HAVE_COMMANDLINETOARGVW 0
+#define HAVE_COTASKMEMFREE 0
+#define HAVE_CRYPTGENRANDOM 0
+#define HAVE_DLOPEN 1
+#define HAVE_FCNTL 1
+#define HAVE_FLT_LIM 1
+#define HAVE_FORK 1
+#define HAVE_GETADDRINFO 0
+#define HAVE_GETHRTIME 0
+#define HAVE_GETOPT 1
+#define HAVE_GETPROCESSAFFINITYMASK 0
+#define HAVE_GETPROCESSMEMORYINFO 0
+#define HAVE_GETPROCESSTIMES 0
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETSERVBYPORT 0
+#define HAVE_GETSYSTEMTIMEASFILETIME 0
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GLOB 0
+#define HAVE_GLXGETPROCADDRESS 0
+#define HAVE_GMTIME_R 1
+#define HAVE_INET_ATON 0
+#define HAVE_ISATTY 1
+#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
+#define HAVE_KBHIT 0
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
+#define HAVE_LZO1X_999_COMPRESS 0
+#define HAVE_MACH_ABSOLUTE_TIME 0
+#define HAVE_MAPVIEWOFFILE 0
+#define HAVE_MEMALIGN 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_PEEKNAMEDPIPE 0
+#define HAVE_POSIX_MEMALIGN 1
+#define HAVE_PTHREAD_CANCEL 0
+#define HAVE_SCHED_GETAFFINITY 1
+#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
+#define HAVE_SETMODE 0
+#define HAVE_SETRLIMIT 1
+#define HAVE_SLEEP 0
+#define HAVE_STRERROR_R 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYSCTL 0
+#define HAVE_USLEEP 1
+#define HAVE_VIRTUALALLOC 0
+#define HAVE_WGLGETPROCADDRESS 0
+#define HAVE_PTHREADS 1
+#define HAVE_OS2THREADS 0
+#define HAVE_W32THREADS 0
+#define HAVE_AS_DN_DIRECTIVE 0
+#define HAVE_AS_FUNC 0
+#define HAVE_AS_OBJECT_ARCH 0
+#define HAVE_ASM_MOD_Q 0
+#define HAVE_ATTRIBUTE_MAY_ALIAS 1
+#define HAVE_ATTRIBUTE_PACKED 1
+#define HAVE_EBP_AVAILABLE 1
+#define HAVE_EBX_AVAILABLE 1
+#define HAVE_GNU_AS 0
+#define HAVE_GNU_WINDRES 0
+#define HAVE_IBM_ASM 0
+#define HAVE_INLINE_ASM_LABELS 1
+#define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
+#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
+#define HAVE_PRAGMA_DEPRECATED 1
+#define HAVE_RSYNC_CONTIMEOUT 1
+#define HAVE_SYMVER_ASM_LABEL 0
+#define HAVE_SYMVER_GNU_ASM 1
+#define HAVE_VFP_ARGS 0
+#define HAVE_XFORM_ASM 0
+#define HAVE_XMM_CLOBBERS 1
+#define HAVE_CONDITION_VARIABLE_PTR 0
+#define HAVE_SOCKLEN_T 0
+#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
+#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
+#define HAVE_STRUCT_IP_MREQ_SOURCE 0
+#define HAVE_STRUCT_IPV6_MREQ 0
+#define HAVE_STRUCT_POLLFD 0
+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1
+#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0
+#define HAVE_STRUCT_SOCKADDR_IN6 0
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 0
+#define HAVE_STRUCT_SOCKADDR_STORAGE 0
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0
+#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 1
+#define HAVE_ATOMICS_NATIVE 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_DXVA2API_COBJ 0
+#define HAVE_DXVA2_LIB 0
+#define HAVE_LIBC_MSVCRT 0
+#define HAVE_LIBDC1394_1 0
+#define HAVE_LIBDC1394_2 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
+#define HAVE_SDL 0
+#define HAVE_SECTION_DATA_REL_RO 1
+#define HAVE_TEXI2HTML 0
+#define HAVE_THREADS 1
+#define HAVE_VAAPI_X11 0
+#define HAVE_VDPAU_X11 0
+#define HAVE_XLIB 0
+#define CONFIG_BSFS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_DEMUXERS 1
+#define CONFIG_ENCODERS 0
+#define CONFIG_FILTERS 0
+#define CONFIG_HWACCELS 0
+#define CONFIG_INDEVS 0
+#define CONFIG_MUXERS 0
+#define CONFIG_OUTDEVS 0
+#define CONFIG_PARSERS 1
+#define CONFIG_PROTOCOLS 0
+#define CONFIG_DOC 0
+#define CONFIG_HTMLPAGES 0
+#define CONFIG_MANPAGES 0
+#define CONFIG_PODPAGES 0
+#define CONFIG_TXTPAGES 0
+#define CONFIG_AVIO_READING_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
+#define CONFIG_DECODING_ENCODING_EXAMPLE 1
+#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
+#define CONFIG_EXTRACT_MVS_EXAMPLE 1
+#define CONFIG_FILTER_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_AUDIO_EXAMPLE 0
+#define CONFIG_FILTERING_VIDEO_EXAMPLE 0
+#define CONFIG_METADATA_EXAMPLE 1
+#define CONFIG_MUXING_EXAMPLE 0
+#define CONFIG_QSVDEC_EXAMPLE 0
+#define CONFIG_REMUXING_EXAMPLE 1
+#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 0
+#define CONFIG_SCALING_VIDEO_EXAMPLE 0
+#define CONFIG_TRANSCODE_AAC_EXAMPLE 0
+#define CONFIG_TRANSCODING_EXAMPLE 0
+#define CONFIG_AVISYNTH 0
+#define CONFIG_BZLIB 0
+#define CONFIG_CRYSTALHD 0
+#define CONFIG_DECKLINK 0
+#define CONFIG_FREI0R 0
+#define CONFIG_GNUTLS 0
+#define CONFIG_ICONV 0
+#define CONFIG_LADSPA 0
+#define CONFIG_LIBAACPLUS 0
+#define CONFIG_LIBASS 0
+#define CONFIG_LIBBLURAY 0
+#define CONFIG_LIBBS2B 0
+#define CONFIG_LIBCACA 0
+#define CONFIG_LIBCDIO 0
+#define CONFIG_LIBCELT 0
+#define CONFIG_LIBDC1394 0
+#define CONFIG_LIBDCADEC 0
+#define CONFIG_LIBFAAC 0
+#define CONFIG_LIBFDK_AAC 0
+#define CONFIG_LIBFLITE 0
+#define CONFIG_LIBFONTCONFIG 0
+#define CONFIG_LIBFREETYPE 0
+#define CONFIG_LIBFRIBIDI 0
+#define CONFIG_LIBGME 0
+#define CONFIG_LIBGSM 0
+#define CONFIG_LIBIEC61883 0
+#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
+#define CONFIG_LIBMFX 0
+#define CONFIG_LIBMODPLUG 0
+#define CONFIG_LIBMP3LAME 0
+#define CONFIG_LIBNUT 0
+#define CONFIG_LIBOPENCORE_AMRNB 0
+#define CONFIG_LIBOPENCORE_AMRWB 0
+#define CONFIG_LIBOPENCV 0
+#define CONFIG_LIBOPENH264 0
+#define CONFIG_LIBOPENJPEG 0
+#define CONFIG_LIBOPUS 0
+#define CONFIG_LIBPULSE 0
+#define CONFIG_LIBQUVI 0
+#define CONFIG_LIBRTMP 0
+#define CONFIG_LIBSCHROEDINGER 0
+#define CONFIG_LIBSHINE 0
+#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
+#define CONFIG_LIBSOXR 0
+#define CONFIG_LIBSPEEX 0
+#define CONFIG_LIBSSH 0
+#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
+#define CONFIG_LIBTHEORA 0
+#define CONFIG_LIBTWOLAME 0
+#define CONFIG_LIBUTVIDEO 0
+#define CONFIG_LIBV4L2 0
+#define CONFIG_LIBVIDSTAB 0
+#define CONFIG_LIBVO_AACENC 0
+#define CONFIG_LIBVO_AMRWBENC 0
+#define CONFIG_LIBVORBIS 0
+#define CONFIG_LIBVPX 0
+#define CONFIG_LIBWAVPACK 0
+#define CONFIG_LIBWEBP 0
+#define CONFIG_LIBX264 0
+#define CONFIG_LIBX265 0
+#define CONFIG_LIBXAVS 0
+#define CONFIG_LIBXCB 0
+#define CONFIG_LIBXCB_SHM 0
+#define CONFIG_LIBXCB_SHAPE 0
+#define CONFIG_LIBXCB_XFIXES 0
+#define CONFIG_LIBXVID 0
+#define CONFIG_LIBZMQ 0
+#define CONFIG_LIBZVBI 0
+#define CONFIG_LZMA 0
+#define CONFIG_MMAL 0
+#define CONFIG_NVENC 0
+#define CONFIG_OPENAL 0
+#define CONFIG_OPENCL 0
+#define CONFIG_OPENGL 0
+#define CONFIG_OPENSSL 0
+#define CONFIG_SDL 0
+#define CONFIG_SECURETRANSPORT 0
+#define CONFIG_X11GRAB 0
+#define CONFIG_XLIB 0
+#define CONFIG_ZLIB 0
+#define CONFIG_FTRAPV 0
+#define CONFIG_GRAY 0
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SAFE_BITSTREAM_READER 1
+#define CONFIG_SHARED 0
+#define CONFIG_SMALL 1
+#define CONFIG_STATIC 1
+#define CONFIG_SWSCALE_ALPHA 1
+#define CONFIG_D3D11VA 0
+#define CONFIG_DXVA2 0
+#define CONFIG_VAAPI 0
+#define CONFIG_VDA 0
+#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
+#define CONFIG_XVMC 0
+#define CONFIG_GPL 0
+#define CONFIG_NONFREE 0
+#define CONFIG_VERSION3 0
+#define CONFIG_AVCODEC 1
+#define CONFIG_AVDEVICE 0
+#define CONFIG_AVFILTER 0
+#define CONFIG_AVFORMAT 1
+#define CONFIG_AVRESAMPLE 0
+#define CONFIG_AVUTIL 1
+#define CONFIG_POSTPROC 0
+#define CONFIG_SWRESAMPLE 0
+#define CONFIG_SWSCALE 0
+#define CONFIG_FFPLAY 0
+#define CONFIG_FFPROBE 0
+#define CONFIG_FFSERVER 0
+#define CONFIG_FFMPEG 0
+#define CONFIG_DCT 0
+#define CONFIG_DWT 0
+#define CONFIG_ERROR_RESILIENCE 0
+#define CONFIG_FAAN 1
+#define CONFIG_FAST_UNALIGNED 1
+#define CONFIG_FFT 1
+#define CONFIG_LSP 0
+#define CONFIG_LZO 0
+#define CONFIG_MDCT 1
+#define CONFIG_PIXELUTILS 0
+#define CONFIG_NETWORK 0
+#define CONFIG_RDFT 1
+#define CONFIG_FONTCONFIG 0
+#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0
+#define CONFIG_MEMALIGN_HACK 0
+#define CONFIG_MEMORY_POISONING 0
+#define CONFIG_NEON_CLOBBER_TEST 0
+#define CONFIG_PIC 1
+#define CONFIG_POD2MAN 1
+#define CONFIG_RAISE_MAJOR 0
+#define CONFIG_THUMB 0
+#define CONFIG_VALGRIND_BACKTRACE 0
+#define CONFIG_XMM_CLOBBER_TEST 0
+#define CONFIG_AANDCTTABLES 0
+#define CONFIG_AC3DSP 0
+#define CONFIG_AUDIO_FRAME_QUEUE 0
+#define CONFIG_AUDIODSP 0
+#define CONFIG_BLOCKDSP 0
+#define CONFIG_BSWAPDSP 0
+#define CONFIG_CABAC 0
+#define CONFIG_DVPROFILE 0
+#define CONFIG_EXIF 0
+#define CONFIG_FAANDCT 0
+#define CONFIG_FAANIDCT 0
+#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
+#define CONFIG_FMTCONVERT 0
+#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
+#define CONFIG_GCRYPT 0
+#define CONFIG_GMP 0
+#define CONFIG_GOLOMB 1
+#define CONFIG_GPLV3 0
+#define CONFIG_H263DSP 0
+#define CONFIG_H264CHROMA 0
+#define CONFIG_H264DSP 0
+#define CONFIG_H264PRED 0
+#define CONFIG_H264QPEL 0
+#define CONFIG_HPELDSP 0
+#define CONFIG_HUFFMAN 0
+#define CONFIG_HUFFYUVDSP 0
+#define CONFIG_HUFFYUVENCDSP 0
+#define CONFIG_IDCTDSP 0
+#define CONFIG_IIRFILTER 0
+#define CONFIG_IMDCT15 0
+#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
+#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
+#define CONFIG_LGPLV3 0
+#define CONFIG_LLAUDDSP 0
+#define CONFIG_LLVIDDSP 0
+#define CONFIG_LPC 0
+#define CONFIG_LZF 0
+#define CONFIG_ME_CMP 0
+#define CONFIG_MPEG_ER 0
+#define CONFIG_MPEGAUDIO 0
+#define CONFIG_MPEGAUDIODSP 0
+#define CONFIG_MPEGVIDEO 0
+#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
+#define CONFIG_PIXBLOCKDSP 0
+#define CONFIG_QPELDSP 0
+#define CONFIG_QSV 0
+#define CONFIG_QSVDEC 0
+#define CONFIG_QSVENC 0
+#define CONFIG_RANGECODER 0
+#define CONFIG_RIFFDEC 1
+#define CONFIG_RIFFENC 0
+#define CONFIG_RTPDEC 0
+#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
+#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
+#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
+#define CONFIG_TPELDSP 0
+#define CONFIG_VIDEODSP 0
+#define CONFIG_VP3DSP 0
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 0
+#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
+#define CONFIG_AAC_ADTSTOASC_BSF 0
+#define CONFIG_CHOMP_BSF 0
+#define CONFIG_DUMP_EXTRADATA_BSF 0
+#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
+#define CONFIG_IMX_DUMP_HEADER_BSF 0
+#define CONFIG_MJPEG2JPEG_BSF 0
+#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
+#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0
+#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 0
+#define CONFIG_MOV2TEXTSUB_BSF 0
+#define CONFIG_NOISE_BSF 0
+#define CONFIG_REMOVE_EXTRADATA_BSF 0
+#define CONFIG_TEXT2MOVSUB_BSF 0
+#define CONFIG_AASC_DECODER 0
+#define CONFIG_AIC_DECODER 0
+#define CONFIG_ALIAS_PIX_DECODER 0
+#define CONFIG_AMV_DECODER 0
+#define CONFIG_ANM_DECODER 0
+#define CONFIG_ANSI_DECODER 0
+#define CONFIG_APNG_DECODER 0
+#define CONFIG_ASV1_DECODER 0
+#define CONFIG_ASV2_DECODER 0
+#define CONFIG_AURA_DECODER 0
+#define CONFIG_AURA2_DECODER 0
+#define CONFIG_AVRP_DECODER 0
+#define CONFIG_AVRN_DECODER 0
+#define CONFIG_AVS_DECODER 0
+#define CONFIG_AVUI_DECODER 0
+#define CONFIG_AYUV_DECODER 0
+#define CONFIG_BETHSOFTVID_DECODER 0
+#define CONFIG_BFI_DECODER 0
+#define CONFIG_BINK_DECODER 0
+#define CONFIG_BMP_DECODER 0
+#define CONFIG_BMV_VIDEO_DECODER 0
+#define CONFIG_BRENDER_PIX_DECODER 0
+#define CONFIG_C93_DECODER 0
+#define CONFIG_CAVS_DECODER 0
+#define CONFIG_CDGRAPHICS_DECODER 0
+#define CONFIG_CDXL_DECODER 0
+#define CONFIG_CINEPAK_DECODER 0
+#define CONFIG_CLJR_DECODER 0
+#define CONFIG_CLLC_DECODER 0
+#define CONFIG_COMFORTNOISE_DECODER 0
+#define CONFIG_CPIA_DECODER 0
+#define CONFIG_CSCD_DECODER 0
+#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
+#define CONFIG_DFA_DECODER 0
+#define CONFIG_DIRAC_DECODER 0
+#define CONFIG_DNXHD_DECODER 0
+#define CONFIG_DPX_DECODER 0
+#define CONFIG_DSICINVIDEO_DECODER 0
+#define CONFIG_DVVIDEO_DECODER 0
+#define CONFIG_DXA_DECODER 0
+#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
+#define CONFIG_EACMV_DECODER 0
+#define CONFIG_EAMAD_DECODER 0
+#define CONFIG_EATGQ_DECODER 0
+#define CONFIG_EATGV_DECODER 0
+#define CONFIG_EATQI_DECODER 0
+#define CONFIG_EIGHTBPS_DECODER 0
+#define CONFIG_EIGHTSVX_EXP_DECODER 0
+#define CONFIG_EIGHTSVX_FIB_DECODER 0
+#define CONFIG_ESCAPE124_DECODER 0
+#define CONFIG_ESCAPE130_DECODER 0
+#define CONFIG_EXR_DECODER 0
+#define CONFIG_FFV1_DECODER 0
+#define CONFIG_FFVHUFF_DECODER 0
+#define CONFIG_FIC_DECODER 0
+#define CONFIG_FLASHSV_DECODER 0
+#define CONFIG_FLASHSV2_DECODER 0
+#define CONFIG_FLIC_DECODER 0
+#define CONFIG_FLV_DECODER 0
+#define CONFIG_FOURXM_DECODER 0
+#define CONFIG_FRAPS_DECODER 0
+#define CONFIG_FRWU_DECODER 0
+#define CONFIG_G2M_DECODER 0
+#define CONFIG_GIF_DECODER 0
+#define CONFIG_H261_DECODER 0
+#define CONFIG_H263_DECODER 0
+#define CONFIG_H263I_DECODER 0
+#define CONFIG_H263P_DECODER 0
+#define CONFIG_H264_DECODER 0
+#define CONFIG_H264_CRYSTALHD_DECODER 0
+#define CONFIG_H264_MMAL_DECODER 0
+#define CONFIG_H264_QSV_DECODER 0
+#define CONFIG_H264_VDA_DECODER 0
+#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
+#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
+#define CONFIG_HNM4_VIDEO_DECODER 0
+#define CONFIG_HQ_HQA_DECODER 0
+#define CONFIG_HQX_DECODER 0
+#define CONFIG_HUFFYUV_DECODER 0
+#define CONFIG_IDCIN_DECODER 0
+#define CONFIG_IFF_BYTERUN1_DECODER 0
+#define CONFIG_IFF_ILBM_DECODER 0
+#define CONFIG_INDEO2_DECODER 0
+#define CONFIG_INDEO3_DECODER 0
+#define CONFIG_INDEO4_DECODER 0
+#define CONFIG_INDEO5_DECODER 0
+#define CONFIG_INTERPLAY_VIDEO_DECODER 0
+#define CONFIG_JPEG2000_DECODER 0
+#define CONFIG_JPEGLS_DECODER 0
+#define CONFIG_JV_DECODER 0
+#define CONFIG_KGV1_DECODER 0
+#define CONFIG_KMVC_DECODER 0
+#define CONFIG_LAGARITH_DECODER 0
+#define CONFIG_LOCO_DECODER 0
+#define CONFIG_MDEC_DECODER 0
+#define CONFIG_MIMIC_DECODER 0
+#define CONFIG_MJPEG_DECODER 0
+#define CONFIG_MJPEGB_DECODER 0
+#define CONFIG_MMVIDEO_DECODER 0
+#define CONFIG_MOTIONPIXELS_DECODER 0
+#define CONFIG_MPEG_XVMC_DECODER 0
+#define CONFIG_MPEG1VIDEO_DECODER 0
+#define CONFIG_MPEG2VIDEO_DECODER 0
+#define CONFIG_MPEG4_DECODER 0
+#define CONFIG_MPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG4_VDPAU_DECODER 0
+#define CONFIG_MPEGVIDEO_DECODER 0
+#define CONFIG_MPEG_VDPAU_DECODER 0
+#define CONFIG_MPEG1_VDPAU_DECODER 0
+#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
+#define CONFIG_MSA1_DECODER 0
+#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
+#define CONFIG_MSMPEG4V1_DECODER 0
+#define CONFIG_MSMPEG4V2_DECODER 0
+#define CONFIG_MSMPEG4V3_DECODER 0
+#define CONFIG_MSRLE_DECODER 0
+#define CONFIG_MSS1_DECODER 0
+#define CONFIG_MSS2_DECODER 0
+#define CONFIG_MSVIDEO1_DECODER 0
+#define CONFIG_MSZH_DECODER 0
+#define CONFIG_MTS2_DECODER 0
+#define CONFIG_MVC1_DECODER 0
+#define CONFIG_MVC2_DECODER 0
+#define CONFIG_MXPEG_DECODER 0
+#define CONFIG_NUV_DECODER 0
+#define CONFIG_PAF_VIDEO_DECODER 0
+#define CONFIG_PAM_DECODER 0
+#define CONFIG_PBM_DECODER 0
+#define CONFIG_PCX_DECODER 0
+#define CONFIG_PGM_DECODER 0
+#define CONFIG_PGMYUV_DECODER 0
+#define CONFIG_PICTOR_DECODER 0
+#define CONFIG_PNG_DECODER 0
+#define CONFIG_PPM_DECODER 0
+#define CONFIG_PRORES_DECODER 0
+#define CONFIG_PRORES_LGPL_DECODER 0
+#define CONFIG_PTX_DECODER 0
+#define CONFIG_QDRAW_DECODER 0
+#define CONFIG_QPEG_DECODER 0
+#define CONFIG_QTRLE_DECODER 0
+#define CONFIG_R10K_DECODER 0
+#define CONFIG_R210_DECODER 0
+#define CONFIG_RAWVIDEO_DECODER 0
+#define CONFIG_RL2_DECODER 0
+#define CONFIG_ROQ_DECODER 0
+#define CONFIG_RPZA_DECODER 0
+#define CONFIG_RV10_DECODER 0
+#define CONFIG_RV20_DECODER 0
+#define CONFIG_RV30_DECODER 0
+#define CONFIG_RV40_DECODER 0
+#define CONFIG_S302M_DECODER 0
+#define CONFIG_SANM_DECODER 0
+#define CONFIG_SGI_DECODER 0
+#define CONFIG_SGIRLE_DECODER 0
+#define CONFIG_SMACKER_DECODER 0
+#define CONFIG_SMC_DECODER 0
+#define CONFIG_SMVJPEG_DECODER 0
+#define CONFIG_SNOW_DECODER 0
+#define CONFIG_SP5X_DECODER 0
+#define CONFIG_SUNRAST_DECODER 0
+#define CONFIG_SVQ1_DECODER 0
+#define CONFIG_SVQ3_DECODER 0
+#define CONFIG_TARGA_DECODER 0
+#define CONFIG_TARGA_Y216_DECODER 0
+#define CONFIG_TDSC_DECODER 0
+#define CONFIG_THEORA_DECODER 0
+#define CONFIG_THP_DECODER 0
+#define CONFIG_TIERTEXSEQVIDEO_DECODER 0
+#define CONFIG_TIFF_DECODER 0
+#define CONFIG_TMV_DECODER 0
+#define CONFIG_TRUEMOTION1_DECODER 0
+#define CONFIG_TRUEMOTION2_DECODER 0
+#define CONFIG_TSCC_DECODER 0
+#define CONFIG_TSCC2_DECODER 0
+#define CONFIG_TXD_DECODER 0
+#define CONFIG_ULTI_DECODER 0
+#define CONFIG_UTVIDEO_DECODER 0
+#define CONFIG_V210_DECODER 0
+#define CONFIG_V210X_DECODER 0
+#define CONFIG_V308_DECODER 0
+#define CONFIG_V408_DECODER 0
+#define CONFIG_V410_DECODER 0
+#define CONFIG_VB_DECODER 0
+#define CONFIG_VBLE_DECODER 0
+#define CONFIG_VC1_DECODER 0
+#define CONFIG_VC1_CRYSTALHD_DECODER 0
+#define CONFIG_VC1_VDPAU_DECODER 0
+#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
+#define CONFIG_VCR1_DECODER 0
+#define CONFIG_VMDVIDEO_DECODER 0
+#define CONFIG_VMNC_DECODER 0
+#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP5_DECODER 0
+#define CONFIG_VP6_DECODER 0
+#define CONFIG_VP6A_DECODER 0
+#define CONFIG_VP6F_DECODER 0
+#define CONFIG_VP7_DECODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_DECODER 0
+#define CONFIG_VQA_DECODER 0
+#define CONFIG_WEBP_DECODER 0
+#define CONFIG_WMV1_DECODER 0
+#define CONFIG_WMV2_DECODER 0
+#define CONFIG_WMV3_DECODER 0
+#define CONFIG_WMV3_CRYSTALHD_DECODER 0
+#define CONFIG_WMV3_VDPAU_DECODER 0
+#define CONFIG_WMV3IMAGE_DECODER 0
+#define CONFIG_WNV1_DECODER 0
+#define CONFIG_XAN_WC3_DECODER 0
+#define CONFIG_XAN_WC4_DECODER 0
+#define CONFIG_XBM_DECODER 0
+#define CONFIG_XFACE_DECODER 0
+#define CONFIG_XL_DECODER 0
+#define CONFIG_XWD_DECODER 0
+#define CONFIG_Y41P_DECODER 0
+#define CONFIG_YOP_DECODER 0
+#define CONFIG_YUV4_DECODER 0
+#define CONFIG_ZERO12V_DECODER 0
+#define CONFIG_ZEROCODEC_DECODER 0
+#define CONFIG_ZLIB_DECODER 0
+#define CONFIG_ZMBV_DECODER 0
+#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
+#define CONFIG_AAC_LATM_DECODER 0
+#define CONFIG_AC3_DECODER 0
+#define CONFIG_AC3_FIXED_DECODER 0
+#define CONFIG_ALAC_DECODER 0
+#define CONFIG_ALS_DECODER 0
+#define CONFIG_AMRNB_DECODER 0
+#define CONFIG_AMRWB_DECODER 0
+#define CONFIG_APE_DECODER 0
+#define CONFIG_ATRAC1_DECODER 0
+#define CONFIG_ATRAC3_DECODER 0
+#define CONFIG_ATRAC3P_DECODER 0
+#define CONFIG_BINKAUDIO_DCT_DECODER 0
+#define CONFIG_BINKAUDIO_RDFT_DECODER 0
+#define CONFIG_BMV_AUDIO_DECODER 0
+#define CONFIG_COOK_DECODER 0
+#define CONFIG_DCA_DECODER 0
+#define CONFIG_DSD_LSBF_DECODER 0
+#define CONFIG_DSD_MSBF_DECODER 0
+#define CONFIG_DSD_LSBF_PLANAR_DECODER 0
+#define CONFIG_DSD_MSBF_PLANAR_DECODER 0
+#define CONFIG_DSICINAUDIO_DECODER 0
+#define CONFIG_DSS_SP_DECODER 0
+#define CONFIG_EAC3_DECODER 0
+#define CONFIG_EVRC_DECODER 0
+#define CONFIG_FFWAVESYNTH_DECODER 0
+#define CONFIG_FLAC_DECODER 0
+#define CONFIG_G723_1_DECODER 0
+#define CONFIG_G729_DECODER 0
+#define CONFIG_GSM_DECODER 0
+#define CONFIG_GSM_MS_DECODER 0
+#define CONFIG_IAC_DECODER 0
+#define CONFIG_IMC_DECODER 0
+#define CONFIG_MACE3_DECODER 0
+#define CONFIG_MACE6_DECODER 0
+#define CONFIG_METASOUND_DECODER 0
+#define CONFIG_MLP_DECODER 0
+#define CONFIG_MP1_DECODER 0
+#define CONFIG_MP1FLOAT_DECODER 0
+#define CONFIG_MP2_DECODER 0
+#define CONFIG_MP2FLOAT_DECODER 0
+#define CONFIG_MP3_DECODER 0
+#define CONFIG_MP3FLOAT_DECODER 0
+#define CONFIG_MP3ADU_DECODER 0
+#define CONFIG_MP3ADUFLOAT_DECODER 0
+#define CONFIG_MP3ON4_DECODER 0
+#define CONFIG_MP3ON4FLOAT_DECODER 0
+#define CONFIG_MPC7_DECODER 0
+#define CONFIG_MPC8_DECODER 0
+#define CONFIG_NELLYMOSER_DECODER 0
+#define CONFIG_ON2AVC_DECODER 0
+#define CONFIG_OPUS_DECODER 0
+#define CONFIG_PAF_AUDIO_DECODER 0
+#define CONFIG_QCELP_DECODER 0
+#define CONFIG_QDM2_DECODER 0
+#define CONFIG_RA_144_DECODER 0
+#define CONFIG_RA_288_DECODER 0
+#define CONFIG_RALF_DECODER 0
+#define CONFIG_SHORTEN_DECODER 0
+#define CONFIG_SIPR_DECODER 0
+#define CONFIG_SMACKAUD_DECODER 0
+#define CONFIG_SONIC_DECODER 0
+#define CONFIG_TAK_DECODER 0
+#define CONFIG_TRUEHD_DECODER 0
+#define CONFIG_TRUESPEECH_DECODER 0
+#define CONFIG_TTA_DECODER 0
+#define CONFIG_TWINVQ_DECODER 0
+#define CONFIG_VMDAUDIO_DECODER 0
+#define CONFIG_VORBIS_DECODER 1
+#define CONFIG_WAVPACK_DECODER 0
+#define CONFIG_WMALOSSLESS_DECODER 0
+#define CONFIG_WMAPRO_DECODER 0
+#define CONFIG_WMAV1_DECODER 0
+#define CONFIG_WMAV2_DECODER 0
+#define CONFIG_WMAVOICE_DECODER 0
+#define CONFIG_WS_SND1_DECODER 0
+#define CONFIG_PCM_ALAW_DECODER 1
+#define CONFIG_PCM_BLURAY_DECODER 0
+#define CONFIG_PCM_DVD_DECODER 0
+#define CONFIG_PCM_F32BE_DECODER 0
+#define CONFIG_PCM_F32LE_DECODER 1
+#define CONFIG_PCM_F64BE_DECODER 0
+#define CONFIG_PCM_F64LE_DECODER 0
+#define CONFIG_PCM_LXF_DECODER 0
+#define CONFIG_PCM_MULAW_DECODER 1
+#define CONFIG_PCM_S8_DECODER 0
+#define CONFIG_PCM_S8_PLANAR_DECODER 0
+#define CONFIG_PCM_S16BE_DECODER 1
+#define CONFIG_PCM_S16BE_PLANAR_DECODER 0
+#define CONFIG_PCM_S16LE_DECODER 1
+#define CONFIG_PCM_S16LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S24BE_DECODER 1
+#define CONFIG_PCM_S24DAUD_DECODER 0
+#define CONFIG_PCM_S24LE_DECODER 1
+#define CONFIG_PCM_S24LE_PLANAR_DECODER 0
+#define CONFIG_PCM_S32BE_DECODER 0
+#define CONFIG_PCM_S32LE_DECODER 0
+#define CONFIG_PCM_S32LE_PLANAR_DECODER 0
+#define CONFIG_PCM_U8_DECODER 1
+#define CONFIG_PCM_U16BE_DECODER 0
+#define CONFIG_PCM_U16LE_DECODER 0
+#define CONFIG_PCM_U24BE_DECODER 0
+#define CONFIG_PCM_U24LE_DECODER 0
+#define CONFIG_PCM_U32BE_DECODER 0
+#define CONFIG_PCM_U32LE_DECODER 0
+#define CONFIG_PCM_ZORK_DECODER 0
+#define CONFIG_INTERPLAY_DPCM_DECODER 0
+#define CONFIG_ROQ_DPCM_DECODER 0
+#define CONFIG_SOL_DPCM_DECODER 0
+#define CONFIG_XAN_DPCM_DECODER 0
+#define CONFIG_ADPCM_4XM_DECODER 0
+#define CONFIG_ADPCM_ADX_DECODER 0
+#define CONFIG_ADPCM_AFC_DECODER 0
+#define CONFIG_ADPCM_CT_DECODER 0
+#define CONFIG_ADPCM_DTK_DECODER 0
+#define CONFIG_ADPCM_EA_DECODER 0
+#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 0
+#define CONFIG_ADPCM_EA_R1_DECODER 0
+#define CONFIG_ADPCM_EA_R2_DECODER 0
+#define CONFIG_ADPCM_EA_R3_DECODER 0
+#define CONFIG_ADPCM_EA_XAS_DECODER 0
+#define CONFIG_ADPCM_G722_DECODER 0
+#define CONFIG_ADPCM_G726_DECODER 0
+#define CONFIG_ADPCM_G726LE_DECODER 0
+#define CONFIG_ADPCM_IMA_AMV_DECODER 0
+#define CONFIG_ADPCM_IMA_APC_DECODER 0
+#define CONFIG_ADPCM_IMA_DK3_DECODER 0
+#define CONFIG_ADPCM_IMA_DK4_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 0
+#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 0
+#define CONFIG_ADPCM_IMA_ISS_DECODER 0
+#define CONFIG_ADPCM_IMA_OKI_DECODER 0
+#define CONFIG_ADPCM_IMA_QT_DECODER 0
+#define CONFIG_ADPCM_IMA_RAD_DECODER 0
+#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 0
+#define CONFIG_ADPCM_IMA_WAV_DECODER 0
+#define CONFIG_ADPCM_IMA_WS_DECODER 0
+#define CONFIG_ADPCM_MS_DECODER 0
+#define CONFIG_ADPCM_SBPRO_2_DECODER 0
+#define CONFIG_ADPCM_SBPRO_3_DECODER 0
+#define CONFIG_ADPCM_SBPRO_4_DECODER 0
+#define CONFIG_ADPCM_SWF_DECODER 0
+#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
+#define CONFIG_ADPCM_VIMA_DECODER 0
+#define CONFIG_ADPCM_XA_DECODER 0
+#define CONFIG_ADPCM_YAMAHA_DECODER 0
+#define CONFIG_SSA_DECODER 0
+#define CONFIG_ASS_DECODER 0
+#define CONFIG_CCAPTION_DECODER 0
+#define CONFIG_DVBSUB_DECODER 0
+#define CONFIG_DVDSUB_DECODER 0
+#define CONFIG_JACOSUB_DECODER 0
+#define CONFIG_MICRODVD_DECODER 0
+#define CONFIG_MOVTEXT_DECODER 0
+#define CONFIG_MPL2_DECODER 0
+#define CONFIG_PGSSUB_DECODER 0
+#define CONFIG_PJS_DECODER 0
+#define CONFIG_REALTEXT_DECODER 0
+#define CONFIG_SAMI_DECODER 0
+#define CONFIG_SRT_DECODER 0
+#define CONFIG_STL_DECODER 0
+#define CONFIG_SUBRIP_DECODER 0
+#define CONFIG_SUBVIEWER_DECODER 0
+#define CONFIG_SUBVIEWER1_DECODER 0
+#define CONFIG_TEXT_DECODER 0
+#define CONFIG_VPLAYER_DECODER 0
+#define CONFIG_WEBVTT_DECODER 0
+#define CONFIG_XSUB_DECODER 0
+#define CONFIG_LIBCELT_DECODER 0
+#define CONFIG_LIBDCADEC_DECODER 0
+#define CONFIG_LIBFDK_AAC_DECODER 0
+#define CONFIG_LIBGSM_DECODER 0
+#define CONFIG_LIBGSM_MS_DECODER 0
+#define CONFIG_LIBILBC_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0
+#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0
+#define CONFIG_LIBOPENJPEG_DECODER 0
+#define CONFIG_LIBOPUS_DECODER 0
+#define CONFIG_LIBSCHROEDINGER_DECODER 0
+#define CONFIG_LIBSPEEX_DECODER 0
+#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0
+#define CONFIG_LIBUTVIDEO_DECODER 0
+#define CONFIG_LIBVORBIS_DECODER 0
+#define CONFIG_LIBVPX_VP8_DECODER 0
+#define CONFIG_LIBVPX_VP9_DECODER 0
+#define CONFIG_LIBZVBI_TELETEXT_DECODER 0
+#define CONFIG_BINTEXT_DECODER 0
+#define CONFIG_XBIN_DECODER 0
+#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
+#define CONFIG_AAC_DEMUXER 0
+#define CONFIG_AC3_DEMUXER 0
+#define CONFIG_ACT_DEMUXER 0
+#define CONFIG_ADF_DEMUXER 0
+#define CONFIG_ADP_DEMUXER 0
+#define CONFIG_ADX_DEMUXER 0
+#define CONFIG_AEA_DEMUXER 0
+#define CONFIG_AFC_DEMUXER 0
+#define CONFIG_AIFF_DEMUXER 0
+#define CONFIG_AMR_DEMUXER 0
+#define CONFIG_ANM_DEMUXER 0
+#define CONFIG_APC_DEMUXER 0
+#define CONFIG_APE_DEMUXER 0
+#define CONFIG_APNG_DEMUXER 0
+#define CONFIG_AQTITLE_DEMUXER 0
+#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
+#define CONFIG_ASS_DEMUXER 0
+#define CONFIG_AST_DEMUXER 0
+#define CONFIG_AU_DEMUXER 0
+#define CONFIG_AVI_DEMUXER 0
+#define CONFIG_AVISYNTH_DEMUXER 0
+#define CONFIG_AVR_DEMUXER 0
+#define CONFIG_AVS_DEMUXER 0
+#define CONFIG_BETHSOFTVID_DEMUXER 0
+#define CONFIG_BFI_DEMUXER 0
+#define CONFIG_BINTEXT_DEMUXER 0
+#define CONFIG_BINK_DEMUXER 0
+#define CONFIG_BIT_DEMUXER 0
+#define CONFIG_BMV_DEMUXER 0
+#define CONFIG_BFSTM_DEMUXER 0
+#define CONFIG_BRSTM_DEMUXER 0
+#define CONFIG_BOA_DEMUXER 0
+#define CONFIG_C93_DEMUXER 0
+#define CONFIG_CAF_DEMUXER 0
+#define CONFIG_CAVSVIDEO_DEMUXER 0
+#define CONFIG_CDG_DEMUXER 0
+#define CONFIG_CDXL_DEMUXER 0
+#define CONFIG_CINE_DEMUXER 0
+#define CONFIG_CONCAT_DEMUXER 0
+#define CONFIG_DATA_DEMUXER 0
+#define CONFIG_DAUD_DEMUXER 0
+#define CONFIG_DFA_DEMUXER 0
+#define CONFIG_DIRAC_DEMUXER 0
+#define CONFIG_DNXHD_DEMUXER 0
+#define CONFIG_DSF_DEMUXER 0
+#define CONFIG_DSICIN_DEMUXER 0
+#define CONFIG_DSS_DEMUXER 0
+#define CONFIG_DTS_DEMUXER 0
+#define CONFIG_DTSHD_DEMUXER 0
+#define CONFIG_DV_DEMUXER 0
+#define CONFIG_DVBSUB_DEMUXER 0
+#define CONFIG_DXA_DEMUXER 0
+#define CONFIG_EA_DEMUXER 0
+#define CONFIG_EA_CDATA_DEMUXER 0
+#define CONFIG_EAC3_DEMUXER 0
+#define CONFIG_EPAF_DEMUXER 0
+#define CONFIG_FFM_DEMUXER 0
+#define CONFIG_FFMETADATA_DEMUXER 0
+#define CONFIG_FILMSTRIP_DEMUXER 0
+#define CONFIG_FLAC_DEMUXER 0
+#define CONFIG_FLIC_DEMUXER 0
+#define CONFIG_FLV_DEMUXER 0
+#define CONFIG_LIVE_FLV_DEMUXER 0
+#define CONFIG_FOURXM_DEMUXER 0
+#define CONFIG_FRM_DEMUXER 0
+#define CONFIG_G722_DEMUXER 0
+#define CONFIG_G723_1_DEMUXER 0
+#define CONFIG_G729_DEMUXER 0
+#define CONFIG_GIF_DEMUXER 0
+#define CONFIG_GSM_DEMUXER 0
+#define CONFIG_GXF_DEMUXER 0
+#define CONFIG_H261_DEMUXER 0
+#define CONFIG_H263_DEMUXER 0
+#define CONFIG_H264_DEMUXER 0
+#define CONFIG_HEVC_DEMUXER 0
+#define CONFIG_HLS_DEMUXER 0
+#define CONFIG_HNM_DEMUXER 0
+#define CONFIG_ICO_DEMUXER 0
+#define CONFIG_IDCIN_DEMUXER 0
+#define CONFIG_IDF_DEMUXER 0
+#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_ILBC_DEMUXER 0
+#define CONFIG_IMAGE2_DEMUXER 0
+#define CONFIG_IMAGE2PIPE_DEMUXER 0
+#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 0
+#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 0
+#define CONFIG_INGENIENT_DEMUXER 0
+#define CONFIG_IPMOVIE_DEMUXER 0
+#define CONFIG_IRCAM_DEMUXER 0
+#define CONFIG_ISS_DEMUXER 0
+#define CONFIG_IV8_DEMUXER 0
+#define CONFIG_IVF_DEMUXER 0
+#define CONFIG_JACOSUB_DEMUXER 0
+#define CONFIG_JV_DEMUXER 0
+#define CONFIG_LATM_DEMUXER 0
+#define CONFIG_LMLM4_DEMUXER 0
+#define CONFIG_LOAS_DEMUXER 0
+#define CONFIG_LRC_DEMUXER 0
+#define CONFIG_LVF_DEMUXER 0
+#define CONFIG_LXF_DEMUXER 0
+#define CONFIG_M4V_DEMUXER 0
+#define CONFIG_MATROSKA_DEMUXER 1
+#define CONFIG_MGSTS_DEMUXER 0
+#define CONFIG_MICRODVD_DEMUXER 0
+#define CONFIG_MJPEG_DEMUXER 0
+#define CONFIG_MLP_DEMUXER 0
+#define CONFIG_MLV_DEMUXER 0
+#define CONFIG_MM_DEMUXER 0
+#define CONFIG_MMF_DEMUXER 0
+#define CONFIG_MOV_DEMUXER 0
+#define CONFIG_MP3_DEMUXER 0
+#define CONFIG_MPC_DEMUXER 0
+#define CONFIG_MPC8_DEMUXER 0
+#define CONFIG_MPEGPS_DEMUXER 0
+#define CONFIG_MPEGTS_DEMUXER 0
+#define CONFIG_MPEGTSRAW_DEMUXER 0
+#define CONFIG_MPEGVIDEO_DEMUXER 0
+#define CONFIG_MPJPEG_DEMUXER 0
+#define CONFIG_MPL2_DEMUXER 0
+#define CONFIG_MPSUB_DEMUXER 0
+#define CONFIG_MSNWC_TCP_DEMUXER 0
+#define CONFIG_MTV_DEMUXER 0
+#define CONFIG_MV_DEMUXER 0
+#define CONFIG_MVI_DEMUXER 0
+#define CONFIG_MXF_DEMUXER 0
+#define CONFIG_MXG_DEMUXER 0
+#define CONFIG_NC_DEMUXER 0
+#define CONFIG_NISTSPHERE_DEMUXER 0
+#define CONFIG_NSV_DEMUXER 0
+#define CONFIG_NUT_DEMUXER 0
+#define CONFIG_NUV_DEMUXER 0
+#define CONFIG_OGG_DEMUXER 1
+#define CONFIG_OMA_DEMUXER 0
+#define CONFIG_PAF_DEMUXER 0
+#define CONFIG_PCM_ALAW_DEMUXER 0
+#define CONFIG_PCM_MULAW_DEMUXER 0
+#define CONFIG_PCM_F64BE_DEMUXER 0
+#define CONFIG_PCM_F64LE_DEMUXER 0
+#define CONFIG_PCM_F32BE_DEMUXER 0
+#define CONFIG_PCM_F32LE_DEMUXER 0
+#define CONFIG_PCM_S32BE_DEMUXER 0
+#define CONFIG_PCM_S32LE_DEMUXER 0
+#define CONFIG_PCM_S24BE_DEMUXER 0
+#define CONFIG_PCM_S24LE_DEMUXER 0
+#define CONFIG_PCM_S16BE_DEMUXER 0
+#define CONFIG_PCM_S16LE_DEMUXER 0
+#define CONFIG_PCM_S8_DEMUXER 0
+#define CONFIG_PCM_U32BE_DEMUXER 0
+#define CONFIG_PCM_U32LE_DEMUXER 0
+#define CONFIG_PCM_U24BE_DEMUXER 0
+#define CONFIG_PCM_U24LE_DEMUXER 0
+#define CONFIG_PCM_U16BE_DEMUXER 0
+#define CONFIG_PCM_U16LE_DEMUXER 0
+#define CONFIG_PCM_U8_DEMUXER 0
+#define CONFIG_PJS_DEMUXER 0
+#define CONFIG_PMP_DEMUXER 0
+#define CONFIG_PVA_DEMUXER 0
+#define CONFIG_PVF_DEMUXER 0
+#define CONFIG_QCP_DEMUXER 0
+#define CONFIG_R3D_DEMUXER 0
+#define CONFIG_RAWVIDEO_DEMUXER 0
+#define CONFIG_REALTEXT_DEMUXER 0
+#define CONFIG_REDSPARK_DEMUXER 0
+#define CONFIG_RL2_DEMUXER 0
+#define CONFIG_RM_DEMUXER 0
+#define CONFIG_ROQ_DEMUXER 0
+#define CONFIG_RPL_DEMUXER 0
+#define CONFIG_RSD_DEMUXER 0
+#define CONFIG_RSO_DEMUXER 0
+#define CONFIG_RTP_DEMUXER 0
+#define CONFIG_RTSP_DEMUXER 0
+#define CONFIG_SAMI_DEMUXER 0
+#define CONFIG_SAP_DEMUXER 0
+#define CONFIG_SBG_DEMUXER 0
+#define CONFIG_SDP_DEMUXER 0
+#define CONFIG_SDR2_DEMUXER 0
+#define CONFIG_SEGAFILM_DEMUXER 0
+#define CONFIG_SHORTEN_DEMUXER 0
+#define CONFIG_SIFF_DEMUXER 0
+#define CONFIG_SLN_DEMUXER 0
+#define CONFIG_SMACKER_DEMUXER 0
+#define CONFIG_SMJPEG_DEMUXER 0
+#define CONFIG_SMUSH_DEMUXER 0
+#define CONFIG_SOL_DEMUXER 0
+#define CONFIG_SOX_DEMUXER 0
+#define CONFIG_SPDIF_DEMUXER 0
+#define CONFIG_SRT_DEMUXER 0
+#define CONFIG_STR_DEMUXER 0
+#define CONFIG_STL_DEMUXER 0
+#define CONFIG_SUBVIEWER1_DEMUXER 0
+#define CONFIG_SUBVIEWER_DEMUXER 0
+#define CONFIG_SUP_DEMUXER 0
+#define CONFIG_SWF_DEMUXER 0
+#define CONFIG_TAK_DEMUXER 0
+#define CONFIG_TEDCAPTIONS_DEMUXER 0
+#define CONFIG_THP_DEMUXER 0
+#define CONFIG_TIERTEXSEQ_DEMUXER 0
+#define CONFIG_TMV_DEMUXER 0
+#define CONFIG_TRUEHD_DEMUXER 0
+#define CONFIG_TTA_DEMUXER 0
+#define CONFIG_TXD_DEMUXER 0
+#define CONFIG_TTY_DEMUXER 0
+#define CONFIG_VC1_DEMUXER 0
+#define CONFIG_VC1T_DEMUXER 0
+#define CONFIG_VIVO_DEMUXER 0
+#define CONFIG_VMD_DEMUXER 0
+#define CONFIG_VOBSUB_DEMUXER 0
+#define CONFIG_VOC_DEMUXER 0
+#define CONFIG_VPLAYER_DEMUXER 0
+#define CONFIG_VQF_DEMUXER 0
+#define CONFIG_W64_DEMUXER 0
+#define CONFIG_WAV_DEMUXER 1
+#define CONFIG_WC3_DEMUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0
+#define CONFIG_WEBVTT_DEMUXER 0
+#define CONFIG_WSAUD_DEMUXER 0
+#define CONFIG_WSVQA_DEMUXER 0
+#define CONFIG_WTV_DEMUXER 0
+#define CONFIG_WV_DEMUXER 0
+#define CONFIG_XA_DEMUXER 0
+#define CONFIG_XBIN_DEMUXER 0
+#define CONFIG_XMV_DEMUXER 0
+#define CONFIG_XWMA_DEMUXER 0
+#define CONFIG_YOP_DEMUXER 0
+#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
+#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 0
+#define CONFIG_LIBGME_DEMUXER 0
+#define CONFIG_LIBMODPLUG_DEMUXER 0
+#define CONFIG_LIBNUT_DEMUXER 0
+#define CONFIG_LIBQUVI_DEMUXER 0
+#define CONFIG_A64MULTI_ENCODER 0
+#define CONFIG_A64MULTI5_ENCODER 0
+#define CONFIG_ALIAS_PIX_ENCODER 0
+#define CONFIG_AMV_ENCODER 0
+#define CONFIG_APNG_ENCODER 0
+#define CONFIG_ASV1_ENCODER 0
+#define CONFIG_ASV2_ENCODER 0
+#define CONFIG_AVRP_ENCODER 0
+#define CONFIG_AVUI_ENCODER 0
+#define CONFIG_AYUV_ENCODER 0
+#define CONFIG_BMP_ENCODER 0
+#define CONFIG_CINEPAK_ENCODER 0
+#define CONFIG_CLJR_ENCODER 0
+#define CONFIG_COMFORTNOISE_ENCODER 0
+#define CONFIG_DNXHD_ENCODER 0
+#define CONFIG_DPX_ENCODER 0
+#define CONFIG_DVVIDEO_ENCODER 0
+#define CONFIG_FFV1_ENCODER 0
+#define CONFIG_FFVHUFF_ENCODER 0
+#define CONFIG_FLASHSV_ENCODER 0
+#define CONFIG_FLASHSV2_ENCODER 0
+#define CONFIG_FLV_ENCODER 0
+#define CONFIG_GIF_ENCODER 0
+#define CONFIG_H261_ENCODER 0
+#define CONFIG_H263_ENCODER 0
+#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
+#define CONFIG_HUFFYUV_ENCODER 0
+#define CONFIG_JPEG2000_ENCODER 0
+#define CONFIG_JPEGLS_ENCODER 0
+#define CONFIG_LJPEG_ENCODER 0
+#define CONFIG_MJPEG_ENCODER 0
+#define CONFIG_MPEG1VIDEO_ENCODER 0
+#define CONFIG_MPEG2VIDEO_ENCODER 0
+#define CONFIG_MPEG4_ENCODER 0
+#define CONFIG_MSMPEG4V2_ENCODER 0
+#define CONFIG_MSMPEG4V3_ENCODER 0
+#define CONFIG_MSVIDEO1_ENCODER 0
+#define CONFIG_PAM_ENCODER 0
+#define CONFIG_PBM_ENCODER 0
+#define CONFIG_PCX_ENCODER 0
+#define CONFIG_PGM_ENCODER 0
+#define CONFIG_PGMYUV_ENCODER 0
+#define CONFIG_PNG_ENCODER 0
+#define CONFIG_PPM_ENCODER 0
+#define CONFIG_PRORES_ENCODER 0
+#define CONFIG_PRORES_AW_ENCODER 0
+#define CONFIG_PRORES_KS_ENCODER 0
+#define CONFIG_QTRLE_ENCODER 0
+#define CONFIG_R10K_ENCODER 0
+#define CONFIG_R210_ENCODER 0
+#define CONFIG_RAWVIDEO_ENCODER 0
+#define CONFIG_ROQ_ENCODER 0
+#define CONFIG_RV10_ENCODER 0
+#define CONFIG_RV20_ENCODER 0
+#define CONFIG_S302M_ENCODER 0
+#define CONFIG_SGI_ENCODER 0
+#define CONFIG_SNOW_ENCODER 0
+#define CONFIG_SUNRAST_ENCODER 0
+#define CONFIG_SVQ1_ENCODER 0
+#define CONFIG_TARGA_ENCODER 0
+#define CONFIG_TIFF_ENCODER 0
+#define CONFIG_UTVIDEO_ENCODER 0
+#define CONFIG_V210_ENCODER 0
+#define CONFIG_V308_ENCODER 0
+#define CONFIG_V408_ENCODER 0
+#define CONFIG_V410_ENCODER 0
+#define CONFIG_WMV1_ENCODER 0
+#define CONFIG_WMV2_ENCODER 0
+#define CONFIG_XBM_ENCODER 0
+#define CONFIG_XFACE_ENCODER 0
+#define CONFIG_XWD_ENCODER 0
+#define CONFIG_Y41P_ENCODER 0
+#define CONFIG_YUV4_ENCODER 0
+#define CONFIG_ZLIB_ENCODER 0
+#define CONFIG_ZMBV_ENCODER 0
+#define CONFIG_AAC_ENCODER 0
+#define CONFIG_AC3_ENCODER 0
+#define CONFIG_AC3_FIXED_ENCODER 0
+#define CONFIG_ALAC_ENCODER 0
+#define CONFIG_DCA_ENCODER 0
+#define CONFIG_EAC3_ENCODER 0
+#define CONFIG_FLAC_ENCODER 0
+#define CONFIG_G723_1_ENCODER 0
+#define CONFIG_MP2_ENCODER 0
+#define CONFIG_MP2FIXED_ENCODER 0
+#define CONFIG_NELLYMOSER_ENCODER 0
+#define CONFIG_RA_144_ENCODER 0
+#define CONFIG_SONIC_ENCODER 0
+#define CONFIG_SONIC_LS_ENCODER 0
+#define CONFIG_TTA_ENCODER 0
+#define CONFIG_VORBIS_ENCODER 0
+#define CONFIG_WAVPACK_ENCODER 0
+#define CONFIG_WMAV1_ENCODER 0
+#define CONFIG_WMAV2_ENCODER 0
+#define CONFIG_PCM_ALAW_ENCODER 0
+#define CONFIG_PCM_F32BE_ENCODER 0
+#define CONFIG_PCM_F32LE_ENCODER 0
+#define CONFIG_PCM_F64BE_ENCODER 0
+#define CONFIG_PCM_F64LE_ENCODER 0
+#define CONFIG_PCM_MULAW_ENCODER 0
+#define CONFIG_PCM_S8_ENCODER 0
+#define CONFIG_PCM_S8_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16BE_ENCODER 0
+#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S16LE_ENCODER 0
+#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S24BE_ENCODER 0
+#define CONFIG_PCM_S24DAUD_ENCODER 0
+#define CONFIG_PCM_S24LE_ENCODER 0
+#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_S32BE_ENCODER 0
+#define CONFIG_PCM_S32LE_ENCODER 0
+#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0
+#define CONFIG_PCM_U8_ENCODER 0
+#define CONFIG_PCM_U16BE_ENCODER 0
+#define CONFIG_PCM_U16LE_ENCODER 0
+#define CONFIG_PCM_U24BE_ENCODER 0
+#define CONFIG_PCM_U24LE_ENCODER 0
+#define CONFIG_PCM_U32BE_ENCODER 0
+#define CONFIG_PCM_U32LE_ENCODER 0
+#define CONFIG_ROQ_DPCM_ENCODER 0
+#define CONFIG_ADPCM_ADX_ENCODER 0
+#define CONFIG_ADPCM_G722_ENCODER 0
+#define CONFIG_ADPCM_G726_ENCODER 0
+#define CONFIG_ADPCM_IMA_QT_ENCODER 0
+#define CONFIG_ADPCM_IMA_WAV_ENCODER 0
+#define CONFIG_ADPCM_MS_ENCODER 0
+#define CONFIG_ADPCM_SWF_ENCODER 0
+#define CONFIG_ADPCM_YAMAHA_ENCODER 0
+#define CONFIG_SSA_ENCODER 0
+#define CONFIG_ASS_ENCODER 0
+#define CONFIG_DVBSUB_ENCODER 0
+#define CONFIG_DVDSUB_ENCODER 0
+#define CONFIG_MOVTEXT_ENCODER 0
+#define CONFIG_SRT_ENCODER 0
+#define CONFIG_SUBRIP_ENCODER 0
+#define CONFIG_WEBVTT_ENCODER 0
+#define CONFIG_XSUB_ENCODER 0
+#define CONFIG_LIBFAAC_ENCODER 0
+#define CONFIG_LIBFDK_AAC_ENCODER 0
+#define CONFIG_LIBGSM_ENCODER 0
+#define CONFIG_LIBGSM_MS_ENCODER 0
+#define CONFIG_LIBILBC_ENCODER 0
+#define CONFIG_LIBMP3LAME_ENCODER 0
+#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0
+#define CONFIG_LIBOPENJPEG_ENCODER 0
+#define CONFIG_LIBOPUS_ENCODER 0
+#define CONFIG_LIBSCHROEDINGER_ENCODER 0
+#define CONFIG_LIBSHINE_ENCODER 0
+#define CONFIG_LIBSPEEX_ENCODER 0
+#define CONFIG_LIBTHEORA_ENCODER 0
+#define CONFIG_LIBTWOLAME_ENCODER 0
+#define CONFIG_LIBUTVIDEO_ENCODER 0
+#define CONFIG_LIBVO_AACENC_ENCODER 0
+#define CONFIG_LIBVO_AMRWBENC_ENCODER 0
+#define CONFIG_LIBVORBIS_ENCODER 0
+#define CONFIG_LIBVPX_VP8_ENCODER 0
+#define CONFIG_LIBVPX_VP9_ENCODER 0
+#define CONFIG_LIBWAVPACK_ENCODER 0
+#define CONFIG_LIBWEBP_ANIM_ENCODER 0
+#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
+#define CONFIG_LIBX264_ENCODER 0
+#define CONFIG_LIBX264RGB_ENCODER 0
+#define CONFIG_LIBX265_ENCODER 0
+#define CONFIG_LIBXAVS_ENCODER 0
+#define CONFIG_LIBXVID_ENCODER 0
+#define CONFIG_LIBAACPLUS_ENCODER 0
+#define CONFIG_LIBOPENH264_ENCODER 0
+#define CONFIG_H264_QSV_ENCODER 0
+#define CONFIG_NVENC_ENCODER 0
+#define CONFIG_NVENC_H264_ENCODER 0
+#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
+#define CONFIG_ADELAY_FILTER 0
+#define CONFIG_AECHO_FILTER 0
+#define CONFIG_AEVAL_FILTER 0
+#define CONFIG_AFADE_FILTER 0
+#define CONFIG_AFORMAT_FILTER 0
+#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
+#define CONFIG_ALLPASS_FILTER 0
+#define CONFIG_AMERGE_FILTER 0
+#define CONFIG_AMIX_FILTER 0
+#define CONFIG_ANULL_FILTER 0
+#define CONFIG_APAD_FILTER 0
+#define CONFIG_APERMS_FILTER 0
+#define CONFIG_APHASER_FILTER 0
+#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
+#define CONFIG_ASELECT_FILTER 0
+#define CONFIG_ASENDCMD_FILTER 0
+#define CONFIG_ASETNSAMPLES_FILTER 0
+#define CONFIG_ASETPTS_FILTER 0
+#define CONFIG_ASETRATE_FILTER 0
+#define CONFIG_ASETTB_FILTER 0
+#define CONFIG_ASHOWINFO_FILTER 0
+#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASTATS_FILTER 0
+#define CONFIG_ASTREAMSYNC_FILTER 0
+#define CONFIG_ASYNCTS_FILTER 0
+#define CONFIG_ATEMPO_FILTER 0
+#define CONFIG_ATRIM_FILTER 0
+#define CONFIG_AZMQ_FILTER 0
+#define CONFIG_BANDPASS_FILTER 0
+#define CONFIG_BANDREJECT_FILTER 0
+#define CONFIG_BASS_FILTER 0
+#define CONFIG_BIQUAD_FILTER 0
+#define CONFIG_BS2B_FILTER 0
+#define CONFIG_CHANNELMAP_FILTER 0
+#define CONFIG_CHANNELSPLIT_FILTER 0
+#define CONFIG_CHORUS_FILTER 0
+#define CONFIG_COMPAND_FILTER 0
+#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
+#define CONFIG_EARWAX_FILTER 0
+#define CONFIG_EBUR128_FILTER 0
+#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
+#define CONFIG_FLANGER_FILTER 0
+#define CONFIG_HIGHPASS_FILTER 0
+#define CONFIG_JOIN_FILTER 0
+#define CONFIG_LADSPA_FILTER 0
+#define CONFIG_LOWPASS_FILTER 0
+#define CONFIG_PAN_FILTER 0
+#define CONFIG_REPLAYGAIN_FILTER 0
+#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
+#define CONFIG_SILENCEDETECT_FILTER 0
+#define CONFIG_SILENCEREMOVE_FILTER 0
+#define CONFIG_TREBLE_FILTER 0
+#define CONFIG_VOLUME_FILTER 0
+#define CONFIG_VOLUMEDETECT_FILTER 0
+#define CONFIG_AEVALSRC_FILTER 0
+#define CONFIG_ANULLSRC_FILTER 0
+#define CONFIG_FLITE_FILTER 0
+#define CONFIG_SINE_FILTER 0
+#define CONFIG_ANULLSINK_FILTER 0
+#define CONFIG_ALPHAEXTRACT_FILTER 0
+#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
+#define CONFIG_ASS_FILTER 0
+#define CONFIG_BBOX_FILTER 0
+#define CONFIG_BLACKDETECT_FILTER 0
+#define CONFIG_BLACKFRAME_FILTER 0
+#define CONFIG_BLEND_FILTER 0
+#define CONFIG_BOXBLUR_FILTER 0
+#define CONFIG_CODECVIEW_FILTER 0
+#define CONFIG_COLORBALANCE_FILTER 0
+#define CONFIG_COLORCHANNELMIXER_FILTER 0
+#define CONFIG_COLORKEY_FILTER 0
+#define CONFIG_COLORLEVELS_FILTER 0
+#define CONFIG_COLORMATRIX_FILTER 0
+#define CONFIG_COPY_FILTER 0
+#define CONFIG_COVER_RECT_FILTER 0
+#define CONFIG_CROP_FILTER 0
+#define CONFIG_CROPDETECT_FILTER 0
+#define CONFIG_CURVES_FILTER 0
+#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
+#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
+#define CONFIG_DEJUDDER_FILTER 0
+#define CONFIG_DELOGO_FILTER 0
+#define CONFIG_DESHAKE_FILTER 0
+#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
+#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
+#define CONFIG_DRAWGRID_FILTER 0
+#define CONFIG_DRAWTEXT_FILTER 0
+#define CONFIG_EDGEDETECT_FILTER 0
+#define CONFIG_ELBG_FILTER 0
+#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
+#define CONFIG_EXTRACTPLANES_FILTER 0
+#define CONFIG_FADE_FILTER 0
+#define CONFIG_FFTFILT_FILTER 0
+#define CONFIG_FIELD_FILTER 0
+#define CONFIG_FIELDMATCH_FILTER 0
+#define CONFIG_FIELDORDER_FILTER 0
+#define CONFIG_FIND_RECT_FILTER 0
+#define CONFIG_FORMAT_FILTER 0
+#define CONFIG_FPS_FILTER 0
+#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
+#define CONFIG_FRAMESTEP_FILTER 0
+#define CONFIG_FREI0R_FILTER 0
+#define CONFIG_FSPP_FILTER 0
+#define CONFIG_GEQ_FILTER 0
+#define CONFIG_GRADFUN_FILTER 0
+#define CONFIG_HALDCLUT_FILTER 0
+#define CONFIG_HFLIP_FILTER 0
+#define CONFIG_HISTEQ_FILTER 0
+#define CONFIG_HISTOGRAM_FILTER 0
+#define CONFIG_HQDN3D_FILTER 0
+#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
+#define CONFIG_HUE_FILTER 0
+#define CONFIG_IDET_FILTER 0
+#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
+#define CONFIG_INTERLACE_FILTER 0
+#define CONFIG_INTERLEAVE_FILTER 0
+#define CONFIG_KERNDEINT_FILTER 0
+#define CONFIG_LENSCORRECTION_FILTER 0
+#define CONFIG_LUT3D_FILTER 0
+#define CONFIG_LUT_FILTER 0
+#define CONFIG_LUTRGB_FILTER 0
+#define CONFIG_LUTYUV_FILTER 0
+#define CONFIG_MCDEINT_FILTER 0
+#define CONFIG_MERGEPLANES_FILTER 0
+#define CONFIG_MPDECIMATE_FILTER 0
+#define CONFIG_NEGATE_FILTER 0
+#define CONFIG_NOFORMAT_FILTER 0
+#define CONFIG_NOISE_FILTER 0
+#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
+#define CONFIG_OCV_FILTER 0
+#define CONFIG_OVERLAY_FILTER 0
+#define CONFIG_OWDENOISE_FILTER 0
+#define CONFIG_PAD_FILTER 0
+#define CONFIG_PALETTEGEN_FILTER 0
+#define CONFIG_PALETTEUSE_FILTER 0
+#define CONFIG_PERMS_FILTER 0
+#define CONFIG_PERSPECTIVE_FILTER 0
+#define CONFIG_PHASE_FILTER 0
+#define CONFIG_PIXDESCTEST_FILTER 0
+#define CONFIG_PP_FILTER 0
+#define CONFIG_PP7_FILTER 0
+#define CONFIG_PSNR_FILTER 0
+#define CONFIG_PULLUP_FILTER 0
+#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
+#define CONFIG_REMOVELOGO_FILTER 0
+#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
+#define CONFIG_ROTATE_FILTER 0
+#define CONFIG_SAB_FILTER 0
+#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
+#define CONFIG_SELECT_FILTER 0
+#define CONFIG_SENDCMD_FILTER 0
+#define CONFIG_SEPARATEFIELDS_FILTER 0
+#define CONFIG_SETDAR_FILTER 0
+#define CONFIG_SETFIELD_FILTER 0
+#define CONFIG_SETPTS_FILTER 0
+#define CONFIG_SETSAR_FILTER 0
+#define CONFIG_SETTB_FILTER 0
+#define CONFIG_SHOWINFO_FILTER 0
+#define CONFIG_SHOWPALETTE_FILTER 0
+#define CONFIG_SHUFFLEPLANES_FILTER 0
+#define CONFIG_SIGNALSTATS_FILTER 0
+#define CONFIG_SMARTBLUR_FILTER 0
+#define CONFIG_SPLIT_FILTER 0
+#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
+#define CONFIG_STEREO3D_FILTER 0
+#define CONFIG_SUBTITLES_FILTER 0
+#define CONFIG_SUPER2XSAI_FILTER 0
+#define CONFIG_SWAPUV_FILTER 0
+#define CONFIG_TBLEND_FILTER 0
+#define CONFIG_TELECINE_FILTER 0
+#define CONFIG_THUMBNAIL_FILTER 0
+#define CONFIG_TILE_FILTER 0
+#define CONFIG_TINTERLACE_FILTER 0
+#define CONFIG_TRANSPOSE_FILTER 0
+#define CONFIG_TRIM_FILTER 0
+#define CONFIG_UNSHARP_FILTER 0
+#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
+#define CONFIG_VFLIP_FILTER 0
+#define CONFIG_VIDSTABDETECT_FILTER 0
+#define CONFIG_VIDSTABTRANSFORM_FILTER 0
+#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
+#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
+#define CONFIG_XBR_FILTER 0
+#define CONFIG_YADIF_FILTER 0
+#define CONFIG_ZMQ_FILTER 0
+#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
+#define CONFIG_CELLAUTO_FILTER 0
+#define CONFIG_COLOR_FILTER 0
+#define CONFIG_FREI0R_SRC_FILTER 0
+#define CONFIG_HALDCLUTSRC_FILTER 0
+#define CONFIG_LIFE_FILTER 0
+#define CONFIG_MANDELBROT_FILTER 0
+#define CONFIG_MPTESTSRC_FILTER 0
+#define CONFIG_NULLSRC_FILTER 0
+#define CONFIG_RGBTESTSRC_FILTER 0
+#define CONFIG_SMPTEBARS_FILTER 0
+#define CONFIG_SMPTEHDBARS_FILTER 0
+#define CONFIG_TESTSRC_FILTER 0
+#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
+#define CONFIG_AVECTORSCOPE_FILTER 0
+#define CONFIG_CONCAT_FILTER 0
+#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
+#define CONFIG_SHOWWAVES_FILTER 0
+#define CONFIG_SHOWWAVESPIC_FILTER 0
+#define CONFIG_AMOVIE_FILTER 0
+#define CONFIG_MOVIE_FILTER 0
+#define CONFIG_H263_VAAPI_HWACCEL 0
+#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_H264_D3D11VA_HWACCEL 0
+#define CONFIG_H264_DXVA2_HWACCEL 0
+#define CONFIG_H264_MMAL_HWACCEL 0
+#define CONFIG_H264_QSV_HWACCEL 0
+#define CONFIG_H264_VAAPI_HWACCEL 0
+#define CONFIG_H264_VDA_HWACCEL 0
+#define CONFIG_H264_VDA_OLD_HWACCEL 0
+#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_HEVC_D3D11VA_HWACCEL 0
+#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_XVMC_HWACCEL 0
+#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG2_XVMC_HWACCEL 0
+#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
+#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
+#define CONFIG_MPEG2_VAAPI_HWACCEL 0
+#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_MPEG4_VAAPI_HWACCEL 0
+#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
+#define CONFIG_VC1_D3D11VA_HWACCEL 0
+#define CONFIG_VC1_DXVA2_HWACCEL 0
+#define CONFIG_VC1_VAAPI_HWACCEL 0
+#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
+#define CONFIG_WMV3_D3D11VA_HWACCEL 0
+#define CONFIG_WMV3_DXVA2_HWACCEL 0
+#define CONFIG_WMV3_VAAPI_HWACCEL 0
+#define CONFIG_WMV3_VDPAU_HWACCEL 0
+#define CONFIG_ALSA_INDEV 0
+#define CONFIG_AVFOUNDATION_INDEV 0
+#define CONFIG_BKTR_INDEV 0
+#define CONFIG_DECKLINK_INDEV 0
+#define CONFIG_DSHOW_INDEV 0
+#define CONFIG_DV1394_INDEV 0
+#define CONFIG_FBDEV_INDEV 0
+#define CONFIG_GDIGRAB_INDEV 0
+#define CONFIG_IEC61883_INDEV 0
+#define CONFIG_JACK_INDEV 0
+#define CONFIG_LAVFI_INDEV 0
+#define CONFIG_OPENAL_INDEV 0
+#define CONFIG_OSS_INDEV 0
+#define CONFIG_PULSE_INDEV 0
+#define CONFIG_QTKIT_INDEV 0
+#define CONFIG_SNDIO_INDEV 0
+#define CONFIG_V4L2_INDEV 0
+#define CONFIG_VFWCAP_INDEV 0
+#define CONFIG_X11GRAB_INDEV 0
+#define CONFIG_X11GRAB_XCB_INDEV 0
+#define CONFIG_LIBCDIO_INDEV 0
+#define CONFIG_LIBDC1394_INDEV 0
+#define CONFIG_A64_MUXER 0
+#define CONFIG_AC3_MUXER 0
+#define CONFIG_ADTS_MUXER 0
+#define CONFIG_ADX_MUXER 0
+#define CONFIG_AIFF_MUXER 0
+#define CONFIG_AMR_MUXER 0
+#define CONFIG_APNG_MUXER 0
+#define CONFIG_ASF_MUXER 0
+#define CONFIG_ASS_MUXER 0
+#define CONFIG_AST_MUXER 0
+#define CONFIG_ASF_STREAM_MUXER 0
+#define CONFIG_AU_MUXER 0
+#define CONFIG_AVI_MUXER 0
+#define CONFIG_AVM2_MUXER 0
+#define CONFIG_BIT_MUXER 0
+#define CONFIG_CAF_MUXER 0
+#define CONFIG_CAVSVIDEO_MUXER 0
+#define CONFIG_CRC_MUXER 0
+#define CONFIG_DASH_MUXER 0
+#define CONFIG_DATA_MUXER 0
+#define CONFIG_DAUD_MUXER 0
+#define CONFIG_DIRAC_MUXER 0
+#define CONFIG_DNXHD_MUXER 0
+#define CONFIG_DTS_MUXER 0
+#define CONFIG_DV_MUXER 0
+#define CONFIG_EAC3_MUXER 0
+#define CONFIG_F4V_MUXER 0
+#define CONFIG_FFM_MUXER 0
+#define CONFIG_FFMETADATA_MUXER 0
+#define CONFIG_FILMSTRIP_MUXER 0
+#define CONFIG_FLAC_MUXER 0
+#define CONFIG_FLV_MUXER 0
+#define CONFIG_FRAMECRC_MUXER 0
+#define CONFIG_FRAMEMD5_MUXER 0
+#define CONFIG_G722_MUXER 0
+#define CONFIG_G723_1_MUXER 0
+#define CONFIG_GIF_MUXER 0
+#define CONFIG_GXF_MUXER 0
+#define CONFIG_H261_MUXER 0
+#define CONFIG_H263_MUXER 0
+#define CONFIG_H264_MUXER 0
+#define CONFIG_HDS_MUXER 0
+#define CONFIG_HEVC_MUXER 0
+#define CONFIG_HLS_MUXER 0
+#define CONFIG_ICO_MUXER 0
+#define CONFIG_ILBC_MUXER 0
+#define CONFIG_IMAGE2_MUXER 0
+#define CONFIG_IMAGE2PIPE_MUXER 0
+#define CONFIG_IPOD_MUXER 0
+#define CONFIG_IRCAM_MUXER 0
+#define CONFIG_ISMV_MUXER 0
+#define CONFIG_IVF_MUXER 0
+#define CONFIG_JACOSUB_MUXER 0
+#define CONFIG_LATM_MUXER 0
+#define CONFIG_LRC_MUXER 0
+#define CONFIG_M4V_MUXER 0
+#define CONFIG_MD5_MUXER 0
+#define CONFIG_MATROSKA_MUXER 0
+#define CONFIG_MATROSKA_AUDIO_MUXER 0
+#define CONFIG_MICRODVD_MUXER 0
+#define CONFIG_MJPEG_MUXER 0
+#define CONFIG_MLP_MUXER 0
+#define CONFIG_MMF_MUXER 0
+#define CONFIG_MOV_MUXER 0
+#define CONFIG_MP2_MUXER 0
+#define CONFIG_MP3_MUXER 0
+#define CONFIG_MP4_MUXER 0
+#define CONFIG_MPEG1SYSTEM_MUXER 0
+#define CONFIG_MPEG1VCD_MUXER 0
+#define CONFIG_MPEG1VIDEO_MUXER 0
+#define CONFIG_MPEG2DVD_MUXER 0
+#define CONFIG_MPEG2SVCD_MUXER 0
+#define CONFIG_MPEG2VIDEO_MUXER 0
+#define CONFIG_MPEG2VOB_MUXER 0
+#define CONFIG_MPEGTS_MUXER 0
+#define CONFIG_MPJPEG_MUXER 0
+#define CONFIG_MXF_MUXER 0
+#define CONFIG_MXF_D10_MUXER 0
+#define CONFIG_MXF_OPATOM_MUXER 0
+#define CONFIG_NULL_MUXER 0
+#define CONFIG_NUT_MUXER 0
+#define CONFIG_OGA_MUXER 0
+#define CONFIG_OGG_MUXER 0
+#define CONFIG_OMA_MUXER 0
+#define CONFIG_OPUS_MUXER 0
+#define CONFIG_PCM_ALAW_MUXER 0
+#define CONFIG_PCM_MULAW_MUXER 0
+#define CONFIG_PCM_F64BE_MUXER 0
+#define CONFIG_PCM_F64LE_MUXER 0
+#define CONFIG_PCM_F32BE_MUXER 0
+#define CONFIG_PCM_F32LE_MUXER 0
+#define CONFIG_PCM_S32BE_MUXER 0
+#define CONFIG_PCM_S32LE_MUXER 0
+#define CONFIG_PCM_S24BE_MUXER 0
+#define CONFIG_PCM_S24LE_MUXER 0
+#define CONFIG_PCM_S16BE_MUXER 0
+#define CONFIG_PCM_S16LE_MUXER 0
+#define CONFIG_PCM_S8_MUXER 0
+#define CONFIG_PCM_U32BE_MUXER 0
+#define CONFIG_PCM_U32LE_MUXER 0
+#define CONFIG_PCM_U24BE_MUXER 0
+#define CONFIG_PCM_U24LE_MUXER 0
+#define CONFIG_PCM_U16BE_MUXER 0
+#define CONFIG_PCM_U16LE_MUXER 0
+#define CONFIG_PCM_U8_MUXER 0
+#define CONFIG_PSP_MUXER 0
+#define CONFIG_RAWVIDEO_MUXER 0
+#define CONFIG_RM_MUXER 0
+#define CONFIG_ROQ_MUXER 0
+#define CONFIG_RSO_MUXER 0
+#define CONFIG_RTP_MUXER 0
+#define CONFIG_RTP_MPEGTS_MUXER 0
+#define CONFIG_RTSP_MUXER 0
+#define CONFIG_SAP_MUXER 0
+#define CONFIG_SEGMENT_MUXER 0
+#define CONFIG_STREAM_SEGMENT_MUXER 0
+#define CONFIG_SINGLEJPEG_MUXER 0
+#define CONFIG_SMJPEG_MUXER 0
+#define CONFIG_SMOOTHSTREAMING_MUXER 0
+#define CONFIG_SOX_MUXER 0
+#define CONFIG_SPX_MUXER 0
+#define CONFIG_SPDIF_MUXER 0
+#define CONFIG_SRT_MUXER 0
+#define CONFIG_SWF_MUXER 0
+#define CONFIG_TEE_MUXER 0
+#define CONFIG_TG2_MUXER 0
+#define CONFIG_TGP_MUXER 0
+#define CONFIG_MKVTIMESTAMP_V2_MUXER 0
+#define CONFIG_TRUEHD_MUXER 0
+#define CONFIG_UNCODEDFRAMECRC_MUXER 0
+#define CONFIG_VC1_MUXER 0
+#define CONFIG_VC1T_MUXER 0
+#define CONFIG_VOC_MUXER 0
+#define CONFIG_W64_MUXER 0
+#define CONFIG_WAV_MUXER 0
+#define CONFIG_WEBM_MUXER 0
+#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0
+#define CONFIG_WEBM_CHUNK_MUXER 0
+#define CONFIG_WEBP_MUXER 0
+#define CONFIG_WEBVTT_MUXER 0
+#define CONFIG_WTV_MUXER 0
+#define CONFIG_WV_MUXER 0
+#define CONFIG_YUV4MPEGPIPE_MUXER 0
+#define CONFIG_LIBNUT_MUXER 0
+#define CONFIG_ALSA_OUTDEV 0
+#define CONFIG_CACA_OUTDEV 0
+#define CONFIG_DECKLINK_OUTDEV 0
+#define CONFIG_FBDEV_OUTDEV 0
+#define CONFIG_OPENGL_OUTDEV 0
+#define CONFIG_OSS_OUTDEV 0
+#define CONFIG_PULSE_OUTDEV 0
+#define CONFIG_SDL_OUTDEV 0
+#define CONFIG_SNDIO_OUTDEV 0
+#define CONFIG_V4L2_OUTDEV 0
+#define CONFIG_XV_OUTDEV 0
+#define CONFIG_AAC_PARSER 0
+#define CONFIG_AAC_LATM_PARSER 0
+#define CONFIG_AC3_PARSER 0
+#define CONFIG_ADX_PARSER 0
+#define CONFIG_BMP_PARSER 0
+#define CONFIG_CAVSVIDEO_PARSER 0
+#define CONFIG_COOK_PARSER 0
+#define CONFIG_DCA_PARSER 0
+#define CONFIG_DIRAC_PARSER 0
+#define CONFIG_DNXHD_PARSER 0
+#define CONFIG_DPX_PARSER 0
+#define CONFIG_DVBSUB_PARSER 0
+#define CONFIG_DVDSUB_PARSER 0
+#define CONFIG_DVD_NAV_PARSER 0
+#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
+#define CONFIG_GSM_PARSER 0
+#define CONFIG_H261_PARSER 0
+#define CONFIG_H263_PARSER 0
+#define CONFIG_H264_PARSER 0
+#define CONFIG_HEVC_PARSER 0
+#define CONFIG_MJPEG_PARSER 0
+#define CONFIG_MLP_PARSER 0
+#define CONFIG_MPEG4VIDEO_PARSER 0
+#define CONFIG_MPEGAUDIO_PARSER 0
+#define CONFIG_MPEGVIDEO_PARSER 0
+#define CONFIG_OPUS_PARSER 1
+#define CONFIG_PNG_PARSER 0
+#define CONFIG_PNM_PARSER 0
+#define CONFIG_RV30_PARSER 0
+#define CONFIG_RV40_PARSER 0
+#define CONFIG_TAK_PARSER 0
+#define CONFIG_VC1_PARSER 0
+#define CONFIG_VORBIS_PARSER 1
+#define CONFIG_VP3_PARSER 0
+#define CONFIG_VP8_PARSER 0
+#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
+#define CONFIG_BLURAY_PROTOCOL 0
+#define CONFIG_CACHE_PROTOCOL 0
+#define CONFIG_CONCAT_PROTOCOL 0
+#define CONFIG_CRYPTO_PROTOCOL 0
+#define CONFIG_DATA_PROTOCOL 0
+#define CONFIG_FFRTMPCRYPT_PROTOCOL 0
+#define CONFIG_FFRTMPHTTP_PROTOCOL 0
+#define CONFIG_FILE_PROTOCOL 0
+#define CONFIG_FTP_PROTOCOL 0
+#define CONFIG_GOPHER_PROTOCOL 0
+#define CONFIG_HLS_PROTOCOL 0
+#define CONFIG_HTTP_PROTOCOL 0
+#define CONFIG_HTTPPROXY_PROTOCOL 0
+#define CONFIG_HTTPS_PROTOCOL 0
+#define CONFIG_ICECAST_PROTOCOL 0
+#define CONFIG_MMSH_PROTOCOL 0
+#define CONFIG_MMST_PROTOCOL 0
+#define CONFIG_MD5_PROTOCOL 0
+#define CONFIG_PIPE_PROTOCOL 0
+#define CONFIG_RTMP_PROTOCOL 0
+#define CONFIG_RTMPE_PROTOCOL 0
+#define CONFIG_RTMPS_PROTOCOL 0
+#define CONFIG_RTMPT_PROTOCOL 0
+#define CONFIG_RTMPTE_PROTOCOL 0
+#define CONFIG_RTMPTS_PROTOCOL 0
+#define CONFIG_RTP_PROTOCOL 0
+#define CONFIG_SCTP_PROTOCOL 0
+#define CONFIG_SRTP_PROTOCOL 0
+#define CONFIG_SUBFILE_PROTOCOL 0
+#define CONFIG_TCP_PROTOCOL 0
+#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0
+#define CONFIG_TLS_GNUTLS_PROTOCOL 0
+#define CONFIG_TLS_OPENSSL_PROTOCOL 0
+#define CONFIG_UDP_PROTOCOL 0
+#define CONFIG_UDPLITE_PROTOCOL 0
+#define CONFIG_UNIX_PROTOCOL 0
+#define CONFIG_LIBRTMP_PROTOCOL 0
+#define CONFIG_LIBRTMPE_PROTOCOL 0
+#define CONFIG_LIBRTMPS_PROTOCOL 0
+#define CONFIG_LIBRTMPT_PROTOCOL 0
+#define CONFIG_LIBRTMPTE_PROTOCOL 0
+#define CONFIG_LIBSSH_PROTOCOL 0
+#define CONFIG_LIBSMBCLIENT_PROTOCOL 0
+#endif /* FFMPEG_CONFIG_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/avconfig.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/avconfig.h
new file mode 100644
index 00000000000..36a8cd14da6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/avconfig.h
@@ -0,0 +1,7 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
+#endif /* AVUTIL_AVCONFIG_H */
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
new file mode 100644
index 00000000000..629579cf063
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h
@@ -0,0 +1,4 @@
+#ifndef AVUTIL_FFVERSION_H
+#define AVUTIL_FFVERSION_H
+#define FFMPEG_VERSION "N-75763-g1651ce3"
+#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 a7b3dc31927..debe1fcab14 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 0
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 e1b1a61f695..3a2319c9b8f 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 7cf105166fc..b718a95737b 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
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 001f612696a..67bfeb85f0b 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 9bfd9ff92a7..965f076e6c9 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h
index 63fe67b3c38..06605a7ecba 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 1e99bd3922e..2038d9615a5 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_9dd69ae_4.9.2-r93) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..25d558166aa 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75748-g7dbd5cd"
#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 47a5b4fbb17..bf34cb8985d 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h
index 2371c591a62..793b881dc56 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
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 01d8ff588cb..237b8391d13 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#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 985d3fb1aa4..03855d24bc1 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 1
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h
index f1969379844..fae96871aa3 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\0-O2\0' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64"
+#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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\0-O2\0' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --enable-yasm --cc=clang --cxx=clang++ --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)"
+#define CC_IDENT "clang version 3.8.0 (trunk 245965)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 1
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..244fca20fe9 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "N-75752-ga961860"
#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 82abc5186c2..d34e79fa26f 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 0
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
+%define HAVE_DIRENT_H 0
%define HAVE_DLFCN_H 0
%define HAVE_D3D11_H 1
%define HAVE_DXVA_H 1
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
%define HAVE_LOCALTIME_R 0
+%define HAVE_LSTAT 0
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 0
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
+%define HAVE_SETCONSOLECTRLHANDLER 1
%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 1
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -327,10 +339,10 @@
%define HAVE_LIBC_MSVCRT 1
%define HAVE_LIBDC1394_1 0
%define HAVE_LIBDC1394_2 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MAKEINFO_HTML 0
-%define HAVE_PERL 0
-%define HAVE_POD2MAN 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
%define HAVE_SDL 0
%define HAVE_SECTION_DATA_REL_RO 0
%define HAVE_TEXI2HTML 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -499,7 +515,7 @@
%define CONFIG_MEMORY_POISONING 0
%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_POD2MAN 0
+%define CONFIG_POD2MAN 1
%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
%define CONFIG_VALGRIND_BACKTRACE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h
index bd5f40669cd..245accbc15d 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/c/src/blink/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
+#define HAVE_DIRENT_H 0
#define HAVE_DLFCN_H 0
#define HAVE_D3D11_H 1
#define HAVE_DXVA_H 1
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
#define HAVE_LOCALTIME_R 0
+#define HAVE_LSTAT 0
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
+#define HAVE_SETCONSOLECTRLHANDLER 1
#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 1
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -343,10 +355,10 @@
#define HAVE_LIBC_MSVCRT 1
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MAKEINFO_HTML 0
-#define HAVE_PERL 0
-#define HAVE_POD2MAN 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 0
#define HAVE_TEXI2HTML 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -515,7 +531,7 @@
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_POD2MAN 0
+#define CONFIG_POD2MAN 1
#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..6ca30c7bb4e 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "2.8.git"
#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 e0515d8ef90..cf974043932 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
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 1
+%define HAVE_DIRENT_H 0
%define HAVE_DLFCN_H 0
%define HAVE_D3D11_H 1
%define HAVE_DXVA_H 1
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 1
%define HAVE_LOCALTIME_R 0
+%define HAVE_LSTAT 0
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 1
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 0
%define HAVE_SCHED_GETAFFINITY 0
%define HAVE_SETCONSOLETEXTATTRIBUTE 1
+%define HAVE_SETCONSOLECTRLHANDLER 1
%define HAVE_SETMODE 1
%define HAVE_SETRLIMIT 0
%define HAVE_SLEEP 1
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 1
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -327,10 +339,10 @@
%define HAVE_LIBC_MSVCRT 1
%define HAVE_LIBDC1394_1 0
%define HAVE_LIBDC1394_2 0
-%define HAVE_MAKEINFO 0
-%define HAVE_MAKEINFO_HTML 0
-%define HAVE_PERL 0
-%define HAVE_POD2MAN 0
+%define HAVE_MAKEINFO 1
+%define HAVE_MAKEINFO_HTML 1
+%define HAVE_PERL 1
+%define HAVE_POD2MAN 1
%define HAVE_SDL 0
%define HAVE_SECTION_DATA_REL_RO 0
%define HAVE_TEXI2HTML 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -499,7 +515,7 @@
%define CONFIG_MEMORY_POISONING 0
%define CONFIG_NEON_CLOBBER_TEST 0
%define CONFIG_PIC 0
-%define CONFIG_POD2MAN 0
+%define CONFIG_POD2MAN 1
%define CONFIG_RAISE_MAJOR 0
%define CONFIG_THUMB 0
%define CONFIG_VALGRIND_BACKTRACE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 0
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 0
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h
index c6654fd7183..9d125d677a1 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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/c/src/blink/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --enable-yasm --extra-cflags=-I/cygdrive/e/src/chrome/src/third_party/ffmpeg/chromium/include/win --cc='cygwin-wrapper cl' --ld='cygwin-wrapper link' --nm='cygwin-wrapper dumpbin -symbols' --ar='cygwin-wrapper lib'"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 1
+#define HAVE_DIRENT_H 0
#define HAVE_DLFCN_H 0
#define HAVE_D3D11_H 1
#define HAVE_DXVA_H 1
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 1
#define HAVE_LOCALTIME_R 0
+#define HAVE_LSTAT 0
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 1
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 0
#define HAVE_SCHED_GETAFFINITY 0
#define HAVE_SETCONSOLETEXTATTRIBUTE 1
+#define HAVE_SETCONSOLECTRLHANDLER 1
#define HAVE_SETMODE 1
#define HAVE_SETRLIMIT 0
#define HAVE_SLEEP 1
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 1
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -343,10 +355,10 @@
#define HAVE_LIBC_MSVCRT 1
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
-#define HAVE_MAKEINFO 0
-#define HAVE_MAKEINFO_HTML 0
-#define HAVE_PERL 0
-#define HAVE_POD2MAN 0
+#define HAVE_MAKEINFO 1
+#define HAVE_MAKEINFO_HTML 1
+#define HAVE_PERL 1
+#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 0
#define HAVE_TEXI2HTML 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -515,7 +531,7 @@
#define CONFIG_MEMORY_POISONING 0
#define CONFIG_NEON_CLOBBER_TEST 0
#define CONFIG_PIC 0
-#define CONFIG_POD2MAN 0
+#define CONFIG_POD2MAN 1
#define CONFIG_RAISE_MAJOR 0
#define CONFIG_THUMB 0
#define CONFIG_VALGRIND_BACKTRACE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 0
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 0
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 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 71c991841d5..6ca30c7bb4e 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,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "git-2015-06-29-a1a5db5"
+#define FFMPEG_VERSION "2.8.git"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/config.h
index 88b68836079..c767f289d56 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/config.h
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 0
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux-noasm/x64/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
index ab91a024a7f..9ac77395e9a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/config.h
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm-neon/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
index 5a1311fc8f9..c20796bcade 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/config.h
@@ -6,7 +6,7 @@
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_fae0d5c_4.9.2-r109) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 1
#define HAVE_ARMV6_EXTERNAL 1
#define HAVE_ARMV6T2_EXTERNAL 1
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 1
#define HAVE_ARMV6_INLINE 1
#define HAVE_ARMV6T2_INLINE 1
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/config.h
index 34152801c1a..cdf456540c2 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/config.h
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/arm64/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
index 6ef0b500d97..bb96d0bb306 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.asm
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 0
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 1
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 1
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
index f277b52b850..68c2f439470 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/config.h
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/ia32/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
index 0a7bf91809c..5475b2f4555 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/config.h
@@ -1,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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
+#define FFMPEG_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 --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-sdl --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --enable-decoder=vorbis --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_f32le' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav' --enable-parser='opus,vorbis' --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=mipsel-cros-linux-gnu- --target-os=linux --arch=mips --extra-cflags=-mips32 --extra-cflags=-EL --extra-ldflags=-mips32 --extra-ldflags=-EL --disable-mipsfpu --disable-mipsdspr1 --disable-mipsdspr2 --enable-pic --enable-demuxer=flac --enable-decoder=flac --enable-parser=flac"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2015
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_d86e6bd_4.9.2-r104) 20150123 (prerelease)"
+#define CC_IDENT "gcc 4.9.x-google (4.9.2_cos_gg_9dd69ae_4.9.2-r93) 20150123 (prerelease)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 0
#define HAVE_FAST_64BIT 0
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -344,12 +356,12 @@
#define HAVE_LIBDC1394_1 0
#define HAVE_LIBDC1394_2 0
#define HAVE_MAKEINFO 1
-#define HAVE_MAKEINFO_HTML 0
+#define HAVE_MAKEINFO_HTML 1
#define HAVE_PERL 1
#define HAVE_POD2MAN 1
#define HAVE_SDL 0
#define HAVE_SECTION_DATA_REL_RO 1
-#define HAVE_TEXI2HTML 1
+#define HAVE_TEXI2HTML 0
#define HAVE_THREADS 1
#define HAVE_VAAPI_X11 0
#define HAVE_VDPAU_X11 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/ffversion.h
index 01d8ff588cb..25d558166aa 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/mipsel/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75748-g7dbd5cd"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
index 0087c91a911..f5bb60bc769 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.asm
@@ -60,7 +60,9 @@
%define HAVE_MIPSDSPR1 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
-%define HAVE_LOONGSON3 0
+%define HAVE_LOONGSON2 1
+%define HAVE_LOONGSON3 1
+%define HAVE_MMI 0
%define HAVE_ARMV5TE_EXTERNAL 0
%define HAVE_ARMV6_EXTERNAL 0
%define HAVE_ARMV6T2_EXTERNAL 0
@@ -99,7 +101,9 @@
%define HAVE_MIPSDSPR1_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
+%define HAVE_MMI_EXTERNAL 0
%define HAVE_ARMV5TE_INLINE 0
%define HAVE_ARMV6_INLINE 0
%define HAVE_ARMV6T2_INLINE 0
@@ -138,7 +142,9 @@
%define HAVE_MIPSDSPR1_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
+%define HAVE_MMI_INLINE 0
%define HAVE_ALIGNED_STACK 1
%define HAVE_FAST_64BIT 1
%define HAVE_FAST_CLZ 1
@@ -176,6 +182,7 @@
%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
%define HAVE_DIRECT_H 0
+%define HAVE_DIRENT_H 1
%define HAVE_DLFCN_H 1
%define HAVE_D3D11_H 0
%define HAVE_DXVA_H 0
@@ -210,7 +217,9 @@
%define HAVE_ATAN2F 1
%define HAVE_CBRT 1
%define HAVE_CBRTF 1
+%define HAVE_COPYSIGN 1
%define HAVE_COSF 1
+%define HAVE_ERF 1
%define HAVE_EXP2 1
%define HAVE_EXP2F 1
%define HAVE_EXPF 1
@@ -260,6 +269,7 @@
%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
%define HAVE_KBHIT 0
%define HAVE_LOCALTIME_R 1
+%define HAVE_LSTAT 1
%define HAVE_LZO1X_999_COMPRESS 0
%define HAVE_MACH_ABSOLUTE_TIME 0
%define HAVE_MAPVIEWOFFILE 0
@@ -273,6 +283,7 @@
%define HAVE_PTHREAD_CANCEL 1
%define HAVE_SCHED_GETAFFINITY 1
%define HAVE_SETCONSOLETEXTATTRIBUTE 0
+%define HAVE_SETCONSOLECTRLHANDLER 0
%define HAVE_SETMODE 0
%define HAVE_SETRLIMIT 1
%define HAVE_SLEEP 0
@@ -309,6 +320,7 @@
%define HAVE_CONDITION_VARIABLE_PTR 0
%define HAVE_SOCKLEN_T 0
%define HAVE_STRUCT_ADDRINFO 0
+%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
%define HAVE_STRUCT_GROUP_SOURCE_REQ 0
%define HAVE_STRUCT_IP_MREQ_SOURCE 0
%define HAVE_STRUCT_IPV6_MREQ 0
@@ -355,7 +367,7 @@
%define CONFIG_PODPAGES 0
%define CONFIG_TXTPAGES 0
%define CONFIG_AVIO_READING_EXAMPLE 1
-%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
%define CONFIG_DECODING_ENCODING_EXAMPLE 1
%define CONFIG_DEMUXING_DECODING_EXAMPLE 1
%define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -397,6 +409,7 @@
%define CONFIG_LIBGSM 0
%define CONFIG_LIBIEC61883 0
%define CONFIG_LIBILBC 0
+%define CONFIG_LIBKVAZAAR 0
%define CONFIG_LIBMFX 0
%define CONFIG_LIBMODPLUG 0
%define CONFIG_LIBMP3LAME 0
@@ -413,10 +426,12 @@
%define CONFIG_LIBSCHROEDINGER 0
%define CONFIG_LIBSHINE 0
%define CONFIG_LIBSMBCLIENT 0
+%define CONFIG_LIBSNAPPY 0
%define CONFIG_LIBSOXR 0
%define CONFIG_LIBSPEEX 0
%define CONFIG_LIBSSH 0
%define CONFIG_LIBSTAGEFRIGHT_H264 0
+%define CONFIG_LIBTESSERACT 0
%define CONFIG_LIBTHEORA 0
%define CONFIG_LIBTWOLAME 0
%define CONFIG_LIBUTVIDEO 0
@@ -464,6 +479,7 @@
%define CONFIG_VAAPI 0
%define CONFIG_VDA 0
%define CONFIG_VDPAU 0
+%define CONFIG_VIDEOTOOLBOX 0
%define CONFIG_XVMC 0
%define CONFIG_GPL 0
%define CONFIG_NONFREE 0
@@ -516,8 +532,10 @@
%define CONFIG_FAANDCT 0
%define CONFIG_FAANIDCT 0
%define CONFIG_FDCTDSP 0
+%define CONFIG_FLACDSP 1
%define CONFIG_FMTCONVERT 0
%define CONFIG_FRAME_THREAD_ENCODER 0
+%define CONFIG_G722DSP 0
%define CONFIG_GCRYPT 0
%define CONFIG_GMP 0
%define CONFIG_GOLOMB 1
@@ -535,17 +553,21 @@
%define CONFIG_IIRFILTER 0
%define CONFIG_IMDCT15 0
%define CONFIG_INTRAX8 0
+%define CONFIG_IVIDSP 0
%define CONFIG_JPEGTABLES 0
+%define CONFIG_LIBX262 0
%define CONFIG_LGPLV3 0
%define CONFIG_LLAUDDSP 0
%define CONFIG_LLVIDDSP 0
%define CONFIG_LPC 0
+%define CONFIG_LZF 0
%define CONFIG_ME_CMP 0
%define CONFIG_MPEG_ER 0
%define CONFIG_MPEGAUDIO 0
%define CONFIG_MPEGAUDIODSP 0
%define CONFIG_MPEGVIDEO 0
%define CONFIG_MPEGVIDEOENC 0
+%define CONFIG_MSS34DSP 0
%define CONFIG_PIXBLOCKDSP 0
%define CONFIG_QPELDSP 0
%define CONFIG_QSV 0
@@ -556,16 +578,24 @@
%define CONFIG_RIFFENC 0
%define CONFIG_RTPDEC 0
%define CONFIG_RTPENC_CHAIN 0
+%define CONFIG_RV34DSP 0
%define CONFIG_SINEWIN 0
+%define CONFIG_SNAPPY 0
%define CONFIG_STARTCODE 0
+%define CONFIG_TEXTUREDSP 0
+%define CONFIG_TEXTUREDSPENC 0
%define CONFIG_TPELDSP 0
%define CONFIG_VIDEODSP 1
%define CONFIG_VP3DSP 1
+%define CONFIG_VP56DSP 0
+%define CONFIG_VP8DSP 1
%define CONFIG_WMA_FREQS 0
+%define CONFIG_WMV2DSP 0
%define CONFIG_AAC_ADTSTOASC_BSF 0
%define CONFIG_CHOMP_BSF 0
%define CONFIG_DUMP_EXTRADATA_BSF 0
%define CONFIG_H264_MP4TOANNEXB_BSF 0
+%define CONFIG_HEVC_MP4TOANNEXB_BSF 0
%define CONFIG_IMX_DUMP_HEADER_BSF 0
%define CONFIG_MJPEG2JPEG_BSF 0
%define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -608,6 +638,7 @@
%define CONFIG_CPIA_DECODER 0
%define CONFIG_CSCD_DECODER 0
%define CONFIG_CYUV_DECODER 0
+%define CONFIG_DDS_DECODER 0
%define CONFIG_DFA_DECODER 0
%define CONFIG_DIRAC_DECODER 0
%define CONFIG_DNXHD_DECODER 0
@@ -616,6 +647,7 @@
%define CONFIG_DVVIDEO_DECODER 0
%define CONFIG_DXA_DECODER 0
%define CONFIG_DXTORY_DECODER 0
+%define CONFIG_DXV_DECODER 0
%define CONFIG_EACMV_DECODER 0
%define CONFIG_EAMAD_DECODER 0
%define CONFIG_EATGQ_DECODER 0
@@ -649,7 +681,9 @@
%define CONFIG_H264_QSV_DECODER 0
%define CONFIG_H264_VDA_DECODER 0
%define CONFIG_H264_VDPAU_DECODER 0
+%define CONFIG_HAP_DECODER 0
%define CONFIG_HEVC_DECODER 0
+%define CONFIG_HEVC_QSV_DECODER 0
%define CONFIG_HNM4_VIDEO_DECODER 0
%define CONFIG_HQ_HQA_DECODER 0
%define CONFIG_HQX_DECODER 0
@@ -685,6 +719,7 @@
%define CONFIG_MPEG_VDPAU_DECODER 0
%define CONFIG_MPEG1_VDPAU_DECODER 0
%define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+%define CONFIG_MPEG2_QSV_DECODER 0
%define CONFIG_MSA1_DECODER 0
%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
%define CONFIG_MSMPEG4V1_DECODER 0
@@ -763,6 +798,7 @@
%define CONFIG_VC1_CRYSTALHD_DECODER 0
%define CONFIG_VC1_VDPAU_DECODER 0
%define CONFIG_VC1IMAGE_DECODER 0
+%define CONFIG_VC1_QSV_DECODER 0
%define CONFIG_VCR1_DECODER 0
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
@@ -797,6 +833,7 @@
%define CONFIG_ZLIB_DECODER 0
%define CONFIG_ZMBV_DECODER 0
%define CONFIG_AAC_DECODER 0
+%define CONFIG_AAC_FIXED_DECODER 0
%define CONFIG_AAC_LATM_DECODER 0
%define CONFIG_AC3_DECODER 0
%define CONFIG_AC3_FIXED_DECODER 0
@@ -939,10 +976,10 @@
%define CONFIG_ADPCM_SBPRO_4_DECODER 0
%define CONFIG_ADPCM_SWF_DECODER 0
%define CONFIG_ADPCM_THP_DECODER 0
+%define CONFIG_ADPCM_THP_LE_DECODER 0
%define CONFIG_ADPCM_VIMA_DECODER 0
%define CONFIG_ADPCM_XA_DECODER 0
%define CONFIG_ADPCM_YAMAHA_DECODER 0
-%define CONFIG_VIMA_DECODER 0
%define CONFIG_SSA_DECODER 0
%define CONFIG_ASS_DECODER 0
%define CONFIG_CCAPTION_DECODER 0
@@ -986,6 +1023,7 @@
%define CONFIG_BINTEXT_DECODER 0
%define CONFIG_XBIN_DECODER 0
%define CONFIG_IDF_DECODER 0
+%define CONFIG_AA_DEMUXER 0
%define CONFIG_AAC_DEMUXER 0
%define CONFIG_AC3_DEMUXER 0
%define CONFIG_ACT_DEMUXER 0
@@ -1002,6 +1040,7 @@
%define CONFIG_APNG_DEMUXER 0
%define CONFIG_AQTITLE_DEMUXER 0
%define CONFIG_ASF_DEMUXER 0
+%define CONFIG_ASF_O_DEMUXER 0
%define CONFIG_ASS_DEMUXER 0
%define CONFIG_AST_DEMUXER 0
%define CONFIG_AU_DEMUXER 0
@@ -1212,6 +1251,7 @@
%define CONFIG_YOP_DEMUXER 0
%define CONFIG_YUV4MPEGPIPE_DEMUXER 0
%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1254,6 +1294,7 @@
%define CONFIG_H261_ENCODER 0
%define CONFIG_H263_ENCODER 0
%define CONFIG_H263P_ENCODER 0
+%define CONFIG_HAP_ENCODER 0
%define CONFIG_HUFFYUV_ENCODER 0
%define CONFIG_JPEG2000_ENCODER 0
%define CONFIG_JPEGLS_ENCODER 0
@@ -1389,6 +1430,7 @@
%define CONFIG_LIBWAVPACK_ENCODER 0
%define CONFIG_LIBWEBP_ANIM_ENCODER 0
%define CONFIG_LIBWEBP_ENCODER 0
+%define CONFIG_LIBX262_ENCODER 0
%define CONFIG_LIBX264_ENCODER 0
%define CONFIG_LIBX264RGB_ENCODER 0
%define CONFIG_LIBX265_ENCODER 0
@@ -1400,12 +1442,17 @@
%define CONFIG_NVENC_ENCODER 0
%define CONFIG_NVENC_H264_ENCODER 0
%define CONFIG_NVENC_HEVC_ENCODER 0
+%define CONFIG_HEVC_QSV_ENCODER 0
+%define CONFIG_LIBKVAZAAR_ENCODER 0
+%define CONFIG_MPEG2_QSV_ENCODER 0
+%define CONFIG_ACROSSFADE_FILTER 0
%define CONFIG_ADELAY_FILTER 0
%define CONFIG_AECHO_FILTER 0
%define CONFIG_AEVAL_FILTER 0
%define CONFIG_AFADE_FILTER 0
%define CONFIG_AFORMAT_FILTER 0
%define CONFIG_AINTERLEAVE_FILTER 0
+%define CONFIG_ALIMITER_FILTER 0
%define CONFIG_ALLPASS_FILTER 0
%define CONFIG_AMERGE_FILTER 0
%define CONFIG_AMIX_FILTER 0
@@ -1414,6 +1461,7 @@
%define CONFIG_APERMS_FILTER 0
%define CONFIG_APHASER_FILTER 0
%define CONFIG_ARESAMPLE_FILTER 0
+%define CONFIG_AREVERSE_FILTER 0
%define CONFIG_ASELECT_FILTER 0
%define CONFIG_ASENDCMD_FILTER 0
%define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1438,9 +1486,11 @@
%define CONFIG_CHORUS_FILTER 0
%define CONFIG_COMPAND_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
%define CONFIG_EBUR128_FILTER 0
%define CONFIG_EQUALIZER_FILTER 0
+%define CONFIG_EXTRASTEREO_FILTER 0
%define CONFIG_FLANGER_FILTER 0
%define CONFIG_HIGHPASS_FILTER 0
%define CONFIG_JOIN_FILTER 0
@@ -1449,6 +1499,7 @@
%define CONFIG_PAN_FILTER 0
%define CONFIG_REPLAYGAIN_FILTER 0
%define CONFIG_RESAMPLE_FILTER 0
+%define CONFIG_SIDECHAINCOMPRESS_FILTER 0
%define CONFIG_SILENCEDETECT_FILTER 0
%define CONFIG_SILENCEREMOVE_FILTER 0
%define CONFIG_TREBLE_FILTER 0
@@ -1461,6 +1512,7 @@
%define CONFIG_ANULLSINK_FILTER 0
%define CONFIG_ALPHAEXTRACT_FILTER 0
%define CONFIG_ALPHAMERGE_FILTER 0
+%define CONFIG_ATADENOISE_FILTER 0
%define CONFIG_ASS_FILTER 0
%define CONFIG_BBOX_FILTER 0
%define CONFIG_BLACKDETECT_FILTER 0
@@ -1479,17 +1531,22 @@
%define CONFIG_CROPDETECT_FILTER 0
%define CONFIG_CURVES_FILTER 0
%define CONFIG_DCTDNOIZ_FILTER 0
+%define CONFIG_DEBAND_FILTER 0
%define CONFIG_DECIMATE_FILTER 0
+%define CONFIG_DEFLATE_FILTER 0
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
+%define CONFIG_DILATION_FILTER 0
%define CONFIG_DRAWBOX_FILTER 0
+%define CONFIG_DRAWGRAPH_FILTER 0
%define CONFIG_DRAWGRID_FILTER 0
%define CONFIG_DRAWTEXT_FILTER 0
%define CONFIG_EDGEDETECT_FILTER 0
%define CONFIG_ELBG_FILTER 0
%define CONFIG_EQ_FILTER 0
+%define CONFIG_EROSION_FILTER 0
%define CONFIG_EXTRACTPLANES_FILTER 0
%define CONFIG_FADE_FILTER 0
%define CONFIG_FFTFILT_FILTER 0
@@ -1500,6 +1557,7 @@
%define CONFIG_FORMAT_FILTER 0
%define CONFIG_FPS_FILTER 0
%define CONFIG_FRAMEPACK_FILTER 0
+%define CONFIG_FRAMERATE_FILTER 0
%define CONFIG_FRAMESTEP_FILTER 0
%define CONFIG_FREI0R_FILTER 0
%define CONFIG_FSPP_FILTER 0
@@ -1511,9 +1569,11 @@
%define CONFIG_HISTOGRAM_FILTER 0
%define CONFIG_HQDN3D_FILTER 0
%define CONFIG_HQX_FILTER 0
+%define CONFIG_HSTACK_FILTER 0
%define CONFIG_HUE_FILTER 0
%define CONFIG_IDET_FILTER 0
%define CONFIG_IL_FILTER 0
+%define CONFIG_INFLATE_FILTER 0
%define CONFIG_INTERLACE_FILTER 0
%define CONFIG_INTERLEAVE_FILTER 0
%define CONFIG_KERNDEINT_FILTER 0
@@ -1529,6 +1589,7 @@
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
%define CONFIG_NULL_FILTER 0
+%define CONFIG_OCR_FILTER 0
%define CONFIG_OCV_FILTER 0
%define CONFIG_OVERLAY_FILTER 0
%define CONFIG_OWDENOISE_FILTER 0
@@ -1544,11 +1605,15 @@
%define CONFIG_PSNR_FILTER 0
%define CONFIG_PULLUP_FILTER 0
%define CONFIG_QP_FILTER 0
+%define CONFIG_RANDOM_FILTER 0
+%define CONFIG_REMOVEGRAIN_FILTER 0
%define CONFIG_REMOVELOGO_FILTER 0
%define CONFIG_REPEATFIELDS_FILTER 0
+%define CONFIG_REVERSE_FILTER 0
%define CONFIG_ROTATE_FILTER 0
%define CONFIG_SAB_FILTER 0
%define CONFIG_SCALE_FILTER 0
+%define CONFIG_SCALE2REF_FILTER 0
%define CONFIG_SELECT_FILTER 0
%define CONFIG_SENDCMD_FILTER 0
%define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1564,6 +1629,7 @@
%define CONFIG_SMARTBLUR_FILTER 0
%define CONFIG_SPLIT_FILTER 0
%define CONFIG_SPP_FILTER 0
+%define CONFIG_SSIM_FILTER 0
%define CONFIG_STEREO3D_FILTER 0
%define CONFIG_SUBTITLES_FILTER 0
%define CONFIG_SUPER2XSAI_FILTER 0
@@ -1577,15 +1643,20 @@
%define CONFIG_TRIM_FILTER 0
%define CONFIG_UNSHARP_FILTER 0
%define CONFIG_USPP_FILTER 0
+%define CONFIG_VECTORSCOPE_FILTER 0
%define CONFIG_VFLIP_FILTER 0
%define CONFIG_VIDSTABDETECT_FILTER 0
%define CONFIG_VIDSTABTRANSFORM_FILTER 0
%define CONFIG_VIGNETTE_FILTER 0
+%define CONFIG_VSTACK_FILTER 0
%define CONFIG_W3FDIF_FILTER 0
+%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_XBR_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_ZMQ_FILTER 0
%define CONFIG_ZOOMPAN_FILTER 0
+%define CONFIG_ALLRGB_FILTER 0
+%define CONFIG_ALLYUV_FILTER 0
%define CONFIG_CELLAUTO_FILTER 0
%define CONFIG_COLOR_FILTER 0
%define CONFIG_FREI0R_SRC_FILTER 0
@@ -1599,16 +1670,21 @@
%define CONFIG_SMPTEHDBARS_FILTER 0
%define CONFIG_TESTSRC_FILTER 0
%define CONFIG_NULLSINK_FILTER 0
+%define CONFIG_ADRAWGRAPH_FILTER 0
+%define CONFIG_APHASEMETER_FILTER 0
%define CONFIG_AVECTORSCOPE_FILTER 0
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
+%define CONFIG_SHOWFREQS_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
+%define CONFIG_SHOWVOLUME_FILTER 0
%define CONFIG_SHOWWAVES_FILTER 0
%define CONFIG_SHOWWAVESPIC_FILTER 0
%define CONFIG_AMOVIE_FILTER 0
%define CONFIG_MOVIE_FILTER 0
%define CONFIG_H263_VAAPI_HWACCEL 0
%define CONFIG_H263_VDPAU_HWACCEL 0
+%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_H264_D3D11VA_HWACCEL 0
%define CONFIG_H264_DXVA2_HWACCEL 0
%define CONFIG_H264_MMAL_HWACCEL 0
@@ -1617,21 +1693,30 @@
%define CONFIG_H264_VDA_HWACCEL 0
%define CONFIG_H264_VDA_OLD_HWACCEL 0
%define CONFIG_H264_VDPAU_HWACCEL 0
+%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_HEVC_D3D11VA_HWACCEL 0
%define CONFIG_HEVC_DXVA2_HWACCEL 0
+%define CONFIG_HEVC_QSV_HWACCEL 0
+%define CONFIG_HEVC_VAAPI_HWACCEL 0
+%define CONFIG_HEVC_VDPAU_HWACCEL 0
%define CONFIG_MPEG1_XVMC_HWACCEL 0
%define CONFIG_MPEG1_VDPAU_HWACCEL 0
+%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG2_XVMC_HWACCEL 0
%define CONFIG_MPEG2_D3D11VA_HWACCEL 0
%define CONFIG_MPEG2_DXVA2_HWACCEL 0
+%define CONFIG_MPEG2_QSV_HWACCEL 0
%define CONFIG_MPEG2_VAAPI_HWACCEL 0
%define CONFIG_MPEG2_VDPAU_HWACCEL 0
+%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_MPEG4_VAAPI_HWACCEL 0
%define CONFIG_MPEG4_VDPAU_HWACCEL 0
+%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
%define CONFIG_VC1_D3D11VA_HWACCEL 0
%define CONFIG_VC1_DXVA2_HWACCEL 0
%define CONFIG_VC1_VAAPI_HWACCEL 0
%define CONFIG_VC1_VDPAU_HWACCEL 0
+%define CONFIG_VC1_QSV_HWACCEL 0
%define CONFIG_WMV3_D3D11VA_HWACCEL 0
%define CONFIG_WMV3_DXVA2_HWACCEL 0
%define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1828,6 +1913,7 @@
%define CONFIG_DVDSUB_PARSER 0
%define CONFIG_DVD_NAV_PARSER 0
%define CONFIG_FLAC_PARSER 1
+%define CONFIG_G729_PARSER 0
%define CONFIG_GSM_PARSER 0
%define CONFIG_H261_PARSER 0
%define CONFIG_H263_PARSER 0
@@ -1849,6 +1935,7 @@
%define CONFIG_VP3_PARSER 1
%define CONFIG_VP8_PARSER 1
%define CONFIG_VP9_PARSER 0
+%define CONFIG_ASYNC_PROTOCOL 0
%define CONFIG_BLURAY_PROTOCOL 0
%define CONFIG_CACHE_PROTOCOL 0
%define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
index 1608b601d0f..41ed9c17f2b 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/config.h
@@ -76,7 +76,9 @@
#define HAVE_MIPSDSPR1 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
-#define HAVE_LOONGSON3 0
+#define HAVE_LOONGSON2 1
+#define HAVE_LOONGSON3 1
+#define HAVE_MMI 0
#define HAVE_ARMV5TE_EXTERNAL 0
#define HAVE_ARMV6_EXTERNAL 0
#define HAVE_ARMV6T2_EXTERNAL 0
@@ -115,7 +117,9 @@
#define HAVE_MIPSDSPR1_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
+#define HAVE_MMI_EXTERNAL 0
#define HAVE_ARMV5TE_INLINE 0
#define HAVE_ARMV6_INLINE 0
#define HAVE_ARMV6T2_INLINE 0
@@ -154,7 +158,9 @@
#define HAVE_MIPSDSPR1_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
+#define HAVE_MMI_INLINE 0
#define HAVE_ALIGNED_STACK 1
#define HAVE_FAST_64BIT 1
#define HAVE_FAST_CLZ 1
@@ -192,6 +198,7 @@
#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0
#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0
#define HAVE_DIRECT_H 0
+#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1
#define HAVE_D3D11_H 0
#define HAVE_DXVA_H 0
@@ -226,7 +233,9 @@
#define HAVE_ATAN2F 1
#define HAVE_CBRT 1
#define HAVE_CBRTF 1
+#define HAVE_COPYSIGN 1
#define HAVE_COSF 1
+#define HAVE_ERF 1
#define HAVE_EXP2 1
#define HAVE_EXP2F 1
#define HAVE_EXPF 1
@@ -276,6 +285,7 @@
#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0
#define HAVE_KBHIT 0
#define HAVE_LOCALTIME_R 1
+#define HAVE_LSTAT 1
#define HAVE_LZO1X_999_COMPRESS 0
#define HAVE_MACH_ABSOLUTE_TIME 0
#define HAVE_MAPVIEWOFFILE 0
@@ -289,6 +299,7 @@
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_SCHED_GETAFFINITY 1
#define HAVE_SETCONSOLETEXTATTRIBUTE 0
+#define HAVE_SETCONSOLECTRLHANDLER 0
#define HAVE_SETMODE 0
#define HAVE_SETRLIMIT 1
#define HAVE_SLEEP 0
@@ -325,6 +336,7 @@
#define HAVE_CONDITION_VARIABLE_PTR 0
#define HAVE_SOCKLEN_T 0
#define HAVE_STRUCT_ADDRINFO 0
+#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0
#define HAVE_STRUCT_GROUP_SOURCE_REQ 0
#define HAVE_STRUCT_IP_MREQ_SOURCE 0
#define HAVE_STRUCT_IPV6_MREQ 0
@@ -371,7 +383,7 @@
#define CONFIG_PODPAGES 0
#define CONFIG_TXTPAGES 0
#define CONFIG_AVIO_READING_EXAMPLE 1
-#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
+#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
#define CONFIG_DECODING_ENCODING_EXAMPLE 1
#define CONFIG_DEMUXING_DECODING_EXAMPLE 1
#define CONFIG_EXTRACT_MVS_EXAMPLE 1
@@ -413,6 +425,7 @@
#define CONFIG_LIBGSM 0
#define CONFIG_LIBIEC61883 0
#define CONFIG_LIBILBC 0
+#define CONFIG_LIBKVAZAAR 0
#define CONFIG_LIBMFX 0
#define CONFIG_LIBMODPLUG 0
#define CONFIG_LIBMP3LAME 0
@@ -429,10 +442,12 @@
#define CONFIG_LIBSCHROEDINGER 0
#define CONFIG_LIBSHINE 0
#define CONFIG_LIBSMBCLIENT 0
+#define CONFIG_LIBSNAPPY 0
#define CONFIG_LIBSOXR 0
#define CONFIG_LIBSPEEX 0
#define CONFIG_LIBSSH 0
#define CONFIG_LIBSTAGEFRIGHT_H264 0
+#define CONFIG_LIBTESSERACT 0
#define CONFIG_LIBTHEORA 0
#define CONFIG_LIBTWOLAME 0
#define CONFIG_LIBUTVIDEO 0
@@ -480,6 +495,7 @@
#define CONFIG_VAAPI 0
#define CONFIG_VDA 0
#define CONFIG_VDPAU 0
+#define CONFIG_VIDEOTOOLBOX 0
#define CONFIG_XVMC 0
#define CONFIG_GPL 0
#define CONFIG_NONFREE 0
@@ -532,8 +548,10 @@
#define CONFIG_FAANDCT 0
#define CONFIG_FAANIDCT 0
#define CONFIG_FDCTDSP 0
+#define CONFIG_FLACDSP 1
#define CONFIG_FMTCONVERT 0
#define CONFIG_FRAME_THREAD_ENCODER 0
+#define CONFIG_G722DSP 0
#define CONFIG_GCRYPT 0
#define CONFIG_GMP 0
#define CONFIG_GOLOMB 1
@@ -551,17 +569,21 @@
#define CONFIG_IIRFILTER 0
#define CONFIG_IMDCT15 0
#define CONFIG_INTRAX8 0
+#define CONFIG_IVIDSP 0
#define CONFIG_JPEGTABLES 0
+#define CONFIG_LIBX262 0
#define CONFIG_LGPLV3 0
#define CONFIG_LLAUDDSP 0
#define CONFIG_LLVIDDSP 0
#define CONFIG_LPC 0
+#define CONFIG_LZF 0
#define CONFIG_ME_CMP 0
#define CONFIG_MPEG_ER 0
#define CONFIG_MPEGAUDIO 0
#define CONFIG_MPEGAUDIODSP 0
#define CONFIG_MPEGVIDEO 0
#define CONFIG_MPEGVIDEOENC 0
+#define CONFIG_MSS34DSP 0
#define CONFIG_PIXBLOCKDSP 0
#define CONFIG_QPELDSP 0
#define CONFIG_QSV 0
@@ -572,16 +594,24 @@
#define CONFIG_RIFFENC 0
#define CONFIG_RTPDEC 0
#define CONFIG_RTPENC_CHAIN 0
+#define CONFIG_RV34DSP 0
#define CONFIG_SINEWIN 0
+#define CONFIG_SNAPPY 0
#define CONFIG_STARTCODE 0
+#define CONFIG_TEXTUREDSP 0
+#define CONFIG_TEXTUREDSPENC 0
#define CONFIG_TPELDSP 0
#define CONFIG_VIDEODSP 1
#define CONFIG_VP3DSP 1
+#define CONFIG_VP56DSP 0
+#define CONFIG_VP8DSP 1
#define CONFIG_WMA_FREQS 0
+#define CONFIG_WMV2DSP 0
#define CONFIG_AAC_ADTSTOASC_BSF 0
#define CONFIG_CHOMP_BSF 0
#define CONFIG_DUMP_EXTRADATA_BSF 0
#define CONFIG_H264_MP4TOANNEXB_BSF 0
+#define CONFIG_HEVC_MP4TOANNEXB_BSF 0
#define CONFIG_IMX_DUMP_HEADER_BSF 0
#define CONFIG_MJPEG2JPEG_BSF 0
#define CONFIG_MJPEGA_DUMP_HEADER_BSF 0
@@ -624,6 +654,7 @@
#define CONFIG_CPIA_DECODER 0
#define CONFIG_CSCD_DECODER 0
#define CONFIG_CYUV_DECODER 0
+#define CONFIG_DDS_DECODER 0
#define CONFIG_DFA_DECODER 0
#define CONFIG_DIRAC_DECODER 0
#define CONFIG_DNXHD_DECODER 0
@@ -632,6 +663,7 @@
#define CONFIG_DVVIDEO_DECODER 0
#define CONFIG_DXA_DECODER 0
#define CONFIG_DXTORY_DECODER 0
+#define CONFIG_DXV_DECODER 0
#define CONFIG_EACMV_DECODER 0
#define CONFIG_EAMAD_DECODER 0
#define CONFIG_EATGQ_DECODER 0
@@ -665,7 +697,9 @@
#define CONFIG_H264_QSV_DECODER 0
#define CONFIG_H264_VDA_DECODER 0
#define CONFIG_H264_VDPAU_DECODER 0
+#define CONFIG_HAP_DECODER 0
#define CONFIG_HEVC_DECODER 0
+#define CONFIG_HEVC_QSV_DECODER 0
#define CONFIG_HNM4_VIDEO_DECODER 0
#define CONFIG_HQ_HQA_DECODER 0
#define CONFIG_HQX_DECODER 0
@@ -701,6 +735,7 @@
#define CONFIG_MPEG_VDPAU_DECODER 0
#define CONFIG_MPEG1_VDPAU_DECODER 0
#define CONFIG_MPEG2_CRYSTALHD_DECODER 0
+#define CONFIG_MPEG2_QSV_DECODER 0
#define CONFIG_MSA1_DECODER 0
#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0
#define CONFIG_MSMPEG4V1_DECODER 0
@@ -779,6 +814,7 @@
#define CONFIG_VC1_CRYSTALHD_DECODER 0
#define CONFIG_VC1_VDPAU_DECODER 0
#define CONFIG_VC1IMAGE_DECODER 0
+#define CONFIG_VC1_QSV_DECODER 0
#define CONFIG_VCR1_DECODER 0
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
@@ -813,6 +849,7 @@
#define CONFIG_ZLIB_DECODER 0
#define CONFIG_ZMBV_DECODER 0
#define CONFIG_AAC_DECODER 0
+#define CONFIG_AAC_FIXED_DECODER 0
#define CONFIG_AAC_LATM_DECODER 0
#define CONFIG_AC3_DECODER 0
#define CONFIG_AC3_FIXED_DECODER 0
@@ -955,10 +992,10 @@
#define CONFIG_ADPCM_SBPRO_4_DECODER 0
#define CONFIG_ADPCM_SWF_DECODER 0
#define CONFIG_ADPCM_THP_DECODER 0
+#define CONFIG_ADPCM_THP_LE_DECODER 0
#define CONFIG_ADPCM_VIMA_DECODER 0
#define CONFIG_ADPCM_XA_DECODER 0
#define CONFIG_ADPCM_YAMAHA_DECODER 0
-#define CONFIG_VIMA_DECODER 0
#define CONFIG_SSA_DECODER 0
#define CONFIG_ASS_DECODER 0
#define CONFIG_CCAPTION_DECODER 0
@@ -1002,6 +1039,7 @@
#define CONFIG_BINTEXT_DECODER 0
#define CONFIG_XBIN_DECODER 0
#define CONFIG_IDF_DECODER 0
+#define CONFIG_AA_DEMUXER 0
#define CONFIG_AAC_DEMUXER 0
#define CONFIG_AC3_DEMUXER 0
#define CONFIG_ACT_DEMUXER 0
@@ -1018,6 +1056,7 @@
#define CONFIG_APNG_DEMUXER 0
#define CONFIG_AQTITLE_DEMUXER 0
#define CONFIG_ASF_DEMUXER 0
+#define CONFIG_ASF_O_DEMUXER 0
#define CONFIG_ASS_DEMUXER 0
#define CONFIG_AST_DEMUXER 0
#define CONFIG_AU_DEMUXER 0
@@ -1228,6 +1267,7 @@
#define CONFIG_YOP_DEMUXER 0
#define CONFIG_YUV4MPEGPIPE_DEMUXER 0
#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 0
+#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 0
#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 0
#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0
#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0
@@ -1270,6 +1310,7 @@
#define CONFIG_H261_ENCODER 0
#define CONFIG_H263_ENCODER 0
#define CONFIG_H263P_ENCODER 0
+#define CONFIG_HAP_ENCODER 0
#define CONFIG_HUFFYUV_ENCODER 0
#define CONFIG_JPEG2000_ENCODER 0
#define CONFIG_JPEGLS_ENCODER 0
@@ -1405,6 +1446,7 @@
#define CONFIG_LIBWAVPACK_ENCODER 0
#define CONFIG_LIBWEBP_ANIM_ENCODER 0
#define CONFIG_LIBWEBP_ENCODER 0
+#define CONFIG_LIBX262_ENCODER 0
#define CONFIG_LIBX264_ENCODER 0
#define CONFIG_LIBX264RGB_ENCODER 0
#define CONFIG_LIBX265_ENCODER 0
@@ -1416,12 +1458,17 @@
#define CONFIG_NVENC_ENCODER 0
#define CONFIG_NVENC_H264_ENCODER 0
#define CONFIG_NVENC_HEVC_ENCODER 0
+#define CONFIG_HEVC_QSV_ENCODER 0
+#define CONFIG_LIBKVAZAAR_ENCODER 0
+#define CONFIG_MPEG2_QSV_ENCODER 0
+#define CONFIG_ACROSSFADE_FILTER 0
#define CONFIG_ADELAY_FILTER 0
#define CONFIG_AECHO_FILTER 0
#define CONFIG_AEVAL_FILTER 0
#define CONFIG_AFADE_FILTER 0
#define CONFIG_AFORMAT_FILTER 0
#define CONFIG_AINTERLEAVE_FILTER 0
+#define CONFIG_ALIMITER_FILTER 0
#define CONFIG_ALLPASS_FILTER 0
#define CONFIG_AMERGE_FILTER 0
#define CONFIG_AMIX_FILTER 0
@@ -1430,6 +1477,7 @@
#define CONFIG_APERMS_FILTER 0
#define CONFIG_APHASER_FILTER 0
#define CONFIG_ARESAMPLE_FILTER 0
+#define CONFIG_AREVERSE_FILTER 0
#define CONFIG_ASELECT_FILTER 0
#define CONFIG_ASENDCMD_FILTER 0
#define CONFIG_ASETNSAMPLES_FILTER 0
@@ -1454,9 +1502,11 @@
#define CONFIG_CHORUS_FILTER 0
#define CONFIG_COMPAND_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
#define CONFIG_EBUR128_FILTER 0
#define CONFIG_EQUALIZER_FILTER 0
+#define CONFIG_EXTRASTEREO_FILTER 0
#define CONFIG_FLANGER_FILTER 0
#define CONFIG_HIGHPASS_FILTER 0
#define CONFIG_JOIN_FILTER 0
@@ -1465,6 +1515,7 @@
#define CONFIG_PAN_FILTER 0
#define CONFIG_REPLAYGAIN_FILTER 0
#define CONFIG_RESAMPLE_FILTER 0
+#define CONFIG_SIDECHAINCOMPRESS_FILTER 0
#define CONFIG_SILENCEDETECT_FILTER 0
#define CONFIG_SILENCEREMOVE_FILTER 0
#define CONFIG_TREBLE_FILTER 0
@@ -1477,6 +1528,7 @@
#define CONFIG_ANULLSINK_FILTER 0
#define CONFIG_ALPHAEXTRACT_FILTER 0
#define CONFIG_ALPHAMERGE_FILTER 0
+#define CONFIG_ATADENOISE_FILTER 0
#define CONFIG_ASS_FILTER 0
#define CONFIG_BBOX_FILTER 0
#define CONFIG_BLACKDETECT_FILTER 0
@@ -1495,17 +1547,22 @@
#define CONFIG_CROPDETECT_FILTER 0
#define CONFIG_CURVES_FILTER 0
#define CONFIG_DCTDNOIZ_FILTER 0
+#define CONFIG_DEBAND_FILTER 0
#define CONFIG_DECIMATE_FILTER 0
+#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
+#define CONFIG_DILATION_FILTER 0
#define CONFIG_DRAWBOX_FILTER 0
+#define CONFIG_DRAWGRAPH_FILTER 0
#define CONFIG_DRAWGRID_FILTER 0
#define CONFIG_DRAWTEXT_FILTER 0
#define CONFIG_EDGEDETECT_FILTER 0
#define CONFIG_ELBG_FILTER 0
#define CONFIG_EQ_FILTER 0
+#define CONFIG_EROSION_FILTER 0
#define CONFIG_EXTRACTPLANES_FILTER 0
#define CONFIG_FADE_FILTER 0
#define CONFIG_FFTFILT_FILTER 0
@@ -1516,6 +1573,7 @@
#define CONFIG_FORMAT_FILTER 0
#define CONFIG_FPS_FILTER 0
#define CONFIG_FRAMEPACK_FILTER 0
+#define CONFIG_FRAMERATE_FILTER 0
#define CONFIG_FRAMESTEP_FILTER 0
#define CONFIG_FREI0R_FILTER 0
#define CONFIG_FSPP_FILTER 0
@@ -1527,9 +1585,11 @@
#define CONFIG_HISTOGRAM_FILTER 0
#define CONFIG_HQDN3D_FILTER 0
#define CONFIG_HQX_FILTER 0
+#define CONFIG_HSTACK_FILTER 0
#define CONFIG_HUE_FILTER 0
#define CONFIG_IDET_FILTER 0
#define CONFIG_IL_FILTER 0
+#define CONFIG_INFLATE_FILTER 0
#define CONFIG_INTERLACE_FILTER 0
#define CONFIG_INTERLEAVE_FILTER 0
#define CONFIG_KERNDEINT_FILTER 0
@@ -1545,6 +1605,7 @@
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
#define CONFIG_NULL_FILTER 0
+#define CONFIG_OCR_FILTER 0
#define CONFIG_OCV_FILTER 0
#define CONFIG_OVERLAY_FILTER 0
#define CONFIG_OWDENOISE_FILTER 0
@@ -1560,11 +1621,15 @@
#define CONFIG_PSNR_FILTER 0
#define CONFIG_PULLUP_FILTER 0
#define CONFIG_QP_FILTER 0
+#define CONFIG_RANDOM_FILTER 0
+#define CONFIG_REMOVEGRAIN_FILTER 0
#define CONFIG_REMOVELOGO_FILTER 0
#define CONFIG_REPEATFIELDS_FILTER 0
+#define CONFIG_REVERSE_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
+#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SELECT_FILTER 0
#define CONFIG_SENDCMD_FILTER 0
#define CONFIG_SEPARATEFIELDS_FILTER 0
@@ -1580,6 +1645,7 @@
#define CONFIG_SMARTBLUR_FILTER 0
#define CONFIG_SPLIT_FILTER 0
#define CONFIG_SPP_FILTER 0
+#define CONFIG_SSIM_FILTER 0
#define CONFIG_STEREO3D_FILTER 0
#define CONFIG_SUBTITLES_FILTER 0
#define CONFIG_SUPER2XSAI_FILTER 0
@@ -1593,15 +1659,20 @@
#define CONFIG_TRIM_FILTER 0
#define CONFIG_UNSHARP_FILTER 0
#define CONFIG_USPP_FILTER 0
+#define CONFIG_VECTORSCOPE_FILTER 0
#define CONFIG_VFLIP_FILTER 0
#define CONFIG_VIDSTABDETECT_FILTER 0
#define CONFIG_VIDSTABTRANSFORM_FILTER 0
#define CONFIG_VIGNETTE_FILTER 0
+#define CONFIG_VSTACK_FILTER 0
#define CONFIG_W3FDIF_FILTER 0
+#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_XBR_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_ZMQ_FILTER 0
#define CONFIG_ZOOMPAN_FILTER 0
+#define CONFIG_ALLRGB_FILTER 0
+#define CONFIG_ALLYUV_FILTER 0
#define CONFIG_CELLAUTO_FILTER 0
#define CONFIG_COLOR_FILTER 0
#define CONFIG_FREI0R_SRC_FILTER 0
@@ -1615,16 +1686,21 @@
#define CONFIG_SMPTEHDBARS_FILTER 0
#define CONFIG_TESTSRC_FILTER 0
#define CONFIG_NULLSINK_FILTER 0
+#define CONFIG_ADRAWGRAPH_FILTER 0
+#define CONFIG_APHASEMETER_FILTER 0
#define CONFIG_AVECTORSCOPE_FILTER 0
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
+#define CONFIG_SHOWFREQS_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
+#define CONFIG_SHOWVOLUME_FILTER 0
#define CONFIG_SHOWWAVES_FILTER 0
#define CONFIG_SHOWWAVESPIC_FILTER 0
#define CONFIG_AMOVIE_FILTER 0
#define CONFIG_MOVIE_FILTER 0
#define CONFIG_H263_VAAPI_HWACCEL 0
#define CONFIG_H263_VDPAU_HWACCEL 0
+#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_H264_D3D11VA_HWACCEL 0
#define CONFIG_H264_DXVA2_HWACCEL 0
#define CONFIG_H264_MMAL_HWACCEL 0
@@ -1633,21 +1709,30 @@
#define CONFIG_H264_VDA_HWACCEL 0
#define CONFIG_H264_VDA_OLD_HWACCEL 0
#define CONFIG_H264_VDPAU_HWACCEL 0
+#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_HEVC_D3D11VA_HWACCEL 0
#define CONFIG_HEVC_DXVA2_HWACCEL 0
+#define CONFIG_HEVC_QSV_HWACCEL 0
+#define CONFIG_HEVC_VAAPI_HWACCEL 0
+#define CONFIG_HEVC_VDPAU_HWACCEL 0
#define CONFIG_MPEG1_XVMC_HWACCEL 0
#define CONFIG_MPEG1_VDPAU_HWACCEL 0
+#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG2_XVMC_HWACCEL 0
#define CONFIG_MPEG2_D3D11VA_HWACCEL 0
#define CONFIG_MPEG2_DXVA2_HWACCEL 0
+#define CONFIG_MPEG2_QSV_HWACCEL 0
#define CONFIG_MPEG2_VAAPI_HWACCEL 0
#define CONFIG_MPEG2_VDPAU_HWACCEL 0
+#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_MPEG4_VAAPI_HWACCEL 0
#define CONFIG_MPEG4_VDPAU_HWACCEL 0
+#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0
#define CONFIG_VC1_D3D11VA_HWACCEL 0
#define CONFIG_VC1_DXVA2_HWACCEL 0
#define CONFIG_VC1_VAAPI_HWACCEL 0
#define CONFIG_VC1_VDPAU_HWACCEL 0
+#define CONFIG_VC1_QSV_HWACCEL 0
#define CONFIG_WMV3_D3D11VA_HWACCEL 0
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
@@ -1844,6 +1929,7 @@
#define CONFIG_DVDSUB_PARSER 0
#define CONFIG_DVD_NAV_PARSER 0
#define CONFIG_FLAC_PARSER 1
+#define CONFIG_G729_PARSER 0
#define CONFIG_GSM_PARSER 0
#define CONFIG_H261_PARSER 0
#define CONFIG_H263_PARSER 0
@@ -1865,6 +1951,7 @@
#define CONFIG_VP3_PARSER 1
#define CONFIG_VP8_PARSER 1
#define CONFIG_VP9_PARSER 0
+#define CONFIG_ASYNC_PROTOCOL 0
#define CONFIG_BLURAY_PROTOCOL 0
#define CONFIG_CACHE_PROTOCOL 0
#define CONFIG_CONCAT_PROTOCOL 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/ffversion.h
index 01d8ff588cb..237b8391d13 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromiumOS/linux/x64/libavutil/ffversion.h
@@ -1,4 +1,4 @@
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-73434-ga1a5db5"
+#define FFMPEG_VERSION "N-75746-g91093a9"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/ffmpeg.sigs b/chromium/third_party/ffmpeg/chromium/ffmpeg.sigs
index 6003984fe0e..5278561e919 100755
--- a/chromium/third_party/ffmpeg/chromium/ffmpeg.sigs
+++ b/chromium/third_party/ffmpeg/chromium/ffmpeg.sigs
@@ -23,15 +23,15 @@ AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe);
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
int av_lockmgr_register(AVLockMgrOperation cb);
-void avcodec_get_frame_defaults(AVFrame *pic);
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
int av_packet_split_side_data(AVPacket *pkt);
uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size);
void av_frame_unref(AVFrame *frame);
void av_frame_free(AVFrame **frame);
-void avcodec_free_frame(AVFrame **frame);
AVFrame* av_frame_alloc();
int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
+const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
+const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
// RDFT functions.
RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
@@ -68,6 +68,7 @@ void av_log_set_callback(AVLogCallback callback);
void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl);
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix);
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
+void av_dict_free(AVDictionary **m);
AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align);
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
@@ -76,3 +77,4 @@ AVBufferRef *av_buffer_create(uint8_t *data, int size, AVFreeOperation free, voi
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align);
void *av_buffer_get_opaque(const AVBufferRef *buf);
int av_get_cpu_flags(void);
+void av_max_alloc(size_t max);
diff --git a/chromium/third_party/ffmpeg/chromium/patches/README b/chromium/third_party/ffmpeg/chromium/patches/README
index bb556903d02..2573f003ea5 100644
--- a/chromium/third_party/ffmpeg/chromium/patches/README
+++ b/chromium/third_party/ffmpeg/chromium/patches/README
@@ -38,10 +38,6 @@ Current patches:
Add call to matroska_read_close() to mitigate memory leak caught by
valgrind.
- Preserve AVCodecID enum in libavcodec/avcodec.h (http://crbug.com/241212)
- Insert AV_CODEC_ID_SNOW into the AVCodecID enum to avoid breaking
- histograms.
-
Fix pthreads emulation on Windows XP
Emulation assumes Vista+ inside (_WIN32_WINNT >= 0x0600) checks. Replace
with WINDOWS_XP_SUPPORT_NEEDED define in compat/w32pthreads.h.
@@ -56,16 +52,9 @@ Current patches:
Add spaces between string literals and tokens in libavutil/timer.h and
libavutil/internal.h.
- Check the return value of init_get_bits in libavformat/oggparsedirac.c.
- If it fails, the GetBitContext is invalid and mustn't be used.
-
- Change printf format specifier for enum from PRIu8 to %d in libavformat/mov.
-
Misc things that were not documented
Enable av_max_alloc(0) to remove alloc size bound in libavutil/mem.c.
- Misc changes in libavformat/mp3dec.c.
-
Add FF_DISABLE_DEPRECATION_WARNINGS/FF_ENABLE_DEPRECATION_WARNINGS pairs in
libavformat/mux.c.
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
index 20244e4baf1..3887c53bd87 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py
@@ -34,7 +34,7 @@ BRANDINGS = [
USAGE = """Usage: %prog TARGET_OS TARGET_ARCH [options] -- [configure_args]
-Valid combinations are android [ia32|x64|arm|arm64]
+Valid combinations are android [ia32|x64|mipsel|arm|arm64]
linux [ia32|x64|mipsel|arm|arm-neon|arm64]
linux-noasm [x64]
mac [x64]
@@ -44,7 +44,6 @@ Platform specific build notes:
android:
Script can be run on a normal x64 Ubuntu box with an Android-ready Chromium
checkout: https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
- TODO(dalecurtis, watk): Figure out if anyone is using MIPS.
linux ia32/x64:
Script can run on a normal Ubuntu box.
@@ -176,6 +175,9 @@ def SetupAndroidToolchain(target_arch):
toolchain_level = api64_level
toolchain_dir_prefix = sysroot_arch = 'x86_64'
toolchain_bin_prefix = 'x86_64-linux-android'
+ elif target_arch == 'mipsel':
+ sysroot_arch = 'mips'
+ toolchain_bin_prefix = toolchain_dir_prefix = 'mipsel-linux-android'
sysroot = (NDK_ROOT_DIR + '/platforms/android-' + toolchain_level +
'/arch-' + sysroot_arch)
@@ -202,9 +204,9 @@ def BuildFFmpeg(target_os, target_arch, host_os, host_arch, parallel_jobs,
if target_os in (host_os, host_os + '-noasm', 'android') and not config_only:
libraries = [
- os.path.join('libavcodec', GetDsoName(target_os, 'avcodec', 56)),
- os.path.join('libavformat', GetDsoName(target_os, 'avformat', 56)),
- os.path.join('libavutil', GetDsoName(target_os, 'avutil', 54)),
+ os.path.join('libavcodec', GetDsoName(target_os, 'avcodec', 57)),
+ os.path.join('libavformat', GetDsoName(target_os, 'avformat', 57)),
+ os.path.join('libavutil', GetDsoName(target_os, 'avutil', 55)),
]
PrintAndCheckCall(
['make', '-j%d' % parallel_jobs] + libraries, cwd=config_dir)
@@ -310,6 +312,7 @@ def main(argv):
'--disable-vaapi',
'--disable-vda',
'--disable-vdpau',
+ '--disable-videotoolbox',
# Common codecs.
'--enable-decoder=vorbis',
@@ -415,20 +418,22 @@ def main(argv):
'--extra-cflags=-march=armv8-a',
])
elif target_arch == 'mipsel':
- if target_os == 'android':
- print('Error: MIPS support is not implemented for Android yet.',
- file=sys.stderr)
- return 1
-
+ if target_os != 'android':
+ configure_flags['Common'].extend([
+ '--enable-cross-compile',
+ '--cross-prefix=mipsel-cros-linux-gnu-',
+ '--target-os=linux',
+ '--extra-cflags=-EL',
+ '--extra-ldflags=-EL',
+ '--extra-ldflags=-mips32',
+ ])
+ else:
+ configure_flags['Common'].extend([
+ '--extra-cflags=-mhard-float',
+ ])
configure_flags['Common'].extend([
- '--enable-cross-compile',
- '--cross-prefix=/usr/bin/mipsel-cros-linux-gnu-',
- '--target-os=linux',
'--arch=mips',
'--extra-cflags=-mips32',
- '--extra-cflags=-EL',
- '--extra-ldflags=-mips32',
- '--extra-ldflags=-EL',
'--disable-mipsfpu',
'--disable-mipsdspr1',
'--disable-mipsdspr2',
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py
new file mode 100644
index 00000000000..f0fc4f0a516
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py
@@ -0,0 +1,360 @@
+#!/usr/bin/python
+#
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Updates the CREDITS.chromium file for ffmpeg.
+
+The structure of the output credits file is:
+- FFmpeg LICENSE.md verbatim
+- A few verbatim license headers from files that didn't match typical FFmpeg
+- The entire text of the LGPL
+
+The vast majority of files are covered by the LGPL text, described by the
+common FFmpeg header ("This file is part of FFmpeg...").
+
+The few exceptions are cases where the FFmpeg header has been modified, or
+where the file has historically had another license (e.g MIPS, JPEG, BSD) and
+was pulled into FFmpeg from another project. In some cases there are many files
+that share the exact same non-LGPL license text. These are bucketed together
+(see KNOWN_FILE_BUCKETS) to de-dup their license in the output file.
+
+Change to the licensing text for bucketed files are automatically caught by
+comparing the md5 digest to a previously recorded digest in the
+KNOWN_FILE_BUCKETS table. Changes are generally not expected, but should
+prompt manual inspection of the difference and possibly an update to the
+license text for that bucket.
+"""
+
+__author__ = 'chcunningham@chromium.org (Chris Cunningham)'
+
+import collections
+import difflib
+from enum import enum
+import hashlib
+import os
+import re
+
+# Name of the LICENSE.md file from upstream FFmpeg. This file should be kept in
+# perfect sync w/ upstream at each merge.
+UPSTREAM_LICENSEMD = 'LICENSE.md'
+
+# Default name of the output file generated by CreditsUpdater.WriteCredits. This
+# name must match the "License file: " in README.chromium.
+DEFAULT_OUTPUT_FILE = 'CREDITS.chromium'
+
+# Minimum similarity threshold to consider a comment header LGPL when compared
+# against FFMPEG_LGPL_REF.
+LGPL_MATCH_THRESHOLD = .9
+
+# Regular expressions for finding license header comments.
+C_COMMENT_BLOCK_START = re.compile('/\*+')
+C_COMMENT_BLOCK_MID = re.compile('^ *\* *')
+C_COMMENT_BLOCK_END = re.compile('\*/')
+ASM_COMMENT_PRE = re.compile('^(;\**|@)')
+ASM_NOT_COMMENT = re.compile('^[^;@]')
+FFMPEG_HEADER_START = re.compile(' *This file is part of FFmpeg')
+
+LICENSE_SEPARATOR = '\n\n' + ('*' * 80) + '\n\n'
+FFMPEG_LGPL_REF = '''
+ * 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
+ */'''
+
+# Known licenses
+License = enum('LGPL', 'MIPS', 'JPEG', 'OGG_MA_MR_2005')
+
+# Tuple describing license and similarity to the FFmpeg LGPL reference for a
+# given file. See KNOWN_FILE_BUCKETS.
+FileInfo = collections.namedtuple('FileInfo', 'license, license_digest')
+
+# Most files in FFmpeg are LGPL, but there are a few exceptions that are worth
+# bucketing together to avoid redundant license texts. The hex values are
+# digests of the comment header, used to detect changes in the unlikely event
+# that their license texts are altered. Any changes will require manual review
+# to decide whether the to update the bucketing.
+KNOWN_FILE_BUCKETS = [
+ # Files that are LGPL but just miss the similarity cutoff.
+ ['libavcodec/codec_desc.c', License.LGPL, '091f9c6d1efc62038e516f5c67263962'],
+ # Files with MIPS license.
+ ['libavcodec/mdct_fixed_32.c', License.MIPS, '179c17c9dab77f95dc6540709b5fb8cd'],
+ ['libavcodec/fft_fixed_32.c', License.MIPS, '179c17c9dab77f95dc6540709b5fb8cd'],
+ ['libavcodec/fft_init_table.c', License.MIPS, '179c17c9dab77f95dc6540709b5fb8cd'],
+ ['libavcodec/mips/aacdec_mips.c', License.MIPS, 'a08afe43d908fe6625603d0cbc95da46'],
+ ['libavcodec/mips/sbrdsp_mips.c', License.MIPS, 'c34ece06ebe27e5a7611ef362962b048'],
+ ['libavcodec/mips/aacpsdsp_mips.c', License.MIPS, 'a08afe43d908fe6625603d0cbc95da46'],
+ ['libavutil/mips/float_dsp_mips.c', License.MIPS, 'fb9f51968ec8289768547144b920cf79'],
+ ['libavcodec/mips/aacsbr_mips.c', License.MIPS, '82c53533b2576fe5d2c04880a46595f2'],
+ ['libavutil/fixed_dsp.c', License.MIPS, '7a521412ac91287b3e1026885f6bd56f'],
+ ['libavcodec/mips/aacdec_mips.h', License.MIPS, 'c34ece06ebe27e5a7611ef362962b048'],
+ ['libavcodec/mips/lsp_mips.h', License.MIPS, 'eef419f576f738e66ca3bfc975a37996'],
+ ['libavcodec/mips/aacsbr_mips.h', License.MIPS, '82c53533b2576fe5d2c04880a46595f2'],
+ ['libavutil/mips/libm_mips.h', License.MIPS, '4b408982f2aa83fac9c020c61853bdae'],
+ ['libavcodec/mips/amrwbdec_mips.h', License.MIPS, '4b408982f2aa83fac9c020c61853bdae'],
+ ['libavcodec/fft_table.h', License.MIPS, '179c17c9dab77f95dc6540709b5fb8cd'],
+ ['libavcodec/mips/compute_antialias_float.h', License.MIPS, 'a7ff7e3157e3726cba79e022628d3b93'],
+ ['libavcodec/mips/compute_antialias_fixed.h', License.MIPS, '97e366b4c71ad5ceca991d89044c414d'],
+ ['libavutil/softfloat_tables.h', License.MIPS, 'de3e5c962caa5c8249bef3085ef36bc8'],
+ ['libavutil/fixed_dsp.h', License.MIPS, '4b408982f2aa83fac9c020c61853bdae'],
+ # Files with JPEG Group license.
+ ['libavcodec/jfdctint_template.c', License.JPEG, 'd80cfd2e439eb700aed0f5bc44fef9b5'],
+ ['libavcodec/jfdctfst.c', License.JPEG, '7dcfa68ad9c8fd940fb404ee3242e03f'],
+ ['libavcodec/jrevdct.c', License.JPEG, 'a9b8f5dcb74fa76a72069306b841b042'],
+ # Files written by Ahlberg and RullgAYrd for parsing Ogg (MIT/X11 license).
+ ['libavformat/oggparseogm.c', License.OGG_MA_MR_2005, 'ee65196bafec5d8e871e64bb739bdc79'],
+ ['libavformat/oggdec.c', License.OGG_MA_MR_2005, '43ed5da1268cb2f104095c79410fd394'],
+ ['libavformat/oggdec.h', License.OGG_MA_MR_2005, 'ee65196bafec5d8e871e64bb739bdc79'],
+ ['libavformat/oggparsevorbis.c', License.OGG_MA_MR_2005, '6c432580b4486564e43cd538370e3dbc'],
+]
+
+# Path describing 'license_texts' folder as a sibling of this script's location.
+LICENSE_FOLDER = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), 'license_texts')
+
+# Files containing license text to be used for the known license buckets. These
+# files should all live in LICENSE_FOLDER.
+LICENSE_TEXTS = {
+ License.MIPS: os.path.join(LICENSE_FOLDER, 'mips.txt'),
+ License.JPEG: os.path.join(LICENSE_FOLDER, 'jpeg.txt'),
+ License.LGPL: os.path.join(LICENSE_FOLDER, 'full_lgpl.txt'),
+ License.OGG_MA_MR_2005: os.path.join(LICENSE_FOLDER,
+ 'oggparse_ahlberg_rullgayrd_2005.txt'),
+}
+
+
+class CreditsUpdater(object):
+ """CreditsUpdater parses license headers for files supplied via ProcessFile.
+ The parsed headers are stored for generating the FFmpeg credits file
+ (LICENSE.md) upon calling OutputCredits."""
+
+ def __init__(self, source_dir, output_file=DEFAULT_OUTPUT_FILE):
+ """ Creates a CreditsUpdater
+ Args:
+ source_dir: Root of ffmpeg sources; where LICENSE.md is found and where
+ the generated DEFAULT_OUTPUT_FILE will be written.
+ output_file: (Optional) Name of the file to write the credits to. File
+ will live in source_dir.
+ """
+ self.source_dir = source_dir
+ self.output_file = output_file
+ # Files where we failed to find any license header. Any entry in this list
+ # will block updating credits until the parsing code is amended to work for
+ # the difficult files.
+ self.difficult_files = []
+ # Map storing processed files that belong to KNOWN_FILE_BUCKETS.
+ # Key: LICENSE, Value: List of files with the known license.
+ self.known_credits = collections.defaultdict(list)
+ # Map storing processed files that do not belong to any known bucket. These
+ # files will have their license printed verbatim.
+ # Key: file path, Value: license text
+ self.generated_credits = collections.defaultdict(list)
+ # Convert the "buckets" above into a map.
+ self.known_file_map = {}
+ for item in KNOWN_FILE_BUCKETS:
+ self.known_file_map[os.path.join(item[0])] = FileInfo(item[1], item[2])
+
+ def ProcessFile(self, file_path):
+ """ Process the file updating credits.
+ Args:
+ file_path: Path to file to process. Path can be absolute or relative, but
+ should be a descendant of source_dir provided to constructor.
+ """
+ if not os.path.isabs(file_path):
+ file_path = os.path.abspath(os.path.join(self.source_dir, file_path))
+
+ comment_lines = ExtractFirstCommentBlock(file_path)
+ if not comment_lines:
+ self.difficult_files.append(file_path)
+ return
+
+ # Try to pull out customizations in first few lines of license header before
+ # "This file is part of FFmpeg." Failing to normalize indicates either a
+ # totally different header or a header with significant alterations.
+ normalized_lines = NormalizeCommentLines(comment_lines)
+ if normalized_lines:
+ sim_ratio = (
+ difflib.SequenceMatcher(
+ None, ConcatLines(normalized_lines),
+ FFMPEG_LGPL_REF).ratio())
+
+ # File is a close match to typical LGPL case.
+ if sim_ratio >= LGPL_MATCH_THRESHOLD:
+ self.known_credits[License.LGPL].append(file_path)
+ # File matches some LGPL, but has significant differences.
+ else:
+ self.HandleNonLGPLFile(comment_lines, file_path)
+ # File does not contain FFmpeg LGPL header in any form.
+ else:
+ self.HandleNonLGPLFile(comment_lines, file_path)
+
+ def HandleNonLGPLFile(self, comment_lines, file_path):
+ # Make file_path relative to FFmpeg directory to lookup self.known_file_map.
+ rel_file_path = os.path.relpath(file_path, os.path.abspath(self.source_dir))
+
+ # Many non-LGPL files fall into known groups (e.g. MIPS). We bucket these
+ # together to avoid repeating the same license text in the credits.
+ if rel_file_path in self.known_file_map:
+ hasher = hashlib.md5()
+ hasher.update(ConcatLines(comment_lines))
+
+ # Detect changes to file's licensing header.
+ file_license_info = self.known_file_map[rel_file_path]
+ if hasher.hexdigest() != file_license_info.license_digest:
+ exit('File %(file_path)s header has changed (was: %(old_digest)s '
+ 'now: %(new_digest)s). Inspect the header and update the '
+ 'exceptions table to continue generating credits.'
+ % {'file_path': rel_file_path,
+ 'old_digest': file_license_info.license_digest,
+ 'new_digest': hasher.hexdigest()})
+ # Store known files in a list for printing.
+ self.known_credits[file_license_info.license].append(rel_file_path)
+ else:
+ # This file does have a known bucket. We'll print its license verbatim.
+ self.generated_credits[rel_file_path] = ConcatLines(comment_lines).strip()
+
+ def PrintStats(self):
+ num_known_credits = 0
+ for license_bucket in self.known_credits:
+ num_known_credits += len(self.known_credits[license_bucket])
+ print 'CreditsUpdater stats:'
+ print '\t%s files w/ known_credits' % num_known_credits
+ print '\t%s generated_credits' % len(self.generated_credits.keys())
+ print '\t%s difficult_files files' % len(self.difficult_files)
+
+ def WriteCredits(self):
+ if self.difficult_files:
+ # After taking a closer look, enhance this tool to work for these or
+ # add them to the white-list if they truly have no licensing header.
+ print 'Failed to find license header for these files:'
+ for filename in self.difficult_files:
+ print filename
+ exit('Update script to work for these to continue generating credits')
+
+ output_path = os.path.join(self.source_dir, self.output_file)
+ licence_md_path = os.path.join(self.source_dir, UPSTREAM_LICENSEMD)
+ with open(output_path, 'w') as open_output:
+ # Always write the FFmpeg overview (LICENSE.md) first.
+ with open(licence_md_path) as open_license_md:
+ 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():
+ open_output.writelines(LICENSE_SEPARATOR)
+ open_output.writelines('%s\n\n%s' % (filename, file_license))
+
+ # Write the known licenses, ending with LGPL.
+ for known_license in sorted(self.known_credits.keys()):
+ # Skip LGPL for now. We print it at the end.
+ if known_license is License.LGPL:
+ continue
+
+ file_list = sorted(self.known_credits[known_license])
+ with open(LICENSE_TEXTS[known_license]) as license_text:
+ open_output.writelines(LICENSE_SEPARATOR)
+ open_output.writelines('\n'.join(file_list) + '\n\n')
+ open_output.writelines(license_text.readlines())
+
+ # Finally, write full text of LGPL
+ with open(LICENSE_TEXTS[License.LGPL]) as lgpl_text:
+ open_output.writelines(LICENSE_SEPARATOR)
+ open_output.writelines(lgpl_text.readlines())
+
+
+def ConcatLines(lines):
+ return ''.join(lines)
+
+
+def NormalizeCommentLines(comment_lines):
+ # Copy to leave orig const.
+ comment_lines = list(comment_lines)
+
+ # Find start of ffmpeg lgpl header.
+ line_index = 0
+ for line in comment_lines:
+ if (FFMPEG_HEADER_START.search(line)):
+ break
+ line_index += 1
+
+ if line_index == len(comment_lines):
+ # print "Failed to find start of ffmpeg header"
+ return None
+
+ # Typically just a few lines for copyright and file description. More
+ # than 20 to the start hints that this may not be the typical lgpl header.
+ if line_index > 20:
+ # print "Header start too far from the top of comment"
+ return None
+
+ # Pull out stuff before header start.
+ comment_lines = comment_lines[line_index: len(comment_lines)]
+ return comment_lines
+
+
+def ExtractFirstCommentBlock(file_path):
+ lines = []
+ found_comment_start = False
+ found_comment_end = False
+ is_asm = file_path.endswith('.asm')
+
+ with open(file_path) as open_file:
+ # .S files generally have C style block comments, but a handful have a
+ # special single-line comment prefixed with '@'. Check a few lines to figure
+ # out which case we're dealing with.
+ if file_path.endswith('.S'):
+ first_line = open_file.readline()
+ if ASM_COMMENT_PRE.search(first_line):
+ is_asm = True
+ open_file.seek(0)
+
+ if is_asm:
+ comment_start_re = ASM_COMMENT_PRE
+ comment_end_re = ASM_NOT_COMMENT
+ else:
+ comment_start_re = C_COMMENT_BLOCK_START
+ comment_end_re = C_COMMENT_BLOCK_END
+
+ for _ in xrange(0, 100):
+ line = open_file.readline()
+ found_comment_start = (found_comment_start or
+ comment_start_re.search(line))
+ if not found_comment_start:
+ continue
+
+ lines.append(line)
+ if comment_end_re.search(line):
+ found_comment_end = True
+ break
+
+ if not (found_comment_start and found_comment_end):
+ return None
+
+ StripCommentChars(lines, is_asm)
+ return lines
+
+
+def StripCommentChars(comment_lines, is_asm=False):
+ if is_asm:
+ for i in xrange(len(comment_lines)):
+ comment_lines[i] = re.sub(ASM_COMMENT_PRE, '', comment_lines[i])
+ else:
+ # Strip off the start slash-star
+ comment_lines[0] = re.sub(C_COMMENT_BLOCK_START, '', comment_lines[0])
+ # Strip off the comment end star-slash
+ comment_lines[-1] = re.sub(C_COMMENT_BLOCK_END, '', comment_lines[-1])
+ # Strip off the comment star for middle lines
+ for i in xrange(1, len(comment_lines)):
+ comment_lines[i] = re.sub(C_COMMENT_BLOCK_MID, '', comment_lines[i])
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py
new file mode 100755
index 00000000000..2be8367e501
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py
@@ -0,0 +1,193 @@
+#!/usr/bin/python
+#
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import codecs
+import copy
+import credits_updater as cu
+import os
+import string
+import unittest
+
+# Assumes this script is in ffmpeg/chromium/scripts/
+SOURCE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ os.path.pardir,
+ os.path.pardir)
+OUTPUT_FILE = 'CREDITS.testing'
+
+# Expected credits for swresample.h applied with the rot13 encoding. Otherwise
+# license scanners get confused about the license of this file.
+SWRESAMPLE_H_LICENSE_ROT_13 = '''yvofjerfnzcyr/fjerfnzcyr.u
+
+Pbclevtug (P) 2011-2013 Zvpunry Avrqreznlre (zvpunryav@tzk.ng)
+
+Guvf svyr vf cneg bs yvofjerfnzcyr
+
+yvofjerfnzcyr vf serr fbsgjner; lbh pna erqvfgevohgr vg naq/be
+zbqvsl vg haqre gur grezf bs gur TAH Yrffre Trareny Choyvp
+Yvprafr nf choyvfurq ol gur Serr Fbsgjner Sbhaqngvba; rvgure
+irefvba 2.1 bs gur Yvprafr, be (ng lbhe bcgvba) nal yngre irefvba.
+
+yvofjerfnzcyr vf qvfgevohgrq va gur ubcr gung vg jvyy or hfrshy,
+ohg JVGUBHG NAL JNEENAGL; jvgubhg rira gur vzcyvrq jneenagl bs
+ZREPUNAGNOVYVGL be SVGARFF SBE N CNEGVPHYNE CHECBFR. Frr gur TAH
+Yrffre Trareny Choyvp Yvprafr sbe zber qrgnvyf.
+
+Lbh fubhyq unir erprvirq n pbcl bs gur TAH Yrffre Trareny Choyvp
+Yvprafr nybat jvgu yvofjerfnzcyr; vs abg, jevgr gb gur Serr Fbsgjner
+Sbhaqngvba, Vap., 51 Senaxyva Fgerrg, Svsgu Sybbe, Obfgba, ZN 02110-1301 HFN'''
+
+# The real expected credits for swresample.h.
+SWRESAMPLE_H_LICENSE = codecs.decode(SWRESAMPLE_H_LICENSE_ROT_13, 'rot13')
+
+
+def NewCreditsUpdater():
+ return cu.CreditsUpdater(SOURCE_DIR, OUTPUT_FILE)
+
+
+class CreditsUpdaterUnittest(unittest.TestCase):
+
+ def tearDown(self):
+ # Cleanup the testing output file
+ test_credits = os.path.join(SOURCE_DIR, OUTPUT_FILE)
+ if os.path.exists(test_credits):
+ os.remove(test_credits)
+
+ def testNoFiles(self):
+ # Write credits without processing any files.
+ NewCreditsUpdater().WriteCredits()
+
+ # Credits should *always* have LICENSE.md followed by full LGPL text.
+ expected_lines = NormalizeNewLines(GetLicenseMdLines() +
+ GetSeparatorLines() +
+ GetLicenseLines(cu.License.LGPL))
+ credits_lines = ReadCreditsLines()
+ self.assertEqual(expected_lines, credits_lines)
+
+ def testLPGLFiles(self):
+ # Process two known LGPL files
+ updater = NewCreditsUpdater()
+ updater.ProcessFile('libavformat/mp3dec.c')
+ updater.ProcessFile('libavformat/mp3enc.c')
+ updater.WriteCredits()
+
+ # Expect output to have just LGPL text (once) preceded by LICENSE.md
+ expected_lines = NormalizeNewLines(GetLicenseMdLines() +
+ GetSeparatorLines() +
+ GetLicenseLines(cu.License.LGPL))
+ credits_lines = ReadCreditsLines()
+ self.assertEqual(expected_lines, credits_lines)
+
+ def testKnownBucketFiles(self):
+ # Process some JPEG and MIPS files.
+ updater = NewCreditsUpdater()
+ updater.ProcessFile('libavcodec/jfdctfst.c')
+ updater.ProcessFile('libavutil/mips/float_dsp_mips.c')
+ updater.WriteCredits()
+
+ # Expected output to have JPEG and MIPS text in addition to the typical LGPL
+ # and LICENSE.md header. JPEG should appear before MIPS because known
+ # buckets will be printed in alphabetical order.
+ expected_lines = NormalizeNewLines(GetLicenseMdLines() +
+ GetSeparatorLines() +
+ ['libavcodec/jfdctfst.c\n\n'] +
+ GetLicenseLines(cu.License.JPEG) +
+ GetSeparatorLines() +
+ ['libavutil/mips/float_dsp_mips.c\n\n'] +
+ GetLicenseLines(cu.License.MIPS) +
+ GetSeparatorLines() +
+ GetLicenseLines(cu.License.LGPL))
+ credits_lines = ReadCreditsLines()
+ self.assertEqual(expected_lines, credits_lines)
+
+ def testGeneratedAndKnownLicences(self):
+ # Process a file that doesn't fall into a known bucket (e.g. the license
+ # header for this file is unique). Also process a known bucket file.
+ updater = NewCreditsUpdater()
+ updater.ProcessFile('libswresample/swresample.h')
+ updater.ProcessFile('libavutil/mips/float_dsp_mips.c')
+ updater.WriteCredits()
+
+ # Expect output to put swresample.h header first, followed by MIPS.
+ expected_lines = NormalizeNewLines(GetLicenseMdLines() +
+ GetSeparatorLines() +
+ SWRESAMPLE_H_LICENSE.splitlines(True) +
+ GetSeparatorLines() +
+ ['libavutil/mips/float_dsp_mips.c\n\n'] +
+ GetLicenseLines(cu.License.MIPS) +
+ GetSeparatorLines() +
+ GetLicenseLines(cu.License.LGPL))
+ credits_lines = ReadCreditsLines()
+ self.assertEqual(expected_lines, credits_lines)
+
+ def testKnownFileDigestChange(self):
+ updater = NewCreditsUpdater()
+
+ # Choose a known file.
+ known_file = os.path.join('libavformat', 'oggparseogm.c')
+ self.assertTrue(known_file in updater.known_file_map)
+
+ # Show file processing works without raising SystemExit.
+ updater.ProcessFile(known_file)
+
+ # Alter the license digest for this file to simulate a change to the
+ # license header.
+ orig_file_info = updater.known_file_map[known_file]
+ altered_file_info = cu.FileInfo(cu.License.LGPL,
+ 'chris' + orig_file_info.license_digest[5:])
+ updater.known_file_map[known_file] = altered_file_info
+
+ # Verify digest mismatch triggers SystemExit.
+ with self.assertRaises(SystemExit):
+ updater.ProcessFile(known_file)
+
+
+# Globals to cache the text of static files once read.
+g_license_md_lines = []
+g_license_lines = {}
+
+
+def ReadCreditsLines():
+ with open(os.path.join(SOURCE_DIR, OUTPUT_FILE)) as test_credits:
+ return test_credits.readlines()
+
+
+def GetLicenseMdLines():
+ global g_license_md_lines
+ if not len(g_license_md_lines):
+ with open(os.path.join(SOURCE_DIR, cu.UPSTREAM_LICENSEMD)) as license_md:
+ g_license_md_lines = license_md.readlines()
+ return g_license_md_lines
+
+
+def GetLicenseLines(license_file):
+ if not license_file in g_license_lines:
+ g_license_lines[license_file] = GetFileLines(
+ os.path.join(cu.LICENSE_TEXTS[license_file]))
+ return g_license_lines[license_file]
+
+
+def GetFileLines(file_path):
+ with open(file_path) as open_file:
+ return open_file.readlines()
+
+
+def GetSeparatorLines():
+ # Pass True to preserve \n chars in the return.
+ return cu.LICENSE_SEPARATOR.splitlines(True)
+
+# Combine into a string then split back out to a list. This is important for
+# making constructed expectations match the credits read from a file. E.g.
+# input: ['foo', '\n', 'bar']
+# return: ['foo\n', 'bar']
+# Comparing lists line by line makes for much better diffs when things go wrong.
+
+
+def NormalizeNewLines(lines):
+ return ''.join(lines).splitlines(True)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/enum.py b/chromium/third_party/ffmpeg/chromium/scripts/enum.py
new file mode 100644
index 00000000000..c803bb5289d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/enum.py
@@ -0,0 +1,6 @@
+import collections
+
+# Python has enums now, but Goobuntu machines seem to run very old python. From:
+# http://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python
+def enum(*keys):
+ return collections.namedtuple('Enum', keys)(*keys)
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py b/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
index e5e847e85d1..20391e12713 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/generate_gyp.py
@@ -28,7 +28,9 @@ __author__ = 'scherkus@chromium.org (Andrew Scherkus)'
import collections
import copy
import datetime
+from enum import enum
import fnmatch
+import credits_updater
import itertools
import optparse
import os
@@ -38,11 +40,6 @@ import string
import subprocess
import sys
-# Python has enums now, but Goobuntu machines seem to run very old python. From:
-# http://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python
-def enum(*keys):
- return collections.namedtuple('Enum', keys)(*keys)
-
COPYRIGHT = """# Copyright %d The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -109,11 +106,13 @@ GN_SOURCE_END = """]
# Controls GYP conditional stanza generation.
Attr = enum('ARCHITECTURE', 'TARGET', 'PLATFORM')
SUPPORT_MATRIX = {
- Attr.ARCHITECTURE: set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'mipsel']),
- Attr.TARGET: set(['Chromium', 'Chrome', 'ChromiumOS', 'ChromeOS']),
- Attr.PLATFORM: set(['android', 'linux', 'win', 'mac'])
+ Attr.ARCHITECTURE:
+ set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'mipsel']),
+ Attr.TARGET: set(['Chromium', 'Chrome', 'ChromiumOS', 'ChromeOS']),
+ Attr.PLATFORM: set(['android', 'linux', 'win', 'mac'])
}
+
def NormalizeFilename(name):
""" Removes leading path separators in an attempt to normalize paths."""
return string.lstrip(name, os.sep)
@@ -127,11 +126,11 @@ def CleanObjectFiles(object_files):
"""
blacklist = [
'libavcodec/inverse.o', # Includes libavutil/inverse.c
- 'libavcodec/file_open.o', # Includes libavutil/file_open.c
+ 'libavcodec/file_open.o', # Includes libavutil/file_open.c
'libavcodec/log2_tab.o', # Includes libavutil/log2_tab.c
'libavformat/golomb_tab.o', # Includes libavcodec/golomb.c
'libavformat/log2_tab.o', # Includes libavutil/log2_tab.c
- 'libavformat/file_open.o', # Includes libavutil/file_open.c
+ 'libavformat/file_open.o', # Includes libavutil/file_open.c
# The following files are removed to trim down on binary size.
# TODO(ihf): Warning, it is *easy* right now to remove more files
@@ -144,7 +143,6 @@ def CleanObjectFiles(object_files):
'libavformat/sdp.o',
'libavutil/adler32.o',
'libavutil/audio_fifo.o',
- 'libavutil/aes.o',
'libavutil/blowfish.o',
'libavutil/cast5.o',
'libavutil/des.o',
@@ -166,25 +164,31 @@ def CleanObjectFiles(object_files):
object_files.remove(name)
return object_files
+
def IsAssemblyFile(f):
_, ext = os.path.splitext(f)
return ext in ['.S', '.asm']
+
def IsGasFile(f):
_, ext = os.path.splitext(f)
return ext in ['.S']
+
def IsYasmFile(f):
_, ext = os.path.splitext(f)
return ext in ['.asm']
+
def IsCFile(f):
_, ext = os.path.splitext(f)
return ext in ['.c']
+
def IsSourceFile(f):
return IsAssemblyFile(f) or IsCFile(f)
+
def GetSourceFiles(source_dir):
"""Returns a list of source files for the given source directory.
@@ -267,11 +271,13 @@ def GetSourceFileSet(object_to_sources, object_files):
source_set.add(object_to_sources[name])
return source_set
+
class SourceListCondition(object):
"""A SourceListCondition represents a combination of architecture, target, and
platform where a specific list of sources should be used. Attributes are setup
using the enum values to facilitate easy iteration over attributes for
condition reduction."""
+
def __init__(self, architecture, target, platform):
"""Creates a SourceListCondition
Args:
@@ -289,6 +295,7 @@ class SourceListCondition(object):
def __repr__(self):
return '{%s, %s, %s}' % (self.PLATFORM, self.ARCHITECTURE, self.TARGET)
+
class SourceSet(object):
"""A SourceSet represents a set of source files that are built on each of the
given set of SourceListConditions.
@@ -368,8 +375,8 @@ class SourceSet(object):
else:
platform_condition = 'OS == "%s"' % condition.PLATFORM
- conjunction_parts = filter(None,
- [platform_condition, arch_condition, target_condition])
+ conjunction_parts = filter(
+ None, [platform_condition, arch_condition, target_condition])
conjunctions.append(' and '.join(conjunction_parts))
# If there is more that one clause, wrap various conditions in parens
@@ -439,8 +446,8 @@ class SourceSet(object):
else:
platform_condition = 'is_%s' % condition.PLATFORM
- conjunction_parts = filter(None,
- [platform_condition, arch_condition, target_condition])
+ conjunction_parts = filter(
+ None, [platform_condition, arch_condition, target_condition])
conjunctions.append(' && '.join(conjunction_parts))
# If there is more that one clause, wrap various conditions in parens
@@ -455,6 +462,7 @@ class SourceSet(object):
# Output a conditional wrapper around stanzas if necessary.
if joined_conjuctions:
stanza += GN_CONDITION_BEGIN % joined_conjuctions
+
def indent(s):
return ' %s' % s
else:
@@ -567,6 +575,7 @@ def GetAllMatchingConditions(conditions, condition_to_match):
return found_matches
+
def GetAttributeValueRange(attribute, condition):
"""Return the range of values for the given attribute, considering
the values of other attributes in the given condition."""
@@ -586,6 +595,7 @@ def GetAttributeValueRange(attribute, condition):
return values_range
+
def DoConditionsSpanValuesRange(conditions, attribute, values_range):
"""Return True if all of the attribute values in values_range are observed
in one or more of the given conditions."""
@@ -676,18 +686,11 @@ def ParseOptions():
metavar='DIR',
help='Build root containing build.x64.linux, etc...')
- parser.add_option('-g',
- '--output_gn',
- dest='output_gn',
- action="store_true",
- default=False,
- help='Output a GN file instead of a gyp file.')
-
parser.add_option('-p',
'--print_licenses',
dest='print_licenses',
default=False,
- action="store_true",
+ action='store_true',
help='Print all licenses to console.')
options, args = parser.parse_args()
@@ -729,22 +732,25 @@ def WriteGn(fd, disjoint_sets):
# Lists of files that are exempt from searching in GetIncludeSources.
IGNORED_INCLUDE_FILES = [
- # Chromium generated files
- 'config.h',
- os.path.join('libavutil', 'avconfig.h'),
- os.path.join('libavutil', 'ffversion.h'),
-
- # Current configure values are set such that we don't include these (because
- # of various defines) and we also don't generate them at all, so we will fail
- # to find these because they don't exist in our repository.
- os.path.join('libavcodec', 'aacps_tables.h'),
- os.path.join('libavcodec', 'aacsbr_tables.h'),
- os.path.join('libavcodec', 'aac_tables.h'),
- os.path.join('libavcodec', 'cabac_tables.h'),
- os.path.join('libavcodec', 'cbrt_tables.h'),
- os.path.join('libavcodec', 'mpegaudio_tables.h'),
- os.path.join('libavcodec', 'pcm_tables.h'),
- os.path.join('libavcodec', 'sinewin_tables.h'),
+ # Chromium generated files
+ 'config.h',
+ os.path.join('libavutil', 'avconfig.h'),
+ os.path.join('libavutil', 'ffversion.h'),
+
+ # Current configure values are set such that we don't include these (because
+ # of various defines) and we also don't generate them at all, so we will fail
+ # to find these because they don't exist in our repository.
+ os.path.join('libavcodec', 'aacps_tables.h'),
+ os.path.join('libavcodec', 'aacps_fixed_tables.h'),
+ os.path.join('libavcodec', 'aacsbr_tables.h'),
+ os.path.join('libavcodec', 'aac_tables.h'),
+ os.path.join('libavcodec', 'cabac_tables.h'),
+ os.path.join('libavcodec', 'cbrt_tables.h'),
+ os.path.join('libavcodec', 'cbrt_fixed_tables.h'),
+ os.path.join('libavcodec', 'mpegaudio_tables.h'),
+ os.path.join('libavcodec', 'pcm_tables.h'),
+ os.path.join('libavcodec', 'sinewin_tables.h'),
+ os.path.join('libavcodec', 'sinewin_fixed_tables.h'),
]
@@ -752,12 +758,12 @@ IGNORED_INCLUDE_FILES = [
# DO NOT ADD TO THIS LIST without first confirming with lawyers that the
# licenses are okay to add.
LICENSE_WHITELIST = [
- 'BSD (3 clause) LGPL (v2.1 or later)',
- 'ISC GENERATED FILE',
- 'LGPL (v2.1 or later)',
- 'LGPL (v2.1 or later) GENERATED FILE',
- 'MIT/X11 (BSD like)',
- 'Public domain LGPL (v2.1 or later)',
+ 'BSD (3 clause) LGPL (v2.1 or later)',
+ 'ISC GENERATED FILE',
+ 'LGPL (v2.1 or later)',
+ 'LGPL (v2.1 or later) GENERATED FILE',
+ 'MIT/X11 (BSD like)',
+ 'Public domain LGPL (v2.1 or later)',
]
@@ -766,10 +772,10 @@ LICENSE_WHITELIST = [
# DO NOT ADD TO THIS LIST without first confirming with lawyers that the files
# you're adding have acceptable licenses.
UNKNOWN_WHITELIST = [
- # From of Independent JPEG group. No named license, but usage is allowed.
- os.path.join('libavcodec', 'jrevdct.c'),
- os.path.join('libavcodec', 'jfdctfst.c'),
- os.path.join('libavcodec', 'jfdctint_template.c'),
+ # From of Independent JPEG group. No named license, but usage is allowed.
+ os.path.join('libavcodec', 'jrevdct.c'),
+ os.path.join('libavcodec', 'jfdctfst.c'),
+ os.path.join('libavcodec', 'jfdctint_template.c'),
]
@@ -821,7 +827,7 @@ def GetIncludedSources(file_path, source_dir, include_set):
if not include_match:
if EXOTIC_INCLUDE_REGEX.search(line):
print 'WARNING: Investigate whacky include line:', line
- continue;
+ continue
include_file_path = include_match.group(1)
@@ -833,7 +839,7 @@ def GetIncludedSources(file_path, source_dir, include_set):
# Check if file is in current directory.
if os.path.isfile(include_path_in_current_dir):
- resolved_include_path = include_path_in_current_dir;
+ resolved_include_path = include_path_in_current_dir
# Else, check source_dir (should be FFmpeg root).
elif os.path.isfile(include_path_in_source_dir):
resolved_include_path = include_path_in_source_dir
@@ -841,7 +847,7 @@ def GetIncludedSources(file_path, source_dir, include_set):
elif include_file_path in IGNORED_INCLUDE_FILES:
continue
else:
- exit('Failed to find file', include_file_path)
+ exit('Failed to find file ' + include_file_path)
# At this point we've found the file. Check if its in our ignore list which
# means that the list should be updated to no longer mention this file.
@@ -852,64 +858,44 @@ def GetIncludedSources(file_path, source_dir, include_set):
GetIncludedSources(resolved_include_path, source_dir, include_set)
-def CheckLicenseForSource(source, source_dir, print_licenses):
+def CheckLicensesForSources(sources, source_dir, print_licenses):
# Assumed to be two back from source_dir (e.g. third_party/ffmpeg/../..).
source_root = os.path.abspath(
os.path.join(source_dir, os.path.pardir, os.path.pardir))
licensecheck_path = os.path.abspath(os.path.join(
- source_root, 'third_party', 'devscripts', 'licensecheck.pl'));
+ source_root, 'third_party', 'devscripts', 'licensecheck.pl'))
if not os.path.exists(licensecheck_path):
exit('Could not find licensecheck.pl: ' + str(licensecheck_path))
- check_process = subprocess.Popen([licensecheck_path,
- '-l', '100',
- os.path.abspath(source)],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ check_process = subprocess.Popen(
+ [licensecheck_path, '-m', '-l', '100']
+ + [os.path.abspath(s) for s in sources], stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
stdout, _ = check_process.communicate()
# Get the filename and license out of the stdout. stdout is expected to be
# "/abspath/to/file: *No copyright* SOME LICENSE".
- filename, licensename = stdout.split(':', 1)
- licensename = licensename.replace('*No copyright*', '').strip()
- rel_file_path = os.path.relpath(filename, os.path.abspath(source_dir))
-
- if (licensename in LICENSE_WHITELIST or
- (licensename == 'UNKNOWN' and rel_file_path in UNKNOWN_WHITELIST)):
- if print_licenses:
- print filename, ':', licensename
- return True
-
- print 'UNEXPECTED LICENSE: %s: %s' % (filename, licensename)
- return False
-
-
-def CheckLicensesForStaticLinking(disjoint_sets, source_dir, print_licenses):
- # Build up set of all sources and includes.
- sources_to_check = set()
- for source_set in disjoint_sets:
- for source in source_set.sources:
- GetIncludedSources(source, source_dir, sources_to_check)
+ for line in stdout.strip().splitlines():
+ filename, licensename = line.split('\t', 1)
+ licensename = licensename.replace('*No copyright*', '').strip()
+ rel_file_path = os.path.relpath(filename, os.path.abspath(source_dir))
+
+ if (licensename in LICENSE_WHITELIST or
+ (licensename == 'UNKNOWN' and rel_file_path in UNKNOWN_WHITELIST)):
+ if print_licenses:
+ print filename, ':', licensename
+ continue
- # Tracking state to print percentage of licenses checked so far.
- source_counter = 0
- num_sources = len(sources_to_check)
+ print 'UNEXPECTED LICENSE: %s: %s' % (filename, licensename)
+ return False
- # Check licenses for all included sources.
- all_checks_passed = True
- for source in sources_to_check:
- if not CheckLicenseForSource(source, source_dir, print_licenses):
- all_checks_passed = False
+ return True
- # Print percentage done so far (it's kind of slow).
- source_counter += 1
- percent_done = int((float(source_counter) * 100 / num_sources))
- line_ending = '\r' if (source_counter != num_sources) else '\n'
- sys.stdout.write('Checking licenses: %s%% %s' % (percent_done, line_ending))
- sys.stdout.flush()
- return all_checks_passed
+def CheckLicensesForStaticLinking(sources_to_check, source_dir, print_licenses):
+ print 'Checking licenses...'
+ return CheckLicensesForSources(sources_to_check, source_dir, print_licenses)
def FixObjectBasenameCollisions(disjoint_sets, all_sources):
@@ -925,7 +911,7 @@ def FixObjectBasenameCollisions(disjoint_sets, all_sources):
detect the presence of a renamed file in all_sources which is overridden and
warn that it should be removed."""
- SourceRename = collections.namedtuple("SourceRename", "old_name, new_name")
+ SourceRename = collections.namedtuple('SourceRename', 'old_name, new_name')
known_basenames = set()
all_renames = set()
@@ -952,11 +938,11 @@ def FixObjectBasenameCollisions(disjoint_sets, all_sources):
known_basenames.add(basename)
for rename in renames:
- print "fixing basename collision: %s -> %s" % (rename.old_name,
+ print 'Fixing basename collision: %s -> %s' % (rename.old_name,
rename.new_name)
shutil.copy2(rename.old_name, rename.new_name)
- source_set.sources.remove(rename.old_name);
+ source_set.sources.remove(rename.old_name)
source_set.sources.add(rename.new_name)
all_renames.add(rename.new_name)
@@ -965,7 +951,16 @@ def FixObjectBasenameCollisions(disjoint_sets, all_sources):
# collision is now resolved by some external/upstream change.
for source_name in all_sources:
if RENAME_PREFIX in source_name and source_name not in all_renames:
- print "WARNING: %s no longer collides. DELETE ME!" % source_name
+ print 'WARNING: %s no longer collides. DELETE ME!' % source_name
+
+
+def UpdateCredits(sources_to_check, source_dir):
+ print 'Updating ffmpeg credits...'
+ updater = credits_updater.CreditsUpdater(source_dir)
+ for source_name in sources_to_check:
+ updater.ProcessFile(source_name)
+ updater.PrintStats()
+ updater.WriteCredits()
def main():
@@ -996,34 +991,42 @@ def main():
platform)])))
sets = CreatePairwiseDisjointSets(sets)
- for source_set in sets:
- ReduceConditionalLogic(source_set)
+
+ # TODO(chcunningham): Logic reduction is not working right; it's incorrectly
+ # treating reducing a few x86 only files to be unconditionally included. See
+ # http://crbug.com/535788 for details.
+ #
+ # for source_set in sets:
+ # ReduceConditionalLogic(source_set)
if not sets:
exit('ERROR: failed to find any source sets. ' +
'Are build_dir (%s) and/or source_dir (%s) options correct?' %
- (options.build_dir, options.source_dir))
+ (options.build_dir, options.source_dir))
+
+ FixObjectBasenameCollisions(sets, source_files)
- FixObjectBasenameCollisions(sets, source_files);
+ # Build up set of all sources and includes.
+ sources_to_check = set()
+ for source_set in sets:
+ for source in source_set.sources:
+ GetIncludedSources(source, source_dir, sources_to_check)
- if not CheckLicensesForStaticLinking(sets, source_dir,
+ if not CheckLicensesForStaticLinking(sources_to_check, source_dir,
options.print_licenses):
- exit ('GENERATE FAILED: invalid licenses detected.')
+ exit('GENERATE FAILED: invalid licenses detected.')
print 'License checks passed.'
+ UpdateCredits(sources_to_check, source_dir)
- # Open for writing.
- if options.output_gn:
- outfile = 'ffmpeg_generated.gni'
- else:
- outfile = 'ffmpeg_generated.gypi'
- output_name = os.path.join(options.source_dir, outfile)
- print 'Output:', output_name
-
- with open(output_name, 'w') as fd:
- if options.output_gn:
- WriteGn(fd, sets)
- else:
- WriteGyp(fd, sets)
+ def WriteOutputFile(outfile, func):
+ output_name = os.path.join(options.source_dir, outfile)
+ print 'Output:', output_name
+
+ with open(output_name, 'w') as fd:
+ func(fd, sets)
+
+ WriteOutputFile('ffmpeg_generated.gni', WriteGn)
+ WriteOutputFile('ffmpeg_generated.gypi', WriteGyp)
if __name__ == '__main__':
main()
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/license_texts/full_lgpl.txt b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/full_lgpl.txt
new file mode 100644
index 00000000000..dc6c92d2211
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/full_lgpl.txt
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library 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.
+
+ This library 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 this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it! \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/license_texts/jpeg.txt b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/jpeg.txt
new file mode 100644
index 00000000000..c41ecdbbedf
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/jpeg.txt
@@ -0,0 +1,36 @@
+This file is part of the Independent JPEG Group's software.
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and
+you, its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1994-1996, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to
+these conditions:
+(1) If any part of the source code for this software is distributed, then
+this README file must be included, with this copyright and no-warranty
+notice unaltered; and any additions, deletions, or changes to the original
+files must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work
+of the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG
+code, not just to the unmodified library. If you use our work, you ought
+to acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company
+name in advertising or publicity relating to this software or products
+derived from it. This software may be referred to only as "the Independent
+JPEG Group's software".
+
+We specifically permit and encourage the use of this software as the basis
+of commercial products, provided that all warranty or liability claims are
+assumed by the product vendor. \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/license_texts/mips.txt b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/mips.txt
new file mode 100644
index 00000000000..3bbf9ebdd6f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/mips.txt
@@ -0,0 +1,36 @@
+Copyright (c) 2012
+MIPS Technologies, Inc., California.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Authors:
+Branimir Vasic (bvasic@mips.com)
+Darko Laus (darko@mips.com)
+Djordje Pesut (djordje@mips.com)
+Goran Cordasic (goran@mips.com)
+Nedeljko Babic (nedeljko.babic imgtec com)
+Mirjana Vulin (mvulin@mips.com)
+Stanislav Ocovaj (socovaj@mips.com)
+Zoran Lukic (zoranl@mips.com) \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/license_texts/oggparse_ahlberg_rullgayrd_2005.txt b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/oggparse_ahlberg_rullgayrd_2005.txt
new file mode 100644
index 00000000000..4af3d441325
--- /dev/null
+++ b/chromium/third_party/ffmpeg/chromium/scripts/license_texts/oggparse_ahlberg_rullgayrd_2005.txt
@@ -0,0 +1,21 @@
+Copyright (C) 2005 Michael Ahlberg, MĂƒÂ¥ns RullgĂƒÂ¥rd
+
+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. \ No newline at end of file
diff --git a/chromium/third_party/ffmpeg/cmdutils.c b/chromium/third_party/ffmpeg/cmdutils.c
index 6e7a0bb09bd..b696008c879 100644
--- a/chromium/third_party/ffmpeg/cmdutils.c
+++ b/chromium/third_party/ffmpeg/cmdutils.c
@@ -63,7 +63,7 @@
static int init_report(const char *env);
-struct SwsContext *sws_opts;
+AVDictionary *sws_dict;
AVDictionary *swr_opts;
AVDictionary *format_opts, *codec_opts, *resample_opts;
@@ -73,20 +73,13 @@ int hide_banner = 0;
void init_opts(void)
{
-
- if(CONFIG_SWSCALE)
- sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
- NULL, NULL, NULL);
+ av_dict_set(&sws_dict, "flags", "bicubic", 0);
}
void uninit_opts(void)
{
-#if CONFIG_SWSCALE
- sws_freeContext(sws_opts);
- sws_opts = NULL;
-#endif
-
av_dict_free(&swr_opts);
+ av_dict_free(&sws_dict);
av_dict_free(&format_opts);
av_dict_free(&codec_opts);
av_dict_free(&resample_opts);
@@ -529,7 +522,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
return o;
}
-#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
+#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
@@ -565,14 +558,18 @@ int opt_default(void *optctx, const char *opt, const char *arg)
}
#if CONFIG_SWSCALE
sc = sws_get_class();
- if (!consumed && opt_find(&sc, opt, NULL, 0,
- AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
- // XXX we only support sws_flags, not arbitrary sws options
- int ret = av_opt_set(sws_opts, opt, arg, 0);
+ if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ struct SwsContext *sws = sws_alloc_context();
+ int ret = av_opt_set(sws, opt, arg, 0);
+ sws_freeContext(sws);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret;
}
+
+ av_dict_set(&sws_dict, opt, arg, FLAGS);
+
consumed = 1;
}
#else
@@ -646,9 +643,7 @@ static void finish_group(OptionParseContext *octx, int group_idx,
*g = octx->cur_group;
g->arg = arg;
g->group_def = l->group_def;
-#if CONFIG_SWSCALE
- g->sws_opts = sws_opts;
-#endif
+ g->sws_dict = sws_dict;
g->swr_opts = swr_opts;
g->codec_opts = codec_opts;
g->format_opts = format_opts;
@@ -657,9 +652,7 @@ static void finish_group(OptionParseContext *octx, int group_idx,
codec_opts = NULL;
format_opts = NULL;
resample_opts = NULL;
-#if CONFIG_SWSCALE
- sws_opts = NULL;
-#endif
+ sws_dict = NULL;
swr_opts = NULL;
init_opts();
@@ -715,9 +708,8 @@ void uninit_parse_context(OptionParseContext *octx)
av_dict_free(&l->groups[j].codec_opts);
av_dict_free(&l->groups[j].format_opts);
av_dict_free(&l->groups[j].resample_opts);
-#if CONFIG_SWSCALE
- sws_freeContext(l->groups[j].sws_opts);
-#endif
+
+ av_dict_free(&l->groups[j].sws_dict);
av_dict_free(&l->groups[j].swr_opts);
}
av_freep(&l->groups);
@@ -1324,12 +1316,12 @@ static void print_codec(const AVCodec *c)
if (c->type == AVMEDIA_TYPE_VIDEO ||
c->type == AVMEDIA_TYPE_AUDIO) {
printf(" Threading capabilities: ");
- switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
- CODEC_CAP_SLICE_THREADS)) {
- case CODEC_CAP_FRAME_THREADS |
- CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
- case CODEC_CAP_FRAME_THREADS: printf("frame"); break;
- case CODEC_CAP_SLICE_THREADS: printf("slice"); break;
+ switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS)) {
+ case AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
+ case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
+ case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
default: printf("no"); break;
}
printf("\n");
@@ -1503,11 +1495,11 @@ static void print_codecs(int encoder)
while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
printf(" %c", get_media_type_char(desc->type));
- printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
- printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
- printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
- printf((codec->capabilities & CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
- printf((codec->capabilities & CODEC_CAP_DR1) ? "D" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
+ printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : ".");
printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
if (strcmp(codec->name, desc->name))
@@ -1581,10 +1573,10 @@ int show_filters(void *optctx, const char *opt, const char *arg)
*(descr_cur++) = '>';
}
pad = i ? filter->outputs : filter->inputs;
- for (j = 0; pad && pad[j].name; j++) {
+ for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) {
if (descr_cur >= descr + sizeof(descr) - 4)
break;
- *(descr_cur++) = get_media_type_char(pad[j].type);
+ *(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j));
}
if (!j)
*(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
@@ -1875,64 +1867,6 @@ int read_yesno(void)
return yesno;
}
-int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
-{
- int64_t ret;
- FILE *f = av_fopen_utf8(filename, "rb");
-
- if (!f) {
- ret = AVERROR(errno);
- av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename,
- strerror(errno));
- return ret;
- }
-
- ret = fseek(f, 0, SEEK_END);
- if (ret == -1) {
- ret = AVERROR(errno);
- goto out;
- }
-
- ret = ftell(f);
- if (ret < 0) {
- ret = AVERROR(errno);
- goto out;
- }
- *size = ret;
-
- ret = fseek(f, 0, SEEK_SET);
- if (ret == -1) {
- ret = AVERROR(errno);
- goto out;
- }
-
- *bufptr = av_malloc(*size + 1);
- if (!*bufptr) {
- av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
- ret = AVERROR(ENOMEM);
- goto out;
- }
- ret = fread(*bufptr, 1, *size, f);
- if (ret < *size) {
- av_free(*bufptr);
- if (ferror(f)) {
- ret = AVERROR(errno);
- av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
- filename, strerror(errno));
- } else
- ret = AVERROR_EOF;
- } else {
- ret = 0;
- (*bufptr)[(*size)++] = '\0';
- }
-
-out:
- if (ret < 0)
- av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", av_err2str(ret));
- fclose(f);
- return ret;
-}
-
FILE *get_preset_file(char *filename, size_t filename_size,
const char *preset_name, int is_path,
const char *codec_name)
@@ -2106,7 +2040,10 @@ double get_rotation(AVStream *st)
theta -= 360*floor(theta/360 + 0.9/360);
if (fabs(theta - 90*round(theta/90)) > 2)
- av_log_ask_for_sample(NULL, "Odd rotation angle\n");
+ av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
+ "If you want to help, upload a sample "
+ "of this file to ftp://upload.ffmpeg.org/incoming/ "
+ "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
return theta;
}
diff --git a/chromium/third_party/ffmpeg/cmdutils.h b/chromium/third_party/ffmpeg/cmdutils.h
index a21ce35fa85..7f3db2af1a6 100644
--- a/chromium/third_party/ffmpeg/cmdutils.h
+++ b/chromium/third_party/ffmpeg/cmdutils.h
@@ -46,7 +46,7 @@ extern const int program_birth_year;
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts;
-extern struct SwsContext *sws_opts;
+extern AVDictionary *sws_dict;
extern AVDictionary *swr_opts;
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
extern int hide_banner;
@@ -277,7 +277,7 @@ typedef struct OptionGroup {
AVDictionary *codec_opts;
AVDictionary *format_opts;
AVDictionary *resample_opts;
- struct SwsContext *sws_opts;
+ AVDictionary *sws_dict;
AVDictionary *swr_opts;
} OptionGroup;
@@ -530,18 +530,6 @@ int show_colors(void *optctx, const char *opt, const char *arg);
int read_yesno(void);
/**
- * Read the file with name filename, and put its content in a newly
- * allocated 0-terminated buffer.
- *
- * @param filename file to read from
- * @param bufptr location where pointer to buffer is returned
- * @param size location where size of buffer is returned
- * @return >= 0 in case of success, a negative value corresponding to an
- * AVERROR error code in case of failure.
- */
-int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
-
-/**
* Get a file corresponding to a preset file.
*
* If is_path is non-zero, look for the file in the path preset_name.
diff --git a/chromium/third_party/ffmpeg/common.mak b/chromium/third_party/ffmpeg/common.mak
index eac8bd99370..7569d35bb13 100644
--- a/chromium/third_party/ffmpeg/common.mak
+++ b/chromium/third_party/ffmpeg/common.mak
@@ -118,8 +118,9 @@ TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
HEADERS += $(HEADERS-yes)
-PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
-DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
+PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
+DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
+STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
SRC_DIR := $(SRC_PATH)/lib$(NAME)
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
diff --git a/chromium/third_party/ffmpeg/compat/windows/mslink b/chromium/third_party/ffmpeg/compat/windows/mslink
new file mode 100755
index 00000000000..07b2b3e3787
--- /dev/null
+++ b/chromium/third_party/ffmpeg/compat/windows/mslink
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+LINK_EXE_PATH=$(dirname "$(command -v cl)")/link
+if [ -x "$LINK_EXE_PATH" ]; then
+ "$LINK_EXE_PATH" $@
+else
+ link $@
+fi
+exit $?
diff --git a/chromium/third_party/ffmpeg/configure b/chromium/third_party/ffmpeg/configure
index 3960b735c10..da18e7008ff 100755
--- a/chromium/third_party/ffmpeg/configure
+++ b/chromium/third_party/ffmpeg/configure
@@ -155,6 +155,7 @@ Hardware accelerators:
--disable-vaapi disable VAAPI code [autodetect]
--disable-vda disable VDA code [autodetect]
--disable-vdpau disable VDPAU code [autodetect]
+ --enable-videotoolbox enable VideoToolbox code [autodetect]
Individual component options:
--disable-everything disable all components listed below
@@ -222,6 +223,7 @@ External library support:
--enable-libgsm enable GSM de/encoding via libgsm [no]
--enable-libiec61883 enable iec61883 via libiec61883 [no]
--enable-libilbc enable iLBC de/encoding via libilbc [no]
+ --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
--enable-libmfx enable HW acceleration through libmfx
--enable-libmodplug enable ModPlug via libmodplug [no]
--enable-libmp3lame enable MP3 encoding via libmp3lame [no]
@@ -239,10 +241,12 @@ External library support:
--enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
--enable-libshine enable fixed-point MP3 encoding via libshine [no]
--enable-libsmbclient enable Samba protocol via libsmbclient [no]
+ --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
--enable-libsoxr enable Include libsoxr resampling [no]
--enable-libspeex enable Speex de/encoding via libspeex [no]
--enable-libssh enable SFTP protocol via libssh [no]
--enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
+ --enable-libtesseract enable Tesseract, needed for ocr filter [no]
--enable-libtheora enable Theora encoding via libtheora [no]
--enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
@@ -321,6 +325,7 @@ Toolchain options:
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
--extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
+ --extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS]
--extra-libs=ELIBS add ELIBS [$ELIBS]
--extra-version=STRING version string suffix []
--optflags=OPTFLAGS override optimization-related compiler flags
@@ -373,7 +378,7 @@ Optimization options (experts only):
--disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
--disable-msa disable MSA optimizations
--disable-mipsfpu disable floating point MIPS optimizations
- --disable-loongson3 disable Loongson-3 SIMD optimizations
+ --disable-mmi disable Loongson SIMD optimizations
--disable-fast-unaligned consider unaligned accesses slow
Developer options (useful when working on FFmpeg itself):
@@ -412,6 +417,15 @@ EOF
}
quotes='""'
+if test -t 1 && which tput >/dev/null; then
+ ncolors=$(tput colors)
+ if test -n "$ncolors" && test $ncolors -ge 8; then
+ bold_color=$(tput bold)
+ warn_color=$(tput setaf 3)
+ error_color=$(tput setaf 1)
+ reset_color=$(tput sgr0)
+ fi
+fi
log(){
echo "$@" >> $logfile
@@ -423,18 +437,14 @@ log_file(){
log END $1
}
-echolog(){
- log "$@"
- echo "$@"
-}
-
warn(){
log "WARNING: $*"
WARNINGS="${WARNINGS}WARNING: $*\n"
}
die(){
- echolog "$@"
+ log "$@"
+ echo "$error_color$bold_color$@$reset_color"
cat <<EOF
If you think configure made a mistake, make sure you are using the latest
@@ -475,7 +485,7 @@ sh_quote(){
}
cleanws(){
- echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//;s/\\r//g'
+ echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
}
filter(){
@@ -791,6 +801,10 @@ add_ldexeflags(){
append LDEXEFLAGS $($ldflags_filter "$@")
}
+add_ldlibflags(){
+ append LDLIBFLAGS $($ldflags_filter "$@")
+}
+
add_stripflags(){
append ASMSTRIPFLAGS "$@"
}
@@ -1304,12 +1318,6 @@ check_host_cpp_condition(){
EOF
}
-apply(){
- file=$1
- shift
- "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
-}
-
cp_if_changed(){
cmp -s "$1" "$2" && echo "$2 is unchanged" && return
mkdir -p "$(dirname $2)"
@@ -1335,7 +1343,7 @@ COMPONENT_LIST="
EXAMPLE_LIST="
avio_reading_example
- avio_list_dir_example
+ avio_dir_cmd_example
decoding_encoding_example
demuxing_decoding_example
extract_mvs_example
@@ -1380,6 +1388,7 @@ EXTERNAL_LIBRARY_LIST="
libgsm
libiec61883
libilbc
+ libkvazaar
libmfx
libmodplug
libmp3lame
@@ -1396,10 +1405,12 @@ EXTERNAL_LIBRARY_LIST="
libschroedinger
libshine
libsmbclient
+ libsnappy
libsoxr
libspeex
libssh
libstagefright_h264
+ libtesseract
libtheora
libtwolame
libutvideo
@@ -1461,6 +1472,7 @@ HWACCEL_LIST="
vaapi
vda
vdpau
+ videotoolbox
xvmc
"
@@ -1589,7 +1601,9 @@ ARCH_EXT_LIST_MIPS="
"
ARCH_EXT_LIST_LOONGSON="
+ loongson2
loongson3
+ mmi
"
ARCH_EXT_LIST_X86_SIMD="
@@ -1679,6 +1693,7 @@ HEADERS_LIST="
dev_video_bktr_ioctl_bt848_h
dev_video_meteor_ioctl_meteor_h
direct_h
+ dirent_h
dlfcn_h
d3d11_h
dxva_h
@@ -1719,7 +1734,9 @@ MATH_FUNCS="
atan2f
cbrt
cbrtf
+ copysign
cosf
+ erf
exp2
exp2f
expf
@@ -1772,6 +1789,7 @@ SYSTEM_FUNCS="
jack_port_get_latency_range
kbhit
localtime_r
+ lstat
lzo1x_999_compress
mach_absolute_time
MapViewOfFile
@@ -1785,6 +1803,7 @@ SYSTEM_FUNCS="
pthread_cancel
sched_getaffinity
SetConsoleTextAttribute
+ SetConsoleCtrlHandler
setmode
setrlimit
Sleep
@@ -1824,6 +1843,7 @@ TYPES_LIST="
CONDITION_VARIABLE_Ptr
socklen_t
struct_addrinfo
+ struct_dcadec_exss_info_matrix_encoding
struct_group_source_req
struct_ip_mreq_source
struct_ipv6_mreq
@@ -1887,8 +1907,10 @@ CONFIG_EXTRA="
faandct
faanidct
fdctdsp
+ flacdsp
fmtconvert
frame_thread_encoder
+ g722dsp
gcrypt
gmp
golomb
@@ -1906,17 +1928,21 @@ CONFIG_EXTRA="
iirfilter
imdct15
intrax8
+ ividsp
jpegtables
+ libx262
lgplv3
llauddsp
llviddsp
lpc
+ lzf
me_cmp
mpeg_er
mpegaudio
mpegaudiodsp
mpegvideo
mpegvideoenc
+ mss34dsp
pixblockdsp
qpeldsp
qsv
@@ -1927,12 +1953,19 @@ CONFIG_EXTRA="
riffenc
rtpdec
rtpenc_chain
+ rv34dsp
sinewin
+ snappy
startcode
+ texturedsp
+ texturedspenc
tpeldsp
videodsp
vp3dsp
+ vp56dsp
+ vp8dsp
wma_freqs
+ wmv2dsp
"
CMDLINE_SELECT="
@@ -2040,7 +2073,7 @@ mips32r2_deps="mips"
mips32r5_deps="mips"
mips64r6_deps="mips"
msa_deps="mips"
-loongson3_deps="mips"
+mmi_deps="mips"
altivec_deps="ppc"
dcbzl_deps="ppc"
@@ -2112,19 +2145,22 @@ me_cmp_select="fdctdsp idctdsp pixblockdsp"
mpeg_er_select="error_resilience"
mpegaudio_select="mpegaudiodsp"
mpegaudiodsp_select="dct"
-mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp"
+mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp mpeg_er videodsp"
mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
qsvdec_select="qsv"
qsvenc_select="qsv"
# decoders / encoders
aac_decoder_select="imdct15 mdct sinewin"
-aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
+aac_fixed_decoder_select="mdct sinewin"
+aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin"
aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
+adpcm_g722_decoder_select="g722dsp"
+adpcm_g722_encoder_select="g722dsp"
aic_decoder_select="golomb idctdsp"
alac_encoder_select="lpc"
als_decoder_select="bswapdsp"
@@ -2153,12 +2189,14 @@ cook_decoder_select="audiodsp mdct sinewin"
cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
dca_decoder_select="fmtconvert mdct"
+dds_decoder_select="texturedsp"
dirac_decoder_select="dwt golomb videodsp mpegvideoenc"
dnxhd_decoder_select="blockdsp idctdsp"
dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
dvvideo_decoder_select="dvprofile idctdsp"
dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
dxa_decoder_select="zlib"
+dxv_decoder_select="lzf texturedsp"
eac3_decoder_select="ac3_decoder"
eac3_encoder_select="ac3_encoder"
eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
@@ -2170,8 +2208,8 @@ ffv1_encoder_select="rangecoder"
ffvhuff_decoder_select="huffyuv_decoder"
ffvhuff_encoder_select="huffyuv_encoder"
fic_decoder_select="golomb"
-flac_decoder_select="golomb"
-flac_encoder_select="bswapdsp golomb lpc"
+flac_decoder_select="flacdsp golomb"
+flac_encoder_select="bswapdsp flacdsp golomb lpc"
flashsv_decoder_select="zlib"
flashsv_encoder_select="zlib"
flashsv2_encoder_select="zlib"
@@ -2182,9 +2220,9 @@ fourxm_decoder_select="blockdsp bswapdsp"
fraps_decoder_select="bswapdsp huffman"
g2m_decoder_select="blockdsp idctdsp jpegtables zlib"
g729_decoder_select="audiodsp"
-h261_decoder_select="mpeg_er mpegvideo"
+h261_decoder_select="mpegvideo"
h261_encoder_select="aandcttables mpegvideoenc"
-h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
+h263_decoder_select="h263_parser h263dsp mpegvideo qpeldsp"
h263_encoder_select="aandcttables h263dsp mpegvideoenc"
h263i_decoder_select="h263_decoder"
h263p_decoder_select="h263_decoder"
@@ -2195,12 +2233,21 @@ h264_qsv_decoder_deps="libmfx"
h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
h264_qsv_encoder_deps="libmfx"
h264_qsv_encoder_select="qsvenc"
+hap_decoder_select="snappy texturedsp"
+hap_encoder_deps="libsnappy"
+hap_encoder_select="texturedspenc"
hevc_decoder_select="bswapdsp cabac golomb videodsp"
+hevc_qsv_encoder_deps="libmfx"
+hevc_qsv_decoder_deps="libmfx"
+hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
+hevc_qsv_encoder_select="qsvenc"
huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
iac_decoder_select="imc_decoder"
imc_decoder_select="bswapdsp fft mdct sinewin"
indeo3_decoder_select="hpeldsp"
+indeo4_decoder_select="ividsp"
+indeo5_decoder_select="ividsp"
interplay_video_decoder_select="hpeldsp"
jpegls_decoder_select="golomb mjpeg_decoder"
jpegls_encoder_select="golomb"
@@ -2230,19 +2277,25 @@ mpc7_decoder_select="bswapdsp mpegaudiodsp"
mpc8_decoder_select="mpegaudiodsp"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpeg2video_decoder"
-mpegvideo_decoder_select="error_resilience mpeg_er mpegvideo"
-mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
+mpegvideo_decoder_select="mpegvideo"
+mpeg1video_decoder_select="mpegvideo"
mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
-mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
+mpeg2video_decoder_select="mpegvideo"
mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
+mpeg2_qsv_decoder_deps="libmfx"
+mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel"
+mpeg2_qsv_encoder_deps="libmfx"
+mpeg2_qsv_encoder_select="qsvenc"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder"
+msa1_decoder_select="mss34dsp"
msmpeg4v1_decoder_select="h263_decoder"
msmpeg4v2_decoder_select="h263_decoder"
msmpeg4v2_encoder_select="h263_encoder"
msmpeg4v3_decoder_select="h263_decoder"
msmpeg4v3_encoder_select="h263_encoder"
-mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder"
+mss2_decoder_select="vc1_decoder"
+mts2_decoder_select="mss34dsp"
mxpeg_decoder_select="mjpeg_decoder"
nellymoser_decoder_select="mdct sinewin"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
@@ -2261,12 +2314,12 @@ ra_144_decoder_select="audiodsp"
ralf_decoder_select="golomb"
rawvideo_decoder_select="bswapdsp"
rtjpeg_decoder_select="me_cmp"
-rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
+rv10_decoder_select="h263_decoder"
rv10_encoder_select="h263_encoder"
-rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
+rv20_decoder_select="h263_decoder"
rv20_encoder_select="h263_encoder"
-rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
-rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
+rv30_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
+rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
@@ -2290,20 +2343,23 @@ truemotion2_decoder_select="bswapdsp"
truespeech_decoder_select="bswapdsp"
tscc_decoder_select="zlib"
twinvq_decoder_select="mdct lsp sinewin"
+txd_decoder_select="texturedsp"
utvideo_decoder_select="bswapdsp"
utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
vble_decoder_select="huffyuvdsp"
-vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
+vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 qpeldsp startcode"
vc1image_decoder_select="vc1_decoder"
+vc1_qsv_decoder_deps="libmfx"
+vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel"
vorbis_decoder_select="mdct"
vorbis_encoder_select="mdct"
vp3_decoder_select="hpeldsp vp3dsp videodsp"
-vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
-vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
+vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
+vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
vp6a_decoder_select="vp6_decoder"
vp6f_decoder_select="vp6_decoder"
-vp7_decoder_select="h264pred videodsp"
-vp8_decoder_select="h264pred videodsp"
+vp7_decoder_select="h264pred videodsp vp8dsp"
+vp8_decoder_select="h264pred videodsp vp8dsp"
vp9_decoder_select="videodsp vp9_parser"
webp_decoder_select="vp8_decoder"
wmalossless_decoder_select="llauddsp"
@@ -2315,8 +2371,8 @@ wmav2_encoder_select="mdct sinewin wma_freqs"
wmavoice_decoder_select="lsp rdft dct mdct sinewin"
wmv1_decoder_select="h263_decoder"
wmv1_encoder_select="h263_encoder"
-wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp"
-wmv2_encoder_select="h263_encoder"
+wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp wmv2dsp"
+wmv2_encoder_select="h263_encoder wmv2dsp"
wmv3_decoder_select="vc1_decoder"
wmv3image_decoder_select="wmv3_decoder"
zerocodec_decoder_select="zlib"
@@ -2327,18 +2383,22 @@ zmbv_encoder_select="zlib"
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
-d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
+d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
vaapi_deps="va_va_h"
-vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
-vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
+vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h"
+vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore -framework CoreServices"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
+videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads CoreServices_CoreServices_h"
+videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework QuartzCore -framework CoreServices"
xvmc_deps="X11_extensions_XvMClib_h"
h263_vaapi_hwaccel_deps="vaapi"
h263_vaapi_hwaccel_select="h263_decoder"
h263_vdpau_hwaccel_deps="vdpau"
h263_vdpau_hwaccel_select="h263_decoder"
+h263_videotoolbox_hwaccel_deps="videotoolbox"
+h263_videotoolbox_hwaccel_select="h263_decoder"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_d3d11va_hwaccel_deps="d3d11va"
h264_d3d11va_hwaccel_select="h264_decoder"
@@ -2361,10 +2421,17 @@ h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
h264_vdpau_hwaccel_select="h264_decoder"
+h264_videotoolbox_hwaccel_deps="videotoolbox"
+h264_videotoolbox_hwaccel_select="h264_decoder"
hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va_hwaccel_select="hevc_decoder"
hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
hevc_dxva2_hwaccel_select="hevc_decoder"
+hevc_qsv_hwaccel_deps="libmfx"
+hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
+hevc_vaapi_hwaccel_select="hevc_decoder"
+hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
+hevc_vdpau_hwaccel_select="hevc_decoder"
mpeg_vdpau_decoder_deps="vdpau"
mpeg_vdpau_decoder_select="mpeg2video_decoder"
mpeg_xvmc_hwaccel_deps="xvmc"
@@ -2373,6 +2440,8 @@ mpeg1_vdpau_decoder_deps="vdpau"
mpeg1_vdpau_decoder_select="mpeg1video_decoder"
mpeg1_vdpau_hwaccel_deps="vdpau"
mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
+mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
+mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
mpeg1_xvmc_hwaccel_deps="xvmc"
mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
mpeg2_crystalhd_decoder_select="crystalhd"
@@ -2380,10 +2449,14 @@ mpeg2_d3d11va_hwaccel_deps="d3d11va"
mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
mpeg2_dxva2_hwaccel_deps="dxva2"
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
+mpeg2_qsv_hwaccel_deps="libmfx"
+mpeg2_qsv_hwaccel_select="qsvdec_mpeg2"
mpeg2_vaapi_hwaccel_deps="vaapi"
mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
mpeg2_vdpau_hwaccel_deps="vdpau"
mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
+mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
+mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
mpeg2_xvmc_hwaccel_deps="xvmc"
mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd"
@@ -2393,6 +2466,8 @@ mpeg4_vdpau_decoder_deps="vdpau"
mpeg4_vdpau_decoder_select="mpeg4_decoder"
mpeg4_vdpau_hwaccel_deps="vdpau"
mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
+mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
+mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_crystalhd_decoder_select="crystalhd"
vc1_d3d11va_hwaccel_deps="d3d11va"
@@ -2405,6 +2480,8 @@ vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder"
vc1_vdpau_hwaccel_deps="vdpau"
vc1_vdpau_hwaccel_select="vc1_decoder"
+vc1_qsv_hwaccel_deps="libmfx"
+vc1_qsv_hwaccel_select="qsvdec_vc1"
wmv3_crystalhd_decoder_select="crystalhd"
wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
@@ -2414,9 +2491,9 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# parsers
h264_parser_select="h264_decoder"
-hevc_parser_select="hevc_decoder"
+hevc_parser_select="golomb"
mpegvideo_parser_select="mpegvideo"
-mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
+mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
vc1_parser_select="mpegvideo startcode vc1_decoder"
# bitstream_filters
@@ -2438,6 +2515,7 @@ libgsm_ms_decoder_deps="libgsm"
libgsm_ms_encoder_deps="libgsm"
libilbc_decoder_deps="libilbc"
libilbc_encoder_deps="libilbc"
+libkvazaar_encoder_deps="libkvazaar"
libmodplug_demuxer_deps="libmodplug"
libmp3lame_encoder_deps="libmp3lame"
libmp3lame_encoder_select="audio_frame_queue"
@@ -2475,6 +2553,7 @@ libvpx_vp9_encoder_deps="libvpx"
libwavpack_encoder_deps="libwavpack"
libwebp_encoder_deps="libwebp"
libwebp_anim_encoder_deps="libwebp"
+libx262_encoder_deps="libx262"
libx264_encoder_deps="libx264"
libx264rgb_encoder_deps="libx264"
libx264rgb_encoder_select="libx264_encoder"
@@ -2491,6 +2570,7 @@ nvenc_hevc_encoder_deps="nvenc"
# demuxers / muxers
ac3_demuxer_select="ac3_parser"
asf_demuxer_select="riffdec"
+asf_o_demuxer_select="riffdec"
asf_muxer_select="riffenc"
asf_stream_muxer_select="asf_muxer"
avi_demuxer_select="riffdec exif"
@@ -2608,6 +2688,7 @@ x11grab_indev_deps="x11grab"
x11grab_xcb_indev_deps="libxcb"
# protocols
+async_protocol_deps="pthreads"
bluray_protocol_deps="libbluray"
ffrtmpcrypt_protocol_deps="!librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
@@ -2671,6 +2752,7 @@ cropdetect_filter_deps="gpl"
delogo_filter_deps="gpl"
deshake_filter_select="pixelutils"
drawtext_filter_deps="libfreetype"
+dynaudnorm_filter_deps="copysign erf"
ebur128_filter_deps="gpl"
eq_filter_deps="gpl"
fftfilt_filter_deps="avcodec"
@@ -2694,6 +2776,7 @@ mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
perspective_filter_deps="gpl"
pp7_filter_deps="gpl"
+ocr_filter_deps="libtesseract"
ocv_filter_deps="libopencv"
owdenoise_filter_deps="gpl"
pan_filter_deps="swresample"
@@ -2705,10 +2788,13 @@ repeatfields_filter_deps="gpl"
resample_filter_deps="avresample"
sab_filter_deps="gpl swscale"
scale_filter_deps="swscale"
+scale2ref_filter_deps="swscale"
select_filter_select="pixelutils"
smartblur_filter_deps="gpl swscale"
showcqt_filter_deps="avcodec"
showcqt_filter_select="fft"
+showfreqs_filter_deps="avcodec"
+showfreqs_filter_select="fft"
showspectrum_filter_deps="avcodec"
showspectrum_filter_select="rdft"
spp_filter_deps="gpl avcodec"
@@ -2728,7 +2814,7 @@ zoompan_filter_deps="swscale"
# examples
avio_reading="avformat avcodec avutil"
-avio_list_dir="avformat avutil"
+avio_dir_cmd="avformat avutil"
avcodec_example_deps="avcodec avutil"
decoding_encoding_example_deps="avcodec avformat avutil"
demuxing_decoding_example_deps="avcodec avformat avutil"
@@ -2800,11 +2886,7 @@ ln_s="ln -s -f"
nm_default="nm -g"
objformat="elf"
pkg_config_default=pkg-config
-if ranlib 2>&1 | grep -q "\-D "; then
- ranlib_default="ranlib -D"
-else
- ranlib_default="ranlib"
-fi
+ranlib_default="ranlib"
strip_default="strip"
yasmexe_default="yasm"
windres_default="windres"
@@ -2845,7 +2927,7 @@ sws_max_filter_size_default=256
set_default sws_max_filter_size
# Enable hwaccels by default.
-enable d3d11va dxva2 vaapi vda vdpau xvmc
+enable d3d11va dxva2 vaapi vda vdpau videotoolbox xvmc
enable xlib
# build settings
@@ -2898,8 +2980,9 @@ if test -f configure; then
source_path=.
else
source_path=$(cd $(dirname "$0"); pwd)
- echo "$source_path" | grep -q '[[:blank:]]' &&
- die "Out of tree builds are impossible with whitespace in source path."
+ case "$source_path" in
+ *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
+ esac
test -e "$source_path/config.h" &&
die "Out of tree builds are impossible with config.h in source dir."
fi
@@ -2999,6 +3082,9 @@ for opt do
--extra-ldexeflags=*)
add_ldexeflags $optval
;;
+ --extra-ldlibflags=*)
+ add_ldlibflags $optval
+ ;;
--extra-libs=*)
add_extralibs $optval
;;
@@ -3134,9 +3220,14 @@ case "$toolchain" in
else
cc_default="c99wrap cl"
fi
- ld_default="link"
+ ld_default="$source_path/compat/windows/mslink"
nm_default="dumpbin -symbols"
ar_default="lib"
+ case "$arch" in
+ arm*)
+ as_default="armasm"
+ ;;
+ esac
target_os_default="win32"
# Use a relative path for TMPDIR. This makes sure all the
# ffconf temp files are written with a relative path, avoiding
@@ -3178,7 +3269,11 @@ cc_default="${cross_prefix}${cc_default}"
cxx_default="${cross_prefix}${cxx_default}"
nm_default="${cross_prefix}${nm_default}"
pkg_config_default="${cross_prefix}${pkg_config_default}"
-ranlib_default="${cross_prefix}${ranlib_default}"
+if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
+ ranlib_default="${cross_prefix}${ranlib_default} -D"
+else
+ ranlib_default="${cross_prefix}${ranlib_default}"
+fi
strip_default="${cross_prefix}${strip_default}"
windres_default="${cross_prefix}${windres_default}"
@@ -3205,7 +3300,7 @@ fi
exesuf() {
case $1 in
- mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
+ mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
esac
}
@@ -3329,6 +3424,7 @@ msvc_common_flags(){
-lavifil32) echo vfw32.lib ;;
-lavicap32) echo vfw32.lib user32.lib ;;
-l*) echo ${flag#-l}.lib ;;
+ -LARGEADDRESSAWARE) echo $flag ;;
-L*) echo -libpath:${flag#-L} ;;
*) echo $flag ;;
esac
@@ -3457,6 +3553,7 @@ tms470_flags(){
probe_cc(){
pfx=$1
_cc=$2
+ first=$3
unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
unset _ld_o _ldflags _ld_lib _ld_path
@@ -3467,8 +3564,8 @@ probe_cc(){
true # no-op to avoid reading stdin in following checks
elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
_type=llvm_gcc
- gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
- _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
+ gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
+ _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O3'
_cflags_size='-Os'
@@ -3479,8 +3576,14 @@ probe_cc(){
gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
- if ! $_cc -dumpversion | grep -q '^2\.'; then
- _depflags='-MMD -MF $(@:.o=.d) -MT $@'
+ case $gcc_basever in
+ 2*) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
+ esac
+ if [ "$first" = true ]; then
+ case $gcc_basever in
+ 4.2*)
+ warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
+ esac
fi
_cflags_speed='-O3'
_cflags_size='-Os'
@@ -3532,7 +3635,7 @@ probe_cc(){
_flags_filter=tms470_flags
elif $_cc -v 2>&1 | grep -q clang; then
_type=clang
- _ident=$($_cc --version | head -n1)
+ _ident=$($_cc --version 2>/dev/null | head -n1)
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O3'
_cflags_size='-Os'
@@ -3595,16 +3698,16 @@ probe_cc(){
_flags='-nologo -Qdiag-error:4044,10157'
# -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
# with MSVC which enables it by default.
- _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
+ _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
disable stripping
- elif $_cc 2>&1 | grep -q Microsoft; then
+ elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
_type=msvc
_ident=$($_cc 2>&1 | head -n1)
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
_DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
_cflags_speed="-O2"
_cflags_size="-O1"
- if $_cc 2>&1 | grep -q Linker; then
+ if $_cc -nologo- 2>&1 | grep -q Linker; then
_ld_o='-out:$@'
else
_ld_o='-Fe$@'
@@ -3615,7 +3718,7 @@ probe_cc(){
_ld_lib='lib%.a'
_ld_path='-libpath:'
_flags='-nologo'
- _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
+ _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS'
disable stripping
elif $_cc --version 2>/dev/null | grep -q ^cparser; then
_type=cparser
@@ -3644,7 +3747,7 @@ set_ccvars(){
fi
}
-probe_cc cc "$cc"
+probe_cc cc "$cc" "true"
cflags_filter=$_flags_filter
cflags_speed=$_cflags_speed
cflags_size=$_cflags_size
@@ -3950,7 +4053,7 @@ elif enabled mips; then
check_cflags "-mtune=i6400 -mabi=64"
check_ldflags "-mabi=64"
;;
- loongson3*)
+ loongson*)
disable mipsfpu
disable mips32r2
disable mips32r5
@@ -3958,14 +4061,24 @@ elif enabled mips; then
disable mipsdspr1
disable mipsdspr2
disable msa
- enable local_aligned_8 local_aligned_16
+ enable local_aligned_8 local_aligned_16 local_aligned_32
enable simd_align_16
enable fast_64bit
enable fast_clz
enable fast_cmov
enable fast_unaligned
disable aligned_stack
- cpuflags="-march=loongson3a -mhard-float"
+ case $cpu in
+ loongson3*)
+ cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
+ ;;
+ loongson2e)
+ cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
+ ;;
+ loongson2f)
+ cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
+ ;;
+ esac
;;
generic)
disable mips32r5
@@ -4232,12 +4345,14 @@ case $target_os in
enabled_any pic shared x86_64 ||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
;;
- mingw32*)
+ mingw32*|mingw64*)
if test $target_os = "mingw32ce"; then
disable network
else
target_os=mingw32
fi
+ decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
+ decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
LIBTARGET=i386
if enabled x86_64; then
LIBTARGET="i386:x86-64"
@@ -4446,8 +4561,19 @@ probe_libc(){
# in such new versions and producing binaries requiring windows 7.0.
# Therefore explicitly set the default to XP unless the user has
# set something else on the command line.
+ # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
+ # family. For these cases, configure is free to use any functions
+ # found in the SDK headers by default. (Alternatively, we could force
+ # _WIN32_WINNT to 0x0602 in that case.)
check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
- add_${pfx}cppflags -D_WIN32_WINNT=0x0502
+ { check_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0502; }
+#ifdef WINAPI_FAMILY
+#include <winapifamily.h>
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#error not desktop
+#endif
+#endif
+EOF
elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
eval ${pfx}libc_type=klibc
elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
@@ -4676,6 +4802,8 @@ elif enabled alpha; then
elif enabled arm; then
+ enabled msvc && check_cpp_condition stddef.h "defined _M_ARMT" && enable thumb
+
check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
float func(float a, float b){ return a+b; }
EOF
@@ -4684,7 +4812,9 @@ EOF
if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
enable vfp_args
- elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
+ elif check_cpp_condition stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
+ enable vfp_args
+ elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
case "${cross_prefix:-$cc}" in
*hardfloat*) enable vfp_args; fpabi=vfp ;;
*) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
@@ -4723,11 +4853,15 @@ EOF
elif enabled mips; then
+ enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
+ enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
+ enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
+
# Enable minimum ISA based on selected options
if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
add_cflags "-mips64r2"
add_asflags "-mips64r2"
- elif enabled mips64 && enabled mipsfpu && disabled loongson3; then
+ elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled loongson3; then
add_cflags "-mips64"
add_asflags "-mips64"
elif enabled mipsdspr1 || enabled mipsdspr2; then
@@ -4752,7 +4886,6 @@ elif enabled mips; then
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
check_inline_asm msa '"addvi.b $w0, $w1, 1"'
- enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
@@ -4969,6 +5102,7 @@ check_func_headers conio.h kbhit
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_func_headers stdlib.h getenv
+check_func_headers sys/stat.h lstat
check_func_headers windows.h CoTaskMemFree -lole32
check_func_headers windows.h GetProcessAffinityMask
@@ -4977,6 +5111,7 @@ check_func_headers windows.h GetSystemTimeAsFileTime
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h PeekNamedPipe
check_func_headers windows.h SetConsoleTextAttribute
+check_func_headers windows.h SetConsoleCtrlHandler
check_func_headers windows.h Sleep
check_func_headers windows.h VirtualAlloc
check_struct windows.h "CONDITION_VARIABLE" Ptr
@@ -4984,7 +5119,9 @@ check_func_headers glob.h glob
enabled xlib &&
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
+check_header CoreServices/CoreServices.h
check_header direct.h
+check_header dirent.h
check_header dlfcn.h
check_header d3d11.h
check_header dxva.h
@@ -5007,6 +5144,7 @@ check_header valgrind/valgrind.h
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header VideoDecodeAcceleration/VDADecoder.h
+check_header VideoToolbox/VideoToolbox.h
check_header windows.h
check_header X11/extensions/XvMClib.h
check_header asm/types.h
@@ -5017,9 +5155,14 @@ check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
-check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"
+check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
-check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0600
+check_type "windows.h d3d11.h" "ID3D11VideoContext"
+check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
+
+check_type "va/va.h" "VAPictureParameterBufferHEVC"
+
+check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
if ! disabled w32threads && ! enabled pthreads; then
check_func_headers "windows.h process.h" _beginthreadex &&
@@ -5062,6 +5205,7 @@ check_lib math.h sin -lm && LIBM="-lm"
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
atan2f_args=2
+copysign_args=2
ldexpf_args=2
powf_args=2
@@ -5089,7 +5233,8 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
-enabled libdcadec && require_pkg_config dcadec libdcadec/dca_context.h dcadec_context_create
+enabled libdcadec && require_pkg_config dcadec libdcadec/dca_context.h dcadec_context_create &&
+ check_struct libdcadec/dca_context.h "struct dcadec_exss_info" matrix_encoding
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
@@ -5105,6 +5250,7 @@ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
done || die "ERROR: libgsm not found"; }
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
+enabled libkvazaar && require_pkg_config kvazaar kvazaar.h kvz_api_get
enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
@@ -5125,12 +5271,14 @@ enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/sc
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
+enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
+enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
+enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
{ check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
@@ -5141,13 +5289,33 @@ enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvi
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
+
enabled libvpx && {
- enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
- die "ERROR: libvpx decoder version must be >=0.9.1"; }
- enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
- die "ERROR: libvpx encoder version must be >=0.9.7"; }
- enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
- enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
+ enabled libvpx_vp8_decoder && {
+ use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
+ check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
+ die "ERROR: libvpx decoder version must be >=0.9.1";
+ }
+ enabled libvpx_vp8_encoder && {
+ use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
+ check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
+ die "ERROR: libvpx encoder version must be >=0.9.7";
+ }
+ enabled libvpx_vp9_decoder && {
+ use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
+ check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
+ disable libvpx_vp9_decoder;
+ }
+ enabled libvpx_vp9_encoder && {
+ use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
+ check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
+ disable libvpx_vp9_encoder;
+ }
+ if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
+ die "libvpx enabled but no supported decoders found"
+ fi
+}
+
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
@@ -5156,8 +5324,10 @@ enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encode
{ require libx264 x264.h x264_encoder_encode -lx264 &&
warn "using libx264 without pkg-config"; } } &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
- die "ERROR: libx264 must be installed and version must be >= 0.118."; }
-enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
+ die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
+ { check_cpp_condition x264.h "X264_MPEG2" &&
+ enable libx262; }
+enabled libx265 && require_pkg_config x265 x265.h x265_api_get &&
{ check_cpp_condition x265.h "X265_BUILD >= 57" ||
die "ERROR: libx265 version must be >= 57."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
@@ -5231,6 +5401,9 @@ if ! disabled sdl; then
disable sdl
fi
fi
+ if test $target_os = "mingw32"; then
+ sdl_libs="$sdl_libs -mconsole"
+ fi
fi
enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
@@ -5394,6 +5567,7 @@ check_disable_warning -Wno-pointer-sign
check_ldflags -Wl,--warn-common
check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
+enabled rpath && add_ldlibflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
# add some strip flags
@@ -5418,7 +5592,6 @@ enabled xmm_clobber_test &&
-Wl,--wrap,avcodec_decode_video2 \
-Wl,--wrap,avcodec_decode_subtitle2 \
-Wl,--wrap,avcodec_encode_audio2 \
- -Wl,--wrap,avcodec_encode_video \
-Wl,--wrap,avcodec_encode_video2 \
-Wl,--wrap,avcodec_encode_subtitle \
-Wl,--wrap,swr_convert \
@@ -5560,8 +5733,30 @@ elif enabled_any msvc icl; then
fi
# msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
+ # The CRT headers contain __declspec(restrict) in a few places, but if redefining
+ # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
+ # (as it ends up if the restrict redefine is done before including stdlib.h), while
+ # MSVC 2013 and newer can handle it fine.
+ # If this declspec fails, force including stdlib.h before the restrict redefinition
+ # happens in config.h.
+ if [ $_restrict != restrict ]; then
+ check_cc <<EOF || add_cflags -FIstdlib.h
+__declspec($_restrict) void* foo(int);
+EOF
+ fi
+ check_func strtoll || add_cflags -Dstrtoll=_strtoi64
fi
+for pfx in "" host_; do
+ varname=${pfx%_}cc_type
+ eval "type=\$$varname"
+ if [ $type = "msvc" ]; then
+ check_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
+static inline int foo(int a) { return a; }
+EOF
+ fi
+done
+
case $as_type in
clang)
add_asflags -Qunused-arguments
@@ -5664,6 +5859,7 @@ enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
enabled resample_filter && prepend avfilter_deps "avresample"
enabled sab_filter && prepend avfilter_deps "swscale"
enabled scale_filter && prepend avfilter_deps "swscale"
+enabled scale2ref_filter && prepend avfilter_deps "swscale"
enabled showspectrum_filter && prepend avfilter_deps "avcodec"
enabled smartblur_filter && prepend avfilter_deps "swscale"
enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
@@ -5741,7 +5937,7 @@ if enabled mips; then
echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
echo "MIPS MSA enabled ${msa-no}"
- echo "LOONGSON3 enabled ${loongson3-no}"
+ echo "LOONGSON MMI enabled ${mmi-no}"
fi
if enabled ppc; then
echo "AltiVec enabled ${altivec-no}"
@@ -5772,6 +5968,10 @@ test -n "$random_seed" &&
echo "random seed ${random_seed}"
echo
+echo "Enabled programs:"
+print_enabled '' $PROGRAM_LIST | print_3_columns
+echo
+
echo "External libraries:"
print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
echo
@@ -5862,6 +6062,7 @@ DEPWINDRES=$dep_cc
DOXYGEN=$doxygen
LDFLAGS=$LDFLAGS
LDEXEFLAGS=$LDEXEFLAGS
+LDLIBFLAGS=$LDLIBFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
ASMSTRIPFLAGS=$ASMSTRIPFLAGS
YASMFLAGS=$YASMFLAGS
@@ -5979,6 +6180,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
mkdir -p doc
mkdir -p tests
+mkdir -p tests/api
echo "@c auto-generated by configure" > doc/config.texi
print_config ARCH_ "$config_files" $ARCH_LIST
@@ -6009,7 +6211,7 @@ echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
cp_if_changed $TMPH libavutil/avconfig.h
if test -n "$WARNINGS"; then
- printf "\n$WARNINGS"
+ printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
enabled fatal_warnings && exit 1
fi
@@ -6073,4 +6275,4 @@ pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVF
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
-pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"
+pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"
diff --git a/chromium/third_party/ffmpeg/doc/APIchanges b/chromium/third_party/ffmpeg/doc/APIchanges
index 6e64a05f109..958035ce777 100644
--- a/chromium/third_party/ffmpeg/doc/APIchanges
+++ b/chromium/third_party/ffmpeg/doc/APIchanges
@@ -2,19 +2,62 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
since the last major version increase or the API was added.
The last version increases were:
-libavcodec: 2014-08-09
-libavdevice: 2014-08-09
-libavfilter: 2014-08-09
-libavformat: 2014-08-09
-libavresample: 2014-08-09
-libpostproc: 2014-08-09
-libswresample: 2014-08-09
-libswscale: 2014-08-09
-libavutil: 2014-08-09
+libavcodec: 2015-08-28
+libavdevice: 2015-08-28
+libavfilter: 2015-08-28
+libavformat: 2015-08-28
+libavresample: 2015-08-28
+libpostproc: 2015-08-28
+libswresample: 2015-08-28
+libswscale: 2015-08-28
+libavutil: 2015-08-28
API changes, most recent first:
+2015-xx-xx - lavu 55.0.100 / lavu 55.0.0
+ xxxxxxx - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t.
+ xxxxxxx - Change type of AVComponentDescriptor fields from uint16_t to int
+ and drop bit packing.
+ xxxxxxx - Add step, offset, and depth to AVComponentDescriptor to replace
+ the deprecated step_minus1, offset_plus1, and depth_minus1.
+
+-------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
+
+2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
+ Deprecate old VA-API context (vaapi_context) fields that were only
+ set and used by libavcodec. They are all managed internally now.
+
+2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
+ Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
+ indicates the nature of the underlying storage: a VA surface. This
+ yields the same value as AV_PIX_FMT_VAAPI_VLD.
+ Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
+ AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
+
+2015-08-02 - lavu 54.30.100 / 54.17.0
+ 9ed59f1 / 7a7df34c - Add av_blowfish_alloc().
+ a130ec9 / ae365453 - Add av_rc4_alloc().
+ 9ca1997 / 5d8bea3b - Add av_xtea_alloc().
+ 3cf08e9 / d9e8b47e - Add av_des_alloc().
+
+2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
+ 94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
+ 444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
+ 29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
+ to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
+
+2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
+ Add AV_PKT_DATA_QUALITY_STATS to export the quality value, PSNR, and pict_type
+ of an AVPacket.
+
+2015-07-16 - 8dad213 - lavc 56.49.100
+ Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
+ and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
+
+2015-07-03 - d563e13 / 83212943 - lavu 54.28.100 / 56.15.0
+ Add av_version_info().
+
-------- 8< --------- FFmpeg 2.7 was cut here -------- 8< ---------
2015-06-04 - cc17b43 - lswr 1.2.100
@@ -692,6 +735,9 @@ API changes, most recent first:
av_ripemd_update()
av_ripemd_final()
+2013-06-10 - 82ef670 - lavu 52.35.101 - hmac.h
+ Add AV_HMAC_SHA224, AV_HMAC_SHA256, AV_HMAC_SHA384, AV_HMAC_SHA512
+
2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h
Add av_realloc_array and av_reallocp_array
diff --git a/chromium/third_party/ffmpeg/doc/Makefile b/chromium/third_party/ffmpeg/doc/Makefile
index 4573531184c..3e67c2a289f 100644
--- a/chromium/third_party/ffmpeg/doc/Makefile
+++ b/chromium/third_party/ffmpeg/doc/Makefile
@@ -36,7 +36,7 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
DOCS = $(DOCS-yes)
-DOC_EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
+DOC_EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
diff --git a/chromium/third_party/ffmpeg/doc/codecs.texi b/chromium/third_party/ffmpeg/doc/codecs.texi
index 3c035a5ecb3..b481b4a053a 100644
--- a/chromium/third_party/ffmpeg/doc/codecs.texi
+++ b/chromium/third_party/ffmpeg/doc/codecs.texi
@@ -129,7 +129,7 @@ should be @code{1 / frame_rate} and timestamp increments should be
identically 1.
@item g @var{integer} (@emph{encoding,video})
-Set the group of picture size. Default value is 12.
+Set the group of picture (GOP) size. Default value is 12.
@item ar @var{integer} (@emph{decoding/encoding,audio})
Set audio sampling rate (in Hz).
@@ -475,6 +475,9 @@ per-block quantization parameter (QP)
motion vector
@item dct_coeff
+@item green_metadata
+display complexity metadata for the upcoming frame, GoP or for a given duration.
+
@item skip
@item startcode
@@ -814,13 +817,17 @@ for codecs that support it. See also @file{doc/examples/export_mvs.c}.
Deprecated, use mpegvideo private options instead.
@item threads @var{integer} (@emph{decoding/encoding,video})
+Set the number of threads to be used, in case the selected codec
+implementation supports multi-threading.
Possible values:
@table @samp
-@item auto
-detect a good number of threads
+@item auto, 0
+automatically select the number of threads to set
@end table
+Default value is @samp{auto}.
+
@item me_threshold @var{integer} (@emph{encoding,video})
Set motion estimation threshold.
@@ -1042,7 +1049,11 @@ Possible values:
@item color_primaries @var{integer} (@emph{decoding/encoding,video})
@item color_trc @var{integer} (@emph{decoding/encoding,video})
@item colorspace @var{integer} (@emph{decoding/encoding,video})
+
@item color_range @var{integer} (@emph{decoding/encoding,video})
+If used as input parameter, it serves as a hint to the decoder, which
+color_range the input has.
+
@item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
@item log_level_offset @var{integer}
diff --git a/chromium/third_party/ffmpeg/doc/decoders.texi b/chromium/third_party/ffmpeg/doc/decoders.texi
index 2fb533ae2df..a6eb573a89b 100644
--- a/chromium/third_party/ffmpeg/doc/decoders.texi
+++ b/chromium/third_party/ffmpeg/doc/decoders.texi
@@ -25,6 +25,13 @@ enabled decoders.
A description of some of the currently available video decoders
follows.
+@section hevc
+
+HEVC / H.265 decoder.
+
+Note: the @option{skip_loop_filter} option has effect only at level
+@code{all}.
+
@section rawvideo
Raw video decoder.
@@ -188,6 +195,25 @@ without this library.
@chapter Subtitles Decoders
@c man begin SUBTILES DECODERS
+@section dvbsub
+
+@subsection Options
+
+@table @option
+@item compute_clut
+@table @option
+@item -1
+Compute clut if no matching CLUT is in the stream.
+@item 0
+Never compute CLUT
+@item 1
+Always compute CLUT and override the one provided in the stream.
+@end table
+@item dvb_substream
+Selects the dvb substream, or all substreams if -1 which is default.
+
+@end table
+
@section dvdsub
This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
diff --git a/chromium/third_party/ffmpeg/doc/demuxers.texi b/chromium/third_party/ffmpeg/doc/demuxers.texi
index 35a15614395..34bfc9bf38f 100644
--- a/chromium/third_party/ffmpeg/doc/demuxers.texi
+++ b/chromium/third_party/ffmpeg/doc/demuxers.texi
@@ -18,6 +18,12 @@ enabled demuxers.
The description of some of the currently available demuxers follows.
+@section aa
+
+Audible Format 2, 3, and 4 demuxer.
+
+This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
+
@section applehttp
Apple HTTP Live Streaming demuxer.
@@ -112,6 +118,47 @@ file is not available or accurate.
If the duration is set for all files, then it is possible to seek in the
whole concatenated video.
+@item @code{inpoint @var{timestamp}}
+In point of the file. When the demuxer opens the file it instantly seeks to the
+specified timestamp. Seeking is done so that all streams can be presented
+successfully at In point.
+
+This directive works best with intra frame codecs, because for non-intra frame
+ones you will usually get extra packets before the actual In point and the
+decoded content will most likely contain frames before In point too.
+
+For each file, packets before the file In point will have timestamps less than
+the calculated start timestamp of the file (negative in case of the first
+file), and the duration of the files (if not specified by the @code{duration}
+directive) will be reduced based on their specified In point.
+
+Because of potential packets before the specified In point, packet timestamps
+may overlap between two concatenated files.
+
+@item @code{outpoint @var{timestamp}}
+Out point of the file. When the demuxer reaches the specified decoding
+timestamp in any of the streams, it handles it as an end of file condition and
+skips the current and all the remaining packets from all streams.
+
+Out point is exclusive, which means that the demuxer will not output packets
+with a decoding timestamp greater or equal to Out point.
+
+This directive works best with intra frame codecs and formats where all streams
+are tightly interleaved. For non-intra frame codecs you will usually get
+additional packets with presentation timestamp after Out point therefore the
+decoded content will most likely contain frames after Out point too. If your
+streams are not tightly interleaved you may not get all the packets from all
+streams before Out point and you may only will be able to decode the earliest
+stream until Out point.
+
+The duration of the files (if not specified by the @code{duration}
+directive) will be reduced based on their specified Out point.
+
+@item @code{file_packet_metadata @var{key=value}}
+Metadata of the packets of the file. The specified metadata will be set for
+each file packet. You can specify this directive multiple times to add multiple
+metadata entries.
+
@item @code{stream}
Introduce a stream in the virtual file.
All subsequent stream-related directives apply to the last introduced
@@ -373,13 +420,26 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
MPEG-2 transport stream demuxer.
+This demuxer accepts the following options:
@table @option
+@item resync_size
+Set size limit for looking up a new synchronization. Default value is
+65536.
@item fix_teletext_pts
-Overrides teletext packet PTS and DTS values with the timestamps calculated
+Override teletext packet PTS and DTS values with the timestamps calculated
from the PCR of the first program which the teletext stream is part of and is
not discarded. Default value is 1, set this option to 0 if you want your
teletext packet PTS and DTS values untouched.
+
+@item ts_packetsize
+Output option carrying the raw packet size in bytes.
+Show the detected raw packet size, cannot be set by the user.
+
+@item scan_all_pmts
+Scan and combine all PMTs. The value is an integer with value from -1
+to 1 (-1 means automatic setting, 1 means enabled, 0 means
+disabled). Default value is -1.
@end table
@section rawvideo
diff --git a/chromium/third_party/ffmpeg/doc/developer.texi b/chromium/third_party/ffmpeg/doc/developer.texi
index d9ccf7b9389..b8259e75115 100644
--- a/chromium/third_party/ffmpeg/doc/developer.texi
+++ b/chromium/third_party/ffmpeg/doc/developer.texi
@@ -544,6 +544,10 @@ should not crash, end in a (near) infinite loop, or allocate ridiculous
amounts of memory when fed damaged data.
@item
+Did you test your decoder or demuxer against sample files?
+Samples may be obtained at @url{http://samples.ffmpeg.org}.
+
+@item
Does the patch not mix functional and cosmetic changes?
@item
@@ -633,6 +637,10 @@ not related to the comments received during review. Such patches will
be rejected. Instead, submit significant changes or new features as
separate patches.
+Everyone is welcome to review patches. Also if you are waiting for your patch
+to be reviewed, please consider helping to review other patches, that is a great
+way to get everyone's patches reviewed sooner.
+
@anchor{Regression tests}
@section Regression tests
diff --git a/chromium/third_party/ffmpeg/doc/encoders.texi b/chromium/third_party/ffmpeg/doc/encoders.texi
index 8b0ecb717dd..3550bcc6991 100644
--- a/chromium/third_party/ffmpeg/doc/encoders.texi
+++ b/chromium/third_party/ffmpeg/doc/encoders.texi
@@ -1342,6 +1342,88 @@ disabled
A description of some of the currently available video encoders
follows.
+@section libopenh264
+
+Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
+
+This encoder requires the presence of the libopenh264 headers and
+library during configuration. You need to explicitly configure the
+build with @code{--enable-libopenh264}. The library is detected using
+@command{pkg-config}.
+
+For more information about the library see
+@url{http://www.openh264.org}.
+
+@subsection Options
+
+The following FFmpeg global options affect the configurations of the
+libopenh264 encoder.
+
+@table @option
+@item b
+Set the bitrate (as a number of bits per second).
+
+@item g
+Set the GOP size.
+
+@item maxrate
+Set the max bitrate (as a number of bits per second).
+
+@item flags +global_header
+Set global header in the bitstream.
+
+@item slices
+Set the number of slices, used in parallelized encoding. Default value
+is 0. This is only used when @option{slice_mode} is set to
+@samp{fixed}.
+
+@item slice_mode
+Set slice mode. Can assume one of the follwing possible values:
+
+@table @samp
+@item fixed
+a fixed number of slices
+@item rowmb
+one slice per row of macroblocks
+@item auto
+automatic number of slices according to number of thread
+@end table
+
+Default value is @samp{auto}.
+
+@item loopfilter
+Enable loop filter, if set to 1 (automatically enabled). To disable
+set a value of 0.
+
+@item profile
+Set profile restrictions. If set to the value of @samp{main} enable
+CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
+@end table
+
+@section jpeg2000
+
+The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
+option can be used to set the encoding quality. Lossless encoding
+can be selected with @code{-pred 1}.
+
+@subsection Options
+
+@table @option
+@item format
+Can be set to either @code{j2k} or @code{jp2} (the default) that
+allows to store non-rgb pix_fmts.
+
+@end table
+
+@section snow
+
+@subsection Options
+
+@table @option
+@item iterative_dia_size
+dia size for the iterative motion estimation
+@end table
+
@section libtheora
libtheora Theora encoder wrapper.
@@ -1550,6 +1632,18 @@ Enable frame parallel decodability features.
@item aq-mode
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
cyclic refresh).
+@item colorspace @emph{color-space}
+Set input color space. The VP9 bitstream supports signaling the following
+colorspaces:
+@table @option
+@item @samp{rgb} @emph{sRGB}
+@item @samp{bt709} @emph{bt709}
+@item @samp{unspecified} @emph{unknown}
+@item @samp{bt470bg} @emph{bt601}
+@item @samp{smpte170m} @emph{smpte170}
+@item @samp{smpte240m} @emph{smpte240}
+@item @samp{bt2020_ncl} @emph{bt2020}
+@end table
@end table
@end table
@@ -2288,6 +2382,30 @@ Setting a higher @option{bits_per_mb} limit will improve the speed.
For the fastest encoding speed set the @option{qscale} parameter (4 is the
recommended value) and do not set a size constraint.
+@section libkvazaar
+
+Kvazaar H.265/HEVC encoder.
+
+Requires the presence of the libkvazaar headers and library during
+configuration. You need to explicitly configure the build with
+@option{--enable-libkvazaar}.
+
+@subsection Options
+
+@table @option
+
+@item b
+Set target video bitrate in bit/s and enable rate control.
+
+@item threads
+Set number of encoding threads.
+
+@item kvazaar-params
+Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
+by commas (,). See kvazaar documentation for a list of options.
+
+@end table
+
@c man end VIDEO ENCODERS
@chapter Subtitles Encoders
diff --git a/chromium/third_party/ffmpeg/doc/examples/Makefile b/chromium/third_party/ffmpeg/doc/examples/Makefile
index 9699f11d439..af3815995a0 100644
--- a/chromium/third_party/ffmpeg/doc/examples/Makefile
+++ b/chromium/third_party/ffmpeg/doc/examples/Makefile
@@ -11,13 +11,14 @@ CFLAGS += -Wall -g
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
-EXAMPLES= avio_list_dir \
+EXAMPLES= avio_dir_cmd \
avio_reading \
decoding_encoding \
demuxing_decoding \
extract_mvs \
filtering_video \
filtering_audio \
+ http_multiclient \
metadata \
muxing \
remuxing \
diff --git a/chromium/third_party/ffmpeg/doc/examples/avio_list_dir.c b/chromium/third_party/ffmpeg/doc/examples/avio_dir_cmd.c
index 4060ba6213d..50c435cf8f8 100644
--- a/chromium/third_party/ffmpeg/doc/examples/avio_list_dir.c
+++ b/chromium/third_party/ffmpeg/doc/examples/avio_dir_cmd.c
@@ -54,28 +54,13 @@ static const char *type_string(int type)
return "<UNKNOWN>";
}
-int main(int argc, char *argv[])
+static int list_op(const char *input_dir)
{
- const char *input_dir = NULL;
AVIODirEntry *entry = NULL;
AVIODirContext *ctx = NULL;
int cnt, ret;
char filemode[4], uid_and_gid[20];
- av_log_set_level(AV_LOG_DEBUG);
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s input_dir\n"
- "API example program to show how to list files in directory "
- "accessed through AVIOContext.\n", argv[0]);
- return 1;
- }
- input_dir = argv[1];
-
- /* register codecs and formats and other lavf/lavc components*/
- av_register_all();
- avformat_network_init();
-
if ((ret = avio_open_dir(&ctx, input_dir, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open directory: %s.\n", av_err2str(ret));
goto fail;
@@ -114,6 +99,81 @@ int main(int argc, char *argv[])
fail:
avio_close_dir(&ctx);
+ return ret;
+}
+
+static int del_op(const char *url)
+{
+ int ret = avpriv_io_delete(url);
+ if (ret < 0)
+ av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
+ return ret;
+}
+
+static int move_op(const char *src, const char *dst)
+{
+ int ret = avpriv_io_move(src, dst);
+ if (ret < 0)
+ av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
+ return ret;
+}
+
+
+static void usage(const char *program_name)
+{
+ fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
+ "API example program to show how to manipulate resources "
+ "accessed through AVIOContext.\n"
+ "OPERATIONS:\n"
+ "list list content of the directory\n"
+ "move rename content in directory\n"
+ "del delete content in directory\n",
+ program_name);
+}
+
+int main(int argc, char *argv[])
+{
+ const char *op = NULL;
+ int ret;
+
+ av_log_set_level(AV_LOG_DEBUG);
+
+ if (argc < 2) {
+ usage(argv[0]);
+ return 1;
+ }
+
+ /* register codecs and formats and other lavf/lavc components*/
+ av_register_all();
+ avformat_network_init();
+
+ op = argv[1];
+ if (strcmp(op, "list") == 0) {
+ if (argc < 3) {
+ av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
+ ret = AVERROR(EINVAL);
+ } else {
+ ret = list_op(argv[2]);
+ }
+ } else if (strcmp(op, "del") == 0) {
+ if (argc < 3) {
+ av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
+ ret = AVERROR(EINVAL);
+ } else {
+ ret = del_op(argv[2]);
+ }
+ } else if (strcmp(op, "move") == 0) {
+ if (argc < 4) {
+ av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
+ ret = AVERROR(EINVAL);
+ } else {
+ ret = move_op(argv[2], argv[3]);
+ }
+ } else {
+ av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
+ ret = AVERROR(EINVAL);
+ }
+
avformat_network_deinit();
return ret < 0 ? 1 : 0;
diff --git a/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c b/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
index f6643f67ef2..fb386eb1844 100644
--- a/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
+++ b/chromium/third_party/ffmpeg/doc/examples/decoding_encoding.c
@@ -245,7 +245,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
AVCodecContext *c= NULL;
int len;
FILE *f, *outfile;
- uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt;
AVFrame *decoded_frame = NULL;
@@ -538,13 +538,13 @@ static void video_decode_example(const char *outfilename, const char *filename)
int frame_count;
FILE *f;
AVFrame *frame;
- uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt;
av_init_packet(&avpkt);
/* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
- memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
printf("Decode video file %s to %s\n", filename, outfilename);
@@ -561,8 +561,8 @@ static void video_decode_example(const char *outfilename, const char *filename)
exit(1);
}
- if(codec->capabilities&CODEC_CAP_TRUNCATED)
- c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
+ if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
+ c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
/* For some codecs, such as msmpeg4 and mpeg4, width and height
MUST be initialized there because this information is not
diff --git a/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c b/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
index 98b3a830971..e6624076cfe 100644
--- a/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
+++ b/chromium/third_party/ffmpeg/doc/examples/demuxing_decoding.c
@@ -55,17 +55,11 @@ static AVPacket pkt;
static int video_frame_count = 0;
static int audio_frame_count = 0;
-/* The different ways of decoding and managing data memory. You are not
- * supposed to support all the modes in your application but pick the one most
- * appropriate to your needs. Look for the use of api_mode in this example to
- * see what are the differences of API usage between them */
-enum {
- API_MODE_OLD = 0, /* old method, deprecated */
- API_MODE_NEW_API_REF_COUNT = 1, /* new method, using the frame reference counting */
- API_MODE_NEW_API_NO_REF_COUNT = 2, /* new method, without reference counting */
-};
-
-static int api_mode = API_MODE_OLD;
+/* Enable or disable frame reference counting. You are not supposed to support
+ * both paths in your application but pick the one most appropriate to your
+ * needs. Look for the use of refcount in this example to see what are the
+ * differences of API usage between them. */
+static int refcount = 0;
static int decode_packet(int *got_frame, int cached)
{
@@ -145,9 +139,9 @@ static int decode_packet(int *got_frame, int cached)
}
}
- /* If we use the new API with reference counting, we own the data and need
+ /* If we use frame reference counting, we own the data and need
* to de-reference it when we don't use it anymore */
- if (*got_frame && api_mode == API_MODE_NEW_API_REF_COUNT)
+ if (*got_frame && refcount)
av_frame_unref(frame);
return decoded;
@@ -181,8 +175,7 @@ static int open_codec_context(int *stream_idx,
}
/* Init the decoders, with or without reference counting */
- if (api_mode == API_MODE_NEW_API_REF_COUNT)
- av_dict_set(&opts, "refcounted_frames", "1", 0);
+ av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0);
if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
fprintf(stderr, "Failed to open %s codec\n",
av_get_media_type_string(type));
@@ -228,28 +221,19 @@ int main (int argc, char **argv)
int ret = 0, got_frame;
if (argc != 4 && argc != 5) {
- fprintf(stderr, "usage: %s [-refcount=<old|new_norefcount|new_refcount>] "
- "input_file video_output_file audio_output_file\n"
+ fprintf(stderr, "usage: %s [-refcount] input_file video_output_file audio_output_file\n"
"API example program to show how to read frames from an input file.\n"
"This program reads frames from a file, decodes them, and writes decoded\n"
"video frames to a rawvideo file named video_output_file, and decoded\n"
"audio frames to a rawaudio file named audio_output_file.\n\n"
"If the -refcount option is specified, the program use the\n"
"reference counting frame system which allows keeping a copy of\n"
- "the data for longer than one decode call. If unset, it's using\n"
- "the classic old method.\n"
+ "the data for longer than one decode call.\n"
"\n", argv[0]);
exit(1);
}
- if (argc == 5) {
- const char *mode = argv[1] + strlen("-refcount=");
- if (!strcmp(mode, "old")) api_mode = API_MODE_OLD;
- else if (!strcmp(mode, "new_norefcount")) api_mode = API_MODE_NEW_API_NO_REF_COUNT;
- else if (!strcmp(mode, "new_refcount")) api_mode = API_MODE_NEW_API_REF_COUNT;
- else {
- fprintf(stderr, "unknow mode '%s'\n", mode);
- exit(1);
- }
+ if (argc == 5 && !strcmp(argv[1], "-refcount")) {
+ refcount = 1;
argv++;
}
src_filename = argv[1];
@@ -315,12 +299,7 @@ int main (int argc, char **argv)
goto end;
}
- /* When using the new API, you need to use the libavutil/frame.h API, while
- * the classic frame management is available in libavcodec */
- if (api_mode == API_MODE_OLD)
- frame = avcodec_alloc_frame();
- else
- frame = av_frame_alloc();
+ frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate frame\n");
ret = AVERROR(ENOMEM);
@@ -397,10 +376,7 @@ end:
fclose(video_dst_file);
if (audio_dst_file)
fclose(audio_dst_file);
- if (api_mode == API_MODE_OLD)
- avcodec_free_frame(&frame);
- else
- av_frame_free(&frame);
+ av_frame_free(&frame);
av_free(video_dst_data[0]);
return ret < 0;
diff --git a/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c b/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
index f5cb8eb8a1a..6c74ec326d7 100644
--- a/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
+++ b/chromium/third_party/ffmpeg/doc/examples/filtering_audio.c
@@ -33,7 +33,6 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
-#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/opt.h>
diff --git a/chromium/third_party/ffmpeg/doc/examples/filtering_video.c b/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
index c02040ae350..5600572dec0 100644
--- a/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
+++ b/chromium/third_party/ffmpeg/doc/examples/filtering_video.c
@@ -33,12 +33,14 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
-#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/opt.h>
-const char *filter_descr = "scale=78:24";
+const char *filter_descr = "scale=78:24,transpose=cclock";
+/* other way:
+ scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively
+ */
static AVFormatContext *fmt_ctx;
static AVCodecContext *dec_ctx;
diff --git a/chromium/third_party/ffmpeg/doc/examples/http_multiclient.c b/chromium/third_party/ffmpeg/doc/examples/http_multiclient.c
new file mode 100644
index 00000000000..b9a306d8354
--- /dev/null
+++ b/chromium/third_party/ffmpeg/doc/examples/http_multiclient.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2015 Stephan Holljes
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * libavformat multi-client network API usage example.
+ *
+ * @example http_multiclient.c
+ * This example will serve a file without decoding or demuxing it over http.
+ * Multiple clients can connect and will receive the same file.
+ */
+
+#include <libavformat/avformat.h>
+#include <libavutil/opt.h>
+#include <unistd.h>
+
+void process_client(AVIOContext *client, const char *in_uri)
+{
+ AVIOContext *input = NULL;
+ uint8_t buf[1024];
+ int ret, n, reply_code;
+ char *resource = NULL;
+ while ((ret = avio_handshake(client)) > 0) {
+ av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
+ // check for strlen(resource) is necessary, because av_opt_get()
+ // may return empty string.
+ if (resource && strlen(resource))
+ break;
+ }
+ if (ret < 0)
+ goto end;
+ av_log(client, AV_LOG_TRACE, "resource=%p\n", resource);
+ if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) {
+ reply_code = 200;
+ } else {
+ reply_code = AVERROR_HTTP_NOT_FOUND;
+ }
+ if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) {
+ av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret));
+ goto end;
+ }
+ av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code);
+
+ while ((ret = avio_handshake(client)) > 0);
+
+ if (ret < 0)
+ goto end;
+
+ fprintf(stderr, "Handshake performed.\n");
+ if (reply_code != 200)
+ goto end;
+ fprintf(stderr, "Opening input file.\n");
+ if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) {
+ av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri,
+ av_err2str(ret));
+ goto end;
+ }
+ for(;;) {
+ n = avio_read(input, buf, sizeof(buf));
+ if (n < 0) {
+ if (n == AVERROR_EOF)
+ break;
+ av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n",
+ av_err2str(n));
+ break;
+ }
+ avio_write(client, buf, n);
+ avio_flush(client);
+ }
+end:
+ fprintf(stderr, "Flushing client\n");
+ avio_flush(client);
+ fprintf(stderr, "Closing client\n");
+ avio_close(client);
+ fprintf(stderr, "Closing input\n");
+ avio_close(input);
+}
+
+int main(int argc, char **argv)
+{
+ av_log_set_level(AV_LOG_TRACE);
+ AVDictionary *options = NULL;
+ AVIOContext *client = NULL, *server = NULL;
+ const char *in_uri, *out_uri;
+ int ret, pid;
+ if (argc < 3) {
+ printf("usage: %s input http://hostname[:port]\n"
+ "API example program to serve http to multiple clients.\n"
+ "\n", argv[0]);
+ return 1;
+ }
+
+ in_uri = argv[1];
+ out_uri = argv[2];
+
+ av_register_all();
+ avformat_network_init();
+
+ if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) {
+ fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret));
+ return ret;
+ }
+ if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) {
+ fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret));
+ return ret;
+ }
+ fprintf(stderr, "Entering main loop.\n");
+ for(;;) {
+ if ((ret = avio_accept(server, &client)) < 0)
+ goto end;
+ fprintf(stderr, "Accepted client, forking process.\n");
+ // XXX: Since we don't reap our children and don't ignore signals
+ // this produces zombie processes.
+ pid = fork();
+ if (pid < 0) {
+ perror("Fork failed");
+ ret = AVERROR(errno);
+ goto end;
+ }
+ if (pid == 0) {
+ fprintf(stderr, "In child.\n");
+ process_client(client, in_uri);
+ avio_close(server);
+ exit(0);
+ }
+ if (pid > 0)
+ avio_close(client);
+ }
+end:
+ avio_close(server);
+ if (ret < 0 && ret != AVERROR_EOF) {
+ fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret));
+ return 1;
+ }
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/doc/examples/muxing.c b/chromium/third_party/ffmpeg/doc/examples/muxing.c
index 8b0ea60bb3b..b5bd54a105e 100644
--- a/chromium/third_party/ffmpeg/doc/examples/muxing.c
+++ b/chromium/third_party/ffmpeg/doc/examples/muxing.c
@@ -172,7 +172,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
/* Some formats want stream headers to be separate. */
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
/**************************************************************/
@@ -230,7 +230,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
/* increment frequency by 110 Hz per second */
ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
- if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
+ if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
nb_samples = 10000;
else
nb_samples = c->frame_size;
diff --git a/chromium/third_party/ffmpeg/doc/examples/qsvdec.c b/chromium/third_party/ffmpeg/doc/examples/qsvdec.c
index 6dbb21031db..04e5b5f85d1 100644
--- a/chromium/third_party/ffmpeg/doc/examples/qsvdec.c
+++ b/chromium/third_party/ffmpeg/doc/examples/qsvdec.c
@@ -405,7 +405,7 @@ int main(int argc, char **argv)
decoder_ctx->codec_id = AV_CODEC_ID_H264;
if (video_st->codec->extradata_size) {
decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!decoder_ctx->extradata) {
ret = AVERROR(ENOMEM);
goto finish;
diff --git a/chromium/third_party/ffmpeg/doc/examples/remuxing.c b/chromium/third_party/ffmpeg/doc/examples/remuxing.c
index e9758a8dcb6..33037f77ad3 100644
--- a/chromium/third_party/ffmpeg/doc/examples/remuxing.c
+++ b/chromium/third_party/ffmpeg/doc/examples/remuxing.c
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
}
out_stream->codec->codec_tag = 0;
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
- out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
av_dump_format(ofmt_ctx, 0, out_filename, 1);
diff --git a/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c b/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
index 339d65c71cd..a09b30d1481 100644
--- a/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
+++ b/chromium/third_party/ffmpeg/doc/examples/transcode_aac.c
@@ -192,7 +192,7 @@ static int open_output_file(const char *filename,
* Mark the encoder so that it behaves accordingly.
*/
if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER)
- (*output_codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ (*output_codec_context)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
/** Open the encoder for the audio stream to use it later. */
if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) < 0) {
diff --git a/chromium/third_party/ffmpeg/doc/examples/transcoding.c b/chromium/third_party/ffmpeg/doc/examples/transcoding.c
index 980e1f101bf..20c9e272caf 100644
--- a/chromium/third_party/ffmpeg/doc/examples/transcoding.c
+++ b/chromium/third_party/ffmpeg/doc/examples/transcoding.c
@@ -31,7 +31,6 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
-#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/opt.h>
@@ -161,7 +160,7 @@ static int open_output_file(const char *filename)
}
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
- enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
av_dump_format(ofmt_ctx, 0, filename, 1);
@@ -449,7 +448,7 @@ static int flush_encoder(unsigned int stream_index)
int got_frame;
if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities &
- CODEC_CAP_DELAY))
+ AV_CODEC_CAP_DELAY))
return 0;
while (1) {
diff --git a/chromium/third_party/ffmpeg/doc/ffmpeg.texi b/chromium/third_party/ffmpeg/doc/ffmpeg.texi
index 4d73788143f..f4ffc6cab96 100644
--- a/chromium/third_party/ffmpeg/doc/ffmpeg.texi
+++ b/chromium/third_party/ffmpeg/doc/ffmpeg.texi
@@ -280,13 +280,15 @@ data read from the input file.
When used as an output option (before an output filename), stop writing the
output after its duration reaches @var{duration}.
-@var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
+@var{duration} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
-to and -t are mutually exclusive and -t has priority.
@item -to @var{position} (@emph{output})
Stop writing the output at @var{position}.
-@var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
+@var{position} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
-to and -t are mutually exclusive and -t has priority.
@@ -295,8 +297,8 @@ Set the file size limit, expressed in bytes.
@item -ss @var{position} (@emph{input/output})
When used as an input option (before @code{-i}), seeks in this input file to
-@var{position}. Note the in most formats it is not possible to seek exactly, so
-@command{ffmpeg} will seek to the closest seek point before @var{position}.
+@var{position}. Note that in most formats it is not possible to seek exactly,
+so @command{ffmpeg} will seek to the closest seek point before @var{position}.
When transcoding and @option{-accurate_seek} is enabled (the default), this
extra segment between the seek point and @var{position} will be decoded and
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
@@ -305,7 +307,13 @@ will be preserved.
When used as an output option (before an output filename), decodes but discards
input until the timestamps reach @var{position}.
-@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
+@var{position} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
+
+@item -sseof @var{position} (@emph{input/output})
+
+Like the @code{-ss} option but relative to the "end of file". That is negative
+values are earlier in the file, 0 is at EOF.
@item -itsoffset @var{offset} (@emph{input})
Set the input time offset.
@@ -320,7 +328,7 @@ the time duration specified in @var{offset}.
@item -timestamp @var{date} (@emph{output})
Set the recording timestamp in the container.
-@var{date} must be a time duration specification,
+@var{date} must be a date specification,
see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
@@ -690,6 +698,10 @@ is not specified, the value of the @var{DISPLAY} environment variable is used
For DXVA2, this option should contain the number of the display adapter to use.
If this option is not specified, the default adapter is used.
@end table
+
+@item -hwaccels
+List all hardware acceleration methods supported in this build of ffmpeg.
+
@end table
@section Audio Options
diff --git a/chromium/third_party/ffmpeg/doc/ffplay.texi b/chromium/third_party/ffmpeg/doc/ffplay.texi
index 1ee3c304693..be696c8f662 100644
--- a/chromium/third_party/ffmpeg/doc/ffplay.texi
+++ b/chromium/third_party/ffmpeg/doc/ffplay.texi
@@ -47,9 +47,17 @@ Disable video.
@item -sn
Disable subtitles.
@item -ss @var{pos}
-Seek to a given position in seconds.
+Seek to @var{pos}. Note that in most formats it is not possible to seek
+exactly, so @command{ffplay} will seek to the nearest seek point to
+@var{pos}.
+
+@var{pos} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -t @var{duration}
-play <duration> seconds of audio/video
+Play @var{duration} seconds of audio/video.
+
+@var{duration} must be a time duration specification,
+see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -bytes
Seek by bytes.
@item -nodisp
diff --git a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
index 3b8581368d7..509c8bca7c7 100644
--- a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
+++ b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
@@ -36,8 +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.
@item @var{stream_type}[:@var{stream_index}]
-@var{stream_type} is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
-'d' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
+@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
+streams, 'V' only matches video streams which are not attached pictures, video
+thumbnails or cover arts. If @var{stream_index} is given, then it matches
stream number @var{stream_index} of this type. Otherwise, it matches all
streams of this type.
@item p:@var{program_id}[:@var{stream_index}]
diff --git a/chromium/third_party/ffmpeg/doc/filter_design.txt b/chromium/third_party/ffmpeg/doc/filter_design.txt
index fca24a94b5a..d784d8471e4 100644
--- a/chromium/third_party/ffmpeg/doc/filter_design.txt
+++ b/chromium/third_party/ffmpeg/doc/filter_design.txt
@@ -98,7 +98,7 @@ Buffer references ownership and permissions
The AVFilterLink structure has a few AVFilterBufferRef fields. The
cur_buf and out_buf were used with the deprecated
start_frame/draw_slice/end_frame API and should no longer be used.
- src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
+ src_buf and partial_buf are used by libavfilter internally
and must not be accessed by filters.
Reference permissions
diff --git a/chromium/third_party/ffmpeg/doc/filters.texi b/chromium/third_party/ffmpeg/doc/filters.texi
index 82e23c820e3..4958374edf0 100644
--- a/chromium/third_party/ffmpeg/doc/filters.texi
+++ b/chromium/third_party/ffmpeg/doc/filters.texi
@@ -318,6 +318,54 @@ build.
Below is a description of the currently available audio filters.
+@section acrossfade
+
+Apply cross fade from one input audio stream to another input audio stream.
+The cross fade is applied for specified duration near the end of first stream.
+
+The filter accepts the following options:
+
+@table @option
+@item nb_samples, ns
+Specify the number of samples for which the cross fade effect has to last.
+At the end of the cross fade effect the first input audio will be completely
+silent. Default is 44100.
+
+@item duration, d
+Specify the duration of the cross fade effect. See
+@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
+for the accepted syntax.
+By default the duration is determined by @var{nb_samples}.
+If set this option is used instead of @var{nb_samples}.
+
+@item overlap, o
+Should first stream end overlap with second stream start. Default is enabled.
+
+@item curve1
+Set curve for cross fade transition for first stream.
+
+@item curve2
+Set curve for cross fade transition for second stream.
+
+For description of available curve types see @ref{afade} filter description.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Cross fade from one input to another:
+@example
+ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
+@end example
+
+@item
+Cross fade from one input to another but without overlapping:
+@example
+ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
+@end example
+@end itemize
+
@section adelay
Delay one or more audio channels.
@@ -469,6 +517,7 @@ aeval=val(0)|-val(1)
@end example
@end itemize
+@anchor{afade}
@section afade
Apply fade-in/out effect to input audio.
@@ -592,6 +641,41 @@ Force the output to either unsigned 8-bit or signed 16-bit stereo
aformat=sample_fmts=u8|s16:channel_layouts=stereo
@end example
+@section alimiter
+
+The limiter prevents input signal from raising over a desired threshold.
+This limiter uses lookahead technology to prevent your signal from distorting.
+It means that there is a small delay after signal is processed. Keep in mind
+that the delay it produces is the attack time you set.
+
+The filter accepts the following options:
+
+@table @option
+@item limit
+Don't let signals above this level pass the limiter. The removed amplitude is
+added automatically. Default is 1.
+
+@item attack
+The limiter will reach its attenuation level in this amount of time in
+milliseconds. Default is 5 milliseconds.
+
+@item release
+Come back from limiting to attenuation 1.0 in this amount of milliseconds.
+Default is 50 milliseconds.
+
+@item asc
+When gain reduction is always needed ASC takes care of releasing to an
+average reduction level rather than reaching a reduction of 0 in the release
+time.
+
+@item asc_level
+Select how much the release time is affected by ASC, 0 means nearly no changes
+in release time while 1 produces higher release times.
+@end table
+
+Depending on picked setting it is recommended to upsample input 2x or 4x times
+with @ref{aresample} before applying this filter.
+
@section allpass
Apply a two-pole all-pass filter with central frequency (in Hz)
@@ -622,6 +706,7 @@ slope
Specify the band-width of a filter in width_type units.
@end table
+@anchor{amerge}
@section amerge
Merge two or more audio streams into a single multi-channel stream.
@@ -941,6 +1026,52 @@ It accepts the following option:
@item length
Short window length in seconds, used for peak and trough RMS measurement.
Default is @code{0.05} (50 milliseconds). Allowed range is @code{[0.1 - 10]}.
+
+@item metadata
+
+Set metadata injection. All the metadata keys are prefixed with @code{lavfi.astats.X},
+where @code{X} is channel number starting from 1 or string @code{Overall}. Default is
+disabled.
+
+Available keys for each channel are:
+DC_offset
+Min_level
+Max_level
+Min_difference
+Max_difference
+Mean_difference
+Peak_level
+RMS_peak
+RMS_trough
+Crest_factor
+Flat_factor
+Peak_count
+Bit_depth
+
+and for Overall:
+DC_offset
+Min_level
+Max_level
+Min_difference
+Max_difference
+Mean_difference
+Peak_level
+RMS_level
+RMS_peak
+RMS_trough
+Flat_factor
+Peak_count
+Bit_depth
+Number_of_samples
+
+For example full key look like this @code{lavfi.astats.1.DC_offset} or
+this @code{lavfi.astats.Overall.Peak_count}.
+
+For description what each key means read bellow.
+
+@item reset
+Set number of frame after which stats are going to be recalculated.
+Default is disabled.
@end table
A description of each shown parameter follows:
@@ -955,6 +1086,16 @@ Minimal sample level.
@item Max level
Maximal sample level.
+@item Min difference
+Minimal difference between two consecutive samples.
+
+@item Max difference
+Maximal difference between two consecutive samples.
+
+@item Mean difference
+Mean difference between two consecutive samples.
+The average of each difference between two consecutive samples.
+
@item Peak level dB
@item RMS level dB
Standard peak and RMS level measured in dBFS.
@@ -973,6 +1114,9 @@ Flatness (i.e. consecutive samples with the same value) of the signal at its pea
@item Peak count
Number of occasions (not the number of samples) that the signal attained either
@var{Min level} or @var{Max level}.
+
+@item Bit depth
+Overall bit depth of audio. Number of bits used for each sample.
@end table
@section astreamsync
@@ -1303,7 +1447,7 @@ the input.
To fix a 5.1 WAV improperly encoded in AAC's native channel order
@example
-ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
+ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
@end example
@section channelsplit
@@ -1403,6 +1547,8 @@ situations, the attack time (response to the audio getting louder) should be
shorter than the decay time, because the human ear is more sensitive to sudden
loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
a typical value for decay is 0.8 seconds.
+If specified number of attacks & decays is lower than number of channels, the last
+set attack/decay will be used for all remaining channels.
@item points
A list of points for the transfer function, specified in dB relative to the
@@ -1485,6 +1631,164 @@ 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 dynaudnorm
+Dynamic Audio Normalizer.
+
+This filter applies a certain amount of gain to the input audio in order
+to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
+contrast to more "simple" normalization algorithms, the Dynamic Audio
+Normalizer *dynamically* re-adjusts the gain factor to the input audio.
+This allows for applying extra gain to the "quiet" sections of the audio
+while avoiding distortions or clipping the "loud" sections. In other words:
+The Dynamic Audio Normalizer will "even out" the volume of quiet and loud
+sections, in the sense that the volume of each section is brought to the
+same target level. Note, however, that the Dynamic Audio Normalizer achieves
+this goal *without* applying "dynamic range compressing". It will retain 100%
+of the dynamic range *within* each section of the audio file.
+
+@table @option
+@item f
+Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
+Default is 500 milliseconds.
+The Dynamic Audio Normalizer processes the input audio in small chunks,
+referred to as frames. This is required, because a peak magnitude has no
+meaning for just a single sample value. Instead, we need to determine the
+peak magnitude for a contiguous sequence of sample values. While a "standard"
+normalizer would simply use the peak magnitude of the complete file, the
+Dynamic Audio Normalizer determines the peak magnitude individually for each
+frame. The length of a frame is specified in milliseconds. By default, the
+Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
+been found to give good results with most files.
+Note that the exact frame length, in number of samples, will be determined
+automatically, based on the sampling rate of the individual input audio file.
+
+@item g
+Set the Gaussian filter window size. In range from 3 to 301, must be odd
+number. Default is 31.
+Probably the most important parameter of the Dynamic Audio Normalizer is the
+@code{window size} of the Gaussian smoothing filter. The filter's window size
+is specified in frames, centered around the current frame. For the sake of
+simplicity, this must be an odd number. Consequently, the default value of 31
+takes into account the current frame, as well as the 15 preceding frames and
+the 15 subsequent frames. Using a larger window results in a stronger
+smoothing effect and thus in less gain variation, i.e. slower gain
+adaptation. Conversely, using a smaller window results in a weaker smoothing
+effect and thus in more gain variation, i.e. faster gain adaptation.
+In other words, the more you increase this value, the more the Dynamic Audio
+Normalizer will behave like a "traditional" normalization filter. On the
+contrary, the more you decrease this value, the more the Dynamic Audio
+Normalizer will behave like a dynamic range compressor.
+
+@item p
+Set the target peak value. This specifies the highest permissible magnitude
+level for the normalized audio input. This filter will try to approach the
+target peak magnitude as closely as possible, but at the same time it also
+makes sure that the normalized signal will never exceed the peak magnitude.
+A frame's maximum local gain factor is imposed directly by the target peak
+magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
+It is not recommended to go above this value.
+
+@item m
+Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
+The Dynamic Audio Normalizer determines the maximum possible (local) gain
+factor for each input frame, i.e. the maximum gain factor that does not
+result in clipping or distortion. The maximum gain factor is determined by
+the frame's highest magnitude sample. However, the Dynamic Audio Normalizer
+additionally bounds the frame's maximum gain factor by a predetermined
+(global) maximum gain factor. This is done in order to avoid excessive gain
+factors in "silent" or almost silent frames. By default, the maximum gain
+factor is 10.0, For most inputs the default value should be sufficient and
+it usually is not recommended to increase this value. Though, for input
+with an extremely low overall volume level, it may be necessary to allow even
+higher gain factors. Note, however, that the Dynamic Audio Normalizer does
+not simply apply a "hard" threshold (i.e. cut off values above the threshold).
+Instead, a "sigmoid" threshold function will be applied. This way, the
+gain factors will smoothly approach the threshold value, but never exceed that
+value.
+
+@item r
+Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
+By default, the Dynamic Audio Normalizer performs "peak" normalization.
+This means that the maximum local gain factor for each frame is defined
+(only) by the frame's highest magnitude sample. This way, the samples can
+be amplified as much as possible without exceeding the maximum signal
+level, i.e. without clipping. Optionally, however, the Dynamic Audio
+Normalizer can also take into account the frame's root mean square,
+abbreviated RMS. In electrical engineering, the RMS is commonly used to
+determine the power of a time-varying signal. It is therefore considered
+that the RMS is a better approximation of the "perceived loudness" than
+just looking at the signal's peak magnitude. Consequently, by adjusting all
+frames to a constant RMS value, a uniform "perceived loudness" can be
+established. If a target RMS value has been specified, a frame's local gain
+factor is defined as the factor that would result in exactly that RMS value.
+Note, however, that the maximum local gain factor is still restricted by the
+frame's highest magnitude sample, in order to prevent clipping.
+
+@item n
+Enable channels coupling. By default is enabled.
+By default, the Dynamic Audio Normalizer will amplify all channels by the same
+amount. This means the same gain factor will be applied to all channels, i.e.
+the maximum possible gain factor is determined by the "loudest" channel.
+However, in some recordings, it may happen that the volume of the different
+channels is uneven, e.g. one channel may be "quieter" than the other one(s).
+In this case, this option can be used to disable the channel coupling. This way,
+the gain factor will be determined independently for each channel, depending
+only on the individual channel's highest magnitude sample. This allows for
+harmonizing the volume of the different channels.
+
+@item c
+Enable DC bias correction. By default is disabled.
+An audio signal (in the time domain) is a sequence of sample values.
+In the Dynamic Audio Normalizer these sample values are represented in the
+-1.0 to 1.0 range, regardless of the original input format. Normally, the
+audio signal, or "waveform", should be centered around the zero point.
+That means if we calculate the mean value of all samples in a file, or in a
+single frame, then the result should be 0.0 or at least very close to that
+value. If, however, there is a significant deviation of the mean value from
+0.0, in either positive or negative direction, this is referred to as a
+DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
+Audio Normalizer provides optional DC bias correction.
+With DC bias correction enabled, the Dynamic Audio Normalizer will determine
+the mean value, or "DC correction" offset, of each input frame and subtract
+that value from all of the frame's sample values which ensures those samples
+are centered around 0.0 again. Also, in order to avoid "gaps" at the frame
+boundaries, the DC correction offset values will be interpolated smoothly
+between neighbouring frames.
+
+@item b
+Enable alternative boundary mode. By default is disabled.
+The Dynamic Audio Normalizer takes into account a certain neighbourhood
+around each frame. This includes the preceding frames as well as the
+subsequent frames. However, for the "boundary" frames, located at the very
+beginning and at the very end of the audio file, not all neighbouring
+frames are available. In particular, for the first few frames in the audio
+file, the preceding frames are not known. And, similarly, for the last few
+frames in the audio file, the subsequent frames are not known. Thus, the
+question arises which gain factors should be assumed for the missing frames
+in the "boundary" region. The Dynamic Audio Normalizer implements two modes
+to deal with this situation. The default boundary mode assumes a gain factor
+of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and
+"fade out" at the beginning and at the end of the input, respectively.
+
+@item s
+Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
+By default, the Dynamic Audio Normalizer does not apply "traditional"
+compression. This means that signal peaks will not be pruned and thus the
+full dynamic range will be retained within each local neighbourhood. However,
+in some cases it may be desirable to combine the Dynamic Audio Normalizer's
+normalization algorithm with a more "traditional" compression.
+For this purpose, the Dynamic Audio Normalizer provides an optional compression
+(thresholding) function. If (and only if) the compression feature is enabled,
+all input frames will be processed by a soft knee thresholding function prior
+to the actual normalization process. Put simply, the thresholding function is
+going to prune all samples whose magnitude exceeds a certain threshold value.
+However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
+value. Instead, the threshold value will be adjusted for each individual
+frame.
+In general, smaller parameters result in stronger compression, and vice versa.
+Values below 3.0 are not recommended, because audible distortion may appear.
+@end table
+
@section earwax
Make audio easier to listen to on headphones.
@@ -1548,6 +1852,23 @@ equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g
@end example
@end itemize
+@section extrastereo
+
+Linearly increases the difference between left and right channels which
+adds some sort of "live" effect to playback.
+
+The filter accepts the following option:
+
+@table @option
+@item m
+Sets the difference coefficient (default: 2.5). 0.0 means mono sound
+(average of both channels), with 1.0 sound will be unchanged, with
+-1.0 left and right channels will be swapped.
+
+@item c
+Enable clipping. By default is enabled.
+@end table
+
@section flanger
Apply a flanging effect to the audio.
@@ -1684,6 +2005,9 @@ threshold or gain).
Controls need to be defined using the following syntax:
c0=@var{value0}|c1=@var{value1}|c2=@var{value2}|..., where
@var{valuei} is the value set on the @var{i}-th control.
+Alternatively they can be also defined using the following syntax:
+@var{value0}|@var{value1}|@var{value2}|..., where
+@var{valuei} is the value set on the @var{i}-th control.
If @option{controls} is set to @code{help}, all available controls and
their valid ranges are printed.
@@ -1801,6 +2125,7 @@ Applies only to double-pole filter.
The default is 0.707q and gives a Butterworth response.
@end table
+@anchor{pan}
@section pan
Mix channels with specific gain levels. The filter accepts the output
@@ -1902,6 +2227,66 @@ At end of filtering it displays @code{track_gain} and @code{track_peak}.
Convert the audio sample format, sample rate and channel layout. It is
not meant to be used directly.
+@section sidechaincompress
+
+This filter acts like normal compressor but has the ability to compress
+detected signal using second input signal.
+It needs two input streams and returns one output stream.
+First input stream will be processed depending on second stream signal.
+The filtered signal then can be filtered with other filters in later stages of
+processing. See @ref{pan} and @ref{amerge} filter.
+
+The filter accepts the following options:
+
+@table @option
+@item threshold
+If a signal of second stream raises above this level it will affect the gain
+reduction of first stream.
+By default is 0.125. Range is between 0.00097563 and 1.
+
+@item ratio
+Set a ratio about which the signal is reduced. 1:2 means that if the level
+raised 4dB above the threshold, it will be only 2dB above after the reduction.
+Default is 2. Range is between 1 and 20.
+
+@item attack
+Amount of milliseconds the signal has to rise above the threshold before gain
+reduction starts. Default is 20. Range is between 0.01 and 2000.
+
+@item release
+Amount of milliseconds the signal has to fall bellow the threshold before
+reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
+
+@item makeup
+Set the amount by how much signal will be amplified after processing.
+Default is 2. Range is from 1 and 64.
+
+@item knee
+Curve the sharp knee around the threshold to enter gain reduction more softly.
+Default is 2.82843. Range is between 1 and 8.
+
+@item link
+Choose if the @code{average} level between all channels of side-chain stream
+or the louder(@code{maximum}) channel of side-chain stream affects the
+reduction. Default is @code{average}.
+
+@item detection
+Should the exact signal be taken in case of @code{peak} or an RMS one in case
+of @code{rms}. Default is @code{rms} which is mainly smoother.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
+depending on the signal of 2nd input and later compressed signal to be
+merged with 2nd input:
+@example
+ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
+@end example
+@end itemize
+
@section silencedetect
Detect silence in an audio stream.
@@ -2527,7 +2912,26 @@ Specify the sample rate, default is 44100.
Specify the duration of the generated audio stream.
@item samples_per_frame
-Set the number of samples per output frame, default is 1024.
+Set the number of samples per output frame.
+
+The expression can contain the following constants:
+
+@table @option
+@item n
+The (sequential) number of the output audio frame, starting from 0.
+
+@item pts
+The PTS (Presentation TimeStamp) of the output audio frame,
+expressed in @var{TB} units.
+
+@item t
+The PTS of the output audio frame, expressed in seconds.
+
+@item TB
+The timebase of the output audio frames.
+@end table
+
+Default is @code{1024}.
@end table
@subsection Examples
@@ -2548,6 +2952,12 @@ sine=f=220:b=4:d=5
sine=frequency=220:beep_factor=4:duration=5
@end example
+@item
+Generate a 1 kHz sine wave following @code{1602,1601,1602,1601,1602} NTSC
+pattern:
+@example
+sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
+@end example
@end itemize
@c man end AUDIO SOURCES
@@ -2637,6 +3047,44 @@ Slower shaper using OpenType for substitutions and positioning
The default is @code{auto}.
@end table
+@section atadenoise
+Apply an Adaptive Temporal Averaging Denoiser to the video input.
+
+The filter accepts the following options:
+
+@table @option
+@item 0a
+Set threshold A for 1st plane. Default is 0.02.
+Valid range is 0 to 0.3.
+
+@item 0b
+Set threshold B for 1st plane. Default is 0.04.
+Valid range is 0 to 5.
+
+@item 1a
+Set threshold A for 2nd plane. Default is 0.02.
+Valid range is 0 to 0.3.
+
+@item 1b
+Set threshold B for 2nd plane. Default is 0.04.
+Valid range is 0 to 5.
+
+@item 2a
+Set threshold A for 3rd plane. Default is 0.02.
+Valid range is 0 to 0.3.
+
+@item 2b
+Set threshold B for 3rd plane. Default is 0.04.
+Valid range is 0 to 5.
+
+Threshold A is designed to react on abrupt changes in the input signal and
+threshold B is designed to react on continuous changes in the input signal.
+
+@item s
+Set number of frames filter will use for averaging. Default is 33. Must be odd
+number in range [5, 129].
+@end table
+
@section bbox
Compute the bounding box for the non-black pixels in the input frame
@@ -3262,12 +3710,12 @@ It accepts the following parameters:
@item w, out_w
The width of the output video. It defaults to @code{iw}.
This expression is evaluated only once during the filter
-configuration.
+configuration, or when the @samp{w} or @samp{out_w} command is sent.
@item h, out_h
The height of the output video. It defaults to @code{ih}.
This expression is evaluated only once during the filter
-configuration.
+configuration, or when the @samp{h} or @samp{out_h} command is sent.
@item x
The horizontal position, in the input video, of the left edge of the output
@@ -3427,6 +3875,22 @@ crop=in_w/2:in_h/2:y:10+10*sin(n/10)
@end example
@end itemize
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item w, out_w
+@item h, out_h
+@item x
+@item y
+Set width/height of the output video and the horizontal/vertical position
+in the input video.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+@end table
+
@section cropdetect
Auto-detect the crop size.
@@ -3527,7 +3991,7 @@ Can be used in addition to the other key points component
options. In this case, the unset component(s) will fallback on this
@option{all} setting.
@item psfile
-Specify a Photoshop curves file (@code{.asv}) to import the settings from.
+Specify a Photoshop curves file (@code{.acv}) to import the settings from.
@end table
To avoid some filtergraph syntax conflicts, each key points list need to be
@@ -3572,7 +4036,7 @@ curves=vintage
@item
Use a Photoshop preset and redefine the points of the green component:
@example
-curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
+curves=psfile='MyCurvesPresets/purple.acv':green='0.45/0.53'
@end example
@end itemize
@@ -3643,6 +4107,43 @@ Violent denoise using a block size of @code{16x16}:
dctdnoiz=15:n=4
@end example
+@section deband
+
+Remove banding artifacts from input video.
+It works by replacing banded pixels with average value of referenced pixels.
+
+The filter accepts the following options:
+
+@table @option
+@item 1thr
+@item 2thr
+@item 3thr
+@item 4thr
+Set banding detection threshold for each plane. Default is 0.02.
+Valid range is 0.00003 to 0.5.
+If difference between current pixel and reference pixel is less than threshold,
+it will be considered as banded.
+
+@item range, r
+Banding detection range in pixels. Default is 16. If positive, random number
+in range 0 to set value will be used. If negative, exact absolute value
+will be used.
+The range defines square of four pixels around current pixel.
+
+@item direction, d
+Set direction in radians from which four pixel will be compared. If positive,
+random direction from 0 to set direction will be picked. If negative, exact of
+absolute value will be picked. For example direction 0, -PI or -2*PI radians
+will pick only pixels on same row and -PI/2 will pick only pixels on same
+column.
+
+@item blur
+If enabled, current pixel is compared with average value of all four
+surrounding pixels. The default is enabled. If disabled current pixel is
+compared with all four surrounding pixels. The pixel is considered banded
+if only all four differences with surrounding pixels are less than threshold.
+@end table
+
@anchor{decimate}
@section decimate
@@ -3683,6 +4184,24 @@ Set whether or not chroma is considered in the metric calculations. Default is
@code{1}.
@end table
+@section deflate
+
+Apply deflate effect to the video.
+
+This filter replaces the pixel by the local(3x3) average by taking into account
+only values lower than the pixel.
+
+It accepts the following options:
+
+@table @option
+@item threshold0
+@item threshold1
+@item threshold2
+@item threshold3
+Allows to limit the maximum change for each plane, default is 65535.
+If 0, plane will remain unchanged.
+@end table
+
@section dejudder
Remove judder produced by partially interlaced telecined content.
@@ -3869,6 +4388,33 @@ A number representing position of the first frame with respect to the telecine
pattern. This is to be used if the stream is cut. The default value is @code{0}.
@end table
+@section dilation
+
+Apply dilation effect to the video.
+
+This filter replaces the pixel by the local(3x3) maximum.
+
+It accepts the following options:
+
+@table @option
+@item threshold0
+@item threshold1
+@item threshold2
+@item threshold3
+Allows to limit the maximum change for each plane, default is 65535.
+If 0, plane will remain unchanged.
+
+@item coordinates
+Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
+pixels are used.
+
+Flags to local 3x3 coordinates maps like this:
+
+ 1 2 3
+ 4 5
+ 6 7 8
+@end table
+
@section drawbox
Draw a colored box on the input image.
@@ -3965,6 +4511,108 @@ drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
@end example
@end itemize
+@section drawgraph, adrawgraph
+
+Draw a graph using input video or audio metadata.
+
+It accepts the following parameters:
+
+@table @option
+@item m1
+Set 1st frame metadata key from which metadata values will be used to draw a graph.
+
+@item fg1
+Set 1st foreground color expression.
+
+@item m2
+Set 2nd frame metadata key from which metadata values will be used to draw a graph.
+
+@item fg2
+Set 2nd foreground color expression.
+
+@item m3
+Set 3rd frame metadata key from which metadata values will be used to draw a graph.
+
+@item fg3
+Set 3rd foreground color expression.
+
+@item m4
+Set 4th frame metadata key from which metadata values will be used to draw a graph.
+
+@item fg4
+Set 4th foreground color expression.
+
+@item min
+Set minimal value of metadata value.
+
+@item max
+Set maximal value of metadata value.
+
+@item bg
+Set graph background color. Default is white.
+
+@item mode
+Set graph mode.
+
+Available values for mode is:
+@table @samp
+@item bar
+@item dot
+@item line
+@end table
+
+Default is @code{line}.
+
+@item slide
+Set slide mode.
+
+Available values for slide is:
+@table @samp
+@item frame
+Draw new frame when right border is reached.
+
+@item replace
+Replace old columns with new ones.
+
+@item scroll
+Scroll from right to left.
+
+@item rscroll
+Scroll from left to right.
+@end table
+
+Default is @code{frame}.
+
+@item size
+Set size of graph video. For the syntax of this option, check the
+@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
+The default value is @code{900x256}.
+
+The foreground color expressions can use the following variables:
+@table @option
+@item MIN
+Minimal value of metadata value.
+
+@item MAX
+Maximal value of metadata value.
+
+@item VAL
+Current metadata key value.
+@end table
+
+The color is defined as 0xAABBGGRR.
+@end table
+
+Example using metadata from @ref{signalstats} filter:
+@example
+signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+@end example
+
+Example using metadata from @ref{ebur128} filter:
+@example
+ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+@end example
+
@section drawgrid
Draw a grid on the input image.
@@ -4625,6 +5273,33 @@ value.
@end table
+@section erosion
+
+Apply erosion effect to the video.
+
+This filter replaces the pixel by the local(3x3) minimum.
+
+It accepts the following options:
+
+@table @option
+@item threshold0
+@item threshold1
+@item threshold2
+@item threshold3
+Allows to limit the maximum change for each plane, default is 65535.
+If 0, plane will remain unchanged.
+
+@item coordinates
+Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
+pixels are used.
+
+Flags to local 3x3 coordinates maps like this:
+
+ 1 2 3
+ 4 5
+ 6 7 8
+@end table
+
@section extractplanes
Extract color channel components from input video stream into
@@ -4687,6 +5362,10 @@ computation time. Default value is 1.
Set a random seed, must be an integer included between 0 and
UINT32_MAX. If not specified, or if explicitly set to -1, the filter
will try to use a good random seed on a best effort basis.
+
+@item pal8
+Set pal8 output pixel format. This option does not work with codebook
+length greater than 256.
@end table
@section fade
@@ -4884,8 +5563,9 @@ which @code{fieldmatch} is based on. While the semantic and usage are very
close, some behaviour and options names can differ.
The @ref{decimate} filter currently only works for constant frame rate input.
-Do not use @code{fieldmatch} and @ref{decimate} if your input has mixed
-telecined and progressive content with changing framerate.
+If your input has mixed telecined (30fps) and progressive content with a lower
+framerate like 24fps use the following filterchain to produce the necessary cfr
+stream: @code{dejudder,fps=30000/1001,fieldmatch,decimate}.
The filter accepts the following options:
@@ -5423,6 +6103,51 @@ ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
@end example
+@section framerate
+
+Change the frame rate by interpolating new video output frames from the source
+frames.
+
+This filter is not designed to function correctly with interlaced media. If
+you wish to change the frame rate of interlaced media then you are required
+to deinterlace before this filter and re-interlace after this filter.
+
+A description of the accepted options follows.
+
+@table @option
+@item fps
+Specify the output frames per second. This option can also be specified
+as a value alone. The default is @code{50}.
+
+@item interp_start
+Specify the start of a range where the output frame will be created as a
+linear interpolation of two frames. The range is [@code{0}-@code{255}],
+the default is @code{15}.
+
+@item interp_end
+Specify the end of a range where the output frame will be created as a
+linear interpolation of two frames. The range is [@code{0}-@code{255}],
+the default is @code{240}.
+
+@item scene
+Specify the level at which a scene change is detected as a value between
+0 and 100 to indicate a new scene; a low value reflects a low
+probability for the current frame to introduce a new scene, while a higher
+value means the current frame is more likely to be one.
+The default is @code{7}.
+
+@item flags
+Specify flags influencing the filter process.
+
+Available value for @var{flags} is:
+
+@table @option
+@item scene_change_detect, scd
+Enable scene change detection using the value of the option @var{scene}.
+This flag is enabled by default.
+@end table
+@end table
+
@section framestep
Select one frame every N-th frame.
@@ -5938,6 +6663,10 @@ Default is @code{parade}.
@item levels_mode
Set mode for @code{levels}. Can be either @code{linear}, or @code{logarithmic}.
Default is @code{linear}.
+
+@item components
+Set what color components to display for mode @code{levels}.
+Default is @code{7}.
@end table
@subsection Examples
@@ -5993,6 +6722,21 @@ Set the scaling dimension: @code{2} for @code{hq2x}, @code{3} for
Default is @code{3}.
@end table
+@section hstack
+Stack input videos horizontally.
+
+All streams must be of same pixel format and of same height.
+
+Note that this filter is faster than using @ref{overlay} and @ref{pad} filter
+to create same output.
+
+The filter accept the following option:
+
+@table @option
+@item nb_inputs
+Set number of input streams. Default is 2.
+@end table
+
@section hue
Modify the hue and/or the saturation of the input.
@@ -6222,6 +6966,24 @@ Default value is @code{none}.
Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code{0}.
@end table
+@section inflate
+
+Apply inflate effect to the video.
+
+This filter replaces the pixel by the local(3x3) average by taking into account
+only values higher than the pixel.
+
+It accepts the following options:
+
+@table @option
+@item threshold0
+@item threshold1
+@item threshold2
+@item threshold3
+Allows to limit the maximum change for each plane, default is 65535.
+If 0, plane will remain unchanged.
+@end table
+
@section interlace
Simple interlacing filter from progressive contents. This interleaves upper (or
@@ -6761,6 +7523,30 @@ noise=alls=20:allf=t+u
Pass the video source unchanged to the output.
+@section ocr
+Optical Character Recognition
+
+This filter uses Tesseract for optical character recognition.
+
+It accepts the following options:
+
+@table @option
+@item datapath
+Set datapath to tesseract data. Default is to use whatever was
+set at installation.
+
+@item language
+Set language, default is "eng".
+
+@item whitelist
+Set character whitelist.
+
+@item blacklist
+Set character blacklist.
+@end table
+
+The filter exports recognized text as the frame metadata @code{lavfi.ocr.text}.
+
@section ocv
Apply a video transform using libopencv.
@@ -7122,6 +7908,7 @@ Set chroma strength.
Must be a double value in the range 0-1000, default is @code{1.0}.
@end table
+@anchor{pad}
@section pad
Add paddings to the input image, and place the original input at the
@@ -7871,6 +8658,128 @@ qp=2+2*sin(PI*qp)
@end example
@end itemize
+@section random
+
+Flush video frames from internal cache of frames into a random order.
+No frame is discarded.
+Inspired by @ref{frei0r} nervous filter.
+
+@table @option
+@item frames
+Set size in number of frames of internal cache, in range from @code{2} to
+@code{512}. Default is @code{30}.
+
+@item seed
+Set seed for random number generator, must be an integer included between
+@code{0} and @code{UINT32_MAX}. If not specified, or if explicitly set to
+less than @code{0}, the filter will try to use a good random seed on a
+best effort basis.
+@end table
+
+@section removegrain
+
+The removegrain filter is a spatial denoiser for progressive video.
+
+@table @option
+@item m0
+Set mode for the first plane.
+
+@item m1
+Set mode for the second plane.
+
+@item m2
+Set mode for the third plane.
+
+@item m3
+Set mode for the fourth plane.
+@end table
+
+Range of mode is from 0 to 24. Description of each mode follows:
+
+@table @var
+@item 0
+Leave input plane unchanged. Default.
+
+@item 1
+Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
+
+@item 2
+Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
+
+@item 3
+Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
+
+@item 4
+Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
+This is equivalent to a median filter.
+
+@item 5
+Line-sensitive clipping giving the minimal change.
+
+@item 6
+Line-sensitive clipping, intermediate.
+
+@item 7
+Line-sensitive clipping, intermediate.
+
+@item 8
+Line-sensitive clipping, intermediate.
+
+@item 9
+Line-sensitive clipping on a line where the neighbours pixels are the closest.
+
+@item 10
+Replaces the target pixel with the closest neighbour.
+
+@item 11
+[1 2 1] horizontal and vertical kernel blur.
+
+@item 12
+Same as mode 11.
+
+@item 13
+Bob mode, interpolates top field from the line where the neighbours
+pixels are the closest.
+
+@item 14
+Bob mode, interpolates bottom field from the line where the neighbours
+pixels are the closest.
+
+@item 15
+Bob mode, interpolates top field. Same as 13 but with a more complicated
+interpolation formula.
+
+@item 16
+Bob mode, interpolates bottom field. Same as 14 but with a more complicated
+interpolation formula.
+
+@item 17
+Clips the pixel with the minimum and maximum of respectively the maximum and
+minimum of each pair of opposite neighbour pixels.
+
+@item 18
+Line-sensitive clipping using opposite neighbours whose greatest distance from
+the current pixel is minimal.
+
+@item 19
+Replaces the pixel with the average of its 8 neighbours.
+
+@item 20
+Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
+
+@item 21
+Clips pixels using the averages of opposite neighbour.
+
+@item 22
+Same as mode 21 but simpler and faster.
+
+@item 23
+Small edge and halo removal, but reputed useless.
+
+@item 24
+Similar as 23.
+@end table
+
@section removelogo
Suppress a TV station logo, using an image file to determine which
@@ -7906,6 +8815,23 @@ pixels will slow things down on a large logo.
This filter uses the repeat_field flag from the Video ES headers and hard repeats
fields based on its value.
+@section reverse, areverse
+
+Reverse a clip.
+
+Warning: This filter requires memory to buffer the entire clip, so trimming
+is suggested.
+
+@subsection Examples
+
+@itemize
+@item
+Take the first 5 seconds of a clip, and reverse it.
+@example
+trim=end=5,reverse
+@end example
+@end itemize
+
@section rotate
Rotate video by an arbitrary angle expressed in radians.
@@ -8360,6 +9286,36 @@ scale=w='min(500\, iw*3/2):h=-1'
@end example
@end itemize
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item width, w
+@item height, h
+Set the output video dimension expression.
+The command accepts the same syntax of the corresponding option.
+
+If the specified expression is not valid, it is kept at its current
+value.
+@end table
+
+@section scale2ref
+
+Scale (resize) the input video, based on a reference video.
+
+See the scale filter for available options, scale2ref supports the same but
+uses the reference video instead of the main input as basis.
+
+@subsection Examples
+
+@itemize
+@item
+Scale a subtitle stream to match the main video in size before overlaying
+@example
+'scale2ref[b][a];[a][b]overlay'
+@end example
+@end itemize
+
@section separatefields
The @code{separatefields} takes a frame-based video input and splits
@@ -8604,6 +9560,7 @@ Swap the second and third planes of the input:
ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
@end example
+@anchor{signalstats}
@section signalstats
Evaluate various visual metrics that assist in determining issues associated
with the digitization of analog video media.
@@ -8834,6 +9791,64 @@ in [-30,0] will filter edges. Default value is 0.
If a chroma option is not explicitly set, the corresponding luma value
is set.
+@section ssim
+
+Obtain the SSIM (Structural SImilarity Metric) between two input videos.
+
+This filter takes in input two input videos, the first input is
+considered the "main" source and is passed unchanged to the
+output. The second input is used as a "reference" video for computing
+the SSIM.
+
+Both video inputs must have the same resolution and pixel format for
+this filter to work correctly. Also it assumes that both inputs
+have the same number of frames, which are compared one by one.
+
+The filter stores the calculated SSIM of each frame.
+
+The description of the accepted parameters follows.
+
+@table @option
+@item stats_file, f
+If specified the filter will use the named file to save the SSIM of
+each individual frame.
+@end table
+
+The file printed if @var{stats_file} is selected, contains a sequence of
+key/value pairs of the form @var{key}:@var{value} for each compared
+couple of frames.
+
+A description of each shown parameter follows:
+
+@table @option
+@item n
+sequential number of the input frame, starting from 1
+
+@item Y, U, V, R, G, B
+SSIM of the compared frames for the component specified by the suffix.
+
+@item All
+SSIM of the compared frames for the whole frame.
+
+@item dB
+Same as above but in dB representation.
+@end table
+
+For example:
+@example
+movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
+[main][ref] ssim="stats_file=stats.log" [out]
+@end example
+
+On this example the input file being processed is compared with the
+reference file @file{ref_movie.mpg}. The SSIM of each individual frame
+is stored in @file{stats.log}.
+
+Another example with both psnr and ssim at same time:
+@example
+ffmpeg -i main.mpg -i ref.mpg -lavfi "ssim;[0:v][1:v]psnr" -f null -
+@end example
+
@section stereo3d
Convert between different stereoscopic image formats.
@@ -8880,6 +9895,12 @@ alternating frames (left eye first, right eye second)
@item ar
alternating frames (right eye first, left eye second)
+@item irl
+interleaved rows (left eye has top row, right eye starts on next row)
+
+@item irr
+interleaved rows (right eye has top row, left eye starts on next row)
+
Default value is @samp{sbsl}.
@end table
@@ -8944,17 +9965,23 @@ anaglyph yellow/blue colored
anaglyph yellow/blue color optimized with the least squares projection of dubois
(yellow filter on left eye, blue filter on right eye)
-@item irl
-interleaved rows (left eye has top row, right eye starts on next row)
-
-@item irr
-interleaved rows (right eye has top row, left eye starts on next row)
-
@item ml
mono output (left eye only)
@item mr
mono output (right eye only)
+
+@item chl
+checkerboard, left eye first
+
+@item chr
+checkerboard, right eye first
+
+@item icl
+interleaved columns, left eye first
+
+@item icr
+interleaved columns, right eye first
@end table
Default value is @samp{arcd}.
@@ -9036,6 +10063,10 @@ was composed. For the syntax of this option, check the
Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
correctly scale the fonts if the aspect ratio has been changed.
+@item fontsdir
+Set a directory path containing fonts that can be used by the filter.
+These fonts will be used in addition to whatever the font provider uses.
+
@item charenc
Set subtitles input character encoding. @code{subtitles} filter only. Only
useful if not UTF-8.
@@ -9655,6 +10686,69 @@ Force a constant quantization parameter. If not set, the filter will use the QP
from the video stream (if available).
@end table
+@section vectorscope
+
+Display 2 color component values in the two dimensional graph (which is called
+a vectorscope).
+
+This filter accepts the following options:
+
+@table @option
+@item mode, m
+Set vectorscope mode.
+
+It accepts the following values:
+@table @samp
+@item gray
+Gray values are displayed on graph, higher brightness means more pixels have
+same component color value on location in graph. This is the default mode.
+
+@item color
+Gray values are displayed on graph. Surrounding pixels values which are not
+present in video frame are drawn in gradient of 2 color components which are
+set by option @code{x} and @code{y}.
+
+@item color2
+Actual color components values present in video frame are displayed on graph.
+
+@item color3
+Similar as color2 but higher frequency of same values @code{x} and @code{y}
+on graph increases value of another color component, which is luminance by
+default values of @code{x} and @code{y}.
+
+@item color4
+Actual colors present in video frame are displayed on graph. If two different
+colors map to same position on graph then color with higher value of component
+not present in graph is picked.
+@end table
+
+@item x
+Set which color component will be represented on X-axis. Default is @code{1}.
+
+@item y
+Set which color component will be represented on Y-axis. Default is @code{2}.
+
+@item intensity, i
+Set intensity, used by modes: gray, color and color3 for increasing brightness
+of color component which represents frequency of (X, Y) location in graph.
+
+@item envelope, e
+@table @samp
+@item none
+No envelope, this is default.
+
+@item instant
+Instant envelope, even darkest single pixel will be clearly highlighted.
+
+@item peak
+Hold maximum and minimum values presented in graph over time. This way you
+can still spot out of range values without constantly looking at vectorscope.
+
+@item peak+instant
+Peak and instant envelope combined together.
+@end table
+@end table
+
@anchor{vidstabdetect}
@section vidstabdetect
@@ -10008,6 +11102,21 @@ vignette='PI/4+random(1)*PI/50':eval=frame
@end itemize
+@section vstack
+Stack input videos vertically.
+
+All streams must be of same pixel format and of same width.
+
+Note that this filter is faster than using @ref{overlay} and @ref{pad} filter
+to create same output.
+
+The filter accept the following option:
+
+@table @option
+@item nb_inputs
+Set number of input streams. Default is 2.
+@end table
+
@section w3fdif
Deinterlace the input video ("w3fdif" stands for "Weston 3 Field
@@ -10047,6 +11156,103 @@ Only deinterlace frames marked as interlaced.
Default value is @samp{all}.
@end table
+@section waveform
+Video waveform monitor.
+
+The waveform monitor plots color component intensity. By default luminance
+only. Each column of the waveform corresponds to a column of pixels in the
+source video.
+
+It accepts the following options:
+
+@table @option
+@item mode, m
+Can be either @code{row}, or @code{column}. Default is @code{column}.
+In row mode, the graph on the left side represents color component value 0 and
+the right side represents value = 255. In column mode, the top side represents
+color component value = 0 and bottom side represents value = 255.
+
+@item intensity, i
+Set intensity. Smaller values are useful to find out how many values of the same
+luminance are distributed across input rows/columns.
+Default value is @code{0.04}. Allowed range is [0, 1].
+
+@item mirror, r
+Set mirroring mode. @code{0} means unmirrored, @code{1} means mirrored.
+In mirrored mode, higher values will be represented on the left
+side for @code{row} mode and at the top for @code{column} mode. Default is
+@code{1} (mirrored).
+
+@item display, d
+Set display mode.
+It accepts the following values:
+@table @samp
+@item overlay
+Presents information identical to that in the @code{parade}, except
+that the graphs representing color components are superimposed directly
+over one another.
+
+This display mode makes it easier to spot relative differences or similarities
+in overlapping areas of the color components that are supposed to be identical,
+such as neutral whites, grays, or blacks.
+
+@item parade
+Display separate graph for the color components side by side in
+@code{row} mode or one below the other in @code{column} mode.
+
+Using this display mode makes it easy to spot color casts in the highlights
+and shadows of an image, by comparing the contours of the top and the bottom
+graphs of each waveform. Since whites, grays, and blacks are characterized
+by exactly equal amounts of red, green, and blue, neutral areas of the picture
+should display three waveforms of roughly equal width/height. If not, the
+correction is easy to perform by making level adjustments the three waveforms.
+@end table
+Default is @code{parade}.
+
+@item components, c
+Set which color components to display. Default is 1, which means only luminance
+or red color component if input is in RGB colorspace. If is set for example to
+7 it will display all 3 (if) available color components.
+
+@item envelope, e
+@table @samp
+@item none
+No envelope, this is default.
+
+@item instant
+Instant envelope, minimum and maximum values presented in graph will be easily
+visible even with small @code{step} value.
+
+@item peak
+Hold minimum and maximum values presented in graph across time. This way you
+can still spot out of range values without constantly looking at waveforms.
+
+@item peak+instant
+Peak and instant envelope combined together.
+@end table
+
+@item filter, f
+@table @samp
+@item lowpass
+No filtering, this is default.
+
+@item flat
+Luma and chroma combined together.
+
+@item aflat
+Similar as above, but shows difference between blue and red chroma.
+
+@item chroma
+Displays only chroma.
+
+@item achroma
+Similar as above, but shows difference between blue and red chroma.
+
+@item color
+Displays actual color value on waveform.
+@end table
+@end table
+
@section xbr
Apply the xBR high-quality magnification filter which is designed for pixel
art. It follows a set of edge-detection rules, see
@@ -10686,6 +11892,8 @@ ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_c
@end example
@end itemize
+@anchor{allrgb}
+@anchor{allyuv}
@anchor{color}
@anchor{haldclutsrc}
@anchor{nullsrc}
@@ -10693,7 +11901,11 @@ ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_c
@anchor{smptebars}
@anchor{smptehdbars}
@anchor{testsrc}
-@section color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
+@section allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc
+
+The @code{allrgb} source returns frames of size 4096x4096 of all rgb colors.
+
+The @code{allyuv} source returns frames of size 4096x4096 of all yuv colors.
The @code{color} source provides an uniformly colored input.
@@ -10832,6 +12044,38 @@ tools.
Below is a description of the currently available multimedia filters.
+@section aphasemeter
+
+Convert input audio to a video output, displaying the audio phase.
+
+The filter accepts the following options:
+
+@table @option
+@item rate, r
+Set the output frame rate. Default value is @code{25}.
+
+@item size, s
+Set 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{800x400}.
+
+@item rc
+@item gc
+@item bc
+Specify the red, green, blue contrast. Default values are @code{2},
+@code{7} and @code{1}.
+Allowed range is @code{[0, 255]}.
+
+@item mpc
+Set color which will be used for drawing median phase. If color is
+@code{none} which is default, no median phase value will be drawn.
+@end table
+
+The filter also exports the frame metadata @code{lavfi.aphasemeter.phase} which
+represents mean phase of current audio frame. Value is in range @code{[-1, 1]}.
+The @code{-1} means left and right channels are completely out of phase and
+@code{1} means channels are in phase.
+
@section avectorscope
Convert input audio to a video output, representing the audio vector
@@ -10857,6 +12101,9 @@ Lissajous rotated by 45 degrees.
@item lissajous_xy
Same as above but not rotated.
+
+@item polar
+Shape resembling half of circle.
@end table
Default value is @samp{lissajous}.
@@ -10872,13 +12119,17 @@ Set the output frame rate. Default value is @code{25}.
@item rc
@item gc
@item bc
-Specify the red, green and blue contrast. Default values are @code{40}, @code{160} and @code{80}.
+@item ac
+Specify the red, green, blue and alpha contrast. Default values are @code{40},
+@code{160}, @code{80} and @code{255}.
Allowed range is @code{[0, 255]}.
@item rf
@item gf
@item bf
-Specify the red, green and blue fade. Default values are @code{15}, @code{10} and @code{5}.
+@item af
+Specify the red, green, blue and alpha fade. Default values are @code{15},
+@code{10}, @code{5} and @code{5}.
Allowed range is @code{[0, 255]}.
@item zoom
@@ -10976,6 +12227,7 @@ do not have exactly the same duration in the first file.
@end itemize
+@anchor{ebur128}
@section ebur128
EBU R128 scanner filter. This filter takes an audio stream as input and outputs
@@ -11819,6 +13071,121 @@ gamma=2:gamma2=2
@end itemize
+@section showfreqs
+
+Convert input audio to video output representing the audio power spectrum.
+Audio amplitude is on Y-axis while frequency is on X-axis.
+
+The filter accepts the following options:
+
+@table @option
+@item size, s
+Specify size of video. For the syntax of this option, check the
+@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
+Default is @code{1024x512}.
+
+@item mode
+Set display mode.
+This set how each frequency bin will be represented.
+
+It accepts the following values:
+@table @samp
+@item line
+@item bar
+@item dot
+@end table
+Default is @code{bar}.
+
+@item ascale
+Set amplitude scale.
+
+It accepts the following values:
+@table @samp
+@item lin
+Linear scale.
+
+@item sqrt
+Square root scale.
+
+@item cbrt
+Cubic root scale.
+
+@item log
+Logarithmic scale.
+@end table
+Default is @code{log}.
+
+@item fscale
+Set frequency scale.
+
+It accepts the following values:
+@table @samp
+@item lin
+Linear scale.
+
+@item log
+Logarithmic scale.
+
+@item rlog
+Reverse logarithmic scale.
+@end table
+Default is @code{lin}.
+
+@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{w2048}
+
+@item win_func
+Set windowing function.
+
+It accepts the following values:
+@table @samp
+@item rect
+@item bartlett
+@item hanning
+@item hamming
+@item blackman
+@item welch
+@item flattop
+@item bharris
+@item bnuttall
+@item bhann
+@item sine
+@item nuttall
+@end table
+Default is @code{hanning}.
+
+@item overlap
+Set window overlap. In range @code{[0, 1]}. Default is @code{1},
+which means optimal overlap for selected window function will be picked.
+
+@item averaging
+Set time averaging. Setting this to 0 will display current maximal peaks.
+Default is @code{1}, which means time averaging is disabled.
+
+@item color
+Specify list of colors separated by space or by '|' which will be used to
+draw channel frequencies. Unrecognized or missing colors will be replaced
+by white color.
+@end table
+
@section showspectrum
Convert input audio to a video output, representing the audio frequency
@@ -11934,6 +13301,45 @@ ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
@end example
@end itemize
+@section showvolume
+
+Convert input audio volume to a video output.
+
+The filter accepts the following options:
+
+@table @option
+@item rate, r
+Set video rate.
+
+@item b
+Set border width, allowed range is [0, 5]. Default is 1.
+
+@item w
+Set channel width, allowed range is [40, 1080]. Default is 400.
+
+@item h
+Set channel height, allowed range is [1, 100]. Default is 20.
+
+@item f
+Set fade, allowed range is [1, 255]. Default is 20.
+
+@item c
+Set volume color expression.
+
+The expression can use the following variables:
+
+@table @option
+@item VOLUME
+Current max volume of channel in dB.
+
+@item CHANNEL
+Current channel number, starting from 0.
+@end table
+
+@item t
+If set, displays channel names. Default is enabled.
+@end table
+
@section showwaves
Convert input audio to a video output, representing the samples waves.
diff --git a/chromium/third_party/ffmpeg/doc/general.texi b/chromium/third_party/ffmpeg/doc/general.texi
index 471a11bb82c..a6e1e5542a4 100644
--- a/chromium/third_party/ffmpeg/doc/general.texi
+++ b/chromium/third_party/ffmpeg/doc/general.texi
@@ -145,6 +145,14 @@ x265 is under the GNU Public License Version 2 or later
details), you must upgrade FFmpeg's license to GPL in order to use it.
@end float
+@section kvazaar
+
+FFmpeg can make use of the kvazaar library for HEVC encoding.
+
+Go to @url{https://github.com/ultravideo/kvazaar} and follow the
+instructions for installing the library. Then pass
+@code{--enable-libkvazaar} to configure to enable it.
+
@section libilbc
iLBC is a narrowband speech codec that has been made freely available
@@ -192,6 +200,17 @@ end user having AviSynth or AvxSynth installed - they'll only need to be
installed to use AviSynth scripts (obviously).
@end float
+@section Intel QuickSync Video
+
+FFmpeg can use Intel QuickSync Video (QSV) for accelerated encoding and decoding
+of multiple codecs. To use QSV, FFmpeg must be linked against the @code{libmfx}
+dispatcher, which loads the actual decoding libraries.
+
+The dispatcher is open source and can be downloaded from
+@url{https://github.com/lu-zero/mfx_dispatch.git}. FFmpeg needs to be configured
+with the @code{--enable-libmfx} option and @code{pkg-config} needs to be able to
+locate the dispatcher's @code{.pc} files.
+
@chapter Supported File Formats, Codecs or Features
@@ -207,6 +226,10 @@ library:
@item 4xm @tab @tab X
@tab 4X Technologies format, used in some games.
@item 8088flex TMV @tab @tab X
+@item AAX @tab @tab X
+ @tab Audible Enhanced Audio format, used in audiobooks.
+@item AA @tab @tab X
+ @tab Audible Format 2, 3, and 4, used in audiobooks.
@item ACT Voice @tab @tab X
@tab contains G.729 audio
@item Adobe Filmstrip @tab X @tab X
@@ -275,6 +298,7 @@ library:
@item Deluxe Paint Animation @tab @tab X
@item DFA @tab @tab X
@tab This format is used in Chronomaster game
+@item DirectDraw Surface @tab @tab X
@item DSD Stream File (DSF) @tab @tab X
@item DV video @tab X @tab X
@item DXA @tab @tab X
@@ -439,6 +463,7 @@ library:
@item Redirector @tab @tab X
@item RedSpark @tab @tab X
@item Renderware TeXture Dictionary @tab @tab X
+@item Resolume DXV @tab @tab X
@item RL2 @tab @tab X
@tab Audio and video format used in some games by Entertainment Software Partners.
@item RPL/ARMovie @tab @tab X
@@ -479,6 +504,7 @@ library:
@tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
@item True Audio @tab @tab X
@item VC-1 test bitstream @tab X @tab X
+@item Vidvox Hap @tab X @tab X
@item Vivo @tab @tab X
@item WAV @tab X @tab X
@item WavPack @tab X @tab X
@@ -665,6 +691,8 @@ following image formats are supported:
@tab Sorenson H.263 used in Flash
@item Forward Uncompressed @tab @tab X
@item Fraps @tab @tab X
+@item Go2Meeting @tab @tab X
+ @tab fourcc: G2M2, G2M3
@item Go2Webinar @tab @tab X
@tab fourcc: G2M4
@item H.261 @tab X @tab X
@@ -673,7 +701,7 @@ following image formats are supported:
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
@tab encoding supported through external library libx264 and OpenH264
@item HEVC @tab X @tab X
- @tab encoding supported through the external library libx265
+ @tab encoding supported through external library libx265 and libkvazaar
@item HNM version 4 @tab @tab X
@item HuffYUV @tab X @tab X
@item HuffYUV FFmpeg variant @tab X @tab X
@@ -838,7 +866,7 @@ following image formats are supported:
@item Name @tab Encoding @tab Decoding @tab Comments
@item 8SVX exponential @tab @tab X
@item 8SVX fibonacci @tab @tab X
-@item AAC+ @tab E @tab X
+@item AAC+ @tab E @tab IX
@tab encoding supported through external library libaacplus
@item AAC @tab E @tab X
@tab encoding supported through external library libfaac and libvo-aacenc
@@ -878,7 +906,7 @@ following image formats are supported:
@item ADPCM MS IMA @tab X @tab X
@item ADPCM Nintendo Gamecube AFC @tab @tab X
@item ADPCM Nintendo Gamecube DTK @tab @tab X
-@item ADPCM Nintendo Gamecube THP @tab @tab X
+@item ADPCM Nintendo THP @tab @tab X
@item ADPCM QT IMA @tab X @tab X
@item ADPCM SEGA CRI ADX @tab X @tab X
@tab Used in Sega Dreamcast games.
diff --git a/chromium/third_party/ffmpeg/doc/git-howto.texi b/chromium/third_party/ffmpeg/doc/git-howto.texi
index b7b5d434804..bf37bcced43 100644
--- a/chromium/third_party/ffmpeg/doc/git-howto.texi
+++ b/chromium/third_party/ffmpeg/doc/git-howto.texi
@@ -1,10 +1,10 @@
\input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
-@settitle Using git to develop FFmpeg
+@settitle Using Git to develop FFmpeg
@titlepage
-@center @titlefont{Using git to develop FFmpeg}
+@center @titlefont{Using Git to develop FFmpeg}
@end titlepage
@top
@@ -13,9 +13,9 @@
@chapter Introduction
-This document aims in giving some quick references on a set of useful git
+This document aims in giving some quick references on a set of useful Git
commands. You should always use the extensive and detailed documentation
-provided directly by git:
+provided directly by Git:
@example
git --help
@@ -32,22 +32,21 @@ man git-<command>
shows information about the subcommand <command>.
Additional information could be found on the
-@url{http://gitref.org, Git Reference} website
+@url{http://gitref.org, Git Reference} website.
For more information about the Git project, visit the
-
-@url{http://git-scm.com/, Git website}
+@url{http://git-scm.com/, Git website}.
Consult these resources whenever you have problems, they are quite exhaustive.
What follows now is a basic introduction to Git and some FFmpeg-specific
-guidelines to ease the contribution to the project
+guidelines to ease the contribution to the project.
@chapter Basics Usage
-@section Get GIT
+@section Get Git
-You can get git from @url{http://git-scm.com/}
+You can get Git from @url{http://git-scm.com/}
Most distribution and operating system provide a package for it.
@@ -108,7 +107,7 @@ git add [-A] <filename/dirname>
git rm [-r] <filename/dirname>
@end example
-GIT needs to get notified of all changes you make to your working
+Git needs to get notified of all changes you make to your working
directory that makes files appear or disappear.
Line moves across files are automatically tracked.
@@ -128,8 +127,8 @@ will show all local modifications in your working directory as unified diff.
git log <filename(s)>
@end example
-You may also use the graphical tools like gitview or gitk or the web
-interface available at http://source.ffmpeg.org/
+You may also use the graphical tools like @command{gitview} or @command{gitk}
+or the web interface available at @url{http://source.ffmpeg.org/}.
@section Checking source tree status
@@ -150,6 +149,7 @@ git diff --check
to double check your changes before committing them to avoid trouble later
on. All experienced developers do this on each and every commit, no matter
how small.
+
Every one of them has been saved from looking like a fool by this many times.
It's very easy for stray debug output or cosmetic modifications to slip in,
please avoid problems through this extra level of scrutiny.
@@ -172,14 +172,14 @@ to make sure you don't have untracked files or deletions.
git add [-i|-p|-A] <filenames/dirnames>
@end example
-Make sure you have told git your name and email address
+Make sure you have told Git your name and email address
@example
git config --global user.name "My Name"
git config --global user.email my@@email.invalid
@end example
-Use @var{--global} to set the global configuration for all your git checkouts.
+Use @option{--global} to set the global configuration for all your Git checkouts.
Git will select the changes to the files for commit. Optionally you can use
the interactive or the patch mode to select hunk by hunk what should be
@@ -210,7 +210,7 @@ include filenames in log messages, Git provides that information.
Possibly make the commit message have a terse, descriptive first line, an
empty line and then a full description. The first line will be used to name
-the patch by git format-patch.
+the patch by @command{git format-patch}.
@section Preparing a patchset
@@ -326,10 +326,12 @@ faulty commit disappear from the history.
@section Pushing changes to remote trees
@example
-git push
+git push origin master --dry-run
@end example
-Will push the changes to the default remote (@var{origin}).
+Will simulate a push of the local master branch to the default remote
+(@var{origin}). And list which branches and ranges or commits would have been
+pushed.
Git will prevent you from pushing changes if the local and remote trees are
out of sync. Refer to @ref{Updating the source tree to the latest revision}.
@@ -350,23 +352,24 @@ branches matching the local ones.
@section Finding a specific svn revision
-Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
+Since version 1.7.1 Git supports @samp{:/foo} syntax for specifying commits
based on a regular expression. see man gitrevisions
@example
git show :/'as revision 23456'
@end example
-will show the svn changeset @var{r23456}. With older git versions searching in
+will show the svn changeset @samp{r23456}. With older Git versions searching in
the @command{git log} output is the easiest option (especially if a pager with
search capabilities is used).
+
This commit can be checked out with
@example
git checkout -b svn_23456 :/'as revision 23456'
@end example
-or for git < 1.7.1 with
+or for Git < 1.7.1 with
@example
git checkout -b svn_23456 $SHA1
@@ -375,7 +378,7 @@ git checkout -b svn_23456 $SHA1
where @var{$SHA1} is the commit hash from the @command{git log} output.
-@chapter pre-push checklist
+@chapter Pre-push checklist
Once you have a set of commits that you feel are ready for pushing,
work through the following checklist to doublecheck everything is in
@@ -386,7 +389,7 @@ Apply your common sense, but if in doubt, err on the side of caution.
First, make sure that the commits and branches you are going to push
match what you want pushed and that nothing is missing, extraneous or
wrong. You can see what will be pushed by running the git push command
-with --dry-run first. And then inspecting the commits listed with
+with @option{--dry-run} first. And then inspecting the commits listed with
@command{git log -p 1234567..987654}. The @command{git status} command
may help in finding local changes that have been forgotten to be added.
@@ -395,7 +398,7 @@ Next let the code pass through a full run of our testsuite.
@itemize
@item @command{make distclean}
@item @command{/path/to/ffmpeg/configure}
-@item @command{make check}
+@item @command{make fate}
@item if fate fails due to missing samples run @command{make fate-rsync} and retry
@end itemize
@@ -413,5 +416,5 @@ recommended.
@chapter Server Issues
-Contact the project admins @email{root@@ffmpeg.org} if you have technical
-problems with the GIT server.
+Contact the project admins at @email{root@@ffmpeg.org} if you have technical
+problems with the Git server.
diff --git a/chromium/third_party/ffmpeg/doc/indevs.texi b/chromium/third_party/ffmpeg/doc/indevs.texi
index d5415bbc7c5..6f1530a27b0 100644
--- a/chromium/third_party/ffmpeg/doc/indevs.texi
+++ b/chromium/third_party/ffmpeg/doc/indevs.texi
@@ -51,6 +51,18 @@ ffmpeg -f alsa -i hw:0 alsaout.wav
For more information see:
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
+@subsection Options
+
+@table @option
+
+@item sample_rate
+Set the sample rate in Hz. Default is 48000.
+
+@item channels
+Set the number of channels. Default is 2.
+
+@end table
+
@section avfoundation
AVFoundation input device.
@@ -114,6 +126,19 @@ und the first one in this list is used instead. Available pixel formats are:
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
yuv420p, nv12, yuyv422, gray}
+@item -framerate
+Set the grabbing frame rate. Default is @code{ntsc}, corresponding to a
+frame rate of @code{30000/1001}.
+
+@item -video_size
+Set the video frame size.
+
+@item -capture_cursor
+Capture the mouse pointer. Default is 0.
+
+@item -capture_mouse_clicks
+Capture the screen mouse clicks. Default is 0.
+
@end table
@subsection Examples
@@ -150,6 +175,36 @@ $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
BSD video input device.
+@subsection Options
+
+@table @option
+
+@item framerate
+Set the frame rate.
+
+@item video_size
+Set the video frame size. Default is @code{vga}.
+
+@item standard
+
+Available values are:
+@table @samp
+@item pal
+
+@item ntsc
+
+@item secam
+
+@item paln
+
+@item palm
+
+@item ntscj
+
+@end table
+
+@end table
+
@section decklink
The decklink input device provides capture capabilities for Blackmagic
@@ -211,18 +266,6 @@ Capture video clip at 1080i50 10 bit:
ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
@end example
-@item
-Capture video clip at 720p50 with 32bit audio:
-@example
-ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@@14' -acodec copy -vcodec copy output.avi
-@end example
-
-@item
-Capture video clip at 576i50 with 8 audio channels:
-@example
-ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@@3' -acodec copy -vcodec copy output.avi
-@end example
-
@end itemize
@section dshow
@@ -275,11 +318,11 @@ If set to @option{true}, print a list of selected device's options
and exit.
@item video_device_number
-Set video device number for devices with same name (starts at 0,
+Set video device number for devices with the same name (starts at 0,
defaults to 0).
@item audio_device_number
-Set audio device number for devices with same name (starts at 0,
+Set audio device number for devices with the same name (starts at 0,
defaults to 0).
@item pixel_format
@@ -429,6 +472,27 @@ $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_numbe
Linux DV 1394 input device.
+@subsection Options
+
+@table @option
+
+@item framerate
+Set the frame rate. Default is 25.
+
+@item standard
+
+Available values are:
+@table @samp
+@item pal
+
+@item ntsc
+
+@end table
+
+Default value is @code{ntsc}.
+
+@end table
+
@section fbdev
Linux framebuffer input device.
@@ -441,18 +505,27 @@ console. It is accessed through a file device node, usually
For more detailed information read the file
Documentation/fb/framebuffer.txt included in the Linux source tree.
+See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
+
To record from the framebuffer device @file{/dev/fb0} with
@command{ffmpeg}:
@example
-ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
+ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
@end example
You can take a single screenshot image with the command:
@example
-ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
+ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
@end example
-See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
+@subsection Options
+
+@table @option
+
+@item framerate
+Set the frame rate. Default is 25.
+
+@end table
@section gdigrab
@@ -638,6 +711,15 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
For more information read:
@url{http://jackaudio.org/}
+@subsection Options
+
+@table @option
+
+@item channels
+Set the number of channels. Default is 2.
+
+@end table
+
@section lavfi
Libavfilter input virtual device.
@@ -678,6 +760,9 @@ Set the filename of the filtergraph to be read and sent to the other
filters. Syntax of the filtergraph is the same as the one specified by
the option @var{graph}.
+@item dumpgraph
+Dump graph to stderr.
+
@end table
@subsection Examples
@@ -879,6 +964,19 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
For more information about OSS see:
@url{http://manuals.opensound.com/usersguide/dsp.html}
+@subsection Options
+
+@table @option
+
+@item sample_rate
+Set the sample rate in Hz. Default is 48000.
+
+@item channels
+Set the number of channels. Default is 2.
+
+@end table
+
+
@section pulse
PulseAudio input device.
@@ -919,6 +1017,10 @@ Specify the number of bytes per frame, by default it is set to 1024.
@item fragment_size
Specify the minimal buffering fragment in PulseAudio, it will affect the
audio latency. By default it is unset.
+
+@item wallclock
+Set the initial PTS using the current time. Default is 1.
+
@end table
@subsection Examples
@@ -954,6 +1056,22 @@ ffmpeg -f qtkit -i "default" out.mpg
ffmpeg -f qtkit -list_devices true -i ""
@end example
+@subsection Options
+
+@table @option
+
+@item frame_rate
+Set frame rate. Default is 30.
+
+@item list_devices
+If set to @code{true}, print a list of devices and exit. Default is
+@code{false}.
+
+@item video_device_index
+Select the video device by index for devices with the same name (starts at 0).
+
+@end table
+
@section sndio
sndio input device.
@@ -971,6 +1089,18 @@ command:
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
@end example
+@subsection Options
+
+@table @option
+
+@item sample_rate
+Set the sample rate in Hz. Default is 48000.
+
+@item channels
+Set the number of channels. Default is 2.
+
+@end table
+
@section video4linux2, v4l2
Video4Linux2 input video device.
@@ -1093,6 +1223,10 @@ Force conversion from monotonic to absolute timestamps.
@end table
Default value is @code{default}.
+
+@item use_libv4l2
+Use libv4l2 (v4l-utils) conversion functions. Default is 0.
+
@end table
@section vfwcap
@@ -1103,6 +1237,19 @@ The filename passed as input is the capture driver number, ranging from
0 to 9. You may use "list" as filename to print a list of drivers. Any
other filename will be interpreted as device number 0.
+@subsection Options
+
+@table @option
+
+@item video_size
+Set the video frame size.
+
+@item framerate
+Set the grabbing frame rate. Default value is @code{ntsc},
+corresponding to a frame rate of @code{30000/1001}.
+
+@end table
+
@section x11grab
X11 video input device.
diff --git a/chromium/third_party/ffmpeg/doc/mips.txt b/chromium/third_party/ffmpeg/doc/mips.txt
index 8c6779f67d5..a84e89ae798 100644
--- a/chromium/third_party/ffmpeg/doc/mips.txt
+++ b/chromium/third_party/ffmpeg/doc/mips.txt
@@ -47,12 +47,16 @@ Files that have MIPS copyright notice in them:
* libavutil/mips/
float_dsp_mips.c
libm_mips.h
+ softfloat_tables.h
* libavcodec/
fft_fixed_32.c
fft_init_table.c
fft_table.h
mdct_fixed_32.c
* libavcodec/mips/
+ aacdec_fixed.c
+ aacsbr_fixed.c
+ aacsbr_template.c
aaccoder_mips.c
aacpsy_mips.h
ac3dsp_mips.c
diff --git a/chromium/third_party/ffmpeg/doc/multithreading.txt b/chromium/third_party/ffmpeg/doc/multithreading.txt
index 2b992fcbc53..83849deacca 100644
--- a/chromium/third_party/ffmpeg/doc/multithreading.txt
+++ b/chromium/third_party/ffmpeg/doc/multithreading.txt
@@ -54,7 +54,7 @@ thread.
If the codec allocates writable tables in its init(), add an init_thread_copy()
which re-allocates them for other threads.
-Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
+Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
speed gain at this point but it should work.
If there are inter-frame dependencies, so the codec calls
diff --git a/chromium/third_party/ffmpeg/doc/muxers.texi b/chromium/third_party/ffmpeg/doc/muxers.texi
index 22a8eb76012..86ca4ad767a 100644
--- a/chromium/third_party/ffmpeg/doc/muxers.texi
+++ b/chromium/third_party/ffmpeg/doc/muxers.texi
@@ -549,7 +549,7 @@ MD5 testing format.
This muxer computes and prints the MD5 hash of all the input audio
and video frames. By default audio frames are converted to signed
16-bit raw audio and video frames to raw video before computing the
-hash.
+hash. Timestamps are ignored.
The output of the muxer consists of a single line of the form:
MD5=@var{MD5}, where @var{MD5} is a hexadecimal number representing
@@ -667,6 +667,13 @@ point on IIS with this muxer. Example:
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
@end example
+@subsection Audible AAX
+
+Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
+@example
+ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
+@end example
+
@section mp3
The MP3 muxer writes a raw MP3 stream with the following optional features:
@@ -759,6 +766,10 @@ Set a constant muxrate (default VBR).
@item -pcr_period @var{numer}
Override the default PCR retransmission time (default 20ms), ignored
if variable muxrate is selected.
+@item pat_period @var{number}
+Maximal time in seconds between PAT/PMT tables.
+@item sdt_period @var{number}
+Maximal time in seconds between SDT tables.
@item -pes_payload_size @var{number}
Set minimum PES packet payload in bytes.
@item -mpegts_flags @var{flags}
@@ -810,6 +821,8 @@ Option mpegts_flags may take a set of such flags:
Reemit PAT/PMT before writing the next packet.
@item latm
Use LATM packetization for AAC.
+@item pat_pmt_at_frames
+Reemit PAT and PMT at each video frame.
@end table
@subsection Example
@@ -964,13 +977,6 @@ Allow caching (only affects M3U8 list files).
Allow live-friendly file generation.
@end table
-@item segment_list_type @var{type}
-Select the listing format.
-@table @option
-@item @var{flat} use a simple flat list of entries.
-@item @var{hls} use a m3u8-like structure.
-@end table
-
@item segment_list_size @var{size}
Update the list file so that it contains at most @var{size}
segments. If 0 the list file will contain all the segments. Default
@@ -980,6 +986,9 @@ value is 0.
Prepend @var{prefix} to each entry. Useful to generate absolute paths.
By default no prefix is applied.
+@item segment_list_type @var{type}
+Select the listing format.
+
The following values are recognized:
@table @samp
@item flat
diff --git a/chromium/third_party/ffmpeg/doc/platform.texi b/chromium/third_party/ffmpeg/doc/platform.texi
index 705a68006fb..54f7bb75958 100644
--- a/chromium/third_party/ffmpeg/doc/platform.texi
+++ b/chromium/third_party/ffmpeg/doc/platform.texi
@@ -175,12 +175,6 @@ Notes:
@itemize
-@item It is possible that coreutils' @code{link.exe} conflicts with MSVC's linker.
-You can find out by running @code{which link} to see which @code{link.exe} you
-are using. If it is located at @code{/bin/link.exe}, then you have the wrong one
-in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
-@code{link.exe} takes precedence in your @code{PATH} over coreutils'.
-
@item If you wish to build with zlib support, you will have to grab a compatible
zlib binary from somewhere, with an MSVC import lib, or if you wish to link
statically, you can follow the instructions below to build a compatible
diff --git a/chromium/third_party/ffmpeg/doc/protocols.texi b/chromium/third_party/ffmpeg/doc/protocols.texi
index 453dbcf6bfe..7c6b9d463d4 100644
--- a/chromium/third_party/ffmpeg/doc/protocols.texi
+++ b/chromium/third_party/ffmpeg/doc/protocols.texi
@@ -19,6 +19,18 @@ supported protocols.
A description of the currently available protocols follows.
+@section async
+
+Asynchronous data filling wrapper for input stream.
+
+Fill data in a background thread, to decouple I/O operation from demux thread.
+
+@example
+async:@var{URL}
+async:http://host/resource
+async:cache:http://host/resource
+@end example
+
@section bluray
Read BluRay playlist.
@@ -248,6 +260,16 @@ Set timeout in microseconds of socket I/O operations used by the underlying low
operation. By default it is set to -1, which means that the timeout is
not specified.
+@item reconnect_at_eof
+If set then eof is treated like an error and causes reconnection, this is useful
+for live / endless streams.
+
+@item reconnect_streamed
+If set then even streamed/non seekable streams will be reconnected on errors.
+
+@item reconnect_delay_max
+Sets the maximum delay in seconds after which to give up reconnecting
+
@item mime_type
Export the MIME type.
@@ -292,6 +314,8 @@ autodetection in the future.
If set to 1 enables experimental HTTP server. This can be used to send data when
used as an output option, or read data from a client with HTTP POST when used as
an input option.
+If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented
+in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
@example
# Server side (sending):
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port}
diff --git a/chromium/third_party/ffmpeg/doc/scaler.texi b/chromium/third_party/ffmpeg/doc/scaler.texi
index 23d6393883f..060a45ca744 100644
--- a/chromium/third_party/ffmpeg/doc/scaler.texi
+++ b/chromium/third_party/ffmpeg/doc/scaler.texi
@@ -122,6 +122,22 @@ a_dither).
@end table
+@item alphablend
+Set the alpha blending to use when the input has alpha but the output does not.
+Default value is @samp{none}.
+
+@table @samp
+@item uniform_color
+Blend onto a uniform background color
+
+@item checkerboard
+Blend onto a checkerboard
+
+@item none
+No blending
+
+@end table
+
@end table
@c man end SCALER OPTIONS
diff --git a/chromium/third_party/ffmpeg/doc/texi2pod.pl b/chromium/third_party/ffmpeg/doc/texi2pod.pl
index e1ff6b46d4a..9a9b34fc150 100644
--- a/chromium/third_party/ffmpeg/doc/texi2pod.pl
+++ b/chromium/third_party/ffmpeg/doc/texi2pod.pl
@@ -384,7 +384,7 @@ sub postprocess
# @* is also impossible in .pod; we discard it and any newline that
# follows it. Similarly, our macro @gol must be discarded.
- s/\@anchor{(?:[^\}]*)\}//g;
+ s/\@anchor\{(?:[^\}]*)\}//g;
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
diff --git a/chromium/third_party/ffmpeg/doc/utils.texi b/chromium/third_party/ffmpeg/doc/utils.texi
index 6517ac0a97a..756c6090727 100644
--- a/chromium/third_party/ffmpeg/doc/utils.texi
+++ b/chromium/third_party/ffmpeg/doc/utils.texi
@@ -238,6 +238,14 @@ The following abbreviations are recognized:
480x320
@item qhd
960x540
+@item 2kdci
+2048x1080
+@item 4kdci
+4096x2160
+@item uhd2160
+3840x2160
+@item uhd4320
+7680x4320
@end table
@anchor{video rate syntax}
diff --git a/chromium/third_party/ffmpeg/ffmpeg.c b/chromium/third_party/ffmpeg/ffmpeg.c
index 40d929dac23..e31a2c60920 100644
--- a/chromium/third_party/ffmpeg/ffmpeg.c
+++ b/chromium/third_party/ffmpeg/ffmpeg.c
@@ -49,6 +49,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/fifo.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
@@ -63,7 +64,6 @@
#include "libavcodec/mathops.h"
#include "libavformat/os_support.h"
-# include "libavfilter/avcodec.h"
# include "libavfilter/avfilter.h"
# include "libavfilter/buffersrc.h"
# include "libavfilter/buffersink.h"
@@ -79,6 +79,10 @@
#include <windows.h>
#include <psapi.h>
#endif
+#if HAVE_SETCONSOLECTRLHANDLER
+#include <windows.h>
+#endif
+
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
@@ -132,8 +136,6 @@ AVIOContext *progress_avio = NULL;
static uint8_t *subtitle_out;
-#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
-
InputStream **input_streams = NULL;
int nb_input_streams = 0;
InputFile **input_files = NULL;
@@ -169,8 +171,8 @@ static int sub2video_get_blank_frame(InputStream *ist)
AVFrame *frame = ist->sub2video.frame;
av_frame_unref(frame);
- ist->sub2video.frame->width = ist->sub2video.w;
- ist->sub2video.frame->height = ist->sub2video.h;
+ ist->sub2video.frame->width = ist->dec_ctx->width ? ist->dec_ctx->width : ist->sub2video.w;
+ ist->sub2video.frame->height = ist->dec_ctx->height ? ist->dec_ctx->height : ist->sub2video.h;
ist->sub2video.frame->format = AV_PIX_FMT_RGB32;
if ((ret = av_frame_get_buffer(frame, 32)) < 0)
return ret;
@@ -190,7 +192,9 @@ static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h,
return;
}
if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) {
- av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");
+ av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle (%d %d %d %d) overflowing %d %d\n",
+ r->x, r->y, r->w, r->h, w, h
+ );
return;
}
@@ -222,7 +226,6 @@ static void sub2video_push_ref(InputStream *ist, int64_t pts)
static void sub2video_update(InputStream *ist, AVSubtitle *sub)
{
- int w = ist->sub2video.w, h = ist->sub2video.h;
AVFrame *frame = ist->sub2video.frame;
int8_t *dst;
int dst_linesize;
@@ -250,7 +253,7 @@ static void sub2video_update(InputStream *ist, AVSubtitle *sub)
dst = frame->data [0];
dst_linesize = frame->linesize[0];
for (i = 0; i < num_rects; i++)
- sub2video_copy_rect(dst, dst_linesize, w, h, sub->rects[i]);
+ sub2video_copy_rect(dst, dst_linesize, frame->width, frame->height, sub->rects[i]);
sub2video_push_ref(ist, pts);
ist->sub2video.end_pts = end_pts;
}
@@ -291,7 +294,7 @@ static void sub2video_flush(InputStream *ist)
if (ist->sub2video.end_pts < INT64_MAX)
sub2video_update(ist, NULL);
for (i = 0; i < ist->nb_filters; i++)
- av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
+ av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
}
/* end of sub2video hack */
@@ -313,6 +316,7 @@ void term_exit(void)
static volatile int received_sigterm = 0;
static volatile int received_nb_signals = 0;
static volatile int transcode_init_done = 0;
+static volatile int ffmpeg_exited = 0;
static int main_return_code = 0;
static void
@@ -321,10 +325,46 @@ sigterm_handler(int sig)
received_sigterm = sig;
received_nb_signals++;
term_exit_sigsafe();
- if(received_nb_signals > 3)
+ if(received_nb_signals > 3) {
+ write(2/*STDERR_FILENO*/, "Received > 3 system signals, hard exiting\n",
+ strlen("Received > 3 system signals, hard exiting\n"));
+
exit(123);
+ }
}
+#if HAVE_SETCONSOLECTRLHANDLER
+static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
+{
+ av_log(NULL, AV_LOG_DEBUG, "\nReceived windows signal %ld\n", fdwCtrlType);
+
+ switch (fdwCtrlType)
+ {
+ case CTRL_C_EVENT:
+ case CTRL_BREAK_EVENT:
+ sigterm_handler(SIGINT);
+ return TRUE;
+
+ case CTRL_CLOSE_EVENT:
+ case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
+ sigterm_handler(SIGTERM);
+ /* Basically, with these 3 events, when we return from this method the
+ process is hard terminated, so stall as long as we need to
+ to try and let the main thread(s) clean up and gracefully terminate
+ (we have at most 5 seconds, but should be done far before that). */
+ while (!ffmpeg_exited) {
+ Sleep(0);
+ }
+ return TRUE;
+
+ default:
+ av_log(NULL, AV_LOG_ERROR, "Received unknown windows signal %ld\n", fdwCtrlType);
+ return FALSE;
+ }
+}
+#endif
+
void term_init(void)
{
#if HAVE_TERMIOS_H
@@ -358,6 +398,9 @@ void term_init(void)
#ifdef SIGXCPU
signal(SIGXCPU, sigterm_handler);
#endif
+#if HAVE_SETCONSOLECTRLHANDLER
+ SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
+#endif
}
/* read a key without blocking */
@@ -391,10 +434,6 @@ static int read_key(void)
is_pipe = !GetConsoleMode(input_handle, &dw);
}
- if (stdin->_cnt > 0) {
- read(0, &ch, 1);
- return ch;
- }
if (is_pipe) {
/* When running under a GUI, you will end here. */
if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) {
@@ -429,7 +468,7 @@ static void ffmpeg_cleanup(int ret)
if (do_benchmark) {
int maxrss = getmaxrss() / 1024;
- printf("bench: maxrss=%ikB\n", maxrss);
+ av_log(NULL, AV_LOG_INFO, "bench: maxrss=%ikB\n", maxrss);
}
for (i = 0; i < nb_filtergraphs; i++) {
@@ -456,7 +495,10 @@ static void ffmpeg_cleanup(int ret)
/* close files */
for (i = 0; i < nb_output_files; i++) {
OutputFile *of = output_files[i];
- AVFormatContext *s = of->ctx;
+ AVFormatContext *s;
+ if (!of)
+ continue;
+ s = of->ctx;
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
avio_closep(&s->pb);
avformat_free_context(s);
@@ -466,7 +508,12 @@ static void ffmpeg_cleanup(int ret)
}
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = output_streams[i];
- AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
+ AVBitStreamFilterContext *bsfc;
+
+ if (!ost)
+ continue;
+
+ bsfc = ost->bitstream_filters;
while (bsfc) {
AVBitStreamFilterContext *next = bsfc->next;
av_bitstream_filter_close(bsfc);
@@ -527,12 +574,13 @@ static void ffmpeg_cleanup(int ret)
avformat_network_deinit();
if (received_sigterm) {
- av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
+ av_log(NULL, AV_LOG_INFO, "Exiting normally, received signal %d.\n",
(int) received_sigterm);
} else if (ret && transcode_init_done) {
av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
}
term_exit();
+ ffmpeg_exited = 1;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
@@ -569,7 +617,7 @@ static void update_benchmark(const char *fmt, ...)
va_start(va, fmt);
vsnprintf(buf, sizeof(buf), fmt, va);
va_end(va);
- printf("bench: %8"PRIu64" %s \n", t - current_time, buf);
+ av_log(NULL, AV_LOG_INFO, "bench: %8"PRIu64" %s \n", t - current_time, buf);
}
current_time = t;
}
@@ -591,7 +639,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
int ret;
if (!ost->st->codec->extradata_size && ost->enc_ctx->extradata_size) {
- ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ost->st->codec->extradata) {
memcpy(ost->st->codec->extradata, ost->enc_ctx->extradata, ost->enc_ctx->extradata_size);
ost->st->codec->extradata_size = ost->enc_ctx->extradata_size;
@@ -616,6 +664,20 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
}
ost->frame_number++;
}
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ int i;
+ uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS,
+ NULL);
+ ost->quality = sd ? AV_RL32(sd) : -1;
+ ost->pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
+
+ for (i = 0; i<FF_ARRAY_ELEMS(ost->error); i++) {
+ if (sd && i < sd[5])
+ ost->error[i] = AV_RL64(sd + 8 + 8*i);
+ else
+ ost->error[i] = -1;
+ }
+ }
if (bsfc)
av_packet_split_side_data(pkt);
@@ -630,11 +692,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
- if(a == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
- uint8_t *t = av_malloc(new_pkt.size + FF_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow
+ if(a == 0 && new_pkt.data != pkt->data) {
+ uint8_t *t = av_malloc(new_pkt.size + AV_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow
if(t) {
memcpy(t, new_pkt.data, new_pkt.size);
- memset(t + new_pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(t + new_pkt.size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
new_pkt.data = t;
new_pkt.buf = NULL;
a = 1;
@@ -650,6 +712,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
if (!new_pkt.buf)
exit_program(1);
} else if (a < 0) {
+ new_pkt = *pkt;
av_log(NULL, AV_LOG_ERROR, "Failed to open bitstream filter %s for stream %d with codec %s",
bsfc->filter->name, pkt->stream_index,
avctx->codec ? avctx->codec->name : "copy");
@@ -1061,7 +1124,7 @@ static void do_video_out(AVFormatContext *s,
int got_packet, forced_keyframe = 0;
double pts_time;
- if (enc->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME) &&
+ if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) &&
ost->top_field_first >= 0)
in_picture->top_field_first = !!ost->top_field_first;
@@ -1087,7 +1150,7 @@ static void do_video_out(AVFormatContext *s,
ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
res = av_expr_eval(ost->forced_keyframes_pexpr,
ost->forced_keyframes_expr_const_values, NULL);
- av_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n",
+ ff_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n",
ost->forced_keyframes_expr_const_values[FKF_N],
ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
@@ -1140,7 +1203,7 @@ static void do_video_out(AVFormatContext *s,
av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &enc->time_base));
}
- if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & CODEC_CAP_DELAY))
+ if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & AV_CODEC_CAP_DELAY))
pkt.pts = ost->sync_opts;
av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
@@ -1176,8 +1239,10 @@ static void do_video_out(AVFormatContext *s,
if (!ost->last_frame)
ost->last_frame = av_frame_alloc();
av_frame_unref(ost->last_frame);
- if (next_picture)
+ if (next_picture && ost->last_frame)
av_frame_ref(ost->last_frame, next_picture);
+ else
+ av_frame_free(&ost->last_frame);
}
static double psnr(double d)
@@ -1203,9 +1268,11 @@ static void do_video_stats(OutputStream *ost, int frame_size)
enc = ost->enc_ctx;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
frame_number = ost->st->nb_frames;
- fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame ? enc->coded_frame->quality / (float)FF_QP2LAMBDA : 0);
- if (enc->coded_frame && (enc->flags&CODEC_FLAG_PSNR))
- fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
+ fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
+ ost->quality / (float)FF_QP2LAMBDA);
+
+ if (ost->error[0]>=0 && (enc->flags & AV_CODEC_FLAG_PSNR))
+ fprintf(vstats_file, "PSNR= %6.2f ", psnr(ost->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
fprintf(vstats_file,"f_size= %6d ", frame_size);
/* compute pts value */
@@ -1217,7 +1284,7 @@ static void do_video_stats(OutputStream *ost, int frame_size)
avg_bitrate = (double)(ost->data_size * 8) / ti1 / 1000.0;
fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
(double)ost->data_size / 1024, ti1, bitrate, avg_bitrate);
- fprintf(vstats_file, "type= %c\n", enc->coded_frame ? av_get_picture_type_char(enc->coded_frame->pict_type) : 'I');
+ fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type));
}
}
@@ -1315,7 +1382,7 @@ static int reap_filters(int flush)
do_video_out(of->ctx, ost, filtered_frame, float_pts);
break;
case AVMEDIA_TYPE_AUDIO:
- if (!(enc->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
+ if (!(enc->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE) &&
enc->channels != av_frame_get_channels(filtered_frame)) {
av_log(NULL, AV_LOG_ERROR,
"Audio filter graph output is not normalized and encoder does not support parameter changes\n");
@@ -1354,8 +1421,8 @@ static void print_final_stats(int64_t total_size)
}
extra_size += ost->enc_ctx->extradata_size;
data_size += ost->data_size;
- if ( (ost->enc_ctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))
- != CODEC_FLAG_PASS1)
+ if ( (ost->enc_ctx->flags & (AV_CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))
+ != AV_CODEC_FLAG_PASS1)
pass1_used = 0;
}
@@ -1494,8 +1561,9 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
float q = -1;
ost = output_streams[i];
enc = ost->enc_ctx;
- if (!ost->stream_copy && enc->coded_frame)
- q = enc->coded_frame->quality / (float)FF_QP2LAMBDA;
+ if (!ost->stream_copy)
+ q = ost->quality / (float) FF_QP2LAMBDA;
+
if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
@@ -1522,7 +1590,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
for (j = 0; j < 32; j++)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log2(qp_histogram[j] + 1)));
}
- if ((enc->flags&CODEC_FLAG_PSNR) && (enc->coded_frame || is_last_report)) {
+
+ if ((enc->flags & AV_CODEC_FLAG_PSNR) && (ost->pict_type != AV_PICTURE_TYPE_NONE || is_last_report)) {
int j;
double error, error_sum = 0;
double scale, scale_sum = 0;
@@ -1534,7 +1603,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
error = enc->error[j];
scale = enc->width * enc->height * 255.0 * 255.0 * frame_number;
} else {
- error = enc->coded_frame->error[j];
+ error = ost->error[j];
scale = enc->width * enc->height * 255.0 * 255.0;
}
if (j)
@@ -1673,7 +1742,9 @@ static void flush_encoders(void)
ret = encode(enc, &pkt, NULL, &got_packet);
update_benchmark("flush %s %d.%d", desc, ost->file_index, ost->index);
if (ret < 0) {
- av_log(NULL, AV_LOG_FATAL, "%s encoding failed\n", desc);
+ av_log(NULL, AV_LOG_FATAL, "%s encoding failed: %s\n",
+ desc,
+ av_err2str(ret));
exit_program(1);
}
if (ost->logfile && enc->stats_out) {
@@ -1789,17 +1860,22 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
opkt.flags = pkt->flags;
-
// FIXME remove the following 2 lines they shall be replaced by the bitstream filters
- if ( ost->enc_ctx->codec_id != AV_CODEC_ID_H264
- && ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG1VIDEO
- && ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG2VIDEO
- && ost->enc_ctx->codec_id != AV_CODEC_ID_VC1
+ if ( ost->st->codec->codec_id != AV_CODEC_ID_H264
+ && ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO
+ && ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
+ && ost->st->codec->codec_id != AV_CODEC_ID_VC1
) {
- if (av_parser_change(ost->parser, ost->st->codec,
+ int ret = av_parser_change(ost->parser, ost->st->codec,
&opkt.data, &opkt.size,
pkt->data, pkt->size,
- pkt->flags & AV_PKT_FLAG_KEY)) {
+ pkt->flags & AV_PKT_FLAG_KEY);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "av_parser_change failed: %s\n",
+ av_err2str(ret));
+ exit_program(1);
+ }
+ if (ret) {
opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
if (!opkt.buf)
exit_program(1);
@@ -1810,9 +1886,16 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
}
av_copy_packet_side_data(&opkt, pkt);
- if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
+ if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+ ost->st->codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
+ (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
/* store AVPicture in AVPacket, as expected by the output format */
- avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
+ int ret = avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "avpicture_fill failed: %s\n",
+ av_err2str(ret));
+ exit_program(1);
+ }
opkt.data = (uint8_t *)&pict;
opkt.size = sizeof(AVPicture);
opkt.flags |= AV_PKT_FLAG_KEY;
@@ -1863,20 +1946,14 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
ret = AVERROR_INVALIDDATA;
}
- if (*got_output || ret<0 || pkt->size)
+ if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
- if (!*got_output || ret < 0) {
- if (!pkt->size) {
- for (i = 0; i < ist->nb_filters; i++)
-#if 1
- av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
-#else
- av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-#endif
- }
+ if (ret < 0 && exit_on_error)
+ exit_program(1);
+
+ if (!*got_output || ret < 0)
return ret;
- }
ist->samples_decoded += decoded_frame->nb_samples;
ist->frames_decoded++;
@@ -2000,17 +2077,21 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) {
ist->st->codec->has_b_frames = ist->dec_ctx->has_b_frames;
} else
- av_log_ask_for_sample(
- ist->dec_ctx,
- "has_b_frames is larger in decoder than demuxer %d > %d ",
- ist->dec_ctx->has_b_frames,
- ist->st->codec->has_b_frames
- );
+ av_log(ist->dec_ctx, AV_LOG_WARNING,
+ "has_b_frames is larger in decoder than demuxer %d > %d.\n"
+ "If you want to help, upload a sample "
+ "of this file to ftp://upload.ffmpeg.org/incoming/ "
+ "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)",
+ ist->dec_ctx->has_b_frames,
+ ist->st->codec->has_b_frames);
}
- if (*got_output || ret<0 || pkt->size)
+ if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
+ if (ret < 0 && exit_on_error)
+ exit_program(1);
+
if (*got_output && ret >= 0) {
if (ist->dec_ctx->width != decoded_frame->width ||
ist->dec_ctx->height != decoded_frame->height ||
@@ -2025,17 +2106,8 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
}
}
- if (!*got_output || ret < 0) {
- if (!pkt->size) {
- for (i = 0; i < ist->nb_filters; i++)
-#if 1
- av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
-#else
- av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-#endif
- }
+ if (!*got_output || ret < 0)
return ret;
- }
if(ist->top_field_first>=0)
decoded_frame->top_field_first = ist->top_field_first;
@@ -2126,9 +2198,12 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
int i, ret = avcodec_decode_subtitle2(ist->dec_ctx,
&subtitle, got_output, pkt);
- if (*got_output || ret<0 || pkt->size)
+ if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
+ if (ret < 0 && exit_on_error)
+ exit_program(1);
+
if (ret < 0 || !*got_output) {
if (!pkt->size)
sub2video_flush(ist);
@@ -2180,6 +2255,17 @@ out:
return ret;
}
+static int send_filter_eof(InputStream *ist)
+{
+ int i, ret;
+ for (i = 0; i < ist->nb_filters; i++) {
+ ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+}
+
/* pkt = NULL means EOF (needed to flush decoder buffers) */
static int process_input_packet(InputStream *ist, const AVPacket *pkt)
{
@@ -2227,7 +2313,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
ist->dts = ist->next_dts;
if (avpkt.size && avpkt.size != pkt->size &&
- !(ist->dec->capabilities & CODEC_CAP_SUBFRAMES)) {
+ !(ist->dec->capabilities & AV_CODEC_CAP_SUBFRAMES)) {
av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
"Multiple frames in a packet from stream %d\n", pkt->stream_index);
ist->showed_multi_packet_warning = 1;
@@ -2264,8 +2350,13 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
return -1;
}
- if (ret < 0)
- return ret;
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
+ ist->file_index, ist->st->index, av_err2str(ret));
+ if (exit_on_error)
+ exit_program(1);
+ break;
+ }
avpkt.dts=
avpkt.pts= AV_NOPTS_VALUE;
@@ -2284,6 +2375,15 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
break;
}
+ /* after flushing, send an EOF on all the filter inputs attached to the stream */
+ if (!pkt && ist->decoding_needed && !got_output) {
+ int ret = send_filter_eof(ist);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error marking filters as finished\n");
+ exit_program(1);
+ }
+ }
+
/* handle stream copy */
if (!ist->decoding_needed) {
ist->dts = ist->next_dts;
@@ -2475,6 +2575,75 @@ static int compare_int64(const void *a, const void *b)
return va < vb ? -1 : va > vb ? +1 : 0;
}
+static int init_output_stream(OutputStream *ost, char *error, int error_len)
+{
+ int ret = 0;
+
+ if (ost->encoding_needed) {
+ AVCodec *codec = ost->enc;
+ AVCodecContext *dec = NULL;
+ InputStream *ist;
+
+ if ((ist = get_input_stream(ost)))
+ dec = ist->dec_ctx;
+ if (dec && dec->subtitle_header) {
+ /* ASS code assumes this buffer is null terminated so add extra byte. */
+ ost->enc_ctx->subtitle_header = av_mallocz(dec->subtitle_header_size + 1);
+ if (!ost->enc_ctx->subtitle_header)
+ return AVERROR(ENOMEM);
+ memcpy(ost->enc_ctx->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
+ ost->enc_ctx->subtitle_header_size = dec->subtitle_header_size;
+ }
+ if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
+ av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
+ if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
+ !codec->defaults &&
+ !av_dict_get(ost->encoder_opts, "b", NULL, 0) &&
+ !av_dict_get(ost->encoder_opts, "ab", NULL, 0))
+ av_dict_set(&ost->encoder_opts, "b", "128000", 0);
+
+ if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
+ if (ret == AVERROR_EXPERIMENTAL)
+ abort_codec_experimental(codec, 1);
+ snprintf(error, error_len,
+ "Error while opening encoder for output stream #%d:%d - "
+ "maybe incorrect parameters such as bit_rate, rate, width or height",
+ ost->file_index, ost->index);
+ return ret;
+ }
+ if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
+ !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
+ av_buffersink_set_frame_size(ost->filter->filter,
+ ost->enc_ctx->frame_size);
+ assert_avoptions(ost->encoder_opts);
+ if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
+ av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
+ " It takes bits/s as argument, not kbits/s\n");
+
+ ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Error initializing the output stream codec context.\n");
+ exit_program(1);
+ }
+
+ // copy timebase while removing common factors
+ ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
+ ost->st->codec->codec= ost->enc_ctx->codec;
+ } else {
+ ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Error setting up codec context options.\n");
+ return ret;
+ }
+ // copy timebase while removing common factors
+ ost->st->time_base = av_add_q(ost->st->codec->time_base, (AVRational){0, 1});
+ }
+
+ return ret;
+}
+
static void parse_forced_key_frames(char *kf, OutputStream *ost,
AVCodecContext *avctx)
{
@@ -2585,7 +2754,7 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost)
if (!encoder_string)
exit_program(1);
- if (!(format_flags & AVFMT_FLAG_BITEXACT) && !(codec_flags & CODEC_FLAG_BITEXACT))
+ if (!(format_flags & AVFMT_FLAG_BITEXACT) && !(codec_flags & AV_CODEC_FLAG_BITEXACT))
av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
else
av_strlcpy(encoder_string, "Lavc ", encoder_string_len);
@@ -2626,21 +2795,6 @@ static int transcode_init(void)
input_streams[j + ifile->ist_index]->start = av_gettime_relative();
}
- /* output stream init */
- for (i = 0; i < nb_output_files; i++) {
- oc = output_files[i]->ctx;
- if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
- av_dump_format(oc, i, oc->filename, 1);
- av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", i);
- return AVERROR(EINVAL);
- }
- }
-
- /* init complex filtergraphs */
- for (i = 0; i < nb_filtergraphs; i++)
- if ((ret = avfilter_graph_config(filtergraphs[i]->graph, NULL)) < 0)
- return ret;
-
/* for each output stream, we compute the right encoding parameters */
for (i = 0; i < nb_output_streams; i++) {
AVCodecContext *enc_ctx;
@@ -2677,7 +2831,7 @@ static int transcode_init(void)
av_assert0(ist && !ost->filter);
- extra_size = (uint64_t)dec_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
+ extra_size = (uint64_t)dec_ctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE;
if (extra_size > INT_MAX) {
return AVERROR(EINVAL);
@@ -2752,7 +2906,7 @@ static int transcode_init(void)
enc_ctx->time_base = dec_ctx->time_base;
}
- if (ist && !ost->frame_rate.num)
+ if (!ost->frame_rate.num)
ost->frame_rate = ist->framerate;
if(ost->frame_rate.num)
enc_ctx->time_base = av_inv_q(ost->frame_rate);
@@ -2849,10 +3003,6 @@ static int transcode_init(void)
goto dump_format;
}
- if (ist)
- ist->decoding_needed |= DECODING_FOR_OST;
- ost->encoding_needed = 1;
-
set_encoder_id(output_files[ost->file_index], ost);
if (!ost->filter &&
@@ -2981,39 +3131,6 @@ static int transcode_init(void)
abort();
break;
}
- /* two pass mode */
- if (enc_ctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
- char logfilename[1024];
- FILE *f;
-
- snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
- ost->logfile_prefix ? ost->logfile_prefix :
- DEFAULT_PASS_LOGFILENAME_PREFIX,
- i);
- if (!strcmp(ost->enc->name, "libx264")) {
- av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
- } else {
- if (enc_ctx->flags & CODEC_FLAG_PASS2) {
- char *logbuffer;
- size_t logbuffer_size;
- if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
- logfilename);
- exit_program(1);
- }
- enc_ctx->stats_in = logbuffer;
- }
- if (enc_ctx->flags & CODEC_FLAG_PASS1) {
- f = av_fopen_utf8(logfilename, "wb");
- if (!f) {
- av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
- logfilename, strerror(errno));
- exit_program(1);
- }
- ost->logfile = f;
- }
- }
- }
}
if (ost->disposition) {
@@ -3050,63 +3167,9 @@ static int transcode_init(void)
/* open each encoder */
for (i = 0; i < nb_output_streams; i++) {
- ost = output_streams[i];
- if (ost->encoding_needed) {
- AVCodec *codec = ost->enc;
- AVCodecContext *dec = NULL;
-
- if ((ist = get_input_stream(ost)))
- dec = ist->dec_ctx;
- if (dec && dec->subtitle_header) {
- /* ASS code assumes this buffer is null terminated so add extra byte. */
- ost->enc_ctx->subtitle_header = av_mallocz(dec->subtitle_header_size + 1);
- if (!ost->enc_ctx->subtitle_header) {
- ret = AVERROR(ENOMEM);
- goto dump_format;
- }
- memcpy(ost->enc_ctx->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
- ost->enc_ctx->subtitle_header_size = dec->subtitle_header_size;
- }
- if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
- av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
- av_dict_set(&ost->encoder_opts, "side_data_only_packets", "1", 0);
-
- if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
- if (ret == AVERROR_EXPERIMENTAL)
- abort_codec_experimental(codec, 1);
- snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
- ost->file_index, ost->index);
- goto dump_format;
- }
- if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
- !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
- av_buffersink_set_frame_size(ost->filter->filter,
- ost->enc_ctx->frame_size);
- assert_avoptions(ost->encoder_opts);
- if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
- av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
- " It takes bits/s as argument, not kbits/s\n");
-
- ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
- if (ret < 0) {
- av_log(NULL, AV_LOG_FATAL,
- "Error initializing the output stream codec context.\n");
- exit_program(1);
- }
-
- // copy timebase while removing common factors
- ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
- ost->st->codec->codec= ost->enc_ctx->codec;
- } else {
- ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
- if (ret < 0) {
- av_log(NULL, AV_LOG_FATAL,
- "Error setting up codec context options.\n");
- return ret;
- }
- // copy timebase while removing common factors
- ost->st->time_base = av_add_q(ost->st->codec->time_base, (AVRational){0, 1});
- }
+ ret = init_output_stream(output_streams[i], error, sizeof(error));
+ if (ret < 0)
+ goto dump_format;
}
/* init input streams */
@@ -3376,9 +3439,17 @@ static int check_keyboard_interaction(int64_t cur_time)
if(!debug) debug = 1;
while(debug & (FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would just crash
debug += debug;
- }else
- if(scanf("%d", &debug)!=1)
+ }else{
+ char buf[32];
+ int k = 0;
+ i = 0;
+ while ((k = read_key()) != '\n' && k != '\r' && i < sizeof(buf)-1)
+ if (k > 0)
+ buf[i++] = k;
+ buf[i] = 0;
+ if (k <= 0 || sscanf(buf, "%d", &debug)!=1)
fprintf(stderr,"error parsing debug value\n");
+ }
for(i=0;i<nb_input_streams;i++) {
input_streams[i]->st->codec->debug = debug;
}
@@ -3456,7 +3527,7 @@ static void free_input_threads(void)
InputFile *f = input_files[i];
AVPacket pkt;
- if (!f->in_thread_queue)
+ if (!f || !f->in_thread_queue)
continue;
av_thread_message_queue_set_err_send(f->in_thread_queue, AVERROR_EOF);
while (av_thread_message_queue_recv(f->in_thread_queue, &pkt, 0) >= 0)
@@ -3759,13 +3830,7 @@ static int process_input(int file_index)
sub2video_heartbeat(ist, pkt.pts);
- ret = process_input_packet(ist, &pkt);
- if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
- ist->file_index, ist->st->index, av_err2str(ret));
- if (exit_on_error)
- exit_program(1);
- }
+ process_input_packet(ist, &pkt);
discard_packet:
av_free_packet(&pkt);
@@ -3984,6 +4049,7 @@ static int transcode(void)
av_freep(&ost->apad);
av_freep(&ost->disposition);
av_dict_free(&ost->encoder_opts);
+ av_dict_free(&ost->sws_dict);
av_dict_free(&ost->swr_opts);
av_dict_free(&ost->resample_opts);
av_dict_free(&ost->bsf_args);
@@ -4092,7 +4158,7 @@ int main(int argc, char **argv)
exit_program(1);
ti = getutime() - ti;
if (do_benchmark) {
- printf("bench: utime=%0.3fs\n", ti / 1000000.0);
+ av_log(NULL, AV_LOG_INFO, "bench: utime=%0.3fs\n", ti / 1000000.0);
}
av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors\n",
decode_error_stat[0], decode_error_stat[1]);
diff --git a/chromium/third_party/ffmpeg/ffmpeg.gyp b/chromium/third_party/ffmpeg/ffmpeg.gyp
index 31997bcfb2c..294dd2e1240 100755
--- a/chromium/third_party/ffmpeg/ffmpeg.gyp
+++ b/chromium/third_party/ffmpeg/ffmpeg.gyp
@@ -228,6 +228,10 @@
# This fires on `pos_min` and `pos_max` in
# autorename_libavformat_utils.c
'-Wno-sometimes-uninitialized',
+ # ffmpeg contains static functions in header files, which lead
+ # to unused function warnings. There are a few legit unused
+ # functions too.
+ '-Wno-unused-function',
],
},
'cflags': [
@@ -434,6 +438,16 @@
'sources': [
'<(shared_generated_dir)/ffmpeg.def',
],
+ 'conditions': [
+ ['OS=="win" and win_use_allocator_shim==1', {
+ 'dependencies': [
+ '../../base/allocator/allocator.gyp:allocator',
+ ],
+ 'sources': [
+ 'chromium/dllmain.cc',
+ ],
+ }],
+ ],
'actions': [
{
'action_name': 'generate_def',
diff --git a/chromium/third_party/ffmpeg/ffmpeg.h b/chromium/third_party/ffmpeg/ffmpeg.h
index 7fd129a2837..6544e6fb05a 100644
--- a/chromium/third_party/ffmpeg/ffmpeg.h
+++ b/chromium/third_party/ffmpeg/ffmpeg.h
@@ -63,6 +63,7 @@ enum HWAccelID {
HWACCEL_VDPAU,
HWACCEL_DXVA2,
HWACCEL_VDA,
+ HWACCEL_VIDEOTOOLBOX,
};
typedef struct HWAccel {
@@ -92,6 +93,7 @@ typedef struct OptionsContext {
/* input/output options */
int64_t start_time;
+ int64_t start_time_eof;
int seek_timestamp;
const char *format;
@@ -229,6 +231,7 @@ typedef struct OutputFilter {
/* temporary storage until stream maps are processed */
AVFilterInOut *out_tmp;
+ enum AVMediaType type;
} OutputFilter;
typedef struct FilterGraph {
@@ -429,8 +432,8 @@ typedef struct OutputStream {
char *filters; ///< filtergraph associated to the -filter option
char *filters_script; ///< filtergraph script associated to the -filter_script option
- int64_t sws_flags;
AVDictionary *encoder_opts;
+ AVDictionary *sws_dict;
AVDictionary *swr_opts;
AVDictionary *resample_opts;
AVDictionary *bsf_args;
@@ -455,6 +458,15 @@ typedef struct OutputStream {
// number of frames/samples sent to the encoder
uint64_t frames_encoded;
uint64_t samples_encoded;
+
+ /* packet quality factor */
+ int quality;
+
+ /* packet picture type */
+ int pict_type;
+
+ /* frame encode sum of squared error values */
+ int64_t error[4];
} OutputStream;
typedef struct OutputFile {
@@ -509,6 +521,7 @@ extern int frame_bits_per_raw_sample;
extern AVIOContext *progress_avio;
extern float max_error_rate;
extern int vdpau_api_ver;
+extern char *videotoolbox_pixfmt;
extern const AVIOInterruptCB int_cb;
@@ -536,11 +549,13 @@ int configure_filtergraph(FilterGraph *fg);
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
+int init_complex_filtergraph(FilterGraph *fg);
int ffmpeg_parse_options(int argc, char **argv);
int vdpau_init(AVCodecContext *s);
int dxva2_init(AVCodecContext *s);
int vda_init(AVCodecContext *s);
+int videotoolbox_init(AVCodecContext *s);
#endif /* FFMPEG_H */
diff --git a/chromium/third_party/ffmpeg/ffmpeg_filter.c b/chromium/third_party/ffmpeg/ffmpeg_filter.c
index 0be49bea87d..10b2f5f7220 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_filter.c
+++ b/chromium/third_party/ffmpeg/ffmpeg_filter.c
@@ -85,7 +85,7 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
break;
}
if (*p == -1) {
- if((codec->capabilities & CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
+ if((codec->capabilities & AV_CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
if(av_get_sample_fmt_name(st->codec->sample_fmt))
av_log(NULL, AV_LOG_WARNING,
@@ -289,6 +289,45 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
}
+int init_complex_filtergraph(FilterGraph *fg)
+{
+ AVFilterInOut *inputs, *outputs, *cur;
+ AVFilterGraph *graph;
+ int ret = 0;
+
+ /* this graph is only used for determining the kinds of inputs
+ * and outputs we have, and is discarded on exit from this function */
+ graph = avfilter_graph_alloc();
+ if (!graph)
+ return AVERROR(ENOMEM);
+
+ ret = avfilter_graph_parse2(graph, fg->graph_desc, &inputs, &outputs);
+ if (ret < 0)
+ goto fail;
+
+ for (cur = inputs; cur; cur = cur->next)
+ init_input_filter(fg, cur);
+
+ for (cur = outputs; cur;) {
+ GROW_ARRAY(fg->outputs, fg->nb_outputs);
+ fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]));
+ if (!fg->outputs[fg->nb_outputs - 1])
+ exit_program(1);
+
+ fg->outputs[fg->nb_outputs - 1]->graph = fg;
+ fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
+ fg->outputs[fg->nb_outputs - 1]->type = avfilter_pad_get_type(cur->filter_ctx->output_pads,
+ cur->pad_idx);
+ cur = cur->next;
+ fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
+ }
+
+fail:
+ avfilter_inout_free(&inputs);
+ avfilter_graph_free(&graph);
+ return ret;
+}
+
static int insert_trim(int64_t start_time, int64_t duration,
AVFilterContext **last_filter, int *pad_idx,
const char *filter_name)
@@ -384,11 +423,17 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
if (codec->width || codec->height) {
char args[255];
AVFilterContext *filter;
+ AVDictionaryEntry *e = NULL;
- snprintf(args, sizeof(args), "%d:%d:0x%X",
+ snprintf(args, sizeof(args), "%d:%d",
codec->width,
- codec->height,
- (unsigned)ost->sws_flags);
+ codec->height);
+
+ while ((e = av_dict_get(ost->sws_dict, "", e,
+ AV_DICT_IGNORE_SUFFIX))) {
+ av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value);
+ }
+
snprintf(name, sizeof(name), "scaler for output stream %d:%d",
ost->file_index, ost->index);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
@@ -499,7 +544,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
av_get_default_channel_layout(ost->audio_channels_mapped));
for (i = 0; i < ost->audio_channels_mapped; i++)
if (ost->audio_channels_map[i] != -1)
- av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]);
+ av_bprintf(&pan_buf, "|c%d=c%d", i, ost->audio_channels_map[i]);
AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str);
av_bprint_finalize(&pan_buf, NULL);
@@ -602,6 +647,11 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
av_freep(&ofilter->name);
DESCRIBE_FILTER_LINK(ofilter, out, 0);
+ if (!ofilter->ost) {
+ av_log(NULL, AV_LOG_FATAL, "Filter %s has a unconnected output\n", ofilter->name);
+ exit_program(1);
+ }
+
switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, ofilter, out);
case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, ofilter, out);
@@ -632,8 +682,8 @@ static int sub2video_prepare(InputStream *ist)
}
av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
}
- ist->sub2video.w = ist->dec_ctx->width = ist->resample_width = w;
- ist->sub2video.h = ist->dec_ctx->height = ist->resample_height = h;
+ ist->sub2video.w = ist->resample_width = w;
+ ist->sub2video.h = ist->resample_height = h;
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
palettes for all rectangles are identical or compatible */
@@ -688,7 +738,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
ist->resample_height,
ist->hwaccel_retrieve_data ? ist->hwaccel_retrieved_pix_fmt : ist->resample_pix_fmt,
tb.num, tb.den, sar.num, sar.den,
- SWS_BILINEAR + ((ist->dec_ctx->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
+ SWS_BILINEAR + ((ist->dec_ctx->flags&AV_CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
if (fr.num && fr.den)
av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
@@ -904,7 +954,7 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
int configure_filtergraph(FilterGraph *fg)
{
AVFilterInOut *inputs, *outputs, *cur;
- int ret, i, init = !fg->graph, simple = !fg->graph_desc;
+ int ret, i, simple = !fg->graph_desc;
const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
fg->graph_desc;
@@ -917,7 +967,13 @@ int configure_filtergraph(FilterGraph *fg)
char args[512];
AVDictionaryEntry *e = NULL;
- snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
+ args[0] = 0;
+ while ((e = av_dict_get(ost->sws_dict, "", e,
+ AV_DICT_IGNORE_SUFFIX))) {
+ av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
+ }
+ if (strlen(args))
+ args[strlen(args)-1] = 0;
fg->graph->scale_sws_opts = av_strdup(args);
args[0] = 0;
@@ -947,14 +1003,30 @@ int configure_filtergraph(FilterGraph *fg)
return ret;
if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
- av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
- "exactly one input and output.\n", graph_desc);
+ const char *num_inputs;
+ const char *num_outputs;
+ if (!outputs) {
+ num_outputs = "0";
+ } else if (outputs->next) {
+ num_outputs = ">1";
+ } else {
+ num_outputs = "1";
+ }
+ if (!inputs) {
+ num_inputs = "0";
+ } else if (inputs->next) {
+ num_inputs = ">1";
+ } else {
+ num_inputs = "1";
+ }
+ av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' was expected "
+ "to have exactly 1 input and 1 output."
+ " However, it had %s input(s) and %s output(s)."
+ " Please adjust, or use a complex filtergraph (-filter_complex) instead.\n",
+ graph_desc, num_inputs, num_outputs);
return AVERROR(EINVAL);
}
- for (cur = inputs; !simple && init && cur; cur = cur->next)
- init_input_filter(fg, cur);
-
for (cur = inputs, i = 0; cur; cur = cur->next, i++)
if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) {
avfilter_inout_free(&inputs);
@@ -963,27 +1035,12 @@ int configure_filtergraph(FilterGraph *fg)
}
avfilter_inout_free(&inputs);
- if (!init || simple) {
- /* we already know the mappings between lavfi outputs and output streams,
- * so we can finish the setup */
- for (cur = outputs, i = 0; cur; cur = cur->next, i++)
- configure_output_filter(fg, fg->outputs[i], cur);
- avfilter_inout_free(&outputs);
+ for (cur = outputs, i = 0; cur; cur = cur->next, i++)
+ configure_output_filter(fg, fg->outputs[i], cur);
+ avfilter_inout_free(&outputs);
- if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
- return ret;
- } else {
- /* wait until output mappings are processed */
- for (cur = outputs; cur;) {
- GROW_ARRAY(fg->outputs, fg->nb_outputs);
- if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
- exit_program(1);
- fg->outputs[fg->nb_outputs - 1]->graph = fg;
- fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
- cur = cur->next;
- fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
- }
- }
+ if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
+ return ret;
fg->reconfiguration = 1;
@@ -991,7 +1048,7 @@ int configure_filtergraph(FilterGraph *fg)
OutputStream *ost = fg->outputs[i]->ost;
if (ost &&
ost->enc->type == AVMEDIA_TYPE_AUDIO &&
- !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
+ !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
av_buffersink_set_frame_size(ost->filter->filter,
ost->enc_ctx->frame_size);
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_generated.gni b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
index 48dac99334c..6f30b9198d3 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_generated.gni
+++ b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
@@ -12,130 +12,133 @@ ffmpeg_c_sources = []
ffmpeg_gas_sources = []
ffmpeg_yasm_sources = []
-ffmpeg_c_sources += [
- "libavcodec/allcodecs.c",
- "libavcodec/autorename_libavcodec_utils.c",
- "libavcodec/avdct.c",
- "libavcodec/avfft.c",
- "libavcodec/avpacket.c",
- "libavcodec/avpicture.c",
- "libavcodec/bitstream.c",
- "libavcodec/bitstream_filter.c",
- "libavcodec/codec_desc.c",
- "libavcodec/dirac.c",
- "libavcodec/dv_profile.c",
- "libavcodec/fft_fixed.c",
- "libavcodec/fft_fixed_32.c",
- "libavcodec/fft_float.c",
- "libavcodec/fft_init_table.c",
- "libavcodec/golomb.c",
- "libavcodec/imgconvert.c",
- "libavcodec/mathtables.c",
- "libavcodec/mdct_fixed.c",
- "libavcodec/mdct_fixed_32.c",
- "libavcodec/mdct_float.c",
- "libavcodec/mpeg12data.c",
- "libavcodec/mpeg4audio.c",
- "libavcodec/mpegaudiodata.c",
- "libavcodec/options.c",
- "libavcodec/opus.c",
- "libavcodec/opus_parser.c",
- "libavcodec/parser.c",
- "libavcodec/pcm.c",
- "libavcodec/pthread.c",
- "libavcodec/pthread_frame.c",
- "libavcodec/pthread_slice.c",
- "libavcodec/qsv_api.c",
- "libavcodec/raw.c",
- "libavcodec/rdft.c",
- "libavcodec/vorbis.c",
- "libavcodec/vorbis_data.c",
- "libavcodec/vorbis_parser.c",
- "libavcodec/vorbisdec.c",
- "libavcodec/vorbisdsp.c",
- "libavcodec/xiph.c",
- "libavformat/allformats.c",
- "libavformat/autorename_libavformat_options.c",
- "libavformat/autorename_libavformat_pcm.c",
- "libavformat/autorename_libavformat_utils.c",
- "libavformat/avio.c",
- "libavformat/aviobuf.c",
- "libavformat/cutils.c",
- "libavformat/dump.c",
- "libavformat/flac_picture.c",
- "libavformat/format.c",
- "libavformat/id3v1.c",
- "libavformat/id3v2.c",
- "libavformat/isom.c",
- "libavformat/matroska.c",
- "libavformat/matroskadec.c",
- "libavformat/metadata.c",
- "libavformat/mux.c",
- "libavformat/oggdec.c",
- "libavformat/oggparsecelt.c",
- "libavformat/oggparsedirac.c",
- "libavformat/oggparseflac.c",
- "libavformat/oggparseogm.c",
- "libavformat/oggparseopus.c",
- "libavformat/oggparseskeleton.c",
- "libavformat/oggparsespeex.c",
- "libavformat/oggparsetheora.c",
- "libavformat/oggparsevorbis.c",
- "libavformat/oggparsevp8.c",
- "libavformat/os_support.c",
- "libavformat/replaygain.c",
- "libavformat/riff.c",
- "libavformat/riffdec.c",
- "libavformat/rmsipr.c",
- "libavformat/url.c",
- "libavformat/vorbiscomment.c",
- "libavformat/wavdec.c",
- "libavutil/atomic.c",
- "libavutil/autorename_libavutil_cpu.c",
- "libavutil/avstring.c",
- "libavutil/base64.c",
- "libavutil/bprint.c",
- "libavutil/buffer.c",
- "libavutil/camellia.c",
- "libavutil/channel_layout.c",
- "libavutil/color_utils.c",
- "libavutil/crc.c",
- "libavutil/dict.c",
- "libavutil/display.c",
- "libavutil/downmix_info.c",
- "libavutil/error.c",
- "libavutil/eval.c",
- "libavutil/fifo.c",
- "libavutil/file_open.c",
- "libavutil/fixed_dsp.c",
- "libavutil/float_dsp.c",
- "libavutil/frame.c",
- "libavutil/imgutils.c",
- "libavutil/intmath.c",
- "libavutil/lfg.c",
- "libavutil/log.c",
- "libavutil/log2_tab.c",
- "libavutil/mathematics.c",
- "libavutil/md5.c",
- "libavutil/mem.c",
- "libavutil/opt.c",
- "libavutil/parseutils.c",
- "libavutil/pixdesc.c",
- "libavutil/pixelutils.c",
- "libavutil/random_seed.c",
- "libavutil/rational.c",
- "libavutil/samplefmt.c",
- "libavutil/sha.c",
- "libavutil/softfloat.c",
- "libavutil/stereo3d.c",
- "libavutil/threadmessage.c",
- "libavutil/time.c",
- "libavutil/timecode.c",
- "libavutil/twofish.c",
- "libavutil/utils.c",
-]
-
-if ((is_linux) || (is_mac) || (is_win)) {
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
+ ffmpeg_c_sources += [
+ "libavcodec/allcodecs.c",
+ "libavcodec/autorename_libavcodec_utils.c",
+ "libavcodec/avdct.c",
+ "libavcodec/avfft.c",
+ "libavcodec/avpacket.c",
+ "libavcodec/avpicture.c",
+ "libavcodec/bitstream.c",
+ "libavcodec/bitstream_filter.c",
+ "libavcodec/codec_desc.c",
+ "libavcodec/dirac.c",
+ "libavcodec/dv_profile.c",
+ "libavcodec/fft_fixed.c",
+ "libavcodec/fft_fixed_32.c",
+ "libavcodec/fft_float.c",
+ "libavcodec/fft_init_table.c",
+ "libavcodec/golomb.c",
+ "libavcodec/imgconvert.c",
+ "libavcodec/mathtables.c",
+ "libavcodec/mdct_fixed.c",
+ "libavcodec/mdct_fixed_32.c",
+ "libavcodec/mdct_float.c",
+ "libavcodec/mpeg12data.c",
+ "libavcodec/mpeg4audio.c",
+ "libavcodec/mpegaudiodata.c",
+ "libavcodec/options.c",
+ "libavcodec/opus.c",
+ "libavcodec/opus_parser.c",
+ "libavcodec/parser.c",
+ "libavcodec/pcm.c",
+ "libavcodec/pthread.c",
+ "libavcodec/pthread_frame.c",
+ "libavcodec/pthread_slice.c",
+ "libavcodec/qsv_api.c",
+ "libavcodec/raw.c",
+ "libavcodec/rdft.c",
+ "libavcodec/vorbis.c",
+ "libavcodec/vorbis_data.c",
+ "libavcodec/vorbis_parser.c",
+ "libavcodec/vorbisdec.c",
+ "libavcodec/vorbisdsp.c",
+ "libavcodec/xiph.c",
+ "libavformat/allformats.c",
+ "libavformat/autorename_libavformat_options.c",
+ "libavformat/autorename_libavformat_pcm.c",
+ "libavformat/autorename_libavformat_utils.c",
+ "libavformat/avio.c",
+ "libavformat/aviobuf.c",
+ "libavformat/cutils.c",
+ "libavformat/dump.c",
+ "libavformat/flac_picture.c",
+ "libavformat/format.c",
+ "libavformat/id3v1.c",
+ "libavformat/id3v2.c",
+ "libavformat/isom.c",
+ "libavformat/matroska.c",
+ "libavformat/matroskadec.c",
+ "libavformat/metadata.c",
+ "libavformat/mux.c",
+ "libavformat/oggdec.c",
+ "libavformat/oggparsecelt.c",
+ "libavformat/oggparsedirac.c",
+ "libavformat/oggparseflac.c",
+ "libavformat/oggparseogm.c",
+ "libavformat/oggparseopus.c",
+ "libavformat/oggparseskeleton.c",
+ "libavformat/oggparsespeex.c",
+ "libavformat/oggparsetheora.c",
+ "libavformat/oggparsevorbis.c",
+ "libavformat/oggparsevp8.c",
+ "libavformat/os_support.c",
+ "libavformat/replaygain.c",
+ "libavformat/riff.c",
+ "libavformat/riffdec.c",
+ "libavformat/rmsipr.c",
+ "libavformat/url.c",
+ "libavformat/vorbiscomment.c",
+ "libavformat/wavdec.c",
+ "libavutil/aes.c",
+ "libavutil/autorename_libavutil_cpu.c",
+ "libavutil/avstring.c",
+ "libavutil/base64.c",
+ "libavutil/bprint.c",
+ "libavutil/buffer.c",
+ "libavutil/camellia.c",
+ "libavutil/channel_layout.c",
+ "libavutil/color_utils.c",
+ "libavutil/crc.c",
+ "libavutil/dict.c",
+ "libavutil/display.c",
+ "libavutil/downmix_info.c",
+ "libavutil/error.c",
+ "libavutil/eval.c",
+ "libavutil/fifo.c",
+ "libavutil/file_open.c",
+ "libavutil/fixed_dsp.c",
+ "libavutil/float_dsp.c",
+ "libavutil/frame.c",
+ "libavutil/imgutils.c",
+ "libavutil/intmath.c",
+ "libavutil/lfg.c",
+ "libavutil/log.c",
+ "libavutil/log2_tab.c",
+ "libavutil/mathematics.c",
+ "libavutil/md5.c",
+ "libavutil/mem.c",
+ "libavutil/opt.c",
+ "libavutil/parseutils.c",
+ "libavutil/pixdesc.c",
+ "libavutil/pixelutils.c",
+ "libavutil/random_seed.c",
+ "libavutil/rational.c",
+ "libavutil/reverse.c",
+ "libavutil/samplefmt.c",
+ "libavutil/sha.c",
+ "libavutil/stereo3d.c",
+ "libavutil/tea.c",
+ "libavutil/threadmessage.c",
+ "libavutil/time.c",
+ "libavutil/timecode.c",
+ "libavutil/twofish.c",
+ "libavutil/utils.c",
+ ]
+}
+
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
ffmpeg_c_sources += [
"libavcodec/h264pred.c",
"libavcodec/hpeldsp.c",
@@ -150,19 +153,19 @@ if ((is_linux) || (is_mac) || (is_win)) {
]
}
-if ((ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding == "ChromeOS") || (is_linux && ffmpeg_branding == "ChromiumOS")) {
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome")) {
ffmpeg_c_sources += [
"libavformat/rawdec.c",
]
}
-if ((ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding == "ChromeOS")) {
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome")) {
ffmpeg_c_sources += [
"libavcodec/aac_ac3_parser.c",
"libavcodec/aac_parser.c",
"libavcodec/aacadtsdec.c",
- "libavcodec/aacps.c",
- "libavcodec/aacpsdsp.c",
+ "libavcodec/aacps_float.c",
+ "libavcodec/aacpsdsp_float.c",
"libavcodec/aacsbr.c",
"libavcodec/aactab.c",
"libavcodec/ac3tab.c",
@@ -182,6 +185,7 @@ if ((ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding == "ChromeOS")
"libavcodec/mpegaudiodsp_float.c",
"libavcodec/sbrdsp.c",
"libavcodec/sinewin.c",
+ "libavcodec/sinewin_fixed.c",
"libavformat/aacdec.c",
"libavformat/apetag.c",
"libavformat/img2.c",
@@ -191,7 +195,25 @@ if ((ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding == "ChromeOS")
]
}
-if ((is_linux && ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding == "ChromeOS") || (is_mac && ffmpeg_branding == "Chrome") || (is_win && ffmpeg_branding == "Chrome")) {
+if ((is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c",
+ "libavcodec/x86/constants.c",
+ "libavcodec/x86/fft_init.c",
+ "libavutil/x86/autorename_libavutil_x86_cpu.c",
+ "libavutil/x86/autorename_libavutil_x86_float_dsp_init.c",
+ "libavutil/x86/lls_init.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/fft.asm",
+ "libavcodec/x86/vorbisdsp.asm",
+ "libavutil/x86/cpuid.asm",
+ "libavutil/x86/float_dsp.asm",
+ "libavutil/x86/lls.asm",
+ ]
+}
+
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome")) {
ffmpeg_c_sources += [
"libavcodec/cabac.c",
"libavcodec/h264.c",
@@ -214,7 +236,13 @@ if ((is_linux && ffmpeg_branding == "Chrome") || (is_linux && ffmpeg_branding ==
]
}
-if ((is_android && current_cpu == "arm") || (is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_cpu == "arm")) {
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
+ ffmpeg_c_sources += [
+ "compat/strtod.c",
+ ]
+}
+
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/arm/fft_fixed_init_arm.c",
"libavcodec/arm/fft_init_arm.c",
@@ -230,7 +258,7 @@ if ((is_android && current_cpu == "arm") || (is_linux && current_cpu == "arm" &&
]
}
-if ((is_linux && ffmpeg_branding == "ChromeOS") || (is_linux && ffmpeg_branding == "ChromiumOS")) {
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/flac.c",
"libavcodec/flac_parser.c",
@@ -241,7 +269,7 @@ if ((is_linux && ffmpeg_branding == "ChromeOS") || (is_linux && ffmpeg_branding
]
}
-if ((is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_cpu == "arm")) {
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/arm/h264pred_init_arm.c",
"libavcodec/arm/hpeldsp_init_arm.c",
@@ -261,39 +289,42 @@ if ((is_linux && current_cpu == "arm" && arm_use_neon) || (is_linux && current_c
]
}
-if ((is_linux && current_cpu == "x64") || (is_linux && current_cpu == "x86") || (is_mac) || (is_win)) {
+if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromiumOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
ffmpeg_c_sources += [
"libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c",
- "libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c",
- "libavcodec/x86/constants.c",
- "libavcodec/x86/fft_init.c",
"libavcodec/x86/h264_intrapred_init.c",
"libavcodec/x86/hpeldsp_init.c",
"libavcodec/x86/vp3dsp_init.c",
"libavcodec/x86/vp8dsp_init.c",
- "libavutil/x86/autorename_libavutil_x86_cpu.c",
- "libavutil/x86/autorename_libavutil_x86_float_dsp_init.c",
- "libavutil/x86/lls_init.c",
]
ffmpeg_yasm_sources += [
- "libavcodec/x86/deinterlace.asm",
- "libavcodec/x86/fft.asm",
"libavcodec/x86/fpel.asm",
"libavcodec/x86/h264_intrapred.asm",
"libavcodec/x86/h264_intrapred_10bit.asm",
"libavcodec/x86/hpeldsp.asm",
"libavcodec/x86/videodsp.asm",
- "libavcodec/x86/vorbisdsp.asm",
"libavcodec/x86/vp3dsp.asm",
"libavcodec/x86/vp8dsp.asm",
"libavcodec/x86/vp8dsp_loopfilter.asm",
- "libavutil/x86/cpuid.asm",
- "libavutil/x86/float_dsp.asm",
- "libavutil/x86/lls.asm",
]
}
-if ((is_android && current_cpu == "arm") || (is_linux && current_cpu == "arm" && arm_use_neon)) {
+if ((is_android && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome")) {
+ ffmpeg_c_sources += [
+ "libavcodec/x86/aacpsdsp_init.c",
+ "libavcodec/x86/dct_init.c",
+ "libavcodec/x86/mpegaudiodsp.c",
+ "libavcodec/x86/sbrdsp_init.c",
+ ]
+ ffmpeg_yasm_sources += [
+ "libavcodec/x86/aacpsdsp.asm",
+ "libavcodec/x86/dct32.asm",
+ "libavcodec/x86/imdct36.asm",
+ "libavcodec/x86/sbrdsp.asm",
+ ]
+}
+
+if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavutil/arm/float_dsp_init_neon.c",
]
@@ -308,12 +339,6 @@ if ((is_android && current_cpu == "arm") || (is_linux && current_cpu == "arm" &&
]
}
-if ((is_android && current_cpu == "arm") || (is_win)) {
- ffmpeg_c_sources += [
- "compat/strtod.c",
- ]
-}
-
if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) {
ffmpeg_c_sources += [
"libavcodec/arm/aacpsdsp_init_arm.c",
@@ -325,7 +350,7 @@ if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_l
]
}
-if (is_linux && ffmpeg_branding == "ChromeOS") {
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) {
ffmpeg_c_sources += [
"libavcodec/acelp_filters.c",
"libavcodec/acelp_pitch_delay.c",
@@ -380,32 +405,48 @@ if (is_linux && ffmpeg_branding == "ChromeOS") {
]
}
-if (is_linux && current_cpu == "mipsel") {
+if ((is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
- "libavcodec/mips/h264pred_init_mips.c",
"libavutil/mips/float_dsp_mips.c",
]
}
-if (is_linux && current_cpu == "arm64") {
+if ((is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromiumOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/mips/h264pred_init_mips.c",
+ "libavcodec/mips/hpeldsp_init_mips.c",
+ "libavcodec/mips/vp8dsp_init_mips.c",
+ ]
+}
+
+if ((is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/aarch64/fft_init_aarch64.c",
- "libavcodec/aarch64/hpeldsp_init_aarch64.c",
- "libavcodec/aarch64/videodsp_init.c",
"libavcodec/aarch64/vorbisdsp_init.c",
"libavutil/aarch64/cpu.c",
"libavutil/aarch64/float_dsp_init.c",
]
ffmpeg_gas_sources += [
- "libavcodec/aarch64/autorename_libavcodec_aarch64_hpeldsp_neon.S",
"libavcodec/aarch64/fft_neon.S",
"libavcodec/aarch64/mdct_neon.S",
- "libavcodec/aarch64/videodsp.S",
"libavcodec/aarch64/vorbisdsp_neon.S",
"libavutil/aarch64/float_dsp_neon.S",
]
}
+if ((is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromiumOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/aarch64/h264pred_init.c",
+ "libavcodec/aarch64/hpeldsp_init_aarch64.c",
+ "libavcodec/aarch64/videodsp_init.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S",
+ "libavcodec/aarch64/autorename_libavcodec_aarch64_hpeldsp_neon.S",
+ "libavcodec/aarch64/videodsp.S",
+ ]
+}
+
if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/arm/flacdsp_init_arm.c",
@@ -426,7 +467,7 @@ if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chr
]
}
-if (is_linux && current_cpu == "arm" && arm_use_neon) {
+if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chromium") || (is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromiumOS")) {
ffmpeg_c_sources += [
"libavcodec/arm/hpeldsp_init_neon.c",
"libavcodec/arm/vp8dsp_init_neon.c",
@@ -439,17 +480,13 @@ if (is_linux && current_cpu == "arm" && arm_use_neon) {
]
}
-if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_mac && ffmpeg_branding == "Chrome") || (is_win && ffmpeg_branding == "Chrome")) {
+if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "x86" && ffmpeg_branding == "ChromeOS") || (is_mac && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome")) {
ffmpeg_c_sources += [
- "libavcodec/x86/dct_init.c",
"libavcodec/x86/h264_qpel.c",
"libavcodec/x86/h264chroma_init.c",
"libavcodec/x86/h264dsp_init.c",
- "libavcodec/x86/mpegaudiodsp.c",
- "libavcodec/x86/sbrdsp_init.c",
]
ffmpeg_yasm_sources += [
- "libavcodec/x86/dct32.asm",
"libavcodec/x86/h264_chromamc.asm",
"libavcodec/x86/h264_chromamc_10bit.asm",
"libavcodec/x86/h264_deblock.asm",
@@ -460,9 +497,7 @@ if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_lin
"libavcodec/x86/h264_qpel_8bit.asm",
"libavcodec/x86/h264_weight.asm",
"libavcodec/x86/h264_weight_10bit.asm",
- "libavcodec/x86/imdct36.asm",
"libavcodec/x86/qpel.asm",
- "libavcodec/x86/sbrdsp.asm",
]
}
@@ -475,7 +510,7 @@ if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_l
]
}
-if (is_win) {
+if ((is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chromium")) {
ffmpeg_c_sources += [
"compat/msvcrt/snprintf.c",
]
@@ -488,15 +523,31 @@ if ((is_android && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (is_l
]
}
-if ((is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS")) {
+if ((is_android && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS")) {
ffmpeg_c_sources += [
"libavcodec/mips/aacdec_mips.c",
"libavcodec/mips/aacpsdsp_mips.c",
"libavcodec/mips/aacsbr_mips.c",
+ "libavcodec/mips/sbrdsp_mips.c",
+ ]
+}
+
+if ((is_linux && current_cpu == "mipsel" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
"libavcodec/mips/h264chroma_init_mips.c",
"libavcodec/mips/h264dsp_init_mips.c",
"libavcodec/mips/h264qpel_init_mips.c",
- "libavcodec/mips/sbrdsp_mips.c",
+ ]
+}
+
+if ((is_android && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_linux && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS")) {
+ ffmpeg_c_sources += [
+ "libavcodec/aarch64/imdct15_init.c",
+ "libavcodec/aarch64/mpegaudiodsp_init.c",
+ ]
+ ffmpeg_gas_sources += [
+ "libavcodec/aarch64/imdct15_neon.S",
+ "libavcodec/aarch64/mpegaudiodsp_neon.S",
]
}
@@ -505,16 +556,12 @@ if ((is_linux && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_l
"libavcodec/aarch64/h264chroma_init_aarch64.c",
"libavcodec/aarch64/h264dsp_init_aarch64.c",
"libavcodec/aarch64/h264qpel_init_aarch64.c",
- "libavcodec/aarch64/imdct15_init.c",
- "libavcodec/aarch64/mpegaudiodsp_init.c",
]
ffmpeg_gas_sources += [
"libavcodec/aarch64/autorename_libavcodec_aarch64_h264cmc_neon.S",
"libavcodec/aarch64/autorename_libavcodec_aarch64_h264dsp_neon.S",
"libavcodec/aarch64/autorename_libavcodec_aarch64_h264idct_neon.S",
"libavcodec/aarch64/autorename_libavcodec_aarch64_h264qpel_neon.S",
- "libavcodec/aarch64/imdct15_neon.S",
- "libavcodec/aarch64/mpegaudiodsp_neon.S",
]
}
@@ -557,7 +604,7 @@ if ((is_linux && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chr
]
}
-if (is_win && current_cpu == "x64") {
+if ((is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chromium")) {
ffmpeg_yasm_sources += [
"libavutil/x86/emms.asm",
]
@@ -591,7 +638,14 @@ if ((is_linux && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (is_l
if (is_linux && current_cpu == "mipsel" && ffmpeg_branding == "ChromeOS") {
ffmpeg_c_sources += [
+ "libavcodec/mips/blockdsp_init_mips.c",
"libavcodec/mips/h263dsp_init_mips.c",
+ "libavcodec/mips/idctdsp_init_mips.c",
+ "libavcodec/mips/me_cmp_init_mips.c",
+ "libavcodec/mips/mpegvideo_init_mips.c",
+ "libavcodec/mips/pixblockdsp_init_mips.c",
+ "libavcodec/mips/qpeldsp_init_mips.c",
+ "libavcodec/mips/xvididct_init_mips.c",
]
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_generated.gypi b/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
index f835857b095..4c7b1b94b38 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
+++ b/chromium/third_party/ffmpeg/ffmpeg_generated.gypi
@@ -22,7 +22,14 @@
}], # OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS"
['OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS"', {
'c_sources': [
+ 'libavcodec/mips/blockdsp_init_mips.c',
'libavcodec/mips/h263dsp_init_mips.c',
+ 'libavcodec/mips/idctdsp_init_mips.c',
+ 'libavcodec/mips/me_cmp_init_mips.c',
+ 'libavcodec/mips/mpegvideo_init_mips.c',
+ 'libavcodec/mips/pixblockdsp_init_mips.c',
+ 'libavcodec/mips/qpeldsp_init_mips.c',
+ 'libavcodec/mips/xvididct_init_mips.c',
],
}], # OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS"
['(OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS")', {
@@ -50,11 +57,11 @@
'libavcodec/x86/xvididct.asm',
],
}], # (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS")
- ['OS == "win" and target_arch == "x64"', {
+ ['(OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
'asm_sources': [
'libavutil/x86/emms.asm',
],
- }], # OS == "win" and target_arch == "x64"
+ }], # (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS")', {
'asm_sources': [
'libavcodec/arm/h264cmc_neon.S',
@@ -96,40 +103,50 @@
'libavcodec/aarch64/h264chroma_init_aarch64.c',
'libavcodec/aarch64/h264dsp_init_aarch64.c',
'libavcodec/aarch64/h264qpel_init_aarch64.c',
- 'libavcodec/aarch64/imdct15_init.c',
- 'libavcodec/aarch64/mpegaudiodsp_init.c',
],
'asm_sources': [
'libavcodec/aarch64/autorename_libavcodec_aarch64_h264cmc_neon.S',
'libavcodec/aarch64/autorename_libavcodec_aarch64_h264dsp_neon.S',
'libavcodec/aarch64/autorename_libavcodec_aarch64_h264idct_neon.S',
'libavcodec/aarch64/autorename_libavcodec_aarch64_h264qpel_neon.S',
+ ],
+ }], # (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS")
+ ['(OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS")', {
+ 'c_sources': [
+ 'libavcodec/aarch64/imdct15_init.c',
+ 'libavcodec/aarch64/mpegaudiodsp_init.c',
+ ],
+ 'asm_sources': [
'libavcodec/aarch64/imdct15_neon.S',
'libavcodec/aarch64/mpegaudiodsp_neon.S',
],
- }], # (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS")
+ }], # (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS")
['(OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS")', {
'c_sources': [
- 'libavcodec/mips/aacdec_mips.c',
- 'libavcodec/mips/aacpsdsp_mips.c',
- 'libavcodec/mips/aacsbr_mips.c',
'libavcodec/mips/h264chroma_init_mips.c',
'libavcodec/mips/h264dsp_init_mips.c',
'libavcodec/mips/h264qpel_init_mips.c',
- 'libavcodec/mips/sbrdsp_mips.c',
],
}], # (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS")
+ ['(OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS")', {
+ 'c_sources': [
+ 'libavcodec/mips/aacdec_mips.c',
+ 'libavcodec/mips/aacpsdsp_mips.c',
+ 'libavcodec/mips/aacsbr_mips.c',
+ 'libavcodec/mips/sbrdsp_mips.c',
+ ],
+ }], # (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS")
['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS")', {
'asm_sources': [
'libavcodec/arm/aacpsdsp_neon.S',
'libavcodec/arm/sbrdsp_neon.S',
],
}], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS")
- ['OS == "win"', {
+ ['(OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
'c_sources': [
'compat/msvcrt/snprintf.c',
],
- }], # OS == "win"
+ }], # (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
['(OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/x86/flacdsp_init.c',
@@ -138,17 +155,13 @@
'libavcodec/x86/flacdsp.asm',
],
}], # (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS")
- ['(OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and ffmpeg_branding == "Chrome") or (OS == "win" and ffmpeg_branding == "Chrome")', {
+ ['(OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")', {
'c_sources': [
- 'libavcodec/x86/dct_init.c',
'libavcodec/x86/h264_qpel.c',
'libavcodec/x86/h264chroma_init.c',
'libavcodec/x86/h264dsp_init.c',
- 'libavcodec/x86/mpegaudiodsp.c',
- 'libavcodec/x86/sbrdsp_init.c',
],
'asm_sources': [
- 'libavcodec/x86/dct32.asm',
'libavcodec/x86/h264_chromamc.asm',
'libavcodec/x86/h264_chromamc_10bit.asm',
'libavcodec/x86/h264_deblock.asm',
@@ -159,12 +172,10 @@
'libavcodec/x86/h264_qpel_8bit.asm',
'libavcodec/x86/h264_weight.asm',
'libavcodec/x86/h264_weight_10bit.asm',
- 'libavcodec/x86/imdct36.asm',
'libavcodec/x86/qpel.asm',
- 'libavcodec/x86/sbrdsp.asm',
],
- }], # (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and ffmpeg_branding == "Chrome") or (OS == "win" and ffmpeg_branding == "Chrome")
- ['OS == "linux" and target_arch == "arm" and arm_neon == 1', {
+ }], # (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/arm/hpeldsp_init_neon.c',
'libavcodec/arm/vp8dsp_init_neon.c',
@@ -175,7 +186,7 @@
'libavcodec/arm/vp3dsp_neon.S',
'libavcodec/arm/vp8dsp_neon.S',
],
- }], # OS == "linux" and target_arch == "arm" and arm_neon == 1
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS")
['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS")', {
'c_sources': [
'libavcodec/arm/h264chroma_init_arm.c',
@@ -194,31 +205,45 @@
'libavcodec/arm/flacdsp_arm.S',
],
}], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS")
- ['OS == "linux" and target_arch == "arm64"', {
+ ['(OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
- 'libavcodec/aarch64/fft_init_aarch64.c',
+ 'libavcodec/aarch64/h264pred_init.c',
'libavcodec/aarch64/hpeldsp_init_aarch64.c',
'libavcodec/aarch64/videodsp_init.c',
+ ],
+ 'asm_sources': [
+ 'libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S',
+ 'libavcodec/aarch64/autorename_libavcodec_aarch64_hpeldsp_neon.S',
+ 'libavcodec/aarch64/videodsp.S',
+ ],
+ }], # (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS")', {
+ 'c_sources': [
+ 'libavcodec/aarch64/fft_init_aarch64.c',
'libavcodec/aarch64/vorbisdsp_init.c',
'libavutil/aarch64/cpu.c',
'libavutil/aarch64/float_dsp_init.c',
],
'asm_sources': [
- 'libavcodec/aarch64/autorename_libavcodec_aarch64_hpeldsp_neon.S',
'libavcodec/aarch64/fft_neon.S',
'libavcodec/aarch64/mdct_neon.S',
- 'libavcodec/aarch64/videodsp.S',
'libavcodec/aarch64/vorbisdsp_neon.S',
'libavutil/aarch64/float_dsp_neon.S',
],
- }], # OS == "linux" and target_arch == "arm64"
- ['OS == "linux" and target_arch == "mipsel"', {
+ }], # (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/mips/h264pred_init_mips.c',
+ 'libavcodec/mips/hpeldsp_init_mips.c',
+ 'libavcodec/mips/vp8dsp_init_mips.c',
+ ],
+ }], # (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS")', {
+ 'c_sources': [
'libavutil/mips/float_dsp_mips.c',
],
- }], # OS == "linux" and target_arch == "mipsel"
- ['OS == "linux" and ffmpeg_branding == "ChromeOS"', {
+ }], # (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS")', {
'c_sources': [
'libavcodec/acelp_filters.c',
'libavcodec/acelp_pitch_delay.c',
@@ -271,7 +296,7 @@
'libavformat/avidec.c',
'libavformat/gsmdec.c',
],
- }], # OS == "linux" and ffmpeg_branding == "ChromeOS"
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS")
['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS")', {
'c_sources': [
'libavcodec/arm/aacpsdsp_init_arm.c',
@@ -282,12 +307,7 @@
'libavcodec/arm/mpegaudiodsp_fixed_armv6.S',
],
}], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS")
- ['(OS == "android" and target_arch == "arm") or (OS == "win")', {
- 'c_sources': [
- 'compat/strtod.c',
- ],
- }], # (OS == "android" and target_arch == "arm") or (OS == "win")
- ['(OS == "android" and target_arch == "arm") or (OS == "linux" and target_arch == "arm" and arm_neon == 1)', {
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavutil/arm/float_dsp_init_neon.c',
],
@@ -300,39 +320,41 @@
'libavcodec/arm/rdft_neon.S',
'libavutil/arm/autorename_libavutil_arm_float_dsp_neon.S',
],
- }], # (OS == "android" and target_arch == "arm") or (OS == "linux" and target_arch == "arm" and arm_neon == 1)
- ['(OS == "linux" and target_arch == "ia32") or (OS == "linux" and target_arch == "x64") or (OS == "mac") or (OS == "win")', {
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")', {
+ 'c_sources': [
+ 'libavcodec/x86/aacpsdsp_init.c',
+ 'libavcodec/x86/dct_init.c',
+ 'libavcodec/x86/mpegaudiodsp.c',
+ 'libavcodec/x86/sbrdsp_init.c',
+ ],
+ 'asm_sources': [
+ 'libavcodec/x86/aacpsdsp.asm',
+ 'libavcodec/x86/dct32.asm',
+ 'libavcodec/x86/imdct36.asm',
+ 'libavcodec/x86/sbrdsp.asm',
+ ],
+ }], # (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")
+ ['(OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
'c_sources': [
'libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c',
- 'libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c',
- 'libavcodec/x86/constants.c',
- 'libavcodec/x86/fft_init.c',
'libavcodec/x86/h264_intrapred_init.c',
'libavcodec/x86/hpeldsp_init.c',
'libavcodec/x86/vp3dsp_init.c',
'libavcodec/x86/vp8dsp_init.c',
- 'libavutil/x86/autorename_libavutil_x86_cpu.c',
- 'libavutil/x86/autorename_libavutil_x86_float_dsp_init.c',
- 'libavutil/x86/lls_init.c',
],
'asm_sources': [
- 'libavcodec/x86/deinterlace.asm',
- 'libavcodec/x86/fft.asm',
'libavcodec/x86/fpel.asm',
'libavcodec/x86/h264_intrapred.asm',
'libavcodec/x86/h264_intrapred_10bit.asm',
'libavcodec/x86/hpeldsp.asm',
'libavcodec/x86/videodsp.asm',
- 'libavcodec/x86/vorbisdsp.asm',
'libavcodec/x86/vp3dsp.asm',
'libavcodec/x86/vp8dsp.asm',
'libavcodec/x86/vp8dsp_loopfilter.asm',
- 'libavutil/x86/cpuid.asm',
- 'libavutil/x86/float_dsp.asm',
- 'libavutil/x86/lls.asm',
],
- }], # (OS == "linux" and target_arch == "ia32") or (OS == "linux" and target_arch == "x64") or (OS == "mac") or (OS == "win")
- ['(OS == "linux" and target_arch == "arm" and arm_neon == 1) or (OS == "linux" and target_arch == "arm")', {
+ }], # (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/arm/h264pred_init_arm.c',
'libavcodec/arm/hpeldsp_init_arm.c',
@@ -350,8 +372,8 @@
'libavcodec/arm/vp8_armv6.S',
'libavcodec/arm/vp8dsp_armv6.S',
],
- }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1) or (OS == "linux" and target_arch == "arm")
- ['(OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and ffmpeg_branding == "ChromiumOS")', {
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/flac.c',
'libavcodec/flac_parser.c',
@@ -360,8 +382,8 @@
'libavcodec/flacdsp.c',
'libavformat/autorename_libavformat_flacdec.c',
],
- }], # (OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and ffmpeg_branding == "ChromiumOS")
- ['(OS == "android" and target_arch == "arm") or (OS == "linux" and target_arch == "arm" and arm_neon == 1) or (OS == "linux" and target_arch == "arm")', {
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS")', {
'c_sources': [
'libavcodec/arm/fft_fixed_init_arm.c',
'libavcodec/arm/fft_init_arm.c',
@@ -375,8 +397,13 @@
'libavcodec/arm/mdct_vfp.S',
'libavutil/arm/float_dsp_vfp.S',
],
- }], # (OS == "android" and target_arch == "arm") or (OS == "linux" and target_arch == "arm" and arm_neon == 1) or (OS == "linux" and target_arch == "arm")
- ['(OS == "linux" and ffmpeg_branding == "Chrome") or (OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and ffmpeg_branding == "Chrome") or (OS == "win" and ffmpeg_branding == "Chrome")', {
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS")
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
+ 'c_sources': [
+ 'compat/strtod.c',
+ ],
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")', {
'c_sources': [
'libavcodec/cabac.c',
'libavcodec/h264.c',
@@ -397,14 +424,31 @@
'libavcodec/h264qpel.c',
'libavcodec/startcode.c',
],
- }], # (OS == "linux" and ffmpeg_branding == "Chrome") or (OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and ffmpeg_branding == "Chrome") or (OS == "win" and ffmpeg_branding == "Chrome")
- ['(OS == "linux" and ffmpeg_branding == "ChromeOS") or (ffmpeg_branding == "Chrome")', {
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")
+ ['(OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
+ 'c_sources': [
+ 'libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c',
+ 'libavcodec/x86/constants.c',
+ 'libavcodec/x86/fft_init.c',
+ 'libavutil/x86/autorename_libavutil_x86_cpu.c',
+ 'libavutil/x86/autorename_libavutil_x86_float_dsp_init.c',
+ 'libavutil/x86/lls_init.c',
+ ],
+ 'asm_sources': [
+ 'libavcodec/x86/fft.asm',
+ 'libavcodec/x86/vorbisdsp.asm',
+ 'libavutil/x86/cpuid.asm',
+ 'libavutil/x86/float_dsp.asm',
+ 'libavutil/x86/lls.asm',
+ ],
+ }], # (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")', {
'c_sources': [
'libavcodec/aac_ac3_parser.c',
'libavcodec/aac_parser.c',
'libavcodec/aacadtsdec.c',
- 'libavcodec/aacps.c',
- 'libavcodec/aacpsdsp.c',
+ 'libavcodec/aacps_float.c',
+ 'libavcodec/aacpsdsp_float.c',
'libavcodec/aacsbr.c',
'libavcodec/aactab.c',
'libavcodec/ac3tab.c',
@@ -424,6 +468,7 @@
'libavcodec/mpegaudiodsp_float.c',
'libavcodec/sbrdsp.c',
'libavcodec/sinewin.c',
+ 'libavcodec/sinewin_fixed.c',
'libavformat/aacdec.c',
'libavformat/apetag.c',
'libavformat/img2.c',
@@ -431,13 +476,13 @@
'libavformat/mov_chan.c',
'libavformat/mp3dec.c',
],
- }], # (OS == "linux" and ffmpeg_branding == "ChromeOS") or (ffmpeg_branding == "Chrome")
- ['(OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and ffmpeg_branding == "ChromiumOS") or (ffmpeg_branding == "Chrome")', {
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")', {
'c_sources': [
'libavformat/rawdec.c',
],
- }], # (OS == "linux" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and ffmpeg_branding == "ChromiumOS") or (ffmpeg_branding == "Chrome")
- ['(OS == "linux") or (OS == "mac") or (OS == "win")', {
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome")
+ ['(OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
'c_sources': [
'libavcodec/h264pred.c',
'libavcodec/hpeldsp.c',
@@ -450,8 +495,8 @@
'libavcodec/vp8_parser.c',
'libavcodec/vp8dsp.c',
],
- }], # (OS == "linux") or (OS == "mac") or (OS == "win")
- ['(1)', {
+ }], # (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
+ ['(OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")', {
'c_sources': [
'libavcodec/allcodecs.c',
'libavcodec/autorename_libavcodec_utils.c',
@@ -530,7 +575,7 @@
'libavformat/url.c',
'libavformat/vorbiscomment.c',
'libavformat/wavdec.c',
- 'libavutil/atomic.c',
+ 'libavutil/aes.c',
'libavutil/autorename_libavutil_cpu.c',
'libavutil/avstring.c',
'libavutil/base64.c',
@@ -564,17 +609,18 @@
'libavutil/pixelutils.c',
'libavutil/random_seed.c',
'libavutil/rational.c',
+ 'libavutil/reverse.c',
'libavutil/samplefmt.c',
'libavutil/sha.c',
- 'libavutil/softfloat.c',
'libavutil/stereo3d.c',
+ 'libavutil/tea.c',
'libavutil/threadmessage.c',
'libavutil/time.c',
'libavutil/timecode.c',
'libavutil/twofish.c',
'libavutil/utils.c',
],
- }], # (1)
+ }], # (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "android" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and arm_neon == 1 and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "arm64" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "ia32" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "mipsel" and ffmpeg_branding == "ChromiumOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromeOS") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "linux" and target_arch == "x64" and ffmpeg_branding == "ChromiumOS") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "mac" and target_arch == "x64" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "ia32" and ffmpeg_branding == "Chromium") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chrome") or (OS == "win" and target_arch == "x64" and ffmpeg_branding == "Chromium")
], # conditions
},
}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_opt.c b/chromium/third_party/ffmpeg/ffmpeg_opt.c
index 69222dea7e8..55818e1b734 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_opt.c
+++ b/chromium/third_party/ffmpeg/ffmpeg_opt.c
@@ -40,6 +40,9 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
+#include "libavutil/time_internal.h"
+
+#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
{\
@@ -71,7 +74,10 @@ const HWAccel hwaccels[] = {
{ "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD },
#endif
#if CONFIG_VDA
- { "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
+ { "vda", videotoolbox_init, HWACCEL_VDA, AV_PIX_FMT_VDA },
+#endif
+#if CONFIG_VIDEOTOOLBOX
+ { "videotoolbox", videotoolbox_init, HWACCEL_VIDEOTOOLBOX, AV_PIX_FMT_VIDEOTOOLBOX },
#endif
{ 0 },
};
@@ -153,12 +159,25 @@ static void init_options(OptionsContext *o)
o->stop_time = INT64_MAX;
o->mux_max_delay = 0.7;
o->start_time = AV_NOPTS_VALUE;
+ o->start_time_eof = AV_NOPTS_VALUE;
o->recording_time = INT64_MAX;
o->limit_filesize = UINT64_MAX;
o->chapters_input_file = INT_MAX;
o->accurate_seek = 1;
}
+static int show_hwaccels(void *optctx, const char *opt, const char *arg)
+{
+ int i;
+
+ printf("Hardware acceleration methods:\n");
+ for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
+ printf("%s\n", hwaccels[i].name);
+ }
+ printf("\n");
+ return 0;
+}
+
/* return a copy of the input with the stream specifiers removed from the keys */
static AVDictionary *strip_specifiers(AVDictionary *dict)
{
@@ -230,6 +249,7 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
int sync_file_idx = -1, sync_stream_idx = 0;
char *p, *sync;
char *map;
+ char *allow_unused;
if (*arg == '-') {
negative = 1;
@@ -274,6 +294,8 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
exit_program(1);
}
} else {
+ if (allow_unused = strchr(map, '?'))
+ *allow_unused = 0;
file_idx = strtol(map, &p, 0);
if (file_idx >= nb_input_files || file_idx < 0) {
av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
@@ -311,8 +333,13 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
}
if (!m) {
- av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg);
- exit_program(1);
+ if (allow_unused) {
+ av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; ignoring.\n", arg);
+ } else {
+ av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
+ "To ignore this, add a trailing '?' to the map.\n", arg);
+ exit_program(1);
+ }
}
av_freep(&map);
@@ -647,9 +674,11 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
case AVMEDIA_TYPE_VIDEO:
if(!ist->dec)
ist->dec = avcodec_find_decoder(dec->codec_id);
+#if FF_API_EMU_EDGE
if (av_codec_get_lowres(dec)) {
dec->flags |= CODEC_FLAG_EMU_EDGE;
}
+#endif
ist->resample_height = ist->dec_ctx->height;
ist->resample_width = ist->dec_ctx->width;
@@ -922,6 +951,12 @@ static int open_input_file(OptionsContext *o, const char *filename)
}
}
+ if (o->start_time_eof != AV_NOPTS_VALUE) {
+ if (ic->duration>0) {
+ o->start_time = o->start_time_eof + ic->duration;
+ } else
+ av_log(NULL, AV_LOG_WARNING, "Cannot use -sseof, duration of %s not known\n", filename);
+ }
timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time;
/* add the stream start time */
if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE)
@@ -1203,12 +1238,13 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
uint32_t tag = strtol(codec_tag, &next, 0);
if (*next)
tag = AV_RL32(codec_tag);
+ ost->st->codec->codec_tag =
ost->enc_ctx->codec_tag = tag;
}
MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
if (qscale >= 0) {
- ost->enc_ctx->flags |= CODEC_FLAG_QSCALE;
+ ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE;
ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale;
}
@@ -1216,9 +1252,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
ost->disposition = av_strdup(ost->disposition);
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
- ost->enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
- av_opt_get_int(o->g->sws_opts, "sws_flags", 0, &ost->sws_flags);
+ av_dict_copy(&ost->sws_dict, o->g->sws_dict, 0);
av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0);
if (ost->enc && av_get_exact_bits_per_sample(ost->enc->id) == 24)
@@ -1438,17 +1474,17 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
video_enc->rc_override_count = i;
if (do_psnr)
- video_enc->flags|= CODEC_FLAG_PSNR;
+ video_enc->flags|= AV_CODEC_FLAG_PSNR;
/* two pass mode */
MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
if (do_pass) {
if (do_pass & 1) {
- video_enc->flags |= CODEC_FLAG_PASS1;
+ video_enc->flags |= AV_CODEC_FLAG_PASS1;
av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND);
}
if (do_pass & 2) {
- video_enc->flags |= CODEC_FLAG_PASS2;
+ video_enc->flags |= AV_CODEC_FLAG_PASS2;
av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND);
}
}
@@ -1458,6 +1494,40 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
!(ost->logfile_prefix = av_strdup(ost->logfile_prefix)))
exit_program(1);
+ if (do_pass) {
+ char logfilename[1024];
+ FILE *f;
+
+ snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
+ ost->logfile_prefix ? ost->logfile_prefix :
+ DEFAULT_PASS_LOGFILENAME_PREFIX,
+ i);
+ if (!strcmp(ost->enc->name, "libx264")) {
+ av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
+ } else {
+ if (video_enc->flags & AV_CODEC_FLAG_PASS2) {
+ char *logbuffer = read_file(logfilename);
+
+ if (!logbuffer) {
+ av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
+ logfilename);
+ exit_program(1);
+ }
+ video_enc->stats_in = logbuffer;
+ }
+ if (video_enc->flags & AV_CODEC_FLAG_PASS1) {
+ f = av_fopen_utf8(logfilename, "wb");
+ if (!f) {
+ av_log(NULL, AV_LOG_FATAL,
+ "Cannot write log file '%s' for pass-1 encoding: %s\n",
+ logfilename, strerror(errno));
+ exit_program(1);
+ }
+ ost->logfile = f;
+ }
+ }
+ }
+
MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
if (ost->forced_keyframes)
ost->forced_keyframes = av_strdup(ost->forced_keyframes);
@@ -1736,8 +1806,7 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
{
OutputStream *ost;
- switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
- ofilter->out_tmp->pad_idx)) {
+ switch (ofilter->type) {
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
default:
@@ -1770,13 +1839,21 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
exit_program(1);
}
- if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error configuring filter.\n");
- exit_program(1);
- }
avfilter_inout_free(&ofilter->out_tmp);
}
+static int init_complex_filters(void)
+{
+ int i, ret = 0;
+
+ for (i = 0; i < nb_filtergraphs; i++) {
+ ret = init_complex_filtergraph(filtergraphs[i]);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+}
+
static int configure_complex_filters(void)
{
int i, ret = 0;
@@ -1799,10 +1876,6 @@ static int open_output_file(OptionsContext *o, const char *filename)
AVDictionary *unused_opts = NULL;
AVDictionaryEntry *e = NULL;
- if (configure_complex_filters() < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error configuring filters.\n");
- exit_program(1);
- }
if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) {
o->stop_time = INT64_MAX;
@@ -1857,8 +1930,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
if (!ofilter->out_tmp || ofilter->out_tmp->name)
continue;
- switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
- ofilter->out_tmp->pad_idx)) {
+ switch (ofilter->type) {
case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break;
case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break;
case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break;
@@ -1917,7 +1989,7 @@ 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->codec->width * ist->st->codec->height;
+ new_area = ist->st->codec->width * ist->st->codec->height + 100000000*!!ist->st->codec_info_nb_frames;
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
new_area = 1;
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
@@ -1934,12 +2006,14 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* audio: most channels */
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
- int channels = 0, idx = -1;
+ int best_score = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) {
+ int score;
ist = input_streams[i];
+ score = ist->st->codec->channels + 100000000*!!ist->st->codec_info_nb_frames;
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
- ist->st->codec->channels > channels) {
- channels = ist->st->codec->channels;
+ score > best_score) {
+ best_score = score;
idx = i;
}
}
@@ -2026,6 +2100,7 @@ loop_end:
if(o-> data_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_DATA)
continue;
+ ost = NULL;
switch (ist->st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break;
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break;
@@ -2049,6 +2124,9 @@ loop_end:
exit_program(1);
}
}
+ if (ost)
+ ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index
+ + map->sync_stream_index];
}
}
}
@@ -2078,7 +2156,7 @@ loop_end:
avio_read(pb, attachment, len);
ost = new_attachment_stream(o, oc, -1);
- ost->stream_copy = 0;
+ ost->stream_copy = 1;
ost->attachment_filename = o->attachments[i];
ost->finished = 1;
ost->st->codec->extradata = attachment;
@@ -2100,6 +2178,12 @@ loop_end:
exit_program(1);
}
+ if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
+ av_dump_format(oc, nb_output_files - 1, oc->filename, 1);
+ av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1);
+ exit_program(1);
+ }
+
/* check if all codec options have been used */
unused_opts = strip_specifiers(o->g->codec_opts);
for (i = of->ost_index; i < nb_output_streams; i++) {
@@ -2142,6 +2226,17 @@ loop_end:
}
av_dict_free(&unused_opts);
+ /* set the encoding/decoding_needed flags */
+ for (i = of->ost_index; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+
+ ost->encoding_needed = !ost->stream_copy;
+ if (ost->encoding_needed && ost->source_index >= 0) {
+ InputStream *ist = input_streams[ost->source_index];
+ ist->decoding_needed |= DECODING_FOR_OST;
+ }
+ }
+
/* check filename in case of an image number is expected */
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(oc->filename)) {
@@ -2237,6 +2332,7 @@ loop_end:
char type, *val;
const char *stream_spec;
int index = 0, j, ret = 0;
+ char now_time[256];
val = strchr(o->metadata[i].u.str, '=');
if (!val) {
@@ -2246,6 +2342,17 @@ loop_end:
}
*val++ = 0;
+ if (!strcmp(o->metadata[i].u.str, "creation_time") &&
+ !strcmp(val, "now")) {
+ time_t now = time(0);
+ struct tm *ptm, tmbuf;
+ ptm = localtime_r(&now, &tmbuf);
+ if (ptm) {
+ if (strftime(now_time, sizeof(now_time), "%Y-%m-%d %H:%M:%S", ptm))
+ val = now_time;
+ }
+ }
+
parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec);
if (type == 's') {
for (j = 0; j < oc->nb_streams; j++) {
@@ -2843,6 +2950,13 @@ int ffmpeg_parse_options(int argc, char **argv)
goto fail;
}
+ /* create the complex filtergraphs */
+ ret = init_complex_filters();
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error initializing complex filters.\n");
+ goto fail;
+ }
+
/* open output files */
ret = open_files(&octx.groups[GROUP_OUTFILE], "output", open_output_file);
if (ret < 0) {
@@ -2850,6 +2964,13 @@ int ffmpeg_parse_options(int argc, char **argv)
goto fail;
}
+ /* configure the complex filtergraphs */
+ ret = configure_complex_filters();
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error configuring complex filters.\n");
+ goto fail;
+ }
+
fail:
uninit_parse_context(&octx);
if (ret < 0) {
@@ -2924,6 +3045,9 @@ const OptionDef options[] = {
{ "ss", HAS_ARG | OPT_TIME | OPT_OFFSET |
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time) },
"set the start time offset", "time_off" },
+ { "sseof", HAS_ARG | OPT_TIME | OPT_OFFSET |
+ OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time_eof) },
+ "set the start time offset relative to EOF", "time_off" },
{ "seek_timestamp", HAS_ARG | OPT_INT | OPT_OFFSET |
OPT_INPUT, { .off = OFFSET(seek_timestamp) },
"enable/disable seeking by timestamp with -ss" },
@@ -2961,8 +3085,8 @@ const OptionDef options[] = {
OPT_INPUT, { .off = OFFSET(rate_emu) },
"read input at native frame rate", "" },
{ "target", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_target },
- "specify target file type (\"vcd\", \"svcd\", \"dvd\","
- " \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
+ "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
+ "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")", "type" },
{ "vsync", HAS_ARG | OPT_EXPERT, { opt_vsync },
"video sync method", "" },
{ "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold },
@@ -3124,10 +3248,15 @@ const OptionDef options[] = {
"use HW accelerated decoding", "hwaccel name" },
{ "hwaccel_device", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
OPT_SPEC | OPT_INPUT, { .off = OFFSET(hwaccel_devices) },
- "select a device for HW acceleration" "devicename" },
+ "select a device for HW acceleration", "devicename" },
#if HAVE_VDPAU_X11
{ "vdpau_api_ver", HAS_ARG | OPT_INT | OPT_EXPERT, { &vdpau_api_ver }, "" },
#endif
+#if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
+ { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" },
+#endif
+ { "hwaccels", OPT_EXIT, { .func_arg = show_hwaccels },
+ "show available HW acceleration methods" },
{ "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC |
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) },
"automatically insert correct rotate filters" },
diff --git a/chromium/third_party/ffmpeg/ffmpeg_options.gni b/chromium/third_party/ffmpeg/ffmpeg_options.gni
index a4f733861e5..4eddc52f057 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_options.gni
+++ b/chromium/third_party/ffmpeg/ffmpeg_options.gni
@@ -4,6 +4,7 @@
import("//build/config/arm.gni")
import("//build/config/chrome_build.gni")
+import("//build/config/sanitizers/sanitizers.gni")
if (is_chrome_branded) {
_default_ffmpeg_branding = "Chrome"
diff --git a/chromium/third_party/ffmpeg/ffmpeg_vda.c b/chromium/third_party/ffmpeg/ffmpeg_vda.c
deleted file mode 100644
index d15648dd8e2..00000000000
--- a/chromium/third_party/ffmpeg/ffmpeg_vda.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/avcodec.h"
-#include "libavcodec/vda.h"
-#include "libavutil/imgutils.h"
-
-#include "ffmpeg.h"
-
-typedef struct VDAContext {
- AVFrame *tmp_frame;
-} VDAContext;
-
-static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
-{
- InputStream *ist = s->opaque;
- VDAContext *vda = ist->hwaccel_ctx;
- CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
- OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
- CVReturn err;
- uint8_t *data[4] = { 0 };
- int linesize[4] = { 0 };
- int planes, ret, i;
-
- av_frame_unref(vda->tmp_frame);
-
- switch (pixel_format) {
- case kCVPixelFormatType_420YpCbCr8Planar: vda->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
- case kCVPixelFormatType_422YpCbCr8: vda->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
- default:
- av_log(NULL, AV_LOG_ERROR,
- "Unsupported pixel format: %u\n", pixel_format);
- return AVERROR(ENOSYS);
- }
-
- vda->tmp_frame->width = frame->width;
- vda->tmp_frame->height = frame->height;
- ret = av_frame_get_buffer(vda->tmp_frame, 32);
- if (ret < 0)
- return ret;
-
- err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
- if (err != kCVReturnSuccess) {
- av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
- return AVERROR_UNKNOWN;
- }
-
- if (CVPixelBufferIsPlanar(pixbuf)) {
-
- planes = CVPixelBufferGetPlaneCount(pixbuf);
- for (i = 0; i < planes; i++) {
- data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
- linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
- }
- } else {
- data[0] = CVPixelBufferGetBaseAddress(pixbuf);
- linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
- }
-
- av_image_copy(vda->tmp_frame->data, vda->tmp_frame->linesize,
- (const uint8_t **)data, linesize, vda->tmp_frame->format,
- frame->width, frame->height);
-
- ret = av_frame_copy_props(vda->tmp_frame, frame);
- if (ret < 0)
- return ret;
-
- av_frame_unref(frame);
- av_frame_move_ref(frame, vda->tmp_frame);
-
- return 0;
-}
-
-static void vda_uninit(AVCodecContext *s)
-{
- InputStream *ist = s->opaque;
- VDAContext *vda = ist->hwaccel_ctx;
-
- ist->hwaccel_uninit = NULL;
- ist->hwaccel_retrieve_data = NULL;
-
- av_frame_free(&vda->tmp_frame);
-
- av_vda_default_free(s);
- av_freep(&ist->hwaccel_ctx);
-}
-
-int vda_init(AVCodecContext *s)
-{
- InputStream *ist = s->opaque;
- int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
- VDAContext *vda;
- int ret;
-
- vda = av_mallocz(sizeof(*vda));
- if (!vda)
- return AVERROR(ENOMEM);
-
- ist->hwaccel_ctx = vda;
- ist->hwaccel_uninit = vda_uninit;
- ist->hwaccel_retrieve_data = vda_retrieve_data;
-
- vda->tmp_frame = av_frame_alloc();
- if (!vda->tmp_frame) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- ret = av_vda_default_init(s);
- if (ret < 0) {
- av_log(NULL, loglevel, "Error creating VDA decoder.\n");
- goto fail;
- }
-
- return 0;
-fail:
- vda_uninit(s);
- return ret;
-}
diff --git a/chromium/third_party/ffmpeg/ffmpeg_vdpau.c b/chromium/third_party/ffmpeg/ffmpeg_vdpau.c
index b05e557613e..92a98eabe8c 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_vdpau.c
+++ b/chromium/third_party/ffmpeg/ffmpeg_vdpau.c
@@ -289,7 +289,8 @@ do {
s->hwaccel_context = vdpau_ctx;
} else
- if (av_vdpau_bind_context(s, ctx->device, ctx->get_proc_address, 0))
+ if (av_vdpau_bind_context(s, ctx->device, ctx->get_proc_address,
+ AV_HWACCEL_FLAG_IGNORE_LEVEL))
goto fail;
ctx->get_information_string(&vendor);
diff --git a/chromium/third_party/ffmpeg/ffmpeg_videotoolbox.c b/chromium/third_party/ffmpeg/ffmpeg_videotoolbox.c
new file mode 100644
index 00000000000..6688452c047
--- /dev/null
+++ b/chromium/third_party/ffmpeg/ffmpeg_videotoolbox.c
@@ -0,0 +1,187 @@
+/*
+ * 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 <CoreServices/CoreServices.h>
+
+#include "config.h"
+#include "libavcodec/avcodec.h"
+#if CONFIG_VDA
+# include "libavcodec/vda.h"
+#endif
+#if CONFIG_VIDEOTOOLBOX
+# include "libavcodec/videotoolbox.h"
+#endif
+#include "libavutil/imgutils.h"
+#include "ffmpeg.h"
+
+typedef struct VTContext {
+ AVFrame *tmp_frame;
+} VTContext;
+
+char *videotoolbox_pixfmt;
+
+static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
+{
+ InputStream *ist = s->opaque;
+ VTContext *vt = ist->hwaccel_ctx;
+ CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
+ OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
+ CVReturn err;
+ uint8_t *data[4] = { 0 };
+ int linesize[4] = { 0 };
+ int planes, ret, i;
+ char codec_str[32];
+
+ av_frame_unref(vt->tmp_frame);
+
+ switch (pixel_format) {
+ case kCVPixelFormatType_420YpCbCr8Planar: vt->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
+ case kCVPixelFormatType_422YpCbCr8: vt->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
+ case kCVPixelFormatType_32BGRA: vt->tmp_frame->format = AV_PIX_FMT_BGRA; break;
+#ifdef kCFCoreFoundationVersionNumber10_7
+ case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_NV12; break;
+#endif
+ default:
+ av_get_codec_tag_string(codec_str, sizeof(codec_str), s->codec_tag);
+ av_log(NULL, AV_LOG_ERROR,
+ "%s: Unsupported pixel format: %s\n", codec_str, videotoolbox_pixfmt);
+ return AVERROR(ENOSYS);
+ }
+
+ vt->tmp_frame->width = frame->width;
+ vt->tmp_frame->height = frame->height;
+ ret = av_frame_get_buffer(vt->tmp_frame, 32);
+ if (ret < 0)
+ return ret;
+
+ err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+ if (err != kCVReturnSuccess) {
+ av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ if (CVPixelBufferIsPlanar(pixbuf)) {
+
+ planes = CVPixelBufferGetPlaneCount(pixbuf);
+ for (i = 0; i < planes; i++) {
+ data[i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
+ linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
+ }
+ } else {
+ data[0] = CVPixelBufferGetBaseAddress(pixbuf);
+ linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
+ }
+
+ av_image_copy(vt->tmp_frame->data, vt->tmp_frame->linesize,
+ (const uint8_t **)data, linesize, vt->tmp_frame->format,
+ frame->width, frame->height);
+
+ ret = av_frame_copy_props(vt->tmp_frame, frame);
+ CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+ if (ret < 0)
+ return ret;
+
+ av_frame_unref(frame);
+ av_frame_move_ref(frame, vt->tmp_frame);
+
+ return 0;
+}
+
+static void videotoolbox_uninit(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ VTContext *vt = ist->hwaccel_ctx;
+
+ ist->hwaccel_uninit = NULL;
+ ist->hwaccel_retrieve_data = NULL;
+
+ av_frame_free(&vt->tmp_frame);
+
+ if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) {
+#if CONFIG_VIDEOTOOLBOX
+ av_videotoolbox_default_free(s);
+#endif
+ } else {
+#if CONFIG_VDA
+ av_vda_default_free(s);
+#endif
+ }
+ av_freep(&ist->hwaccel_ctx);
+}
+
+int videotoolbox_init(AVCodecContext *s)
+{
+ InputStream *ist = s->opaque;
+ int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ int ret = 0;
+ VTContext *vt;
+
+ vt = av_mallocz(sizeof(*vt));
+ if (!vt)
+ return AVERROR(ENOMEM);
+
+ ist->hwaccel_ctx = vt;
+ ist->hwaccel_uninit = videotoolbox_uninit;
+ ist->hwaccel_retrieve_data = videotoolbox_retrieve_data;
+
+ vt->tmp_frame = av_frame_alloc();
+ if (!vt->tmp_frame) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) {
+#if CONFIG_VIDEOTOOLBOX
+ if (!videotoolbox_pixfmt) {
+ ret = av_videotoolbox_default_init(s);
+ } else {
+ AVVideotoolboxContext *vtctx = av_videotoolbox_alloc_context();
+ CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
+ videotoolbox_pixfmt,
+ kCFStringEncodingUTF8);
+ vtctx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
+ ret = av_videotoolbox_default_init2(s, vtctx);
+ CFRelease(pixfmt_str);
+ }
+#endif
+ } else {
+#if CONFIG_VDA
+ if (!videotoolbox_pixfmt) {
+ ret = av_vda_default_init(s);
+ } else {
+ AVVDAContext *vdactx = av_vda_alloc_context();
+ CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
+ videotoolbox_pixfmt,
+ kCFStringEncodingUTF8);
+ vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
+ ret = av_vda_default_init2(s, vdactx);
+ CFRelease(pixfmt_str);
+ }
+#endif
+ }
+ if (ret < 0) {
+ av_log(NULL, loglevel,
+ "Error creating %s decoder.\n", ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX ? "Videotoolbox" : "VDA");
+ goto fail;
+ }
+
+ return 0;
+fail:
+ videotoolbox_uninit(s);
+ return ret;
+}
diff --git a/chromium/third_party/ffmpeg/ffplay.c b/chromium/third_party/ffmpeg/ffplay.c
index 58034c60a9f..d302793924b 100644
--- a/chromium/third_party/ffmpeg/ffplay.c
+++ b/chromium/third_party/ffmpeg/ffplay.c
@@ -31,7 +31,6 @@
#include <stdint.h>
#include "libavutil/avstring.h"
-#include "libavutil/colorspace.h"
#include "libavutil/eval.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
@@ -49,7 +48,6 @@
#include "libswresample/swresample.h"
#if CONFIG_AVFILTER
-# include "libavfilter/avcodec.h"
# include "libavfilter/avfilter.h"
# include "libavfilter/buffersink.h"
# include "libavfilter/buffersrc.h"
@@ -66,7 +64,9 @@ const char program_name[] = "ffplay";
const int program_birth_year = 2003;
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
-#define MIN_FRAMES 5
+#define MIN_FRAMES 25
+#define EXTERNAL_CLOCK_MIN_FRAMES 2
+#define EXTERNAL_CLOCK_MAX_FRAMES 10
/* Minimum SDL audio buffer size, in samples. */
#define SDL_AUDIO_MIN_BUFFER_SIZE 512
@@ -102,7 +102,7 @@ const int program_birth_year = 2003;
#define CURSOR_HIDE_DELAY 1000000
-static int64_t sws_flags = SWS_BICUBIC;
+static unsigned sws_flags = SWS_BICUBIC;
typedef struct MyAVPacketList {
AVPacket pkt;
@@ -223,6 +223,9 @@ typedef struct VideoState {
Decoder viddec;
Decoder subdec;
+ int viddec_width;
+ int viddec_height;
+
int audio_stream;
int av_sync_type;
@@ -278,6 +281,7 @@ typedef struct VideoState {
#if !CONFIG_AVFILTER
struct SwsContext *img_convert_ctx;
#endif
+ struct SwsContext *sub_convert_ctx;
SDL_Rect last_display_rect;
int eof;
@@ -829,229 +833,50 @@ static void fill_border(int xleft, int ytop, int width, int height, int x, int y
#define ALPHA_BLEND(a, oldp, newp, s)\
((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s))
-#define RGBA_IN(r, g, b, a, s)\
-{\
- unsigned int v = ((const uint32_t *)(s))[0];\
- a = (v >> 24) & 0xff;\
- r = (v >> 16) & 0xff;\
- g = (v >> 8) & 0xff;\
- b = v & 0xff;\
-}
-
-#define YUVA_IN(y, u, v, a, s, pal)\
-{\
- unsigned int val = ((const uint32_t *)(pal))[*(const uint8_t*)(s)];\
- a = (val >> 24) & 0xff;\
- y = (val >> 16) & 0xff;\
- u = (val >> 8) & 0xff;\
- v = val & 0xff;\
-}
-
-#define YUVA_OUT(d, y, u, v, a)\
-{\
- ((uint32_t *)(d))[0] = (a << 24) | (y << 16) | (u << 8) | v;\
-}
#define BPP 1
static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw, int imgh)
{
- int wrap, wrap3, width2, skip2;
- int y, u, v, a, u1, v1, a1, w, h;
+ int x, y, Y, U, V, A;
uint8_t *lum, *cb, *cr;
- const uint8_t *p;
- const uint32_t *pal;
int dstx, dsty, dstw, dsth;
+ const AVPicture *src = &rect->pict;
dstw = av_clip(rect->w, 0, imgw);
dsth = av_clip(rect->h, 0, imgh);
dstx = av_clip(rect->x, 0, imgw - dstw);
dsty = av_clip(rect->y, 0, imgh - dsth);
- lum = dst->data[0] + dsty * dst->linesize[0];
- cb = dst->data[1] + (dsty >> 1) * dst->linesize[1];
- cr = dst->data[2] + (dsty >> 1) * dst->linesize[2];
-
- width2 = ((dstw + 1) >> 1) + (dstx & ~dstw & 1);
- skip2 = dstx >> 1;
- wrap = dst->linesize[0];
- wrap3 = rect->pict.linesize[0];
- p = rect->pict.data[0];
- pal = (const uint32_t *)rect->pict.data[1]; /* Now in YCrCb! */
-
- if (dsty & 1) {
- lum += dstx;
- cb += skip2;
- cr += skip2;
-
- if (dstx & 1) {
- YUVA_IN(y, u, v, a, p, pal);
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
- cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
- cb++;
- cr++;
- lum++;
- p += BPP;
- }
- for (w = dstw - (dstx & 1); w >= 2; w -= 2) {
- YUVA_IN(y, u, v, a, p, pal);
- u1 = u;
- v1 = v;
- a1 = a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
- YUVA_IN(y, u, v, a, p + BPP, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
- cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
- cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
- cb++;
- cr++;
- p += 2 * BPP;
- lum += 2;
- }
- if (w) {
- YUVA_IN(y, u, v, a, p, pal);
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
- cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
- p++;
+ lum = dst->data[0] + dstx + dsty * dst->linesize[0];
+ cb = dst->data[1] + dstx/2 + (dsty >> 1) * dst->linesize[1];
+ cr = dst->data[2] + dstx/2 + (dsty >> 1) * dst->linesize[2];
+
+ for (y = 0; y<dsth; y++) {
+ for (x = 0; x<dstw; x++) {
+ Y = src->data[0][x + y*src->linesize[0]];
+ A = src->data[3][x + y*src->linesize[3]];
+ lum[0] = ALPHA_BLEND(A, lum[0], Y, 0);
lum++;
}
- p += wrap3 - dstw * BPP;
- lum += wrap - dstw - dstx;
- cb += dst->linesize[1] - width2 - skip2;
- cr += dst->linesize[2] - width2 - skip2;
- }
- for (h = dsth - (dsty & 1); h >= 2; h -= 2) {
- lum += dstx;
- cb += skip2;
- cr += skip2;
-
- if (dstx & 1) {
- YUVA_IN(y, u, v, a, p, pal);
- u1 = u;
- v1 = v;
- a1 = a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- p += wrap3;
- lum += wrap;
- YUVA_IN(y, u, v, a, p, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
- cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
- cb++;
- cr++;
- p += -wrap3 + BPP;
- lum += -wrap + 1;
- }
- for (w = dstw - (dstx & 1); w >= 2; w -= 2) {
- YUVA_IN(y, u, v, a, p, pal);
- u1 = u;
- v1 = v;
- a1 = a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
- YUVA_IN(y, u, v, a, p + BPP, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
- p += wrap3;
- lum += wrap;
-
- YUVA_IN(y, u, v, a, p, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
- YUVA_IN(y, u, v, a, p + BPP, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
-
- cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 2);
- cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 2);
+ lum += dst->linesize[0] - dstw;
+ }
+ for (y = 0; y<dsth/2; y++) {
+ for (x = 0; x<dstw/2; x++) {
+ U = src->data[1][x + y*src->linesize[1]];
+ V = src->data[2][x + y*src->linesize[2]];
+ A = src->data[3][2*x + 2*y *src->linesize[3]]
+ + src->data[3][2*x + 1 + 2*y *src->linesize[3]]
+ + src->data[3][2*x + 1 + (2*y+1)*src->linesize[3]]
+ + src->data[3][2*x + (2*y+1)*src->linesize[3]];
+ cb[0] = ALPHA_BLEND(A>>2, cb[0], U, 0);
+ cr[0] = ALPHA_BLEND(A>>2, cr[0], V, 0);
cb++;
cr++;
- p += -wrap3 + 2 * BPP;
- lum += -wrap + 2;
- }
- if (w) {
- YUVA_IN(y, u, v, a, p, pal);
- u1 = u;
- v1 = v;
- a1 = a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- p += wrap3;
- lum += wrap;
- YUVA_IN(y, u, v, a, p, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
- cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
- cb++;
- cr++;
- p += -wrap3 + BPP;
- lum += -wrap + 1;
- }
- p += wrap3 + (wrap3 - dstw * BPP);
- lum += wrap + (wrap - dstw - dstx);
- cb += dst->linesize[1] - width2 - skip2;
- cr += dst->linesize[2] - width2 - skip2;
- }
- /* handle odd height */
- if (h) {
- lum += dstx;
- cb += skip2;
- cr += skip2;
-
- if (dstx & 1) {
- YUVA_IN(y, u, v, a, p, pal);
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
- cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
- cb++;
- cr++;
- lum++;
- p += BPP;
- }
- for (w = dstw - (dstx & 1); w >= 2; w -= 2) {
- YUVA_IN(y, u, v, a, p, pal);
- u1 = u;
- v1 = v;
- a1 = a;
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
-
- YUVA_IN(y, u, v, a, p + BPP, pal);
- u1 += u;
- v1 += v;
- a1 += a;
- lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
- cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u, 1);
- cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v, 1);
- cb++;
- cr++;
- p += 2 * BPP;
- lum += 2;
- }
- if (w) {
- YUVA_IN(y, u, v, a, p, pal);
- lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
- cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
- cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
}
+ cb += dst->linesize[1] - dstw/2;
+ cr += dst->linesize[2] - dstw/2;
}
}
@@ -1306,6 +1131,7 @@ static void stream_close(VideoState *is)
#if !CONFIG_AVFILTER
sws_freeContext(is->img_convert_ctx);
#endif
+ sws_freeContext(is->sub_convert_ctx);
av_free(is);
}
@@ -1475,11 +1301,11 @@ static double get_master_clock(VideoState *is)
}
static void check_external_clock_speed(VideoState *is) {
- if (is->video_stream >= 0 && is->videoq.nb_packets <= MIN_FRAMES / 2 ||
- is->audio_stream >= 0 && is->audioq.nb_packets <= MIN_FRAMES / 2) {
+ if (is->video_stream >= 0 && is->videoq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES ||
+ is->audio_stream >= 0 && is->audioq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES) {
set_clock_speed(&is->extclk, FFMAX(EXTERNAL_CLOCK_SPEED_MIN, is->extclk.speed - EXTERNAL_CLOCK_SPEED_STEP));
- } else if ((is->video_stream < 0 || is->videoq.nb_packets > MIN_FRAMES * 2) &&
- (is->audio_stream < 0 || is->audioq.nb_packets > MIN_FRAMES * 2)) {
+ } else if ((is->video_stream < 0 || is->videoq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES) &&
+ (is->audio_stream < 0 || is->audioq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES)) {
set_clock_speed(&is->extclk, FFMIN(EXTERNAL_CLOCK_SPEED_MAX, is->extclk.speed + EXTERNAL_CLOCK_SPEED_STEP));
} else {
double speed = is->extclk.speed;
@@ -1851,7 +1677,18 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, double
av_picture_copy(&pict, (AVPicture *)src_frame,
src_frame->format, vp->width, vp->height);
#else
- av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
+ {
+ AVDictionaryEntry *e = av_dict_get(sws_dict, "sws_flags", NULL, 0);
+ if (e) {
+ const AVClass *class = sws_get_class();
+ const AVOption *o = av_opt_find(&class, "sws_flags", NULL, 0,
+ AV_OPT_SEARCH_FAKE_OBJ);
+ int ret = av_opt_eval_flags(&class, o, e->value, &sws_flags);
+ if (ret < 0)
+ exit(1);
+ }
+ }
+
is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
vp->width, vp->height, src_frame->format, vp->width, vp->height,
AV_PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL);
@@ -1893,6 +1730,9 @@ static int get_video_frame(VideoState *is, AVFrame *frame)
frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);
+ is->viddec_width = frame->width;
+ is->viddec_height = frame->height;
+
if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {
if (frame->pts != AV_NOPTS_VALUE) {
double diff = dpts - get_master_clock(is);
@@ -1958,15 +1798,23 @@ fail:
static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame)
{
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
- char sws_flags_str[128];
+ char sws_flags_str[512] = "";
char buffersrc_args[256];
int ret;
AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL;
AVCodecContext *codec = is->video_st->codec;
AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL);
+ AVDictionaryEntry *e = NULL;
+
+ while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) {
+ if (!strcmp(e->key, "sws_flags")) {
+ av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value);
+ } else
+ av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", e->key, e->value);
+ }
+ if (strlen(sws_flags_str))
+ sws_flags_str[strlen(sws_flags_str)-1] = '\0';
- av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
- snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags);
graph->scale_sws_opts = av_strdup(sws_flags_str);
snprintf(buffersrc_args, sizeof(buffersrc_args),
@@ -2328,8 +2176,7 @@ static int subtitle_thread(void *arg)
Frame *sp;
int got_subtitle;
double pts;
- int i, j;
- int r, g, b, y, u, v, a;
+ int i;
for (;;) {
if (!(sp = frame_queue_peek_writable(&is->subpq)))
@@ -2348,14 +2195,41 @@ static int subtitle_thread(void *arg)
for (i = 0; i < sp->sub.num_rects; i++)
{
- for (j = 0; j < sp->sub.rects[i]->nb_colors; j++)
- {
- RGBA_IN(r, g, b, a, (uint32_t*)sp->sub.rects[i]->pict.data[1] + j);
- y = RGB_TO_Y_CCIR(r, g, b);
- u = RGB_TO_U_CCIR(r, g, b, 0);
- v = RGB_TO_V_CCIR(r, g, b, 0);
- YUVA_OUT((uint32_t*)sp->sub.rects[i]->pict.data[1] + j, y, u, v, a);
+ int in_w = sp->sub.rects[i]->w;
+ int in_h = sp->sub.rects[i]->h;
+ int subw = is->subdec.avctx->width ? is->subdec.avctx->width : is->viddec_width;
+ int subh = is->subdec.avctx->height ? is->subdec.avctx->height : is->viddec_height;
+ int out_w = is->viddec_width ? in_w * is->viddec_width / subw : in_w;
+ int out_h = is->viddec_height ? in_h * is->viddec_height / subh : in_h;
+ AVPicture newpic;
+
+ //can not use avpicture_alloc as it is not compatible with avsubtitle_free()
+ av_image_fill_linesizes(newpic.linesize, AV_PIX_FMT_YUVA420P, out_w);
+ newpic.data[0] = av_malloc(newpic.linesize[0] * out_h);
+ newpic.data[3] = av_malloc(newpic.linesize[3] * out_h);
+ newpic.data[1] = av_malloc(newpic.linesize[1] * ((out_h+1)/2));
+ newpic.data[2] = av_malloc(newpic.linesize[2] * ((out_h+1)/2));
+
+ is->sub_convert_ctx = sws_getCachedContext(is->sub_convert_ctx,
+ in_w, in_h, AV_PIX_FMT_PAL8, out_w, out_h,
+ AV_PIX_FMT_YUVA420P, sws_flags, NULL, NULL, NULL);
+ if (!is->sub_convert_ctx || !newpic.data[0] || !newpic.data[3] ||
+ !newpic.data[1] || !newpic.data[2]
+ ) {
+ av_log(NULL, AV_LOG_FATAL, "Cannot initialize the sub conversion context\n");
+ exit(1);
}
+ sws_scale(is->sub_convert_ctx,
+ (void*)sp->sub.rects[i]->pict.data, sp->sub.rects[i]->pict.linesize,
+ 0, in_h, newpic.data, newpic.linesize);
+
+ av_free(sp->sub.rects[i]->pict.data[0]);
+ av_free(sp->sub.rects[i]->pict.data[1]);
+ sp->sub.rects[i]->pict = newpic;
+ sp->sub.rects[i]->w = out_w;
+ sp->sub.rects[i]->h = out_h;
+ sp->sub.rects[i]->x = sp->sub.rects[i]->x * out_w / in_w;
+ sp->sub.rects[i]->y = sp->sub.rects[i]->y * out_h / in_h;
}
/* now we can update the picture count */
@@ -2448,6 +2322,13 @@ static int audio_decode_frame(VideoState *is)
return -1;
do {
+#if defined(_WIN32)
+ while (frame_queue_nb_remaining(&is->sampq) == 0) {
+ if ((av_gettime_relative() - audio_callback_time) > 1000000LL * is->audio_hw_buf_size / is->audio_tgt.bytes_per_sec / 2)
+ return -1;
+ av_usleep (1000);
+ }
+#endif
if (!(af = frame_queue_peek_readable(&is->sampq)))
return -1;
frame_queue_next(&is->sampq);
@@ -2695,10 +2576,15 @@ static int stream_component_open(VideoState *is, int stream_index)
}
av_codec_set_lowres(avctx, stream_lowres);
+#if FF_API_EMU_EDGE
if(stream_lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE;
- if (fast) avctx->flags2 |= CODEC_FLAG2_FAST;
- if(codec->capabilities & CODEC_CAP_DR1)
+#endif
+ if (fast)
+ avctx->flags2 |= AV_CODEC_FLAG2_FAST;
+#if FF_API_EMU_EDGE
+ if(codec->capabilities & AV_CODEC_CAP_DR1)
avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, ic->streams[stream_index], codec);
if (!av_dict_get(opts, "threads", NULL, 0))
@@ -2771,6 +2657,9 @@ static int stream_component_open(VideoState *is, int stream_index)
is->video_stream = stream_index;
is->video_st = ic->streams[stream_index];
+ is->viddec_width = avctx->width;
+ is->viddec_height = avctx->height;
+
decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread);
decoder_start(&is->viddec, video_thread, is);
is->queue_attachments_req = 1;
diff --git a/chromium/third_party/ffmpeg/ffprobe.c b/chromium/third_party/ffmpeg/ffprobe.c
index 3e5324e36b9..ac03689b834 100644
--- a/chromium/third_party/ffmpeg/ffprobe.c
+++ b/chromium/third_party/ffmpeg/ffprobe.c
@@ -807,10 +807,10 @@ typedef struct DefaultContext {
#define OFFSET(x) offsetof(DefaultContext, x)
static const AVOption default_options[] = {
- { "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- { "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- { "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- { "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
+ { "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ { "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ { "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ { "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{NULL},
};
@@ -963,12 +963,12 @@ typedef struct CompactContext {
static const AVOption compact_options[]= {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
- {"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- {"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
+ {"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ {"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
- {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
- {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
+ {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
+ {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
};
@@ -1079,12 +1079,12 @@ static const Writer compact_writer = {
static const AVOption csv_options[] = {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
- {"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
- {"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
+ {"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
+ {"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
- {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
- {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
+ {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
+ {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
};
@@ -1117,8 +1117,8 @@ typedef struct FlatContext {
static const AVOption flat_options[]= {
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
- {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
- {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
+ {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
+ {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
};
@@ -1237,8 +1237,8 @@ typedef struct INIContext {
#define OFFSET(x) offsetof(INIContext, x)
static const AVOption ini_options[] = {
- {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
- {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
+ {"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
+ {"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
};
@@ -1343,8 +1343,8 @@ typedef struct JSONContext {
#define OFFSET(x) offsetof(JSONContext, x)
static const AVOption json_options[]= {
- { "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- { "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
+ { "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ { "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ NULL }
};
@@ -1506,10 +1506,10 @@ typedef struct XMLContext {
#define OFFSET(x) offsetof(XMLContext, x)
static const AVOption xml_options[] = {
- {"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- {"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- {"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
- {"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
+ {"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ {"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ {"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
+ {"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{NULL},
};
@@ -2722,7 +2722,7 @@ static void ffprobe_show_pixel_formats(WriterContext *w)
for (i = 0; i < pixdesc->nb_components; i++) {
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT_COMPONENT);
print_int("index", i + 1);
- print_int("bit_depth", pixdesc->comp[i].depth_minus1 + 1);
+ print_int("bit_depth", pixdesc->comp[i].depth);
writer_print_section_footer(w);
}
writer_print_section_footer(w);
diff --git a/chromium/third_party/ffmpeg/ffserver.c b/chromium/third_party/ffmpeg/ffserver.c
index 2b19bba9ba9..73ede871abb 100644
--- a/chromium/third_party/ffmpeg/ffserver.c
+++ b/chromium/third_party/ffmpeg/ffserver.c
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "libavformat/avformat.h"
-// FIXME those are internal headers, ffserver _really_ shouldn't use them
+/* FIXME: those are internal headers, ffserver _really_ shouldn't use them */
#include "libavformat/ffm.h"
#include "libavformat/network.h"
#include "libavformat/os_support.h"
@@ -209,6 +209,7 @@ static void close_connection(HTTPContext *c);
/* HTTP handling */
static int handle_connection(HTTPContext *c);
+static inline void print_stream_params(AVIOContext *pb, FFServerStream *stream);
static void compute_status(HTTPContext *c);
static int open_input_stream(HTTPContext *c, const char *info);
static int http_parse_request(HTTPContext *c);
@@ -250,7 +251,8 @@ static unsigned int nb_connections;
static uint64_t current_bandwidth;
-static int64_t cur_time; // Making this global saves on passing it around everywhere
+/* Making this global saves on passing it around everywhere */
+static int64_t cur_time;
static AVLFG random_state;
@@ -314,12 +316,12 @@ static char *ctime1(char *buf2, int buf_size)
static void http_vlog(const char *fmt, va_list vargs)
{
static int print_prefix = 1;
+ char buf[32];
if (!logfile)
return;
if (print_prefix) {
- char buf[32];
ctime1(buf, sizeof(buf));
fprintf(logfile, "%s ", buf);
}
@@ -468,20 +470,22 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)",
ntohs(my_addr->sin_port));
perror (bindmsg);
- closesocket(server_fd);
- return -1;
+ goto fail;
}
if (listen (server_fd, 5) < 0) {
perror ("listen");
- closesocket(server_fd);
- return -1;
+ goto fail;
}
if (ff_socket_nonblock(server_fd, 1) < 0)
av_log(NULL, AV_LOG_WARNING, "ff_socket_nonblock failed\n");
return server_fd;
+
+fail:
+ closesocket(server_fd);
+ return -1;
}
/* start all multicast streams */
@@ -504,8 +508,7 @@ static void start_multicast(void)
random1 = av_lfg_get(&random_state);
/* open the RTP connection */
- snprintf(session_id, sizeof(session_id), "%08x%08x",
- random0, random1);
+ snprintf(session_id, sizeof(session_id), "%08x%08x", random0, random1);
/* choose a port if none given */
if (stream->multicast_port == 0) {
@@ -563,25 +566,21 @@ static int http_server(void)
if (config.http_addr.sin_port) {
server_fd = socket_open_listen(&config.http_addr);
- if (server_fd < 0) {
- av_free(poll_table);
- return -1;
- }
+ if (server_fd < 0)
+ goto quit;
}
if (config.rtsp_addr.sin_port) {
rtsp_server_fd = socket_open_listen(&config.rtsp_addr);
if (rtsp_server_fd < 0) {
- av_free(poll_table);
closesocket(server_fd);
- return -1;
+ goto quit;
}
}
if (!rtsp_server_fd && !server_fd) {
http_log("HTTP and RTSP disabled.\n");
- av_free(poll_table);
- return -1;
+ goto quit;
}
http_log("FFserver started.\n");
@@ -630,9 +629,8 @@ static int http_server(void)
poll_entry++;
} else {
/* when ffserver is doing the timing, we work by
- looking at which packet needs to be sent every
- 10 ms */
- /* one tick wait XXX: 10 ms assumed */
+ * looking at which packet needs to be sent every
+ * 10 ms (one tick wait XXX: 10 ms assumed) */
if (delay > 10)
delay = 10;
}
@@ -655,13 +653,12 @@ static int http_server(void)
}
/* wait for an event on one connection. We poll at least every
- second to handle timeouts */
+ * second to handle timeouts */
do {
ret = poll(poll_table, poll_entry - poll_table, delay);
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
ff_neterrno() != AVERROR(EINTR)) {
- av_free(poll_table);
- return -1;
+ goto quit;
}
} while (ret < 0);
@@ -695,6 +692,10 @@ static int http_server(void)
new_connection(rtsp_server_fd, 1);
}
}
+
+quit:
+ av_free(poll_table);
+ return -1;
}
/* start waiting for a new HTTP/RTSP request */
@@ -703,13 +704,9 @@ static void start_wait_request(HTTPContext *c, int is_rtsp)
c->buffer_ptr = c->buffer;
c->buffer_end = c->buffer + c->buffer_size - 1; /* leave room for '\0' */
- if (is_rtsp) {
- c->timeout = cur_time + RTSP_REQUEST_TIMEOUT;
- c->state = RTSPSTATE_WAIT_REQUEST;
- } else {
- c->timeout = cur_time + HTTP_REQUEST_TIMEOUT;
- c->state = HTTPSTATE_WAIT_REQUEST;
- }
+ c->state = is_rtsp ? RTSPSTATE_WAIT_REQUEST : HTTPSTATE_WAIT_REQUEST;
+ c->timeout = cur_time +
+ (is_rtsp ? RTSP_REQUEST_TIMEOUT : HTTP_REQUEST_TIMEOUT);
}
static void http_send_too_busy_reply(int fd)
@@ -787,7 +784,6 @@ static void close_connection(HTTPContext *c)
HTTPContext **cp, *c1;
int i, nb_streams;
AVFormatContext *ctx;
- URLContext *h;
AVStream *st;
/* remove connection from list */
@@ -832,9 +828,7 @@ static void close_connection(HTTPContext *c)
av_freep(&ctx->streams[0]);
av_freep(&ctx);
}
- h = c->rtp_handles[i];
- if (h)
- ffurl_close(h);
+ ffurl_close(c->rtp_handles[i]);
}
ctx = &c->fmt_ctx;
@@ -903,11 +897,11 @@ static int handle_connection(HTTPContext *c)
if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
(ptr >= c->buffer + 4 && !memcmp(ptr-4, "\r\n\r\n", 4))) {
/* request found : parse it and reply */
- if (c->state == HTTPSTATE_WAIT_REQUEST) {
+ if (c->state == HTTPSTATE_WAIT_REQUEST)
ret = http_parse_request(c);
- } else {
+ else
ret = rtsp_parse_request(c);
- }
+
if (ret < 0)
return -1;
} else if (ptr >= c->buffer_end) {
@@ -952,8 +946,8 @@ static int handle_connection(HTTPContext *c)
case HTTPSTATE_SEND_DATA_HEADER:
case HTTPSTATE_SEND_DATA_TRAILER:
/* for packetized output, we consider we can always write (the
- input streams set the speed). It may be better to verify
- that we do not rely too much on the kernel queues */
+ * input streams set the speed). It may be better to verify
+ * that we do not rely too much on the kernel queues */
if (!c->is_packetized) {
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
@@ -1166,8 +1160,10 @@ static int modify_current_stream(HTTPContext *c, char *rates)
break;
}
- if (c->switch_feed_streams[i] >= 0 && c->switch_feed_streams[i] != c->feed_streams[i])
+ if (c->switch_feed_streams[i] >= 0 &&
+ c->switch_feed_streams[i] != c->feed_streams[i]) {
action_required = 1;
+ }
}
return action_required;
@@ -1271,17 +1267,17 @@ static int validate_acl(FFServerStream *stream, HTTPContext *c)
if (stream->dynamic_acl[0]) {
acl = parse_dynamic_acl(stream, c);
-
ret = validate_acl_list(acl, c);
-
free_acl_list(acl);
}
return ret;
}
-/* compute the real filename of a file by matching it without its
- extensions to all the stream's filenames */
+/**
+ * compute the real filename of a file by matching it without its
+ * extensions to all the stream's filenames
+ */
static void compute_real_filename(char *filename, int max_size)
{
char file1[1024];
@@ -1289,7 +1285,6 @@ static void compute_real_filename(char *filename, int max_size)
char *p;
FFServerStream *stream;
- /* compute filename by matching without the file extensions */
av_strlcpy(file1, filename, sizeof(file1));
p = strrchr(file1, '.');
if (p)
@@ -1399,7 +1394,7 @@ static int http_parse_request(HTTPContext *c)
compute_real_filename(filename, sizeof(filename) - 1);
}
- // "redirect" / request to index.html
+ /* "redirect" request to index.html */
if (!strlen(filename))
av_strlcpy(filename, "index.html", sizeof(filename) - 1);
@@ -1452,7 +1447,7 @@ static int http_parse_request(HTTPContext *c)
if (c->post == 0 && stream->stream_type == STREAM_TYPE_LIVE)
current_bandwidth += stream->bandwidth;
- /* If already streaming this feed, do not let start another feeder. */
+ /* If already streaming this feed, do not let another feeder start */
if (stream->feed_opened) {
snprintf(msg, sizeof(msg), "This feed is already being received.");
http_log("Feed '%s' already being received\n", stream->feed_filename);
@@ -1738,8 +1733,9 @@ static int http_parse_request(HTTPContext *c)
return 0;
send_status:
compute_status(c);
- c->http_error = 200; /* horrible : we use this value to avoid
- going to the send data state */
+ /* horrible: we use this value to avoid
+ * going to the send data state */
+ c->http_error = 200;
c->state = HTTPSTATE_SEND_HEADER;
return 0;
}
@@ -1754,6 +1750,52 @@ static void fmt_bytecount(AVIOContext *pb, int64_t count)
avio_printf(pb, "%"PRId64"%c", count, *s);
}
+static inline void print_stream_params(AVIOContext *pb, FFServerStream *stream)
+{
+ int i, stream_no;
+ const char *type = "unknown";
+ char parameters[64];
+ AVStream *st;
+ AVCodec *codec;
+
+ stream_no = stream->nb_streams;
+
+ avio_printf(pb, "<table cellspacing=0 cellpadding=4><tr><th>Stream<th>"
+ "type<th>kbits/s<th align=left>codec<th align=left>"
+ "Parameters\n");
+
+ for (i = 0; i < stream_no; i++) {
+ st = stream->streams[i];
+ codec = avcodec_find_encoder(st->codec->codec_id);
+
+ parameters[0] = 0;
+
+ switch(st->codec->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ type = "audio";
+ snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz",
+ st->codec->channels, st->codec->sample_rate);
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ type = "video";
+ snprintf(parameters, sizeof(parameters),
+ "%dx%d, q=%d-%d, fps=%d", st->codec->width,
+ st->codec->height, st->codec->qmin, st->codec->qmax,
+ st->codec->time_base.den / st->codec->time_base.num);
+ break;
+ default:
+ abort();
+ }
+
+ avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d"
+ "<td>%s<td>%s\n",
+ i, type, st->codec->bit_rate/1000,
+ codec ? codec->name : "", parameters);
+ }
+
+ avio_printf(pb, "</table>\n");
+}
+
static void compute_status(HTTPContext *c)
{
HTTPContext *c1;
@@ -1804,8 +1846,8 @@ static void compute_status(HTTPContext *c)
strcpy(eosf - 3, ".ram");
else if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
/* generate a sample RTSP director if
- unicast. Generate an SDP redirector if
- multicast */
+ * unicast. Generate an SDP redirector if
+ * multicast */
eosf = strrchr(sfilename, '.');
if (!eosf)
eosf = sfilename + strlen(sfilename);
@@ -1894,7 +1936,7 @@ static void compute_status(HTTPContext *c)
avio_printf(pb, "<h2>Feed %s</h2>", stream->filename);
if (stream->pid) {
- avio_printf(pb, "Running as pid %d.\n", stream->pid);
+ avio_printf(pb, "Running as pid %"PRId64".\n", (int64_t) stream->pid);
#if defined(linux)
{
@@ -1903,8 +1945,8 @@ static void compute_status(HTTPContext *c)
/* This is somewhat linux specific I guess */
snprintf(ps_cmd, sizeof(ps_cmd),
- "ps -o \"%%cpu,cputime\" --no-headers %d",
- stream->pid);
+ "ps -o \"%%cpu,cputime\" --no-headers %"PRId64"",
+ (int64_t) stream->pid);
pid_stat = popen(ps_cmd, "r");
if (pid_stat) {
@@ -1924,42 +1966,7 @@ static void compute_status(HTTPContext *c)
avio_printf(pb, "<p>");
}
- avio_printf(pb, "<table cellspacing=0 cellpadding=4><tr><th>Stream<th>"
- "type<th>kbits/s<th align=left>codec<th align=left>"
- "Parameters\n");
-
- for (i = 0; i < stream->nb_streams; i++) {
- AVStream *st = stream->streams[i];
- AVCodec *codec = avcodec_find_encoder(st->codec->codec_id);
- const char *type = "unknown";
- char parameters[64];
-
- parameters[0] = 0;
-
- switch(st->codec->codec_type) {
- case AVMEDIA_TYPE_AUDIO:
- type = "audio";
- snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz",
- st->codec->channels, st->codec->sample_rate);
- break;
- case AVMEDIA_TYPE_VIDEO:
- type = "video";
- snprintf(parameters, sizeof(parameters),
- "%dx%d, q=%d-%d, fps=%d", st->codec->width,
- st->codec->height, st->codec->qmin, st->codec->qmax,
- st->codec->time_base.den / st->codec->time_base.num);
- break;
- default:
- abort();
- }
-
- avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d"
- "<td>%s<td>%s\n",
- i, type, st->codec->bit_rate/1000,
- codec ? codec->name : "", parameters);
- }
-
- avio_printf(pb, "</table>\n");
+ print_stream_params(pb, stream);
stream = stream->next;
}
@@ -2111,8 +2118,7 @@ static int64_t get_server_clock(HTTPContext *c)
return (cur_time - c->start_time) * 1000;
}
-/* return the estimated time at which the current packet must be sent
- (in us) */
+/* return the estimated time (in us) at which the current packet must be sent */
static int64_t get_packet_send_clock(HTTPContext *c)
{
int bytes_left, bytes_sent, frame_bytes;
@@ -2120,11 +2126,10 @@ static int64_t get_packet_send_clock(HTTPContext *c)
frame_bytes = c->cur_frame_bytes;
if (frame_bytes <= 0)
return c->cur_pts;
- else {
- bytes_left = c->buffer_end - c->buffer_ptr;
- bytes_sent = frame_bytes - bytes_left;
- return c->cur_pts + (c->cur_frame_duration * bytes_sent) / frame_bytes;
- }
+
+ bytes_left = c->buffer_end - c->buffer_ptr;
+ bytes_sent = frame_bytes - bytes_left;
+ return c->cur_pts + (c->cur_frame_duration * bytes_sent) / frame_bytes;
}
@@ -2151,7 +2156,8 @@ static int http_prepare_data(HTTPContext *c)
AVStream *src;
c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream));
- /* if file or feed, then just take streams from FFServerStream struct */
+ /* if file or feed, then just take streams from FFServerStream
+ * struct */
if (!c->stream->feed ||
c->stream->feed == c->stream)
src = c->stream->streams[i];
@@ -2216,23 +2222,23 @@ static int http_prepare_data(HTTPContext *c)
if (ret < 0) {
if (c->stream->feed) {
/* if coming from feed, it means we reached the end of the
- ffm file, so must wait for more data */
+ * ffm file, so must wait for more data */
c->state = HTTPSTATE_WAIT_FEED;
return 1; /* state changed */
- } else if (ret == AVERROR(EAGAIN)) {
+ }
+ if (ret == AVERROR(EAGAIN)) {
/* input not ready, come back later */
return 0;
+ }
+ if (c->stream->loop) {
+ avformat_close_input(&c->fmt_in);
+ if (open_input_stream(c, "") < 0)
+ goto no_loop;
+ goto redo;
} else {
- if (c->stream->loop) {
- avformat_close_input(&c->fmt_in);
- if (open_input_stream(c, "") < 0)
- goto no_loop;
- goto redo;
- } else {
no_loop:
/* must send trailer now because EOF or error */
c->state = HTTPSTATE_SEND_DATA_TRAILER;
- }
}
} else {
int source_index = pkt.stream_index;
@@ -2303,9 +2309,9 @@ static int http_prepare_data(HTTPContext *c)
max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
ret = ffio_open_dyn_packet_buf(&ctx->pb,
max_packet_size);
- } else {
+ } else
ret = avio_open_dyn_buf(&ctx->pb);
- }
+
if (ret < 0) {
/* XXX: potential leak */
return -1;
@@ -2368,7 +2374,8 @@ static int http_prepare_data(HTTPContext *c)
/* should convert the format at the same time */
/* send data starting at c->buffer_ptr to the output connection
- * (either UDP or TCP) */
+ * (either UDP or TCP)
+ */
static int http_send_data(HTTPContext *c)
{
int len, ret;
@@ -2449,8 +2456,8 @@ static int http_send_data(HTTPContext *c)
rtsp_c->packet_buffer_ptr += len;
if (rtsp_c->packet_buffer_ptr < rtsp_c->packet_buffer_end) {
/* if we could not send all the data, we will
- send it later, so a new state is needed to
- "lock" the RTSP TCP connection */
+ * send it later, so a new state is needed to
+ * "lock" the RTSP TCP connection */
rtsp_c->state = RTSPSTATE_SEND_PACKET;
break;
} else
@@ -2534,9 +2541,8 @@ static int http_start_receive_data(HTTPContext *c)
http_log("Error reading write index from feed file '%s': %s\n",
c->stream->feed_filename, strerror(errno));
return ret;
- } else {
- c->stream->feed_write_index = ret;
}
+ c->stream->feed_write_index = ret;
}
c->stream->feed_write_index = FFMAX(ffm_read_write_index(fd),
@@ -2578,12 +2584,11 @@ static int http_receive_data(HTTPContext *c)
goto fail;
c->buffer_ptr = c->buffer;
break;
- } else if (++loop_run > 10) {
+ } else if (++loop_run > 10)
/* no chunk header, abort */
goto fail;
- } else {
+ else
c->buffer_ptr++;
- }
}
if (c->buffer_end > c->buffer_ptr) {
@@ -2616,7 +2621,7 @@ static int http_receive_data(HTTPContext *c)
if (c->buffer_ptr >= c->buffer_end) {
FFServerStream *feed = c->stream;
/* a packet has been received : write it in the store, except
- if header */
+ * if header */
if (c->data_count > FFM_PACKET_SIZE) {
/* XXX: use llseek or url_seek
* XXX: Should probably fail? */
@@ -2822,10 +2827,10 @@ static int rtsp_parse_request(HTTPContext *c)
the_end:
len = avio_close_dyn_buf(c->pb, &c->pb_buffer);
c->pb = NULL; /* safety */
- if (len < 0) {
+ if (len < 0)
/* XXX: cannot do more */
return -1;
- }
+
c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len;
c->state = RTSPSTATE_SEND_REPLY;
@@ -2844,9 +2849,9 @@ static int prepare_sdp_description(FFServerStream *stream, uint8_t **pbuffer,
*pbuffer = NULL;
avc = avformat_alloc_context();
- if (!avc || !rtp_format) {
+ if (!avc || !rtp_format)
return -1;
- }
+
avc->oformat = rtp_format;
av_dict_set(&avc->metadata, "title",
entry ? entry->value : "No Title", 0);
@@ -2855,9 +2860,8 @@ static int prepare_sdp_description(FFServerStream *stream, uint8_t **pbuffer,
snprintf(avc->filename, 1024, "rtp://%s:%d?multicast=1?ttl=%d",
inet_ntoa(stream->multicast_ip),
stream->multicast_port, stream->multicast_ttl);
- } else {
+ } else
snprintf(avc->filename, 1024, "rtp://0.0.0.0");
- }
avc->streams = av_malloc_array(avc->nb_streams, sizeof(*avc->streams));
if (!avc->streams)
@@ -2887,7 +2891,7 @@ static int prepare_sdp_description(FFServerStream *stream, uint8_t **pbuffer,
static void rtsp_cmd_options(HTTPContext *c, const char *url)
{
-// rtsp_reply_header(c, RTSP_STATUS_OK);
+ /* rtsp_reply_header(c, RTSP_STATUS_OK); */
avio_printf(c->pb, "RTSP/1.0 %d %s\r\n", RTSP_STATUS_OK, "OK");
avio_printf(c->pb, "CSeq: %d\r\n", c->seq);
avio_printf(c->pb, "Public: %s\r\n",
@@ -3054,7 +3058,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
}
/* test if stream is OK (test needed because several SETUP needs
- to be done for a given file) */
+ * to be done for a given file) */
if (rtp_c->stream != stream) {
rtsp_reply_error(c, RTSP_STATUS_SERVICE);
return;
@@ -3115,8 +3119,10 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
}
-/* find an RTP connection by using the session ID. Check consistency
- with filename */
+/**
+ * find an RTP connection by using the session ID. Check consistency
+ * with filename
+ */
static HTTPContext *find_rtp_session_with_url(const char *url,
const char *session_id)
{
@@ -3139,10 +3145,10 @@ static HTTPContext *find_rtp_session_with_url(const char *url,
for(s=0; s<rtp_c->stream->nb_streams; ++s) {
snprintf(buf, sizeof(buf), "%s/streamid=%d",
rtp_c->stream->filename, s);
- if(!strncmp(path, buf, sizeof(buf))) {
- // XXX: Should we reply with RTSP_STATUS_ONLY_AGGREGATE if nb_streams>1?
+ if(!strncmp(path, buf, sizeof(buf)))
+ /* XXX: Should we reply with RTSP_STATUS_ONLY_AGGREGATE
+ * if nb_streams>1? */
return rtp_c;
- }
}
len = strlen(path);
if (len > 0 && path[len - 1] == '/' &&
@@ -3220,7 +3226,7 @@ static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
const char *proto_str;
/* XXX: should output a warning page when coming
- close to the connection limit */
+ * close to the connection limit */
if (nb_connections >= config.nb_max_connections)
goto fail;
@@ -3275,9 +3281,11 @@ static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
return NULL;
}
-/* add a new RTP stream in an RTP connection (used in RTSP SETUP
- command). If RTP/TCP protocol is used, TCP connection 'rtsp_c' is
- used. */
+/**
+ * add a new RTP stream in an RTP connection (used in RTSP SETUP
+ * command). If RTP/TCP protocol is used, TCP connection 'rtsp_c' is
+ * used.
+ */
static int rtp_new_av_stream(HTTPContext *c,
int stream_index, struct sockaddr_in *dest_addr,
HTTPContext *rtsp_c)
@@ -3355,10 +3363,10 @@ static int rtp_new_av_stream(HTTPContext *c,
/* normally, no packets should be output here, but the packet size may
* be checked */
- if (ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
+ if (ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0)
/* XXX: close stream */
goto fail;
- }
+
if (avformat_write_header(ctx, NULL) < 0) {
fail:
if (h)
@@ -3395,12 +3403,12 @@ static AVStream *add_av_stream1(FFServerStream *stream,
return NULL;
}
avcodec_copy_context(fst->codec, codec);
- } else {
+ } else
/* live streams must use the actual feed's codec since it may be
* updated later to carry extradata needed by them.
*/
fst->codec = codec;
- }
+
fst->priv_data = av_mallocz(sizeof(FeedData));
fst->index = stream->nb_streams;
avpriv_set_pts_info(fst, 33, 1, 90000);
@@ -3502,7 +3510,7 @@ static void extract_mpeg4_header(AVFormatContext *infile)
if (p[0] == 0x00 && p[1] == 0x00 &&
p[2] == 0x01 && p[3] == 0xb6) {
size = p - pkt.data;
- st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
st->codec->extradata_size = size;
memcpy(st->codec->extradata, pkt.data, size);
break;
@@ -3532,7 +3540,7 @@ static void build_file_streams(void)
/* open stream */
if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
/* specific case : if transport stream output to RTP,
- we use a raw transport stream reader */
+ * we use a raw transport stream reader */
av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);
}
@@ -3554,7 +3562,7 @@ static void build_file_streams(void)
remove_stream(stream);
} else {
/* find all the AVStreams inside and reference them in
- 'stream' */
+ * 'stream' */
if (avformat_find_stream_info(infile, NULL) < 0) {
http_log("Could not find codec parameters from '%s'\n",
stream->feed_filename);
@@ -3581,16 +3589,17 @@ static void build_feed_streams(void)
/* gather all streams */
for(stream = config.first_stream; stream; stream = stream->next) {
feed = stream->feed;
- if (feed) {
- if (stream->is_feed) {
- for(i=0;i<stream->nb_streams;i++)
- stream->feed_streams[i] = i;
- } else {
- /* we handle a stream coming from a feed */
- for(i=0;i<stream->nb_streams;i++)
- stream->feed_streams[i] = add_av_stream(feed,
- stream->streams[i]);
- }
+ if (!feed)
+ continue;
+
+ if (stream->is_feed) {
+ for(i=0;i<stream->nb_streams;i++)
+ stream->feed_streams[i] = i;
+ } else {
+ /* we handle a stream coming from a feed */
+ for(i=0;i<stream->nb_streams;i++)
+ stream->feed_streams[i] = add_av_stream(feed,
+ stream->streams[i]);
}
}
@@ -3757,24 +3766,24 @@ static void compute_bandwidth(void)
static void handle_child_exit(int sig)
{
pid_t pid;
- int status;
+ int status, uptime;
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
FFServerStream *feed;
for (feed = config.first_feed; feed; feed = feed->next) {
- if (feed->pid == pid) {
- int uptime = time(0) - feed->pid_start;
+ if (feed->pid != pid)
+ continue;
- feed->pid = 0;
- fprintf(stderr,
- "%s: Pid %d exited with status %d after %d seconds\n",
- feed->filename, pid, status, uptime);
+ uptime = time(0) - feed->pid_start;
+ feed->pid = 0;
+ fprintf(stderr,
+ "%s: Pid %"PRId64" exited with status %d after %d seconds\n",
+ feed->filename, (int64_t) pid, status, uptime);
- if (uptime < 30)
- /* Turn off any more restarts */
- ffserver_free_child_args(&feed->child_argv);
- }
+ if (uptime < 30)
+ /* Turn off any more restarts */
+ ffserver_free_child_args(&feed->child_argv);
}
}
diff --git a/chromium/third_party/ffmpeg/ffserver_config.c b/chromium/third_party/ffmpeg/ffserver_config.c
index 06bd8ac44ab..de8a4547fb8 100644
--- a/chromium/third_party/ffmpeg/ffserver_config.c
+++ b/chromium/third_party/ffmpeg/ffserver_config.c
@@ -230,9 +230,9 @@ static void add_codec(FFServerStream *stream, AVCodecContext *av,
/* compute default parameters */
switch(av->codec_type) {
case AVMEDIA_TYPE_AUDIO:
- if (!av_dict_get(recommended, "ab", NULL, 0)) {
+ if (!av_dict_get(recommended, "b", NULL, 0)) {
av->bit_rate = 64000;
- av_dict_set_int(&recommended, "ab", av->bit_rate, 0);
+ av_dict_set_int(&recommended, "b", av->bit_rate, 0);
WARNING("Setting default value for audio bit rate = %d. "
"Use NoDefaults to disable it.\n",
av->bit_rate);
@@ -923,7 +923,7 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd,
ffserver_get_arg(arg, sizeof(arg), p);
ffserver_set_float_param(&f, arg, 1000, -FLT_MAX, FLT_MAX, config,
"Invalid %s: '%s'\n", cmd, arg);
- if (ffserver_save_avoption_int("ab", (int64_t)lrintf(f),
+ if (ffserver_save_avoption_int("b", (int64_t)lrintf(f),
AV_OPT_FLAG_AUDIO_PARAM, config) < 0)
goto nomem;
} else if (!av_strcasecmp(cmd, "AudioChannels")) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/012v.c b/chromium/third_party/ffmpeg/libavcodec/012v.c
index b87551e0a56..b5a4066656e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/012v.c
+++ b/chromium/third_party/ffmpeg/libavcodec/012v.c
@@ -151,5 +151,5 @@ AVCodec ff_zero12v_decoder = {
.id = AV_CODEC_ID_012V,
.init = zero12v_decode_init,
.decode = zero12v_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/4xm.c b/chromium/third_party/ffmpeg/libavcodec/4xm.c
index 3a25622860b..a7a757a0784 100644
--- a/chromium/third_party/ffmpeg/libavcodec/4xm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/4xm.c
@@ -559,7 +559,7 @@ static inline void idct_put(FourXContext *f, int x, int y)
idct(block[i]);
}
- if (!(f->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(f->avctx->flags & AV_CODEC_FLAG_GRAY)) {
for (i = 4; i < 6; i++)
idct(block[i]);
}
@@ -883,11 +883,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
cfrm = &f->cfrm[i];
- if (data_size > UINT_MAX - cfrm->size - FF_INPUT_BUFFER_PADDING_SIZE)
+ if (data_size > UINT_MAX - cfrm->size - AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR_INVALIDDATA;
cfrm->data = av_fast_realloc(cfrm->data, &cfrm->allocated_size,
- cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ cfrm->size + data_size + AV_INPUT_BUFFER_PADDING_SIZE);
// explicit check needed as memcpy below might not catch a NULL
if (!cfrm->data) {
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
@@ -1026,5 +1026,5 @@ AVCodec ff_fourxm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/8bps.c b/chromium/third_party/ffmpeg/libavcodec/8bps.c
index e00bdfc8086..2e4464dbb4a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/8bps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/8bps.c
@@ -184,5 +184,5 @@ AVCodec ff_eightbps_decoder = {
.priv_data_size = sizeof(EightBpsContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/8svx.c b/chromium/third_party/ffmpeg/libavcodec/8svx.c
index 26496e506c7..edc945c6973 100644
--- a/chromium/third_party/ffmpeg/libavcodec/8svx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/8svx.c
@@ -194,7 +194,7 @@ AVCodec ff_eightsvx_fib_decoder = {
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
};
@@ -209,7 +209,7 @@ AVCodec ff_eightsvx_exp_decoder = {
.init = eightsvx_decode_init,
.decode = eightsvx_decode_frame,
.close = eightsvx_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/Makefile b/chromium/third_party/ffmpeg/libavcodec/Makefile
index 98af702de1e..23df723ce09 100644
--- a/chromium/third_party/ffmpeg/libavcodec/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/Makefile
@@ -7,12 +7,12 @@ HEADERS = avcodec.h \
dv_profile.h \
d3d11va.h \
dxva2.h \
- old_codec_ids.h \
qsv.h \
vaapi.h \
vda.h \
vdpau.h \
version.h \
+ videotoolbox.h \
vorbis_parser.h \
xvmc.h \
@@ -56,6 +56,7 @@ FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
fft_fixed_32.o fft_init_table.o \
$(FFT-OBJS-yes)
+OBJS-$(CONFIG_FLACDSP) += flacdsp.o
OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_H263DSP) += h263dsp.o
@@ -71,12 +72,14 @@ OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
OBJS-$(CONFIG_IIRFILTER) += iirfilter.o
OBJS-$(CONFIG_IMDCT15) += imdct15.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
+OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o
OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
OBJS-$(CONFIG_LPC) += lpc.o
OBJS-$(CONFIG_LSP) += lsp.o
+OBJS-$(CONFIG_LZF) += lzf.o
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
OBJS-$(CONFIG_ME_CMP) += me_cmp.o
OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
@@ -92,6 +95,7 @@ OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o mpegvideodsp.o rl.o \
OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
motion_est.o ratecontrol.o \
mpegvideoencdsp.o
+OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o
OBJS-$(CONFIG_NVENC) += nvenc.o
OBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
OBJS-$(CONFIG_QPELDSP) += qpeldsp.o
@@ -101,23 +105,36 @@ OBJS-$(CONFIG_QSVENC) += qsvenc.o
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
-OBJS-$(CONFIG_SHARED) += log2_tab.o
-OBJS-$(CONFIG_SINEWIN) += sinewin.o
+OBJS-$(CONFIG_RV34DSP) += rv34dsp.o
+OBJS-$(CONFIG_SHARED) += log2_tab.o reverse.o
+OBJS-$(CONFIG_SINEWIN) += sinewin.o sinewin_fixed.o
+OBJS-$(CONFIG_SNAPPY) += snappy.o
OBJS-$(CONFIG_STARTCODE) += startcode.o
+OBJS-$(CONFIG_TEXTUREDSP) += texturedsp.o
+OBJS-$(CONFIG_TEXTUREDSPENC) += texturedspenc.o
OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
+OBJS-$(CONFIG_VP56DSP) += vp56dsp.o
+OBJS-$(CONFIG_VP8DSP) += vp8dsp.o
OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o
+OBJS-$(CONFIG_WMV2DSP) += wmv2dsp.o
# decoders/encoders
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
-OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
+OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_float.o \
aacadtsdec.o mpeg4audio.o kbdwin.o \
- sbrdsp.o aacpsdsp.o
-OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
+ sbrdsp.o aacpsdsp_float.o
+OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_fixed.o \
+ aacadtsdec.o mpeg4audio.o kbdwin.o \
+ sbrdsp_fixed.o aacpsdsp_fixed.o
+OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \
aacpsy.o aactab.o \
+ aacenc_is.o \
+ aacenc_tns.o \
+ aacenc_pred.o \
psymodel.o mpeg4audio.o kbdwin.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o kbdwin.o
@@ -202,6 +219,7 @@ OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \
dcadata.o dca_exss.o \
dca_xll.o synth_filter.o
OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o dcadata.o
+OBJS-$(CONFIG_DDS_DECODER) += dds.o
OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \
dirac_arith.o mpeg12data.o dirac_dwt.o
OBJS-$(CONFIG_DFA_DECODER) += dfa.o
@@ -224,6 +242,7 @@ OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
+OBJS-$(CONFIG_DXV_DECODER) += dxv.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3_data.o
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o eac3_data.o
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
@@ -243,8 +262,8 @@ OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o
OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o
OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
OBJS-$(CONFIG_FIC_DECODER) += fic.o
-OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o flacdsp.o
-OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o flacdsp.o vorbis_data.o
+OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o
+OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_data.o
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
@@ -253,7 +272,7 @@ OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
-OBJS-$(CONFIG_G2M_DECODER) += g2meet.o
+OBJS-$(CONFIG_G2M_DECODER) += g2meet.o elsdec.o
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
celp_filters.o celp_math.o
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o acelp_vectors.o celp_math.o
@@ -268,18 +287,22 @@ OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
mpeg4video.o mpeg4videodec.o flvdec.o\
intelh263dec.o h263data.o
OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
- h263.o ituh263enc.o flvenc.o
+ h263.o h263data.o ituh263enc.o flvenc.o
OBJS-$(CONFIG_H264_DECODER) += h264.o h264_cabac.o h264_cavlc.o \
h264_direct.o h264_loopfilter.o \
h264_mb.o h264_picture.o h264_ps.o \
h264_refs.o h264_sei.o h264_slice.o
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
-OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h264.o
+OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h2645.o
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
+OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
+OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \
hevc_cabac.o hevc_refs.o hevcpred.o \
- hevcdsp.o hevc_filter.o
+ hevcdsp.o hevc_filter.o hevc_parse.o hevc_data.o
+OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec_h2645.o
+OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o hevc_parse.o
OBJS-$(CONFIG_HNM4_VIDEO_DECODER) += hnm4video.o
OBJS-$(CONFIG_HQ_HQA_DECODER) += hq_hqa.o hq_hqadata.o hq_hqadsp.o \
canopus.o
@@ -293,8 +316,8 @@ OBJS-$(CONFIG_IFF_ILBM_DECODER) += iff.o
OBJS-$(CONFIG_IMC_DECODER) += imc.o
OBJS-$(CONFIG_INDEO2_DECODER) += indeo2.o
OBJS-$(CONFIG_INDEO3_DECODER) += indeo3.o
-OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi.o ivi_dsp.o
-OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi.o ivi_dsp.o
+OBJS-$(CONFIG_INDEO4_DECODER) += indeo4.o ivi.o
+OBJS-$(CONFIG_INDEO5_DECODER) += indeo5.o ivi.o
OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER) += dpcm.o
OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o
@@ -346,6 +369,8 @@ OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
+OBJS-$(CONFIG_MPEG2_QSV_DECODER) += qsvdec_mpeg2.o
+OBJS-$(CONFIG_MPEG2_QSV_ENCODER) += qsvenc_mpeg2.o
OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
@@ -354,13 +379,13 @@ OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
-OBJS-$(CONFIG_MSA1_DECODER) += mss3.o mss34dsp.o
+OBJS-$(CONFIG_MSA1_DECODER) += mss3.o
OBJS-$(CONFIG_MSS1_DECODER) += mss1.o mss12.o
OBJS-$(CONFIG_MSS2_DECODER) += mss2.o mss12.o mss2dsp.o
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
OBJS-$(CONFIG_MSVIDEO1_ENCODER) += msvideo1enc.o elbg.o
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
-OBJS-$(CONFIG_MTS2_DECODER) += mss4.o mss34dsp.o
+OBJS-$(CONFIG_MTS2_DECODER) += mss4.o
OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o
@@ -424,9 +449,9 @@ OBJS-$(CONFIG_RV10_DECODER) += rv10.o
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
OBJS-$(CONFIG_RV20_DECODER) += rv10.o
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
-OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o
-OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o
-OBJS-$(CONFIG_SAMI_DECODER) += samidec.o ass.o
+OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o
+OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o
+OBJS-$(CONFIG_SAMI_DECODER) += samidec.o ass.o htmlsubtitles.o
OBJS-$(CONFIG_S302M_DECODER) += s302m.o
OBJS-$(CONFIG_S302M_ENCODER) += s302menc.o
OBJS-$(CONFIG_SANM_DECODER) += sanm.o
@@ -450,10 +475,10 @@ OBJS-$(CONFIG_SONIC_DECODER) += sonic.o
OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o
OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o
-OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o
+OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o htmlsubtitles.o
OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o
OBJS-$(CONFIG_STL_DECODER) += textdec.o ass.o
-OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o
+OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o htmlsubtitles.o
OBJS-$(CONFIG_SUBRIP_ENCODER) += srtenc.o ass_split.o
OBJS-$(CONFIG_SUBVIEWER1_DECODER) += textdec.o ass.o
OBJS-$(CONFIG_SUBVIEWER_DECODER) += subviewerdec.o ass.o
@@ -482,7 +507,7 @@ OBJS-$(CONFIG_TSCC2_DECODER) += tscc2.o
OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o
OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o
OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o
-OBJS-$(CONFIG_TXD_DECODER) += txd.o s3tc.o
+OBJS-$(CONFIG_TXD_DECODER) += txd.o
OBJS-$(CONFIG_ULTI_DECODER) += ulti.o
OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideo.o
OBJS-$(CONFIG_UTVIDEO_ENCODER) += utvideoenc.o utvideo.o
@@ -502,6 +527,7 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o
vc1dsp.o \
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
wmv2dsp.o
+OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec_vc1.o
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o
@@ -511,12 +537,11 @@ OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
vorbis_data.o
OBJS-$(CONFIG_VP3_DECODER) += vp3.o
-OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56dsp.o \
- vp56rac.o
-OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
+OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56rac.o
+OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
vp6dsp.o vp56rac.o
-OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8dsp.o vp56rac.o
-OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8dsp.o vp56rac.o
+OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o
+OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o
OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o vp9dsp_8bpp.o \
vp9dsp_10bpp.o vp9dsp_12bpp.o
OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
@@ -538,9 +563,9 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
acelp_vectors.o acelp_filters.o
OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o
-OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2dsp.o \
+OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o \
msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2dsp.o \
+OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
msmpeg4.o msmpeg4enc.o msmpeg4data.o
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o
@@ -670,33 +695,40 @@ OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
-OBJS-$(CONFIG_VIMA_DECODER) += vima.o adpcm_data.o
# hardware accelerators
OBJS-$(CONFIG_D3D11VA) += dxva2.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
OBJS-$(CONFIG_VAAPI) += vaapi.o
-OBJS-$(CONFIG_VDA) += vda.o
+OBJS-$(CONFIG_VDA) += vda.o videotoolbox.o
+OBJS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.o
OBJS-$(CONFIG_VDPAU) += vdpau.o
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
+OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_H264_D3D11VA_HWACCEL) += dxva2_h264.o
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
OBJS-$(CONFIG_H264_VDA_HWACCEL) += vda_h264.o
OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
+OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
+OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
+OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
+OBJS-$(CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG2_D3D11VA_HWACCEL) += dxva2_mpeg2.o
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
+OBJS-$(CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_MPEG2_XVMC_HWACCEL) += mpegvideo_xvmc.o
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
+OBJS-$(CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_VC1_D3D11VA_HWACCEL) += dxva2_vc1.o
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
@@ -704,6 +736,7 @@ OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
# libavformat dependencies
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
+OBJS-$(CONFIG_AVI_DEMUXER) += mpeg4audio.o mpegaudiodata.o
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
ac3tab.o
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o
@@ -757,6 +790,7 @@ OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsmdec.o
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsmenc.o
OBJS-$(CONFIG_LIBILBC_DECODER) += libilbc.o
OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
+OBJS-$(CONFIG_LIBKVAZAAR_ENCODER) += libkvazaar.o
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
@@ -792,6 +826,7 @@ OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.o libwebpenc.o
OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_animencoder.o
+OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
OBJS-$(CONFIG_LIBX265_ENCODER) += libx265.o
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
@@ -817,16 +852,17 @@ OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
vorbis_data.o
+OBJS-$(CONFIG_G729_PARSER) += g729_parser.o
OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o
-OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o
+OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_parse.o hevc_ps.o hevc_data.o
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
mpeg4videodec.o mpeg4video.o \
- ituh263dec.o h263dec.o
+ ituh263dec.o h263dec.o h263data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
mpegaudiodecheader.o mpegaudiodata.o
@@ -849,6 +885,7 @@ OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o aacadtsdec.o \
OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o
OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.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
OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o
@@ -873,8 +910,6 @@ SKIPHEADERS += %_tablegen.h \
%_tables.h \
aac_tablegen_decl.h \
fft-internal.h \
- libutvideo.h \
- old_codec_ids.h \
tableprint.h \
tableprint_vlc.h \
$(ARCH)/vp56_arith.h \
@@ -883,21 +918,23 @@ SKIPHEADERS-$(CONFIG_D3D11VA) += d3d11va.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h
SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER) += libschroedinger.h
SKIPHEADERS-$(CONFIG_LIBUTVIDEO) += libutvideo.h
+SKIPHEADERS-$(CONFIG_LIBVPX) += libvpx.h
+SKIPHEADERS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.h
SKIPHEADERS-$(CONFIG_QSV) += qsv.h qsv_internal.h
SKIPHEADERS-$(CONFIG_QSVDEC) += qsvdec.h
SKIPHEADERS-$(CONFIG_QSVENC) += qsvenc.h
SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
-SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_internal.h
+SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_vt_internal.h
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
+SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vda_vt_internal.h
TESTPROGS = imgconvert \
+ jpeg2000dwt \
mathops \
options \
avfft \
-TESTPROGS += api-flac
-
TESTPROGS-$(CONFIG_CABAC) += cabac
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed fft-fixed32
TESTPROGS-$(CONFIG_IDCTDSP) += dct
@@ -913,9 +950,12 @@ TOOLS = fourcc2pixfmt
HOSTPROGS = aac_tablegen \
aacps_tablegen \
+ aacps_fixed_tablegen \
aacsbr_tablegen \
+ aacsbr_fixed_tablegen \
cabac_tablegen \
cbrt_tablegen \
+ cbrt_fixed_tablegen \
cos_tablegen \
dsd_tablegen \
dv_tablegen \
@@ -924,6 +964,7 @@ HOSTPROGS = aac_tablegen \
pcm_tablegen \
qdm2_tablegen \
sinewin_tablegen \
+ sinewin_fixed_tablegen \
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
@@ -942,8 +983,9 @@ else
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
endif
-GEN_HEADERS = cabac_tables.h cbrt_tables.h aacps_tables.h aacsbr_tables.h aac_tables.h dsd_tables.h dv_tables.h \
- sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
+GEN_HEADERS = cabac_tables.h cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h aacps_fixed_tables.h aacsbr_tables.h \
+ aacsbr_fixed_tables.h aac_tables.h dsd_tables.h dv_tables.h \
+ sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h motionpixels_tables.h \
pcm_tables.h qdm2_tables.h
GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
@@ -952,13 +994,18 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
ifdef CONFIG_HARDCODED_TABLES
$(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
-$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
+$(SUBDIR)aacdec_fixed.o: $(SUBDIR)cbrt_fixed_tables.h
+$(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h
+$(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h
$(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
+$(SUBDIR)aacsbr_fixed.o: $(SUBDIR)aacsbr_fixed_tables.h
$(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
+$(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h
$(SUBDIR)cabac.o: $(SUBDIR)cabac_tables.h
$(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
+$(SUBDIR)sinewin_fixed.o: $(SUBDIR)sinewin_fixed_tables.h
$(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h
$(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h
$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
diff --git a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
index f9c4f36e7d0..91aac0933f1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
@@ -66,7 +66,8 @@ static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
-static void to_meta_with_crop(AVCodecContext *avctx, const AVFrame *p, int *dest)
+static void to_meta_with_crop(AVCodecContext *avctx,
+ const AVFrame *p, int *dest)
{
int blockx, blocky, x, y;
int luma = 0;
@@ -234,7 +235,7 @@ static av_cold int a64multi_encode_init(AVCodecContext *avctx)
}
/* set up extradata */
- if (!(avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE))) {
+ if (!(avctx->extradata = av_mallocz(8 * 4 + AV_INPUT_BUFFER_PADDING_SIZE))) {
av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n");
return AVERROR(ENOMEM);
}
@@ -327,7 +328,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* any frames to encode? */
if (c->mc_lifetime) {
int alloc_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
- if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size, 0)) < 0)
return ret;
buf = pkt->data;
@@ -405,7 +406,7 @@ AVCodec ff_a64multi_encoder = {
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
};
#endif
#if CONFIG_A64MULTI5_ENCODER
@@ -419,6 +420,6 @@ AVCodec ff_a64multi5_encoder = {
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac.h b/chromium/third_party/ffmpeg/libavcodec/aac.h
index 23ec085d8e0..17af49c7666 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aac.h
@@ -30,9 +30,14 @@
#ifndef AVCODEC_AAC_H
#define AVCODEC_AAC_H
+
+#include "aac_defines.h"
#include "libavutil/float_dsp.h"
+#include "libavutil/fixed_dsp.h"
#include "avcodec.h"
+#if !USE_FIXED
#include "imdct15.h"
+#endif
#include "fft.h"
#include "mpeg4audio.h"
#include "sbr.h"
@@ -45,6 +50,8 @@
#define TNS_MAX_ORDER 20
#define MAX_LTP_LONG_SFB 40
+#define CLIP_AVOIDANCE_FACTOR 0.95f
+
enum RawDataBlockType {
TYPE_SCE,
TYPE_CPE,
@@ -76,9 +83,10 @@ enum BandType {
ZERO_BT = 0, ///< Scalefactors and spectral data are all zero.
FIRST_PAIR_BT = 5, ///< This and later band types encode two values (rather than four) with one code word.
ESC_BT = 11, ///< Spectral data are coded with an escape sequence.
+ RESERVED_BT = 12, ///< Band types following are encoded differently from others.
NOISE_BT = 13, ///< Spectral data are scaled white noise not coded in the bitstream.
- INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions.
- INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
+ INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions (out of phase).
+ INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions (in phase).
};
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
@@ -125,12 +133,14 @@ typedef struct OutputConfiguration {
* Predictor State
*/
typedef struct PredictorState {
- float cor0;
- float cor1;
- float var0;
- float var1;
- float r0;
- float r1;
+ AAC_FLOAT cor0;
+ AAC_FLOAT cor1;
+ AAC_FLOAT var0;
+ AAC_FLOAT var1;
+ AAC_FLOAT r0;
+ AAC_FLOAT r1;
+ AAC_FLOAT k1;
+ AAC_FLOAT x_est;
} PredictorState;
#define MAX_PREDICTORS 672
@@ -151,7 +161,7 @@ typedef struct PredictorState {
typedef struct LongTermPrediction {
int8_t present;
int16_t lag;
- float coef;
+ INTFLOAT coef;
int8_t used[MAX_LTP_LONG_SFB];
} LongTermPrediction;
@@ -173,7 +183,10 @@ typedef struct IndividualChannelStream {
int predictor_present;
int predictor_initialized;
int predictor_reset_group;
+ int predictor_reset_count[31]; ///< used by encoder to count prediction resets
uint8_t prediction_used[41];
+ uint8_t window_clipping[8]; ///< set if a certain window is near clipping
+ float clip_avoidance_factor; ///< set if any window is near clipping to the necessary atennuation factor to avoid it
} IndividualChannelStream;
/**
@@ -185,7 +198,8 @@ typedef struct TemporalNoiseShaping {
int length[8][4];
int direction[8][4];
int order[8][4];
- float coef[8][4][TNS_MAX_ORDER];
+ int coef_idx[8][4][TNS_MAX_ORDER];
+ INTFLOAT coef[8][4][TNS_MAX_ORDER];
} TemporalNoiseShaping;
/**
@@ -222,7 +236,7 @@ typedef struct ChannelCoupling {
int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel;
* [2] list of gains for left channel; [3] lists of gains for both channels
*/
- float gain[16][120];
+ INTFLOAT gain[16][120];
} ChannelCoupling;
/**
@@ -233,17 +247,21 @@ typedef struct SingleChannelElement {
TemporalNoiseShaping tns;
Pulse pulse;
enum BandType band_type[128]; ///< band types
+ enum BandType band_alt[128]; ///< alternative band type (used by encoder)
int band_type_run_end[120]; ///< band type run end points
- float sf[120]; ///< scalefactors
+ INTFLOAT sf[120]; ///< scalefactors
int sf_idx[128]; ///< scalefactor indices (used by encoder)
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
- DECLARE_ALIGNED(32, float, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
- DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed
- DECLARE_ALIGNED(32, float, saved)[1536]; ///< overlap
- DECLARE_ALIGNED(32, float, ret_buf)[2048]; ///< PCM output buffer
- DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP
+ float is_ener[128]; ///< Intensity stereo pos (used by encoder)
+ float pns_ener[128]; ///< Noise energy values (used by encoder)
+ DECLARE_ALIGNED(32, INTFLOAT, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
+ DECLARE_ALIGNED(32, INTFLOAT, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed
+ DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
+ DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
+ DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
+ DECLARE_ALIGNED(32, AAC_FLOAT, prcoeffs)[1024]; ///< Main prediction coefs (used by encoder)
PredictorState predictor_state[MAX_PREDICTORS];
- float *ret; ///< PCM output
+ INTFLOAT *ret; ///< PCM output
} SingleChannelElement;
/**
@@ -254,7 +272,9 @@ typedef struct ChannelElement {
// CPE specific
int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)
+ uint8_t is_mode; ///< Set if any bands have been encoded using intensity stereo (used by encoder)
uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
+ uint8_t is_mask[128]; ///< Set if intensity stereo is used (used by encoder)
// shared
SingleChannelElement ch[2];
// CCE specific
@@ -288,7 +308,7 @@ struct AACContext {
* (We do not want to have these on the stack.)
* @{
*/
- DECLARE_ALIGNED(32, float, buf_mdct)[1024];
+ DECLARE_ALIGNED(32, INTFLOAT, buf_mdct)[1024];
/** @} */
/**
@@ -299,8 +319,12 @@ struct AACContext {
FFTContext mdct_small;
FFTContext mdct_ld;
FFTContext mdct_ltp;
+#if USE_FIXED
+ AVFixedDSPContext *fdsp;
+#else
IMDCT15Context *mdct480;
AVFloatDSPContext *fdsp;
+#endif /* USE_FIXED */
int random_state;
/** @} */
@@ -320,7 +344,7 @@ struct AACContext {
int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel
/** @} */
- DECLARE_ALIGNED(32, float, temp)[128];
+ DECLARE_ALIGNED(32, INTFLOAT, temp)[128];
OutputConfiguration oc[2];
int warned_num_aac_frames;
@@ -328,11 +352,13 @@ struct AACContext {
/* aacdec functions pointers */
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
- void (*apply_tns)(float coef[1024], TemporalNoiseShaping *tns,
+ void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns,
IndividualChannelStream *ics, int decode);
- void (*windowing_and_mdct_ltp)(AACContext *ac, float *out,
- float *in, IndividualChannelStream *ics);
+ void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out,
+ INTFLOAT *in, IndividualChannelStream *ics);
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
+ void (*vector_pow43)(int *coefs, int len);
+ void (*subband_scale)(int *dst, int *src, int scale, int offset, int len);
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_ac3_parser.c b/chromium/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
index 7fefda5ce9f..2f7d56807c2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
@@ -84,14 +84,6 @@ get_next:
avctx->sample_rate = s->sample_rate;
/* (E-)AC-3: allow downmixing to stereo or mono */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->request_channels == 1)
- avctx->request_channel_layout = AV_CH_LAYOUT_MONO;
- else if (avctx->request_channels == 2)
- avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (s->channels > 1 &&
avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
avctx->channels = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c b/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
index 1f11d024991..9c117c60054 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_adtstoasc_bsf.c
@@ -89,7 +89,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
}
av_free(avctx->extradata);
avctx->extradata_size = 2 + pce_size;
- avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
avctx->extradata_size = 0;
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_defines.h b/chromium/third_party/ffmpeg/libavcodec/aac_defines.h
new file mode 100644
index 00000000000..3c45742ee1f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_defines.h
@@ -0,0 +1,114 @@
+/*
+ * AAC defines
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AAC_DEFINES_H
+#define AVCODEC_AAC_DEFINES_H
+
+#ifndef USE_FIXED
+#define USE_FIXED 0
+#endif
+
+#if USE_FIXED
+
+#include "libavutil/softfloat.h"
+
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 1
+
+#define AAC_RENAME(x) x ## _fixed
+#define AAC_RENAME_32(x) x ## _fixed_32
+#define INTFLOAT int
+#define INT64FLOAT int64_t
+#define SHORTFLOAT int16_t
+#define AAC_FLOAT SoftFloat
+#define AAC_SIGNE int
+#define FIXR(a) ((int)((a) * 1 + 0.5))
+#define FIXR10(a) ((int)((a) * 1024.0 + 0.5))
+#define Q23(a) (int)((a) * 8388608.0 + 0.5)
+#define Q30(x) (int)((x)*1073741824.0 + 0.5)
+#define Q31(x) (int)((x)*2147483648.0 + 0.5)
+#define RANGE15(x) x
+#define GET_GAIN(x, y) (-(y) << (x)) + 1024
+#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)
+#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)
+#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)
+#define AAC_MUL31(x, y) (int)(((int64_t)(x) * (y) + 0x40000000) >> 31)
+#define AAC_MADD28(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
+ ((int64_t)(a) * (b)) + \
+ 0x8000000) >> 28)
+#define AAC_MADD30(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
+ ((int64_t)(a) * (b)) + \
+ 0x20000000) >> 30)
+#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
+ ((int64_t)(a) * (b)) + \
+ ((int64_t)(c) * (d)) + \
+ ((int64_t)(e) * (f)) + \
+ 0x20000000) >> 30)
+#define AAC_MSUB30(x, y, a, b) (int)((((int64_t)(x) * (y)) - \
+ ((int64_t)(a) * (b)) + \
+ 0x20000000) >> 30)
+#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
+ ((int64_t)(a) * (b)) - \
+ ((int64_t)(c) * (d)) - \
+ ((int64_t)(e) * (f)) + \
+ 0x20000000) >> 30)
+#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \
+ ((int64_t)(y) * (z)) + \
+ 0x40000000) >> 31)
+#define AAC_HALF_SUM(x, y) (x) >> 1 + (y) >> 1
+#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
+
+#else
+
+#define FFT_FLOAT 1
+#define FFT_FIXED_32 0
+
+#define AAC_RENAME(x) x
+#define AAC_RENAME_32(x) x
+#define INTFLOAT float
+#define INT64FLOAT float
+#define SHORTFLOAT float
+#define AAC_FLOAT float
+#define AAC_SIGNE unsigned
+#define FIXR(x) ((float)(x))
+#define FIXR10(x) ((float)(x))
+#define Q23(x) x
+#define Q30(x) x
+#define Q31(x) x
+#define RANGE15(x) (32768.0 * (x))
+#define GET_GAIN(x, y) powf((x), -(y))
+#define AAC_MUL16(x, y) ((x) * (y))
+#define AAC_MUL26(x, y) ((x) * (y))
+#define AAC_MUL30(x, y) ((x) * (y))
+#define AAC_MUL31(x, y) ((x) * (y))
+#define AAC_MADD28(x, y, a, b) ((x) * (y) + (a) * (b))
+#define AAC_MADD30(x, y, a, b) ((x) * (y) + (a) * (b))
+#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) + \
+ (c) * (d) + (e) * (f))
+#define AAC_MSUB30(x, y, a, b) ((x) * (y) - (a) * (b))
+#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) - \
+ (c) * (d) - (e) * (f))
+#define AAC_MSUB31_V3(x, y, z) ((x) - (y)) * (z)
+#define AAC_HALF_SUM(x, y) ((x) + (y)) * 0.5f
+#define AAC_SRA_R(x, y) (x)
+
+#endif /* USE_FIXED */
+
+#endif /* AVCODEC_AAC_DEFINES_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_parser.c b/chromium/third_party/ffmpeg/libavcodec/aac_parser.c
index cb93ba94827..0b868edcb25 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_parser.c
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size;
union {
uint64_t u64;
- uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
} tmp;
tmp.u64 = av_be2ne64(state);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.c
index 33a179f51e9..2d13211d45f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.c
@@ -33,5 +33,7 @@ int main(void)
WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);
+ WRITE_ARRAY("const", float, ff_aac_pow34sf_tab);
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.h
index bf71e59cb5a..8b223f972eb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen.h
@@ -30,12 +30,15 @@
#else
#include "libavutil/mathematics.h"
float ff_aac_pow2sf_tab[428];
+float ff_aac_pow34sf_tab[428];
av_cold void ff_aac_tableinit(void)
{
int i;
- for (i = 0; i < 428; i++)
+ for (i = 0; i < 428; i++) {
ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
+ ff_aac_pow34sf_tab[i] = pow(ff_aac_pow2sf_tab[i], 3.0/4.0);
+ }
}
#endif /* CONFIG_HARDCODED_TABLES */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen_decl.h b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen_decl.h
index 5105dae4838..ef86f85e1fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aac_tablegen_decl.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aac_tablegen_decl.h
@@ -28,9 +28,11 @@
#if CONFIG_HARDCODED_TABLES
#define ff_aac_tableinit()
extern const float ff_aac_pow2sf_tab[428];
+extern const float ff_aac_pow34sf_tab[428];
#else
void ff_aac_tableinit(void);
extern float ff_aac_pow2sf_tab[428];
+extern float ff_aac_pow34sf_tab[428];
#endif /* CONFIG_HARDCODED_TABLES */
#endif /* AVCODEC_AAC_TABLEGEN_DECL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aaccoder.c b/chromium/third_party/ffmpeg/libavcodec/aaccoder.c
index 2929f3ac443..524987df0b4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aaccoder.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aaccoder.c
@@ -39,290 +39,25 @@
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
+#include "aacenctab.h"
+#include "aacenc_utils.h"
+#include "aacenc_quantization.h"
+#include "aac_tablegen_decl.h"
+
+#include "aacenc_is.h"
+#include "aacenc_tns.h"
+#include "aacenc_pred.h"
/** Frequency in Hz for lower limit of noise substitution **/
#define NOISE_LOW_LIMIT 4000
-/** Total number of usable codebooks **/
-#define CB_TOT 13
-
-/** bits needed to code codebook run value for long windows */
-static const uint8_t run_value_bits_long[64] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
-};
-
-/** bits needed to code codebook run value for short windows */
-static const uint8_t run_value_bits_short[16] = {
- 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
-};
-
-static const uint8_t * const run_value_bits[2] = {
- run_value_bits_long, run_value_bits_short
-};
-
-/** Map to convert values from BandCodingPath index to a codebook index **/
-static const uint8_t aac_cb_out_map[CB_TOT] = {0,1,2,3,4,5,6,7,8,9,10,11,13};
-/** Inverse map to convert from codebooks to BandCodingPath indices **/
-static const uint8_t aac_cb_in_map[CB_TOT+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12};
-
-/**
- * Quantize one coefficient.
- * @return absolute value of the quantized coefficient
- * @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
- */
-static av_always_inline int quant(float coef, const float Q)
-{
- float a = coef * Q;
- return sqrtf(a * sqrtf(a)) + 0.4054;
-}
-
-static void quantize_bands(int *out, const float *in, const float *scaled,
- int size, float Q34, int is_signed, int maxval)
-{
- int i;
- double qc;
- for (i = 0; i < size; i++) {
- qc = scaled[i] * Q34;
- out[i] = (int)FFMIN(qc + 0.4054, (double)maxval);
- if (is_signed && in[i] < 0.0f) {
- out[i] = -out[i];
- }
- }
-}
-
-static void abs_pow34_v(float *out, const float *in, const int size)
-{
-#ifndef USE_REALLY_FULL_SEARCH
- int i;
- for (i = 0; i < size; i++) {
- float a = fabsf(in[i]);
- out[i] = sqrtf(a * sqrtf(a));
- }
-#endif /* USE_REALLY_FULL_SEARCH */
-}
-
-static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
-static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
-
-/**
- * Calculate rate distortion cost for quantizing with given codebook
- *
- * @return quantization distortion
- */
-static av_always_inline float quantize_and_encode_band_cost_template(
- struct AACEncContext *s,
- PutBitContext *pb, const float *in,
- const float *scaled, int size, int scale_idx,
- int cb, const float lambda, const float uplim,
- int *bits, int BT_ZERO, int BT_UNSIGNED,
- int BT_PAIR, int BT_ESC, int BT_NOISE)
-{
- const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
- const float Q = ff_aac_pow2sf_tab [q_idx];
- const float Q34 = ff_aac_pow34sf_tab[q_idx];
- const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
- const float CLIPPED_ESCAPE = 165140.0f*IQ;
- int i, j;
- float cost = 0;
- const int dim = BT_PAIR ? 2 : 4;
- int resbits = 0;
- int off;
-
- if (BT_ZERO) {
- for (i = 0; i < size; i++)
- cost += in[i]*in[i];
- if (bits)
- *bits = 0;
- return cost * lambda;
- }
- if (BT_NOISE) {
- for (i = 0; i < size; i++)
- cost += in[i]*in[i];
- if (bits)
- *bits = 0;
- return cost * lambda;
- }
- if (!scaled) {
- abs_pow34_v(s->scoefs, in, size);
- scaled = s->scoefs;
- }
- quantize_bands(s->qcoefs, in, scaled, size, Q34, !BT_UNSIGNED, aac_cb_maxval[cb]);
- if (BT_UNSIGNED) {
- off = 0;
- } else {
- off = aac_cb_maxval[cb];
- }
- for (i = 0; i < size; i += dim) {
- const float *vec;
- int *quants = s->qcoefs + i;
- int curidx = 0;
- int curbits;
- float rd = 0.0f;
- for (j = 0; j < dim; j++) {
- curidx *= aac_cb_range[cb];
- curidx += quants[j] + off;
- }
- curbits = ff_aac_spectral_bits[cb-1][curidx];
- vec = &ff_aac_codebook_vectors[cb-1][curidx*dim];
- if (BT_UNSIGNED) {
- for (j = 0; j < dim; j++) {
- float t = fabsf(in[i+j]);
- float di;
- if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow
- if (t >= CLIPPED_ESCAPE) {
- di = t - CLIPPED_ESCAPE;
- curbits += 21;
- } else {
- int c = av_clip_uintp2(quant(t, Q), 13);
- di = t - c*cbrtf(c)*IQ;
- curbits += av_log2(c)*2 - 4 + 1;
- }
- } else {
- di = t - vec[j]*IQ;
- }
- if (vec[j] != 0.0f)
- curbits++;
- rd += di*di;
- }
- } else {
- for (j = 0; j < dim; j++) {
- float di = in[i+j] - vec[j]*IQ;
- rd += di*di;
- }
- }
- cost += rd * lambda + curbits;
- resbits += curbits;
- if (cost >= uplim)
- return uplim;
- if (pb) {
- put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]);
- if (BT_UNSIGNED)
- for (j = 0; j < dim; j++)
- if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f)
- put_bits(pb, 1, in[i+j] < 0.0f);
- if (BT_ESC) {
- for (j = 0; j < 2; j++) {
- if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
- int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q), 13);
- int len = av_log2(coef);
-
- put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
- put_sbits(pb, len, coef);
- }
- }
- }
- }
- }
-
- if (bits)
- *bits = resbits;
- return cost;
-}
-
-static float quantize_and_encode_band_cost_NONE(struct AACEncContext *s, PutBitContext *pb,
- const float *in, const float *scaled,
- int size, int scale_idx, int cb,
- const float lambda, const float uplim,
- int *bits) {
- av_assert0(0);
- return 0.0f;
-}
-
-#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE) \
-static float quantize_and_encode_band_cost_ ## NAME( \
- struct AACEncContext *s, \
- PutBitContext *pb, const float *in, \
- const float *scaled, int size, int scale_idx, \
- int cb, const float lambda, const float uplim, \
- int *bits) { \
- return quantize_and_encode_band_cost_template( \
- s, pb, in, scaled, size, scale_idx, \
- BT_ESC ? ESC_BT : cb, lambda, uplim, bits, \
- BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE); \
-}
-
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO, 1, 0, 0, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC, 0, 1, 1, 1, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NOISE, 0, 0, 0, 0, 1)
-
-static float (*const quantize_and_encode_band_cost_arr[])(
- struct AACEncContext *s,
- PutBitContext *pb, const float *in,
- const float *scaled, int size, int scale_idx,
- int cb, const float lambda, const float uplim,
- int *bits) = {
- quantize_and_encode_band_cost_ZERO,
- quantize_and_encode_band_cost_SQUAD,
- quantize_and_encode_band_cost_SQUAD,
- quantize_and_encode_band_cost_UQUAD,
- quantize_and_encode_band_cost_UQUAD,
- quantize_and_encode_band_cost_SPAIR,
- quantize_and_encode_band_cost_SPAIR,
- quantize_and_encode_band_cost_UPAIR,
- quantize_and_encode_band_cost_UPAIR,
- quantize_and_encode_band_cost_UPAIR,
- quantize_and_encode_band_cost_UPAIR,
- quantize_and_encode_band_cost_ESC,
- quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */
- quantize_and_encode_band_cost_NOISE,
-};
-
-#define quantize_and_encode_band_cost( \
- s, pb, in, scaled, size, scale_idx, cb, \
- lambda, uplim, bits) \
- quantize_and_encode_band_cost_arr[cb]( \
- s, pb, in, scaled, size, scale_idx, cb, \
- lambda, uplim, bits)
-
-static float quantize_band_cost(struct AACEncContext *s, const float *in,
- const float *scaled, int size, int scale_idx,
- int cb, const float lambda, const float uplim,
- int *bits)
-{
- return quantize_and_encode_band_cost(s, NULL, in, scaled, size, scale_idx,
- cb, lambda, uplim, bits);
-}
-
-static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,
- const float *in, int size, int scale_idx,
- int cb, const float lambda)
-{
- quantize_and_encode_band_cost(s, pb, in, NULL, size, scale_idx, cb, lambda,
- INFINITY, NULL);
-}
-
-static float find_max_val(int group_len, int swb_size, const float *scaled) {
- float maxval = 0.0f;
- int w2, i;
- for (w2 = 0; w2 < group_len; w2++) {
- for (i = 0; i < swb_size; i++) {
- maxval = FFMAX(maxval, scaled[w2*128+i]);
- }
- }
- return maxval;
-}
+/* Parameter of f(x) = a*(lambda/100), defines the maximum fourier spread
+ * beyond which no PNS is used (since the SFBs contain tone rather than noise) */
+#define NOISE_SPREAD_THRESHOLD 0.5073f
-static int find_min_book(float maxval, int sf) {
- float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
- float Q34 = sqrtf(Q * sqrtf(Q));
- int qmaxval, cb;
- qmaxval = maxval * Q34 + 0.4054f;
- if (qmaxval == 0) cb = 0;
- else if (qmaxval == 1) cb = 1;
- else if (qmaxval == 2) cb = 3;
- else if (qmaxval <= 4) cb = 5;
- else if (qmaxval <= 7) cb = 7;
- else if (qmaxval <= 12) cb = 9;
- else cb = 11;
- return cb;
-}
+/* Parameter of f(x) = a*(100/lambda), defines how much PNS is allowed to
+ * replace low energy non zero bands */
+#define NOISE_LAMBDA_REPLACE 1.948f
/**
* structure used in optimal codebook search
@@ -339,7 +74,7 @@ typedef struct BandCodingPath {
static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
- BandCodingPath path[120][CB_TOT];
+ BandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
@@ -352,7 +87,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
start = win*128;
- for (cb = 0; cb < CB_TOT; cb++) {
+ for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[0][cb].cost = 0.0f;
path[0][cb].prev_idx = -1;
path[0][cb].run = 0;
@@ -360,7 +95,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
for (swb = 0; swb < max_sfb; swb++) {
size = sce->ics.swb_sizes[swb];
if (sce->zeroes[win*16 + swb]) {
- for (cb = 0; cb < CB_TOT; cb++) {
+ for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[swb+1][cb].prev_idx = cb;
path[swb+1][cb].cost = path[swb][cb].cost;
path[swb+1][cb].run = path[swb][cb].run + 1;
@@ -370,15 +105,22 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
int mincb = next_mincb;
next_minrd = INFINITY;
next_mincb = 0;
- for (cb = 0; cb < CB_TOT; cb++) {
+ for (cb = 0; cb < CB_TOT_ALL; cb++) {
float cost_stay_here, cost_get_here;
float rd = 0.0f;
+ if (cb >= 12 && sce->band_type[win*16+swb] < aac_cb_out_map[cb] ||
+ cb < aac_cb_in_map[sce->band_type[win*16+swb]] && sce->band_type[win*16+swb] > aac_cb_out_map[cb]) {
+ path[swb+1][cb].prev_idx = -1;
+ path[swb+1][cb].cost = INFINITY;
+ path[swb+1][cb].run = path[swb][cb].run + 1;
+ continue;
+ }
for (w = 0; w < group_len; w++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
- rd += quantize_band_cost(s, sce->coeffs + start + w*128,
- s->scoefs + start + w*128, size,
+ rd += quantize_band_cost(s, &sce->coeffs[start + w*128],
+ &s->scoefs[start + w*128], size,
sce->sf_idx[(win+w)*16+swb], aac_cb_out_map[cb],
- lambda / band->threshold, INFINITY, NULL);
+ lambda / band->threshold, INFINITY, NULL, 0);
}
cost_stay_here = path[swb][cb].cost + rd;
cost_get_here = minrd + rd + run_bits + 4;
@@ -406,11 +148,12 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
//convert resulting path from backward-linked list
stack_len = 0;
idx = 0;
- for (cb = 1; cb < CB_TOT; cb++)
+ for (cb = 1; cb < CB_TOT_ALL; cb++)
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
idx = cb;
ppos = max_sfb;
while (ppos > 0) {
+ av_assert1(idx >= 0);
cb = idx;
stackrun[stack_len] = path[ppos][cb].run;
stackcb [stack_len] = cb;
@@ -441,7 +184,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
- BandCodingPath path[120][CB_TOT];
+ BandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
@@ -454,7 +197,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
start = win*128;
- for (cb = 0; cb < CB_TOT; cb++) {
+ for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[0][cb].cost = run_bits+4;
path[0][cb].prev_idx = -1;
path[0][cb].run = 0;
@@ -478,7 +221,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
}
next_minbits = path[swb+1][0].cost;
next_mincb = 0;
- for (cb = 1; cb < CB_TOT; cb++) {
+ for (cb = 1; cb < CB_TOT_ALL; cb++) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
@@ -495,21 +238,21 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
}
- for (cb = startcb; cb < CB_TOT; cb++) {
+ for (cb = startcb; cb < CB_TOT_ALL; cb++) {
float cost_stay_here, cost_get_here;
float bits = 0.0f;
- if (cb == 12 && sce->band_type[win*16+swb] != NOISE_BT) {
+ if (cb >= 12 && sce->band_type[win*16+swb] != aac_cb_out_map[cb]) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
continue;
}
for (w = 0; w < group_len; w++) {
- bits += quantize_band_cost(s, sce->coeffs + start + w*128,
- s->scoefs + start + w*128, size,
- sce->sf_idx[(win+w)*16+swb],
+ bits += quantize_band_cost(s, &sce->coeffs[start + w*128],
+ &s->scoefs[start + w*128], size,
+ sce->sf_idx[win*16+swb],
aac_cb_out_map[cb],
- 0, INFINITY, NULL);
+ 0, INFINITY, NULL, 0);
}
cost_stay_here = path[swb][cb].cost + bits;
cost_get_here = minbits + bits + run_bits + 4;
@@ -537,7 +280,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
//convert resulting path from backward-linked list
stack_len = 0;
idx = 0;
- for (cb = 1; cb < CB_TOT; cb++)
+ for (cb = 1; cb < CB_TOT_ALL; cb++)
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
idx = cb;
ppos = max_sfb;
@@ -570,16 +313,6 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
}
}
-/** Return the minimum scalefactor where the quantized coef does not clip. */
-static av_always_inline uint8_t coef2minsf(float coef) {
- return av_clip_uint8(log2f(coef)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512);
-}
-
-/** Return the maximum scalefactor where the quantized coef is not zero. */
-static av_always_inline uint8_t coef2maxsf(float coef) {
- return av_clip_uint8(log2f(coef)*4 + 6 + SCALE_ONE_POS - SCALE_DIV_512);
-}
-
typedef struct TrellisPath {
float cost;
int prev;
@@ -588,6 +321,43 @@ typedef struct TrellisPath {
#define TRELLIS_STAGES 121
#define TRELLIS_STATES (SCALE_MAX_DIFF+1)
+static void set_special_band_scalefactors(AACEncContext *s, SingleChannelElement *sce)
+{
+ int w, g, start = 0;
+ int minscaler_n = sce->sf_idx[0], minscaler_i = sce->sf_idx[0];
+ int bands = 0;
+
+ for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
+ start = 0;
+ for (g = 0; g < sce->ics.num_swb; g++) {
+ if (sce->band_type[w*16+g] == INTENSITY_BT || sce->band_type[w*16+g] == INTENSITY_BT2) {
+ sce->sf_idx[w*16+g] = av_clip(roundf(log2f(sce->is_ener[w*16+g])*2), -155, 100);
+ minscaler_i = FFMIN(minscaler_i, sce->sf_idx[w*16+g]);
+ bands++;
+ } else if (sce->band_type[w*16+g] == NOISE_BT) {
+ sce->sf_idx[w*16+g] = av_clip(3+ceilf(log2f(sce->pns_ener[w*16+g])*2), -100, 155);
+ minscaler_n = FFMIN(minscaler_n, sce->sf_idx[w*16+g]);
+ bands++;
+ }
+ start += sce->ics.swb_sizes[g];
+ }
+ }
+
+ if (!bands)
+ return;
+
+ /* Clip the scalefactor indices */
+ for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
+ for (g = 0; g < sce->ics.num_swb; g++) {
+ if (sce->band_type[w*16+g] == INTENSITY_BT || sce->band_type[w*16+g] == INTENSITY_BT2) {
+ sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler_i, minscaler_i + SCALE_MAX_DIFF);
+ } else if (sce->band_type[w*16+g] == NOISE_BT) {
+ sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler_n, minscaler_n + SCALE_MAX_DIFF);
+ }
+ }
+ }
+}
+
static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce,
const float lambda)
@@ -653,7 +423,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
- const float *coefs = sce->coeffs + start;
+ const float *coefs = &sce->coeffs[start];
float qmin, qmax;
int nz = 0;
@@ -692,7 +462,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
- q + q0, cb, lambda / band->threshold, INFINITY, NULL);
+ q + q0, cb, lambda / band->threshold, INFINITY, NULL, 0);
}
minrd = FFMIN(minrd, dist);
@@ -748,11 +518,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
{
int start = 0, i, w, w2, g;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
- const float freq_mult = avctx->sample_rate/(1024.0f/sce->ics.num_windows)/2.0f;
float dists[128] = { 0 }, uplims[128] = { 0 };
float maxvals[128];
- int noise_sf[128] = { 0 };
- int fflag, minscaler, minscaler_n;
+ int fflag, minscaler;
int its = 0;
int allz = 0;
float minthr = INFINITY;
@@ -763,13 +531,12 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
//XXX: some heuristic to determine initial quantizers will reduce search time
//determine zero bands and upper limits
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
- start = 0;
for (g = 0; g < sce->ics.num_swb; g++) {
int nz = 0;
float uplim = 0.0f, energy = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
- uplim += band->threshold;
+ uplim += band->threshold;
energy += band->energy;
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
@@ -778,18 +545,10 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
nz = 1;
}
uplims[w*16+g] = uplim *512;
- if (s->options.pns && start*freq_mult > NOISE_LOW_LIMIT && energy < uplim * 1.2f) {
- noise_sf[w*16+g] = av_clip(4+FFMIN(log2f(energy)*2,255), -100, 155);
- sce->band_type[w*16+g] = NOISE_BT;
- nz= 1;
- } else { /** Band type will be determined by the twoloop algorithm */
- sce->band_type[w*16+g] = 0;
- }
sce->zeroes[w*16+g] = !nz;
if (nz)
minthr = FFMIN(minthr, uplim);
allz |= nz;
- start += sce->ics.swb_sizes[g];
}
}
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
@@ -820,7 +579,6 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
do {
int tbits, qstep;
minscaler = sce->sf_idx[0];
- minscaler_n = sce->sf_idx[0];
//inner loop - quantize spectrum to fit into given number of bits
qstep = its ? 1 : 32;
do {
@@ -829,17 +587,13 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
- const float *coefs = sce->coeffs + start;
- const float *scaled = s->scoefs + start;
+ const float *coefs = &sce->coeffs[start];
+ const float *scaled = &s->scoefs[start];
int bits = 0;
int cb;
float dist = 0.0f;
- if (sce->band_type[w*16+g] == NOISE_BT) {
- minscaler_n = FFMIN(minscaler_n, noise_sf[w*16+g]);
- start += sce->ics.swb_sizes[g];
- continue;
- } else if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
+ if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
start += sce->ics.swb_sizes[g];
continue;
}
@@ -854,7 +608,8 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
cb,
1.0f,
INFINITY,
- &b);
+ &b,
+ 0);
bits += b;
}
dists[w*16+g] = dist - bits;
@@ -883,16 +638,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
fflag = 0;
minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF);
- for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
- for (g = 0; g < sce->ics.num_swb; g++)
- if (sce->band_type[w*16+g] == NOISE_BT)
- sce->sf_idx[w*16+g] = av_clip(noise_sf[w*16+g], minscaler_n, minscaler_n + SCALE_MAX_DIFF);
-
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
int prevsc = sce->sf_idx[w*16+g];
- if (sce->band_type[w*16+g] == NOISE_BT)
- continue;
if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) {
if (find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1))
sce->sf_idx[w*16+g]--;
@@ -935,7 +683,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
}
} else {
for (w = 0; w < 8; w++) {
- const float *coeffs = sce->coeffs + w*128;
+ const float *coeffs = &sce->coeffs[w*128];
curband = start = 0;
for (i = 0; i < 128; i++) {
if (i - start >= sce->ics.swb_sizes[curband]) {
@@ -960,7 +708,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
- float *coefs = sce->coeffs + start;
+ float *coefs = &sce->coeffs[start];
const int size = sce->ics.swb_sizes[g];
int start2 = start, end2 = start + size, peakpos = start;
float maxval = -1, thr = 0.0f, t;
@@ -1001,8 +749,8 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
- const float *coefs = sce->coeffs + start;
- const float *scaled = s->scoefs + start;
+ const float *coefs = &sce->coeffs[start];
+ const float *scaled = &s->scoefs[start];
const int size = sce->ics.swb_sizes[g];
int scf, prev_scf, step;
int min_scf = -1, max_scf = 256;
@@ -1027,11 +775,12 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
ESC_BT,
lambda,
INFINITY,
- &b);
+ &b,
+ 0);
dist -= b;
}
dist *= 1.0f / 512.0f / lambda;
- quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512]);
+ quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512], ROUND_STANDARD);
if (quant_max >= 8191) { // too much, return to the previous quantizer
sce->sf_idx[w*16+g] = prev_scf;
break;
@@ -1111,17 +860,101 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
}
-static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
- const float lambda)
+static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce)
+{
+ FFPsyBand *band;
+ int w, g, w2, i;
+ float *PNS = &s->scoefs[0*128], *PNS34 = &s->scoefs[1*128];
+ float *NOR34 = &s->scoefs[3*128];
+ const float lambda = s->lambda;
+ const float freq_mult = avctx->sample_rate/(1024.0f/sce->ics.num_windows)/2.0f;
+ const float thr_mult = NOISE_LAMBDA_REPLACE*(100.0f/lambda);
+ const float spread_threshold = NOISE_SPREAD_THRESHOLD*(lambda/100.f);
+
+ if (sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE)
+ return;
+
+ for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
+ for (g = 0; g < sce->ics.num_swb; g++) {
+ int noise_sfi;
+ float dist1 = 0.0f, dist2 = 0.0f, noise_amp;
+ float pns_energy = 0.0f, energy_ratio, dist_thresh;
+ float sfb_energy = 0.0f, threshold = 0.0f, spread = 0.0f;
+ const int start = sce->ics.swb_offset[w*16+g];
+ const float freq = start*freq_mult;
+ const float freq_boost = FFMAX(0.88f*freq/NOISE_LOW_LIMIT, 1.0f);
+ if (freq < NOISE_LOW_LIMIT || avctx->cutoff && freq >= avctx->cutoff)
+ continue;
+ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
+ band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
+ sfb_energy += band->energy;
+ spread += band->spread;
+ threshold += band->threshold;
+ }
+
+ /* Ramps down at ~8000Hz and loosens the dist threshold */
+ dist_thresh = FFMIN(2.5f*NOISE_LOW_LIMIT/freq, 1.27f);
+
+ if (sce->zeroes[w*16+g] || spread < spread_threshold ||
+ sfb_energy > threshold*thr_mult*freq_boost) {
+ sce->pns_ener[w*16+g] = sfb_energy;
+ continue;
+ }
+
+ noise_sfi = av_clip(roundf(log2f(sfb_energy)*2), -100, 155); /* Quantize */
+ noise_amp = -ff_aac_pow2sf_tab[noise_sfi + POW_SF2_ZERO]; /* Dequantize */
+ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
+ float band_energy, scale;
+ const int start_c = sce->ics.swb_offset[(w+w2)*16+g];
+ band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
+ for (i = 0; i < sce->ics.swb_sizes[g]; i++)
+ PNS[i] = s->random_state = lcg_random(s->random_state);
+ band_energy = s->fdsp->scalarproduct_float(PNS, PNS, sce->ics.swb_sizes[g]);
+ scale = noise_amp/sqrtf(band_energy);
+ s->fdsp->vector_fmul_scalar(PNS, PNS, scale, sce->ics.swb_sizes[g]);
+ pns_energy += s->fdsp->scalarproduct_float(PNS, PNS, sce->ics.swb_sizes[g]);
+ abs_pow34_v(NOR34, &sce->coeffs[start_c], sce->ics.swb_sizes[g]);
+ abs_pow34_v(PNS34, PNS, sce->ics.swb_sizes[g]);
+ dist1 += quantize_band_cost(s, &sce->coeffs[start_c],
+ NOR34,
+ sce->ics.swb_sizes[g],
+ sce->sf_idx[(w+w2)*16+g],
+ sce->band_alt[(w+w2)*16+g],
+ lambda/band->threshold, INFINITY, NULL, 0);
+ dist2 += quantize_band_cost(s, PNS,
+ PNS34,
+ sce->ics.swb_sizes[g],
+ noise_sfi,
+ NOISE_BT,
+ lambda/band->threshold, INFINITY, NULL, 0);
+ }
+ energy_ratio = sfb_energy/pns_energy; /* Compensates for quantization error */
+ sce->pns_ener[w*16+g] = energy_ratio*sfb_energy;
+ if (energy_ratio > 0.85f && energy_ratio < 1.25f && dist1/dist2 > dist_thresh) {
+ sce->band_type[w*16+g] = NOISE_BT;
+ sce->zeroes[w*16+g] = 0;
+ if (sce->band_type[w*16+g-1] != NOISE_BT && /* Prevent holes */
+ sce->band_type[w*16+g-2] == NOISE_BT) {
+ sce->band_type[w*16+g-1] = NOISE_BT;
+ sce->zeroes[w*16+g-1] = 0;
+ }
+ }
+ }
+ }
+}
+
+static void search_for_ms(AACEncContext *s, ChannelElement *cpe)
{
int start = 0, i, w, w2, g;
float M[128], S[128];
float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
+ const float lambda = s->lambda;
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
if (!cpe->common_window)
return;
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
+ start = 0;
for (g = 0; g < sce0->ics.num_swb; g++) {
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
float dist1 = 0.0f, dist2 = 0.0f;
@@ -1131,39 +964,39 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
float minthr = FFMIN(band0->threshold, band1->threshold);
float maxthr = FFMAX(band0->threshold, band1->threshold);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
- M[i] = (sce0->pcoeffs[start+w2*128+i]
- + sce1->pcoeffs[start+w2*128+i]) * 0.5;
+ M[i] = (sce0->coeffs[start+(w+w2)*128+i]
+ + sce1->coeffs[start+(w+w2)*128+i]) * 0.5;
S[i] = M[i]
- - sce1->pcoeffs[start+w2*128+i];
+ - sce1->coeffs[start+(w+w2)*128+i];
}
- abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
- abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
+ abs_pow34_v(L34, sce0->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
+ abs_pow34_v(R34, sce1->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
abs_pow34_v(M34, M, sce0->ics.swb_sizes[g]);
abs_pow34_v(S34, S, sce0->ics.swb_sizes[g]);
- dist1 += quantize_band_cost(s, sce0->coeffs + start + w2*128,
+ dist1 += quantize_band_cost(s, &sce0->coeffs[start + (w+w2)*128],
L34,
sce0->ics.swb_sizes[g],
sce0->sf_idx[(w+w2)*16+g],
sce0->band_type[(w+w2)*16+g],
- lambda / band0->threshold, INFINITY, NULL);
- dist1 += quantize_band_cost(s, sce1->coeffs + start + w2*128,
+ lambda / band0->threshold, INFINITY, NULL, 0);
+ dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128],
R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[(w+w2)*16+g],
sce1->band_type[(w+w2)*16+g],
- lambda / band1->threshold, INFINITY, NULL);
+ lambda / band1->threshold, INFINITY, NULL, 0);
dist2 += quantize_band_cost(s, M,
M34,
sce0->ics.swb_sizes[g],
sce0->sf_idx[(w+w2)*16+g],
sce0->band_type[(w+w2)*16+g],
- lambda / maxthr, INFINITY, NULL);
+ lambda / maxthr, INFINITY, NULL, 0);
dist2 += quantize_band_cost(s, S,
S34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[(w+w2)*16+g],
sce1->band_type[(w+w2)*16+g],
- lambda / minthr, INFINITY, NULL);
+ lambda / minthr, INFINITY, NULL, 0);
}
cpe->ms_mask[w*16+g] = dist2 < dist1;
}
@@ -1177,24 +1010,64 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_faac,
encode_window_bands_info,
quantize_and_encode_band,
+ ff_aac_encode_tns_info,
+ ff_aac_encode_main_pred,
+ ff_aac_adjust_common_prediction,
+ ff_aac_apply_main_pred,
+ ff_aac_apply_tns,
+ set_special_band_scalefactors,
+ search_for_pns,
+ ff_aac_search_for_tns,
search_for_ms,
+ ff_aac_search_for_is,
+ ff_aac_search_for_pred,
},
[AAC_CODER_ANMR] = {
search_for_quantizers_anmr,
encode_window_bands_info,
quantize_and_encode_band,
+ ff_aac_encode_tns_info,
+ ff_aac_encode_main_pred,
+ ff_aac_adjust_common_prediction,
+ ff_aac_apply_main_pred,
+ ff_aac_apply_tns,
+ set_special_band_scalefactors,
+ search_for_pns,
+ ff_aac_search_for_tns,
search_for_ms,
+ ff_aac_search_for_is,
+ ff_aac_search_for_pred,
},
[AAC_CODER_TWOLOOP] = {
search_for_quantizers_twoloop,
codebook_trellis_rate,
quantize_and_encode_band,
+ ff_aac_encode_tns_info,
+ ff_aac_encode_main_pred,
+ ff_aac_adjust_common_prediction,
+ ff_aac_apply_main_pred,
+ ff_aac_apply_tns,
+ set_special_band_scalefactors,
+ search_for_pns,
+ ff_aac_search_for_tns,
search_for_ms,
+ ff_aac_search_for_is,
+ ff_aac_search_for_pred,
},
[AAC_CODER_FAST] = {
search_for_quantizers_fast,
encode_window_bands_info,
quantize_and_encode_band,
+ ff_aac_encode_tns_info,
+ ff_aac_encode_main_pred,
+ ff_aac_adjust_common_prediction,
+ ff_aac_apply_main_pred,
+ ff_aac_apply_tns,
+ set_special_band_scalefactors,
+ search_for_pns,
+ ff_aac_search_for_tns,
search_for_ms,
+ ff_aac_search_for_is,
+ ff_aac_search_for_pred,
},
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec.c b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
index 622cc5c087a..837102f40a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
@@ -32,54 +32,9 @@
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
-/*
- * supported tools
- *
- * Support? Name
- * N (code in SoC repo) gain control
- * Y block switching
- * Y window shapes - standard
- * N window shapes - Low Delay
- * Y filterbank - standard
- * N (code in SoC repo) filterbank - Scalable Sample Rate
- * Y Temporal Noise Shaping
- * Y Long Term Prediction
- * Y intensity stereo
- * Y channel coupling
- * Y frequency domain prediction
- * Y Perceptual Noise Substitution
- * Y Mid/Side stereo
- * N Scalable Inverse AAC Quantization
- * N Frequency Selective Switch
- * N upsampling filter
- * Y quantization & coding - AAC
- * N quantization & coding - TwinVQ
- * N quantization & coding - BSAC
- * N AAC Error Resilience tools
- * N Error Resilience payload syntax
- * N Error Protection tool
- * N CELP
- * N Silence Compression
- * N HVXC
- * N HVXC 4kbits/s VR
- * N Structured Audio tools
- * N Structured Audio Sample Bank Format
- * N MIDI
- * N Harmonic and Individual Lines plus Noise
- * N Text-To-Speech Interface
- * Y Spectral Band Replication
- * Y (not in this code) Layer-1
- * Y (not in this code) Layer-2
- * Y (not in this code) Layer-3
- * N SinuSoidal Coding (Transient, Sinusoid, Noise)
- * Y Parametric Stereo
- * N Direct Stream Transfer
- * Y Enhanced AAC Low Delay (ER AAC ELD)
- *
- * Note: - HE AAC v1 comprises LC AAC with Spectral Band Replication.
- * - HE AAC v2 comprises LC AAC with Spectral Band Replication and
- Parametric Stereo.
- */
+#define FFT_FLOAT 1
+#define FFT_FIXED_32 0
+#define USE_FIXED 0
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
@@ -113,929 +68,6 @@
# include "mips/aacdec_mips.h"
#endif
-static VLC vlc_scalefactors;
-static VLC vlc_spectral[11];
-
-static int output_configure(AACContext *ac,
- uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
- enum OCStatus oc_type, int get_new_frame);
-
-#define overread_err "Input buffer exhausted before END element found\n"
-
-static int count_channels(uint8_t (*layout)[3], int tags)
-{
- int i, sum = 0;
- for (i = 0; i < tags; i++) {
- int syn_ele = layout[i][0];
- int pos = layout[i][2];
- sum += (1 + (syn_ele == TYPE_CPE)) *
- (pos != AAC_CHANNEL_OFF && pos != AAC_CHANNEL_CC);
- }
- return sum;
-}
-
-/**
- * Check for the channel element in the current channel position configuration.
- * If it exists, make sure the appropriate element is allocated and map the
- * channel order to match the internal FFmpeg channel layout.
- *
- * @param che_pos current channel position configuration
- * @param type channel element type
- * @param id channel element id
- * @param channels count of the number of channels in the configuration
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static av_cold int che_configure(AACContext *ac,
- enum ChannelPosition che_pos,
- int type, int id, int *channels)
-{
- if (*channels >= MAX_CHANNELS)
- return AVERROR_INVALIDDATA;
- if (che_pos) {
- if (!ac->che[type][id]) {
- if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
- return AVERROR(ENOMEM);
- ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
- }
- if (type != TYPE_CCE) {
- if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) {
- av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
- return AVERROR_INVALIDDATA;
- }
- ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0];
- if (type == TYPE_CPE ||
- (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) {
- ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1];
- }
- }
- } else {
- if (ac->che[type][id])
- ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr);
- av_freep(&ac->che[type][id]);
- }
- return 0;
-}
-
-static int frame_configure_elements(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int type, id, ch, ret;
-
- /* set channel pointers to internal buffers by default */
- for (type = 0; type < 4; type++) {
- for (id = 0; id < MAX_ELEM_ID; id++) {
- ChannelElement *che = ac->che[type][id];
- if (che) {
- che->ch[0].ret = che->ch[0].ret_buf;
- che->ch[1].ret = che->ch[1].ret_buf;
- }
- }
- }
-
- /* get output buffer */
- av_frame_unref(ac->frame);
- if (!avctx->channels)
- return 1;
-
- ac->frame->nb_samples = 2048;
- if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
- return ret;
-
- /* map output channel pointers to AVFrame data */
- for (ch = 0; ch < avctx->channels; ch++) {
- if (ac->output_element[ch])
- ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
- }
-
- return 0;
-}
-
-struct elem_to_channel {
- uint64_t av_position;
- uint8_t syn_ele;
- uint8_t elem_id;
- uint8_t aac_position;
-};
-
-static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
- uint8_t (*layout_map)[3], int offset, uint64_t left,
- uint64_t right, int pos)
-{
- if (layout_map[offset][0] == TYPE_CPE) {
- e2c_vec[offset] = (struct elem_to_channel) {
- .av_position = left | right,
- .syn_ele = TYPE_CPE,
- .elem_id = layout_map[offset][1],
- .aac_position = pos
- };
- return 1;
- } else {
- e2c_vec[offset] = (struct elem_to_channel) {
- .av_position = left,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[offset][1],
- .aac_position = pos
- };
- e2c_vec[offset + 1] = (struct elem_to_channel) {
- .av_position = right,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[offset + 1][1],
- .aac_position = pos
- };
- return 2;
- }
-}
-
-static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
- int *current)
-{
- int num_pos_channels = 0;
- int first_cpe = 0;
- int sce_parity = 0;
- int i;
- for (i = *current; i < tags; i++) {
- if (layout_map[i][2] != pos)
- break;
- if (layout_map[i][0] == TYPE_CPE) {
- if (sce_parity) {
- if (pos == AAC_CHANNEL_FRONT && !first_cpe) {
- sce_parity = 0;
- } else {
- return -1;
- }
- }
- num_pos_channels += 2;
- first_cpe = 1;
- } else {
- num_pos_channels++;
- sce_parity ^= 1;
- }
- }
- if (sce_parity &&
- ((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE))
- return -1;
- *current = i;
- return num_pos_channels;
-}
-
-static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
-{
- int i, n, total_non_cc_elements;
- struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
- int num_front_channels, num_side_channels, num_back_channels;
- uint64_t layout;
-
- if (FF_ARRAY_ELEMS(e2c_vec) < tags)
- return 0;
-
- i = 0;
- num_front_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_FRONT, &i);
- if (num_front_channels < 0)
- return 0;
- num_side_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_SIDE, &i);
- if (num_side_channels < 0)
- return 0;
- num_back_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_BACK, &i);
- if (num_back_channels < 0)
- return 0;
-
- if (num_side_channels == 0 && num_back_channels >= 4) {
- num_side_channels = 2;
- num_back_channels -= 2;
- }
-
- i = 0;
- if (num_front_channels & 1) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_FRONT_CENTER,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_FRONT
- };
- i++;
- num_front_channels--;
- }
- if (num_front_channels >= 4) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_FRONT_LEFT_OF_CENTER,
- AV_CH_FRONT_RIGHT_OF_CENTER,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
- if (num_front_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_FRONT_LEFT,
- AV_CH_FRONT_RIGHT,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
- while (num_front_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
-
- if (num_side_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_SIDE_LEFT,
- AV_CH_SIDE_RIGHT,
- AAC_CHANNEL_FRONT);
- num_side_channels -= 2;
- }
- while (num_side_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_SIDE);
- num_side_channels -= 2;
- }
-
- while (num_back_channels >= 4) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_BACK);
- num_back_channels -= 2;
- }
- if (num_back_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_BACK_LEFT,
- AV_CH_BACK_RIGHT,
- AAC_CHANNEL_BACK);
- num_back_channels -= 2;
- }
- if (num_back_channels) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_BACK_CENTER,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_BACK
- };
- i++;
- num_back_channels--;
- }
-
- if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_LOW_FREQUENCY,
- .syn_ele = TYPE_LFE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_LFE
- };
- i++;
- }
- while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = UINT64_MAX,
- .syn_ele = TYPE_LFE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_LFE
- };
- i++;
- }
-
- // Must choose a stable sort
- total_non_cc_elements = n = i;
- do {
- int next_n = 0;
- for (i = 1; i < n; i++)
- if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
- FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
- next_n = i;
- }
- n = next_n;
- } while (n > 0);
-
- layout = 0;
- for (i = 0; i < total_non_cc_elements; i++) {
- layout_map[i][0] = e2c_vec[i].syn_ele;
- layout_map[i][1] = e2c_vec[i].elem_id;
- layout_map[i][2] = e2c_vec[i].aac_position;
- if (e2c_vec[i].av_position != UINT64_MAX) {
- layout |= e2c_vec[i].av_position;
- }
- }
-
- return layout;
-}
-
-/**
- * Save current output configuration if and only if it has been locked.
- */
-static void push_output_configuration(AACContext *ac) {
- if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
- ac->oc[0] = ac->oc[1];
- }
- ac->oc[1].status = OC_NONE;
-}
-
-/**
- * Restore the previous output configuration if and only if the current
- * configuration is unlocked.
- */
-static void pop_output_configuration(AACContext *ac) {
- if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
- ac->oc[1] = ac->oc[0];
- ac->avctx->channels = ac->oc[1].channels;
- ac->avctx->channel_layout = ac->oc[1].channel_layout;
- output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
- ac->oc[1].status, 0);
- }
-}
-
-/**
- * Configure output channel order based on the current program
- * configuration element.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int output_configure(AACContext *ac,
- uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
- enum OCStatus oc_type, int get_new_frame)
-{
- AVCodecContext *avctx = ac->avctx;
- int i, channels = 0, ret;
- uint64_t layout = 0;
- uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }};
- uint8_t type_counts[TYPE_END] = { 0 };
-
- if (ac->oc[1].layout_map != layout_map) {
- memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
- ac->oc[1].layout_map_tags = tags;
- }
- for (i = 0; i < tags; i++) {
- int type = layout_map[i][0];
- int id = layout_map[i][1];
- id_map[type][id] = type_counts[type]++;
- }
- // Try to sniff a reasonable channel order, otherwise output the
- // channels in the order the PCE declared them.
- if (avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE)
- layout = sniff_channel_order(layout_map, tags);
- for (i = 0; i < tags; i++) {
- int type = layout_map[i][0];
- int id = layout_map[i][1];
- int iid = id_map[type][id];
- int position = layout_map[i][2];
- // Allocate or free elements depending on if they are in the
- // current program configuration.
- ret = che_configure(ac, position, type, iid, &channels);
- if (ret < 0)
- return ret;
- ac->tag_che_map[type][id] = ac->che[type][iid];
- }
- if (ac->oc[1].m4ac.ps == 1 && channels == 2) {
- if (layout == AV_CH_FRONT_CENTER) {
- layout = AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT;
- } else {
- layout = 0;
- }
- }
-
- if (layout) avctx->channel_layout = layout;
- ac->oc[1].channel_layout = layout;
- avctx->channels = ac->oc[1].channels = channels;
- ac->oc[1].status = oc_type;
-
- if (get_new_frame) {
- if ((ret = frame_configure_elements(ac->avctx)) < 0)
- return ret;
- }
-
- return 0;
-}
-
-static void flush(AVCodecContext *avctx)
-{
- AACContext *ac= avctx->priv_data;
- int type, i, j;
-
- for (type = 3; type >= 0; type--) {
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *che = ac->che[type][i];
- if (che) {
- for (j = 0; j <= 1; j++) {
- memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
- }
- }
- }
- }
-}
-
-/**
- * Set up channel positions based on a default channel configuration
- * as specified in table 1.17.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int set_default_channel_config(AVCodecContext *avctx,
- uint8_t (*layout_map)[3],
- int *tags,
- int channel_config)
-{
- if (channel_config < 1 || (channel_config > 7 && channel_config < 11) ||
- channel_config > 12) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid default channel configuration (%d)\n",
- channel_config);
- return AVERROR_INVALIDDATA;
- }
- *tags = tags_per_config[channel_config];
- memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
- *tags * sizeof(*layout_map));
-
- /*
- * AAC specification has 7.1(wide) as a default layout for 8-channel streams.
- * However, at least Nero AAC encoder encodes 7.1 streams using the default
- * channel config 7, mapping the side channels of the original audio stream
- * to the second AAC_CHANNEL_FRONT pair in the AAC stream. Similarly, e.g. FAAD
- * decodes the second AAC_CHANNEL_FRONT pair as side channels, therefore decoding
- * the incorrect streams as if they were correct (and as the encoder intended).
- *
- * As actual intended 7.1(wide) streams are very rare, default to assuming a
- * 7.1 layout was intended.
- */
- if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
- av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
- " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
- " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
- layout_map[2][2] = AAC_CHANNEL_SIDE;
- }
-
- return 0;
-}
-
-static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
-{
- /* For PCE based channel configurations map the channels solely based
- * on tags. */
- if (!ac->oc[1].m4ac.chan_config) {
- return ac->tag_che_map[type][elem_id];
- }
- // Allow single CPE stereo files to be signalled with mono configuration.
- if (!ac->tags_mapped && type == TYPE_CPE &&
- ac->oc[1].m4ac.chan_config == 1) {
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags;
- push_output_configuration(ac);
-
- av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
-
- if (set_default_channel_config(ac->avctx, layout_map,
- &layout_map_tags, 2) < 0)
- return NULL;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 1) < 0)
- return NULL;
-
- ac->oc[1].m4ac.chan_config = 2;
- ac->oc[1].m4ac.ps = 0;
- }
- // And vice-versa
- if (!ac->tags_mapped && type == TYPE_SCE &&
- ac->oc[1].m4ac.chan_config == 2) {
- uint8_t layout_map[MAX_ELEM_ID * 4][3];
- int layout_map_tags;
- push_output_configuration(ac);
-
- av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
-
- if (set_default_channel_config(ac->avctx, layout_map,
- &layout_map_tags, 1) < 0)
- return NULL;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 1) < 0)
- return NULL;
-
- ac->oc[1].m4ac.chan_config = 1;
- if (ac->oc[1].m4ac.sbr)
- ac->oc[1].m4ac.ps = -1;
- }
- /* For indexed channel configurations map the channels solely based
- * on position. */
- switch (ac->oc[1].m4ac.chan_config) {
- case 12:
- case 7:
- if (ac->tags_mapped == 3 && type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
- }
- case 11:
- if (ac->tags_mapped == 2 &&
- ac->oc[1].m4ac.chan_config == 11 &&
- type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
- }
- case 6:
- /* Some streams incorrectly code 5.1 audio as
- * SCE[0] CPE[0] CPE[1] SCE[1]
- * instead of
- * SCE[0] CPE[0] CPE[1] LFE[0].
- * If we seem to have encountered such a stream, transfer
- * the LFE[0] element to the SCE[1]'s mapping */
- if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
- if (!ac->warned_remapping_once && (type != TYPE_LFE || elem_id != 0)) {
- av_log(ac->avctx, AV_LOG_WARNING,
- "This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n",
- type == TYPE_SCE ? "SCE" : "LFE", elem_id);
- ac->warned_remapping_once++;
- }
- ac->tags_mapped++;
- return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
- }
- case 5:
- if (ac->tags_mapped == 2 && type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
- }
- case 4:
- /* Some streams incorrectly code 4.0 audio as
- * SCE[0] CPE[0] LFE[0]
- * instead of
- * SCE[0] CPE[0] SCE[1].
- * If we seem to have encountered such a stream, transfer
- * the SCE[1] element to the LFE[0]'s mapping */
- if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
- if (!ac->warned_remapping_once && (type != TYPE_SCE || elem_id != 1)) {
- av_log(ac->avctx, AV_LOG_WARNING,
- "This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n",
- type == TYPE_SCE ? "SCE" : "LFE", elem_id);
- ac->warned_remapping_once++;
- }
- ac->tags_mapped++;
- return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
- }
- if (ac->tags_mapped == 2 &&
- ac->oc[1].m4ac.chan_config == 4 &&
- type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
- }
- case 3:
- case 2:
- if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) &&
- type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
- } else if (ac->oc[1].m4ac.chan_config == 2) {
- return NULL;
- }
- case 1:
- if (!ac->tags_mapped && type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0];
- }
- default:
- return NULL;
- }
-}
-
-/**
- * Decode an array of 4 bit element IDs, optionally interleaved with a
- * stereo/mono switching bit.
- *
- * @param type speaker type/position for these channels
- */
-static void decode_channel_map(uint8_t layout_map[][3],
- enum ChannelPosition type,
- GetBitContext *gb, int n)
-{
- while (n--) {
- enum RawDataBlockType syn_ele;
- switch (type) {
- case AAC_CHANNEL_FRONT:
- case AAC_CHANNEL_BACK:
- case AAC_CHANNEL_SIDE:
- syn_ele = get_bits1(gb);
- break;
- case AAC_CHANNEL_CC:
- skip_bits1(gb);
- syn_ele = TYPE_CCE;
- break;
- case AAC_CHANNEL_LFE:
- syn_ele = TYPE_LFE;
- break;
- default:
- // AAC_CHANNEL_OFF has no channel map
- av_assert0(0);
- }
- layout_map[0][0] = syn_ele;
- layout_map[0][1] = get_bits(gb, 4);
- layout_map[0][2] = type;
- layout_map++;
- }
-}
-
-/**
- * Decode program configuration element; reference: table 4.2.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
- uint8_t (*layout_map)[3],
- GetBitContext *gb)
-{
- int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
- int sampling_index;
- int comment_len;
- int tags;
-
- skip_bits(gb, 2); // object_type
-
- sampling_index = get_bits(gb, 4);
- if (m4ac->sampling_index != sampling_index)
- av_log(avctx, AV_LOG_WARNING,
- "Sample rate index in program config element does not "
- "match the sample rate index configured by the container.\n");
-
- num_front = get_bits(gb, 4);
- num_side = get_bits(gb, 4);
- num_back = get_bits(gb, 4);
- num_lfe = get_bits(gb, 2);
- num_assoc_data = get_bits(gb, 3);
- num_cc = get_bits(gb, 4);
-
- if (get_bits1(gb))
- skip_bits(gb, 4); // mono_mixdown_tag
- if (get_bits1(gb))
- skip_bits(gb, 4); // stereo_mixdown_tag
-
- if (get_bits1(gb))
- skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround
-
- if (get_bits_left(gb) < 4 * (num_front + num_side + num_back + num_lfe + num_assoc_data + num_cc)) {
- av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
- return -1;
- }
- decode_channel_map(layout_map , AAC_CHANNEL_FRONT, gb, num_front);
- tags = num_front;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_SIDE, gb, num_side);
- tags += num_side;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_BACK, gb, num_back);
- tags += num_back;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_LFE, gb, num_lfe);
- tags += num_lfe;
-
- skip_bits_long(gb, 4 * num_assoc_data);
-
- decode_channel_map(layout_map + tags, AAC_CHANNEL_CC, gb, num_cc);
- tags += num_cc;
-
- align_get_bits(gb);
-
- /* comment field, first byte is length */
- comment_len = get_bits(gb, 8) * 8;
- if (get_bits_left(gb) < comment_len) {
- av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, comment_len);
- return tags;
-}
-
-/**
- * Decode GA "General Audio" specific configuration; reference: table 4.1.
- *
- * @param ac pointer to AACContext, may be null
- * @param avctx pointer to AVCCodecContext, used for logging
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
- GetBitContext *gb,
- MPEG4AudioConfig *m4ac,
- int channel_config)
-{
- int extension_flag, ret, ep_config, res_flags;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags = 0;
-
- if (get_bits1(gb)) { // frameLengthFlag
- avpriv_request_sample(avctx, "960/120 MDCT window");
- return AVERROR_PATCHWELCOME;
- }
- m4ac->frame_length_short = 0;
-
- if (get_bits1(gb)) // dependsOnCoreCoder
- skip_bits(gb, 14); // coreCoderDelay
- extension_flag = get_bits1(gb);
-
- if (m4ac->object_type == AOT_AAC_SCALABLE ||
- m4ac->object_type == AOT_ER_AAC_SCALABLE)
- skip_bits(gb, 3); // layerNr
-
- if (channel_config == 0) {
- skip_bits(gb, 4); // element_instance_tag
- tags = decode_pce(avctx, m4ac, layout_map, gb);
- if (tags < 0)
- return tags;
- } else {
- if ((ret = set_default_channel_config(avctx, layout_map,
- &tags, channel_config)))
- return ret;
- }
-
- if (count_channels(layout_map, tags) > 1) {
- m4ac->ps = 0;
- } else if (m4ac->sbr == 1 && m4ac->ps == -1)
- m4ac->ps = 1;
-
- if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
- return ret;
-
- if (extension_flag) {
- switch (m4ac->object_type) {
- case AOT_ER_BSAC:
- skip_bits(gb, 5); // numOfSubFrame
- skip_bits(gb, 11); // layer_length
- break;
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_SCALABLE:
- case AOT_ER_AAC_LD:
- res_flags = get_bits(gb, 3);
- if (res_flags) {
- avpriv_report_missing_feature(avctx,
- "AAC data resilience (flags %x)",
- res_flags);
- return AVERROR_PATCHWELCOME;
- }
- break;
- }
- skip_bits1(gb); // extensionFlag3 (TBD in version 3)
- }
- switch (m4ac->object_type) {
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_SCALABLE:
- case AOT_ER_AAC_LD:
- ep_config = get_bits(gb, 2);
- if (ep_config) {
- avpriv_report_missing_feature(avctx,
- "epConfig %d", ep_config);
- return AVERROR_PATCHWELCOME;
- }
- }
- return 0;
-}
-
-static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
- GetBitContext *gb,
- MPEG4AudioConfig *m4ac,
- int channel_config)
-{
- int ret, ep_config, res_flags;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags = 0;
- const int ELDEXT_TERM = 0;
-
- m4ac->ps = 0;
- m4ac->sbr = 0;
-
- m4ac->frame_length_short = get_bits1(gb);
- res_flags = get_bits(gb, 3);
- if (res_flags) {
- avpriv_report_missing_feature(avctx,
- "AAC data resilience (flags %x)",
- res_flags);
- return AVERROR_PATCHWELCOME;
- }
-
- if (get_bits1(gb)) { // ldSbrPresentFlag
- avpriv_report_missing_feature(avctx,
- "Low Delay SBR");
- return AVERROR_PATCHWELCOME;
- }
-
- while (get_bits(gb, 4) != ELDEXT_TERM) {
- int len = get_bits(gb, 4);
- if (len == 15)
- len += get_bits(gb, 8);
- if (len == 15 + 255)
- len += get_bits(gb, 16);
- if (get_bits_left(gb) < len * 8 + 4) {
- av_log(avctx, AV_LOG_ERROR, overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, 8 * len);
- }
-
- if ((ret = set_default_channel_config(avctx, layout_map,
- &tags, channel_config)))
- return ret;
-
- if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
- return ret;
-
- ep_config = get_bits(gb, 2);
- if (ep_config) {
- avpriv_report_missing_feature(avctx,
- "epConfig %d", ep_config);
- return AVERROR_PATCHWELCOME;
- }
- return 0;
-}
-
-/**
- * Decode audio specific configuration; reference: table 1.13.
- *
- * @param ac pointer to AACContext, may be null
- * @param avctx pointer to AVCCodecContext, used for logging
- * @param m4ac pointer to MPEG4AudioConfig, used for parsing
- * @param data pointer to buffer holding an audio specific config
- * @param bit_size size of audio specific config or data in bits
- * @param sync_extension look for an appended sync extension
- *
- * @return Returns error status or number of consumed bits. <0 - error
- */
-static int decode_audio_specific_config(AACContext *ac,
- AVCodecContext *avctx,
- MPEG4AudioConfig *m4ac,
- const uint8_t *data, int bit_size,
- int sync_extension)
-{
- GetBitContext gb;
- int i, ret;
-
- ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
- for (i = 0; i < bit_size >> 3; i++)
- ff_dlog(avctx, "%02x ", data[i]);
- ff_dlog(avctx, "\n");
-
- if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
- return ret;
-
- if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,
- sync_extension)) < 0)
- return AVERROR_INVALIDDATA;
- if (m4ac->sampling_index > 12) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid sampling rate index %d\n",
- m4ac->sampling_index);
- return AVERROR_INVALIDDATA;
- }
- if (m4ac->object_type == AOT_ER_AAC_LD &&
- (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid low delay sampling rate index %d\n",
- m4ac->sampling_index);
- return AVERROR_INVALIDDATA;
- }
-
- skip_bits_long(&gb, i);
-
- switch (m4ac->object_type) {
- case AOT_AAC_MAIN:
- case AOT_AAC_LC:
- case AOT_AAC_LTP:
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LD:
- if ((ret = decode_ga_specific_config(ac, avctx, &gb,
- m4ac, m4ac->chan_config)) < 0)
- return ret;
- break;
- case AOT_ER_AAC_ELD:
- if ((ret = decode_eld_specific_config(ac, avctx, &gb,
- m4ac, m4ac->chan_config)) < 0)
- return ret;
- break;
- default:
- avpriv_report_missing_feature(avctx,
- "Audio object type %s%d",
- m4ac->sbr == 1 ? "SBR+" : "",
- m4ac->object_type);
- return AVERROR(ENOSYS);
- }
-
- ff_dlog(avctx,
- "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
- m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
- m4ac->sample_rate, m4ac->sbr,
- m4ac->ps);
-
- return get_bits_count(&gb);
-}
-
-/**
- * linear congruential pseudorandom number generator
- *
- * @param previous_val pointer to the current state of the generator
- *
- * @return Returns a 32-bit pseudorandom integer
- */
-static av_always_inline int lcg_random(unsigned previous_val)
-{
- union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
- return v.s;
-}
-
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
@@ -1046,514 +78,6 @@ static av_always_inline void reset_predict_state(PredictorState *ps)
ps->var1 = 1.0f;
}
-static void reset_all_predictors(PredictorState *ps)
-{
- int i;
- for (i = 0; i < MAX_PREDICTORS; i++)
- reset_predict_state(&ps[i]);
-}
-
-static int sample_rate_idx (int rate)
-{
- if (92017 <= rate) return 0;
- else if (75132 <= rate) return 1;
- else if (55426 <= rate) return 2;
- else if (46009 <= rate) return 3;
- else if (37566 <= rate) return 4;
- else if (27713 <= rate) return 5;
- else if (23004 <= rate) return 6;
- else if (18783 <= rate) return 7;
- else if (13856 <= rate) return 8;
- else if (11502 <= rate) return 9;
- else if (9391 <= rate) return 10;
- else return 11;
-}
-
-static void reset_predictor_group(PredictorState *ps, int group_num)
-{
- int i;
- for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
- reset_predict_state(&ps[i]);
-}
-
-#define AAC_INIT_VLC_STATIC(num, size) \
- INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
- ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \
- sizeof(ff_aac_spectral_bits[num][0]), \
- ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
- sizeof(ff_aac_spectral_codes[num][0]), \
- size);
-
-static void aacdec_init(AACContext *ac);
-
-static av_cold int aac_decode_init(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int ret;
-
- ac->avctx = avctx;
- ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
-
- aacdec_init(ac);
-
- avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
- if (avctx->extradata_size > 0) {
- if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
- avctx->extradata,
- avctx->extradata_size * 8,
- 1)) < 0)
- return ret;
- } else {
- int sr, i;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags;
-
- sr = sample_rate_idx(avctx->sample_rate);
- ac->oc[1].m4ac.sampling_index = sr;
- ac->oc[1].m4ac.channels = avctx->channels;
- ac->oc[1].m4ac.sbr = -1;
- ac->oc[1].m4ac.ps = -1;
-
- for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
- if (ff_mpeg4audio_channels[i] == avctx->channels)
- break;
- if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
- i = 0;
- }
- ac->oc[1].m4ac.chan_config = i;
-
- if (ac->oc[1].m4ac.chan_config) {
- int ret = set_default_channel_config(avctx, layout_map,
- &layout_map_tags, ac->oc[1].m4ac.chan_config);
- if (!ret)
- output_configure(ac, layout_map, layout_map_tags,
- OC_GLOBAL_HDR, 0);
- else if (avctx->err_recognition & AV_EF_EXPLODE)
- return AVERROR_INVALIDDATA;
- }
- }
-
- if (avctx->channels > MAX_CHANNELS) {
- av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
- return AVERROR_INVALIDDATA;
- }
-
- AAC_INIT_VLC_STATIC( 0, 304);
- AAC_INIT_VLC_STATIC( 1, 270);
- AAC_INIT_VLC_STATIC( 2, 550);
- AAC_INIT_VLC_STATIC( 3, 300);
- AAC_INIT_VLC_STATIC( 4, 328);
- AAC_INIT_VLC_STATIC( 5, 294);
- AAC_INIT_VLC_STATIC( 6, 306);
- AAC_INIT_VLC_STATIC( 7, 268);
- AAC_INIT_VLC_STATIC( 8, 510);
- AAC_INIT_VLC_STATIC( 9, 366);
- AAC_INIT_VLC_STATIC(10, 462);
-
- ff_aac_sbr_init();
-
- ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
- if (!ac->fdsp) {
- return AVERROR(ENOMEM);
- }
-
- ac->random_state = 0x1f2e3d4c;
-
- ff_aac_tableinit();
-
- INIT_VLC_STATIC(&vlc_scalefactors, 7,
- FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
- ff_aac_scalefactor_bits,
- sizeof(ff_aac_scalefactor_bits[0]),
- sizeof(ff_aac_scalefactor_bits[0]),
- ff_aac_scalefactor_code,
- sizeof(ff_aac_scalefactor_code[0]),
- sizeof(ff_aac_scalefactor_code[0]),
- 352);
-
- ff_mdct_init(&ac->mdct, 11, 1, 1.0 / (32768.0 * 1024.0));
- ff_mdct_init(&ac->mdct_ld, 10, 1, 1.0 / (32768.0 * 512.0));
- ff_mdct_init(&ac->mdct_small, 8, 1, 1.0 / (32768.0 * 128.0));
- ff_mdct_init(&ac->mdct_ltp, 11, 0, -2.0 * 32768.0);
- ret = ff_imdct15_init(&ac->mdct480, 5);
- if (ret < 0)
- return ret;
-
- // window initialization
- ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
- ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
- ff_init_ff_sine_windows(10);
- ff_init_ff_sine_windows( 9);
- ff_init_ff_sine_windows( 7);
-
- cbrt_tableinit();
-
- return 0;
-}
-
-/**
- * Skip data_stream_element; reference: table 4.10.
- */
-static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
-{
- int byte_align = get_bits1(gb);
- int count = get_bits(gb, 8);
- if (count == 255)
- count += get_bits(gb, 8);
- if (byte_align)
- align_get_bits(gb);
-
- if (get_bits_left(gb) < 8 * count) {
- av_log(ac->avctx, AV_LOG_ERROR, "skip_data_stream_element: "overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, 8 * count);
- return 0;
-}
-
-static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
- GetBitContext *gb)
-{
- int sfb;
- if (get_bits1(gb)) {
- ics->predictor_reset_group = get_bits(gb, 5);
- if (ics->predictor_reset_group == 0 ||
- ics->predictor_reset_group > 30) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid Predictor Reset Group.\n");
- return AVERROR_INVALIDDATA;
- }
- }
- for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]); sfb++) {
- ics->prediction_used[sfb] = get_bits1(gb);
- }
- return 0;
-}
-
-/**
- * Decode Long Term Prediction data; reference: table 4.xx.
- */
-static void decode_ltp(LongTermPrediction *ltp,
- GetBitContext *gb, uint8_t max_sfb)
-{
- int sfb;
-
- ltp->lag = get_bits(gb, 11);
- ltp->coef = ltp_coef[get_bits(gb, 3)];
- for (sfb = 0; sfb < FFMIN(max_sfb, MAX_LTP_LONG_SFB); sfb++)
- ltp->used[sfb] = get_bits1(gb);
-}
-
-/**
- * Decode Individual Channel Stream info; reference: table 4.6.
- */
-static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
- GetBitContext *gb)
-{
- const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
- const int aot = m4ac->object_type;
- const int sampling_index = m4ac->sampling_index;
- if (aot != AOT_ER_AAC_ELD) {
- if (get_bits1(gb)) {
- av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
- if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
- return AVERROR_INVALIDDATA;
- }
- ics->window_sequence[1] = ics->window_sequence[0];
- ics->window_sequence[0] = get_bits(gb, 2);
- if (aot == AOT_ER_AAC_LD &&
- ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "AAC LD is only defined for ONLY_LONG_SEQUENCE but "
- "window sequence %d found.\n", ics->window_sequence[0]);
- ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
- return AVERROR_INVALIDDATA;
- }
- ics->use_kb_window[1] = ics->use_kb_window[0];
- ics->use_kb_window[0] = get_bits1(gb);
- }
- ics->num_window_groups = 1;
- ics->group_len[0] = 1;
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- int i;
- ics->max_sfb = get_bits(gb, 4);
- for (i = 0; i < 7; i++) {
- if (get_bits1(gb)) {
- ics->group_len[ics->num_window_groups - 1]++;
- } else {
- ics->num_window_groups++;
- ics->group_len[ics->num_window_groups - 1] = 1;
- }
- }
- ics->num_windows = 8;
- ics->swb_offset = ff_swb_offset_128[sampling_index];
- ics->num_swb = ff_aac_num_swb_128[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_128[sampling_index];
- ics->predictor_present = 0;
- } else {
- ics->max_sfb = get_bits(gb, 6);
- ics->num_windows = 1;
- if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
- if (m4ac->frame_length_short) {
- ics->swb_offset = ff_swb_offset_480[sampling_index];
- ics->num_swb = ff_aac_num_swb_480[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_480[sampling_index];
- } else {
- ics->swb_offset = ff_swb_offset_512[sampling_index];
- ics->num_swb = ff_aac_num_swb_512[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_512[sampling_index];
- }
- if (!ics->num_swb || !ics->swb_offset)
- return AVERROR_BUG;
- } else {
- ics->swb_offset = ff_swb_offset_1024[sampling_index];
- ics->num_swb = ff_aac_num_swb_1024[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index];
- }
- if (aot != AOT_ER_AAC_ELD) {
- ics->predictor_present = get_bits1(gb);
- ics->predictor_reset_group = 0;
- }
- if (ics->predictor_present) {
- if (aot == AOT_AAC_MAIN) {
- if (decode_prediction(ac, ics, gb)) {
- goto fail;
- }
- } else if (aot == AOT_AAC_LC ||
- aot == AOT_ER_AAC_LC) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Prediction is not allowed in AAC-LC.\n");
- goto fail;
- } else {
- if (aot == AOT_ER_AAC_LD) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "LTP in ER AAC LD not yet implemented.\n");
- return AVERROR_PATCHWELCOME;
- }
- if ((ics->ltp.present = get_bits(gb, 1)))
- decode_ltp(&ics->ltp, gb, ics->max_sfb);
- }
- }
- }
-
- if (ics->max_sfb > ics->num_swb) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Number of scalefactor bands in group (%d) "
- "exceeds limit (%d).\n",
- ics->max_sfb, ics->num_swb);
- goto fail;
- }
-
- return 0;
-fail:
- ics->max_sfb = 0;
- return AVERROR_INVALIDDATA;
-}
-
-/**
- * Decode band types (section_data payload); reference: table 4.46.
- *
- * @param band_type array of the used band type
- * @param band_type_run_end array of the last scalefactor band of a band type run
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_band_types(AACContext *ac, enum BandType band_type[120],
- int band_type_run_end[120], GetBitContext *gb,
- IndividualChannelStream *ics)
-{
- int g, idx = 0;
- const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;
- for (g = 0; g < ics->num_window_groups; g++) {
- int k = 0;
- while (k < ics->max_sfb) {
- uint8_t sect_end = k;
- int sect_len_incr;
- int sect_band_type = get_bits(gb, 4);
- if (sect_band_type == 12) {
- av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
- return AVERROR_INVALIDDATA;
- }
- do {
- sect_len_incr = get_bits(gb, bits);
- sect_end += sect_len_incr;
- if (get_bits_left(gb) < 0) {
- av_log(ac->avctx, AV_LOG_ERROR, "decode_band_types: "overread_err);
- return AVERROR_INVALIDDATA;
- }
- if (sect_end > ics->max_sfb) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Number of bands (%d) exceeds limit (%d).\n",
- sect_end, ics->max_sfb);
- return AVERROR_INVALIDDATA;
- }
- } while (sect_len_incr == (1 << bits) - 1);
- for (; k < sect_end; k++) {
- band_type [idx] = sect_band_type;
- band_type_run_end[idx++] = sect_end;
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode scalefactors; reference: table 4.47.
- *
- * @param global_gain first scalefactor value as scalefactors are differentially coded
- * @param band_type array of the used band type
- * @param band_type_run_end array of the last scalefactor band of a band type run
- * @param sf array of scalefactors or intensity stereo positions
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
- unsigned int global_gain,
- IndividualChannelStream *ics,
- enum BandType band_type[120],
- int band_type_run_end[120])
-{
- int g, i, idx = 0;
- int offset[3] = { global_gain, global_gain - NOISE_OFFSET, 0 };
- int clipped_offset;
- int noise_flag = 1;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb;) {
- int run_end = band_type_run_end[idx];
- if (band_type[idx] == ZERO_BT) {
- for (; i < run_end; i++, idx++)
- sf[idx] = 0.0;
- } else if ((band_type[idx] == INTENSITY_BT) ||
- (band_type[idx] == INTENSITY_BT2)) {
- for (; i < run_end; i++, idx++) {
- offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- clipped_offset = av_clip(offset[2], -155, 100);
- if (offset[2] != clipped_offset) {
- avpriv_request_sample(ac->avctx,
- "If you heard an audible artifact, there may be a bug in the decoder. "
- "Clipped intensity stereo position (%d -> %d)",
- offset[2], clipped_offset);
- }
- sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
- }
- } else if (band_type[idx] == NOISE_BT) {
- for (; i < run_end; i++, idx++) {
- if (noise_flag-- > 0)
- offset[1] += get_bits(gb, NOISE_PRE_BITS) - NOISE_PRE;
- else
- offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- clipped_offset = av_clip(offset[1], -100, 155);
- if (offset[1] != clipped_offset) {
- avpriv_request_sample(ac->avctx,
- "If you heard an audible artifact, there may be a bug in the decoder. "
- "Clipped noise gain (%d -> %d)",
- offset[1], clipped_offset);
- }
- sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
- }
- } else {
- for (; i < run_end; i++, idx++) {
- offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- if (offset[0] > 255U) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Scalefactor (%d) out of range.\n", offset[0]);
- return AVERROR_INVALIDDATA;
- }
- sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode pulse data; reference: table 4.7.
- */
-static int decode_pulses(Pulse *pulse, GetBitContext *gb,
- const uint16_t *swb_offset, int num_swb)
-{
- int i, pulse_swb;
- pulse->num_pulse = get_bits(gb, 2) + 1;
- pulse_swb = get_bits(gb, 6);
- if (pulse_swb >= num_swb)
- return -1;
- pulse->pos[0] = swb_offset[pulse_swb];
- pulse->pos[0] += get_bits(gb, 5);
- if (pulse->pos[0] >= swb_offset[num_swb])
- return -1;
- pulse->amp[0] = get_bits(gb, 4);
- for (i = 1; i < pulse->num_pulse; i++) {
- pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];
- if (pulse->pos[i] >= swb_offset[num_swb])
- return -1;
- pulse->amp[i] = get_bits(gb, 4);
- }
- return 0;
-}
-
-/**
- * Decode Temporal Noise Shaping data; reference: table 4.48.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
- GetBitContext *gb, const IndividualChannelStream *ics)
-{
- int w, filt, i, coef_len, coef_res, coef_compress;
- const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE;
- const int tns_max_order = is8 ? 7 : ac->oc[1].m4ac.object_type == AOT_AAC_MAIN ? 20 : 12;
- for (w = 0; w < ics->num_windows; w++) {
- if ((tns->n_filt[w] = get_bits(gb, 2 - is8))) {
- coef_res = get_bits1(gb);
-
- for (filt = 0; filt < tns->n_filt[w]; filt++) {
- int tmp2_idx;
- tns->length[w][filt] = get_bits(gb, 6 - 2 * is8);
-
- if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "TNS filter order %d is greater than maximum %d.\n",
- tns->order[w][filt], tns_max_order);
- tns->order[w][filt] = 0;
- return AVERROR_INVALIDDATA;
- }
- if (tns->order[w][filt]) {
- tns->direction[w][filt] = get_bits1(gb);
- coef_compress = get_bits1(gb);
- coef_len = coef_res + 3 - coef_compress;
- tmp2_idx = 2 * coef_compress + coef_res;
-
- for (i = 0; i < tns->order[w][filt]; i++)
- tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode Mid/Side data; reference: table 4.54.
- *
- * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
- * [1] mask is decoded from bitstream; [2] mask is all 1s;
- * [3] reserved for scalable AAC
- */
-static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
- int ms_present)
-{
- int idx;
- int max_idx = cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
- if (ms_present == 1) {
- for (idx = 0; idx < max_idx; idx++)
- cpe->ms_mask[idx] = get_bits1(gb);
- } else if (ms_present == 2) {
- memset(cpe->ms_mask, 1, max_idx * sizeof(cpe->ms_mask[0]));
- }
-}
-
#ifndef VMUL2
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
const float *scale)
@@ -1622,233 +146,6 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
}
#endif
-/**
- * Decode spectral data; reference: table 4.50.
- * Dequantize and scale spectral data; reference: 4.6.3.3.
- *
- * @param coef array of dequantized, scaled spectral data
- * @param sf array of scalefactors or intensity stereo positions
- * @param pulse_present set if pulses are present
- * @param pulse pointer to pulse data struct
- * @param band_type array of the used band type
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
- GetBitContext *gb, const float sf[120],
- int pulse_present, const Pulse *pulse,
- const IndividualChannelStream *ics,
- enum BandType band_type[120])
-{
- int i, k, g, idx = 0;
- const int c = 1024 / ics->num_windows;
- const uint16_t *offsets = ics->swb_offset;
- float *coef_base = coef;
-
- for (g = 0; g < ics->num_windows; g++)
- memset(coef + g * 128 + offsets[ics->max_sfb], 0,
- sizeof(float) * (c - offsets[ics->max_sfb]));
-
- for (g = 0; g < ics->num_window_groups; g++) {
- unsigned g_len = ics->group_len[g];
-
- for (i = 0; i < ics->max_sfb; i++, idx++) {
- const unsigned cbt_m1 = band_type[idx] - 1;
- float *cfo = coef + offsets[i];
- int off_len = offsets[i + 1] - offsets[i];
- int group;
-
- if (cbt_m1 >= INTENSITY_BT2 - 1) {
- for (group = 0; group < g_len; group++, cfo+=128) {
- memset(cfo, 0, off_len * sizeof(float));
- }
- } else if (cbt_m1 == NOISE_BT - 1) {
- for (group = 0; group < g_len; group++, cfo+=128) {
- float scale;
- float band_energy;
-
- 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);
- }
- } else {
- const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
- const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
- VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
- OPEN_READER(re, gb);
-
- switch (cbt_m1 >> 1) {
- case 0:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned cb_idx;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- cf = VMUL4(cf, vq, cb_idx, sf + idx);
- } while (len -= 4);
- }
- break;
-
- case 1:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned nnz;
- unsigned cb_idx;
- uint32_t bits;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 8 & 15;
- bits = nnz ? GET_CACHE(re, gb) : 0;
- LAST_SKIP_BITS(re, gb, nnz);
- cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
- } while (len -= 4);
- }
- break;
-
- case 2:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned cb_idx;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- cf = VMUL2(cf, vq, cb_idx, sf + idx);
- } while (len -= 2);
- }
- break;
-
- case 3:
- case 4:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned nnz;
- unsigned cb_idx;
- unsigned sign;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 8 & 15;
- sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
- LAST_SKIP_BITS(re, gb, nnz);
- cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
- } while (len -= 2);
- }
- break;
-
- default:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- uint32_t *icf = (uint32_t *) cf;
- int len = off_len;
-
- do {
- int code;
- unsigned nzt, nnz;
- unsigned cb_idx;
- uint32_t bits;
- int j;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (!code) {
- *icf++ = 0;
- *icf++ = 0;
- continue;
- }
-
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 12;
- nzt = cb_idx >> 8;
- bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
- LAST_SKIP_BITS(re, gb, nnz);
-
- for (j = 0; j < 2; j++) {
- if (nzt & 1<<j) {
- uint32_t b;
- int n;
- /* The total length of escape_sequence must be < 22 bits according
- to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
- UPDATE_CACHE(re, gb);
- b = GET_CACHE(re, gb);
- b = 31 - av_log2(~b);
-
- if (b > 8) {
- av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
- return AVERROR_INVALIDDATA;
- }
-
- SKIP_BITS(re, gb, b + 1);
- b += 4;
- n = (1 << b) + SHOW_UBITS(re, gb, b);
- LAST_SKIP_BITS(re, gb, b);
- *icf++ = cbrt_tab[n] | (bits & 1U<<31);
- bits <<= 1;
- } else {
- unsigned v = ((const uint32_t*)vq)[cb_idx & 15];
- *icf++ = (bits & 1U<<31) | v;
- bits <<= !!v;
- }
- cb_idx >>= 4;
- }
- } while (len -= 2);
-
- ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
- }
- }
-
- CLOSE_READER(re, gb);
- }
- }
- coef += g_len << 7;
- }
-
- if (pulse_present) {
- idx = 0;
- for (i = 0; i < pulse->num_pulse; i++) {
- float co = coef_base[ pulse->pos[i] ];
- while (offsets[idx + 1] <= pulse->pos[i])
- idx++;
- if (band_type[idx] != NOISE_BT && sf[idx]) {
- float ico = -pulse->amp[i];
- if (co) {
- co /= sf[idx];
- ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
- }
- coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
- }
- }
- }
- return 0;
-}
-
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
@@ -1905,771 +202,6 @@ static av_always_inline void predict(PredictorState *ps, float *coef,
}
/**
- * Apply AAC-Main style frequency domain prediction.
- */
-static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
-{
- int sfb, k;
-
- if (!sce->ics.predictor_initialized) {
- reset_all_predictors(sce->predictor_state);
- sce->ics.predictor_initialized = 1;
- }
-
- if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
- for (sfb = 0;
- sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
- sfb++) {
- for (k = sce->ics.swb_offset[sfb];
- k < sce->ics.swb_offset[sfb + 1];
- k++) {
- predict(&sce->predictor_state[k], &sce->coeffs[k],
- sce->ics.predictor_present &&
- sce->ics.prediction_used[sfb]);
- }
- }
- if (sce->ics.predictor_reset_group)
- reset_predictor_group(sce->predictor_state,
- sce->ics.predictor_reset_group);
- } else
- reset_all_predictors(sce->predictor_state);
-}
-
-/**
- * Decode an individual_channel_stream payload; reference: table 4.44.
- *
- * @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information.
- * @param scale_flag scalable [1] or non-scalable [0] AAC (Unused until scalable AAC is implemented.)
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_ics(AACContext *ac, SingleChannelElement *sce,
- GetBitContext *gb, int common_window, int scale_flag)
-{
- Pulse pulse;
- TemporalNoiseShaping *tns = &sce->tns;
- IndividualChannelStream *ics = &sce->ics;
- float *out = sce->coeffs;
- int global_gain, eld_syntax, er_syntax, pulse_present = 0;
- int ret;
-
- eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
- er_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_LC ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_LTP ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_LD ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
- /* This assignment is to silence a GCC warning about the variable being used
- * uninitialized when in fact it always is.
- */
- pulse.num_pulse = 0;
-
- global_gain = get_bits(gb, 8);
-
- if (!common_window && !scale_flag) {
- if (decode_ics_info(ac, ics, gb) < 0)
- return AVERROR_INVALIDDATA;
- }
-
- if ((ret = decode_band_types(ac, sce->band_type,
- sce->band_type_run_end, gb, ics)) < 0)
- return ret;
- if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
- sce->band_type, sce->band_type_run_end)) < 0)
- return ret;
-
- pulse_present = 0;
- if (!scale_flag) {
- if (!eld_syntax && (pulse_present = get_bits1(gb))) {
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Pulse tool not allowed in eight short sequence.\n");
- return AVERROR_INVALIDDATA;
- }
- if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Pulse data corrupt or invalid.\n");
- return AVERROR_INVALIDDATA;
- }
- }
- tns->present = get_bits1(gb);
- if (tns->present && !er_syntax)
- if (decode_tns(ac, tns, gb, ics) < 0)
- return AVERROR_INVALIDDATA;
- if (!eld_syntax && get_bits1(gb)) {
- avpriv_request_sample(ac->avctx, "SSR");
- return AVERROR_PATCHWELCOME;
- }
- // I see no textual basis in the spec for this occurring after SSR gain
- // control, but this is what both reference and real implmentations do
- if (tns->present && er_syntax)
- if (decode_tns(ac, tns, gb, ics) < 0)
- return AVERROR_INVALIDDATA;
- }
-
- if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
- &pulse, ics, sce->band_type) < 0)
- return AVERROR_INVALIDDATA;
-
- if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
- apply_prediction(ac, sce);
-
- return 0;
-}
-
-/**
- * Mid/Side stereo decoding; reference: 4.6.8.1.3.
- */
-static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
-{
- const IndividualChannelStream *ics = &cpe->ch[0].ics;
- float *ch0 = cpe->ch[0].coeffs;
- float *ch1 = cpe->ch[1].coeffs;
- int g, i, group, idx = 0;
- const uint16_t *offsets = ics->swb_offset;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb; i++, idx++) {
- if (cpe->ms_mask[idx] &&
- cpe->ch[0].band_type[idx] < NOISE_BT &&
- cpe->ch[1].band_type[idx] < NOISE_BT) {
- for (group = 0; group < ics->group_len[g]; group++) {
- ac->fdsp->butterflies_float(ch0 + group * 128 + offsets[i],
- ch1 + group * 128 + offsets[i],
- offsets[i+1] - offsets[i]);
- }
- }
- }
- ch0 += ics->group_len[g] * 128;
- ch1 += ics->group_len[g] * 128;
- }
-}
-
-/**
- * intensity stereo decoding; reference: 4.6.8.2.3
- *
- * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
- * [1] mask is decoded from bitstream; [2] mask is all 1s;
- * [3] reserved for scalable AAC
- */
-static void apply_intensity_stereo(AACContext *ac,
- ChannelElement *cpe, int ms_present)
-{
- const IndividualChannelStream *ics = &cpe->ch[1].ics;
- SingleChannelElement *sce1 = &cpe->ch[1];
- float *coef0 = cpe->ch[0].coeffs, *coef1 = cpe->ch[1].coeffs;
- const uint16_t *offsets = ics->swb_offset;
- int g, group, i, idx = 0;
- int c;
- float scale;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb;) {
- if (sce1->band_type[idx] == INTENSITY_BT ||
- sce1->band_type[idx] == INTENSITY_BT2) {
- const int bt_run_end = sce1->band_type_run_end[idx];
- for (; i < bt_run_end; i++, idx++) {
- c = -1 + 2 * (sce1->band_type[idx] - 14);
- if (ms_present)
- c *= 1 - 2 * cpe->ms_mask[idx];
- scale = c * sce1->sf[idx];
- for (group = 0; group < ics->group_len[g]; group++)
- ac->fdsp->vector_fmul_scalar(coef1 + group * 128 + offsets[i],
- coef0 + group * 128 + offsets[i],
- scale,
- offsets[i + 1] - offsets[i]);
- }
- } else {
- int bt_run_end = sce1->band_type_run_end[idx];
- idx += bt_run_end - i;
- i = bt_run_end;
- }
- }
- coef0 += ics->group_len[g] * 128;
- coef1 += ics->group_len[g] * 128;
- }
-}
-
-/**
- * Decode a channel_pair_element; reference: table 4.4.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
-{
- int i, ret, common_window, ms_present = 0;
- int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
- common_window = eld_syntax || get_bits1(gb);
- if (common_window) {
- if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
- return AVERROR_INVALIDDATA;
- i = cpe->ch[1].ics.use_kb_window[0];
- cpe->ch[1].ics = cpe->ch[0].ics;
- cpe->ch[1].ics.use_kb_window[1] = i;
- if (cpe->ch[1].ics.predictor_present &&
- (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
- if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
- decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
- ms_present = get_bits(gb, 2);
- if (ms_present == 3) {
- av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
- return AVERROR_INVALIDDATA;
- } else if (ms_present)
- decode_mid_side_stereo(cpe, gb, ms_present);
- }
- if ((ret = decode_ics(ac, &cpe->ch[0], gb, common_window, 0)))
- return ret;
- if ((ret = decode_ics(ac, &cpe->ch[1], gb, common_window, 0)))
- return ret;
-
- if (common_window) {
- if (ms_present)
- apply_mid_side_stereo(ac, cpe);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN) {
- apply_prediction(ac, &cpe->ch[0]);
- apply_prediction(ac, &cpe->ch[1]);
- }
- }
-
- apply_intensity_stereo(ac, cpe, ms_present);
- return 0;
-}
-
-static const float cce_scale[] = {
- 1.09050773266525765921, //2^(1/8)
- 1.18920711500272106672, //2^(1/4)
- M_SQRT2,
- 2,
-};
-
-/**
- * Decode coupling_channel_element; reference: table 4.8.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
-{
- int num_gain = 0;
- int c, g, sfb, ret;
- int sign;
- float scale;
- SingleChannelElement *sce = &che->ch[0];
- ChannelCoupling *coup = &che->coup;
-
- coup->coupling_point = 2 * get_bits1(gb);
- coup->num_coupled = get_bits(gb, 3);
- for (c = 0; c <= coup->num_coupled; c++) {
- num_gain++;
- coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE;
- coup->id_select[c] = get_bits(gb, 4);
- if (coup->type[c] == TYPE_CPE) {
- coup->ch_select[c] = get_bits(gb, 2);
- if (coup->ch_select[c] == 3)
- num_gain++;
- } else
- coup->ch_select[c] = 2;
- }
- coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
-
- sign = get_bits(gb, 1);
- scale = cce_scale[get_bits(gb, 2)];
-
- if ((ret = decode_ics(ac, sce, gb, 0, 0)))
- return ret;
-
- for (c = 0; c < num_gain; c++) {
- int idx = 0;
- int cge = 1;
- int gain = 0;
- float gain_cache = 1.0;
- if (c) {
- cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
- gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;
- gain_cache = powf(scale, -gain);
- }
- if (coup->coupling_point == AFTER_IMDCT) {
- coup->gain[c][0] = gain_cache;
- } else {
- for (g = 0; g < sce->ics.num_window_groups; g++) {
- for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) {
- if (sce->band_type[idx] != ZERO_BT) {
- if (!cge) {
- int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
- if (t) {
- int s = 1;
- t = gain += t;
- if (sign) {
- s -= 2 * (t & 0x1);
- t >>= 1;
- }
- gain_cache = powf(scale, -t) * s;
- }
- }
- coup->gain[c][idx] = gain_cache;
- }
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Parse whether channels are to be excluded from Dynamic Range Compression; reference: table 4.53.
- *
- * @return Returns number of bytes consumed.
- */
-static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc,
- GetBitContext *gb)
-{
- int i;
- int num_excl_chan = 0;
-
- do {
- for (i = 0; i < 7; i++)
- che_drc->exclude_mask[num_excl_chan++] = get_bits1(gb);
- } while (num_excl_chan < MAX_CHANNELS - 7 && get_bits1(gb));
-
- return num_excl_chan / 7;
-}
-
-/**
- * Decode dynamic range information; reference: table 4.52.
- *
- * @return Returns number of bytes consumed.
- */
-static int decode_dynamic_range(DynamicRangeControl *che_drc,
- GetBitContext *gb)
-{
- int n = 1;
- int drc_num_bands = 1;
- int i;
-
- /* pce_tag_present? */
- if (get_bits1(gb)) {
- che_drc->pce_instance_tag = get_bits(gb, 4);
- skip_bits(gb, 4); // tag_reserved_bits
- n++;
- }
-
- /* excluded_chns_present? */
- if (get_bits1(gb)) {
- n += decode_drc_channel_exclusions(che_drc, gb);
- }
-
- /* drc_bands_present? */
- if (get_bits1(gb)) {
- che_drc->band_incr = get_bits(gb, 4);
- che_drc->interpolation_scheme = get_bits(gb, 4);
- n++;
- drc_num_bands += che_drc->band_incr;
- for (i = 0; i < drc_num_bands; i++) {
- che_drc->band_top[i] = get_bits(gb, 8);
- n++;
- }
- }
-
- /* prog_ref_level_present? */
- if (get_bits1(gb)) {
- che_drc->prog_ref_level = get_bits(gb, 7);
- skip_bits1(gb); // prog_ref_level_reserved_bits
- n++;
- }
-
- for (i = 0; i < drc_num_bands; i++) {
- che_drc->dyn_rng_sgn[i] = get_bits1(gb);
- che_drc->dyn_rng_ctl[i] = get_bits(gb, 7);
- n++;
- }
-
- return n;
-}
-
-static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
- uint8_t buf[256];
- int i, major, minor;
-
- if (len < 13+7*8)
- goto unknown;
-
- get_bits(gb, 13); len -= 13;
-
- for(i=0; i+1<sizeof(buf) && len>=8; i++, len-=8)
- buf[i] = get_bits(gb, 8);
-
- buf[i] = 0;
- if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);
-
- if (sscanf(buf, "libfaac %d.%d", &major, &minor) == 2){
- ac->avctx->internal->skip_samples = 1024;
- }
-
-unknown:
- skip_bits_long(gb, len);
-
- return 0;
-}
-
-/**
- * Decode extension data (incomplete); reference: table 4.51.
- *
- * @param cnt length of TYPE_FIL syntactic element in bytes
- *
- * @return Returns number of bytes consumed
- */
-static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
- ChannelElement *che, enum RawDataBlockType elem_type)
-{
- int crc_flag = 0;
- int res = cnt;
- int type = get_bits(gb, 4);
-
- if (ac->avctx->debug & FF_DEBUG_STARTCODE)
- av_log(ac->avctx, AV_LOG_DEBUG, "extension type: %d len:%d\n", type, cnt);
-
- switch (type) { // extension type
- case EXT_SBR_DATA_CRC:
- crc_flag++;
- case EXT_SBR_DATA:
- if (!che) {
- av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
- return res;
- } else if (!ac->oc[1].m4ac.sbr) {
- av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
- skip_bits_long(gb, 8 * cnt - 4);
- return res;
- } else if (ac->oc[1].m4ac.sbr == -1 && ac->oc[1].status == OC_LOCKED) {
- av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n");
- skip_bits_long(gb, 8 * cnt - 4);
- return res;
- } else if (ac->oc[1].m4ac.ps == -1 && ac->oc[1].status < OC_LOCKED && ac->avctx->channels == 1) {
- ac->oc[1].m4ac.sbr = 1;
- ac->oc[1].m4ac.ps = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
- output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
- ac->oc[1].status, 1);
- } else {
- ac->oc[1].m4ac.sbr = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE;
- }
- res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
- break;
- case EXT_DYNAMIC_RANGE:
- res = decode_dynamic_range(&ac->che_drc, gb);
- break;
- case EXT_FILL:
- decode_fill(ac, gb, 8 * cnt - 4);
- break;
- case EXT_FILL_DATA:
- case EXT_DATA_ELEMENT:
- default:
- skip_bits_long(gb, 8 * cnt - 4);
- break;
- };
- return res;
-}
-
-/**
- * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
- *
- * @param decode 1 if tool is used normally, 0 if tool is used in LTP.
- * @param coef spectral coefficients
- */
-static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
- IndividualChannelStream *ics, int decode)
-{
- const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
- int w, filt, m, i;
- int bottom, top, order, start, end, size, inc;
- float lpc[TNS_MAX_ORDER];
- float tmp[TNS_MAX_ORDER+1];
-
- for (w = 0; w < ics->num_windows; w++) {
- bottom = ics->num_swb;
- for (filt = 0; filt < tns->n_filt[w]; filt++) {
- top = bottom;
- bottom = FFMAX(0, top - tns->length[w][filt]);
- order = tns->order[w][filt];
- if (order == 0)
- continue;
-
- // tns_decode_coef
- compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
-
- start = ics->swb_offset[FFMIN(bottom, mmm)];
- end = ics->swb_offset[FFMIN( top, mmm)];
- if ((size = end - start) <= 0)
- continue;
- if (tns->direction[w][filt]) {
- inc = -1;
- start = end - 1;
- } else {
- inc = 1;
- }
- start += w * 128;
-
- if (decode) {
- // ar filter
- for (m = 0; m < size; m++, start += inc)
- for (i = 1; i <= FFMIN(m, order); i++)
- coef[start] -= coef[start - i * inc] * lpc[i - 1];
- } else {
- // ma filter
- for (m = 0; m < size; m++, start += inc) {
- tmp[0] = coef[start];
- for (i = 1; i <= FFMIN(m, order); i++)
- coef[start] += tmp[i] * lpc[i - 1];
- for (i = order; i > 0; i--)
- tmp[i] = tmp[i - 1];
- }
- }
- }
- }
-}
-
-/**
- * Apply windowing and MDCT to obtain the spectral
- * coefficient from the predicted sample by LTP.
- */
-static void windowing_and_mdct_ltp(AACContext *ac, float *out,
- float *in, IndividualChannelStream *ics)
-{
- const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-
- if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
- ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
- } else {
- memset(in, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul(in + 448, in + 448, swindow_prev, 128);
- }
- if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
- ac->fdsp->vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
- } else {
- ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
- memset(in + 1024 + 576, 0, 448 * sizeof(float));
- }
- ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
-}
-
-/**
- * Apply the long term prediction
- */
-static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
-{
- const LongTermPrediction *ltp = &sce->ics.ltp;
- const uint16_t *offsets = sce->ics.swb_offset;
- int i, sfb;
-
- if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
- float *predTime = sce->ret;
- float *predFreq = ac->buf_mdct;
- int16_t num_samples = 2048;
-
- if (ltp->lag < 1024)
- num_samples = ltp->lag + 1024;
- for (i = 0; i < num_samples; i++)
- predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
- memset(&predTime[i], 0, (2048 - i) * sizeof(float));
-
- ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
-
- if (sce->tns.present)
- ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
-
- for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
- if (ltp->used[sfb])
- for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
- sce->coeffs[i] += predFreq[i];
- }
-}
-
-/**
- * Update the LTP buffer for next frame
- */
-static void update_ltp(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *saved = sce->saved;
- float *saved_ltp = sce->coeffs;
- const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- int i;
-
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- memcpy(saved_ltp, saved, 512 * sizeof(float));
- memset(saved_ltp + 576, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
- for (i = 0; i < 64; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
- } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
- memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
- memset(saved_ltp + 576, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
- for (i = 0; i < 64; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
- } else { // LONG_STOP or ONLY_LONG
- ac->fdsp->vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
- for (i = 0; i < 512; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
- }
-
- memcpy(sce->ltp_state, sce->ltp_state+1024, 1024 * sizeof(*sce->ltp_state));
- memcpy(sce->ltp_state+1024, sce->ret, 1024 * sizeof(*sce->ltp_state));
- memcpy(sce->ltp_state+2048, saved_ltp, 1024 * sizeof(*sce->ltp_state));
-}
-
-/**
- * Conduct IMDCT and windowing.
- */
-static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
- float *buf = ac->buf_mdct;
- float *temp = ac->temp;
- int i;
-
- // imdct
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- for (i = 0; i < 1024; i += 128)
- ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i);
- } else
- ac->mdct.imdct_half(&ac->mdct, buf, in);
-
- /* window overlapping
- * NOTE: To simplify the overlapping code, all 'meaningless' short to long
- * and long to short transitions are considered to be short to short
- * transitions. This leaves just two cases (long to long and short to short)
- * with a little special sauce for EIGHT_SHORT_SEQUENCE.
- */
- if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
- (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
- ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 512);
- } else {
- memcpy( out, saved, 448 * sizeof(float));
-
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- ac->fdsp->vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
- ac->fdsp->vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
- memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
- } else {
- ac->fdsp->vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
- memcpy( out + 576, buf + 64, 448 * sizeof(float));
- }
- }
-
- // buffer update
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- memcpy( saved, temp + 64, 64 * sizeof(float));
- ac->fdsp->vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
- ac->fdsp->vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
- ac->fdsp->vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
- memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
- } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
- memcpy( saved, buf + 512, 448 * sizeof(float));
- memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
- } else { // LONG_STOP or ONLY_LONG
- memcpy( saved, buf + 512, 512 * sizeof(float));
- }
-}
-
-static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- float *buf = ac->buf_mdct;
-
- // imdct
- ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
-
- // window overlapping
- if (ics->use_kb_window[1]) {
- // AAC LD uses a low overlap sine window instead of a KBD window
- memcpy(out, saved, 192 * sizeof(float));
- ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
- memcpy( out + 320, buf + 64, 192 * sizeof(float));
- } else {
- ac->fdsp->vector_fmul_window(out, saved, buf, ff_sine_512, 256);
- }
-
- // buffer update
- memcpy(saved, buf + 256, 256 * sizeof(float));
-}
-
-static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
-{
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- float *buf = ac->buf_mdct;
- int i;
- const int n = ac->oc[1].m4ac.frame_length_short ? 480 : 512;
- const int n2 = n >> 1;
- const int n4 = n >> 2;
- const float *const window = n == 480 ? ff_aac_eld_window_480 :
- ff_aac_eld_window_512;
-
- // Inverse transform, mapped to the conventional IMDCT by
- // Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
- // "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
- // International Conference on Audio, Language and Image Processing, ICALIP 2008.
- // URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
- for (i = 0; i < n2; i+=2) {
- float temp;
- temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
- temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp;
- }
- if (n == 480)
- ac->mdct480->imdct_half(ac->mdct480, buf, in, 1, -1.f/(16*1024*960));
- else
- ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
- for (i = 0; i < n; i+=2) {
- buf[i] = -buf[i];
- }
- // Like with the regular IMDCT at this point we still have the middle half
- // of a transform but with even symmetry on the left and odd symmetry on
- // the right
-
- // window overlapping
- // The spec says to use samples [0..511] but the reference decoder uses
- // samples [128..639].
- for (i = n4; i < n2; i ++) {
- out[i - n4] = buf[n2 - 1 - i] * window[i - n4] +
- saved[ i + n2] * window[i + n - n4] +
- -saved[ n + n2 - 1 - i] * window[i + 2*n - n4] +
- -saved[2*n + n2 + i] * window[i + 3*n - n4];
- }
- for (i = 0; i < n2; i ++) {
- out[n4 + i] = buf[i] * window[i + n2 - n4] +
- -saved[ n - 1 - i] * window[i + n2 + n - n4] +
- -saved[ n + i] * window[i + n2 + 2*n - n4] +
- saved[2*n + n - 1 - i] * window[i + n2 + 3*n - n4];
- }
- for (i = 0; i < n4; i ++) {
- out[n2 + n4 + i] = buf[ i + n2] * window[i + n - n4] +
- -saved[ n2 - 1 - i] * window[i + 2*n - n4] +
- -saved[ n + n2 + i] * window[i + 3*n - n4];
- }
-
- // buffer update
- memmove(saved + n, saved, 2 * n * sizeof(float));
- memcpy( saved, buf, n * sizeof(float));
-}
-
-/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
@@ -2724,506 +256,7 @@ static void apply_independent_coupling(AACContext *ac,
dest[i] += gain * src[i];
}
-/**
- * channel coupling transformation interface
- *
- * @param apply_coupling_method pointer to (in)dependent coupling function
- */
-static void apply_channel_coupling(AACContext *ac, ChannelElement *cc,
- enum RawDataBlockType type, int elem_id,
- enum CouplingPoint coupling_point,
- void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index))
-{
- int i, c;
-
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *cce = ac->che[TYPE_CCE][i];
- int index = 0;
-
- if (cce && cce->coup.coupling_point == coupling_point) {
- ChannelCoupling *coup = &cce->coup;
-
- for (c = 0; c <= coup->num_coupled; c++) {
- if (coup->type[c] == type && coup->id_select[c] == elem_id) {
- if (coup->ch_select[c] != 1) {
- apply_coupling_method(ac, &cc->ch[0], cce, index);
- if (coup->ch_select[c] != 0)
- index++;
- }
- if (coup->ch_select[c] != 2)
- apply_coupling_method(ac, &cc->ch[1], cce, index++);
- } else
- index += 1 + (coup->ch_select[c] == 3);
- }
- }
- }
-}
-
-/**
- * Convert spectral data to float samples, applying all supported tools as appropriate.
- */
-static void spectral_to_sample(AACContext *ac)
-{
- int i, type;
- void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);
- switch (ac->oc[1].m4ac.object_type) {
- case AOT_ER_AAC_LD:
- imdct_and_window = imdct_and_windowing_ld;
- break;
- case AOT_ER_AAC_ELD:
- imdct_and_window = imdct_and_windowing_eld;
- break;
- default:
- imdct_and_window = ac->imdct_and_windowing;
- }
- for (type = 3; type >= 0; type--) {
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *che = ac->che[type][i];
- if (che && che->present) {
- if (type <= TYPE_CPE)
- apply_channel_coupling(ac, che, type, i, BEFORE_TNS, apply_dependent_coupling);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
- if (che->ch[0].ics.predictor_present) {
- if (che->ch[0].ics.ltp.present)
- ac->apply_ltp(ac, &che->ch[0]);
- if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
- ac->apply_ltp(ac, &che->ch[1]);
- }
- }
- if (che->ch[0].tns.present)
- ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
- if (che->ch[1].tns.present)
- ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
- if (type <= TYPE_CPE)
- apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
- if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
- imdct_and_window(ac, &che->ch[0]);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
- ac->update_ltp(ac, &che->ch[0]);
- if (type == TYPE_CPE) {
- imdct_and_window(ac, &che->ch[1]);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
- ac->update_ltp(ac, &che->ch[1]);
- }
- if (ac->oc[1].m4ac.sbr > 0) {
- ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
- }
- }
- if (type <= TYPE_CCE)
- apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
- che->present = 0;
- } else if (che) {
- av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
- }
- }
- }
-}
-
-static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
-{
- int size;
- AACADTSHeaderInfo hdr_info;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags, ret;
-
- size = avpriv_aac_parse_header(gb, &hdr_info);
- if (size > 0) {
- if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
- // This is 2 for "VLB " audio in NSV files.
- // See samples/nsv/vlb_audio.
- avpriv_report_missing_feature(ac->avctx,
- "More than one AAC RDB per ADTS frame");
- ac->warned_num_aac_frames = 1;
- }
- push_output_configuration(ac);
- if (hdr_info.chan_config) {
- ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
- if ((ret = set_default_channel_config(ac->avctx,
- layout_map,
- &layout_map_tags,
- hdr_info.chan_config)) < 0)
- return ret;
- if ((ret = output_configure(ac, layout_map, layout_map_tags,
- FFMAX(ac->oc[1].status,
- OC_TRIAL_FRAME), 0)) < 0)
- return ret;
- } else {
- ac->oc[1].m4ac.chan_config = 0;
- /**
- * dual mono frames in Japanese DTV can have chan_config 0
- * WITHOUT specifying PCE.
- * thus, set dual mono as default.
- */
- if (ac->dmono_mode && ac->oc[0].status == OC_NONE) {
- layout_map_tags = 2;
- layout_map[0][0] = layout_map[1][0] = TYPE_SCE;
- layout_map[0][2] = layout_map[1][2] = AAC_CHANNEL_FRONT;
- layout_map[0][1] = 0;
- layout_map[1][1] = 1;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 0))
- return -7;
- }
- }
- ac->oc[1].m4ac.sample_rate = hdr_info.sample_rate;
- ac->oc[1].m4ac.sampling_index = hdr_info.sampling_index;
- ac->oc[1].m4ac.object_type = hdr_info.object_type;
- ac->oc[1].m4ac.frame_length_short = 0;
- if (ac->oc[0].status != OC_LOCKED ||
- ac->oc[0].m4ac.chan_config != hdr_info.chan_config ||
- ac->oc[0].m4ac.sample_rate != hdr_info.sample_rate) {
- ac->oc[1].m4ac.sbr = -1;
- ac->oc[1].m4ac.ps = -1;
- }
- if (!hdr_info.crc_absent)
- skip_bits(gb, 16);
- }
- return size;
-}
-
-static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, GetBitContext *gb)
-{
- AACContext *ac = avctx->priv_data;
- const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
- ChannelElement *che;
- int err, i;
- int samples = m4ac->frame_length_short ? 960 : 1024;
- int chan_config = m4ac->chan_config;
- int aot = m4ac->object_type;
-
- if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
- samples >>= 1;
-
- ac->frame = data;
-
- if ((err = frame_configure_elements(avctx)) < 0)
- return err;
-
- // The FF_PROFILE_AAC_* defines are all object_type - 1
- // This may lead to an undefined profile being signaled
- ac->avctx->profile = aot - 1;
-
- ac->tags_mapped = 0;
-
- if (chan_config < 0 || (chan_config >= 8 && chan_config < 11) || chan_config >= 13) {
- avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
- chan_config);
- return AVERROR_INVALIDDATA;
- }
- for (i = 0; i < tags_per_config[chan_config]; i++) {
- const int elem_type = aac_channel_layout_map[chan_config-1][i][0];
- const int elem_id = aac_channel_layout_map[chan_config-1][i][1];
- if (!(che=get_che(ac, elem_type, elem_id))) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "channel element %d.%d is not allocated\n",
- elem_type, elem_id);
- return AVERROR_INVALIDDATA;
- }
- che->present = 1;
- if (aot != AOT_ER_AAC_ELD)
- skip_bits(gb, 4);
- switch (elem_type) {
- case TYPE_SCE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- break;
- case TYPE_CPE:
- err = decode_cpe(ac, gb, che);
- break;
- case TYPE_LFE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- break;
- }
- if (err < 0)
- return err;
- }
-
- spectral_to_sample(ac);
-
- ac->frame->nb_samples = samples;
- ac->frame->sample_rate = avctx->sample_rate;
- *got_frame_ptr = 1;
-
- skip_bits_long(gb, get_bits_left(gb));
- return 0;
-}
-
-static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
-{
- AACContext *ac = avctx->priv_data;
- ChannelElement *che = NULL, *che_prev = NULL;
- enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
- int err, elem_id;
- int samples = 0, multiplier, audio_found = 0, pce_found = 0;
- int is_dmono, sce_count = 0;
-
- ac->frame = data;
-
- if (show_bits(gb, 12) == 0xfff) {
- if ((err = parse_adts_frame_header(ac, gb)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
- goto fail;
- }
- if (ac->oc[1].m4ac.sampling_index > 12) {
- av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- }
-
- if ((err = frame_configure_elements(avctx)) < 0)
- goto fail;
-
- // The FF_PROFILE_AAC_* defines are all object_type - 1
- // This may lead to an undefined profile being signaled
- ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
-
- ac->tags_mapped = 0;
- // parse
- while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
- elem_id = get_bits(gb, 4);
-
- if (avctx->debug & FF_DEBUG_STARTCODE)
- av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
-
- if (!avctx->channels && elem_type != TYPE_PCE) {
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
-
- if (elem_type < TYPE_DSE) {
- if (!(che=get_che(ac, elem_type, elem_id))) {
- av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
- elem_type, elem_id);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- samples = 1024;
- che->present = 1;
- }
-
- switch (elem_type) {
-
- case TYPE_SCE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- audio_found = 1;
- sce_count++;
- break;
-
- case TYPE_CPE:
- err = decode_cpe(ac, gb, che);
- audio_found = 1;
- break;
-
- case TYPE_CCE:
- err = decode_cce(ac, gb, che);
- break;
-
- case TYPE_LFE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- audio_found = 1;
- break;
-
- case TYPE_DSE:
- err = skip_data_stream_element(ac, gb);
- break;
-
- case TYPE_PCE: {
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags;
- push_output_configuration(ac);
- tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb);
- if (tags < 0) {
- err = tags;
- break;
- }
- if (pce_found) {
- av_log(avctx, AV_LOG_ERROR,
- "Not evaluating a further program_config_element as this construct is dubious at best.\n");
- } else {
- err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
- if (!err)
- ac->oc[1].m4ac.chan_config = 0;
- pce_found = 1;
- }
- break;
- }
-
- case TYPE_FIL:
- if (elem_id == 15)
- elem_id += get_bits(gb, 8) - 1;
- if (get_bits_left(gb) < 8 * elem_id) {
- av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- while (elem_id > 0)
- elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, elem_type_prev);
- err = 0; /* FIXME */
- break;
-
- default:
- err = AVERROR_BUG; /* should not happen, but keeps compiler happy */
- break;
- }
-
- che_prev = che;
- elem_type_prev = elem_type;
-
- if (err)
- goto fail;
-
- if (get_bits_left(gb) < 3) {
- av_log(avctx, AV_LOG_ERROR, overread_err);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- }
-
- if (!avctx->channels) {
- *got_frame_ptr = 0;
- return 0;
- }
-
- spectral_to_sample(ac);
-
- multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
- samples <<= multiplier;
-
- if (ac->oc[1].status && audio_found) {
- avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
- avctx->frame_size = samples;
- ac->oc[1].status = OC_LOCKED;
- }
-
- if (multiplier) {
- int side_size;
- const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
- if (side && side_size>=4)
- AV_WL32(side, 2*AV_RL32(side));
- }
-
- if (!ac->frame->data[0] && samples) {
- av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
-
- if (samples) {
- ac->frame->nb_samples = samples;
- ac->frame->sample_rate = avctx->sample_rate;
- } else
- av_frame_unref(ac->frame);
- *got_frame_ptr = !!samples;
-
- /* for dual-mono audio (SCE + SCE) */
- is_dmono = ac->dmono_mode && sce_count == 2 &&
- ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
- if (is_dmono) {
- if (ac->dmono_mode == 1)
- ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0];
- else if (ac->dmono_mode == 2)
- ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1];
- }
-
- return 0;
-fail:
- pop_output_configuration(ac);
- return err;
-}
-
-static int aac_decode_frame(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, AVPacket *avpkt)
-{
- AACContext *ac = avctx->priv_data;
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- GetBitContext gb;
- int buf_consumed;
- int buf_offset;
- int err;
- int new_extradata_size;
- const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
- AV_PKT_DATA_NEW_EXTRADATA,
- &new_extradata_size);
- int jp_dualmono_size;
- const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt,
- AV_PKT_DATA_JP_DUALMONO,
- &jp_dualmono_size);
-
- if (new_extradata && 0) {
- av_free(avctx->extradata);
- avctx->extradata = av_mallocz(new_extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
- if (!avctx->extradata)
- return AVERROR(ENOMEM);
- avctx->extradata_size = new_extradata_size;
- memcpy(avctx->extradata, new_extradata, new_extradata_size);
- push_output_configuration(ac);
- if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
- avctx->extradata,
- avctx->extradata_size*8, 1) < 0) {
- pop_output_configuration(ac);
- return AVERROR_INVALIDDATA;
- }
- }
-
- ac->dmono_mode = 0;
- if (jp_dualmono && jp_dualmono_size > 0)
- ac->dmono_mode = 1 + *jp_dualmono;
- if (ac->force_dmono_mode >= 0)
- ac->dmono_mode = ac->force_dmono_mode;
-
- if (INT_MAX / 8 <= buf_size)
- return AVERROR_INVALIDDATA;
-
- if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
- return err;
-
- switch (ac->oc[1].m4ac.object_type) {
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_LD:
- case AOT_ER_AAC_ELD:
- err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb);
- break;
- default:
- err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt);
- }
- if (err < 0)
- return err;
-
- buf_consumed = (get_bits_count(&gb) + 7) >> 3;
- for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
- if (buf[buf_offset])
- break;
-
- return buf_size > buf_offset ? buf_consumed : buf_size;
-}
-
-static av_cold int aac_decode_close(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int i, type;
-
- for (i = 0; i < MAX_ELEM_ID; i++) {
- for (type = 0; type < 4; type++) {
- if (ac->che[type][i])
- ff_aac_sbr_ctx_close(&ac->che[type][i]->sbr);
- av_freep(&ac->che[type][i]);
- }
- }
-
- ff_mdct_end(&ac->mdct);
- ff_mdct_end(&ac->mdct_small);
- ff_mdct_end(&ac->mdct_ld);
- ff_mdct_end(&ac->mdct_ltp);
- ff_imdct15_uninit(&ac->mdct480);
- av_freep(&ac->fdsp);
- return 0;
-}
-
+#include "aacdec_template.c"
#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word
@@ -3289,14 +322,14 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
if (avctx->extradata_size < esize) {
av_free(avctx->extradata);
- avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(esize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
}
avctx->extradata_size = esize;
memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
- memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(avctx->extradata+esize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
skip_bits_long(gb, bits_consumed);
@@ -3463,7 +496,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
push_output_configuration(&latmctx->aac_ctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1].m4ac,
- avctx->extradata, avctx->extradata_size*8, 1)) < 0) {
+ avctx->extradata, avctx->extradata_size*8LL, 1)) < 0) {
pop_output_configuration(&latmctx->aac_ctx);
return err;
}
@@ -3505,53 +538,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
return ret;
}
-static void aacdec_init(AACContext *c)
-{
- c->imdct_and_windowing = imdct_and_windowing;
- c->apply_ltp = apply_ltp;
- c->apply_tns = apply_tns;
- c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
- c->update_ltp = update_ltp;
-
- if(ARCH_MIPS)
- ff_aacdec_init_mips(c);
-}
-/**
- * AVOptions for Japanese DTV specific extensions (ADTS only)
- */
-#define AACDEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
- {"dual_mono_mode", "Select the channel to decode for dual mono",
- offsetof(AACContext, force_dmono_mode), AV_OPT_TYPE_INT, {.i64=-1}, -1, 2,
- AACDEC_FLAGS, "dual_mono_mode"},
-
- {"auto", "autoselection", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"main", "Select Main/Left channel", 0, AV_OPT_TYPE_CONST, {.i64= 1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"sub" , "Select Sub/Right channel", 0, AV_OPT_TYPE_CONST, {.i64= 2}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"both", "Select both channels", 0, AV_OPT_TYPE_CONST, {.i64= 0}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
-
- {NULL},
-};
-
-static const AVClass aac_decoder_class = {
- .class_name = "AAC decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVProfile profiles[] = {
- { FF_PROFILE_AAC_MAIN, "Main" },
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_SSR, "SSR" },
- { FF_PROFILE_AAC_LTP, "LTP" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_UNKNOWN },
-};
-
AVCodec ff_aac_decoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
@@ -3564,7 +550,7 @@ AVCodec ff_aac_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
@@ -3588,7 +574,7 @@ AVCodec ff_aac_latm_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
.flush = flush,
.profiles = profiles,
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c b/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c
new file mode 100644
index 00000000000..875ef582f44
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c
@@ -0,0 +1,443 @@
+/*
+ * Copyright (c) 2013
+ * MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * AAC decoder fixed-point implementation
+ *
+ * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
+ * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * AAC decoder
+ * @author Oded Shimon ( ods15 ods15 dyndns org )
+ * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
+ *
+ * Fixed point implementation
+ * @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
+ */
+
+#define FFT_FLOAT 0
+#define FFT_FIXED_32 1
+#define USE_FIXED 1
+
+#include "libavutil/fixed_dsp.h"
+#include "libavutil/opt.h"
+#include "avcodec.h"
+#include "internal.h"
+#include "get_bits.h"
+#include "fft.h"
+#include "lpc.h"
+#include "kbdwin.h"
+#include "sinewin.h"
+
+#include "aac.h"
+#include "aactab.h"
+#include "aacdectab.h"
+#include "cbrt_tablegen.h"
+#include "sbr.h"
+#include "aacsbr.h"
+#include "mpeg4audio.h"
+#include "aacadtsdec.h"
+#include "libavutil/intfloat.h"
+
+#include <math.h>
+#include <string.h>
+
+static av_always_inline void reset_predict_state(PredictorState *ps)
+{
+ ps->r0.mant = 0;
+ ps->r0.exp = 0;
+ ps->r1.mant = 0;
+ ps->r1.exp = 0;
+ ps->cor0.mant = 0;
+ ps->cor0.exp = 0;
+ ps->cor1.mant = 0;
+ ps->cor1.exp = 0;
+ ps->var0.mant = 0x20000000;
+ ps->var0.exp = 1;
+ ps->var1.mant = 0x20000000;
+ ps->var1.exp = 1;
+}
+
+static const int exp2tab[4] = { Q31(1.0000000000/2), Q31(1.1892071150/2), Q31(1.4142135624/2), Q31(1.6817928305/2) }; // 2^0, 2^0.25, 2^0.5, 2^0.75
+
+static inline int *DEC_SPAIR(int *dst, unsigned idx)
+{
+ dst[0] = (idx & 15) - 4;
+ dst[1] = (idx >> 4 & 15) - 4;
+
+ return dst + 2;
+}
+
+static inline int *DEC_SQUAD(int *dst, unsigned idx)
+{
+ dst[0] = (idx & 3) - 1;
+ dst[1] = (idx >> 2 & 3) - 1;
+ dst[2] = (idx >> 4 & 3) - 1;
+ dst[3] = (idx >> 6 & 3) - 1;
+
+ return dst + 4;
+}
+
+static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
+{
+ dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
+ dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1));
+
+ return dst + 2;
+}
+
+static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
+{
+ unsigned nz = idx >> 12;
+
+ dst[0] = (idx & 3) * (1 + (((int)sign >> 31) << 1));
+ sign <<= nz & 1;
+ nz >>= 1;
+ dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) << 1));
+ sign <<= nz & 1;
+ nz >>= 1;
+ dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) << 1));
+ sign <<= nz & 1;
+ nz >>= 1;
+ dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) << 1));
+
+ return dst + 4;
+}
+
+static void vector_pow43(int *coefs, int len)
+{
+ int i, coef;
+
+ for (i=0; i<len; i++) {
+ coef = coefs[i];
+ if (coef < 0)
+ coef = -(int)cbrt_tab[-coef];
+ else
+ coef = (int)cbrt_tab[coef];
+ coefs[i] = coef;
+ }
+}
+
+static void subband_scale(int *dst, int *src, int scale, int offset, int len)
+{
+ int ssign = scale < 0 ? -1 : 1;
+ int s = FFABS(scale);
+ unsigned int round;
+ int i, out, c = exp2tab[s & 3];
+
+ s = offset - (s >> 2);
+
+ if (s > 0) {
+ round = 1 << (s-1);
+ for (i=0; i<len; i++) {
+ out = (int)(((int64_t)src[i] * c) >> 32);
+ dst[i] = ((int)(out+round) >> s) * ssign;
+ }
+ }
+ else {
+ s = s + 32;
+ round = 1 << (s-1);
+ for (i=0; i<len; i++) {
+ out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);
+ dst[i] = out * ssign;
+ }
+ }
+}
+
+static void noise_scale(int *coefs, int scale, int band_energy, int len)
+{
+ int ssign = scale < 0 ? -1 : 1;
+ int s = FFABS(scale);
+ unsigned int round;
+ int i, out, c = exp2tab[s & 3];
+ int nlz = 0;
+
+ while (band_energy > 0x7fff) {
+ band_energy >>= 1;
+ nlz++;
+ }
+ c /= band_energy;
+ s = 21 + nlz - (s >> 2);
+
+ if (s > 0) {
+ round = 1 << (s-1);
+ for (i=0; i<len; i++) {
+ out = (int)(((int64_t)coefs[i] * c) >> 32);
+ coefs[i] = ((int)(out+round) >> s) * ssign;
+ }
+ }
+ 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;
+ }
+ }
+}
+
+static av_always_inline SoftFloat flt16_round(SoftFloat pf)
+{
+ SoftFloat tmp;
+ int s;
+
+ tmp.exp = pf.exp;
+ s = pf.mant >> 31;
+ tmp.mant = (pf.mant ^ s) - s;
+ tmp.mant = (tmp.mant + 0x00200000U) & 0xFFC00000U;
+ tmp.mant = (tmp.mant ^ s) - s;
+
+ return tmp;
+}
+
+static av_always_inline SoftFloat flt16_even(SoftFloat pf)
+{
+ SoftFloat tmp;
+ int s;
+
+ tmp.exp = pf.exp;
+ s = pf.mant >> 31;
+ tmp.mant = (pf.mant ^ s) - s;
+ tmp.mant = (tmp.mant + 0x001FFFFFU + (tmp.mant & 0x00400000U >> 16)) & 0xFFC00000U;
+ tmp.mant = (tmp.mant ^ s) - s;
+
+ return tmp;
+}
+
+static av_always_inline SoftFloat flt16_trunc(SoftFloat pf)
+{
+ SoftFloat pun;
+ int s;
+
+ pun.exp = pf.exp;
+ s = pf.mant >> 31;
+ pun.mant = (pf.mant ^ s) - s;
+ pun.mant = pun.mant & 0xFFC00000U;
+ pun.mant = (pun.mant ^ s) - s;
+
+ return pun;
+}
+
+static av_always_inline void predict(PredictorState *ps, int *coef,
+ int output_enable)
+{
+ const SoftFloat a = { 1023410176, 0 }; // 61.0 / 64
+ const SoftFloat alpha = { 973078528, 0 }; // 29.0 / 32
+ SoftFloat e0, e1;
+ SoftFloat pv;
+ SoftFloat k1, k2;
+ SoftFloat r0 = ps->r0, r1 = ps->r1;
+ SoftFloat cor0 = ps->cor0, cor1 = ps->cor1;
+ SoftFloat var0 = ps->var0, var1 = ps->var1;
+ SoftFloat tmp;
+
+ if (var0.exp > 1 || (var0.exp == 1 && var0.mant > 0x20000000)) {
+ k1 = av_mul_sf(cor0, flt16_even(av_div_sf(a, var0)));
+ }
+ else {
+ k1.mant = 0;
+ k1.exp = 0;
+ }
+
+ if (var1.exp > 1 || (var1.exp == 1 && var1.mant > 0x20000000)) {
+ k2 = av_mul_sf(cor1, flt16_even(av_div_sf(a, var1)));
+ }
+ else {
+ k2.mant = 0;
+ k2.exp = 0;
+ }
+
+ tmp = av_mul_sf(k1, r0);
+ pv = flt16_round(av_add_sf(tmp, av_mul_sf(k2, r1)));
+ if (output_enable) {
+ int shift = 28 - pv.exp;
+
+ if (shift < 31)
+ *coef += (pv.mant + (1 << (shift - 1))) >> shift;
+ }
+
+ e0 = av_int2sf(*coef, 2);
+ e1 = av_sub_sf(e0, tmp);
+
+ ps->cor1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor1), av_mul_sf(r1, e1)));
+ tmp = av_add_sf(av_mul_sf(r1, r1), av_mul_sf(e1, e1));
+ tmp.exp--;
+ ps->var1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var1), tmp));
+ ps->cor0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor0), av_mul_sf(r0, e0)));
+ tmp = av_add_sf(av_mul_sf(r0, r0), av_mul_sf(e0, e0));
+ tmp.exp--;
+ ps->var0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var0), tmp));
+
+ ps->r1 = flt16_trunc(av_mul_sf(a, av_sub_sf(r0, av_mul_sf(k1, e0))));
+ ps->r0 = flt16_trunc(av_mul_sf(a, e0));
+}
+
+
+static const int cce_scale_fixed[8] = {
+ Q30(1.0), //2^(0/8)
+ Q30(1.0905077327), //2^(1/8)
+ Q30(1.1892071150), //2^(2/8)
+ Q30(1.2968395547), //2^(3/8)
+ Q30(1.4142135624), //2^(4/8)
+ Q30(1.5422108254), //2^(5/8)
+ Q30(1.6817928305), //2^(6/8)
+ Q30(1.8340080864), //2^(7/8)
+};
+
+/**
+ * Apply dependent channel coupling (applied before IMDCT).
+ *
+ * @param index index into coupling gain array
+ */
+static void apply_dependent_coupling_fixed(AACContext *ac,
+ SingleChannelElement *target,
+ ChannelElement *cce, int index)
+{
+ IndividualChannelStream *ics = &cce->ch[0].ics;
+ const uint16_t *offsets = ics->swb_offset;
+ int *dest = target->coeffs;
+ const int *src = cce->ch[0].coeffs;
+ int g, i, group, k, idx = 0;
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Dependent coupling is not supported together with LTP\n");
+ return;
+ }
+ for (g = 0; g < ics->num_window_groups; g++) {
+ for (i = 0; i < ics->max_sfb; i++, idx++) {
+ if (cce->ch[0].band_type[idx] != ZERO_BT) {
+ const int gain = cce->coup.gain[index][idx];
+ int shift, round, c, tmp;
+
+ if (gain < 0) {
+ c = -cce_scale_fixed[-gain & 7];
+ shift = (-gain-1024) >> 3;
+ }
+ else {
+ c = cce_scale_fixed[gain & 7];
+ shift = (gain-1024) >> 3;
+ }
+
+ if (shift < 0) {
+ shift = -shift;
+ round = 1 << (shift - 1);
+
+ for (group = 0; group < ics->group_len[g]; group++) {
+ for (k = offsets[i]; k < offsets[i + 1]; k++) {
+ tmp = (int)(((int64_t)src[group * 128 + k] * c + \
+ (int64_t)0x1000000000) >> 37);
+ dest[group * 128 + k] += (tmp + round) >> shift;
+ }
+ }
+ }
+ else {
+ for (group = 0; group < ics->group_len[g]; group++) {
+ for (k = offsets[i]; k < offsets[i + 1]; k++) {
+ tmp = (int)(((int64_t)src[group * 128 + k] * c + \
+ (int64_t)0x1000000000) >> 37);
+ dest[group * 128 + k] += tmp << shift;
+ }
+ }
+ }
+ }
+ }
+ dest += ics->group_len[g] * 128;
+ src += ics->group_len[g] * 128;
+ }
+}
+
+/**
+ * Apply independent channel coupling (applied after IMDCT).
+ *
+ * @param index index into coupling gain array
+ */
+static void apply_independent_coupling_fixed(AACContext *ac,
+ SingleChannelElement *target,
+ ChannelElement *cce, int index)
+{
+ int i, c, shift, round, tmp;
+ const int gain = cce->coup.gain[index][0];
+ const int *src = cce->ch[0].ret;
+ int *dest = target->ret;
+ const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
+
+ c = cce_scale_fixed[gain & 7];
+ shift = (gain-1024) >> 3;
+ if (shift < 0) {
+ shift = -shift;
+ round = 1 << (shift - 1);
+
+ for (i = 0; i < len; i++) {
+ tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
+ dest[i] += (tmp + round) >> shift;
+ }
+ }
+ else {
+ for (i = 0; i < len; i++) {
+ tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
+ dest[i] += tmp << shift;
+ }
+ }
+}
+
+#include "aacdec_template.c"
+
+AVCodec ff_aac_fixed_decoder = {
+ .name = "aac_fixed",
+ .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_AAC,
+ .priv_data_size = sizeof(AACContext),
+ .init = aac_decode_init,
+ .close = aac_decode_close,
+ .decode = aac_decode_frame,
+ .sample_fmts = (const enum AVSampleFormat[]) {
+ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
+ },
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
+ .channel_layouts = aac_channel_layout,
+ .flush = flush,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c b/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c
new file mode 100644
index 00000000000..c2d7d056500
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c
@@ -0,0 +1,3229 @@
+/*
+ * AAC decoder
+ * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
+ * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
+ * Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
+ *
+ * AAC LATM decoder
+ * Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
+ * Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
+ *
+ * AAC decoder fixed-point implementation
+ * Copyright (c) 2013
+ * MIPS Technologies, Inc., California.
+ *
+ * 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
+ * AAC decoder
+ * @author Oded Shimon ( ods15 ods15 dyndns org )
+ * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
+ *
+ * AAC decoder fixed-point implementation
+ * @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
+ * @author Nedeljko Babic ( nedeljko.babic imgtec com )
+ */
+
+/*
+ * supported tools
+ *
+ * Support? Name
+ * N (code in SoC repo) gain control
+ * Y block switching
+ * Y window shapes - standard
+ * N window shapes - Low Delay
+ * Y filterbank - standard
+ * N (code in SoC repo) filterbank - Scalable Sample Rate
+ * Y Temporal Noise Shaping
+ * Y Long Term Prediction
+ * Y intensity stereo
+ * Y channel coupling
+ * Y frequency domain prediction
+ * Y Perceptual Noise Substitution
+ * Y Mid/Side stereo
+ * N Scalable Inverse AAC Quantization
+ * N Frequency Selective Switch
+ * N upsampling filter
+ * Y quantization & coding - AAC
+ * N quantization & coding - TwinVQ
+ * N quantization & coding - BSAC
+ * N AAC Error Resilience tools
+ * N Error Resilience payload syntax
+ * N Error Protection tool
+ * N CELP
+ * N Silence Compression
+ * N HVXC
+ * N HVXC 4kbits/s VR
+ * N Structured Audio tools
+ * N Structured Audio Sample Bank Format
+ * N MIDI
+ * N Harmonic and Individual Lines plus Noise
+ * N Text-To-Speech Interface
+ * Y Spectral Band Replication
+ * Y (not in this code) Layer-1
+ * Y (not in this code) Layer-2
+ * Y (not in this code) Layer-3
+ * N SinuSoidal Coding (Transient, Sinusoid, Noise)
+ * Y Parametric Stereo
+ * N Direct Stream Transfer
+ * Y (not in fixed point code) Enhanced AAC Low Delay (ER AAC ELD)
+ *
+ * Note: - HE AAC v1 comprises LC AAC with Spectral Band Replication.
+ * - HE AAC v2 comprises LC AAC with Spectral Band Replication and
+ Parametric Stereo.
+ */
+
+static VLC vlc_scalefactors;
+static VLC vlc_spectral[11];
+
+static int output_configure(AACContext *ac,
+ uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
+ enum OCStatus oc_type, int get_new_frame);
+
+#define overread_err "Input buffer exhausted before END element found\n"
+
+static int count_channels(uint8_t (*layout)[3], int tags)
+{
+ int i, sum = 0;
+ for (i = 0; i < tags; i++) {
+ int syn_ele = layout[i][0];
+ int pos = layout[i][2];
+ sum += (1 + (syn_ele == TYPE_CPE)) *
+ (pos != AAC_CHANNEL_OFF && pos != AAC_CHANNEL_CC);
+ }
+ return sum;
+}
+
+/**
+ * Check for the channel element in the current channel position configuration.
+ * If it exists, make sure the appropriate element is allocated and map the
+ * channel order to match the internal FFmpeg channel layout.
+ *
+ * @param che_pos current channel position configuration
+ * @param type channel element type
+ * @param id channel element id
+ * @param channels count of the number of channels in the configuration
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static av_cold int che_configure(AACContext *ac,
+ enum ChannelPosition che_pos,
+ int type, int id, int *channels)
+{
+ if (*channels >= MAX_CHANNELS)
+ return AVERROR_INVALIDDATA;
+ if (che_pos) {
+ if (!ac->che[type][id]) {
+ if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
+ return AVERROR(ENOMEM);
+ AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr);
+ }
+ if (type != TYPE_CCE) {
+ if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+ ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0];
+ if (type == TYPE_CPE ||
+ (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) {
+ ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1];
+ }
+ }
+ } else {
+ if (ac->che[type][id])
+ AAC_RENAME(ff_aac_sbr_ctx_close)(&ac->che[type][id]->sbr);
+ av_freep(&ac->che[type][id]);
+ }
+ return 0;
+}
+
+static int frame_configure_elements(AVCodecContext *avctx)
+{
+ AACContext *ac = avctx->priv_data;
+ int type, id, ch, ret;
+
+ /* set channel pointers to internal buffers by default */
+ for (type = 0; type < 4; type++) {
+ for (id = 0; id < MAX_ELEM_ID; id++) {
+ ChannelElement *che = ac->che[type][id];
+ if (che) {
+ che->ch[0].ret = che->ch[0].ret_buf;
+ che->ch[1].ret = che->ch[1].ret_buf;
+ }
+ }
+ }
+
+ /* get output buffer */
+ av_frame_unref(ac->frame);
+ if (!avctx->channels)
+ return 1;
+
+ ac->frame->nb_samples = 2048;
+ if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
+ return ret;
+
+ /* map output channel pointers to AVFrame data */
+ for (ch = 0; ch < avctx->channels; ch++) {
+ if (ac->output_element[ch])
+ ac->output_element[ch]->ret = (INTFLOAT *)ac->frame->extended_data[ch];
+ }
+
+ return 0;
+}
+
+struct elem_to_channel {
+ uint64_t av_position;
+ uint8_t syn_ele;
+ uint8_t elem_id;
+ uint8_t aac_position;
+};
+
+static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
+ uint8_t (*layout_map)[3], int offset, uint64_t left,
+ uint64_t right, int pos)
+{
+ if (layout_map[offset][0] == TYPE_CPE) {
+ e2c_vec[offset] = (struct elem_to_channel) {
+ .av_position = left | right,
+ .syn_ele = TYPE_CPE,
+ .elem_id = layout_map[offset][1],
+ .aac_position = pos
+ };
+ return 1;
+ } else {
+ e2c_vec[offset] = (struct elem_to_channel) {
+ .av_position = left,
+ .syn_ele = TYPE_SCE,
+ .elem_id = layout_map[offset][1],
+ .aac_position = pos
+ };
+ e2c_vec[offset + 1] = (struct elem_to_channel) {
+ .av_position = right,
+ .syn_ele = TYPE_SCE,
+ .elem_id = layout_map[offset + 1][1],
+ .aac_position = pos
+ };
+ return 2;
+ }
+}
+
+static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
+ int *current)
+{
+ int num_pos_channels = 0;
+ int first_cpe = 0;
+ int sce_parity = 0;
+ int i;
+ for (i = *current; i < tags; i++) {
+ if (layout_map[i][2] != pos)
+ break;
+ if (layout_map[i][0] == TYPE_CPE) {
+ if (sce_parity) {
+ if (pos == AAC_CHANNEL_FRONT && !first_cpe) {
+ sce_parity = 0;
+ } else {
+ return -1;
+ }
+ }
+ num_pos_channels += 2;
+ first_cpe = 1;
+ } else {
+ num_pos_channels++;
+ sce_parity ^= 1;
+ }
+ }
+ if (sce_parity &&
+ ((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE))
+ return -1;
+ *current = i;
+ return num_pos_channels;
+}
+
+static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
+{
+ int i, n, total_non_cc_elements;
+ struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
+ int num_front_channels, num_side_channels, num_back_channels;
+ uint64_t layout;
+
+ if (FF_ARRAY_ELEMS(e2c_vec) < tags)
+ return 0;
+
+ i = 0;
+ num_front_channels =
+ count_paired_channels(layout_map, tags, AAC_CHANNEL_FRONT, &i);
+ if (num_front_channels < 0)
+ return 0;
+ num_side_channels =
+ count_paired_channels(layout_map, tags, AAC_CHANNEL_SIDE, &i);
+ if (num_side_channels < 0)
+ return 0;
+ num_back_channels =
+ count_paired_channels(layout_map, tags, AAC_CHANNEL_BACK, &i);
+ if (num_back_channels < 0)
+ return 0;
+
+ if (num_side_channels == 0 && num_back_channels >= 4) {
+ num_side_channels = 2;
+ num_back_channels -= 2;
+ }
+
+ i = 0;
+ if (num_front_channels & 1) {
+ e2c_vec[i] = (struct elem_to_channel) {
+ .av_position = AV_CH_FRONT_CENTER,
+ .syn_ele = TYPE_SCE,
+ .elem_id = layout_map[i][1],
+ .aac_position = AAC_CHANNEL_FRONT
+ };
+ i++;
+ num_front_channels--;
+ }
+ if (num_front_channels >= 4) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_FRONT_LEFT_OF_CENTER,
+ AV_CH_FRONT_RIGHT_OF_CENTER,
+ AAC_CHANNEL_FRONT);
+ num_front_channels -= 2;
+ }
+ if (num_front_channels >= 2) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_FRONT_LEFT,
+ AV_CH_FRONT_RIGHT,
+ AAC_CHANNEL_FRONT);
+ num_front_channels -= 2;
+ }
+ while (num_front_channels >= 2) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_FRONT);
+ num_front_channels -= 2;
+ }
+
+ if (num_side_channels >= 2) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_SIDE_LEFT,
+ AV_CH_SIDE_RIGHT,
+ AAC_CHANNEL_FRONT);
+ num_side_channels -= 2;
+ }
+ while (num_side_channels >= 2) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_SIDE);
+ num_side_channels -= 2;
+ }
+
+ while (num_back_channels >= 4) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ UINT64_MAX,
+ UINT64_MAX,
+ AAC_CHANNEL_BACK);
+ num_back_channels -= 2;
+ }
+ if (num_back_channels >= 2) {
+ i += assign_pair(e2c_vec, layout_map, i,
+ AV_CH_BACK_LEFT,
+ AV_CH_BACK_RIGHT,
+ AAC_CHANNEL_BACK);
+ num_back_channels -= 2;
+ }
+ if (num_back_channels) {
+ e2c_vec[i] = (struct elem_to_channel) {
+ .av_position = AV_CH_BACK_CENTER,
+ .syn_ele = TYPE_SCE,
+ .elem_id = layout_map[i][1],
+ .aac_position = AAC_CHANNEL_BACK
+ };
+ i++;
+ num_back_channels--;
+ }
+
+ if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
+ e2c_vec[i] = (struct elem_to_channel) {
+ .av_position = AV_CH_LOW_FREQUENCY,
+ .syn_ele = TYPE_LFE,
+ .elem_id = layout_map[i][1],
+ .aac_position = AAC_CHANNEL_LFE
+ };
+ i++;
+ }
+ while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
+ e2c_vec[i] = (struct elem_to_channel) {
+ .av_position = UINT64_MAX,
+ .syn_ele = TYPE_LFE,
+ .elem_id = layout_map[i][1],
+ .aac_position = AAC_CHANNEL_LFE
+ };
+ i++;
+ }
+
+ // Must choose a stable sort
+ total_non_cc_elements = n = i;
+ do {
+ int next_n = 0;
+ for (i = 1; i < n; i++)
+ if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
+ FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
+ next_n = i;
+ }
+ n = next_n;
+ } while (n > 0);
+
+ layout = 0;
+ for (i = 0; i < total_non_cc_elements; i++) {
+ layout_map[i][0] = e2c_vec[i].syn_ele;
+ layout_map[i][1] = e2c_vec[i].elem_id;
+ layout_map[i][2] = e2c_vec[i].aac_position;
+ if (e2c_vec[i].av_position != UINT64_MAX) {
+ layout |= e2c_vec[i].av_position;
+ }
+ }
+
+ return layout;
+}
+
+/**
+ * Save current output configuration if and only if it has been locked.
+ */
+static void push_output_configuration(AACContext *ac) {
+ if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
+ ac->oc[0] = ac->oc[1];
+ }
+ ac->oc[1].status = OC_NONE;
+}
+
+/**
+ * Restore the previous output configuration if and only if the current
+ * configuration is unlocked.
+ */
+static void pop_output_configuration(AACContext *ac) {
+ if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
+ ac->oc[1] = ac->oc[0];
+ ac->avctx->channels = ac->oc[1].channels;
+ ac->avctx->channel_layout = ac->oc[1].channel_layout;
+ output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
+ ac->oc[1].status, 0);
+ }
+}
+
+/**
+ * Configure output channel order based on the current program
+ * configuration element.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int output_configure(AACContext *ac,
+ uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
+ enum OCStatus oc_type, int get_new_frame)
+{
+ AVCodecContext *avctx = ac->avctx;
+ int i, channels = 0, ret;
+ uint64_t layout = 0;
+ uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }};
+ uint8_t type_counts[TYPE_END] = { 0 };
+
+ if (ac->oc[1].layout_map != layout_map) {
+ memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
+ ac->oc[1].layout_map_tags = tags;
+ }
+ for (i = 0; i < tags; i++) {
+ int type = layout_map[i][0];
+ int id = layout_map[i][1];
+ id_map[type][id] = type_counts[type]++;
+ }
+ // Try to sniff a reasonable channel order, otherwise output the
+ // channels in the order the PCE declared them.
+ if (avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE)
+ layout = sniff_channel_order(layout_map, tags);
+ for (i = 0; i < tags; i++) {
+ int type = layout_map[i][0];
+ int id = layout_map[i][1];
+ int iid = id_map[type][id];
+ int position = layout_map[i][2];
+ // Allocate or free elements depending on if they are in the
+ // current program configuration.
+ ret = che_configure(ac, position, type, iid, &channels);
+ if (ret < 0)
+ return ret;
+ ac->tag_che_map[type][id] = ac->che[type][iid];
+ }
+ if (ac->oc[1].m4ac.ps == 1 && channels == 2) {
+ if (layout == AV_CH_FRONT_CENTER) {
+ layout = AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT;
+ } else {
+ layout = 0;
+ }
+ }
+
+ if (layout) avctx->channel_layout = layout;
+ ac->oc[1].channel_layout = layout;
+ avctx->channels = ac->oc[1].channels = channels;
+ ac->oc[1].status = oc_type;
+
+ if (get_new_frame) {
+ if ((ret = frame_configure_elements(ac->avctx)) < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
+static void flush(AVCodecContext *avctx)
+{
+ AACContext *ac= avctx->priv_data;
+ int type, i, j;
+
+ for (type = 3; type >= 0; type--) {
+ for (i = 0; i < MAX_ELEM_ID; i++) {
+ ChannelElement *che = ac->che[type][i];
+ if (che) {
+ for (j = 0; j <= 1; j++) {
+ memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Set up channel positions based on a default channel configuration
+ * as specified in table 1.17.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int set_default_channel_config(AVCodecContext *avctx,
+ uint8_t (*layout_map)[3],
+ int *tags,
+ int channel_config)
+{
+ if (channel_config < 1 || (channel_config > 7 && channel_config < 11) ||
+ channel_config > 12) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid default channel configuration (%d)\n",
+ channel_config);
+ return AVERROR_INVALIDDATA;
+ }
+ *tags = tags_per_config[channel_config];
+ memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
+ *tags * sizeof(*layout_map));
+
+ /*
+ * AAC specification has 7.1(wide) as a default layout for 8-channel streams.
+ * However, at least Nero AAC encoder encodes 7.1 streams using the default
+ * channel config 7, mapping the side channels of the original audio stream
+ * to the second AAC_CHANNEL_FRONT pair in the AAC stream. Similarly, e.g. FAAD
+ * decodes the second AAC_CHANNEL_FRONT pair as side channels, therefore decoding
+ * the incorrect streams as if they were correct (and as the encoder intended).
+ *
+ * As actual intended 7.1(wide) streams are very rare, default to assuming a
+ * 7.1 layout was intended.
+ */
+ if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
+ av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
+ " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
+ " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
+ layout_map[2][2] = AAC_CHANNEL_SIDE;
+ }
+
+ return 0;
+}
+
+static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
+{
+ /* For PCE based channel configurations map the channels solely based
+ * on tags. */
+ if (!ac->oc[1].m4ac.chan_config) {
+ return ac->tag_che_map[type][elem_id];
+ }
+ // Allow single CPE stereo files to be signalled with mono configuration.
+ if (!ac->tags_mapped && type == TYPE_CPE &&
+ ac->oc[1].m4ac.chan_config == 1) {
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int layout_map_tags;
+ push_output_configuration(ac);
+
+ av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
+
+ if (set_default_channel_config(ac->avctx, layout_map,
+ &layout_map_tags, 2) < 0)
+ return NULL;
+ if (output_configure(ac, layout_map, layout_map_tags,
+ OC_TRIAL_FRAME, 1) < 0)
+ return NULL;
+
+ ac->oc[1].m4ac.chan_config = 2;
+ ac->oc[1].m4ac.ps = 0;
+ }
+ // And vice-versa
+ if (!ac->tags_mapped && type == TYPE_SCE &&
+ ac->oc[1].m4ac.chan_config == 2) {
+ uint8_t layout_map[MAX_ELEM_ID * 4][3];
+ int layout_map_tags;
+ push_output_configuration(ac);
+
+ av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
+
+ if (set_default_channel_config(ac->avctx, layout_map,
+ &layout_map_tags, 1) < 0)
+ return NULL;
+ if (output_configure(ac, layout_map, layout_map_tags,
+ OC_TRIAL_FRAME, 1) < 0)
+ return NULL;
+
+ ac->oc[1].m4ac.chan_config = 1;
+ if (ac->oc[1].m4ac.sbr)
+ ac->oc[1].m4ac.ps = -1;
+ }
+ /* For indexed channel configurations map the channels solely based
+ * on position. */
+ switch (ac->oc[1].m4ac.chan_config) {
+ case 12:
+ case 7:
+ if (ac->tags_mapped == 3 && type == TYPE_CPE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
+ }
+ case 11:
+ if (ac->tags_mapped == 2 &&
+ ac->oc[1].m4ac.chan_config == 11 &&
+ type == TYPE_SCE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
+ }
+ case 6:
+ /* Some streams incorrectly code 5.1 audio as
+ * SCE[0] CPE[0] CPE[1] SCE[1]
+ * instead of
+ * SCE[0] CPE[0] CPE[1] LFE[0].
+ * If we seem to have encountered such a stream, transfer
+ * the LFE[0] element to the SCE[1]'s mapping */
+ if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
+ if (!ac->warned_remapping_once && (type != TYPE_LFE || elem_id != 0)) {
+ av_log(ac->avctx, AV_LOG_WARNING,
+ "This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n",
+ type == TYPE_SCE ? "SCE" : "LFE", elem_id);
+ ac->warned_remapping_once++;
+ }
+ ac->tags_mapped++;
+ return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
+ }
+ case 5:
+ if (ac->tags_mapped == 2 && type == TYPE_CPE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
+ }
+ case 4:
+ /* Some streams incorrectly code 4.0 audio as
+ * SCE[0] CPE[0] LFE[0]
+ * instead of
+ * SCE[0] CPE[0] SCE[1].
+ * If we seem to have encountered such a stream, transfer
+ * the SCE[1] element to the LFE[0]'s mapping */
+ if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
+ if (!ac->warned_remapping_once && (type != TYPE_SCE || elem_id != 1)) {
+ av_log(ac->avctx, AV_LOG_WARNING,
+ "This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n",
+ type == TYPE_SCE ? "SCE" : "LFE", elem_id);
+ ac->warned_remapping_once++;
+ }
+ ac->tags_mapped++;
+ return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
+ }
+ if (ac->tags_mapped == 2 &&
+ ac->oc[1].m4ac.chan_config == 4 &&
+ type == TYPE_SCE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
+ }
+ case 3:
+ case 2:
+ if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) &&
+ type == TYPE_CPE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
+ } else if (ac->oc[1].m4ac.chan_config == 2) {
+ return NULL;
+ }
+ case 1:
+ if (!ac->tags_mapped && type == TYPE_SCE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0];
+ }
+ default:
+ return NULL;
+ }
+}
+
+/**
+ * Decode an array of 4 bit element IDs, optionally interleaved with a
+ * stereo/mono switching bit.
+ *
+ * @param type speaker type/position for these channels
+ */
+static void decode_channel_map(uint8_t layout_map[][3],
+ enum ChannelPosition type,
+ GetBitContext *gb, int n)
+{
+ while (n--) {
+ enum RawDataBlockType syn_ele;
+ switch (type) {
+ case AAC_CHANNEL_FRONT:
+ case AAC_CHANNEL_BACK:
+ case AAC_CHANNEL_SIDE:
+ syn_ele = get_bits1(gb);
+ break;
+ case AAC_CHANNEL_CC:
+ skip_bits1(gb);
+ syn_ele = TYPE_CCE;
+ break;
+ case AAC_CHANNEL_LFE:
+ syn_ele = TYPE_LFE;
+ break;
+ default:
+ // AAC_CHANNEL_OFF has no channel map
+ av_assert0(0);
+ }
+ layout_map[0][0] = syn_ele;
+ layout_map[0][1] = get_bits(gb, 4);
+ layout_map[0][2] = type;
+ layout_map++;
+ }
+}
+
+/**
+ * Decode program configuration element; reference: table 4.2.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
+ uint8_t (*layout_map)[3],
+ GetBitContext *gb)
+{
+ int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
+ int sampling_index;
+ int comment_len;
+ int tags;
+
+ skip_bits(gb, 2); // object_type
+
+ sampling_index = get_bits(gb, 4);
+ if (m4ac->sampling_index != sampling_index)
+ av_log(avctx, AV_LOG_WARNING,
+ "Sample rate index in program config element does not "
+ "match the sample rate index configured by the container.\n");
+
+ num_front = get_bits(gb, 4);
+ num_side = get_bits(gb, 4);
+ num_back = get_bits(gb, 4);
+ num_lfe = get_bits(gb, 2);
+ num_assoc_data = get_bits(gb, 3);
+ num_cc = get_bits(gb, 4);
+
+ if (get_bits1(gb))
+ skip_bits(gb, 4); // mono_mixdown_tag
+ if (get_bits1(gb))
+ skip_bits(gb, 4); // stereo_mixdown_tag
+
+ if (get_bits1(gb))
+ skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround
+
+ if (get_bits_left(gb) < 4 * (num_front + num_side + num_back + num_lfe + num_assoc_data + num_cc)) {
+ av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
+ return -1;
+ }
+ decode_channel_map(layout_map , AAC_CHANNEL_FRONT, gb, num_front);
+ tags = num_front;
+ decode_channel_map(layout_map + tags, AAC_CHANNEL_SIDE, gb, num_side);
+ tags += num_side;
+ decode_channel_map(layout_map + tags, AAC_CHANNEL_BACK, gb, num_back);
+ tags += num_back;
+ decode_channel_map(layout_map + tags, AAC_CHANNEL_LFE, gb, num_lfe);
+ tags += num_lfe;
+
+ skip_bits_long(gb, 4 * num_assoc_data);
+
+ decode_channel_map(layout_map + tags, AAC_CHANNEL_CC, gb, num_cc);
+ tags += num_cc;
+
+ align_get_bits(gb);
+
+ /* comment field, first byte is length */
+ comment_len = get_bits(gb, 8) * 8;
+ if (get_bits_left(gb) < comment_len) {
+ av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
+ return AVERROR_INVALIDDATA;
+ }
+ skip_bits_long(gb, comment_len);
+ return tags;
+}
+
+/**
+ * Decode GA "General Audio" specific configuration; reference: table 4.1.
+ *
+ * @param ac pointer to AACContext, may be null
+ * @param avctx pointer to AVCCodecContext, used for logging
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
+ GetBitContext *gb,
+ MPEG4AudioConfig *m4ac,
+ int channel_config)
+{
+ int extension_flag, ret, ep_config, res_flags;
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int tags = 0;
+
+ if (get_bits1(gb)) { // frameLengthFlag
+ avpriv_request_sample(avctx, "960/120 MDCT window");
+ return AVERROR_PATCHWELCOME;
+ }
+ m4ac->frame_length_short = 0;
+
+ if (get_bits1(gb)) // dependsOnCoreCoder
+ skip_bits(gb, 14); // coreCoderDelay
+ extension_flag = get_bits1(gb);
+
+ if (m4ac->object_type == AOT_AAC_SCALABLE ||
+ m4ac->object_type == AOT_ER_AAC_SCALABLE)
+ skip_bits(gb, 3); // layerNr
+
+ if (channel_config == 0) {
+ skip_bits(gb, 4); // element_instance_tag
+ tags = decode_pce(avctx, m4ac, layout_map, gb);
+ if (tags < 0)
+ return tags;
+ } else {
+ if ((ret = set_default_channel_config(avctx, layout_map,
+ &tags, channel_config)))
+ return ret;
+ }
+
+ if (count_channels(layout_map, tags) > 1) {
+ m4ac->ps = 0;
+ } else if (m4ac->sbr == 1 && m4ac->ps == -1)
+ m4ac->ps = 1;
+
+ if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
+ return ret;
+
+ if (extension_flag) {
+ switch (m4ac->object_type) {
+ case AOT_ER_BSAC:
+ skip_bits(gb, 5); // numOfSubFrame
+ skip_bits(gb, 11); // layer_length
+ break;
+ case AOT_ER_AAC_LC:
+ case AOT_ER_AAC_LTP:
+ case AOT_ER_AAC_SCALABLE:
+ case AOT_ER_AAC_LD:
+ res_flags = get_bits(gb, 3);
+ if (res_flags) {
+ avpriv_report_missing_feature(avctx,
+ "AAC data resilience (flags %x)",
+ res_flags);
+ return AVERROR_PATCHWELCOME;
+ }
+ break;
+ }
+ skip_bits1(gb); // extensionFlag3 (TBD in version 3)
+ }
+ switch (m4ac->object_type) {
+ case AOT_ER_AAC_LC:
+ case AOT_ER_AAC_LTP:
+ case AOT_ER_AAC_SCALABLE:
+ case AOT_ER_AAC_LD:
+ ep_config = get_bits(gb, 2);
+ if (ep_config) {
+ avpriv_report_missing_feature(avctx,
+ "epConfig %d", ep_config);
+ return AVERROR_PATCHWELCOME;
+ }
+ }
+ return 0;
+}
+
+static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
+ GetBitContext *gb,
+ MPEG4AudioConfig *m4ac,
+ int channel_config)
+{
+ int ret, ep_config, res_flags;
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int tags = 0;
+ const int ELDEXT_TERM = 0;
+
+ m4ac->ps = 0;
+ m4ac->sbr = 0;
+#if USE_FIXED
+ if (get_bits1(gb)) { // frameLengthFlag
+ avpriv_request_sample(avctx, "960/120 MDCT window");
+ return AVERROR_PATCHWELCOME;
+ }
+#else
+ m4ac->frame_length_short = get_bits1(gb);
+#endif
+ res_flags = get_bits(gb, 3);
+ if (res_flags) {
+ avpriv_report_missing_feature(avctx,
+ "AAC data resilience (flags %x)",
+ res_flags);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ if (get_bits1(gb)) { // ldSbrPresentFlag
+ avpriv_report_missing_feature(avctx,
+ "Low Delay SBR");
+ return AVERROR_PATCHWELCOME;
+ }
+
+ while (get_bits(gb, 4) != ELDEXT_TERM) {
+ int len = get_bits(gb, 4);
+ if (len == 15)
+ len += get_bits(gb, 8);
+ if (len == 15 + 255)
+ len += get_bits(gb, 16);
+ if (get_bits_left(gb) < len * 8 + 4) {
+ av_log(avctx, AV_LOG_ERROR, overread_err);
+ return AVERROR_INVALIDDATA;
+ }
+ skip_bits_long(gb, 8 * len);
+ }
+
+ if ((ret = set_default_channel_config(avctx, layout_map,
+ &tags, channel_config)))
+ return ret;
+
+ if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
+ return ret;
+
+ ep_config = get_bits(gb, 2);
+ if (ep_config) {
+ avpriv_report_missing_feature(avctx,
+ "epConfig %d", ep_config);
+ return AVERROR_PATCHWELCOME;
+ }
+ return 0;
+}
+
+/**
+ * Decode audio specific configuration; reference: table 1.13.
+ *
+ * @param ac pointer to AACContext, may be null
+ * @param avctx pointer to AVCCodecContext, used for logging
+ * @param m4ac pointer to MPEG4AudioConfig, used for parsing
+ * @param data pointer to buffer holding an audio specific config
+ * @param bit_size size of audio specific config or data in bits
+ * @param sync_extension look for an appended sync extension
+ *
+ * @return Returns error status or number of consumed bits. <0 - error
+ */
+static int decode_audio_specific_config(AACContext *ac,
+ AVCodecContext *avctx,
+ MPEG4AudioConfig *m4ac,
+ const uint8_t *data, int64_t bit_size,
+ int sync_extension)
+{
+ GetBitContext gb;
+ int i, ret;
+
+ if (bit_size < 0 || bit_size > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Audio specific config size is invalid\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ ff_dlog(avctx, "audio specific config size %d\n", (int)bit_size >> 3);
+ for (i = 0; i < bit_size >> 3; i++)
+ ff_dlog(avctx, "%02x ", data[i]);
+ ff_dlog(avctx, "\n");
+
+ if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
+ return ret;
+
+ if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,
+ sync_extension)) < 0)
+ return AVERROR_INVALIDDATA;
+ if (m4ac->sampling_index > 12) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid sampling rate index %d\n",
+ m4ac->sampling_index);
+ return AVERROR_INVALIDDATA;
+ }
+ if (m4ac->object_type == AOT_ER_AAC_LD &&
+ (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid low delay sampling rate index %d\n",
+ m4ac->sampling_index);
+ return AVERROR_INVALIDDATA;
+ }
+
+ skip_bits_long(&gb, i);
+
+ switch (m4ac->object_type) {
+ case AOT_AAC_MAIN:
+ case AOT_AAC_LC:
+ case AOT_AAC_LTP:
+ case AOT_ER_AAC_LC:
+ case AOT_ER_AAC_LD:
+ if ((ret = decode_ga_specific_config(ac, avctx, &gb,
+ m4ac, m4ac->chan_config)) < 0)
+ return ret;
+ break;
+ case AOT_ER_AAC_ELD:
+ if ((ret = decode_eld_specific_config(ac, avctx, &gb,
+ m4ac, m4ac->chan_config)) < 0)
+ return ret;
+ break;
+ default:
+ avpriv_report_missing_feature(avctx,
+ "Audio object type %s%d",
+ m4ac->sbr == 1 ? "SBR+" : "",
+ m4ac->object_type);
+ return AVERROR(ENOSYS);
+ }
+
+ ff_dlog(avctx,
+ "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
+ m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
+ m4ac->sample_rate, m4ac->sbr,
+ m4ac->ps);
+
+ return get_bits_count(&gb);
+}
+
+/**
+ * linear congruential pseudorandom number generator
+ *
+ * @param previous_val pointer to the current state of the generator
+ *
+ * @return Returns a 32-bit pseudorandom integer
+ */
+static av_always_inline int lcg_random(unsigned previous_val)
+{
+ union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
+ return v.s;
+}
+
+static void reset_all_predictors(PredictorState *ps)
+{
+ int i;
+ for (i = 0; i < MAX_PREDICTORS; i++)
+ reset_predict_state(&ps[i]);
+}
+
+static int sample_rate_idx (int rate)
+{
+ if (92017 <= rate) return 0;
+ else if (75132 <= rate) return 1;
+ else if (55426 <= rate) return 2;
+ else if (46009 <= rate) return 3;
+ else if (37566 <= rate) return 4;
+ else if (27713 <= rate) return 5;
+ else if (23004 <= rate) return 6;
+ else if (18783 <= rate) return 7;
+ else if (13856 <= rate) return 8;
+ else if (11502 <= rate) return 9;
+ else if (9391 <= rate) return 10;
+ else return 11;
+}
+
+static void reset_predictor_group(PredictorState *ps, int group_num)
+{
+ int i;
+ for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
+ reset_predict_state(&ps[i]);
+}
+
+#define AAC_INIT_VLC_STATIC(num, size) \
+ INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
+ ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \
+ sizeof(ff_aac_spectral_bits[num][0]), \
+ ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
+ sizeof(ff_aac_spectral_codes[num][0]), \
+ size);
+
+static void aacdec_init(AACContext *ac);
+
+static av_cold int aac_decode_init(AVCodecContext *avctx)
+{
+ AACContext *ac = avctx->priv_data;
+ int ret;
+
+ ac->avctx = avctx;
+ ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
+
+ aacdec_init(ac);
+#if USE_FIXED
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
+#else
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+#endif /* USE_FIXED */
+
+ if (avctx->extradata_size > 0) {
+ if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
+ avctx->extradata,
+ avctx->extradata_size * 8LL,
+ 1)) < 0)
+ return ret;
+ } else {
+ int sr, i;
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int layout_map_tags;
+
+ sr = sample_rate_idx(avctx->sample_rate);
+ ac->oc[1].m4ac.sampling_index = sr;
+ ac->oc[1].m4ac.channels = avctx->channels;
+ ac->oc[1].m4ac.sbr = -1;
+ ac->oc[1].m4ac.ps = -1;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
+ if (ff_mpeg4audio_channels[i] == avctx->channels)
+ break;
+ if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
+ i = 0;
+ }
+ ac->oc[1].m4ac.chan_config = i;
+
+ if (ac->oc[1].m4ac.chan_config) {
+ int ret = set_default_channel_config(avctx, layout_map,
+ &layout_map_tags, ac->oc[1].m4ac.chan_config);
+ if (!ret)
+ output_configure(ac, layout_map, layout_map_tags,
+ OC_GLOBAL_HDR, 0);
+ else if (avctx->err_recognition & AV_EF_EXPLODE)
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ if (avctx->channels > MAX_CHANNELS) {
+ av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ AAC_INIT_VLC_STATIC( 0, 304);
+ AAC_INIT_VLC_STATIC( 1, 270);
+ AAC_INIT_VLC_STATIC( 2, 550);
+ AAC_INIT_VLC_STATIC( 3, 300);
+ AAC_INIT_VLC_STATIC( 4, 328);
+ AAC_INIT_VLC_STATIC( 5, 294);
+ AAC_INIT_VLC_STATIC( 6, 306);
+ AAC_INIT_VLC_STATIC( 7, 268);
+ AAC_INIT_VLC_STATIC( 8, 510);
+ AAC_INIT_VLC_STATIC( 9, 366);
+ AAC_INIT_VLC_STATIC(10, 462);
+
+ AAC_RENAME(ff_aac_sbr_init)();
+
+#if USE_FIXED
+ ac->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT);
+#else
+ ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
+#endif /* USE_FIXED */
+ if (!ac->fdsp) {
+ return AVERROR(ENOMEM);
+ }
+
+ ac->random_state = 0x1f2e3d4c;
+
+ ff_aac_tableinit();
+
+ INIT_VLC_STATIC(&vlc_scalefactors, 7,
+ FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
+ ff_aac_scalefactor_bits,
+ sizeof(ff_aac_scalefactor_bits[0]),
+ sizeof(ff_aac_scalefactor_bits[0]),
+ ff_aac_scalefactor_code,
+ sizeof(ff_aac_scalefactor_code[0]),
+ sizeof(ff_aac_scalefactor_code[0]),
+ 352);
+
+ AAC_RENAME_32(ff_mdct_init)(&ac->mdct, 11, 1, 1.0 / RANGE15(1024.0));
+ AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ld, 10, 1, 1.0 / RANGE15(512.0));
+ AAC_RENAME_32(ff_mdct_init)(&ac->mdct_small, 8, 1, 1.0 / RANGE15(128.0));
+ AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ltp, 11, 0, RANGE15(-2.0));
+#if !USE_FIXED
+ ret = ff_imdct15_init(&ac->mdct480, 5);
+ if (ret < 0)
+ return ret;
+#endif
+ // window initialization
+ AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_long_1024), 4.0, 1024);
+ AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(ff_aac_kbd_short_128), 6.0, 128);
+ AAC_RENAME(ff_init_ff_sine_windows)(10);
+ AAC_RENAME(ff_init_ff_sine_windows)( 9);
+ AAC_RENAME(ff_init_ff_sine_windows)( 7);
+
+ AAC_RENAME(cbrt_tableinit)();
+
+ return 0;
+}
+
+/**
+ * Skip data_stream_element; reference: table 4.10.
+ */
+static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
+{
+ int byte_align = get_bits1(gb);
+ int count = get_bits(gb, 8);
+ if (count == 255)
+ count += get_bits(gb, 8);
+ if (byte_align)
+ align_get_bits(gb);
+
+ if (get_bits_left(gb) < 8 * count) {
+ av_log(ac->avctx, AV_LOG_ERROR, "skip_data_stream_element: "overread_err);
+ return AVERROR_INVALIDDATA;
+ }
+ skip_bits_long(gb, 8 * count);
+ return 0;
+}
+
+static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
+ GetBitContext *gb)
+{
+ int sfb;
+ if (get_bits1(gb)) {
+ ics->predictor_reset_group = get_bits(gb, 5);
+ if (ics->predictor_reset_group == 0 ||
+ ics->predictor_reset_group > 30) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid Predictor Reset Group.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]); sfb++) {
+ ics->prediction_used[sfb] = get_bits1(gb);
+ }
+ return 0;
+}
+
+/**
+ * Decode Long Term Prediction data; reference: table 4.xx.
+ */
+static void decode_ltp(LongTermPrediction *ltp,
+ GetBitContext *gb, uint8_t max_sfb)
+{
+ int sfb;
+
+ ltp->lag = get_bits(gb, 11);
+ ltp->coef = ltp_coef[get_bits(gb, 3)];
+ for (sfb = 0; sfb < FFMIN(max_sfb, MAX_LTP_LONG_SFB); sfb++)
+ ltp->used[sfb] = get_bits1(gb);
+}
+
+/**
+ * Decode Individual Channel Stream info; reference: table 4.6.
+ */
+static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
+ GetBitContext *gb)
+{
+ const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
+ const int aot = m4ac->object_type;
+ const int sampling_index = m4ac->sampling_index;
+ if (aot != AOT_ER_AAC_ELD) {
+ if (get_bits1(gb)) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
+ if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
+ return AVERROR_INVALIDDATA;
+ }
+ ics->window_sequence[1] = ics->window_sequence[0];
+ ics->window_sequence[0] = get_bits(gb, 2);
+ if (aot == AOT_ER_AAC_LD &&
+ ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "AAC LD is only defined for ONLY_LONG_SEQUENCE but "
+ "window sequence %d found.\n", ics->window_sequence[0]);
+ ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
+ return AVERROR_INVALIDDATA;
+ }
+ ics->use_kb_window[1] = ics->use_kb_window[0];
+ ics->use_kb_window[0] = get_bits1(gb);
+ }
+ ics->num_window_groups = 1;
+ ics->group_len[0] = 1;
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ int i;
+ ics->max_sfb = get_bits(gb, 4);
+ for (i = 0; i < 7; i++) {
+ if (get_bits1(gb)) {
+ ics->group_len[ics->num_window_groups - 1]++;
+ } else {
+ ics->num_window_groups++;
+ ics->group_len[ics->num_window_groups - 1] = 1;
+ }
+ }
+ ics->num_windows = 8;
+ ics->swb_offset = ff_swb_offset_128[sampling_index];
+ ics->num_swb = ff_aac_num_swb_128[sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_128[sampling_index];
+ ics->predictor_present = 0;
+ } else {
+ ics->max_sfb = get_bits(gb, 6);
+ ics->num_windows = 1;
+ if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
+ if (m4ac->frame_length_short) {
+ ics->swb_offset = ff_swb_offset_480[sampling_index];
+ ics->num_swb = ff_aac_num_swb_480[sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_480[sampling_index];
+ } else {
+ ics->swb_offset = ff_swb_offset_512[sampling_index];
+ ics->num_swb = ff_aac_num_swb_512[sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_512[sampling_index];
+ }
+ if (!ics->num_swb || !ics->swb_offset)
+ return AVERROR_BUG;
+ } else {
+ ics->swb_offset = ff_swb_offset_1024[sampling_index];
+ ics->num_swb = ff_aac_num_swb_1024[sampling_index];
+ ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index];
+ }
+ if (aot != AOT_ER_AAC_ELD) {
+ ics->predictor_present = get_bits1(gb);
+ ics->predictor_reset_group = 0;
+ }
+ if (ics->predictor_present) {
+ if (aot == AOT_AAC_MAIN) {
+ if (decode_prediction(ac, ics, gb)) {
+ goto fail;
+ }
+ } else if (aot == AOT_AAC_LC ||
+ aot == AOT_ER_AAC_LC) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Prediction is not allowed in AAC-LC.\n");
+ goto fail;
+ } else {
+ if (aot == AOT_ER_AAC_LD) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "LTP in ER AAC LD not yet implemented.\n");
+ return AVERROR_PATCHWELCOME;
+ }
+ if ((ics->ltp.present = get_bits(gb, 1)))
+ decode_ltp(&ics->ltp, gb, ics->max_sfb);
+ }
+ }
+ }
+
+ if (ics->max_sfb > ics->num_swb) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Number of scalefactor bands in group (%d) "
+ "exceeds limit (%d).\n",
+ ics->max_sfb, ics->num_swb);
+ goto fail;
+ }
+
+ return 0;
+fail:
+ ics->max_sfb = 0;
+ return AVERROR_INVALIDDATA;
+}
+
+/**
+ * Decode band types (section_data payload); reference: table 4.46.
+ *
+ * @param band_type array of the used band type
+ * @param band_type_run_end array of the last scalefactor band of a band type run
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_band_types(AACContext *ac, enum BandType band_type[120],
+ int band_type_run_end[120], GetBitContext *gb,
+ IndividualChannelStream *ics)
+{
+ int g, idx = 0;
+ const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;
+ for (g = 0; g < ics->num_window_groups; g++) {
+ int k = 0;
+ while (k < ics->max_sfb) {
+ uint8_t sect_end = k;
+ int sect_len_incr;
+ int sect_band_type = get_bits(gb, 4);
+ if (sect_band_type == 12) {
+ av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
+ return AVERROR_INVALIDDATA;
+ }
+ do {
+ sect_len_incr = get_bits(gb, bits);
+ sect_end += sect_len_incr;
+ if (get_bits_left(gb) < 0) {
+ av_log(ac->avctx, AV_LOG_ERROR, "decode_band_types: "overread_err);
+ return AVERROR_INVALIDDATA;
+ }
+ if (sect_end > ics->max_sfb) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Number of bands (%d) exceeds limit (%d).\n",
+ sect_end, ics->max_sfb);
+ return AVERROR_INVALIDDATA;
+ }
+ } while (sect_len_incr == (1 << bits) - 1);
+ for (; k < sect_end; k++) {
+ band_type [idx] = sect_band_type;
+ band_type_run_end[idx++] = sect_end;
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+ * Decode scalefactors; reference: table 4.47.
+ *
+ * @param global_gain first scalefactor value as scalefactors are differentially coded
+ * @param band_type array of the used band type
+ * @param band_type_run_end array of the last scalefactor band of a band type run
+ * @param sf array of scalefactors or intensity stereo positions
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_scalefactors(AACContext *ac, INTFLOAT sf[120], GetBitContext *gb,
+ unsigned int global_gain,
+ IndividualChannelStream *ics,
+ enum BandType band_type[120],
+ int band_type_run_end[120])
+{
+ int g, i, idx = 0;
+ int offset[3] = { global_gain, global_gain - NOISE_OFFSET, 0 };
+ int clipped_offset;
+ int noise_flag = 1;
+ for (g = 0; g < ics->num_window_groups; g++) {
+ for (i = 0; i < ics->max_sfb;) {
+ int run_end = band_type_run_end[idx];
+ if (band_type[idx] == ZERO_BT) {
+ for (; i < run_end; i++, idx++)
+ sf[idx] = FIXR(0.);
+ } else if ((band_type[idx] == INTENSITY_BT) ||
+ (band_type[idx] == INTENSITY_BT2)) {
+ for (; i < run_end; i++, idx++) {
+ offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
+ clipped_offset = av_clip(offset[2], -155, 100);
+ if (offset[2] != clipped_offset) {
+ avpriv_request_sample(ac->avctx,
+ "If you heard an audible artifact, there may be a bug in the decoder. "
+ "Clipped intensity stereo position (%d -> %d)",
+ offset[2], clipped_offset);
+ }
+#if USE_FIXED
+ sf[idx] = 100 - clipped_offset;
+#else
+ sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
+#endif /* USE_FIXED */
+ }
+ } else if (band_type[idx] == NOISE_BT) {
+ for (; i < run_end; i++, idx++) {
+ if (noise_flag-- > 0)
+ offset[1] += get_bits(gb, NOISE_PRE_BITS) - NOISE_PRE;
+ else
+ offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
+ clipped_offset = av_clip(offset[1], -100, 155);
+ if (offset[1] != clipped_offset) {
+ avpriv_request_sample(ac->avctx,
+ "If you heard an audible artifact, there may be a bug in the decoder. "
+ "Clipped noise gain (%d -> %d)",
+ offset[1], clipped_offset);
+ }
+#if USE_FIXED
+ sf[idx] = -(100 + clipped_offset);
+#else
+ sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
+#endif /* USE_FIXED */
+ }
+ } else {
+ for (; i < run_end; i++, idx++) {
+ offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
+ if (offset[0] > 255U) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Scalefactor (%d) out of range.\n", offset[0]);
+ return AVERROR_INVALIDDATA;
+ }
+#if USE_FIXED
+ sf[idx] = -offset[0];
+#else
+ sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
+#endif /* USE_FIXED */
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+ * Decode pulse data; reference: table 4.7.
+ */
+static int decode_pulses(Pulse *pulse, GetBitContext *gb,
+ const uint16_t *swb_offset, int num_swb)
+{
+ int i, pulse_swb;
+ pulse->num_pulse = get_bits(gb, 2) + 1;
+ pulse_swb = get_bits(gb, 6);
+ if (pulse_swb >= num_swb)
+ return -1;
+ pulse->pos[0] = swb_offset[pulse_swb];
+ pulse->pos[0] += get_bits(gb, 5);
+ if (pulse->pos[0] >= swb_offset[num_swb])
+ return -1;
+ pulse->amp[0] = get_bits(gb, 4);
+ for (i = 1; i < pulse->num_pulse; i++) {
+ pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];
+ if (pulse->pos[i] >= swb_offset[num_swb])
+ return -1;
+ pulse->amp[i] = get_bits(gb, 4);
+ }
+ return 0;
+}
+
+/**
+ * Decode Temporal Noise Shaping data; reference: table 4.48.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
+ GetBitContext *gb, const IndividualChannelStream *ics)
+{
+ int w, filt, i, coef_len, coef_res, coef_compress;
+ const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE;
+ const int tns_max_order = is8 ? 7 : ac->oc[1].m4ac.object_type == AOT_AAC_MAIN ? 20 : 12;
+ for (w = 0; w < ics->num_windows; w++) {
+ if ((tns->n_filt[w] = get_bits(gb, 2 - is8))) {
+ coef_res = get_bits1(gb);
+
+ for (filt = 0; filt < tns->n_filt[w]; filt++) {
+ int tmp2_idx;
+ tns->length[w][filt] = get_bits(gb, 6 - 2 * is8);
+
+ if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "TNS filter order %d is greater than maximum %d.\n",
+ tns->order[w][filt], tns_max_order);
+ tns->order[w][filt] = 0;
+ return AVERROR_INVALIDDATA;
+ }
+ if (tns->order[w][filt]) {
+ tns->direction[w][filt] = get_bits1(gb);
+ coef_compress = get_bits1(gb);
+ coef_len = coef_res + 3 - coef_compress;
+ tmp2_idx = 2 * coef_compress + coef_res;
+
+ for (i = 0; i < tns->order[w][filt]; i++)
+ tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+ * Decode Mid/Side data; reference: table 4.54.
+ *
+ * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
+ * [1] mask is decoded from bitstream; [2] mask is all 1s;
+ * [3] reserved for scalable AAC
+ */
+static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
+ int ms_present)
+{
+ int idx;
+ int max_idx = cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
+ if (ms_present == 1) {
+ for (idx = 0; idx < max_idx; idx++)
+ cpe->ms_mask[idx] = get_bits1(gb);
+ } else if (ms_present == 2) {
+ memset(cpe->ms_mask, 1, max_idx * sizeof(cpe->ms_mask[0]));
+ }
+}
+
+/**
+ * Decode spectral data; reference: table 4.50.
+ * Dequantize and scale spectral data; reference: 4.6.3.3.
+ *
+ * @param coef array of dequantized, scaled spectral data
+ * @param sf array of scalefactors or intensity stereo positions
+ * @param pulse_present set if pulses are present
+ * @param pulse pointer to pulse data struct
+ * @param band_type array of the used band type
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
+ GetBitContext *gb, const INTFLOAT sf[120],
+ int pulse_present, const Pulse *pulse,
+ const IndividualChannelStream *ics,
+ enum BandType band_type[120])
+{
+ int i, k, g, idx = 0;
+ const int c = 1024 / ics->num_windows;
+ const uint16_t *offsets = ics->swb_offset;
+ INTFLOAT *coef_base = coef;
+
+ for (g = 0; g < ics->num_windows; g++)
+ memset(coef + g * 128 + offsets[ics->max_sfb], 0,
+ sizeof(INTFLOAT) * (c - offsets[ics->max_sfb]));
+
+ for (g = 0; g < ics->num_window_groups; g++) {
+ unsigned g_len = ics->group_len[g];
+
+ for (i = 0; i < ics->max_sfb; i++, idx++) {
+ const unsigned cbt_m1 = band_type[idx] - 1;
+ INTFLOAT *cfo = coef + offsets[i];
+ int off_len = offsets[i + 1] - offsets[i];
+ int group;
+
+ if (cbt_m1 >= INTENSITY_BT2 - 1) {
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+ memset(cfo, 0, off_len * sizeof(*cfo));
+ }
+ } 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;
+
+ 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
+ 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);
+#endif /* USE_FIXED */
+ }
+ } else {
+#if !USE_FIXED
+ const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
+#endif /* !USE_FIXED */
+ const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
+ VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
+ OPEN_READER(re, gb);
+
+ switch (cbt_m1 >> 1) {
+ case 0:
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+ INTFLOAT *cf = cfo;
+ int len = off_len;
+
+ do {
+ int code;
+ unsigned cb_idx;
+
+ UPDATE_CACHE(re, gb);
+ GET_VLC(code, re, gb, vlc_tab, 8, 2);
+ cb_idx = cb_vector_idx[code];
+#if USE_FIXED
+ cf = DEC_SQUAD(cf, cb_idx);
+#else
+ cf = VMUL4(cf, vq, cb_idx, sf + idx);
+#endif /* USE_FIXED */
+ } while (len -= 4);
+ }
+ break;
+
+ case 1:
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+ INTFLOAT *cf = cfo;
+ int len = off_len;
+
+ do {
+ int code;
+ unsigned nnz;
+ unsigned cb_idx;
+ uint32_t bits;
+
+ UPDATE_CACHE(re, gb);
+ GET_VLC(code, re, gb, vlc_tab, 8, 2);
+ cb_idx = cb_vector_idx[code];
+ nnz = cb_idx >> 8 & 15;
+ bits = nnz ? GET_CACHE(re, gb) : 0;
+ LAST_SKIP_BITS(re, gb, nnz);
+#if USE_FIXED
+ cf = DEC_UQUAD(cf, cb_idx, bits);
+#else
+ cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
+#endif /* USE_FIXED */
+ } while (len -= 4);
+ }
+ break;
+
+ case 2:
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+ INTFLOAT *cf = cfo;
+ int len = off_len;
+
+ do {
+ int code;
+ unsigned cb_idx;
+
+ UPDATE_CACHE(re, gb);
+ GET_VLC(code, re, gb, vlc_tab, 8, 2);
+ cb_idx = cb_vector_idx[code];
+#if USE_FIXED
+ cf = DEC_SPAIR(cf, cb_idx);
+#else
+ cf = VMUL2(cf, vq, cb_idx, sf + idx);
+#endif /* USE_FIXED */
+ } while (len -= 2);
+ }
+ break;
+
+ case 3:
+ case 4:
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+ INTFLOAT *cf = cfo;
+ int len = off_len;
+
+ do {
+ int code;
+ unsigned nnz;
+ unsigned cb_idx;
+ unsigned sign;
+
+ UPDATE_CACHE(re, gb);
+ GET_VLC(code, re, gb, vlc_tab, 8, 2);
+ cb_idx = cb_vector_idx[code];
+ nnz = cb_idx >> 8 & 15;
+ sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
+ LAST_SKIP_BITS(re, gb, nnz);
+#if USE_FIXED
+ cf = DEC_UPAIR(cf, cb_idx, sign);
+#else
+ cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
+#endif /* USE_FIXED */
+ } while (len -= 2);
+ }
+ break;
+
+ default:
+ for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
+#if USE_FIXED
+ int *icf = cfo;
+ int v;
+#else
+ float *cf = cfo;
+ uint32_t *icf = (uint32_t *) cf;
+#endif /* USE_FIXED */
+ int len = off_len;
+
+ do {
+ int code;
+ unsigned nzt, nnz;
+ unsigned cb_idx;
+ uint32_t bits;
+ int j;
+
+ UPDATE_CACHE(re, gb);
+ GET_VLC(code, re, gb, vlc_tab, 8, 2);
+
+ if (!code) {
+ *icf++ = 0;
+ *icf++ = 0;
+ continue;
+ }
+
+ cb_idx = cb_vector_idx[code];
+ nnz = cb_idx >> 12;
+ nzt = cb_idx >> 8;
+ bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
+ LAST_SKIP_BITS(re, gb, nnz);
+
+ for (j = 0; j < 2; j++) {
+ if (nzt & 1<<j) {
+ uint32_t b;
+ int n;
+ /* The total length of escape_sequence must be < 22 bits according
+ to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
+ UPDATE_CACHE(re, gb);
+ b = GET_CACHE(re, gb);
+ b = 31 - av_log2(~b);
+
+ if (b > 8) {
+ av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ SKIP_BITS(re, gb, b + 1);
+ b += 4;
+ n = (1 << b) + SHOW_UBITS(re, gb, b);
+ LAST_SKIP_BITS(re, gb, b);
+#if USE_FIXED
+ v = n;
+ if (bits & 1U<<31)
+ v = -v;
+ *icf++ = v;
+#else
+ *icf++ = cbrt_tab[n] | (bits & 1U<<31);
+#endif /* USE_FIXED */
+ bits <<= 1;
+ } else {
+#if USE_FIXED
+ v = cb_idx & 15;
+ if (bits & 1U<<31)
+ v = -v;
+ *icf++ = v;
+#else
+ unsigned v = ((const uint32_t*)vq)[cb_idx & 15];
+ *icf++ = (bits & 1U<<31) | v;
+#endif /* USE_FIXED */
+ bits <<= !!v;
+ }
+ cb_idx >>= 4;
+ }
+ } while (len -= 2);
+#if !USE_FIXED
+ ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
+#endif /* !USE_FIXED */
+ }
+ }
+
+ CLOSE_READER(re, gb);
+ }
+ }
+ coef += g_len << 7;
+ }
+
+ if (pulse_present) {
+ idx = 0;
+ for (i = 0; i < pulse->num_pulse; i++) {
+ INTFLOAT co = coef_base[ pulse->pos[i] ];
+ while (offsets[idx + 1] <= pulse->pos[i])
+ idx++;
+ if (band_type[idx] != NOISE_BT && sf[idx]) {
+ INTFLOAT ico = -pulse->amp[i];
+#if USE_FIXED
+ if (co) {
+ ico = co + (co > 0 ? -ico : ico);
+ }
+ coef_base[ pulse->pos[i] ] = ico;
+#else
+ if (co) {
+ co /= sf[idx];
+ ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
+ }
+ coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
+#endif /* USE_FIXED */
+ }
+ }
+ }
+#if USE_FIXED
+ coef = coef_base;
+ idx = 0;
+ for (g = 0; g < ics->num_window_groups; g++) {
+ unsigned g_len = ics->group_len[g];
+
+ for (i = 0; i < ics->max_sfb; i++, idx++) {
+ const unsigned cbt_m1 = band_type[idx] - 1;
+ int *cfo = coef + offsets[i];
+ int off_len = offsets[i + 1] - offsets[i];
+ int group;
+
+ if (cbt_m1 < NOISE_BT - 1) {
+ for (group = 0; group < (int)g_len; group++, cfo+=128) {
+ ac->vector_pow43(cfo, off_len);
+ ac->subband_scale(cfo, cfo, sf[idx], 34, off_len);
+ }
+ }
+ }
+ coef += g_len << 7;
+ }
+#endif /* USE_FIXED */
+ return 0;
+}
+
+/**
+ * Apply AAC-Main style frequency domain prediction.
+ */
+static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
+{
+ int sfb, k;
+
+ if (!sce->ics.predictor_initialized) {
+ reset_all_predictors(sce->predictor_state);
+ sce->ics.predictor_initialized = 1;
+ }
+
+ if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
+ for (sfb = 0;
+ sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
+ sfb++) {
+ for (k = sce->ics.swb_offset[sfb];
+ k < sce->ics.swb_offset[sfb + 1];
+ k++) {
+ predict(&sce->predictor_state[k], &sce->coeffs[k],
+ sce->ics.predictor_present &&
+ sce->ics.prediction_used[sfb]);
+ }
+ }
+ if (sce->ics.predictor_reset_group)
+ reset_predictor_group(sce->predictor_state,
+ sce->ics.predictor_reset_group);
+ } else
+ reset_all_predictors(sce->predictor_state);
+}
+
+/**
+ * Decode an individual_channel_stream payload; reference: table 4.44.
+ *
+ * @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information.
+ * @param scale_flag scalable [1] or non-scalable [0] AAC (Unused until scalable AAC is implemented.)
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_ics(AACContext *ac, SingleChannelElement *sce,
+ GetBitContext *gb, int common_window, int scale_flag)
+{
+ Pulse pulse;
+ TemporalNoiseShaping *tns = &sce->tns;
+ IndividualChannelStream *ics = &sce->ics;
+ INTFLOAT *out = sce->coeffs;
+ int global_gain, eld_syntax, er_syntax, pulse_present = 0;
+ int ret;
+
+ eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
+ er_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_LC ||
+ ac->oc[1].m4ac.object_type == AOT_ER_AAC_LTP ||
+ ac->oc[1].m4ac.object_type == AOT_ER_AAC_LD ||
+ ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
+
+ /* This assignment is to silence a GCC warning about the variable being used
+ * uninitialized when in fact it always is.
+ */
+ pulse.num_pulse = 0;
+
+ global_gain = get_bits(gb, 8);
+
+ if (!common_window && !scale_flag) {
+ if (decode_ics_info(ac, ics, gb) < 0)
+ return AVERROR_INVALIDDATA;
+ }
+
+ if ((ret = decode_band_types(ac, sce->band_type,
+ sce->band_type_run_end, gb, ics)) < 0)
+ return ret;
+ if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
+ sce->band_type, sce->band_type_run_end)) < 0)
+ return ret;
+
+ pulse_present = 0;
+ if (!scale_flag) {
+ if (!eld_syntax && (pulse_present = get_bits1(gb))) {
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Pulse tool not allowed in eight short sequence.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Pulse data corrupt or invalid.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+ tns->present = get_bits1(gb);
+ if (tns->present && !er_syntax)
+ if (decode_tns(ac, tns, gb, ics) < 0)
+ return AVERROR_INVALIDDATA;
+ if (!eld_syntax && get_bits1(gb)) {
+ avpriv_request_sample(ac->avctx, "SSR");
+ return AVERROR_PATCHWELCOME;
+ }
+ // I see no textual basis in the spec for this occurring after SSR gain
+ // control, but this is what both reference and real implmentations do
+ if (tns->present && er_syntax)
+ if (decode_tns(ac, tns, gb, ics) < 0)
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
+ &pulse, ics, sce->band_type) < 0)
+ return AVERROR_INVALIDDATA;
+
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
+ apply_prediction(ac, sce);
+
+ return 0;
+}
+
+/**
+ * Mid/Side stereo decoding; reference: 4.6.8.1.3.
+ */
+static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
+{
+ const IndividualChannelStream *ics = &cpe->ch[0].ics;
+ INTFLOAT *ch0 = cpe->ch[0].coeffs;
+ INTFLOAT *ch1 = cpe->ch[1].coeffs;
+ int g, i, group, idx = 0;
+ const uint16_t *offsets = ics->swb_offset;
+ for (g = 0; g < ics->num_window_groups; g++) {
+ for (i = 0; i < ics->max_sfb; i++, idx++) {
+ if (cpe->ms_mask[idx] &&
+ cpe->ch[0].band_type[idx] < NOISE_BT &&
+ cpe->ch[1].band_type[idx] < NOISE_BT) {
+#if USE_FIXED
+ for (group = 0; group < ics->group_len[g]; group++) {
+ ac->fdsp->butterflies_fixed(ch0 + group * 128 + offsets[i],
+ ch1 + group * 128 + offsets[i],
+ offsets[i+1] - offsets[i]);
+#else
+ for (group = 0; group < ics->group_len[g]; group++) {
+ ac->fdsp->butterflies_float(ch0 + group * 128 + offsets[i],
+ ch1 + group * 128 + offsets[i],
+ offsets[i+1] - offsets[i]);
+#endif /* USE_FIXED */
+ }
+ }
+ }
+ ch0 += ics->group_len[g] * 128;
+ ch1 += ics->group_len[g] * 128;
+ }
+}
+
+/**
+ * intensity stereo decoding; reference: 4.6.8.2.3
+ *
+ * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
+ * [1] mask is decoded from bitstream; [2] mask is all 1s;
+ * [3] reserved for scalable AAC
+ */
+static void apply_intensity_stereo(AACContext *ac,
+ ChannelElement *cpe, int ms_present)
+{
+ const IndividualChannelStream *ics = &cpe->ch[1].ics;
+ SingleChannelElement *sce1 = &cpe->ch[1];
+ INTFLOAT *coef0 = cpe->ch[0].coeffs, *coef1 = cpe->ch[1].coeffs;
+ const uint16_t *offsets = ics->swb_offset;
+ int g, group, i, idx = 0;
+ int c;
+ INTFLOAT scale;
+ for (g = 0; g < ics->num_window_groups; g++) {
+ for (i = 0; i < ics->max_sfb;) {
+ if (sce1->band_type[idx] == INTENSITY_BT ||
+ sce1->band_type[idx] == INTENSITY_BT2) {
+ const int bt_run_end = sce1->band_type_run_end[idx];
+ for (; i < bt_run_end; i++, idx++) {
+ c = -1 + 2 * (sce1->band_type[idx] - 14);
+ if (ms_present)
+ c *= 1 - 2 * cpe->ms_mask[idx];
+ scale = c * sce1->sf[idx];
+ for (group = 0; group < ics->group_len[g]; group++)
+#if USE_FIXED
+ ac->subband_scale(coef1 + group * 128 + offsets[i],
+ coef0 + group * 128 + offsets[i],
+ scale,
+ 23,
+ offsets[i + 1] - offsets[i]);
+#else
+ ac->fdsp->vector_fmul_scalar(coef1 + group * 128 + offsets[i],
+ coef0 + group * 128 + offsets[i],
+ scale,
+ offsets[i + 1] - offsets[i]);
+#endif /* USE_FIXED */
+ }
+ } else {
+ int bt_run_end = sce1->band_type_run_end[idx];
+ idx += bt_run_end - i;
+ i = bt_run_end;
+ }
+ }
+ coef0 += ics->group_len[g] * 128;
+ coef1 += ics->group_len[g] * 128;
+ }
+}
+
+/**
+ * Decode a channel_pair_element; reference: table 4.4.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
+{
+ int i, ret, common_window, ms_present = 0;
+ int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
+
+ common_window = eld_syntax || get_bits1(gb);
+ if (common_window) {
+ if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
+ return AVERROR_INVALIDDATA;
+ i = cpe->ch[1].ics.use_kb_window[0];
+ cpe->ch[1].ics = cpe->ch[0].ics;
+ cpe->ch[1].ics.use_kb_window[1] = i;
+ if (cpe->ch[1].ics.predictor_present &&
+ (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
+ if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
+ decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
+ ms_present = get_bits(gb, 2);
+ if (ms_present == 3) {
+ av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
+ return AVERROR_INVALIDDATA;
+ } else if (ms_present)
+ decode_mid_side_stereo(cpe, gb, ms_present);
+ }
+ if ((ret = decode_ics(ac, &cpe->ch[0], gb, common_window, 0)))
+ return ret;
+ if ((ret = decode_ics(ac, &cpe->ch[1], gb, common_window, 0)))
+ return ret;
+
+ if (common_window) {
+ if (ms_present)
+ apply_mid_side_stereo(ac, cpe);
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN) {
+ apply_prediction(ac, &cpe->ch[0]);
+ apply_prediction(ac, &cpe->ch[1]);
+ }
+ }
+
+ apply_intensity_stereo(ac, cpe, ms_present);
+ return 0;
+}
+
+static const float cce_scale[] = {
+ 1.09050773266525765921, //2^(1/8)
+ 1.18920711500272106672, //2^(1/4)
+ M_SQRT2,
+ 2,
+};
+
+/**
+ * Decode coupling_channel_element; reference: table 4.8.
+ *
+ * @return Returns error status. 0 - OK, !0 - error
+ */
+static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
+{
+ int num_gain = 0;
+ int c, g, sfb, ret;
+ int sign;
+ INTFLOAT scale;
+ SingleChannelElement *sce = &che->ch[0];
+ ChannelCoupling *coup = &che->coup;
+
+ coup->coupling_point = 2 * get_bits1(gb);
+ coup->num_coupled = get_bits(gb, 3);
+ for (c = 0; c <= coup->num_coupled; c++) {
+ num_gain++;
+ coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE;
+ coup->id_select[c] = get_bits(gb, 4);
+ if (coup->type[c] == TYPE_CPE) {
+ coup->ch_select[c] = get_bits(gb, 2);
+ if (coup->ch_select[c] == 3)
+ num_gain++;
+ } else
+ coup->ch_select[c] = 2;
+ }
+ coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
+
+ sign = get_bits(gb, 1);
+ scale = AAC_RENAME(cce_scale)[get_bits(gb, 2)];
+
+ if ((ret = decode_ics(ac, sce, gb, 0, 0)))
+ return ret;
+
+ for (c = 0; c < num_gain; c++) {
+ int idx = 0;
+ int cge = 1;
+ int gain = 0;
+ INTFLOAT gain_cache = FIXR10(1.);
+ if (c) {
+ cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
+ gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;
+ gain_cache = GET_GAIN(scale, gain);
+ }
+ if (coup->coupling_point == AFTER_IMDCT) {
+ coup->gain[c][0] = gain_cache;
+ } else {
+ for (g = 0; g < sce->ics.num_window_groups; g++) {
+ for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) {
+ if (sce->band_type[idx] != ZERO_BT) {
+ if (!cge) {
+ int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
+ if (t) {
+ int s = 1;
+ t = gain += t;
+ if (sign) {
+ s -= 2 * (t & 0x1);
+ t >>= 1;
+ }
+ gain_cache = GET_GAIN(scale, t) * s;
+ }
+ }
+ coup->gain[c][idx] = gain_cache;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+ * Parse whether channels are to be excluded from Dynamic Range Compression; reference: table 4.53.
+ *
+ * @return Returns number of bytes consumed.
+ */
+static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc,
+ GetBitContext *gb)
+{
+ int i;
+ int num_excl_chan = 0;
+
+ do {
+ for (i = 0; i < 7; i++)
+ che_drc->exclude_mask[num_excl_chan++] = get_bits1(gb);
+ } while (num_excl_chan < MAX_CHANNELS - 7 && get_bits1(gb));
+
+ return num_excl_chan / 7;
+}
+
+/**
+ * Decode dynamic range information; reference: table 4.52.
+ *
+ * @return Returns number of bytes consumed.
+ */
+static int decode_dynamic_range(DynamicRangeControl *che_drc,
+ GetBitContext *gb)
+{
+ int n = 1;
+ int drc_num_bands = 1;
+ int i;
+
+ /* pce_tag_present? */
+ if (get_bits1(gb)) {
+ che_drc->pce_instance_tag = get_bits(gb, 4);
+ skip_bits(gb, 4); // tag_reserved_bits
+ n++;
+ }
+
+ /* excluded_chns_present? */
+ if (get_bits1(gb)) {
+ n += decode_drc_channel_exclusions(che_drc, gb);
+ }
+
+ /* drc_bands_present? */
+ if (get_bits1(gb)) {
+ che_drc->band_incr = get_bits(gb, 4);
+ che_drc->interpolation_scheme = get_bits(gb, 4);
+ n++;
+ drc_num_bands += che_drc->band_incr;
+ for (i = 0; i < drc_num_bands; i++) {
+ che_drc->band_top[i] = get_bits(gb, 8);
+ n++;
+ }
+ }
+
+ /* prog_ref_level_present? */
+ if (get_bits1(gb)) {
+ che_drc->prog_ref_level = get_bits(gb, 7);
+ skip_bits1(gb); // prog_ref_level_reserved_bits
+ n++;
+ }
+
+ for (i = 0; i < drc_num_bands; i++) {
+ che_drc->dyn_rng_sgn[i] = get_bits1(gb);
+ che_drc->dyn_rng_ctl[i] = get_bits(gb, 7);
+ n++;
+ }
+
+ return n;
+}
+
+static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
+ uint8_t buf[256];
+ int i, major, minor;
+
+ if (len < 13+7*8)
+ goto unknown;
+
+ get_bits(gb, 13); len -= 13;
+
+ for(i=0; i+1<sizeof(buf) && len>=8; i++, len-=8)
+ buf[i] = get_bits(gb, 8);
+
+ buf[i] = 0;
+ if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
+ av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);
+
+ if (sscanf(buf, "libfaac %d.%d", &major, &minor) == 2){
+ ac->avctx->internal->skip_samples = 1024;
+ }
+
+unknown:
+ skip_bits_long(gb, len);
+
+ return 0;
+}
+
+/**
+ * Decode extension data (incomplete); reference: table 4.51.
+ *
+ * @param cnt length of TYPE_FIL syntactic element in bytes
+ *
+ * @return Returns number of bytes consumed
+ */
+static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
+ ChannelElement *che, enum RawDataBlockType elem_type)
+{
+ int crc_flag = 0;
+ int res = cnt;
+ int type = get_bits(gb, 4);
+
+ if (ac->avctx->debug & FF_DEBUG_STARTCODE)
+ av_log(ac->avctx, AV_LOG_DEBUG, "extension type: %d len:%d\n", type, cnt);
+
+ switch (type) { // extension type
+ case EXT_SBR_DATA_CRC:
+ crc_flag++;
+ case EXT_SBR_DATA:
+ if (!che) {
+ av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
+ return res;
+ } else if (!ac->oc[1].m4ac.sbr) {
+ av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
+ skip_bits_long(gb, 8 * cnt - 4);
+ return res;
+ } else if (ac->oc[1].m4ac.sbr == -1 && ac->oc[1].status == OC_LOCKED) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n");
+ skip_bits_long(gb, 8 * cnt - 4);
+ return res;
+ } else if (ac->oc[1].m4ac.ps == -1 && ac->oc[1].status < OC_LOCKED && ac->avctx->channels == 1) {
+ ac->oc[1].m4ac.sbr = 1;
+ ac->oc[1].m4ac.ps = 1;
+ ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
+ output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
+ ac->oc[1].status, 1);
+ } else {
+ ac->oc[1].m4ac.sbr = 1;
+ ac->avctx->profile = FF_PROFILE_AAC_HE;
+ }
+ res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
+ break;
+ case EXT_DYNAMIC_RANGE:
+ res = decode_dynamic_range(&ac->che_drc, gb);
+ break;
+ case EXT_FILL:
+ decode_fill(ac, gb, 8 * cnt - 4);
+ break;
+ case EXT_FILL_DATA:
+ case EXT_DATA_ELEMENT:
+ default:
+ skip_bits_long(gb, 8 * cnt - 4);
+ break;
+ };
+ return res;
+}
+
+/**
+ * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
+ *
+ * @param decode 1 if tool is used normally, 0 if tool is used in LTP.
+ * @param coef spectral coefficients
+ */
+static void apply_tns(INTFLOAT coef[1024], TemporalNoiseShaping *tns,
+ IndividualChannelStream *ics, int decode)
+{
+ const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
+ int w, filt, m, i;
+ int bottom, top, order, start, end, size, inc;
+ INTFLOAT lpc[TNS_MAX_ORDER];
+ INTFLOAT tmp[TNS_MAX_ORDER+1];
+
+ for (w = 0; w < ics->num_windows; w++) {
+ bottom = ics->num_swb;
+ for (filt = 0; filt < tns->n_filt[w]; filt++) {
+ top = bottom;
+ bottom = FFMAX(0, top - tns->length[w][filt]);
+ order = tns->order[w][filt];
+ if (order == 0)
+ continue;
+
+ // tns_decode_coef
+ AAC_RENAME(compute_lpc_coefs)(tns->coef[w][filt], order, lpc, 0, 0, 0);
+
+ start = ics->swb_offset[FFMIN(bottom, mmm)];
+ end = ics->swb_offset[FFMIN( top, mmm)];
+ if ((size = end - start) <= 0)
+ continue;
+ if (tns->direction[w][filt]) {
+ inc = -1;
+ start = end - 1;
+ } else {
+ inc = 1;
+ }
+ start += w * 128;
+
+ if (decode) {
+ // ar filter
+ for (m = 0; m < size; m++, start += inc)
+ for (i = 1; i <= FFMIN(m, order); i++)
+ coef[start] -= AAC_MUL26(coef[start - i * inc], lpc[i - 1]);
+ } else {
+ // ma filter
+ for (m = 0; m < size; m++, start += inc) {
+ tmp[0] = coef[start];
+ for (i = 1; i <= FFMIN(m, order); i++)
+ coef[start] += AAC_MUL26(tmp[i], lpc[i - 1]);
+ for (i = order; i > 0; i--)
+ tmp[i] = tmp[i - 1];
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Apply windowing and MDCT to obtain the spectral
+ * coefficient from the predicted sample by LTP.
+ */
+static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out,
+ INTFLOAT *in, IndividualChannelStream *ics)
+{
+ const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
+ const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
+ const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
+ const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
+
+ if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
+ ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
+ } else {
+ memset(in, 0, 448 * sizeof(*in));
+ ac->fdsp->vector_fmul(in + 448, in + 448, swindow_prev, 128);
+ }
+ if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
+ ac->fdsp->vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
+ } else {
+ ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
+ memset(in + 1024 + 576, 0, 448 * sizeof(*in));
+ }
+ ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
+}
+
+/**
+ * Apply the long term prediction
+ */
+static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
+{
+ const LongTermPrediction *ltp = &sce->ics.ltp;
+ const uint16_t *offsets = sce->ics.swb_offset;
+ int i, sfb;
+
+ if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
+ INTFLOAT *predTime = sce->ret;
+ INTFLOAT *predFreq = ac->buf_mdct;
+ int16_t num_samples = 2048;
+
+ if (ltp->lag < 1024)
+ num_samples = ltp->lag + 1024;
+ for (i = 0; i < num_samples; i++)
+ predTime[i] = AAC_MUL30(sce->ltp_state[i + 2048 - ltp->lag], ltp->coef);
+ memset(&predTime[i], 0, (2048 - i) * sizeof(*predTime));
+
+ ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
+
+ if (sce->tns.present)
+ ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
+
+ for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
+ if (ltp->used[sfb])
+ for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
+ sce->coeffs[i] += predFreq[i];
+ }
+}
+
+/**
+ * Update the LTP buffer for next frame
+ */
+static void update_ltp(AACContext *ac, SingleChannelElement *sce)
+{
+ IndividualChannelStream *ics = &sce->ics;
+ INTFLOAT *saved = sce->saved;
+ INTFLOAT *saved_ltp = sce->coeffs;
+ const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
+ const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
+ int i;
+
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ memcpy(saved_ltp, saved, 512 * sizeof(*saved_ltp));
+ memset(saved_ltp + 576, 0, 448 * sizeof(*saved_ltp));
+ ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
+
+ for (i = 0; i < 64; i++)
+ saved_ltp[i + 512] = AAC_MUL31(ac->buf_mdct[1023 - i], swindow[63 - i]);
+ } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
+ memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(*saved_ltp));
+ memset(saved_ltp + 576, 0, 448 * sizeof(*saved_ltp));
+ ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
+
+ for (i = 0; i < 64; i++)
+ saved_ltp[i + 512] = AAC_MUL31(ac->buf_mdct[1023 - i], swindow[63 - i]);
+ } else { // LONG_STOP or ONLY_LONG
+ ac->fdsp->vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
+
+ for (i = 0; i < 512; i++)
+ saved_ltp[i + 512] = AAC_MUL31(ac->buf_mdct[1023 - i], lwindow[511 - i]);
+ }
+
+ memcpy(sce->ltp_state, sce->ltp_state+1024, 1024 * sizeof(*sce->ltp_state));
+ memcpy(sce->ltp_state+1024, sce->ret, 1024 * sizeof(*sce->ltp_state));
+ memcpy(sce->ltp_state+2048, saved_ltp, 1024 * sizeof(*sce->ltp_state));
+}
+
+/**
+ * Conduct IMDCT and windowing.
+ */
+static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
+{
+ IndividualChannelStream *ics = &sce->ics;
+ INTFLOAT *in = sce->coeffs;
+ INTFLOAT *out = sce->ret;
+ INTFLOAT *saved = sce->saved;
+ const INTFLOAT *swindow = ics->use_kb_window[0] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
+ const INTFLOAT *lwindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_long_1024) : AAC_RENAME(ff_sine_1024);
+ const INTFLOAT *swindow_prev = ics->use_kb_window[1] ? AAC_RENAME(ff_aac_kbd_short_128) : AAC_RENAME(ff_sine_128);
+ INTFLOAT *buf = ac->buf_mdct;
+ INTFLOAT *temp = ac->temp;
+ int i;
+
+ // imdct
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ for (i = 0; i < 1024; i += 128)
+ ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i);
+ } else {
+ ac->mdct.imdct_half(&ac->mdct, buf, in);
+#if USE_FIXED
+ for (i=0; i<1024; i++)
+ buf[i] = (buf[i] + 4) >> 3;
+#endif /* USE_FIXED */
+ }
+
+ /* window overlapping
+ * NOTE: To simplify the overlapping code, all 'meaningless' short to long
+ * and long to short transitions are considered to be short to short
+ * transitions. This leaves just two cases (long to long and short to short)
+ * with a little special sauce for EIGHT_SHORT_SEQUENCE.
+ */
+ if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
+ (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
+ ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 512);
+ } else {
+ memcpy( out, saved, 448 * sizeof(*out));
+
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ ac->fdsp->vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
+ ac->fdsp->vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
+ ac->fdsp->vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
+ ac->fdsp->vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
+ ac->fdsp->vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
+ memcpy( out + 448 + 4*128, temp, 64 * sizeof(*out));
+ } else {
+ ac->fdsp->vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
+ memcpy( out + 576, buf + 64, 448 * sizeof(*out));
+ }
+ }
+
+ // buffer update
+ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ memcpy( saved, temp + 64, 64 * sizeof(*saved));
+ ac->fdsp->vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
+ ac->fdsp->vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
+ ac->fdsp->vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
+ memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(*saved));
+ } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
+ memcpy( saved, buf + 512, 448 * sizeof(*saved));
+ memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(*saved));
+ } else { // LONG_STOP or ONLY_LONG
+ memcpy( saved, buf + 512, 512 * sizeof(*saved));
+ }
+}
+
+static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
+{
+ IndividualChannelStream *ics = &sce->ics;
+ INTFLOAT *in = sce->coeffs;
+ INTFLOAT *out = sce->ret;
+ INTFLOAT *saved = sce->saved;
+ INTFLOAT *buf = ac->buf_mdct;
+#if USE_FIXED
+ int i;
+#endif /* USE_FIXED */
+
+ // imdct
+ ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
+
+#if USE_FIXED
+ for (i = 0; i < 1024; i++)
+ buf[i] = (buf[i] + 2) >> 2;
+#endif /* USE_FIXED */
+
+ // window overlapping
+ if (ics->use_kb_window[1]) {
+ // AAC LD uses a low overlap sine window instead of a KBD window
+ memcpy(out, saved, 192 * sizeof(*out));
+ ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, AAC_RENAME(ff_sine_128), 64);
+ memcpy( out + 320, buf + 64, 192 * sizeof(*out));
+ } else {
+ ac->fdsp->vector_fmul_window(out, saved, buf, AAC_RENAME(ff_sine_512), 256);
+ }
+
+ // buffer update
+ memcpy(saved, buf + 256, 256 * sizeof(*saved));
+}
+
+static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
+{
+ INTFLOAT *in = sce->coeffs;
+ INTFLOAT *out = sce->ret;
+ INTFLOAT *saved = sce->saved;
+ INTFLOAT *buf = ac->buf_mdct;
+ int i;
+ const int n = ac->oc[1].m4ac.frame_length_short ? 480 : 512;
+ const int n2 = n >> 1;
+ const int n4 = n >> 2;
+ const INTFLOAT *const window = n == 480 ? AAC_RENAME(ff_aac_eld_window_480) :
+ AAC_RENAME(ff_aac_eld_window_512);
+
+ // Inverse transform, mapped to the conventional IMDCT by
+ // Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
+ // "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
+ // International Conference on Audio, Language and Image Processing, ICALIP 2008.
+ // URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
+ for (i = 0; i < n2; i+=2) {
+ INTFLOAT temp;
+ temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
+ temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp;
+ }
+#if !USE_FIXED
+ if (n == 480)
+ ac->mdct480->imdct_half(ac->mdct480, buf, in, 1, -1.f/(16*1024*960));
+ else
+#endif
+ ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
+
+#if USE_FIXED
+ for (i = 0; i < 1024; i++)
+ buf[i] = (buf[i] + 1) >> 1;
+#endif /* USE_FIXED */
+
+ for (i = 0; i < n; i+=2) {
+ buf[i] = -buf[i];
+ }
+ // Like with the regular IMDCT at this point we still have the middle half
+ // of a transform but with even symmetry on the left and odd symmetry on
+ // the right
+
+ // window overlapping
+ // The spec says to use samples [0..511] but the reference decoder uses
+ // samples [128..639].
+ for (i = n4; i < n2; i ++) {
+ out[i - n4] = AAC_MUL31( buf[ n2 - 1 - i] , window[i - n4]) +
+ AAC_MUL31( saved[ i + n2] , window[i + n - n4]) +
+ AAC_MUL31(-saved[n + n2 - 1 - i] , window[i + 2*n - n4]) +
+ AAC_MUL31(-saved[ 2*n + n2 + i] , window[i + 3*n - n4]);
+ }
+ for (i = 0; i < n2; i ++) {
+ out[n4 + i] = AAC_MUL31( buf[ i] , window[i + n2 - n4]) +
+ AAC_MUL31(-saved[ n - 1 - i] , window[i + n2 + n - n4]) +
+ AAC_MUL31(-saved[ n + i] , window[i + n2 + 2*n - n4]) +
+ AAC_MUL31( saved[2*n + n - 1 - i] , window[i + n2 + 3*n - n4]);
+ }
+ for (i = 0; i < n4; i ++) {
+ out[n2 + n4 + i] = AAC_MUL31( buf[ i + n2] , window[i + n - n4]) +
+ AAC_MUL31(-saved[n2 - 1 - i] , window[i + 2*n - n4]) +
+ AAC_MUL31(-saved[n + n2 + i] , window[i + 3*n - n4]);
+ }
+
+ // buffer update
+ memmove(saved + n, saved, 2 * n * sizeof(*saved));
+ memcpy( saved, buf, n * sizeof(*saved));
+}
+
+/**
+ * channel coupling transformation interface
+ *
+ * @param apply_coupling_method pointer to (in)dependent coupling function
+ */
+static void apply_channel_coupling(AACContext *ac, ChannelElement *cc,
+ enum RawDataBlockType type, int elem_id,
+ enum CouplingPoint coupling_point,
+ void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index))
+{
+ int i, c;
+
+ for (i = 0; i < MAX_ELEM_ID; i++) {
+ ChannelElement *cce = ac->che[TYPE_CCE][i];
+ int index = 0;
+
+ if (cce && cce->coup.coupling_point == coupling_point) {
+ ChannelCoupling *coup = &cce->coup;
+
+ for (c = 0; c <= coup->num_coupled; c++) {
+ if (coup->type[c] == type && coup->id_select[c] == elem_id) {
+ if (coup->ch_select[c] != 1) {
+ apply_coupling_method(ac, &cc->ch[0], cce, index);
+ if (coup->ch_select[c] != 0)
+ index++;
+ }
+ if (coup->ch_select[c] != 2)
+ apply_coupling_method(ac, &cc->ch[1], cce, index++);
+ } else
+ index += 1 + (coup->ch_select[c] == 3);
+ }
+ }
+ }
+}
+
+/**
+ * Convert spectral data to samples, applying all supported tools as appropriate.
+ */
+static void spectral_to_sample(AACContext *ac, int samples)
+{
+ int i, type;
+ void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);
+ switch (ac->oc[1].m4ac.object_type) {
+ case AOT_ER_AAC_LD:
+ imdct_and_window = imdct_and_windowing_ld;
+ break;
+ case AOT_ER_AAC_ELD:
+ imdct_and_window = imdct_and_windowing_eld;
+ break;
+ default:
+ imdct_and_window = ac->imdct_and_windowing;
+ }
+ for (type = 3; type >= 0; type--) {
+ for (i = 0; i < MAX_ELEM_ID; i++) {
+ ChannelElement *che = ac->che[type][i];
+ if (che && che->present) {
+ if (type <= TYPE_CPE)
+ apply_channel_coupling(ac, che, type, i, BEFORE_TNS, AAC_RENAME(apply_dependent_coupling));
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
+ if (che->ch[0].ics.predictor_present) {
+ if (che->ch[0].ics.ltp.present)
+ ac->apply_ltp(ac, &che->ch[0]);
+ if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
+ ac->apply_ltp(ac, &che->ch[1]);
+ }
+ }
+ if (che->ch[0].tns.present)
+ ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
+ if (che->ch[1].tns.present)
+ ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
+ if (type <= TYPE_CPE)
+ apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, AAC_RENAME(apply_dependent_coupling));
+ if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
+ imdct_and_window(ac, &che->ch[0]);
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
+ ac->update_ltp(ac, &che->ch[0]);
+ if (type == TYPE_CPE) {
+ imdct_and_window(ac, &che->ch[1]);
+ if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
+ ac->update_ltp(ac, &che->ch[1]);
+ }
+ if (ac->oc[1].m4ac.sbr > 0) {
+ AAC_RENAME(ff_sbr_apply)(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
+ }
+ }
+ if (type <= TYPE_CCE)
+ apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, AAC_RENAME(apply_independent_coupling));
+
+#if USE_FIXED
+ {
+ int j;
+ /* preparation for resampler */
+ for(j = 0; j<samples; j++){
+ che->ch[0].ret[j] = (int32_t)av_clipl_int32((int64_t)che->ch[0].ret[j]<<7)+0x8000;
+ if(type == TYPE_CPE)
+ che->ch[1].ret[j] = (int32_t)av_clipl_int32((int64_t)che->ch[1].ret[j]<<7)+0x8000;
+ }
+ }
+#endif /* USE_FIXED */
+ che->present = 0;
+ } else if (che) {
+ av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
+ }
+ }
+ }
+}
+
+static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
+{
+ int size;
+ AACADTSHeaderInfo hdr_info;
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int layout_map_tags, ret;
+
+ size = avpriv_aac_parse_header(gb, &hdr_info);
+ if (size > 0) {
+ if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
+ // This is 2 for "VLB " audio in NSV files.
+ // See samples/nsv/vlb_audio.
+ avpriv_report_missing_feature(ac->avctx,
+ "More than one AAC RDB per ADTS frame");
+ ac->warned_num_aac_frames = 1;
+ }
+ push_output_configuration(ac);
+ if (hdr_info.chan_config) {
+ ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
+ if ((ret = set_default_channel_config(ac->avctx,
+ layout_map,
+ &layout_map_tags,
+ hdr_info.chan_config)) < 0)
+ return ret;
+ if ((ret = output_configure(ac, layout_map, layout_map_tags,
+ FFMAX(ac->oc[1].status,
+ OC_TRIAL_FRAME), 0)) < 0)
+ return ret;
+ } else {
+ ac->oc[1].m4ac.chan_config = 0;
+ /**
+ * dual mono frames in Japanese DTV can have chan_config 0
+ * WITHOUT specifying PCE.
+ * thus, set dual mono as default.
+ */
+ if (ac->dmono_mode && ac->oc[0].status == OC_NONE) {
+ layout_map_tags = 2;
+ layout_map[0][0] = layout_map[1][0] = TYPE_SCE;
+ layout_map[0][2] = layout_map[1][2] = AAC_CHANNEL_FRONT;
+ layout_map[0][1] = 0;
+ layout_map[1][1] = 1;
+ if (output_configure(ac, layout_map, layout_map_tags,
+ OC_TRIAL_FRAME, 0))
+ return -7;
+ }
+ }
+ ac->oc[1].m4ac.sample_rate = hdr_info.sample_rate;
+ ac->oc[1].m4ac.sampling_index = hdr_info.sampling_index;
+ ac->oc[1].m4ac.object_type = hdr_info.object_type;
+ ac->oc[1].m4ac.frame_length_short = 0;
+ if (ac->oc[0].status != OC_LOCKED ||
+ ac->oc[0].m4ac.chan_config != hdr_info.chan_config ||
+ ac->oc[0].m4ac.sample_rate != hdr_info.sample_rate) {
+ ac->oc[1].m4ac.sbr = -1;
+ ac->oc[1].m4ac.ps = -1;
+ }
+ if (!hdr_info.crc_absent)
+ skip_bits(gb, 16);
+ }
+ return size;
+}
+
+static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, GetBitContext *gb)
+{
+ AACContext *ac = avctx->priv_data;
+ const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
+ ChannelElement *che;
+ int err, i;
+ int samples = m4ac->frame_length_short ? 960 : 1024;
+ int chan_config = m4ac->chan_config;
+ int aot = m4ac->object_type;
+
+ if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
+ samples >>= 1;
+
+ ac->frame = data;
+
+ if ((err = frame_configure_elements(avctx)) < 0)
+ return err;
+
+ // The FF_PROFILE_AAC_* defines are all object_type - 1
+ // This may lead to an undefined profile being signaled
+ ac->avctx->profile = aot - 1;
+
+ ac->tags_mapped = 0;
+
+ if (chan_config < 0 || (chan_config >= 8 && chan_config < 11) || chan_config >= 13) {
+ avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
+ chan_config);
+ return AVERROR_INVALIDDATA;
+ }
+ for (i = 0; i < tags_per_config[chan_config]; i++) {
+ const int elem_type = aac_channel_layout_map[chan_config-1][i][0];
+ const int elem_id = aac_channel_layout_map[chan_config-1][i][1];
+ if (!(che=get_che(ac, elem_type, elem_id))) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "channel element %d.%d is not allocated\n",
+ elem_type, elem_id);
+ return AVERROR_INVALIDDATA;
+ }
+ che->present = 1;
+ if (aot != AOT_ER_AAC_ELD)
+ skip_bits(gb, 4);
+ switch (elem_type) {
+ case TYPE_SCE:
+ err = decode_ics(ac, &che->ch[0], gb, 0, 0);
+ break;
+ case TYPE_CPE:
+ err = decode_cpe(ac, gb, che);
+ break;
+ case TYPE_LFE:
+ err = decode_ics(ac, &che->ch[0], gb, 0, 0);
+ break;
+ }
+ if (err < 0)
+ return err;
+ }
+
+ spectral_to_sample(ac, samples);
+
+ ac->frame->nb_samples = samples;
+ ac->frame->sample_rate = avctx->sample_rate;
+ *got_frame_ptr = 1;
+
+ skip_bits_long(gb, get_bits_left(gb));
+ return 0;
+}
+
+static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
+{
+ AACContext *ac = avctx->priv_data;
+ ChannelElement *che = NULL, *che_prev = NULL;
+ enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
+ int err, elem_id;
+ int samples = 0, multiplier, audio_found = 0, pce_found = 0;
+ int is_dmono, sce_count = 0;
+
+ ac->frame = data;
+
+ if (show_bits(gb, 12) == 0xfff) {
+ if ((err = parse_adts_frame_header(ac, gb)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
+ goto fail;
+ }
+ if (ac->oc[1].m4ac.sampling_index > 12) {
+ av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ }
+
+ if ((err = frame_configure_elements(avctx)) < 0)
+ goto fail;
+
+ // The FF_PROFILE_AAC_* defines are all object_type - 1
+ // This may lead to an undefined profile being signaled
+ ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
+
+ ac->tags_mapped = 0;
+ // parse
+ while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
+ elem_id = get_bits(gb, 4);
+
+ if (avctx->debug & FF_DEBUG_STARTCODE)
+ av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
+
+ if (!avctx->channels && elem_type != TYPE_PCE) {
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
+ if (elem_type < TYPE_DSE) {
+ if (!(che=get_che(ac, elem_type, elem_id))) {
+ av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
+ elem_type, elem_id);
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ samples = 1024;
+ che->present = 1;
+ }
+
+ switch (elem_type) {
+
+ case TYPE_SCE:
+ err = decode_ics(ac, &che->ch[0], gb, 0, 0);
+ audio_found = 1;
+ sce_count++;
+ break;
+
+ case TYPE_CPE:
+ err = decode_cpe(ac, gb, che);
+ audio_found = 1;
+ break;
+
+ case TYPE_CCE:
+ err = decode_cce(ac, gb, che);
+ break;
+
+ case TYPE_LFE:
+ err = decode_ics(ac, &che->ch[0], gb, 0, 0);
+ audio_found = 1;
+ break;
+
+ case TYPE_DSE:
+ err = skip_data_stream_element(ac, gb);
+ break;
+
+ case TYPE_PCE: {
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int tags;
+ push_output_configuration(ac);
+ tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb);
+ if (tags < 0) {
+ err = tags;
+ break;
+ }
+ if (pce_found) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Not evaluating a further program_config_element as this construct is dubious at best.\n");
+ } else {
+ err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
+ if (!err)
+ ac->oc[1].m4ac.chan_config = 0;
+ pce_found = 1;
+ }
+ break;
+ }
+
+ case TYPE_FIL:
+ if (elem_id == 15)
+ elem_id += get_bits(gb, 8) - 1;
+ if (get_bits_left(gb) < 8 * elem_id) {
+ av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ while (elem_id > 0)
+ elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, elem_type_prev);
+ err = 0; /* FIXME */
+ break;
+
+ default:
+ err = AVERROR_BUG; /* should not happen, but keeps compiler happy */
+ break;
+ }
+
+ che_prev = che;
+ elem_type_prev = elem_type;
+
+ if (err)
+ goto fail;
+
+ if (get_bits_left(gb) < 3) {
+ av_log(avctx, AV_LOG_ERROR, overread_err);
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ }
+
+ if (!avctx->channels) {
+ *got_frame_ptr = 0;
+ return 0;
+ }
+
+ multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
+ samples <<= multiplier;
+
+ spectral_to_sample(ac, samples);
+
+ if (ac->oc[1].status && audio_found) {
+ avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
+ avctx->frame_size = samples;
+ ac->oc[1].status = OC_LOCKED;
+ }
+
+ if (multiplier) {
+ int side_size;
+ const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
+ if (side && side_size>=4)
+ AV_WL32(side, 2*AV_RL32(side));
+ }
+
+ if (!ac->frame->data[0] && samples) {
+ av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
+ if (samples) {
+ ac->frame->nb_samples = samples;
+ ac->frame->sample_rate = avctx->sample_rate;
+ } else
+ av_frame_unref(ac->frame);
+ *got_frame_ptr = !!samples;
+
+ /* for dual-mono audio (SCE + SCE) */
+ is_dmono = ac->dmono_mode && sce_count == 2 &&
+ ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
+ if (is_dmono) {
+ if (ac->dmono_mode == 1)
+ ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0];
+ else if (ac->dmono_mode == 2)
+ ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1];
+ }
+
+ return 0;
+fail:
+ pop_output_configuration(ac);
+ return err;
+}
+
+static int aac_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ AACContext *ac = avctx->priv_data;
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ GetBitContext gb;
+ int buf_consumed;
+ int buf_offset;
+ int err;
+ int new_extradata_size;
+ const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
+ AV_PKT_DATA_NEW_EXTRADATA,
+ &new_extradata_size);
+ int jp_dualmono_size;
+ const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt,
+ AV_PKT_DATA_JP_DUALMONO,
+ &jp_dualmono_size);
+
+ if (new_extradata && 0) {
+ av_free(avctx->extradata);
+ avctx->extradata = av_mallocz(new_extradata_size +
+ AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!avctx->extradata)
+ return AVERROR(ENOMEM);
+ avctx->extradata_size = new_extradata_size;
+ memcpy(avctx->extradata, new_extradata, new_extradata_size);
+ push_output_configuration(ac);
+ if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
+ avctx->extradata,
+ avctx->extradata_size*8LL, 1) < 0) {
+ pop_output_configuration(ac);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ ac->dmono_mode = 0;
+ if (jp_dualmono && jp_dualmono_size > 0)
+ ac->dmono_mode = 1 + *jp_dualmono;
+ if (ac->force_dmono_mode >= 0)
+ ac->dmono_mode = ac->force_dmono_mode;
+
+ if (INT_MAX / 8 <= buf_size)
+ return AVERROR_INVALIDDATA;
+
+ if ((err = init_get_bits8(&gb, buf, buf_size)) < 0)
+ return err;
+
+ switch (ac->oc[1].m4ac.object_type) {
+ case AOT_ER_AAC_LC:
+ case AOT_ER_AAC_LTP:
+ case AOT_ER_AAC_LD:
+ case AOT_ER_AAC_ELD:
+ err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb);
+ break;
+ default:
+ err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt);
+ }
+ if (err < 0)
+ return err;
+
+ buf_consumed = (get_bits_count(&gb) + 7) >> 3;
+ for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
+ if (buf[buf_offset])
+ break;
+
+ return buf_size > buf_offset ? buf_consumed : buf_size;
+}
+
+static av_cold int aac_decode_close(AVCodecContext *avctx)
+{
+ AACContext *ac = avctx->priv_data;
+ int i, type;
+
+ for (i = 0; i < MAX_ELEM_ID; i++) {
+ for (type = 0; type < 4; type++) {
+ if (ac->che[type][i])
+ AAC_RENAME(ff_aac_sbr_ctx_close)(&ac->che[type][i]->sbr);
+ av_freep(&ac->che[type][i]);
+ }
+ }
+
+ ff_mdct_end(&ac->mdct);
+ ff_mdct_end(&ac->mdct_small);
+ ff_mdct_end(&ac->mdct_ld);
+ ff_mdct_end(&ac->mdct_ltp);
+#if !USE_FIXED
+ ff_imdct15_uninit(&ac->mdct480);
+#endif
+ av_freep(&ac->fdsp);
+ return 0;
+}
+
+static void aacdec_init(AACContext *c)
+{
+ c->imdct_and_windowing = imdct_and_windowing;
+ c->apply_ltp = apply_ltp;
+ c->apply_tns = apply_tns;
+ c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
+ c->update_ltp = update_ltp;
+#if USE_FIXED
+ c->vector_pow43 = vector_pow43;
+ c->subband_scale = subband_scale;
+#endif
+
+#if !USE_FIXED
+ if(ARCH_MIPS)
+ ff_aacdec_init_mips(c);
+#endif /* !USE_FIXED */
+}
+/**
+ * AVOptions for Japanese DTV specific extensions (ADTS only)
+ */
+#define AACDEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
+static const AVOption options[] = {
+ {"dual_mono_mode", "Select the channel to decode for dual mono",
+ offsetof(AACContext, force_dmono_mode), AV_OPT_TYPE_INT, {.i64=-1}, -1, 2,
+ AACDEC_FLAGS, "dual_mono_mode"},
+
+ {"auto", "autoselection", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
+ {"main", "Select Main/Left channel", 0, AV_OPT_TYPE_CONST, {.i64= 1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
+ {"sub" , "Select Sub/Right channel", 0, AV_OPT_TYPE_CONST, {.i64= 2}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
+ {"both", "Select both channels", 0, AV_OPT_TYPE_CONST, {.i64= 0}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
+
+ {NULL},
+};
+
+static const AVClass aac_decoder_class = {
+ .class_name = "AAC decoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVProfile profiles[] = {
+ { FF_PROFILE_AAC_MAIN, "Main" },
+ { FF_PROFILE_AAC_LOW, "LC" },
+ { FF_PROFILE_AAC_SSR, "SSR" },
+ { FF_PROFILE_AAC_LTP, "LTP" },
+ { FF_PROFILE_AAC_HE, "HE-AAC" },
+ { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
+ { FF_PROFILE_AAC_LD, "LD" },
+ { FF_PROFILE_AAC_ELD, "ELD" },
+ { FF_PROFILE_UNKNOWN },
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdectab.h b/chromium/third_party/ffmpeg/libavcodec/aacdectab.h
index 3e70e064a6e..5c89a93d5d0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdectab.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdectab.h
@@ -38,46 +38,11 @@
/* @name ltp_coef
* Table of the LTP coefficients
*/
-static const float ltp_coef[8] = {
- 0.570829, 0.696616, 0.813004, 0.911304,
- 0.984900, 1.067894, 1.194601, 1.369533,
+static const INTFLOAT ltp_coef[8] = {
+ Q30(0.570829f), Q30(0.696616f), Q30(0.813004f), Q30(0.911304f),
+ Q30(0.984900f), Q30(1.067894f), Q30(1.194601f), Q30(1.369533f),
};
-/* @name tns_tmp2_map
- * Tables of the tmp2[] arrays of LPC coefficients used for TNS.
- * The suffix _M_N[] indicate the values of coef_compress and coef_res
- * respectively.
- * @{
- */
-static const float tns_tmp2_map_1_3[4] = {
- 0.00000000, -0.43388373, 0.64278758, 0.34202015,
-};
-
-static const float tns_tmp2_map_0_3[8] = {
- 0.00000000, -0.43388373, -0.78183150, -0.97492790,
- 0.98480773, 0.86602539, 0.64278758, 0.34202015,
-};
-
-static const float tns_tmp2_map_1_4[8] = {
- 0.00000000, -0.20791170, -0.40673664, -0.58778524,
- 0.67369562, 0.52643216, 0.36124167, 0.18374951,
-};
-
-static const float tns_tmp2_map_0_4[16] = {
- 0.00000000, -0.20791170, -0.40673664, -0.58778524,
- -0.74314481, -0.86602539, -0.95105654, -0.99452192,
- 0.99573416, 0.96182561, 0.89516330, 0.79801720,
- 0.67369562, 0.52643216, 0.36124167, 0.18374951,
-};
-
-static const float * const tns_tmp2_map[4] = {
- tns_tmp2_map_0_3,
- tns_tmp2_map_0_4,
- tns_tmp2_map_1_3,
- tns_tmp2_map_1_4
-};
-// @}
-
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
static const uint8_t aac_channel_layout_map[16][5][3] = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc.c b/chromium/third_party/ffmpeg/libavcodec/aacenc.c
index 897c3a10df2..bb9004842e2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc.c
@@ -27,7 +27,6 @@
/***********************************
* TODOs:
* add sane pulse detection
- * add temporal noise shaping
***********************************/
#include "libavutil/float_dsp.h"
@@ -42,127 +41,11 @@
#include "aac.h"
#include "aactab.h"
#include "aacenc.h"
+#include "aacenctab.h"
+#include "aacenc_utils.h"
#include "psymodel.h"
-#define AAC_MAX_CHANNELS 6
-
-#define ERROR_IF(cond, ...) \
- if (cond) { \
- av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
- return AVERROR(EINVAL); \
- }
-
-#define WARN_IF(cond, ...) \
- if (cond) { \
- av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \
- }
-
-float ff_aac_pow34sf_tab[428];
-
-static const uint8_t swb_size_1024_96[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
- 12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_64[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8,
- 12, 12, 12, 16, 16, 16, 20, 24, 24, 28, 36,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
-};
-
-static const uint8_t swb_size_1024_48[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
- 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 96
-};
-
-static const uint8_t swb_size_1024_32[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
- 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
-};
-
-static const uint8_t swb_size_1024_24[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28,
- 32, 36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_16[] = {
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24, 24, 28, 28,
- 32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_8[] = {
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 28,
- 32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
-};
-
-static const uint8_t *swb_size_1024[] = {
- swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
- swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
- swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
- swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
- swb_size_1024_8
-};
-
-static const uint8_t swb_size_128_96[] = {
- 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
-};
-
-static const uint8_t swb_size_128_48[] = {
- 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16
-};
-
-static const uint8_t swb_size_128_24[] = {
- 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20
-};
-
-static const uint8_t swb_size_128_16[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
-};
-
-static const uint8_t swb_size_128_8[] = {
- 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
-};
-
-static const uint8_t *swb_size_128[] = {
- /* the last entry on the following row is swb_size_128_64 but is a
- duplicate of swb_size_128_96 */
- swb_size_128_96, swb_size_128_96, swb_size_128_96,
- swb_size_128_48, swb_size_128_48, swb_size_128_48,
- swb_size_128_24, swb_size_128_24, swb_size_128_16,
- swb_size_128_16, swb_size_128_16, swb_size_128_8,
- swb_size_128_8
-};
-
-/** default channel configurations */
-static const uint8_t aac_chan_configs[6][5] = {
- {1, TYPE_SCE}, // 1 channel - single channel element
- {1, TYPE_CPE}, // 2 channels - channel pair
- {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
- {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
- {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
- {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
-};
-
-/**
- * Table to remap channels from libavcodec's default order to AAC order.
- */
-static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
- { 0 },
- { 0, 1 },
- { 2, 0, 1 },
- { 2, 0, 1, 3 },
- { 2, 0, 1, 3, 4 },
- { 2, 0, 1, 4, 5, 3 },
-};
-
/**
* Make AAC audio config object.
* @see 1.6.2.1 "Syntax - AudioSpecificConfig"
@@ -173,7 +56,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
- put_bits(&pb, 5, 2); //object type - AAC-LC
+ put_bits(&pb, 5, s->profile+1); //profile
put_bits(&pb, 4, s->samplerate_index); //sample rate index
put_bits(&pb, 4, s->channels);
//GASpecificConfig
@@ -265,7 +148,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
else
for (i = 0; i < 1024; i += 128)
- s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + i, output + i*2);
+ s->mdct128.mdct_calc(&s->mdct128, &sce->coeffs[i], output + i*2);
memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024);
memcpy(sce->pcoeffs, sce->coeffs, sizeof(sce->pcoeffs));
}
@@ -283,7 +166,7 @@ static void put_ics_info(AACEncContext *s, IndividualChannelStream *info)
put_bits(&s->pb, 1, info->use_kb_window[0]);
if (info->window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
put_bits(&s->pb, 6, info->max_sfb);
- put_bits(&s->pb, 1, 0); // no prediction
+ put_bits(&s->pb, 1, !!info->predictor_present);
} else {
put_bits(&s->pb, 4, info->max_sfb);
for (w = 1; w < 8; w++)
@@ -312,26 +195,14 @@ static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
static void adjust_frame_information(ChannelElement *cpe, int chans)
{
int i, w, w2, g, ch;
- int start, maxsfb, cmaxsfb;
+ int maxsfb, cmaxsfb;
for (ch = 0; ch < chans; ch++) {
IndividualChannelStream *ics = &cpe->ch[ch].ics;
- start = 0;
maxsfb = 0;
cpe->ch[ch].pulse.num_pulse = 0;
for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {
- for (w2 = 0; w2 < ics->group_len[w]; w2++) {
- start = (w+w2) * 128;
- for (g = 0; g < ics->num_swb; g++) {
- //apply M/S
- if (cpe->common_window && !ch && cpe->ms_mask[w*16 + g]) {
- for (i = 0; i < ics->swb_sizes[g]; i++) {
- cpe->ch[0].coeffs[start+i] = (cpe->ch[0].pcoeffs[start+i] + cpe->ch[1].pcoeffs[start+i]) * 0.5f;
- cpe->ch[1].coeffs[start+i] = cpe->ch[0].coeffs[start+i] - cpe->ch[1].pcoeffs[start+i];
- }
- }
- start += ics->swb_sizes[g];
- }
+ for (w2 = 0; w2 < ics->group_len[w]; w2++) {
for (cmaxsfb = ics->num_swb; cmaxsfb > 0 && cpe->ch[ch].zeroes[w*16+cmaxsfb-1]; cmaxsfb--)
;
maxsfb = FFMAX(maxsfb, cmaxsfb);
@@ -371,6 +242,59 @@ static void adjust_frame_information(ChannelElement *cpe, int chans)
}
}
+static void apply_intensity_stereo(ChannelElement *cpe)
+{
+ int w, w2, g, i;
+ IndividualChannelStream *ics = &cpe->ch[0].ics;
+ if (!cpe->common_window)
+ return;
+ for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {
+ for (w2 = 0; w2 < ics->group_len[w]; w2++) {
+ int start = (w+w2) * 128;
+ for (g = 0; g < ics->num_swb; g++) {
+ int p = -1 + 2 * (cpe->ch[1].band_type[w*16+g] - 14);
+ float scale = cpe->ch[0].is_ener[w*16+g];
+ if (!cpe->is_mask[w*16 + g]) {
+ start += ics->swb_sizes[g];
+ continue;
+ }
+ for (i = 0; i < ics->swb_sizes[g]; i++) {
+ float sum = (cpe->ch[0].coeffs[start+i] + p*cpe->ch[1].coeffs[start+i])*scale;
+ cpe->ch[0].coeffs[start+i] = sum;
+ cpe->ch[1].coeffs[start+i] = 0.0f;
+ }
+ start += ics->swb_sizes[g];
+ }
+ }
+ }
+}
+
+static void apply_mid_side_stereo(ChannelElement *cpe)
+{
+ int w, w2, g, i;
+ IndividualChannelStream *ics = &cpe->ch[0].ics;
+ if (!cpe->common_window)
+ return;
+ for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {
+ for (w2 = 0; w2 < ics->group_len[w]; w2++) {
+ int start = (w+w2) * 128;
+ for (g = 0; g < ics->num_swb; g++) {
+ if (!cpe->ms_mask[w*16 + g]) {
+ start += ics->swb_sizes[g];
+ continue;
+ }
+ for (i = 0; i < ics->swb_sizes[g]; i++) {
+ float L = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) * 0.5f;
+ float R = L - cpe->ch[1].coeffs[start+i];
+ cpe->ch[0].coeffs[start+i] = L;
+ cpe->ch[1].coeffs[start+i] = R;
+ }
+ start += ics->swb_sizes[g];
+ }
+ }
+ }
+}
+
/**
* Encode scalefactor band coding type.
*/
@@ -378,6 +302,9 @@ static void encode_band_info(AACEncContext *s, SingleChannelElement *sce)
{
int w;
+ if (s->coder->set_special_band_scalefactors)
+ s->coder->set_special_band_scalefactors(s, sce);
+
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
s->coder->encode_window_bands_info(s, sce, w, sce->ics.group_len[w], s->lambda);
}
@@ -389,7 +316,7 @@ static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce)
{
int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0] - NOISE_OFFSET;
- int noise_flag = 1;
+ int off_is = 0, noise_flag = 1;
int i, w;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
@@ -402,6 +329,10 @@ static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
put_bits(&s->pb, NOISE_PRE_BITS, diff + NOISE_PRE);
continue;
}
+ } else if (sce->band_type[w*16 + i] == INTENSITY_BT ||
+ sce->band_type[w*16 + i] == INTENSITY_BT2) {
+ diff = sce->sf_idx[w*16 + i] - off_is;
+ off_is = sce->sf_idx[w*16 + i];
} else {
diff = sce->sf_idx[w*16 + i] - off_sf;
off_sf = sce->sf_idx[w*16 + i];
@@ -447,18 +378,41 @@ static void encode_spectral_coeffs(AACEncContext *s, SingleChannelElement *sce)
start += sce->ics.swb_sizes[i];
continue;
}
- for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++)
- s->coder->quantize_and_encode_band(s, &s->pb, sce->coeffs + start + w2*128,
- sce->ics.swb_sizes[i],
+ for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++) {
+ s->coder->quantize_and_encode_band(s, &s->pb,
+ &sce->coeffs[start + w2*128],
+ NULL, sce->ics.swb_sizes[i],
sce->sf_idx[w*16 + i],
sce->band_type[w*16 + i],
- s->lambda);
+ s->lambda,
+ sce->ics.window_clipping[w]);
+ }
start += sce->ics.swb_sizes[i];
}
}
}
/**
+ * Downscale spectral coefficients for near-clipping windows to avoid artifacts
+ */
+static void avoid_clipping(AACEncContext *s, SingleChannelElement *sce)
+{
+ int start, i, j, w;
+
+ if (sce->ics.clip_avoidance_factor < 1.0f) {
+ for (w = 0; w < sce->ics.num_windows; w++) {
+ start = 0;
+ for (i = 0; i < sce->ics.max_sfb; i++) {
+ float *swb_coeffs = &sce->coeffs[start + w*128];
+ for (j = 0; j < sce->ics.swb_sizes[i]; j++)
+ swb_coeffs[j] *= sce->ics.clip_avoidance_factor;
+ start += sce->ics.swb_sizes[i];
+ }
+ }
+ }
+}
+
+/**
* Encode one channel of audio data.
*/
static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
@@ -466,12 +420,17 @@ static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
int common_window)
{
put_bits(&s->pb, 8, sce->sf_idx[0]);
- if (!common_window)
+ if (!common_window) {
put_ics_info(s, &sce->ics);
+ if (s->coder->encode_main_pred)
+ s->coder->encode_main_pred(s, sce);
+ }
encode_band_info(s, sce);
encode_scale_factors(avctx, s, sce);
encode_pulses(s, &sce->pulse);
- put_bits(&s->pb, 1, 0); //tns
+ put_bits(&s->pb, 1, !!sce->tns.present);
+ if (s->coder->encode_tns_info)
+ s->coder->encode_tns_info(s, sce);
put_bits(&s->pb, 1, 0); //ssr
encode_spectral_coeffs(s, sce);
return 0;
@@ -529,7 +488,9 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
AACEncContext *s = avctx->priv_data;
float **samples = s->planar_samples, *samples2, *la, *overlap;
ChannelElement *cpe;
- int i, ch, w, g, chans, tag, start_ch, ret, ms_mode = 0;
+ SingleChannelElement *sce;
+ int i, ch, w, chans, tag, start_ch, ret;
+ int ms_mode = 0, is_mode = 0, tns_mode = 0, pred_mode = 0;
int chan_el_counter[4];
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
@@ -558,6 +519,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
for (ch = 0; ch < chans; ch++) {
IndividualChannelStream *ics = &cpe->ch[ch].ics;
int cur_channel = start_ch + ch;
+ float clip_avoidance_factor;
overlap = &samples[cur_channel][0];
samples2 = overlap + 1024;
la = samples2 + (448+64);
@@ -585,25 +547,46 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ics->num_windows = wi[ch].num_windows;
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
ics->num_swb = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
+ ics->swb_offset = wi[ch].window_type[0] == EIGHT_SHORT_SEQUENCE ?
+ ff_swb_offset_128 [s->samplerate_index]:
+ ff_swb_offset_1024[s->samplerate_index];
+ ics->tns_max_bands = wi[ch].window_type[0] == EIGHT_SHORT_SEQUENCE ?
+ ff_tns_max_bands_128 [s->samplerate_index]:
+ ff_tns_max_bands_1024[s->samplerate_index];
+ clip_avoidance_factor = 0.0f;
for (w = 0; w < ics->num_windows; w++)
ics->group_len[w] = wi[ch].grouping[w];
+ for (w = 0; w < ics->num_windows; w++) {
+ if (wi[ch].clipping[w] > CLIP_AVOIDANCE_FACTOR) {
+ ics->window_clipping[w] = 1;
+ clip_avoidance_factor = FFMAX(clip_avoidance_factor, wi[ch].clipping[w]);
+ } else {
+ ics->window_clipping[w] = 0;
+ }
+ }
+ if (clip_avoidance_factor > CLIP_AVOIDANCE_FACTOR) {
+ ics->clip_avoidance_factor = CLIP_AVOIDANCE_FACTOR / clip_avoidance_factor;
+ } else {
+ ics->clip_avoidance_factor = 1.0f;
+ }
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
if (isnan(cpe->ch->coeffs[0])) {
av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n");
return AVERROR(EINVAL);
}
+ avoid_clipping(s, &cpe->ch[ch]);
}
start_ch += chans;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels, 0)) < 0)
return ret;
do {
int frame_bits;
init_put_bits(&s->pb, avpkt->data, avpkt->size);
- if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
+ if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT))
put_bitstream_info(s, LIBAVCODEC_IDENT);
start_ch = 0;
memset(chan_el_counter, 0, sizeof(chan_el_counter));
@@ -613,16 +596,26 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
+ cpe->common_window = 0;
+ memset(cpe->is_mask, 0, sizeof(cpe->is_mask));
+ memset(cpe->ms_mask, 0, sizeof(cpe->ms_mask));
put_bits(&s->pb, 3, tag);
put_bits(&s->pb, 4, chan_el_counter[tag]++);
- for (ch = 0; ch < chans; ch++)
- coeffs[ch] = cpe->ch[ch].coeffs;
+ for (ch = 0; ch < chans; ch++) {
+ sce = &cpe->ch[ch];
+ coeffs[ch] = sce->coeffs;
+ sce->ics.predictor_present = 0;
+ memset(&sce->ics.prediction_used, 0, sizeof(sce->ics.prediction_used));
+ memset(&sce->tns, 0, sizeof(TemporalNoiseShaping));
+ for (w = 0; w < 128; w++)
+ if (sce->band_type[w] > RESERVED_BT)
+ sce->band_type[w] = 0;
+ }
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
for (ch = 0; ch < chans; ch++) {
s->cur_channel = start_ch + ch;
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
}
- cpe->common_window = 0;
if (chans > 1
&& wi[0].window_type[0] == wi[1].window_type[0]
&& wi[0].window_shape == wi[1].window_shape) {
@@ -635,22 +628,59 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
}
}
+ for (ch = 0; ch < chans; ch++) { /* TNS and PNS */
+ sce = &cpe->ch[ch];
+ s->cur_channel = start_ch + ch;
+ if (s->options.pns && s->coder->search_for_pns)
+ s->coder->search_for_pns(s, avctx, sce);
+ if (s->options.tns && s->coder->search_for_tns)
+ s->coder->search_for_tns(s, sce);
+ if (s->options.tns && s->coder->apply_tns_filt)
+ s->coder->apply_tns_filt(s, sce);
+ if (sce->tns.present)
+ tns_mode = 1;
+ }
s->cur_channel = start_ch;
- if (s->options.stereo_mode && cpe->common_window) {
- if (s->options.stereo_mode > 0) {
- IndividualChannelStream *ics = &cpe->ch[0].ics;
- for (w = 0; w < ics->num_windows; w += ics->group_len[w])
- for (g = 0; g < ics->num_swb; g++)
- cpe->ms_mask[w*16+g] = 1;
- } else if (s->coder->search_for_ms) {
- s->coder->search_for_ms(s, cpe, s->lambda);
+ if (s->options.intensity_stereo) { /* Intensity Stereo */
+ if (s->coder->search_for_is)
+ s->coder->search_for_is(s, avctx, cpe);
+ if (cpe->is_mode) is_mode = 1;
+ apply_intensity_stereo(cpe);
+ }
+ if (s->options.pred) { /* Prediction */
+ for (ch = 0; ch < chans; ch++) {
+ sce = &cpe->ch[ch];
+ s->cur_channel = start_ch + ch;
+ if (s->options.pred && s->coder->search_for_pred)
+ s->coder->search_for_pred(s, sce);
+ if (cpe->ch[ch].ics.predictor_present) pred_mode = 1;
}
+ if (s->coder->adjust_common_prediction)
+ s->coder->adjust_common_prediction(s, cpe);
+ for (ch = 0; ch < chans; ch++) {
+ sce = &cpe->ch[ch];
+ s->cur_channel = start_ch + ch;
+ if (s->options.pred && s->coder->apply_main_pred)
+ s->coder->apply_main_pred(s, sce);
+ }
+ s->cur_channel = start_ch;
+ }
+ if (s->options.stereo_mode) { /* Mid/Side stereo */
+ if (s->options.stereo_mode == -1 && s->coder->search_for_ms)
+ s->coder->search_for_ms(s, cpe);
+ else if (cpe->common_window)
+ memset(cpe->ms_mask, 1, sizeof(cpe->ms_mask));
+ for (w = 0; w < 128; w++)
+ cpe->ms_mask[w] = cpe->is_mask[w] ? 0 : cpe->ms_mask[w];
+ apply_mid_side_stereo(cpe);
}
adjust_frame_information(cpe, chans);
if (chans == 2) {
put_bits(&s->pb, 1, cpe->common_window);
if (cpe->common_window) {
put_ics_info(s, &cpe->ch[0].ics);
+ if (s->coder->encode_main_pred)
+ s->coder->encode_main_pred(s, &cpe->ch[0]);
encode_ms_info(&s->pb, cpe);
if (cpe->ms_mode) ms_mode = 1;
}
@@ -667,7 +697,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s->psy.bitres.bits = frame_bits / s->channels;
break;
}
- if (ms_mode) {
+ if (is_mode || ms_mode || tns_mode || pred_mode) {
for (i = 0; i < s->chan_map[0]; i++) {
// Must restore coeffs
chans = tag == TYPE_CPE ? 2 : 1;
@@ -686,7 +716,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avctx->frame_bits = put_bits_count(&s->pb);
// rate control stuff
- if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;
s->lambda *= ratio;
s->lambda = FFMIN(s->lambda, 65536.f);
@@ -710,6 +740,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
ff_mdct_end(&s->mdct1024);
ff_mdct_end(&s->mdct128);
ff_psy_end(&s->psy);
+ ff_lpc_end(&s->lpc);
if (s->psypp)
ff_psy_preprocess_end(s->psypp);
av_freep(&s->buffer.samples);
@@ -723,7 +754,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
{
int ret = 0;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
@@ -746,7 +777,7 @@ static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
int ch;
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->buffer.samples, s->channels, 3 * 1024 * sizeof(s->buffer.samples[0]), alloc_fail);
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->cpe, s->chan_map[0], sizeof(ChannelElement), alloc_fail);
- FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
+ FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + AV_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
for(ch = 0; ch < s->channels; ch++)
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
@@ -772,16 +803,29 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
s->channels = avctx->channels;
- ERROR_IF(i == 16
- || i >= (sizeof(swb_size_1024) / sizeof(*swb_size_1024))
- || i >= (sizeof(swb_size_128) / sizeof(*swb_size_128)),
+ ERROR_IF(i == 16 || i >= ff_aac_swb_size_1024_len || i >= ff_aac_swb_size_128_len,
"Unsupported sample rate %d\n", avctx->sample_rate);
ERROR_IF(s->channels > AAC_MAX_CHANNELS,
"Unsupported number of channels: %d\n", s->channels);
- ERROR_IF(avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW,
- "Unsupported profile %d\n", avctx->profile);
WARN_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
"Too many bits per frame requested, clamping to max\n");
+ if (avctx->profile == FF_PROFILE_AAC_MAIN) {
+ s->options.pred = 1;
+ } else if ((avctx->profile == FF_PROFILE_AAC_LOW ||
+ avctx->profile == FF_PROFILE_UNKNOWN) && s->options.pred) {
+ s->profile = 0; /* Main */
+ WARN_IF(1, "Prediction requested, changing profile to AAC-Main\n");
+ } else if (avctx->profile == FF_PROFILE_AAC_LOW ||
+ avctx->profile == FF_PROFILE_UNKNOWN) {
+ s->profile = 1; /* Low */
+ } else {
+ ERROR_IF(1, "Unsupported profile %d\n", avctx->profile);
+ }
+
+ if (s->options.aac_coder != AAC_CODER_TWOLOOP) {
+ s->options.intensity_stereo = 0;
+ s->options.pns = 0;
+ }
avctx->bit_rate = (int)FFMIN(
6144 * s->channels / 1024.0 * avctx->sample_rate,
@@ -800,8 +844,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
avctx->extradata_size = 5;
put_audio_specific_config(avctx);
- sizes[0] = swb_size_1024[i];
- sizes[1] = swb_size_128[i];
+ sizes[0] = ff_aac_swb_size_1024[i];
+ sizes[1] = ff_aac_swb_size_128[i];
lengths[0] = ff_aac_num_swb_1024[i];
lengths[1] = ff_aac_num_swb_128[i];
for (i = 0; i < s->chan_map[0]; i++)
@@ -811,17 +855,16 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto fail;
s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[s->options.aac_coder];
+ ff_lpc_init(&s->lpc, 2*avctx->frame_size, TNS_MAX_ORDER, FF_LPC_TYPE_LEVINSON);
if (HAVE_MIPSDSPR1)
ff_aac_coder_init_mips(s);
s->lambda = avctx->global_quality > 0 ? avctx->global_quality : 120;
+ s->random_state = 0x1f2e3d4c;
ff_aac_tableinit();
- for (i = 0; i < 428; i++)
- ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
-
avctx->initial_padding = 1024;
ff_af_queue_init(avctx, &s->afq);
@@ -837,14 +880,15 @@ static const AVOption aacenc_options[] = {
{"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_off", "Disable Mid/Side coding", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
- {"aac_coder", "", offsetof(AACEncContext, options.aac_coder), AV_OPT_TYPE_INT, {.i64 = AAC_CODER_TWOLOOP}, 0, AAC_CODER_NB-1, AACENC_FLAGS, "aac_coder"},
+ {"aac_coder", "Coding algorithm", offsetof(AACEncContext, options.aac_coder), AV_OPT_TYPE_INT, {.i64 = AAC_CODER_TWOLOOP}, 0, AAC_CODER_NB-1, AACENC_FLAGS, "aac_coder"},
{"faac", "FAAC-inspired method", 0, AV_OPT_TYPE_CONST, {.i64 = AAC_CODER_FAAC}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
{"anmr", "ANMR method", 0, AV_OPT_TYPE_CONST, {.i64 = AAC_CODER_ANMR}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
{"twoloop", "Two loop searching method", 0, AV_OPT_TYPE_CONST, {.i64 = AAC_CODER_TWOLOOP}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
{"fast", "Constant quantizer", 0, AV_OPT_TYPE_CONST, {.i64 = AAC_CODER_FAST}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
- {"aac_pns", "Perceptual Noise Substitution", offsetof(AACEncContext, options.pns), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AACENC_FLAGS, "aac_pns"},
- {"disable", "Disable PNS", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pns"},
- {"enable", "Enable PNS (Proof of concept)", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pns"},
+ {"aac_pns", "Perceptual Noise Substitution", offsetof(AACEncContext, options.pns), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AACENC_FLAGS},
+ {"aac_is", "Intensity stereo coding", offsetof(AACEncContext, options.intensity_stereo), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AACENC_FLAGS},
+ {"aac_tns", "Temporal noise shaping", offsetof(AACEncContext, options.tns), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AACENC_FLAGS},
+ {"aac_pred", "AAC-Main prediction", offsetof(AACEncContext, options.pred), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AACENC_FLAGS},
{NULL}
};
@@ -855,13 +899,6 @@ static const AVClass aacenc_class = {
LIBAVUTIL_VERSION_INT,
};
-/* duplicated from avpriv_mpeg4audio_sample_rates to avoid shared build
- * failures */
-static const int mpeg4audio_sample_rates[16] = {
- 96000, 88200, 64000, 48000, 44100, 32000,
- 24000, 22050, 16000, 12000, 11025, 8000, 7350
-};
-
AVCodec ff_aac_encoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
@@ -872,8 +909,8 @@ AVCodec ff_aac_encoder = {
.encode2 = aac_encode_frame,
.close = aac_encode_end,
.supported_samplerates = mpeg4audio_sample_rates,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY |
- CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &aacenc_class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc.h b/chromium/third_party/ffmpeg/libavcodec/aacenc.h
index 7c1f277fa18..54951f9f70a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc.h
@@ -30,6 +30,8 @@
#include "audio_frame_queue.h"
#include "psymodel.h"
+#include "lpc.h"
+
typedef enum AACCoder {
AAC_CODER_FAAC = 0,
AAC_CODER_ANMR,
@@ -43,6 +45,9 @@ typedef struct AACEncOptions {
int stereo_mode;
int aac_coder;
int pns;
+ int tns;
+ int pred;
+ int intensity_stereo;
} AACEncOptions;
struct AACEncContext;
@@ -52,9 +57,19 @@ typedef struct AACCoefficientsEncoder {
SingleChannelElement *sce, const float lambda);
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda);
- void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
- int scale_idx, int cb, const float lambda);
- void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
+ void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size,
+ int scale_idx, int cb, const float lambda, int rtz);
+ void (*encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*encode_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*adjust_common_prediction)(struct AACEncContext *s, ChannelElement *cpe);
+ void (*apply_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
+ void (*search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe);
+ void (*search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
+ void (*search_for_pred)(struct AACEncContext *s, SingleChannelElement *sce);
} AACCoefficientsEncoder;
extern AACCoefficientsEncoder ff_aac_coders[];
@@ -71,6 +86,8 @@ typedef struct AACEncContext {
AVFloatDSPContext *fdsp;
float *planar_samples[6]; ///< saved preprocessed input
+ int profile; ///< copied from avctx
+ LPCContext lpc; ///< used by TNS
int samplerate_index; ///< MPEG-4 samplerate index
int channels; ///< channel count
const uint8_t *chan_map; ///< channel configuration map
@@ -81,6 +98,7 @@ typedef struct AACEncContext {
AACCoefficientsEncoder *coder;
int cur_channel;
int last_frame;
+ int random_state;
float lambda;
AudioFrameQueue afq;
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
@@ -91,8 +109,6 @@ typedef struct AACEncContext {
} buffer;
} AACEncContext;
-extern float ff_aac_pow34sf_tab[428];
-
void ff_aac_coder_init_mips(AACEncContext *c);
#endif /* AVCODEC_AACENC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_is.c b/chromium/third_party/ffmpeg/libavcodec/aacenc_is.c
new file mode 100644
index 00000000000..e983b7548fe
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_is.c
@@ -0,0 +1,141 @@
+/*
+ * AAC encoder intensity stereo
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder Intensity Stereo
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#include "aacenc.h"
+#include "aacenc_utils.h"
+#include "aacenc_is.h"
+#include "aacenc_quantization.h"
+
+struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
+ int start, int w, int g, float ener0,
+ float ener1, float ener01,
+ int use_pcoeffs, int phase)
+{
+ int i, w2;
+ SingleChannelElement *sce0 = &cpe->ch[0];
+ SingleChannelElement *sce1 = &cpe->ch[1];
+ float *L = use_pcoeffs ? sce0->pcoeffs : sce0->coeffs;
+ float *R = use_pcoeffs ? sce1->pcoeffs : sce1->coeffs;
+ float *L34 = &s->scoefs[256*0], *R34 = &s->scoefs[256*1];
+ float *IS = &s->scoefs[256*2], *I34 = &s->scoefs[256*3];
+ float dist1 = 0.0f, dist2 = 0.0f;
+ struct AACISError is_error = {0};
+
+ for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
+ FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
+ FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
+ int is_band_type, is_sf_idx = FFMAX(1, sce0->sf_idx[(w+w2)*16+g]-4);
+ float e01_34 = phase*pow(ener1/ener0, 3.0/4.0);
+ float maxval, dist_spec_err = 0.0f;
+ float minthr = FFMIN(band0->threshold, band1->threshold);
+ for (i = 0; i < sce0->ics.swb_sizes[g]; i++)
+ IS[i] = (L[start+(w+w2)*128+i] + phase*R[start+(w+w2)*128+i])*sqrt(ener0/ener01);
+ abs_pow34_v(L34, &L[start+(w+w2)*128], sce0->ics.swb_sizes[g]);
+ abs_pow34_v(R34, &R[start+(w+w2)*128], sce0->ics.swb_sizes[g]);
+ abs_pow34_v(I34, IS, sce0->ics.swb_sizes[g]);
+ maxval = find_max_val(1, sce0->ics.swb_sizes[g], I34);
+ is_band_type = find_min_book(maxval, is_sf_idx);
+ dist1 += quantize_band_cost(s, &L[start + (w+w2)*128], L34,
+ sce0->ics.swb_sizes[g],
+ sce0->sf_idx[(w+w2)*16+g],
+ sce0->band_type[(w+w2)*16+g],
+ s->lambda / band0->threshold, INFINITY, NULL, 0);
+ dist1 += quantize_band_cost(s, &R[start + (w+w2)*128], R34,
+ sce1->ics.swb_sizes[g],
+ sce1->sf_idx[(w+w2)*16+g],
+ sce1->band_type[(w+w2)*16+g],
+ s->lambda / band1->threshold, INFINITY, NULL, 0);
+ dist2 += quantize_band_cost(s, IS, I34, sce0->ics.swb_sizes[g],
+ is_sf_idx, is_band_type,
+ s->lambda / minthr, INFINITY, NULL, 0);
+ for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
+ dist_spec_err += (L34[i] - I34[i])*(L34[i] - I34[i]);
+ dist_spec_err += (R34[i] - I34[i]*e01_34)*(R34[i] - I34[i]*e01_34);
+ }
+ dist_spec_err *= s->lambda / minthr;
+ dist2 += dist_spec_err;
+ }
+
+ is_error.pass = dist2 <= dist1;
+ is_error.phase = phase;
+ is_error.error = fabsf(dist1 - dist2);
+ is_error.dist1 = dist1;
+ is_error.dist2 = dist2;
+
+ return is_error;
+}
+
+void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe)
+{
+ SingleChannelElement *sce0 = &cpe->ch[0];
+ SingleChannelElement *sce1 = &cpe->ch[1];
+ int start = 0, count = 0, w, w2, g, i;
+ const float freq_mult = avctx->sample_rate/(1024.0f/sce0->ics.num_windows)/2.0f;
+
+ if (!cpe->common_window)
+ return;
+
+ for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
+ start = 0;
+ for (g = 0; g < sce0->ics.num_swb; g++) {
+ if (start*freq_mult > INT_STEREO_LOW_LIMIT*(s->lambda/170.0f) &&
+ cpe->ch[0].band_type[w*16+g] != NOISE_BT && !cpe->ch[0].zeroes[w*16+g] &&
+ cpe->ch[1].band_type[w*16+g] != NOISE_BT && !cpe->ch[1].zeroes[w*16+g]) {
+ float ener0 = 0.0f, ener1 = 0.0f, ener01 = 0.0f;
+ struct AACISError ph_err1, ph_err2, *erf;
+ if (sce0->band_type[w*16+g] == NOISE_BT ||
+ sce1->band_type[w*16+g] == NOISE_BT) {
+ start += sce0->ics.swb_sizes[g];
+ continue;
+ }
+ for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
+ for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
+ float coef0 = fabsf(sce0->pcoeffs[start+(w+w2)*128+i]);
+ float coef1 = fabsf(sce1->pcoeffs[start+(w+w2)*128+i]);
+ ener0 += coef0*coef0;
+ ener1 += coef1*coef1;
+ ener01 += (coef0 + coef1)*(coef0 + coef1);
+ }
+ }
+ ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
+ ener0, ener1, ener01, 0, -1);
+ ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
+ ener0, ener1, ener01, 0, +1);
+ erf = ph_err1.error < ph_err2.error ? &ph_err1 : &ph_err2;
+ if (erf->pass) {
+ cpe->is_mask[w*16+g] = 1;
+ cpe->ch[0].is_ener[w*16+g] = sqrt(ener0/ener01);
+ cpe->ch[1].is_ener[w*16+g] = ener0/ener1;
+ cpe->ch[1].band_type[w*16+g] = erf->phase ? INTENSITY_BT : INTENSITY_BT2;
+ count++;
+ }
+ }
+ start += sce0->ics.swb_sizes[g];
+ }
+ }
+ cpe->is_mode = !!count;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_is.h b/chromium/third_party/ffmpeg/libavcodec/aacenc_is.h
new file mode 100644
index 00000000000..31bbacac580
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_is.h
@@ -0,0 +1,50 @@
+/*
+ * AAC encoder intensity stereo
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder Intensity Stereo
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_IS_H
+#define AVCODEC_AACENC_IS_H
+
+#include "aacenc.h"
+
+/** Frequency in Hz for lower limit of intensity stereo **/
+#define INT_STEREO_LOW_LIMIT 6100
+
+struct AACISError {
+ int pass; /* 1 if dist2 <= dist1 */
+ int phase; /* -1 or +1 */
+ float error; /* fabs(dist1 - dist2) */
+ float dist1; /* From original coeffs */
+ float dist2; /* From IS'd coeffs */
+};
+
+struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
+ int start, int w, int g, float ener0,
+ float ener1, float ener01,
+ int use_pcoeffs, int phase);
+void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
+
+#endif /* AVCODEC_AACENC_IS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.c b/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.c
new file mode 100644
index 00000000000..c0e5e6e3b67
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.c
@@ -0,0 +1,344 @@
+/*
+ * AAC encoder main-type prediction
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder Intensity Stereo
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#include "aactab.h"
+#include "aacenc_pred.h"
+#include "aacenc_utils.h"
+#include "aacenc_is.h" /* <- Needed for common window distortions */
+#include "aacenc_quantization.h"
+
+#define RESTORE_PRED(sce, sfb) \
+ if (sce->ics.prediction_used[sfb]) {\
+ sce->ics.prediction_used[sfb] = 0;\
+ sce->band_type[sfb] = sce->band_alt[sfb];\
+ }
+
+static inline float flt16_round(float pf)
+{
+ union av_intfloat32 tmp;
+ tmp.f = pf;
+ tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
+ return tmp.f;
+}
+
+static inline float flt16_even(float pf)
+{
+ union av_intfloat32 tmp;
+ tmp.f = pf;
+ tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
+ return tmp.f;
+}
+
+static inline float flt16_trunc(float pf)
+{
+ union av_intfloat32 pun;
+ pun.f = pf;
+ pun.i &= 0xFFFF0000U;
+ return pun.f;
+}
+
+static inline void predict(PredictorState *ps, float *coef, float *rcoef, int set)
+{
+ float k2;
+ const float a = 0.953125; // 61.0 / 64
+ const float alpha = 0.90625; // 29.0 / 32
+ const float k1 = ps->k1;
+ const float r0 = ps->r0, r1 = ps->r1;
+ const float cor0 = ps->cor0, cor1 = ps->cor1;
+ const float var0 = ps->var0, var1 = ps->var1;
+ const float e0 = *coef - ps->x_est;
+ const float e1 = e0 - k1 * r0;
+
+ if (set)
+ *coef = e0;
+
+ ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
+ ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
+ ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
+ ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
+ ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
+ ps->r0 = flt16_trunc(a * e0);
+
+ /* Prediction for next frame */
+ ps->k1 = ps->var0 > 1 ? ps->cor0 * flt16_even(a / ps->var0) : 0;
+ k2 = ps->var1 > 1 ? ps->cor1 * flt16_even(a / ps->var1) : 0;
+ *rcoef = ps->x_est = flt16_round(ps->k1*ps->r0 + k2*ps->r1);
+}
+
+static inline void reset_predict_state(PredictorState *ps)
+{
+ ps->r0 = 0.0f;
+ ps->r1 = 0.0f;
+ ps->k1 = 0.0f;
+ ps->cor0 = 0.0f;
+ ps->cor1 = 0.0f;
+ ps->var0 = 1.0f;
+ ps->var1 = 1.0f;
+ ps->x_est = 0.0f;
+}
+
+static inline void reset_all_predictors(PredictorState *ps)
+{
+ int i;
+ for (i = 0; i < MAX_PREDICTORS; i++)
+ reset_predict_state(&ps[i]);
+}
+
+static inline void reset_predictor_group(SingleChannelElement *sce, int group_num)
+{
+ int i;
+ PredictorState *ps = sce->predictor_state;
+ for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
+ reset_predict_state(&ps[i]);
+}
+
+void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce)
+{
+ int sfb, k;
+ const int pmax = FFMIN(sce->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
+
+ if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
+ for (sfb = 0; sfb < pmax; sfb++) {
+ for (k = sce->ics.swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) {
+ predict(&sce->predictor_state[k], &sce->coeffs[k], &sce->prcoeffs[k],
+ sce->ics.predictor_present && sce->ics.prediction_used[sfb]);
+ }
+ }
+ if (sce->ics.predictor_reset_group) {
+ reset_predictor_group(sce, sce->ics.predictor_reset_group);
+ }
+ } else {
+ reset_all_predictors(sce->predictor_state);
+ }
+}
+
+/* If inc = 0 you can check if this returns 0 to see if you can reset freely */
+static inline int update_counters(IndividualChannelStream *ics, int inc)
+{
+ int i;
+ for (i = 1; i < 31; i++) {
+ ics->predictor_reset_count[i] += inc;
+ if (ics->predictor_reset_count[i] > PRED_RESET_FRAME_MIN)
+ return i; /* Reset this immediately */
+ }
+ return 0;
+}
+
+void ff_aac_adjust_common_prediction(AACEncContext *s, ChannelElement *cpe)
+{
+ int start, w, w2, g, i, count = 0;
+ SingleChannelElement *sce0 = &cpe->ch[0];
+ SingleChannelElement *sce1 = &cpe->ch[1];
+ const int pmax0 = FFMIN(sce0->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
+ const int pmax1 = FFMIN(sce1->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
+ const int pmax = FFMIN(pmax0, pmax1);
+
+ if (!cpe->common_window ||
+ sce0->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE ||
+ sce1->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE)
+ return;
+
+ for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
+ start = 0;
+ for (g = 0; g < sce0->ics.num_swb; g++) {
+ int sfb = w*16+g;
+ int sum = sce0->ics.prediction_used[sfb] + sce1->ics.prediction_used[sfb];
+ float ener0 = 0.0f, ener1 = 0.0f, ener01 = 0.0f;
+ struct AACISError ph_err1, ph_err2, *erf;
+ if (sfb < PRED_SFB_START || sfb > pmax || sum != 2) {
+ RESTORE_PRED(sce0, sfb);
+ RESTORE_PRED(sce1, sfb);
+ start += sce0->ics.swb_sizes[g];
+ continue;
+ }
+ for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
+ for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
+ float coef0 = sce0->pcoeffs[start+(w+w2)*128+i];
+ float coef1 = sce1->pcoeffs[start+(w+w2)*128+i];
+ ener0 += coef0*coef0;
+ ener1 += coef1*coef1;
+ ener01 += (coef0 + coef1)*(coef0 + coef1);
+ }
+ }
+ ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
+ ener0, ener1, ener01, 1, -1);
+ ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
+ ener0, ener1, ener01, 1, +1);
+ erf = ph_err1.error < ph_err2.error ? &ph_err1 : &ph_err2;
+ if (erf->pass) {
+ sce0->ics.prediction_used[sfb] = 1;
+ sce1->ics.prediction_used[sfb] = 1;
+ count++;
+ } else {
+ RESTORE_PRED(sce0, sfb);
+ RESTORE_PRED(sce1, sfb);
+ }
+ start += sce0->ics.swb_sizes[g];
+ }
+ }
+
+ sce1->ics.predictor_present = sce0->ics.predictor_present = !!count;
+}
+
+static void update_pred_resets(SingleChannelElement *sce)
+{
+ int i, max_group_id_c, max_frame = 0;
+ float avg_frame = 0.0f;
+ IndividualChannelStream *ics = &sce->ics;
+
+ /* Update the counters and immediately update any frame behind schedule */
+ if ((ics->predictor_reset_group = update_counters(&sce->ics, 1)))
+ return;
+
+ for (i = 1; i < 31; i++) {
+ /* Count-based */
+ if (ics->predictor_reset_count[i] > max_frame) {
+ max_group_id_c = i;
+ max_frame = ics->predictor_reset_count[i];
+ }
+ avg_frame = (ics->predictor_reset_count[i] + avg_frame)/2;
+ }
+
+ if (max_frame > PRED_RESET_MIN) {
+ ics->predictor_reset_group = max_group_id_c;
+ } else {
+ ics->predictor_reset_group = 0;
+ }
+}
+
+void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce)
+{
+ int sfb, i, count = 0, cost_coeffs = 0, cost_pred = 0;
+ const int pmax = FFMIN(sce->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
+ float *O34 = &s->scoefs[128*0], *P34 = &s->scoefs[128*1];
+ float *SENT = &s->scoefs[128*2], *S34 = &s->scoefs[128*3];
+ float *QERR = &s->scoefs[128*4];
+
+ if (sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
+ sce->ics.predictor_present = 0;
+ return;
+ }
+
+ if (!sce->ics.predictor_initialized) {
+ reset_all_predictors(sce->predictor_state);
+ sce->ics.predictor_initialized = 1;
+ memcpy(sce->prcoeffs, sce->coeffs, 1024*sizeof(float));
+ for (i = 1; i < 31; i++)
+ sce->ics.predictor_reset_count[i] = i;
+ }
+
+ update_pred_resets(sce);
+ memcpy(sce->band_alt, sce->band_type, sizeof(sce->band_type));
+
+ for (sfb = PRED_SFB_START; sfb < pmax; sfb++) {
+ int cost1, cost2, cb_p;
+ float dist1, dist2, dist_spec_err = 0.0f;
+ const int cb_n = sce->band_type[sfb];
+ const int start_coef = sce->ics.swb_offset[sfb];
+ const int num_coeffs = sce->ics.swb_offset[sfb + 1] - start_coef;
+ const FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[sfb];
+
+ if (start_coef + num_coeffs > MAX_PREDICTORS ||
+ (s->cur_channel && sce->band_type[sfb] >= INTENSITY_BT2) ||
+ sce->band_type[sfb] == NOISE_BT)
+ continue;
+
+ /* Normal coefficients */
+ abs_pow34_v(O34, &sce->coeffs[start_coef], num_coeffs);
+ dist1 = quantize_and_encode_band_cost(s, NULL, &sce->coeffs[start_coef], NULL,
+ O34, num_coeffs, sce->sf_idx[sfb],
+ cb_n, s->lambda / band->threshold, INFINITY, &cost1, 0);
+ cost_coeffs += cost1;
+
+ /* Encoded coefficients - needed for #bits, band type and quant. error */
+ for (i = 0; i < num_coeffs; i++)
+ SENT[i] = sce->coeffs[start_coef + i] - sce->prcoeffs[start_coef + i];
+ abs_pow34_v(S34, SENT, num_coeffs);
+ if (cb_n < RESERVED_BT)
+ cb_p = find_min_book(find_max_val(1, num_coeffs, S34), sce->sf_idx[sfb]);
+ else
+ cb_p = cb_n;
+ quantize_and_encode_band_cost(s, NULL, SENT, QERR, S34, num_coeffs,
+ sce->sf_idx[sfb], cb_p, s->lambda / band->threshold, INFINITY,
+ &cost2, 0);
+
+ /* Reconstructed coefficients - needed for distortion measurements */
+ for (i = 0; i < num_coeffs; i++)
+ sce->prcoeffs[start_coef + i] += QERR[i] != 0.0f ? (sce->prcoeffs[start_coef + i] - QERR[i]) : 0.0f;
+ abs_pow34_v(P34, &sce->prcoeffs[start_coef], num_coeffs);
+ if (cb_n < RESERVED_BT)
+ cb_p = find_min_book(find_max_val(1, num_coeffs, P34), sce->sf_idx[sfb]);
+ else
+ cb_p = cb_n;
+ dist2 = quantize_and_encode_band_cost(s, NULL, &sce->prcoeffs[start_coef], NULL,
+ P34, num_coeffs, sce->sf_idx[sfb],
+ cb_p, s->lambda / band->threshold, INFINITY, NULL, 0);
+ for (i = 0; i < num_coeffs; i++)
+ dist_spec_err += (O34[i] - P34[i])*(O34[i] - P34[i]);
+ dist_spec_err *= s->lambda / band->threshold;
+ dist2 += dist_spec_err;
+
+ if (dist2 <= dist1 && cb_p <= cb_n) {
+ cost_pred += cost2;
+ sce->ics.prediction_used[sfb] = 1;
+ sce->band_alt[sfb] = cb_n;
+ sce->band_type[sfb] = cb_p;
+ count++;
+ } else {
+ cost_pred += cost1;
+ sce->band_alt[sfb] = cb_p;
+ }
+ }
+
+ if (count && cost_coeffs < cost_pred) {
+ count = 0;
+ for (sfb = PRED_SFB_START; sfb < pmax; sfb++)
+ RESTORE_PRED(sce, sfb);
+ memset(&sce->ics.prediction_used, 0, sizeof(sce->ics.prediction_used));
+ }
+
+ sce->ics.predictor_present = !!count;
+}
+
+/**
+ * Encoder predictors data.
+ */
+void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
+{
+ int sfb;
+ IndividualChannelStream *ics = &sce->ics;
+ const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
+
+ if (!ics->predictor_present)
+ return;
+
+ put_bits(&s->pb, 1, !!ics->predictor_reset_group);
+ if (ics->predictor_reset_group)
+ put_bits(&s->pb, 5, ics->predictor_reset_group);
+ for (sfb = 0; sfb < pmax; sfb++)
+ put_bits(&s->pb, 1, ics->prediction_used[sfb]);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.h b/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.h
new file mode 100644
index 00000000000..999af869f5e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_pred.h
@@ -0,0 +1,47 @@
+/*
+ * AAC encoder main-type prediction
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder main prediction
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_PRED_H
+#define AVCODEC_AACENC_PRED_H
+
+#include "aacenc.h"
+
+/* Every predictor group needs to get reset at least once in this many frames */
+#define PRED_RESET_FRAME_MIN 240
+
+/* Any frame with less than this amount of frames since last reset is ok */
+#define PRED_RESET_MIN 64
+
+/* Raise to filter any low frequency artifacts due to prediction */
+#define PRED_SFB_START 10
+
+void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce);
+void ff_aac_adjust_common_prediction(AACEncContext *s, ChannelElement *cpe);
+void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce);
+void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce);
+
+#endif /* AVCODEC_AACENC_PRED_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_quantization.h b/chromium/third_party/ffmpeg/libavcodec/aacenc_quantization.h
new file mode 100644
index 00000000000..b514954e4dd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_quantization.h
@@ -0,0 +1,260 @@
+/*
+ * AAC encoder intensity stereo
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder quantizer
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_QUANTIZATION_H
+#define AVCODEC_AACENC_QUANTIZATION_H
+
+#include "aactab.h"
+#include "aacenc.h"
+#include "aacenctab.h"
+#include "aacenc_utils.h"
+
+/**
+ * Calculate rate distortion cost for quantizing with given codebook
+ *
+ * @return quantization distortion
+ */
+static av_always_inline float quantize_and_encode_band_cost_template(
+ struct AACEncContext *s,
+ PutBitContext *pb, const float *in, float *out,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits, int BT_ZERO, int BT_UNSIGNED,
+ int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO,
+ const float ROUNDING)
+{
+ const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
+ const float Q = ff_aac_pow2sf_tab [q_idx];
+ const float Q34 = ff_aac_pow34sf_tab[q_idx];
+ const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
+ const float CLIPPED_ESCAPE = 165140.0f*IQ;
+ int i, j;
+ float cost = 0;
+ const int dim = BT_PAIR ? 2 : 4;
+ int resbits = 0;
+ int off;
+
+ if (BT_ZERO || BT_NOISE || BT_STEREO) {
+ for (i = 0; i < size; i++)
+ cost += in[i]*in[i];
+ if (bits)
+ *bits = 0;
+ if (out) {
+ for (i = 0; i < size; i += dim)
+ for (j = 0; j < dim; j++)
+ out[i+j] = 0.0f;
+ }
+ return cost * lambda;
+ }
+ if (!scaled) {
+ abs_pow34_v(s->scoefs, in, size);
+ scaled = s->scoefs;
+ }
+ quantize_bands(s->qcoefs, in, scaled, size, Q34, !BT_UNSIGNED, aac_cb_maxval[cb], ROUNDING);
+ if (BT_UNSIGNED) {
+ off = 0;
+ } else {
+ off = aac_cb_maxval[cb];
+ }
+ for (i = 0; i < size; i += dim) {
+ const float *vec;
+ int *quants = s->qcoefs + i;
+ int curidx = 0;
+ int curbits;
+ float quantized, rd = 0.0f;
+ for (j = 0; j < dim; j++) {
+ curidx *= aac_cb_range[cb];
+ curidx += quants[j] + off;
+ }
+ curbits = ff_aac_spectral_bits[cb-1][curidx];
+ vec = &ff_aac_codebook_vectors[cb-1][curidx*dim];
+ if (BT_UNSIGNED) {
+ for (j = 0; j < dim; j++) {
+ float t = fabsf(in[i+j]);
+ float di;
+ if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow
+ if (t >= CLIPPED_ESCAPE) {
+ quantized = CLIPPED_ESCAPE;
+ curbits += 21;
+ } else {
+ int c = av_clip_uintp2(quant(t, Q, ROUNDING), 13);
+ quantized = c*cbrtf(c)*IQ;
+ curbits += av_log2(c)*2 - 4 + 1;
+ }
+ } else {
+ quantized = vec[j]*IQ;
+ }
+ di = t - quantized;
+ if (out)
+ out[i+j] = in[i+j] >= 0 ? quantized : -quantized;
+ if (vec[j] != 0.0f)
+ curbits++;
+ rd += di*di;
+ }
+ } else {
+ for (j = 0; j < dim; j++) {
+ quantized = vec[j]*IQ;
+ if (out)
+ out[i+j] = quantized;
+ rd += (in[i+j] - quantized)*(in[i+j] - quantized);
+ }
+ }
+ cost += rd * lambda + curbits;
+ resbits += curbits;
+ if (cost >= uplim)
+ return uplim;
+ if (pb) {
+ put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]);
+ if (BT_UNSIGNED)
+ for (j = 0; j < dim; j++)
+ if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f)
+ put_bits(pb, 1, in[i+j] < 0.0f);
+ if (BT_ESC) {
+ for (j = 0; j < 2; j++) {
+ if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
+ int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13);
+ int len = av_log2(coef);
+
+ put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
+ put_sbits(pb, len, coef);
+ }
+ }
+ }
+ }
+ }
+
+ if (bits)
+ *bits = resbits;
+ return cost;
+}
+
+static inline float quantize_and_encode_band_cost_NONE(struct AACEncContext *s, PutBitContext *pb,
+ const float *in, float *quant, const float *scaled,
+ int size, int scale_idx, int cb,
+ const float lambda, const float uplim,
+ int *bits) {
+ av_assert0(0);
+ return 0.0f;
+}
+
+#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, ROUNDING) \
+static float quantize_and_encode_band_cost_ ## NAME( \
+ struct AACEncContext *s, \
+ PutBitContext *pb, const float *in, float *quant, \
+ const float *scaled, int size, int scale_idx, \
+ int cb, const float lambda, const float uplim, \
+ int *bits) { \
+ return quantize_and_encode_band_cost_template( \
+ s, pb, in, quant, scaled, size, scale_idx, \
+ BT_ESC ? ESC_BT : cb, lambda, uplim, bits, \
+ BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, \
+ ROUNDING); \
+}
+
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO, 1, 0, 0, 0, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC, 0, 1, 1, 1, 0, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC_RTZ, 0, 1, 1, 1, 0, 0, ROUND_TO_ZERO)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NOISE, 0, 0, 0, 0, 1, 0, ROUND_STANDARD)
+QUANTIZE_AND_ENCODE_BAND_COST_FUNC(STEREO,0, 0, 0, 0, 0, 1, ROUND_STANDARD)
+
+static float (*const quantize_and_encode_band_cost_arr[])(
+ struct AACEncContext *s,
+ PutBitContext *pb, const float *in, float *quant,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits) = {
+ quantize_and_encode_band_cost_ZERO,
+ quantize_and_encode_band_cost_SQUAD,
+ quantize_and_encode_band_cost_SQUAD,
+ quantize_and_encode_band_cost_UQUAD,
+ quantize_and_encode_band_cost_UQUAD,
+ quantize_and_encode_band_cost_SPAIR,
+ quantize_and_encode_band_cost_SPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_ESC,
+ quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */
+ quantize_and_encode_band_cost_NOISE,
+ quantize_and_encode_band_cost_STEREO,
+ quantize_and_encode_band_cost_STEREO,
+};
+
+static float (*const quantize_and_encode_band_cost_rtz_arr[])(
+ struct AACEncContext *s,
+ PutBitContext *pb, const float *in, float *quant,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits) = {
+ quantize_and_encode_band_cost_ZERO,
+ quantize_and_encode_band_cost_SQUAD,
+ quantize_and_encode_band_cost_SQUAD,
+ quantize_and_encode_band_cost_UQUAD,
+ quantize_and_encode_band_cost_UQUAD,
+ quantize_and_encode_band_cost_SPAIR,
+ quantize_and_encode_band_cost_SPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_UPAIR,
+ quantize_and_encode_band_cost_ESC_RTZ,
+ quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */
+ quantize_and_encode_band_cost_NOISE,
+ quantize_and_encode_band_cost_STEREO,
+ quantize_and_encode_band_cost_STEREO,
+};
+
+#define quantize_and_encode_band_cost( \
+ s, pb, in, quant, scaled, size, scale_idx, cb, \
+ lambda, uplim, bits, rtz) \
+ ((rtz) ? quantize_and_encode_band_cost_rtz_arr : quantize_and_encode_band_cost_arr)[cb]( \
+ s, pb, in, quant, scaled, size, scale_idx, cb, \
+ lambda, uplim, bits)
+
+static inline float quantize_band_cost(struct AACEncContext *s, const float *in,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits, int rtz)
+{
+ return quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx,
+ cb, lambda, uplim, bits, rtz);
+}
+
+static inline void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,
+ const float *in, float *out, int size, int scale_idx,
+ int cb, const float lambda, int rtz)
+{
+ quantize_and_encode_band_cost(s, pb, in, out, NULL, size, scale_idx, cb, lambda,
+ INFINITY, NULL, rtz);
+}
+
+#endif /* AVCODEC_AACENC_QUANTIZATION_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.c b/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.c
new file mode 100644
index 00000000000..8e0a00fc789
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.c
@@ -0,0 +1,219 @@
+/*
+ * AAC encoder TNS
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder temporal noise shaping
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#include "aacenc.h"
+#include "aacenc_tns.h"
+#include "aactab.h"
+#include "aacenc_utils.h"
+#include "aacenc_quantization.h"
+
+/*
+ * Shifts the values as well if compression is possible.
+ */
+static inline int compress_coeffs(int *coef, int order, int c_bits)
+{
+ int i, res = 0;
+ const int low_idx = c_bits ? 4 : 2;
+ const int shift_val = c_bits ? 8 : 4;
+ const int high_idx = c_bits ? 11 : 5;
+ for (i = 0; i < order; i++)
+ if (coef[i] < low_idx && coef[i] > high_idx)
+ res++;
+ if (res == order)
+ for (i = 0; i < order; i++)
+ coef[i] -= (coef[i] > high_idx) ? shift_val : 0;
+ return res == order;
+}
+
+/**
+ * Encode TNS data.
+ * Coefficient compression saves a single bit per coefficient.
+ */
+void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce)
+{
+ int i, w, filt, coef_len, coef_compress = 0;
+ const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
+ TemporalNoiseShaping *tns = &sce->tns;
+ const int c_bits = is8 ? TNS_Q_BITS_SHORT == 4 : TNS_Q_BITS == 4;
+
+ if (!sce->tns.present)
+ return;
+
+ for (i = 0; i < sce->ics.num_windows; i++) {
+ put_bits(&s->pb, 2 - is8, sce->tns.n_filt[i]);
+ if (tns->n_filt[i]) {
+ put_bits(&s->pb, 1, c_bits);
+ for (filt = 0; filt < tns->n_filt[i]; filt++) {
+ put_bits(&s->pb, 6 - 2 * is8, tns->length[i][filt]);
+ put_bits(&s->pb, 5 - 2 * is8, tns->order[i][filt]);
+ if (tns->order[i][filt]) {
+ coef_compress = compress_coeffs(tns->coef_idx[i][filt],
+ tns->order[i][filt], c_bits);
+ put_bits(&s->pb, 1, !!tns->direction[i][filt]);
+ put_bits(&s->pb, 1, !!coef_compress);
+ coef_len = c_bits + 3 - coef_compress;
+ for (w = 0; w < tns->order[i][filt]; w++)
+ put_bits(&s->pb, coef_len, tns->coef_idx[i][filt][w]);
+ }
+ }
+ }
+ }
+}
+
+/* Apply TNS filter */
+void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
+{
+ TemporalNoiseShaping *tns = &sce->tns;
+ IndividualChannelStream *ics = &sce->ics;
+ int w, filt, m, i, top, order, bottom, start, end, size, inc;
+ const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
+ float lpc[TNS_MAX_ORDER];
+
+ for (w = 0; w < ics->num_windows; w++) {
+ bottom = ics->num_swb;
+ for (filt = 0; filt < tns->n_filt[w]; filt++) {
+ top = bottom;
+ bottom = FFMAX(0, top - tns->length[w][filt]);
+ order = tns->order[w][filt];
+ if (order == 0)
+ continue;
+
+ // tns_decode_coef
+ compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
+
+ start = ics->swb_offset[FFMIN(bottom, mmm)];
+ end = ics->swb_offset[FFMIN( top, mmm)];
+ if ((size = end - start) <= 0)
+ continue;
+ if (tns->direction[w][filt]) {
+ inc = -1;
+ start = end - 1;
+ } else {
+ inc = 1;
+ }
+ start += w * 128;
+
+ // ar filter
+ for (m = 0; m < size; m++, start += inc)
+ for (i = 1; i <= FFMIN(m, order); i++)
+ sce->coeffs[start] += lpc[i-1]*sce->pcoeffs[start - i*inc];
+ }
+ }
+}
+
+/*
+ * c_bits - 1 if 4 bit coefficients, 0 if 3 bit coefficients
+ */
+static inline void quantize_coefs(double *coef, int *idx, float *lpc, int order,
+ int c_bits)
+{
+ int i;
+ const float *quant_arr = tns_tmp2_map[c_bits];
+ for (i = 0; i < order; i++) {
+ idx[i] = quant_array_idx((float)coef[i], quant_arr, c_bits ? 16 : 8);
+ lpc[i] = quant_arr[idx[i]];
+ }
+}
+
+/*
+ * 3 bits per coefficient with 8 short windows
+ */
+void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
+{
+ TemporalNoiseShaping *tns = &sce->tns;
+ int w, w2, g, count = 0;
+ const int mmm = FFMIN(sce->ics.tns_max_bands, sce->ics.max_sfb);
+ const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
+ const int c_bits = is8 ? TNS_Q_BITS_SHORT == 4 : TNS_Q_BITS == 4;
+
+ int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm);
+ int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
+
+ for (w = 0; w < sce->ics.num_windows; w++) {
+ int use_tns;
+ int order = is8 ? 5 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER;
+ int coef_start = w*sce->ics.num_swb + sce->ics.swb_offset[sfb_start];
+ int coef_len = sce->ics.swb_offset[sfb_end] - sce->ics.swb_offset[sfb_start];
+ float e_ratio = 0.0f, threshold = 0.0f, spread = 0.0f, en[2] = {0.0, 0.0f};
+ double gain = 0.0f, coefs[MAX_LPC_ORDER] = {0};
+
+ for (g = 0; g < sce->ics.num_swb; g++) {
+ if (w*16+g < sfb_start || w*16+g > sfb_end)
+ continue;
+ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
+ FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
+ if ((w+w2)*16+g > sfb_start + ((sfb_end - sfb_start)/2))
+ en[1] += band->energy;
+ else
+ en[0] += band->energy;
+ threshold += band->threshold;
+ spread += band->spread;
+ }
+ }
+
+ if (coef_len <= 0 || (sfb_end - sfb_start) <= 0)
+ continue;
+
+ /* LPC */
+ gain = ff_lpc_calc_ref_coefs_f(&s->lpc, &sce->coeffs[coef_start],
+ coef_len, order, coefs);
+
+ if (!order || gain < TNS_GAIN_THRESHOLD_LOW || gain > TNS_GAIN_THRESHOLD_HIGH)
+ use_tns = 0;
+ else if ((en[0]+en[1]) < TNS_GAIN_THRESHOLD_LOW*threshold || spread < TNS_SPREAD_THRESHOLD)
+ use_tns = 0;
+ else
+ use_tns = 1;
+
+ if (use_tns) {
+ e_ratio = en[0]/en[1];
+ if (is8 || order < 2 || (e_ratio > TNS_E_RATIO_LOW && e_ratio < TNS_E_RATIO_HIGH)) {
+ tns->n_filt[w] = 1;
+ for (g = 0; g < tns->n_filt[w]; g++) {
+ tns->length[w][g] = sfb_end - sfb_start;
+ tns->direction[w][g] = en[0] < en[1];
+ tns->order[w][g] = order;
+ quantize_coefs(coefs, tns->coef_idx[w][g], tns->coef[w][g],
+ order, c_bits);
+ }
+ } else { /* 2 filters due to energy disbalance */
+ tns->n_filt[w] = 2;
+ for (g = 0; g < tns->n_filt[w]; g++) {
+ tns->direction[w][g] = en[g] < en[!g];
+ tns->order[w][g] = !g ? order/2 : order - tns->order[w][g-1];
+ tns->length[w][g] = !g ? (sfb_end - sfb_start)/2 : \
+ (sfb_end - sfb_start) - tns->length[w][g-1];
+ quantize_coefs(&coefs[!g ? 0 : order - tns->order[w][g-1]],
+ tns->coef_idx[w][g], tns->coef[w][g],
+ tns->order[w][g], c_bits);
+ }
+ }
+ count++;
+ }
+ }
+ sce->tns.present = !!count;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.h b/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.h
new file mode 100644
index 00000000000..a7c119f3688
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_tns.h
@@ -0,0 +1,55 @@
+/*
+ * AAC encoder TNS
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder temporal noise shaping
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_TNS_H
+#define AVCODEC_AACENC_TNS_H
+
+#include "aacenc.h"
+
+/* Could be set to 3 to save an additional bit at the cost of little quality */
+#define TNS_Q_BITS 4
+
+/* Coefficient resolution in short windows */
+#define TNS_Q_BITS_SHORT 3
+
+/* TNS will only be used if the LPC gain is within these margins */
+#define TNS_GAIN_THRESHOLD_LOW 1.437f
+#define TNS_GAIN_THRESHOLD_HIGH 21.19f
+
+/* If the energy ratio between the low SFBs vs the high SFBs is not between
+ * those two values, use 2 filters instead */
+#define TNS_E_RATIO_LOW 0.77
+#define TNS_E_RATIO_HIGH 1.23
+
+/* Do not use TNS if the psy band spread is below this value */
+#define TNS_SPREAD_THRESHOLD 0.5f
+
+void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce);
+void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce);
+void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce);
+
+#endif /* AVCODEC_AACENC_TNS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_utils.h b/chromium/third_party/ffmpeg/libavcodec/aacenc_utils.h
new file mode 100644
index 00000000000..0ab15a3e5e8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_utils.h
@@ -0,0 +1,152 @@
+/*
+ * AAC encoder utilities
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * 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
+ * AAC encoder utilities
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_UTILS_H
+#define AVCODEC_AACENC_UTILS_H
+
+#include "aac.h"
+#include "aac_tablegen_decl.h"
+#include "aacenctab.h"
+
+#define ROUND_STANDARD 0.4054f
+#define ROUND_TO_ZERO 0.1054f
+#define C_QUANT 0.4054f
+
+static inline void abs_pow34_v(float *out, const float *in, const int size)
+{
+ int i;
+ for (i = 0; i < size; i++) {
+ float a = fabsf(in[i]);
+ out[i] = sqrtf(a * sqrtf(a));
+ }
+}
+
+/**
+ * Quantize one coefficient.
+ * @return absolute value of the quantized coefficient
+ * @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
+ */
+static inline int quant(float coef, const float Q, const float rounding)
+{
+ float a = coef * Q;
+ return sqrtf(a * sqrtf(a)) + rounding;
+}
+
+static inline void quantize_bands(int *out, const float *in, const float *scaled,
+ int size, float Q34, int is_signed, int maxval,
+ const float rounding)
+{
+ int i;
+ double qc;
+ for (i = 0; i < size; i++) {
+ qc = scaled[i] * Q34;
+ out[i] = (int)FFMIN(qc + rounding, (double)maxval);
+ if (is_signed && in[i] < 0.0f) {
+ out[i] = -out[i];
+ }
+ }
+}
+
+static inline float find_max_val(int group_len, int swb_size, const float *scaled)
+{
+ float maxval = 0.0f;
+ int w2, i;
+ for (w2 = 0; w2 < group_len; w2++) {
+ for (i = 0; i < swb_size; i++) {
+ maxval = FFMAX(maxval, scaled[w2*128+i]);
+ }
+ }
+ return maxval;
+}
+
+static inline int find_min_book(float maxval, int sf)
+{
+ float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
+ float Q34 = sqrtf(Q * sqrtf(Q));
+ int qmaxval, cb;
+ qmaxval = maxval * Q34 + C_QUANT;
+ if (qmaxval == 0) cb = 0;
+ else if (qmaxval == 1) cb = 1;
+ else if (qmaxval == 2) cb = 3;
+ else if (qmaxval <= 4) cb = 5;
+ else if (qmaxval <= 7) cb = 7;
+ else if (qmaxval <= 12) cb = 9;
+ else cb = 11;
+ return cb;
+}
+
+/** Return the minimum scalefactor where the quantized coef does not clip. */
+static inline uint8_t coef2minsf(float coef)
+{
+ return av_clip_uint8(log2f(coef)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512);
+}
+
+/** Return the maximum scalefactor where the quantized coef is not zero. */
+static inline uint8_t coef2maxsf(float coef)
+{
+ return av_clip_uint8(log2f(coef)*4 + 6 + SCALE_ONE_POS - SCALE_DIV_512);
+}
+
+/*
+ * Returns the closest possible index to an array of float values, given a value.
+ */
+static inline int quant_array_idx(const float val, const float *arr, const int num)
+{
+ int i, index = 0;
+ float quant_min_err = INFINITY;
+ for (i = 0; i < num; i++) {
+ float error = (val - arr[i])*(val - arr[i]);
+ if (error < quant_min_err) {
+ quant_min_err = error;
+ index = i;
+ }
+ }
+ return index;
+}
+
+/*
+ * linear congruential pseudorandom number generator, copied from the decoder
+ */
+static inline int lcg_random(unsigned previous_val)
+{
+ union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
+ return v.s;
+}
+
+#define ERROR_IF(cond, ...) \
+ if (cond) { \
+ av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
+ return AVERROR(EINVAL); \
+ }
+
+#define WARN_IF(cond, ...) \
+ if (cond) { \
+ av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \
+ }
+
+
+#endif /* AVCODEC_AACENC_UTILS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenctab.c b/chromium/third_party/ffmpeg/libavcodec/aacenctab.c
new file mode 100644
index 00000000000..f3d70fbe31c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenctab.c
@@ -0,0 +1,108 @@
+/*
+ * AAC encoder data
+ * Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com )
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "aacenctab.h"
+
+static const uint8_t swb_size_128_96[] = {
+ 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
+};
+
+static const uint8_t swb_size_128_64[] = {
+ 4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
+};
+
+static const uint8_t swb_size_128_48[] = {
+ 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16
+};
+
+static const uint8_t swb_size_128_24[] = {
+ 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20
+};
+
+static const uint8_t swb_size_128_16[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
+};
+
+static const uint8_t swb_size_128_8[] = {
+ 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
+};
+
+static const uint8_t swb_size_1024_96[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
+ 12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
+};
+
+static const uint8_t swb_size_1024_64[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8,
+ 12, 12, 12, 16, 16, 16, 20, 24, 24, 28, 36,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
+};
+
+static const uint8_t swb_size_1024_48[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
+ 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 96
+};
+
+static const uint8_t swb_size_1024_32[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
+ 12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
+};
+
+static const uint8_t swb_size_1024_24[] = {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28,
+ 32, 36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
+};
+
+static const uint8_t swb_size_1024_16[] = {
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24, 24, 28, 28,
+ 32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64, 64
+};
+
+static const uint8_t swb_size_1024_8[] = {
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 28,
+ 32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
+};
+
+const uint8_t *ff_aac_swb_size_128[] = {
+ swb_size_128_96, swb_size_128_96, swb_size_128_64,
+ swb_size_128_48, swb_size_128_48, swb_size_128_48,
+ swb_size_128_24, swb_size_128_24, swb_size_128_16,
+ swb_size_128_16, swb_size_128_16, swb_size_128_8,
+ swb_size_128_8
+};
+
+const uint8_t *ff_aac_swb_size_1024[] = {
+ swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
+ swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
+ swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
+ swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
+ swb_size_1024_8
+};
+
+const int ff_aac_swb_size_128_len = FF_ARRAY_ELEMS(ff_aac_swb_size_128);
+const int ff_aac_swb_size_1024_len = FF_ARRAY_ELEMS(ff_aac_swb_size_1024);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenctab.h b/chromium/third_party/ffmpeg/libavcodec/aacenctab.h
new file mode 100644
index 00000000000..9e7595a755d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenctab.h
@@ -0,0 +1,113 @@
+/*
+ * AAC encoder data
+ * Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com )
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * AAC encoder data
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENCTAB_H
+#define AVCODEC_AACENCTAB_H
+
+#include "aac.h"
+
+/** Total number of usable codebooks **/
+#define CB_TOT 12
+
+/** Total number of codebooks, including special ones **/
+#define CB_TOT_ALL 15
+
+#define AAC_MAX_CHANNELS 6
+
+extern const uint8_t *ff_aac_swb_size_1024[];
+extern const int ff_aac_swb_size_1024_len;
+extern const uint8_t *ff_aac_swb_size_128[];
+extern const int ff_aac_swb_size_128_len;
+
+/** default channel configurations */
+static const uint8_t aac_chan_configs[6][5] = {
+ {1, TYPE_SCE}, // 1 channel - single channel element
+ {1, TYPE_CPE}, // 2 channels - channel pair
+ {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
+ {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
+ {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
+ {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
+};
+
+/**
+ * Table to remap channels from libavcodec's default order to AAC order.
+ */
+static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
+ { 0 },
+ { 0, 1 },
+ { 2, 0, 1 },
+ { 2, 0, 1, 3 },
+ { 2, 0, 1, 3, 4 },
+ { 2, 0, 1, 4, 5, 3 },
+};
+
+/* duplicated from avpriv_mpeg4audio_sample_rates to avoid shared build
+ * failures */
+static const int mpeg4audio_sample_rates[16] = {
+ 96000, 88200, 64000, 48000, 44100, 32000,
+ 24000, 22050, 16000, 12000, 11025, 8000, 7350
+};
+
+/** bits needed to code codebook run value for long windows */
+static const uint8_t run_value_bits_long[64] = {
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
+};
+
+/** bits needed to code codebook run value for short windows */
+static const uint8_t run_value_bits_short[16] = {
+ 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
+};
+
+/* TNS starting SFBs for long and short windows */
+static const uint8_t tns_min_sfb_short[16] = {
+ 2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12, 12, 12, 12, 12
+};
+
+static const uint8_t tns_min_sfb_long[16] = {
+ 12, 13, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31, 31, 31, 31, 31
+};
+
+static const uint8_t * const tns_min_sfb[2] = {
+ tns_min_sfb_long, tns_min_sfb_short
+};
+
+static const uint8_t * const run_value_bits[2] = {
+ run_value_bits_long, run_value_bits_short
+};
+
+/** Map to convert values from BandCodingPath index to a codebook index **/
+static const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15};
+/** Inverse map to convert from codebooks to BandCodingPath indices **/
+static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14};
+
+static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
+static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
+
+#endif /* AVCODEC_AACENCTAB_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps.c b/chromium/third_party/ffmpeg/libavcodec/aacps.c
index ea5a5d23317..1165d9be3f3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps.c
@@ -17,16 +17,23 @@
* 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
+ *
+ * Note: Rounding-to-nearest used unless otherwise stated
+ *
*/
#include <stdint.h>
#include "libavutil/common.h"
-#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "get_bits.h"
#include "aacps.h"
+#if USE_FIXED
+#include "aacps_fixed_tablegen.h"
+#else
+#include "libavutil/internal.h"
#include "aacps_tablegen.h"
+#endif /* USE_FIXED */
#include "aacpsdata.c"
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
@@ -148,7 +155,7 @@ static void ipdopd_reset(int8_t *ipd_hist, int8_t *opd_hist)
}
}
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left)
+int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left)
{
int e;
int bit_count_start = get_bits_count(gb_host);
@@ -302,35 +309,41 @@ err:
/** Split one subband into 2 subsubbands with a symmetric real filter.
* The filter must have its non-center even coefficients equal to zero. */
-static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[8], int len, int reverse)
+static void hybrid2_re(INTFLOAT (*in)[2], INTFLOAT (*out)[32][2], const INTFLOAT filter[8], int len, int reverse)
{
int i, j;
for (i = 0; i < len; i++, in++) {
- float re_in = filter[6] * in[6][0]; //real inphase
- float re_op = 0.0f; //real out of phase
- float im_in = filter[6] * in[6][1]; //imag inphase
- float im_op = 0.0f; //imag out of phase
+ INT64FLOAT re_in = AAC_MUL31(filter[6], in[6][0]); //real inphase
+ INT64FLOAT re_op = 0.0f; //real out of phase
+ INT64FLOAT im_in = AAC_MUL31(filter[6], in[6][1]); //imag inphase
+ INT64FLOAT im_op = 0.0f; //imag out of phase
for (j = 0; j < 6; j += 2) {
- re_op += filter[j+1] * (in[j+1][0] + in[12-j-1][0]);
- im_op += filter[j+1] * (in[j+1][1] + in[12-j-1][1]);
+ re_op += (INT64FLOAT)filter[j+1] * (in[j+1][0] + in[12-j-1][0]);
+ im_op += (INT64FLOAT)filter[j+1] * (in[j+1][1] + in[12-j-1][1]);
}
- out[ reverse][i][0] = re_in + re_op;
- out[ reverse][i][1] = im_in + im_op;
- out[!reverse][i][0] = re_in - re_op;
- out[!reverse][i][1] = im_in - im_op;
+
+#if USE_FIXED
+ re_op = (re_op + 0x40000000) >> 31;
+ im_op = (im_op + 0x40000000) >> 31;
+#endif /* USE_FIXED */
+
+ out[ reverse][i][0] = (INTFLOAT)(re_in + re_op);
+ out[ reverse][i][1] = (INTFLOAT)(im_in + im_op);
+ out[!reverse][i][0] = (INTFLOAT)(re_in - re_op);
+ out[!reverse][i][1] = (INTFLOAT)(im_in - im_op);
}
}
/** Split one subband into 6 subsubbands with a complex filter */
-static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2],
- TABLE_CONST float (*filter)[8][2], int len)
+static void hybrid6_cx(PSDSPContext *dsp, INTFLOAT (*in)[2], INTFLOAT (*out)[32][2],
+ TABLE_CONST INTFLOAT (*filter)[8][2], int len)
{
int i;
int N = 8;
- LOCAL_ALIGNED_16(float, temp, [8], [2]);
+ LOCAL_ALIGNED_16(INTFLOAT, temp, [8], [2]);
for (i = 0; i < len; i++, in++) {
- dsp->hybrid_analysis(temp, in, (const float (*)[8][2]) filter, 1, N);
+ dsp->hybrid_analysis(temp, in, (const INTFLOAT (*)[8][2]) filter, 1, N);
out[0][i][0] = temp[6][0];
out[0][i][1] = temp[6][1];
out[1][i][0] = temp[7][0];
@@ -347,18 +360,18 @@ static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2],
}
static void hybrid4_8_12_cx(PSDSPContext *dsp,
- float (*in)[2], float (*out)[32][2],
- TABLE_CONST float (*filter)[8][2], int N, int len)
+ INTFLOAT (*in)[2], INTFLOAT (*out)[32][2],
+ TABLE_CONST INTFLOAT (*filter)[8][2], int N, int len)
{
int i;
for (i = 0; i < len; i++, in++) {
- dsp->hybrid_analysis(out[0] + i, in, (const float (*)[8][2]) filter, 32, N);
+ dsp->hybrid_analysis(out[0] + i, in, (const INTFLOAT (*)[8][2]) filter, 32, N);
}
}
-static void hybrid_analysis(PSDSPContext *dsp, float out[91][32][2],
- float in[5][44][2], float L[2][38][64],
+static void hybrid_analysis(PSDSPContext *dsp, INTFLOAT out[91][32][2],
+ INTFLOAT in[5][44][2], INTFLOAT L[2][38][64],
int is34, int len)
{
int i, j;
@@ -387,8 +400,8 @@ static void hybrid_analysis(PSDSPContext *dsp, float out[91][32][2],
}
}
-static void hybrid_synthesis(PSDSPContext *dsp, float out[2][38][64],
- float in[91][32][2], int is34, int len)
+static void hybrid_synthesis(PSDSPContext *dsp, INTFLOAT out[2][38][64],
+ INTFLOAT in[91][32][2], int is34, int len)
{
int i, n;
if (is34) {
@@ -429,7 +442,7 @@ static void hybrid_synthesis(PSDSPContext *dsp, float out[2][38][64],
}
/// All-pass filter decay slope
-#define DECAY_SLOPE 0.05f
+#define DECAY_SLOPE Q30(0.05f)
/// Number of frequency bands that can be addressed by the parameter index, b(k)
static const int NR_PAR_BANDS[] = { 20, 34 };
static const int NR_IPDOPD_BANDS[] = { 11, 17 };
@@ -483,28 +496,43 @@ static void map_idx_34_to_20(int8_t *par_mapped, const int8_t *par, int full)
}
}
-static void map_val_34_to_20(float par[PS_MAX_NR_IIDICC])
+static void map_val_34_to_20(INTFLOAT par[PS_MAX_NR_IIDICC])
{
+#if USE_FIXED
+ par[ 0] = (int)(((int64_t)(par[ 0] + (par[ 1]>>1)) * 1431655765 + \
+ 0x40000000) >> 31);
+ par[ 1] = (int)(((int64_t)((par[ 1]>>1) + par[ 2]) * 1431655765 + \
+ 0x40000000) >> 31);
+ par[ 2] = (int)(((int64_t)(par[ 3] + (par[ 4]>>1)) * 1431655765 + \
+ 0x40000000) >> 31);
+ par[ 3] = (int)(((int64_t)((par[ 4]>>1) + par[ 5]) * 1431655765 + \
+ 0x40000000) >> 31);
+#else
par[ 0] = (2*par[ 0] + par[ 1]) * 0.33333333f;
par[ 1] = ( par[ 1] + 2*par[ 2]) * 0.33333333f;
par[ 2] = (2*par[ 3] + par[ 4]) * 0.33333333f;
par[ 3] = ( par[ 4] + 2*par[ 5]) * 0.33333333f;
- par[ 4] = ( par[ 6] + par[ 7]) * 0.5f;
- par[ 5] = ( par[ 8] + par[ 9]) * 0.5f;
+#endif /* USE_FIXED */
+ par[ 4] = AAC_HALF_SUM(par[ 6], par[ 7]);
+ par[ 5] = AAC_HALF_SUM(par[ 8], par[ 9]);
par[ 6] = par[10];
par[ 7] = par[11];
- par[ 8] = ( par[12] + par[13]) * 0.5f;
- par[ 9] = ( par[14] + par[15]) * 0.5f;
+ par[ 8] = AAC_HALF_SUM(par[12], par[13]);
+ par[ 9] = AAC_HALF_SUM(par[14], par[15]);
par[10] = par[16];
par[11] = par[17];
par[12] = par[18];
par[13] = par[19];
- par[14] = ( par[20] + par[21]) * 0.5f;
- par[15] = ( par[22] + par[23]) * 0.5f;
- par[16] = ( par[24] + par[25]) * 0.5f;
- par[17] = ( par[26] + par[27]) * 0.5f;
+ par[14] = AAC_HALF_SUM(par[20], par[21]);
+ par[15] = AAC_HALF_SUM(par[22], par[23]);
+ par[16] = AAC_HALF_SUM(par[24], par[25]);
+ par[17] = AAC_HALF_SUM(par[26], par[27]);
+#if USE_FIXED
+ par[18] = (((par[28]+2)>>2) + ((par[29]+2)>>2) + ((par[30]+2)>>2) + ((par[31]+2)>>2));
+#else
par[18] = ( par[28] + par[29] + par[30] + par[31]) * 0.25f;
- par[19] = ( par[32] + par[33]) * 0.5f;
+#endif /* USE_FIXED */
+ par[19] = AAC_HALF_SUM(par[32], par[33]);
}
static void map_idx_10_to_34(int8_t *par_mapped, const int8_t *par, int full)
@@ -589,7 +617,7 @@ static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
par_mapped[ 0] = par[ 0];
}
-static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC])
+static void map_val_20_to_34(INTFLOAT par[PS_MAX_NR_IIDICC])
{
par[33] = par[19];
par[32] = par[19];
@@ -620,27 +648,29 @@ static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC])
par[ 7] = par[ 4];
par[ 6] = par[ 4];
par[ 5] = par[ 3];
- par[ 4] = (par[ 2] + par[ 3]) * 0.5f;
+ par[ 4] = AAC_HALF_SUM(par[ 2], par[ 3]);
par[ 3] = par[ 2];
par[ 2] = par[ 1];
- par[ 1] = (par[ 0] + par[ 1]) * 0.5f;
+ par[ 1] = AAC_HALF_SUM(par[ 0], par[ 1]);
}
-static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34)
+static void decorrelation(PSContext *ps, INTFLOAT (*out)[32][2], const INTFLOAT (*s)[32][2], int is34)
{
- LOCAL_ALIGNED_16(float, power, [34], [PS_QMF_TIME_SLOTS]);
- LOCAL_ALIGNED_16(float, transient_gain, [34], [PS_QMF_TIME_SLOTS]);
- float *peak_decay_nrg = ps->peak_decay_nrg;
- float *power_smooth = ps->power_smooth;
- float *peak_decay_diff_smooth = ps->peak_decay_diff_smooth;
- float (*delay)[PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2] = ps->delay;
- float (*ap_delay)[PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2] = ps->ap_delay;
- const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
- const float peak_decay_factor = 0.76592833836465f;
+ LOCAL_ALIGNED_16(INTFLOAT, power, [34], [PS_QMF_TIME_SLOTS]);
+ LOCAL_ALIGNED_16(INTFLOAT, transient_gain, [34], [PS_QMF_TIME_SLOTS]);
+ INTFLOAT *peak_decay_nrg = ps->peak_decay_nrg;
+ INTFLOAT *power_smooth = ps->power_smooth;
+ INTFLOAT *peak_decay_diff_smooth = ps->peak_decay_diff_smooth;
+ INTFLOAT (*delay)[PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2] = ps->delay;
+ INTFLOAT (*ap_delay)[PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2] = ps->ap_delay;
+#if !USE_FIXED
const float transient_impact = 1.5f;
const float a_smooth = 0.25f; ///< Smoothing coefficient
+#endif /* USE_FIXED */
+ const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
int i, k, m, n;
int n0 = 0, nL = 32;
+ const INTFLOAT peak_decay_factor = Q31(0.76592833836465f);
memset(power, 0, 34 * sizeof(*power));
@@ -658,6 +688,33 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
}
//Transient detection
+#if USE_FIXED
+ for (i = 0; i < NR_PAR_BANDS[is34]; i++) {
+ for (n = n0; n < nL; n++) {
+ int decayed_peak;
+ int denom;
+
+ decayed_peak = (int)(((int64_t)peak_decay_factor * \
+ peak_decay_nrg[i] + 0x40000000) >> 31);
+ peak_decay_nrg[i] = FFMAX(decayed_peak, power[i][n]);
+ power_smooth[i] += (power[i][n] - power_smooth[i] + 2) >> 2;
+ peak_decay_diff_smooth[i] += (peak_decay_nrg[i] - power[i][n] - \
+ peak_decay_diff_smooth[i] + 2) >> 2;
+ denom = peak_decay_diff_smooth[i] + (peak_decay_diff_smooth[i] >> 1);
+ if (denom > power_smooth[i]) {
+ int p = power_smooth[i];
+ while (denom < 0x40000000) {
+ denom <<= 1;
+ p <<= 1;
+ }
+ transient_gain[i][n] = p / (denom >> 16);
+ }
+ else {
+ transient_gain[i][n] = 1 << 16;
+ }
+ }
+ }
+#else
for (i = 0; i < NR_PAR_BANDS[is34]; i++) {
for (n = n0; n < nL; n++) {
float decayed_peak = peak_decay_factor * peak_decay_nrg[i];
@@ -671,6 +728,7 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
}
}
+#endif /* USE_FIXED */
//Decorrelation and transient reduction
// PS_AP_LINKS - 1
// -----
@@ -681,8 +739,22 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
//d[k][z] (out) = transient_gain_mapped[k][z] * H[k][z] * s[k][z]
for (k = 0; k < NR_ALLPASS_BANDS[is34]; k++) {
int b = k_to_i[k];
+#if USE_FIXED
+ int g_decay_slope;
+
+ if (k - DECAY_CUTOFF[is34] <= 0) {
+ g_decay_slope = 1 << 30;
+ }
+ else if (k - DECAY_CUTOFF[is34] >= 20) {
+ g_decay_slope = 0;
+ }
+ else {
+ g_decay_slope = (1 << 30) - DECAY_SLOPE * (k - DECAY_CUTOFF[is34]);
+ }
+#else
float g_decay_slope = 1.f - DECAY_SLOPE * (k - DECAY_CUTOFF[is34]);
g_decay_slope = av_clipf(g_decay_slope, 0.f, 1.f);
+#endif /* USE_FIXED */
memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
for (m = 0; m < PS_AP_LINKS; m++) {
@@ -690,7 +762,7 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
}
ps->dsp.decorrelate(out[k], delay[k] + PS_MAX_DELAY - 2, ap_delay[k],
phi_fract[is34][k],
- (const float (*)[2]) Q_fract_allpass[is34][k],
+ (const INTFLOAT (*)[2]) Q_fract_allpass[is34][k],
transient_gain[b], g_decay_slope, nL - n0);
}
for (; k < SHORT_DELAY_BAND[is34]; k++) {
@@ -749,14 +821,14 @@ static void remap20(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
}
}
-static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)
+static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)[32][2], int is34)
{
int e, b, k;
- float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
- float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
- float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
- float (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22;
+ INTFLOAT (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
+ INTFLOAT (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
+ INTFLOAT (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
+ INTFLOAT (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22;
int8_t *opd_hist = ps->opd_hist;
int8_t *ipd_hist = ps->ipd_hist;
int8_t iid_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
@@ -768,7 +840,7 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf;
int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf;
const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
- TABLE_CONST float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
+ TABLE_CONST INTFLOAT (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
//Remapping
if (ps->num_env_old) {
@@ -823,7 +895,7 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
//Mixing
for (e = 0; e < ps->num_env; e++) {
for (b = 0; b < NR_PAR_BANDS[is34]; b++) {
- float h11, h12, h21, h22;
+ INTFLOAT h11, h12, h21, h22;
h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0];
h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];
h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
@@ -832,27 +904,27 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
if (!PS_BASELINE && ps->enable_ipdopd && b < NR_IPDOPD_BANDS[is34]) {
//The spec say says to only run this smoother when enable_ipdopd
//is set but the reference decoder appears to run it constantly
- float h11i, h12i, h21i, h22i;
- float ipd_adj_re, ipd_adj_im;
+ INTFLOAT h11i, h12i, h21i, h22i;
+ INTFLOAT ipd_adj_re, ipd_adj_im;
int opd_idx = opd_hist[b] * 8 + opd_mapped[e][b];
int ipd_idx = ipd_hist[b] * 8 + ipd_mapped[e][b];
- float opd_re = pd_re_smooth[opd_idx];
- float opd_im = pd_im_smooth[opd_idx];
- float ipd_re = pd_re_smooth[ipd_idx];
- float ipd_im = pd_im_smooth[ipd_idx];
+ INTFLOAT opd_re = pd_re_smooth[opd_idx];
+ INTFLOAT opd_im = pd_im_smooth[opd_idx];
+ INTFLOAT ipd_re = pd_re_smooth[ipd_idx];
+ INTFLOAT ipd_im = pd_im_smooth[ipd_idx];
opd_hist[b] = opd_idx & 0x3F;
ipd_hist[b] = ipd_idx & 0x3F;
- ipd_adj_re = opd_re*ipd_re + opd_im*ipd_im;
- ipd_adj_im = opd_im*ipd_re - opd_re*ipd_im;
- h11i = h11 * opd_im;
- h11 = h11 * opd_re;
- h12i = h12 * ipd_adj_im;
- h12 = h12 * ipd_adj_re;
- h21i = h21 * opd_im;
- h21 = h21 * opd_re;
- h22i = h22 * ipd_adj_im;
- h22 = h22 * ipd_adj_re;
+ ipd_adj_re = AAC_MADD30(opd_re, ipd_re, opd_im, ipd_im);
+ ipd_adj_im = AAC_MSUB30(opd_im, ipd_re, opd_re, ipd_im);
+ h11i = AAC_MUL30(h11, opd_im);
+ h11 = AAC_MUL30(h11, opd_re);
+ h12i = AAC_MUL30(h12, ipd_adj_im);
+ h12 = AAC_MUL30(h12, ipd_adj_re);
+ h21i = AAC_MUL30(h21, opd_im);
+ h21 = AAC_MUL30(h21, opd_re);
+ h22i = AAC_MUL30(h22, ipd_adj_im);
+ h22 = AAC_MUL30(h22, ipd_adj_re);
H11[1][e+1][b] = h11i;
H12[1][e+1][b] = h12i;
H21[1][e+1][b] = h21i;
@@ -864,11 +936,14 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
H22[0][e+1][b] = h22;
}
for (k = 0; k < NR_BANDS[is34]; k++) {
- float h[2][4];
- float h_step[2][4];
+ LOCAL_ALIGNED_16(INTFLOAT, h, [2], [4]);
+ LOCAL_ALIGNED_16(INTFLOAT, h_step, [2], [4]);
int start = ps->border_position[e];
int stop = ps->border_position[e+1];
- float width = 1.f / (stop - start);
+ INTFLOAT width = Q30(1.f) / (stop - start);
+#if USE_FIXED
+ width <<= 1;
+#endif
b = k_to_i[k];
h[0][0] = H11[0][e][b];
h[0][1] = H12[0][e][b];
@@ -889,15 +964,15 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
}
}
//Interpolation
- h_step[0][0] = (H11[0][e+1][b] - h[0][0]) * width;
- h_step[0][1] = (H12[0][e+1][b] - h[0][1]) * width;
- h_step[0][2] = (H21[0][e+1][b] - h[0][2]) * width;
- h_step[0][3] = (H22[0][e+1][b] - h[0][3]) * width;
+ h_step[0][0] = AAC_MSUB31_V3(H11[0][e+1][b], h[0][0], width);
+ h_step[0][1] = AAC_MSUB31_V3(H12[0][e+1][b], h[0][1], width);
+ h_step[0][2] = AAC_MSUB31_V3(H21[0][e+1][b], h[0][2], width);
+ h_step[0][3] = AAC_MSUB31_V3(H22[0][e+1][b], h[0][3], width);
if (!PS_BASELINE && ps->enable_ipdopd) {
- h_step[1][0] = (H11[1][e+1][b] - h[1][0]) * width;
- h_step[1][1] = (H12[1][e+1][b] - h[1][1]) * width;
- h_step[1][2] = (H21[1][e+1][b] - h[1][2]) * width;
- h_step[1][3] = (H22[1][e+1][b] - h[1][3]) * width;
+ h_step[1][0] = AAC_MSUB31_V3(H11[1][e+1][b], h[1][0], width);
+ h_step[1][1] = AAC_MSUB31_V3(H12[1][e+1][b], h[1][1], width);
+ h_step[1][2] = AAC_MSUB31_V3(H21[1][e+1][b], h[1][2], width);
+ h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width);
}
ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
l[k] + start + 1, r[k] + start + 1,
@@ -906,10 +981,10 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
}
}
-int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
+int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top)
{
- float (*Lbuf)[32][2] = ps->Lbuf;
- float (*Rbuf)[32][2] = ps->Rbuf;
+ INTFLOAT (*Lbuf)[32][2] = ps->Lbuf;
+ INTFLOAT (*Rbuf)[32][2] = ps->Rbuf;
const int len = 32;
int is34 = ps->is34bands;
@@ -919,7 +994,7 @@ int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float
memset(ps->ap_delay + top, 0, (NR_ALLPASS_BANDS[is34] - top)*sizeof(ps->ap_delay[0]));
hybrid_analysis(&ps->dsp, Lbuf, ps->in_buf, L, is34, len);
- decorrelation(ps, Rbuf, (const float (*)[32][2]) Lbuf, is34);
+ decorrelation(ps, Rbuf, (const INTFLOAT (*)[32][2]) Lbuf, is34);
stereo_processing(ps, Lbuf, Rbuf, is34);
hybrid_synthesis(&ps->dsp, L, Lbuf, is34, len);
hybrid_synthesis(&ps->dsp, R, Rbuf, is34, len);
@@ -936,7 +1011,7 @@ int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float
#define PS_VLC_ROW(name) \
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
-av_cold void ff_ps_init(void) {
+av_cold void AAC_RENAME(ff_ps_init)(void) {
// Syntax initialization
static const struct {
const void *ps_codes, *ps_bits;
@@ -968,7 +1043,7 @@ av_cold void ff_ps_init(void) {
ps_tableinit();
}
-av_cold void ff_ps_ctx_init(PSContext *ps)
+av_cold void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps)
{
- ff_psdsp_init(&ps->dsp);
+ AAC_RENAME(ff_psdsp_init)(&ps->dsp);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps.h b/chromium/third_party/ffmpeg/libavcodec/aacps.h
index 174770d6e4e..54f9d99177c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacps.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps.h
@@ -61,26 +61,26 @@ typedef struct PSContext {
int is34bands;
int is34bands_old;
- DECLARE_ALIGNED(16, float, in_buf)[5][44][2];
- DECLARE_ALIGNED(16, float, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
- DECLARE_ALIGNED(16, float, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
- DECLARE_ALIGNED(16, float, peak_decay_nrg)[34];
- DECLARE_ALIGNED(16, float, power_smooth)[34];
- DECLARE_ALIGNED(16, float, peak_decay_diff_smooth)[34];
- DECLARE_ALIGNED(16, float, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
- DECLARE_ALIGNED(16, float, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
- DECLARE_ALIGNED(16, float, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
- DECLARE_ALIGNED(16, float, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
- DECLARE_ALIGNED(16, float, Lbuf)[91][32][2];
- DECLARE_ALIGNED(16, float, Rbuf)[91][32][2];
+ DECLARE_ALIGNED(16, INTFLOAT, in_buf)[5][44][2];
+ DECLARE_ALIGNED(16, INTFLOAT, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
+ DECLARE_ALIGNED(16, INTFLOAT, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
+ DECLARE_ALIGNED(16, INTFLOAT, peak_decay_nrg)[34];
+ DECLARE_ALIGNED(16, INTFLOAT, power_smooth)[34];
+ DECLARE_ALIGNED(16, INTFLOAT, peak_decay_diff_smooth)[34];
+ DECLARE_ALIGNED(16, INTFLOAT, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
+ DECLARE_ALIGNED(16, INTFLOAT, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
+ DECLARE_ALIGNED(16, INTFLOAT, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
+ DECLARE_ALIGNED(16, INTFLOAT, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
+ DECLARE_ALIGNED(16, INTFLOAT, Lbuf)[91][32][2];
+ DECLARE_ALIGNED(16, INTFLOAT, Rbuf)[91][32][2];
int8_t opd_hist[PS_MAX_NR_IIDICC];
int8_t ipd_hist[PS_MAX_NR_IIDICC];
PSDSPContext dsp;
} PSContext;
-void ff_ps_init(void);
-void ff_ps_ctx_init(PSContext *ps);
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
-int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top);
+void AAC_RENAME(ff_ps_init)(void);
+void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps);
+int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
+int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top);
#endif /* AVCODEC_PS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_fixed.c b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed.c
new file mode 100644
index 00000000000..46af21339a9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed.c
@@ -0,0 +1,24 @@
+/*
+ * MPEG-4 Parametric Stereo decoding functions
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+
+#include "aacps.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.c
new file mode 100644
index 00000000000..9e306991f06
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.c
@@ -0,0 +1,24 @@
+/*
+ * Generate a header file for hardcoded Parametric Stereo tables
+ *
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+#include "aacps_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.h
new file mode 100644
index 00000000000..01f2eced644
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_fixed_tablegen.h
@@ -0,0 +1,403 @@
+/*
+ * Header file for hardcoded Parametric Stereo tables
+ *
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Note: Rounding-to-nearest used unless otherwise stated
+ *
+ */
+
+#ifndef AACPS_FIXED_TABLEGEN_H
+#define AACPS_FIXED_TABLEGEN_H
+
+#include <math.h>
+#include <stdint.h>
+
+#if CONFIG_HARDCODED_TABLES
+#define ps_tableinit()
+#define TABLE_CONST const
+#include "libavcodec/aacps_fixed_tables.h"
+#else
+#include "libavutil/common.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/mem.h"
+
+#include "aac_defines.h"
+#include "libavutil/softfloat.h"
+#define NR_ALLPASS_BANDS20 30
+#define NR_ALLPASS_BANDS34 50
+#define PS_AP_LINKS 3
+#define TABLE_CONST
+static int pd_re_smooth[8*8*8];
+static int pd_im_smooth[8*8*8];
+static int HA[46][8][4];
+static int HB[46][8][4];
+static DECLARE_ALIGNED(16, int, f20_0_8) [ 8][8][2];
+static DECLARE_ALIGNED(16, int, f34_0_12)[12][8][2];
+static DECLARE_ALIGNED(16, int, f34_1_8) [ 8][8][2];
+static DECLARE_ALIGNED(16, int, f34_2_4) [ 4][8][2];
+static TABLE_CONST DECLARE_ALIGNED(16, int, Q_fract_allpass)[2][50][3][2];
+static DECLARE_ALIGNED(16, int, phi_fract)[2][50][2];
+
+static const int g0_Q8[] = {
+ Q31(0.00746082949812f), Q31(0.02270420949825f), Q31(0.04546865930473f), Q31(0.07266113929591f),
+ Q31(0.09885108575264f), Q31(0.11793710567217f), Q31(0.125f)
+};
+
+static const int g0_Q12[] = {
+ Q31(0.04081179924692f), Q31(0.03812810994926f), Q31(0.05144908135699f), Q31(0.06399831151592f),
+ Q31(0.07428313801106f), Q31(0.08100347892914f), Q31(0.08333333333333f)
+};
+
+static const int g1_Q8[] = {
+ Q31(0.01565675600122f), Q31(0.03752716391991f), Q31(0.05417891378782f), Q31(0.08417044116767f),
+ Q31(0.10307344158036f), Q31(0.12222452249753f), Q31(0.125f)
+};
+
+static const int g2_Q4[] = {
+ Q31(-0.05908211155639f), Q31(-0.04871498374946f), Q31(0.0f), Q31(0.07778723915851f),
+ Q31( 0.16486303567403f), Q31( 0.23279856662996f), Q31(0.25f)
+};
+
+static const int sintbl_4[4] = { 0, 1073741824, 0, -1073741824 };
+static const int costbl_4[4] = { 1073741824, 0, -1073741824, 0 };
+static const int sintbl_8[8] = { 0, 759250125, 1073741824, 759250125,
+ 0, -759250125, -1073741824, -759250125 };
+static const int costbl_8[8] = { 1073741824, 759250125, 0, -759250125,
+ -1073741824, -759250125, 0, 759250125 };
+static const int sintbl_12[12] = { 0, 536870912, 929887697, 1073741824,
+ 929887697, 536870912, 0, -536870912,
+ -929887697, -1073741824, -929887697, -536870912 };
+static const int costbl_12[12] = { 1073741824, 929887697, 536870912, 0,
+ -536870912, -929887697, -1073741824, -929887697,
+ -536870912, 0, 536870912, 929887697 };
+
+static void make_filters_from_proto(int (*filter)[8][2], const int *proto, int bands)
+{
+
+ const int *sinptr, *cosptr;
+ int s, c, sinhalf, coshalf;
+ int q, n;
+
+ if (bands == 4) {
+ sinptr = sintbl_4;
+ cosptr = costbl_4;
+ sinhalf = 759250125;
+ coshalf = 759250125;
+ } else if (bands == 8) {
+ sinptr = sintbl_8;
+ cosptr = costbl_8;
+ sinhalf = 410903207;
+ coshalf = 992008094;
+ } else {
+ sinptr = sintbl_12;
+ cosptr = costbl_12;
+ sinhalf = 277904834;
+ coshalf = 1037154959;
+ }
+
+ for (q = 0; q < bands; q++) {
+ for (n = 0; n < 7; n++) {
+ int theta = (q*(n-6) + (n>>1) - 3) % bands;
+
+ if (theta < 0)
+ theta += bands;
+ s = sinptr[theta];
+ c = cosptr[theta];
+
+ if (n & 1) {
+ theta = (int)(((int64_t)c * coshalf - (int64_t)s * sinhalf + 0x20000000) >> 30);
+ s = (int)(((int64_t)s * coshalf + (int64_t)c * sinhalf + 0x20000000) >> 30);
+ c = theta;
+ }
+ filter[q][n][0] = (int)(((int64_t)proto[n] * c + 0x20000000) >> 30);
+ filter[q][n][1] = -(int)(((int64_t)proto[n] * s + 0x20000000) >> 30);
+ }
+ }
+}
+
+static void ps_tableinit(void)
+{
+ static const int ipdopd_sin[] = { Q30(0), Q30(M_SQRT1_2), Q30(1), Q30( M_SQRT1_2), Q30( 0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2) };
+ static const int ipdopd_cos[] = { Q30(1), Q30(M_SQRT1_2), Q30(0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2), Q30( 0), Q30( M_SQRT1_2) };
+ int pd0, pd1, pd2;
+ int idx;
+
+ static const int alpha_tab[] =
+ {
+ Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI),
+ Q30(1.4455626011f/M_PI), Q30(1.4531552792f/M_PI), Q30(1.4648091793f/M_PI), Q30(1.4945238829f/M_PI), Q30(1.5239057541f/M_PI), Q30(1.5644006729f/M_PI),
+ Q30(1.3738563061f/M_PI), Q30(1.3851221800f/M_PI), Q30(1.4026404619f/M_PI), Q30(1.4484288692f/M_PI), Q30(1.4949874878f/M_PI), Q30(1.5604078770f/M_PI),
+ Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI),
+ Q30(1.1507037878f/M_PI), Q30(1.1669205427f/M_PI), Q30(1.1938756704f/M_PI), Q30(1.2754167318f/M_PI), Q30(1.3761177063f/M_PI), Q30(1.5429240465f/M_PI),
+ Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI),
+ Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI),
+ Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI),
+ Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI),
+ Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI),
+ Q30(0.4200925827f/M_PI), Q30(0.4038758278f/M_PI), Q30(0.3769206405f/M_PI), Q30(0.2953795493f/M_PI), Q30(0.1946786791f/M_PI), Q30(0.0278722942f/M_PI),
+ Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI),
+ Q30(0.1969399750f/M_PI), Q30(0.1856741160f/M_PI), Q30(0.1681558639f/M_PI), Q30(0.1223674342f/M_PI), Q30(0.0758088827f/M_PI), Q30(0.0103884479f/M_PI),
+ Q30(0.1252337098f/M_PI), Q30(0.1176410317f/M_PI), Q30(0.1059871912f/M_PI), Q30(0.0762724727f/M_PI), Q30(0.0468905345f/M_PI), Q30(0.0063956482f/M_PI),
+ Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI),
+ Q30(1.5676341057f/M_PI), Q30(1.5678333044f/M_PI), Q30(1.5681363344f/M_PI), Q30(1.5688960552f/M_PI), Q30(1.5696337223f/M_PI), Q30(1.5706381798f/M_PI),
+ Q30(1.5651730299f/M_PI), Q30(1.5655272007f/M_PI), Q30(1.5660660267f/M_PI), Q30(1.5674170256f/M_PI), Q30(1.5687289238f/M_PI), Q30(1.5705151558f/M_PI),
+ Q30(1.5607966185f/M_PI), Q30(1.5614265203f/M_PI), Q30(1.5623844862f/M_PI), Q30(1.5647867918f/M_PI), Q30(1.5671195984f/M_PI), Q30(1.5702962875f/M_PI),
+ Q30(1.5530153513f/M_PI), Q30(1.5541347265f/M_PI), Q30(1.5558375120f/M_PI), Q30(1.5601085424f/M_PI), Q30(1.5642569065f/M_PI), Q30(1.5699069500f/M_PI),
+ Q30(1.5391840935f/M_PI), Q30(1.5411708355f/M_PI), Q30(1.5441943407f/M_PI), Q30(1.5517836809f/M_PI), Q30(1.5591609478f/M_PI), Q30(1.5692136288f/M_PI),
+ Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI),
+ Q30(1.4915299416f/M_PI), Q30(1.4964480400f/M_PI), Q30(1.5039558411f/M_PI), Q30(1.5229074955f/M_PI), Q30(1.5414420366f/M_PI), Q30(1.5667995214f/M_PI),
+ Q30(1.4590617418f/M_PI), Q30(1.4658898115f/M_PI), Q30(1.4763505459f/M_PI), Q30(1.5029321909f/M_PI), Q30(1.5291173458f/M_PI), Q30(1.5651149750f/M_PI),
+ Q30(1.4136143923f/M_PI), Q30(1.4229322672f/M_PI), Q30(1.4373078346f/M_PI), Q30(1.4743183851f/M_PI), Q30(1.5113102198f/M_PI), Q30(1.5626684427f/M_PI),
+ Q30(1.3505556583f/M_PI), Q30(1.3628427982f/M_PI), Q30(1.3820509911f/M_PI), Q30(1.4327841997f/M_PI), Q30(1.4850014448f/M_PI), Q30(1.5590143204f/M_PI),
+ Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI),
+ Q30(1.1919227839f/M_PI), Q30(1.2081253529f/M_PI), Q30(1.2346779108f/M_PI), Q30(1.3123005629f/M_PI), Q30(1.4034168720f/M_PI), Q30(1.5471596718f/M_PI),
+ Q30(1.1061993837f/M_PI), Q30(1.1219338179f/M_PI), Q30(1.1484941244f/M_PI), Q30(1.2320860624f/M_PI), Q30(1.3421301842f/M_PI), Q30(1.5373806953f/M_PI),
+ Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI),
+ Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI),
+ Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI),
+ Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI),
+ Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI),
+ Q30(0.4645969570f/M_PI), Q30(0.4488625824f/M_PI), Q30(0.4223022461f/M_PI), Q30(0.3387103081f/M_PI), Q30(0.2286661267f/M_PI), Q30(0.0334156826f/M_PI),
+ Q30(0.3788735867f/M_PI), Q30(0.3626709878f/M_PI), Q30(0.3361184299f/M_PI), Q30(0.2584958076f/M_PI), Q30(0.1673794836f/M_PI), Q30(0.0236366931f/M_PI),
+ Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI),
+ Q30(0.2202406377f/M_PI), Q30(0.2079535723f/M_PI), Q30(0.1887452900f/M_PI), Q30(0.1380121708f/M_PI), Q30(0.0857949182f/M_PI), Q30(0.0117820343f/M_PI),
+ Q30(0.1571819335f/M_PI), Q30(0.1478640437f/M_PI), Q30(0.1334884763f/M_PI), Q30(0.0964778885f/M_PI), Q30(0.0594860613f/M_PI), Q30(0.0081279324f/M_PI),
+ Q30(0.1117345318f/M_PI), Q30(0.1049065739f/M_PI), Q30(0.0944457650f/M_PI), Q30(0.0678641573f/M_PI), Q30(0.0416790098f/M_PI), Q30(0.0056813755f/M_PI),
+ Q30(0.0792663917f/M_PI), Q30(0.0743482932f/M_PI), Q30(0.0668405443f/M_PI), Q30(0.0478888862f/M_PI), Q30(0.0293543357f/M_PI), Q30(0.0039967746f/M_PI),
+ Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI),
+ Q30(0.0316122435f/M_PI), Q30(0.0296254847f/M_PI), Q30(0.0266019460f/M_PI), Q30(0.0190126132f/M_PI), Q30(0.0116353342f/M_PI), Q30(0.0015827164f/M_PI),
+ Q30(0.0177809205f/M_PI), Q30(0.0166615788f/M_PI), Q30(0.0149587989f/M_PI), Q30(0.0106877899f/M_PI), Q30(0.0065393616f/M_PI), Q30(0.0008894200f/M_PI),
+ Q30(0.0099996664f/M_PI), Q30(0.0093698399f/M_PI), Q30(0.0084118480f/M_PI), Q30(0.0060095116f/M_PI), Q30(0.0036767013f/M_PI), Q30(0.0005000498f/M_PI),
+ Q30(0.0056233541f/M_PI), Q30(0.0052691097f/M_PI), Q30(0.0047303112f/M_PI), Q30(0.0033792770f/M_PI), Q30(0.0020674451f/M_PI), Q30(0.0002811795f/M_PI),
+ Q30(0.0031622672f/M_PI), Q30(0.0029630491f/M_PI), Q30(0.0026600463f/M_PI), Q30(0.0019002859f/M_PI), Q30(0.0011625893f/M_PI), Q30(0.0001581155f/M_PI)
+ };
+
+ static const int gamma_tab[] =
+ {
+ Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI),
+ Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI)
+ };
+
+ static const int iid_par_dequant_c1[] = {
+ //iid_par_dequant_default
+ Q30(1.41198278375959f), Q30(1.40313815268360f), Q30(1.38687670404960f), Q30(1.34839972492648f),
+ Q30(1.29124937110028f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1),
+ Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.57677990744575f), Q30(0.42640143271122f),
+ Q30(0.27671828230984f), Q30(0.17664462766713f), Q30(0.07940162697653f),
+ //iid_par_dequant_fine
+ Q30(1.41420649135832f), Q30(1.41419120222364f), Q30(1.41414285699784f), Q30(1.41399000859438f),
+ Q30(1.41350698548044f), Q30(1.41198278375959f), Q30(1.40977302262355f), Q30(1.40539479488545f),
+ Q30(1.39677960498402f), Q30(1.38005309967827f), Q30(1.34839972492648f), Q30(1.31392017367631f),
+ Q30(1.26431008149654f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1),
+ Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.63365607219232f), Q30(0.52308104267543f),
+ Q30(0.42640143271122f), Q30(0.30895540465965f), Q30(0.22137464873077f), Q30(0.15768788954414f),
+ Q30(0.11198225164225f), Q30(0.07940162697653f), Q30(0.04469901562677f), Q30(0.02514469318284f),
+ Q30(0.01414142856998f), Q30(0.00795258154731f), Q30(0.00447211359449f),
+ };
+
+ static const int acos_icc_invq[] = {
+ Q31(0), Q31(0.178427635f/M_PI), Q31(0.28566733f/M_PI), Q31(0.46307236f/M_PI), Q31(0.59716315f/M_PI), Q31(0.78539816f/M_PI), Q31(1.10030855f/M_PI), Q31(1.57079633f/M_PI)
+ };
+ int iid, icc;
+
+ int k, m;
+ static const int8_t f_center_20[] = {
+ -3, -1, 1, 3, 5, 7, 10, 14, 18, 22,
+ };
+ static const int32_t f_center_34[] = {
+ Q31( 2/768.0),Q31( 6/768.0),Q31(10/768.0),Q31(14/768.0),Q31( 18/768.0),Q31( 22/768.0),Q31( 26/768.0),Q31(30/768.0),
+ Q31( 34/768.0),Q31(-10/768.0),Q31(-6/768.0),Q31(-2/768.0),Q31( 51/768.0),Q31( 57/768.0),Q31( 15/768.0),Q31(21/768.0),
+ Q31( 27/768.0),Q31( 33/768.0),Q31(39/768.0),Q31(45/768.0),Q31( 54/768.0),Q31( 66/768.0),Q31( 78/768.0),Q31(42/768.0),
+ Q31(102/768.0),Q31( 66/768.0),Q31(78/768.0),Q31(90/768.0),Q31(102/768.0),Q31(114/768.0),Q31(126/768.0),Q31(90/768.0)
+ };
+ static const int fractional_delay_links[] = { Q31(0.43f), Q31(0.75f), Q31(0.347f) };
+ const int fractional_delay_gain = Q31(0.39f);
+
+ for (pd0 = 0; pd0 < 8; pd0++) {
+ int pd0_re = (ipdopd_cos[pd0]+2)>>2;
+ int pd0_im = (ipdopd_sin[pd0]+2)>>2;
+ for (pd1 = 0; pd1 < 8; pd1++) {
+ int pd1_re = ipdopd_cos[pd1] >> 1;
+ int pd1_im = ipdopd_sin[pd1] >> 1;
+ for (pd2 = 0; pd2 < 8; pd2++) {
+ int shift, round;
+ int pd2_re = ipdopd_cos[pd2];
+ int pd2_im = ipdopd_sin[pd2];
+ int re_smooth = pd0_re + pd1_re + pd2_re;
+ int im_smooth = pd0_im + pd1_im + pd2_im;
+
+ SoftFloat pd_mag = av_int2sf(((ipdopd_cos[(pd0-pd1)&7]+8)>>4) + ((ipdopd_cos[(pd0-pd2)&7]+4)>>3) +
+ ((ipdopd_cos[(pd1-pd2)&7]+2)>>2) + 0x15000000, 28);
+ pd_mag = av_div_sf(FLOAT_1, av_sqrt_sf(pd_mag));
+ shift = 30 - pd_mag.exp;
+ round = 1 << (shift-1);
+ pd_re_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)re_smooth * pd_mag.mant + round) >> shift);
+ pd_im_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)im_smooth * pd_mag.mant + round) >> shift);
+ }
+ }
+ }
+
+ idx = 0;
+ for (iid = 0; iid < 46; iid++) {
+ int c1, c2;
+
+ c1 = iid_par_dequant_c1[iid];
+ if (iid < 15)
+ c2 = iid_par_dequant_c1[14-iid];
+ else
+ c2 = iid_par_dequant_c1[60-iid];
+
+ for (icc = 0; icc < 8; icc++) {
+ /*if (PS_BASELINE || ps->icc_mode < 3)*/{
+ int alpha, beta;
+ int ca, sa, cb, sb;
+
+ alpha = acos_icc_invq[icc];
+ beta = (int)(((int64_t)alpha * 1518500250 + 0x40000000) >> 31);
+ alpha >>= 1;
+ beta = (int)(((int64_t)beta * (c1 - c2) + 0x40000000) >> 31);
+ av_sincos_sf(beta + alpha, &sa, &ca);
+ av_sincos_sf(beta - alpha, &sb, &cb);
+
+ HA[iid][icc][0] = (int)(((int64_t)c2 * ca + 0x20000000) >> 30);
+ HA[iid][icc][1] = (int)(((int64_t)c1 * cb + 0x20000000) >> 30);
+ HA[iid][icc][2] = (int)(((int64_t)c2 * sa + 0x20000000) >> 30);
+ HA[iid][icc][3] = (int)(((int64_t)c1 * sb + 0x20000000) >> 30);
+ } /* else */ {
+ int alpha_int, gamma_int;
+ int alpha_c_int, alpha_s_int, gamma_c_int, gamma_s_int;
+
+ alpha_int = alpha_tab[idx];
+ gamma_int = gamma_tab[idx];
+
+ av_sincos_sf(alpha_int, &alpha_s_int, &alpha_c_int);
+ av_sincos_sf(gamma_int, &gamma_s_int, &gamma_c_int);
+
+ alpha_c_int = (int)(((int64_t)alpha_c_int * 1518500250 + 0x20000000) >> 30);
+ alpha_s_int = (int)(((int64_t)alpha_s_int * 1518500250 + 0x20000000) >> 30);
+
+ HB[iid][icc][0] = (int)(((int64_t)alpha_c_int * gamma_c_int + 0x20000000) >> 30);
+ HB[iid][icc][1] = (int)(((int64_t)alpha_s_int * gamma_c_int + 0x20000000) >> 30);
+ HB[iid][icc][2] = -(int)(((int64_t)alpha_s_int * gamma_s_int + 0x20000000) >> 30);
+ HB[iid][icc][3] = (int)(((int64_t)alpha_c_int * gamma_s_int + 0x20000000) >> 30);
+ }
+
+ if (icc < 5 || icc > 6)
+ idx++;
+ }
+ }
+
+ for (k = 0; k < NR_ALLPASS_BANDS20; k++) {
+ int theta;
+ int64_t f_center;
+ int c, s;
+
+ if (k < FF_ARRAY_ELEMS(f_center_20))
+ f_center = f_center_20[k];
+ else
+ f_center = (k << 3) - 52;
+
+ for (m = 0; m < PS_AP_LINKS; m++) {
+ theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 8) >> 4);
+ av_sincos_sf(-theta, &s, &c);
+ Q_fract_allpass[0][k][m][0] = c;
+ Q_fract_allpass[0][k][m][1] = s;
+ }
+
+ theta = (int)(((int64_t)fractional_delay_gain * f_center + 8) >> 4);
+ av_sincos_sf(-theta, &s, &c);
+ phi_fract[0][k][0] = c;
+ phi_fract[0][k][1] = s;
+ }
+
+ for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
+ int theta, f_center;
+ int c, s;
+
+ if (k < FF_ARRAY_ELEMS(f_center_34))
+ f_center = f_center_34[k];
+ else
+ f_center = ((int64_t)k << 26) - (53 << 25);
+
+ for (m = 0; m < PS_AP_LINKS; m++) {
+ theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 0x10000000) >> 27);
+ av_sincos_sf(-theta, &s, &c);
+ Q_fract_allpass[1][k][m][0] = c;
+ Q_fract_allpass[1][k][m][1] = s;
+ }
+
+ theta = (int)(((int64_t)fractional_delay_gain * f_center + 0x10000000) >> 27);
+ av_sincos_sf(-theta, &s, &c);
+ phi_fract[1][k][0] = c;
+ phi_fract[1][k][1] = s;
+ }
+
+ make_filters_from_proto(f20_0_8, g0_Q8, 8);
+ make_filters_from_proto(f34_0_12, g0_Q12, 12);
+ make_filters_from_proto(f34_1_8, g1_Q8, 8);
+ make_filters_from_proto(f34_2_4, g2_Q4, 4);
+}
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* AACPS_FIXED_TABLEGEN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_float.c b/chromium/third_party/ffmpeg/libavcodec/aacps_float.c
new file mode 100644
index 00000000000..73259c10fbe
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_float.c
@@ -0,0 +1,24 @@
+/*
+ * MPEG-4 Parametric Stereo decoding functions
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 0
+
+#include "aacps.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen.c
index f56930b9583..26a6752faa9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen.c
@@ -20,74 +20,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "aacps_tablegen.h"
-#include "tableprint.h"
-
-void write_float_3d_array (const void *p, int b, int c, int d)
-{
- int i;
- const float *f = p;
- for (i = 0; i < b; i++) {
- printf("{\n");
- write_float_2d_array(f, c, d);
- printf("},\n");
- f += c * d;
- }
-}
-
-void write_float_4d_array (const void *p, int a, int b, int c, int d)
-{
- int i;
- const float *f = p;
- for (i = 0; i < a; i++) {
- printf("{\n");
- write_float_3d_array(f, b, c, d);
- printf("},\n");
- f += b * c * d;
- }
-}
-
-int main(void)
-{
- ps_tableinit();
-
- write_fileheader();
-
- printf("static const float pd_re_smooth[8*8*8] = {\n");
- write_float_array(pd_re_smooth, 8*8*8);
- printf("};\n");
- printf("static const float pd_im_smooth[8*8*8] = {\n");
- write_float_array(pd_im_smooth, 8*8*8);
- printf("};\n");
-
- printf("static const float HA[46][8][4] = {\n");
- write_float_3d_array(HA, 46, 8, 4);
- printf("};\n");
- printf("static const float HB[46][8][4] = {\n");
- write_float_3d_array(HB, 46, 8, 4);
- printf("};\n");
-
- printf("static const DECLARE_ALIGNED(16, float, f20_0_8)[8][8][2] = {\n");
- write_float_3d_array(f20_0_8, 8, 8, 2);
- printf("};\n");
- printf("static const DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2] = {\n");
- write_float_3d_array(f34_0_12, 12, 8, 2);
- printf("};\n");
- printf("static const DECLARE_ALIGNED(16, float, f34_1_8)[8][8][2] = {\n");
- write_float_3d_array(f34_1_8, 8, 8, 2);
- printf("};\n");
- printf("static const DECLARE_ALIGNED(16, float, f34_2_4)[4][8][2] = {\n");
- write_float_3d_array(f34_2_4, 4, 8, 2);
- printf("};\n");
-
- printf("static const DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2] = {\n");
- write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
- printf("};\n");
- printf("static const DECLARE_ALIGNED(16, float, phi_fract)[2][50][2] = {\n");
- write_float_3d_array(phi_fract, 2, 50, 2);
- printf("};\n");
-
- return 0;
-}
+#define USE_FIXED 0
+#include "aacps_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen_template.c b/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen_template.c
new file mode 100644
index 00000000000..e06ec914f21
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacps_tablegen_template.c
@@ -0,0 +1,107 @@
+/*
+ * Generate a header file for hardcoded Parametric Stereo tables
+ *
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#define CONFIG_HARDCODED_TABLES 0
+#include "aac_defines.h"
+
+#if USE_FIXED
+#define TYPE_NAME "int32_t"
+#define INT32FLOAT int32_t
+#define ARRAY_RENAME(x) write_int32_t_ ## x
+#define ARRAY_URENAME(x) write_uint32_t_ ## x
+#include "aacps_fixed_tablegen.h"
+#else
+#define TYPE_NAME "float"
+#define INT32FLOAT float
+#define ARRAY_RENAME(x) write_float_ ## x
+#define ARRAY_URENAME(x) write_float_ ## x
+#include "aacps_tablegen.h"
+#endif /* USE_FIXED */
+#include "tableprint.h"
+
+void ARRAY_RENAME(3d_array) (const void *p, int b, int c, int d)
+{
+ int i;
+ const INT32FLOAT *f = p;
+ for (i = 0; i < b; i++) {
+ printf("{\n");
+ ARRAY_URENAME(2d_array)(f, c, d);
+ printf("},\n");
+ f += c * d;
+ }
+}
+
+void ARRAY_RENAME(4d_array) (const void *p, int a, int b, int c, int d)
+{
+ int i;
+ const INT32FLOAT *f = p;
+ for (i = 0; i < a; i++) {
+ printf("{\n");
+ ARRAY_RENAME(3d_array)(f, b, c, d);
+ printf("},\n");
+ f += b * c * d;
+ }
+}
+
+int main(void)
+{
+ ps_tableinit();
+
+ write_fileheader();
+
+ printf("static const %s pd_re_smooth[8*8*8] = {\n", TYPE_NAME);
+ ARRAY_RENAME(array)(pd_re_smooth, 8*8*8);
+ printf("};\n");
+ printf("static const %s pd_im_smooth[8*8*8] = {\n", TYPE_NAME);
+ ARRAY_RENAME(array)(pd_im_smooth, 8*8*8);
+ printf("};\n");
+
+ printf("static const %s HA[46][8][4] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(HA, 46, 8, 4);
+ printf("};\n");
+ printf("static const %s HB[46][8][4] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(HB, 46, 8, 4);
+ printf("};\n");
+
+ printf("static const DECLARE_ALIGNED(16, %s, f20_0_8)[8][8][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(f20_0_8, 8, 8, 2);
+ printf("};\n");
+ printf("static const DECLARE_ALIGNED(16, %s, f34_0_12)[12][8][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(f34_0_12, 12, 8, 2);
+ printf("};\n");
+ printf("static const DECLARE_ALIGNED(16, %s, f34_1_8)[8][8][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(f34_1_8, 8, 8, 2);
+ printf("};\n");
+ printf("static const DECLARE_ALIGNED(16, %s, f34_2_4)[4][8][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(f34_2_4, 4, 8, 2);
+ printf("};\n");
+
+ printf("static const DECLARE_ALIGNED(16, %s, Q_fract_allpass)[2][50][3][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(4d_array)(Q_fract_allpass, 2, 50, 3, 2);
+ printf("};\n");
+ printf("static const DECLARE_ALIGNED(16, %s, phi_fract)[2][50][2] = {\n", TYPE_NAME);
+ ARRAY_RENAME(3d_array)(phi_fract, 2, 50, 2);
+ printf("};\n");
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdata.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdata.c
index 7431caebc67..5c1a1b0f88d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacpsdata.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdata.c
@@ -157,7 +157,7 @@ static const int8_t k_to_i_34[] = {
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33
};
-static const float g1_Q2[] = {
- 0.0f, 0.01899487526049f, 0.0f, -0.07293139167538f,
- 0.0f, 0.30596630545168f, 0.5f
+static const INTFLOAT g1_Q2[] = {
+ Q31(0.0f), Q31(0.01899487526049f), Q31(0.0f), Q31(-0.07293139167538f),
+ Q31(0.0f), Q31(0.30596630545168f), Q31(0.5f)
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.c
deleted file mode 100644
index 5dc1a6aba96..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "aacpsdsp.h"
-
-static void ps_add_squares_c(float *dst, const float (*src)[2], int n)
-{
- int i;
- for (i = 0; i < n; i++)
- dst[i] += src[i][0] * src[i][0] + src[i][1] * src[i][1];
-}
-
-static void ps_mul_pair_single_c(float (*dst)[2], float (*src0)[2], float *src1,
- int n)
-{
- int i;
- for (i = 0; i < n; i++) {
- dst[i][0] = src0[i][0] * src1[i];
- dst[i][1] = src0[i][1] * src1[i];
- }
-}
-
-static void ps_hybrid_analysis_c(float (*out)[2], float (*in)[2],
- const float (*filter)[8][2],
- int stride, int n)
-{
- int i, j;
-
- for (i = 0; i < n; i++) {
- float sum_re = filter[i][6][0] * in[6][0];
- float sum_im = filter[i][6][0] * in[6][1];
-
- for (j = 0; j < 6; j++) {
- float in0_re = in[j][0];
- float in0_im = in[j][1];
- float in1_re = in[12-j][0];
- float in1_im = in[12-j][1];
- sum_re += filter[i][j][0] * (in0_re + in1_re) -
- filter[i][j][1] * (in0_im - in1_im);
- sum_im += filter[i][j][0] * (in0_im + in1_im) +
- filter[i][j][1] * (in0_re - in1_re);
- }
- out[i * stride][0] = sum_re;
- out[i * stride][1] = sum_im;
- }
-}
-
-static void ps_hybrid_analysis_ileave_c(float (*out)[32][2], float L[2][38][64],
- int i, int len)
-{
- int j;
-
- for (; i < 64; i++) {
- for (j = 0; j < len; j++) {
- out[i][j][0] = L[0][j][i];
- out[i][j][1] = L[1][j][i];
- }
- }
-}
-
-static void ps_hybrid_synthesis_deint_c(float out[2][38][64],
- float (*in)[32][2],
- int i, int len)
-{
- int n;
-
- for (; i < 64; i++) {
- for (n = 0; n < len; n++) {
- out[0][n][i] = in[i][n][0];
- out[1][n][i] = in[i][n][1];
- }
- }
-}
-
-static void ps_decorrelate_c(float (*out)[2], float (*delay)[2],
- float (*ap_delay)[PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2],
- const float phi_fract[2], const float (*Q_fract)[2],
- const float *transient_gain,
- float g_decay_slope,
- int len)
-{
- static const float a[] = { 0.65143905753106f,
- 0.56471812200776f,
- 0.48954165955695f };
- float ag[PS_AP_LINKS];
- int m, n;
-
- for (m = 0; m < PS_AP_LINKS; m++)
- ag[m] = a[m] * g_decay_slope;
-
- for (n = 0; n < len; n++) {
- float in_re = delay[n][0] * phi_fract[0] - delay[n][1] * phi_fract[1];
- float in_im = delay[n][0] * phi_fract[1] + delay[n][1] * phi_fract[0];
- for (m = 0; m < PS_AP_LINKS; m++) {
- float a_re = ag[m] * in_re;
- float a_im = ag[m] * in_im;
- float link_delay_re = ap_delay[m][n+2-m][0];
- float link_delay_im = ap_delay[m][n+2-m][1];
- float fractional_delay_re = Q_fract[m][0];
- float fractional_delay_im = Q_fract[m][1];
- float apd_re = in_re;
- float apd_im = in_im;
- in_re = link_delay_re * fractional_delay_re -
- link_delay_im * fractional_delay_im - a_re;
- in_im = link_delay_re * fractional_delay_im +
- link_delay_im * fractional_delay_re - a_im;
- ap_delay[m][n+5][0] = apd_re + ag[m] * in_re;
- ap_delay[m][n+5][1] = apd_im + ag[m] * in_im;
- }
- out[n][0] = transient_gain[n] * in_re;
- out[n][1] = transient_gain[n] * in_im;
- }
-}
-
-static void ps_stereo_interpolate_c(float (*l)[2], float (*r)[2],
- float h[2][4], float h_step[2][4],
- int len)
-{
- float h0 = h[0][0];
- float h1 = h[0][1];
- float h2 = h[0][2];
- float h3 = h[0][3];
- float hs0 = h_step[0][0];
- float hs1 = h_step[0][1];
- float hs2 = h_step[0][2];
- float hs3 = h_step[0][3];
- int n;
-
- for (n = 0; n < len; n++) {
- //l is s, r is d
- float l_re = l[n][0];
- float l_im = l[n][1];
- float r_re = r[n][0];
- float r_im = r[n][1];
- h0 += hs0;
- h1 += hs1;
- h2 += hs2;
- h3 += hs3;
- l[n][0] = h0 * l_re + h2 * r_re;
- l[n][1] = h0 * l_im + h2 * r_im;
- r[n][0] = h1 * l_re + h3 * r_re;
- r[n][1] = h1 * l_im + h3 * r_im;
- }
-}
-
-static void ps_stereo_interpolate_ipdopd_c(float (*l)[2], float (*r)[2],
- float h[2][4], float h_step[2][4],
- int len)
-{
- float h00 = h[0][0], h10 = h[1][0];
- float h01 = h[0][1], h11 = h[1][1];
- float h02 = h[0][2], h12 = h[1][2];
- float h03 = h[0][3], h13 = h[1][3];
- float hs00 = h_step[0][0], hs10 = h_step[1][0];
- float hs01 = h_step[0][1], hs11 = h_step[1][1];
- float hs02 = h_step[0][2], hs12 = h_step[1][2];
- float hs03 = h_step[0][3], hs13 = h_step[1][3];
- int n;
-
- for (n = 0; n < len; n++) {
- //l is s, r is d
- float l_re = l[n][0];
- float l_im = l[n][1];
- float r_re = r[n][0];
- float r_im = r[n][1];
- h00 += hs00;
- h01 += hs01;
- h02 += hs02;
- h03 += hs03;
- h10 += hs10;
- h11 += hs11;
- h12 += hs12;
- h13 += hs13;
-
- l[n][0] = h00 * l_re + h02 * r_re - h10 * l_im - h12 * r_im;
- l[n][1] = h00 * l_im + h02 * r_im + h10 * l_re + h12 * r_re;
- r[n][0] = h01 * l_re + h03 * r_re - h11 * l_im - h13 * r_im;
- r[n][1] = h01 * l_im + h03 * r_im + h11 * l_re + h13 * r_re;
- }
-}
-
-av_cold void ff_psdsp_init(PSDSPContext *s)
-{
- s->add_squares = ps_add_squares_c;
- s->mul_pair_single = ps_mul_pair_single_c;
- s->hybrid_analysis = ps_hybrid_analysis_c;
- s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
- s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
- s->decorrelate = ps_decorrelate_c;
- s->stereo_interpolate[0] = ps_stereo_interpolate_c;
- s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c;
-
- if (ARCH_ARM)
- ff_psdsp_init_arm(s);
- if (ARCH_MIPS)
- ff_psdsp_init_mips(s);
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.h b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.h
index 0ef30236ecf..c194bbe3aee 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp.h
@@ -21,34 +21,37 @@
#ifndef LIBAVCODEC_AACPSDSP_H
#define LIBAVCODEC_AACPSDSP_H
+#include "aac_defines.h"
+
#define PS_QMF_TIME_SLOTS 32
#define PS_AP_LINKS 3
#define PS_MAX_AP_DELAY 5
typedef struct PSDSPContext {
- void (*add_squares)(float *dst, const float (*src)[2], int n);
- void (*mul_pair_single)(float (*dst)[2], float (*src0)[2], float *src1,
+ void (*add_squares)(INTFLOAT *dst, const INTFLOAT (*src)[2], int n);
+ void (*mul_pair_single)(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
int n);
- void (*hybrid_analysis)(float (*out)[2], float (*in)[2],
- const float (*filter)[8][2],
+ void (*hybrid_analysis)(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
+ const INTFLOAT (*filter)[8][2],
int stride, int n);
- void (*hybrid_analysis_ileave)(float (*out)[32][2], float L[2][38][64],
+ void (*hybrid_analysis_ileave)(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
int i, int len);
- void (*hybrid_synthesis_deint)(float out[2][38][64], float (*in)[32][2],
+ void (*hybrid_synthesis_deint)(INTFLOAT out[2][38][64], INTFLOAT (*in)[32][2],
int i, int len);
- void (*decorrelate)(float (*out)[2], float (*delay)[2],
- float (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
- const float phi_fract[2], const float (*Q_fract)[2],
- const float *transient_gain,
- float g_decay_slope,
+ void (*decorrelate)(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
+ INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
+ const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2],
+ const INTFLOAT *transient_gain,
+ INTFLOAT g_decay_slope,
int len);
- void (*stereo_interpolate[2])(float (*l)[2], float (*r)[2],
- float h[2][4], float h_step[2][4],
+ void (*stereo_interpolate[2])(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
+ INTFLOAT h[2][4], INTFLOAT h_step[2][4],
int len);
} PSDSPContext;
-void ff_psdsp_init(PSDSPContext *s);
+void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s);
void ff_psdsp_init_arm(PSDSPContext *s);
void ff_psdsp_init_mips(PSDSPContext *s);
+void ff_psdsp_init_x86(PSDSPContext *s);
#endif /* LIBAVCODEC_AACPSDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_fixed.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_fixed.c
new file mode 100644
index 00000000000..24132951135
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_fixed.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+
+#include "aacpsdsp_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_float.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_float.c
new file mode 100644
index 00000000000..99aa650acff
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_float.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 0
+
+#include "aacpsdsp_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c
new file mode 100644
index 00000000000..3049ce8b79e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Note: Rounding-to-nearest used unless otherwise stated
+ *
+ */
+#include <stdint.h>
+
+#include "config.h"
+#include "libavutil/attributes.h"
+#include "aacpsdsp.h"
+
+static void ps_add_squares_c(INTFLOAT *dst, const INTFLOAT (*src)[2], int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ dst[i] += AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
+}
+
+static void ps_mul_pair_single_c(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
+ int n)
+{
+ int i;
+ for (i = 0; i < n; i++) {
+ dst[i][0] = AAC_MUL16(src0[i][0], src1[i]);
+ dst[i][1] = AAC_MUL16(src0[i][1], src1[i]);
+ }
+}
+
+static void ps_hybrid_analysis_c(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
+ const INTFLOAT (*filter)[8][2],
+ int stride, int n)
+{
+ int i, j;
+
+ for (i = 0; i < n; i++) {
+ INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0];
+ 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];
+ 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) +
+ (INT64FLOAT)filter[i][j][1] * (in0_re - in1_re);
+ }
+#if USE_FIXED
+ out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31);
+ out[i * stride][1] = (int)((sum_im + 0x40000000) >> 31);
+#else
+ out[i * stride][0] = sum_re;
+ out[i * stride][1] = sum_im;
+#endif /* USE_FIXED */
+ }
+}
+static void ps_hybrid_analysis_ileave_c(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
+ int i, int len)
+{
+ int j;
+
+ for (; i < 64; i++) {
+ for (j = 0; j < len; j++) {
+ out[i][j][0] = L[0][j][i];
+ out[i][j][1] = L[1][j][i];
+ }
+ }
+}
+
+static void ps_hybrid_synthesis_deint_c(INTFLOAT out[2][38][64],
+ INTFLOAT (*in)[32][2],
+ int i, int len)
+{
+ int n;
+
+ for (; i < 64; i++) {
+ for (n = 0; n < len; n++) {
+ out[0][n][i] = in[i][n][0];
+ out[1][n][i] = in[i][n][1];
+ }
+ }
+}
+
+static void ps_decorrelate_c(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
+ INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2],
+ const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2],
+ const INTFLOAT *transient_gain,
+ INTFLOAT g_decay_slope,
+ int len)
+{
+ static const INTFLOAT a[] = { Q31(0.65143905753106f),
+ Q31(0.56471812200776f),
+ Q31(0.48954165955695f) };
+ INTFLOAT ag[PS_AP_LINKS];
+ int m, n;
+
+ for (m = 0; m < PS_AP_LINKS; m++)
+ ag[m] = AAC_MUL30(a[m], g_decay_slope);
+
+ for (n = 0; n < len; n++) {
+ INTFLOAT in_re = AAC_MSUB30(delay[n][0], phi_fract[0], delay[n][1], phi_fract[1]);
+ INTFLOAT in_im = AAC_MADD30(delay[n][0], phi_fract[1], delay[n][1], phi_fract[0]);
+ for (m = 0; m < PS_AP_LINKS; m++) {
+ INTFLOAT a_re = AAC_MUL31(ag[m], in_re);
+ INTFLOAT a_im = AAC_MUL31(ag[m], in_im);
+ INTFLOAT link_delay_re = ap_delay[m][n+2-m][0];
+ INTFLOAT link_delay_im = ap_delay[m][n+2-m][1];
+ INTFLOAT fractional_delay_re = Q_fract[m][0];
+ INTFLOAT fractional_delay_im = Q_fract[m][1];
+ INTFLOAT apd_re = in_re;
+ INTFLOAT apd_im = in_im;
+ in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
+ link_delay_im, fractional_delay_im);
+ in_re -= a_re;
+ in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
+ link_delay_im, fractional_delay_re);
+ in_im -= a_im;
+ ap_delay[m][n+5][0] = apd_re + AAC_MUL31(ag[m], in_re);
+ ap_delay[m][n+5][1] = apd_im + AAC_MUL31(ag[m], in_im);
+ }
+ out[n][0] = AAC_MUL16(transient_gain[n], in_re);
+ out[n][1] = AAC_MUL16(transient_gain[n], in_im);
+ }
+}
+
+static void ps_stereo_interpolate_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
+ INTFLOAT h[2][4], INTFLOAT h_step[2][4],
+ int len)
+{
+ INTFLOAT h0 = h[0][0];
+ INTFLOAT h1 = h[0][1];
+ INTFLOAT h2 = h[0][2];
+ INTFLOAT h3 = h[0][3];
+ INTFLOAT hs0 = h_step[0][0];
+ INTFLOAT hs1 = h_step[0][1];
+ INTFLOAT hs2 = h_step[0][2];
+ INTFLOAT hs3 = h_step[0][3];
+ int n;
+
+ for (n = 0; n < len; n++) {
+ //l is s, r is d
+ INTFLOAT l_re = l[n][0];
+ INTFLOAT l_im = l[n][1];
+ INTFLOAT r_re = r[n][0];
+ INTFLOAT r_im = r[n][1];
+ h0 += hs0;
+ h1 += hs1;
+ h2 += hs2;
+ h3 += hs3;
+ l[n][0] = AAC_MADD30(h0, l_re, h2, r_re);
+ l[n][1] = AAC_MADD30(h0, l_im, h2, r_im);
+ r[n][0] = AAC_MADD30(h1, l_re, h3, r_re);
+ r[n][1] = AAC_MADD30(h1, l_im, h3, r_im);
+ }
+}
+
+static void ps_stereo_interpolate_ipdopd_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
+ INTFLOAT h[2][4], INTFLOAT h_step[2][4],
+ int len)
+{
+ INTFLOAT h00 = h[0][0], h10 = h[1][0];
+ INTFLOAT h01 = h[0][1], h11 = h[1][1];
+ INTFLOAT h02 = h[0][2], h12 = h[1][2];
+ INTFLOAT h03 = h[0][3], h13 = h[1][3];
+ INTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
+ INTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
+ INTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
+ INTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
+ int n;
+
+ for (n = 0; n < len; n++) {
+ //l is s, r is d
+ INTFLOAT l_re = l[n][0];
+ INTFLOAT l_im = l[n][1];
+ INTFLOAT r_re = r[n][0];
+ INTFLOAT r_im = r[n][1];
+ h00 += hs00;
+ h01 += hs01;
+ h02 += hs02;
+ h03 += hs03;
+ h10 += hs10;
+ h11 += hs11;
+ h12 += hs12;
+ h13 += hs13;
+
+ l[n][0] = AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
+ l[n][1] = AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
+ r[n][0] = AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
+ r[n][1] = AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
+ }
+}
+
+av_cold void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s)
+{
+ s->add_squares = ps_add_squares_c;
+ s->mul_pair_single = ps_mul_pair_single_c;
+ s->hybrid_analysis = ps_hybrid_analysis_c;
+ s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
+ s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
+ s->decorrelate = ps_decorrelate_c;
+ s->stereo_interpolate[0] = ps_stereo_interpolate_c;
+ s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c;
+
+#if !USE_FIXED
+ if (ARCH_ARM)
+ ff_psdsp_init_arm(s);
+ if (ARCH_MIPS)
+ ff_psdsp_init_mips(s);
+ if (ARCH_X86)
+ ff_psdsp_init_x86(s);
+#endif /* !USE_FIXED */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsy.c b/chromium/third_party/ffmpeg/libavcodec/aacpsy.c
index 3a661594767..82b670d49d8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacpsy.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsy.c
@@ -262,7 +262,7 @@ static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx)
for (i = 0; i < avctx->channels; i++) {
AacPsyChannel *pch = &ctx->ch[i];
- if (avctx->flags & CODEC_FLAG_QSCALE)
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE)
pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm;
else
pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->channels / 1000);
@@ -787,6 +787,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
psy_band->threshold = band->thr;
psy_band->energy = band->energy;
+ psy_band->spread = band->active_lines * 2.0f / band_sizes[g];
}
}
@@ -836,6 +837,7 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
int grouping = 0;
int uselongblock = 1;
int attacks[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
+ float clippings[AAC_NUM_BLOCKS_SHORT];
int i;
FFPsyWindowInfo wi = { { 0 } };
@@ -925,14 +927,35 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
lame_apply_block_type(pch, &wi, uselongblock);
+ /* Calculate input sample maximums and evaluate clipping risk */
+ if (audio) {
+ for (i = 0; i < AAC_NUM_BLOCKS_SHORT; i++) {
+ const float *wbuf = audio + i * AAC_BLOCK_SIZE_SHORT;
+ float max = 0;
+ int j;
+ for (j = 0; j < AAC_BLOCK_SIZE_SHORT; j++)
+ max = FFMAX(max, fabsf(wbuf[j]));
+ clippings[i] = max;
+ }
+ } else {
+ for (i = 0; i < 8; i++)
+ clippings[i] = 0;
+ }
+
wi.window_type[1] = prev_type;
if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
+ float clipping = 0.0f;
+
wi.num_windows = 1;
wi.grouping[0] = 1;
if (wi.window_type[0] == LONG_START_SEQUENCE)
wi.window_shape = 0;
else
wi.window_shape = 1;
+
+ for (i = 0; i < 8; i++)
+ clipping = FFMAX(clipping, clippings[i]);
+ wi.clipping[0] = clipping;
} else {
int lastgrp = 0;
@@ -943,6 +966,14 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
lastgrp = i;
wi.grouping[lastgrp]++;
}
+
+ for (i = 0; i < 8; i += wi.grouping[i]) {
+ int w;
+ float clipping = 0.0f;
+ for (w = 0; w < wi.grouping[i] && !clipping; w++)
+ clipping = FFMAX(clipping, clippings[i+w]);
+ wi.clipping[i] = clipping;
+ }
}
/* Determine grouping, based on the location of the first attack, and save for
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr.c b/chromium/third_party/ffmpeg/libavcodec/aacsbr.c
index 7e98834c490..81f19028224 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacsbr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr.c
@@ -25,6 +25,7 @@
* AAC Spectral Band Replication decoding functions
* @author Robert Swain ( rob opendot cl )
*/
+#define USE_FIXED 0
#include "aac.h"
#include "sbr.h"
@@ -42,252 +43,13 @@
#include <float.h>
#include <math.h>
-#define ENVELOPE_ADJUSTMENT_OFFSET 2
-#define NOISE_FLOOR_OFFSET 6.0f
-
#if ARCH_MIPS
#include "mips/aacsbr_mips.h"
#endif /* ARCH_MIPS */
-/**
- * SBR VLC tables
- */
-enum {
- T_HUFFMAN_ENV_1_5DB,
- F_HUFFMAN_ENV_1_5DB,
- T_HUFFMAN_ENV_BAL_1_5DB,
- F_HUFFMAN_ENV_BAL_1_5DB,
- T_HUFFMAN_ENV_3_0DB,
- F_HUFFMAN_ENV_3_0DB,
- T_HUFFMAN_ENV_BAL_3_0DB,
- F_HUFFMAN_ENV_BAL_3_0DB,
- T_HUFFMAN_NOISE_3_0DB,
- T_HUFFMAN_NOISE_BAL_3_0DB,
-};
-
-/**
- * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
- */
-enum {
- FIXFIX,
- FIXVAR,
- VARFIX,
- VARVAR,
-};
-
-enum {
- EXTENSION_ID_PS = 2,
-};
-
static VLC vlc_sbr[10];
-static const int8_t vlc_sbr_lav[10] =
- { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 };
-
-#define SBR_INIT_VLC_STATIC(num, size) \
- INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \
- sbr_tmp[num].sbr_bits , 1, 1, \
- sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \
- size)
-
-#define SBR_VLC_ROW(name) \
- { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
-
static void aacsbr_func_ptr_init(AACSBRContext *c);
-av_cold void ff_aac_sbr_init(void)
-{
- static const struct {
- const void *sbr_codes, *sbr_bits;
- const unsigned int table_size, elem_size;
- } sbr_tmp[] = {
- SBR_VLC_ROW(t_huffman_env_1_5dB),
- SBR_VLC_ROW(f_huffman_env_1_5dB),
- SBR_VLC_ROW(t_huffman_env_bal_1_5dB),
- SBR_VLC_ROW(f_huffman_env_bal_1_5dB),
- SBR_VLC_ROW(t_huffman_env_3_0dB),
- SBR_VLC_ROW(f_huffman_env_3_0dB),
- SBR_VLC_ROW(t_huffman_env_bal_3_0dB),
- SBR_VLC_ROW(f_huffman_env_bal_3_0dB),
- SBR_VLC_ROW(t_huffman_noise_3_0dB),
- SBR_VLC_ROW(t_huffman_noise_bal_3_0dB),
- };
-
- // SBR VLC table initialization
- SBR_INIT_VLC_STATIC(0, 1098);
- SBR_INIT_VLC_STATIC(1, 1092);
- SBR_INIT_VLC_STATIC(2, 768);
- SBR_INIT_VLC_STATIC(3, 1026);
- SBR_INIT_VLC_STATIC(4, 1058);
- SBR_INIT_VLC_STATIC(5, 1052);
- SBR_INIT_VLC_STATIC(6, 544);
- SBR_INIT_VLC_STATIC(7, 544);
- SBR_INIT_VLC_STATIC(8, 592);
- SBR_INIT_VLC_STATIC(9, 512);
-
- aacsbr_tableinit();
-
- ff_ps_init();
-}
-
-/** Places SBR in pure upsampling mode. */
-static void sbr_turnoff(SpectralBandReplication *sbr) {
- sbr->start = 0;
- // Init defults used in pure upsampling mode
- sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
- sbr->m[1] = 0;
- // Reset values for first SBR header
- sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
- memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters));
-}
-
-av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
-{
- if(sbr->mdct.mdct_bits)
- return;
- sbr->kx[0] = sbr->kx[1];
- sbr_turnoff(sbr);
- sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
- sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
- /* SBR requires samples to be scaled to +/-32768.0 to work correctly.
- * mdct scale factors are adjusted to scale up from +/-1.0 at analysis
- * and scale back down at synthesis. */
- ff_mdct_init(&sbr->mdct, 7, 1, 1.0 / (64 * 32768.0));
- ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
- ff_ps_ctx_init(&sbr->ps);
- ff_sbrdsp_init(&sbr->dsp);
- aacsbr_func_ptr_init(&sbr->c);
-}
-
-av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
-{
- ff_mdct_end(&sbr->mdct);
- ff_mdct_end(&sbr->mdct_ana);
-}
-
-static int qsort_comparison_function_int16(const void *a, const void *b)
-{
- return *(const int16_t *)a - *(const int16_t *)b;
-}
-
-static inline int in_table_int16(const int16_t *table, int last_el, int16_t needle)
-{
- int i;
- for (i = 0; i <= last_el; i++)
- if (table[i] == needle)
- return 1;
- return 0;
-}
-
-/// Limiter Frequency Band Table (14496-3 sp04 p198)
-static void sbr_make_f_tablelim(SpectralBandReplication *sbr)
-{
- int k;
- if (sbr->bs_limiter_bands > 0) {
- static const float bands_warped[3] = { 1.32715174233856803909f, //2^(0.49/1.2)
- 1.18509277094158210129f, //2^(0.49/2)
- 1.11987160404675912501f }; //2^(0.49/3)
- const float lim_bands_per_octave_warped = bands_warped[sbr->bs_limiter_bands - 1];
- int16_t patch_borders[7];
- uint16_t *in = sbr->f_tablelim + 1, *out = sbr->f_tablelim;
-
- patch_borders[0] = sbr->kx[1];
- for (k = 1; k <= sbr->num_patches; k++)
- patch_borders[k] = patch_borders[k-1] + sbr->patch_num_subbands[k-1];
-
- memcpy(sbr->f_tablelim, sbr->f_tablelow,
- (sbr->n[0] + 1) * sizeof(sbr->f_tablelow[0]));
- if (sbr->num_patches > 1)
- memcpy(sbr->f_tablelim + sbr->n[0] + 1, patch_borders + 1,
- (sbr->num_patches - 1) * sizeof(patch_borders[0]));
-
- qsort(sbr->f_tablelim, sbr->num_patches + sbr->n[0],
- sizeof(sbr->f_tablelim[0]),
- qsort_comparison_function_int16);
-
- sbr->n_lim = sbr->n[0] + sbr->num_patches - 1;
- while (out < sbr->f_tablelim + sbr->n_lim) {
- if (*in >= *out * lim_bands_per_octave_warped) {
- *++out = *in++;
- } else if (*in == *out ||
- !in_table_int16(patch_borders, sbr->num_patches, *in)) {
- in++;
- sbr->n_lim--;
- } else if (!in_table_int16(patch_borders, sbr->num_patches, *out)) {
- *out = *in++;
- sbr->n_lim--;
- } else {
- *++out = *in++;
- }
- }
- } else {
- sbr->f_tablelim[0] = sbr->f_tablelow[0];
- sbr->f_tablelim[1] = sbr->f_tablelow[sbr->n[0]];
- sbr->n_lim = 1;
- }
-}
-
-static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext *gb)
-{
- unsigned int cnt = get_bits_count(gb);
- uint8_t bs_header_extra_1;
- uint8_t bs_header_extra_2;
- int old_bs_limiter_bands = sbr->bs_limiter_bands;
- SpectrumParameters old_spectrum_params;
-
- sbr->start = 1;
-
- // Save last spectrum parameters variables to compare to new ones
- memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
-
- sbr->bs_amp_res_header = get_bits1(gb);
- sbr->spectrum_params.bs_start_freq = get_bits(gb, 4);
- sbr->spectrum_params.bs_stop_freq = get_bits(gb, 4);
- sbr->spectrum_params.bs_xover_band = get_bits(gb, 3);
- skip_bits(gb, 2); // bs_reserved
-
- bs_header_extra_1 = get_bits1(gb);
- bs_header_extra_2 = get_bits1(gb);
-
- if (bs_header_extra_1) {
- sbr->spectrum_params.bs_freq_scale = get_bits(gb, 2);
- sbr->spectrum_params.bs_alter_scale = get_bits1(gb);
- sbr->spectrum_params.bs_noise_bands = get_bits(gb, 2);
- } else {
- sbr->spectrum_params.bs_freq_scale = 2;
- sbr->spectrum_params.bs_alter_scale = 1;
- sbr->spectrum_params.bs_noise_bands = 2;
- }
-
- // Check if spectrum parameters changed
- if (memcmp(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters)))
- sbr->reset = 1;
-
- if (bs_header_extra_2) {
- sbr->bs_limiter_bands = get_bits(gb, 2);
- sbr->bs_limiter_gains = get_bits(gb, 2);
- sbr->bs_interpol_freq = get_bits1(gb);
- sbr->bs_smoothing_mode = get_bits1(gb);
- } else {
- sbr->bs_limiter_bands = 2;
- sbr->bs_limiter_gains = 2;
- sbr->bs_interpol_freq = 1;
- sbr->bs_smoothing_mode = 1;
- }
-
- if (sbr->bs_limiter_bands != old_bs_limiter_bands && !sbr->reset)
- sbr_make_f_tablelim(sbr);
-
- return get_bits_count(gb) - cnt;
-}
-
-static int array_min_int16(const int16_t *array, int nel)
-{
- int i, min = array[0];
- for (i = 1; i < nel; i++)
- min = FFMIN(array[i], min);
- return min;
-}
-
static void make_bands(int16_t* bands, int start, int stop, int num_bands)
{
int k, previous, present;
@@ -306,821 +68,6 @@ static void make_bands(int16_t* bands, int start, int stop, int num_bands)
bands[num_bands-1] = stop - previous;
}
-static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band)
-{
- // Requirements (14496-3 sp04 p205)
- if (n_master <= 0) {
- av_log(avctx, AV_LOG_ERROR, "Invalid n_master: %d\n", n_master);
- return -1;
- }
- if (bs_xover_band >= n_master) {
- av_log(avctx, AV_LOG_ERROR,
- "Invalid bitstream, crossover band index beyond array bounds: %d\n",
- bs_xover_band);
- return -1;
- }
- return 0;
-}
-
-/// Master Frequency Band Table (14496-3 sp04 p194)
-static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
- SpectrumParameters *spectrum)
-{
- unsigned int temp, max_qmf_subbands = 0;
- unsigned int start_min, stop_min;
- int k;
- const int8_t *sbr_offset_ptr;
- int16_t stop_dk[13];
-
- if (sbr->sample_rate < 32000) {
- temp = 3000;
- } else if (sbr->sample_rate < 64000) {
- temp = 4000;
- } else
- temp = 5000;
-
- switch (sbr->sample_rate) {
- case 16000:
- sbr_offset_ptr = sbr_offset[0];
- break;
- case 22050:
- sbr_offset_ptr = sbr_offset[1];
- break;
- case 24000:
- sbr_offset_ptr = sbr_offset[2];
- break;
- case 32000:
- sbr_offset_ptr = sbr_offset[3];
- break;
- case 44100: case 48000: case 64000:
- sbr_offset_ptr = sbr_offset[4];
- break;
- case 88200: case 96000: case 128000: case 176400: case 192000:
- sbr_offset_ptr = sbr_offset[5];
- break;
- default:
- av_log(ac->avctx, AV_LOG_ERROR,
- "Unsupported sample rate for SBR: %d\n", sbr->sample_rate);
- return -1;
- }
-
- start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
- stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
-
- sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq];
-
- if (spectrum->bs_stop_freq < 14) {
- sbr->k[2] = stop_min;
- make_bands(stop_dk, stop_min, 64, 13);
- qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16);
- for (k = 0; k < spectrum->bs_stop_freq; k++)
- sbr->k[2] += stop_dk[k];
- } else if (spectrum->bs_stop_freq == 14) {
- sbr->k[2] = 2*sbr->k[0];
- } else if (spectrum->bs_stop_freq == 15) {
- sbr->k[2] = 3*sbr->k[0];
- } else {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bs_stop_freq: %d\n", spectrum->bs_stop_freq);
- return -1;
- }
- sbr->k[2] = FFMIN(64, sbr->k[2]);
-
- // Requirements (14496-3 sp04 p205)
- if (sbr->sample_rate <= 32000) {
- max_qmf_subbands = 48;
- } else if (sbr->sample_rate == 44100) {
- max_qmf_subbands = 35;
- } else if (sbr->sample_rate >= 48000)
- max_qmf_subbands = 32;
- else
- av_assert0(0);
-
- if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bitstream, too many QMF subbands: %d\n", sbr->k[2] - sbr->k[0]);
- return -1;
- }
-
- if (!spectrum->bs_freq_scale) {
- int dk, k2diff;
-
- dk = spectrum->bs_alter_scale + 1;
- sbr->n_master = ((sbr->k[2] - sbr->k[0] + (dk&2)) >> dk) << 1;
- if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
- return -1;
-
- for (k = 1; k <= sbr->n_master; k++)
- sbr->f_master[k] = dk;
-
- k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk;
- if (k2diff < 0) {
- sbr->f_master[1]--;
- sbr->f_master[2]-= (k2diff < -1);
- } else if (k2diff) {
- sbr->f_master[sbr->n_master]++;
- }
-
- sbr->f_master[0] = sbr->k[0];
- for (k = 1; k <= sbr->n_master; k++)
- sbr->f_master[k] += sbr->f_master[k - 1];
-
- } else {
- int half_bands = 7 - spectrum->bs_freq_scale; // bs_freq_scale = {1,2,3}
- int two_regions, num_bands_0;
- int vdk0_max, vdk1_min;
- int16_t vk0[49];
-
- if (49 * sbr->k[2] > 110 * sbr->k[0]) {
- two_regions = 1;
- sbr->k[1] = 2 * sbr->k[0];
- } else {
- two_regions = 0;
- sbr->k[1] = sbr->k[2];
- }
-
- num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2;
-
- if (num_bands_0 <= 0) { // Requirements (14496-3 sp04 p205)
- av_log(ac->avctx, AV_LOG_ERROR, "Invalid num_bands_0: %d\n", num_bands_0);
- return -1;
- }
-
- vk0[0] = 0;
-
- make_bands(vk0+1, sbr->k[0], sbr->k[1], num_bands_0);
-
- qsort(vk0 + 1, num_bands_0, sizeof(vk0[1]), qsort_comparison_function_int16);
- vdk0_max = vk0[num_bands_0];
-
- vk0[0] = sbr->k[0];
- for (k = 1; k <= num_bands_0; k++) {
- if (vk0[k] <= 0) { // Requirements (14496-3 sp04 p205)
- av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk0[%d]: %d\n", k, vk0[k]);
- return -1;
- }
- vk0[k] += vk0[k-1];
- }
-
- if (two_regions) {
- int16_t vk1[49];
- float invwarp = spectrum->bs_alter_scale ? 0.76923076923076923077f
- : 1.0f; // bs_alter_scale = {0,1}
- int num_bands_1 = lrintf(half_bands * invwarp *
- log2f(sbr->k[2] / (float)sbr->k[1])) * 2;
-
- make_bands(vk1+1, sbr->k[1], sbr->k[2], num_bands_1);
-
- vdk1_min = array_min_int16(vk1 + 1, num_bands_1);
-
- if (vdk1_min < vdk0_max) {
- int change;
- qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
- change = FFMIN(vdk0_max - vk1[1], (vk1[num_bands_1] - vk1[1]) >> 1);
- vk1[1] += change;
- vk1[num_bands_1] -= change;
- }
-
- qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
-
- vk1[0] = sbr->k[1];
- for (k = 1; k <= num_bands_1; k++) {
- if (vk1[k] <= 0) { // Requirements (14496-3 sp04 p205)
- av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk1[%d]: %d\n", k, vk1[k]);
- return -1;
- }
- vk1[k] += vk1[k-1];
- }
-
- sbr->n_master = num_bands_0 + num_bands_1;
- if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
- return -1;
- memcpy(&sbr->f_master[0], vk0,
- (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
- memcpy(&sbr->f_master[num_bands_0 + 1], vk1 + 1,
- num_bands_1 * sizeof(sbr->f_master[0]));
-
- } else {
- sbr->n_master = num_bands_0;
- if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
- return -1;
- memcpy(sbr->f_master, vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
- }
- }
-
- return 0;
-}
-
-/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
-static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
-{
- int i, k, last_k = -1, last_msb = -1, sb = 0;
- int msb = sbr->k[0];
- int usb = sbr->kx[1];
- int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
-
- sbr->num_patches = 0;
-
- if (goal_sb < sbr->kx[1] + sbr->m[1]) {
- for (k = 0; sbr->f_master[k] < goal_sb; k++) ;
- } else
- k = sbr->n_master;
-
- do {
- int odd = 0;
- if (k == last_k && msb == last_msb) {
- av_log(ac->avctx, AV_LOG_ERROR, "patch construction failed\n");
- return AVERROR_INVALIDDATA;
- }
- last_k = k;
- last_msb = msb;
- for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
- sb = sbr->f_master[i];
- odd = (sb + sbr->k[0]) & 1;
- }
-
- // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5.
- // After this check the final number of patches can still be six which is
- // illegal however the Coding Technologies decoder check stream has a final
- // count of 6 patches
- if (sbr->num_patches > 5) {
- av_log(ac->avctx, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
- return -1;
- }
-
- sbr->patch_num_subbands[sbr->num_patches] = FFMAX(sb - usb, 0);
- sbr->patch_start_subband[sbr->num_patches] = sbr->k[0] - odd - sbr->patch_num_subbands[sbr->num_patches];
-
- if (sbr->patch_num_subbands[sbr->num_patches] > 0) {
- usb = sb;
- msb = sb;
- sbr->num_patches++;
- } else
- msb = sbr->kx[1];
-
- if (sbr->f_master[k] - sb < 3)
- k = sbr->n_master;
- } while (sb != sbr->kx[1] + sbr->m[1]);
-
- if (sbr->num_patches > 1 &&
- sbr->patch_num_subbands[sbr->num_patches - 1] < 3)
- sbr->num_patches--;
-
- return 0;
-}
-
-/// Derived Frequency Band Tables (14496-3 sp04 p197)
-static int sbr_make_f_derived(AACContext *ac, SpectralBandReplication *sbr)
-{
- int k, temp;
-
- sbr->n[1] = sbr->n_master - sbr->spectrum_params.bs_xover_band;
- sbr->n[0] = (sbr->n[1] + 1) >> 1;
-
- memcpy(sbr->f_tablehigh, &sbr->f_master[sbr->spectrum_params.bs_xover_band],
- (sbr->n[1] + 1) * sizeof(sbr->f_master[0]));
- sbr->m[1] = sbr->f_tablehigh[sbr->n[1]] - sbr->f_tablehigh[0];
- sbr->kx[1] = sbr->f_tablehigh[0];
-
- // Requirements (14496-3 sp04 p205)
- if (sbr->kx[1] + sbr->m[1] > 64) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Stop frequency border too high: %d\n", sbr->kx[1] + sbr->m[1]);
- return -1;
- }
- if (sbr->kx[1] > 32) {
- av_log(ac->avctx, AV_LOG_ERROR, "Start frequency border too high: %d\n", sbr->kx[1]);
- return -1;
- }
-
- sbr->f_tablelow[0] = sbr->f_tablehigh[0];
- temp = sbr->n[1] & 1;
- for (k = 1; k <= sbr->n[0]; k++)
- sbr->f_tablelow[k] = sbr->f_tablehigh[2 * k - temp];
-
- sbr->n_q = FFMAX(1, lrintf(sbr->spectrum_params.bs_noise_bands *
- log2f(sbr->k[2] / (float)sbr->kx[1]))); // 0 <= bs_noise_bands <= 3
- if (sbr->n_q > 5) {
- av_log(ac->avctx, AV_LOG_ERROR, "Too many noise floor scale factors: %d\n", sbr->n_q);
- return -1;
- }
-
- sbr->f_tablenoise[0] = sbr->f_tablelow[0];
- temp = 0;
- for (k = 1; k <= sbr->n_q; k++) {
- temp += (sbr->n[0] - temp) / (sbr->n_q + 1 - k);
- sbr->f_tablenoise[k] = sbr->f_tablelow[temp];
- }
-
- if (sbr_hf_calc_npatches(ac, sbr) < 0)
- return -1;
-
- sbr_make_f_tablelim(sbr);
-
- sbr->data[0].f_indexnoise = 0;
- sbr->data[1].f_indexnoise = 0;
-
- return 0;
-}
-
-static av_always_inline void get_bits1_vector(GetBitContext *gb, uint8_t *vec,
- int elements)
-{
- int i;
- for (i = 0; i < elements; i++) {
- vec[i] = get_bits1(gb);
- }
-}
-
-/** ceil(log2(index+1)) */
-static const int8_t ceil_log2[] = {
- 0, 1, 2, 2, 3, 3,
-};
-
-static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
- GetBitContext *gb, SBRData *ch_data)
-{
- int i;
- int bs_pointer = 0;
- // frameLengthFlag ? 15 : 16; 960 sample length frames unsupported; this value is numTimeSlots
- int abs_bord_trail = 16;
- int num_rel_lead, num_rel_trail;
- unsigned bs_num_env_old = ch_data->bs_num_env;
-
- ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env];
- ch_data->bs_amp_res = sbr->bs_amp_res_header;
- ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old];
-
- switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
- case FIXFIX:
- ch_data->bs_num_env = 1 << get_bits(gb, 2);
- num_rel_lead = ch_data->bs_num_env - 1;
- if (ch_data->bs_num_env == 1)
- ch_data->bs_amp_res = 0;
-
- if (ch_data->bs_num_env > 4) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
- ch_data->bs_num_env);
- return -1;
- }
-
- ch_data->t_env[0] = 0;
- ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
- abs_bord_trail = (abs_bord_trail + (ch_data->bs_num_env >> 1)) /
- ch_data->bs_num_env;
- for (i = 0; i < num_rel_lead; i++)
- ch_data->t_env[i + 1] = ch_data->t_env[i] + abs_bord_trail;
-
- ch_data->bs_freq_res[1] = get_bits1(gb);
- for (i = 1; i < ch_data->bs_num_env; i++)
- ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
- break;
- case FIXVAR:
- abs_bord_trail += get_bits(gb, 2);
- num_rel_trail = get_bits(gb, 2);
- ch_data->bs_num_env = num_rel_trail + 1;
- ch_data->t_env[0] = 0;
- ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
- for (i = 0; i < num_rel_trail; i++)
- ch_data->t_env[ch_data->bs_num_env - 1 - i] =
- ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
-
- bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
- for (i = 0; i < ch_data->bs_num_env; i++)
- ch_data->bs_freq_res[ch_data->bs_num_env - i] = get_bits1(gb);
- break;
- case VARFIX:
- ch_data->t_env[0] = get_bits(gb, 2);
- num_rel_lead = get_bits(gb, 2);
- ch_data->bs_num_env = num_rel_lead + 1;
- ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
- for (i = 0; i < num_rel_lead; i++)
- ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
-
- bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
- get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
- break;
- case VARVAR:
- ch_data->t_env[0] = get_bits(gb, 2);
- abs_bord_trail += get_bits(gb, 2);
- num_rel_lead = get_bits(gb, 2);
- num_rel_trail = get_bits(gb, 2);
- ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1;
-
- if (ch_data->bs_num_env > 5) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
- ch_data->bs_num_env);
- return -1;
- }
-
- ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
- for (i = 0; i < num_rel_lead; i++)
- ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
- for (i = 0; i < num_rel_trail; i++)
- ch_data->t_env[ch_data->bs_num_env - 1 - i] =
- ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
-
- bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
- get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
- break;
- }
-
- av_assert0(bs_pointer >= 0);
- if (bs_pointer > ch_data->bs_num_env + 1) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
- bs_pointer);
- return -1;
- }
-
- for (i = 1; i <= ch_data->bs_num_env; i++) {
- if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
- av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
- return -1;
- }
- }
-
- ch_data->bs_num_noise = (ch_data->bs_num_env > 1) + 1;
-
- ch_data->t_q[0] = ch_data->t_env[0];
- ch_data->t_q[ch_data->bs_num_noise] = ch_data->t_env[ch_data->bs_num_env];
- if (ch_data->bs_num_noise > 1) {
- int idx;
- if (ch_data->bs_frame_class == FIXFIX) {
- idx = ch_data->bs_num_env >> 1;
- } else if (ch_data->bs_frame_class & 1) { // FIXVAR or VARVAR
- idx = ch_data->bs_num_env - FFMAX(bs_pointer - 1, 1);
- } else { // VARFIX
- if (!bs_pointer)
- idx = 1;
- else if (bs_pointer == 1)
- idx = ch_data->bs_num_env - 1;
- else // bs_pointer > 1
- idx = bs_pointer - 1;
- }
- ch_data->t_q[1] = ch_data->t_env[idx];
- }
-
- ch_data->e_a[0] = -(ch_data->e_a[1] != bs_num_env_old); // l_APrev
- ch_data->e_a[1] = -1;
- if ((ch_data->bs_frame_class & 1) && bs_pointer) { // FIXVAR or VARVAR and bs_pointer != 0
- ch_data->e_a[1] = ch_data->bs_num_env + 1 - bs_pointer;
- } else if ((ch_data->bs_frame_class == 2) && (bs_pointer > 1)) // VARFIX and bs_pointer > 1
- ch_data->e_a[1] = bs_pointer - 1;
-
- return 0;
-}
-
-static void copy_sbr_grid(SBRData *dst, const SBRData *src) {
- //These variables are saved from the previous frame rather than copied
- dst->bs_freq_res[0] = dst->bs_freq_res[dst->bs_num_env];
- dst->t_env_num_env_old = dst->t_env[dst->bs_num_env];
- dst->e_a[0] = -(dst->e_a[1] != dst->bs_num_env);
-
- //These variables are read from the bitstream and therefore copied
- memcpy(dst->bs_freq_res+1, src->bs_freq_res+1, sizeof(dst->bs_freq_res)-sizeof(*dst->bs_freq_res));
- memcpy(dst->t_env, src->t_env, sizeof(dst->t_env));
- memcpy(dst->t_q, src->t_q, sizeof(dst->t_q));
- dst->bs_num_env = src->bs_num_env;
- dst->bs_amp_res = src->bs_amp_res;
- dst->bs_num_noise = src->bs_num_noise;
- dst->bs_frame_class = src->bs_frame_class;
- dst->e_a[1] = src->e_a[1];
-}
-
-/// Read how the envelope and noise floor data is delta coded
-static void read_sbr_dtdf(SpectralBandReplication *sbr, GetBitContext *gb,
- SBRData *ch_data)
-{
- get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env);
- get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise);
-}
-
-/// Read inverse filtering data
-static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb,
- SBRData *ch_data)
-{
- int i;
-
- memcpy(ch_data->bs_invf_mode[1], ch_data->bs_invf_mode[0], 5 * sizeof(uint8_t));
- for (i = 0; i < sbr->n_q; i++)
- ch_data->bs_invf_mode[0][i] = get_bits(gb, 2);
-}
-
-static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb,
- SBRData *ch_data, int ch)
-{
- int bits;
- int i, j, k;
- VLC_TYPE (*t_huff)[2], (*f_huff)[2];
- int t_lav, f_lav;
- const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
- const int odd = sbr->n[1] & 1;
-
- if (sbr->bs_coupling && ch) {
- if (ch_data->bs_amp_res) {
- bits = 5;
- t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_3_0DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_3_0DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
- } else {
- bits = 6;
- t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_1_5DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_1_5DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_1_5DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_1_5DB];
- }
- } else {
- if (ch_data->bs_amp_res) {
- bits = 6;
- t_huff = vlc_sbr[T_HUFFMAN_ENV_3_0DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_3_0DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
- } else {
- bits = 7;
- t_huff = vlc_sbr[T_HUFFMAN_ENV_1_5DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_1_5DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_1_5DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_1_5DB];
- }
- }
-
- for (i = 0; i < ch_data->bs_num_env; i++) {
- if (ch_data->bs_df_env[i]) {
- // bs_freq_res[0] == bs_freq_res[bs_num_env] from prev frame
- if (ch_data->bs_freq_res[i + 1] == ch_data->bs_freq_res[i]) {
- for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
- ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
- } else if (ch_data->bs_freq_res[i + 1]) {
- for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
- k = (j + odd) >> 1; // find k such that f_tablelow[k] <= f_tablehigh[j] < f_tablelow[k + 1]
- ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
- }
- } else {
- for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
- k = j ? 2*j - odd : 0; // find k such that f_tablehigh[k] == f_tablelow[j]
- ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
- }
- }
- } else {
- ch_data->env_facs[i + 1][0] = delta * get_bits(gb, bits); // bs_env_start_value_balance
- for (j = 1; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
- ch_data->env_facs[i + 1][j] = ch_data->env_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
- }
- }
-
- //assign 0th elements of env_facs from last elements
- memcpy(ch_data->env_facs[0], ch_data->env_facs[ch_data->bs_num_env],
- sizeof(ch_data->env_facs[0]));
-}
-
-static void read_sbr_noise(SpectralBandReplication *sbr, GetBitContext *gb,
- SBRData *ch_data, int ch)
-{
- int i, j;
- VLC_TYPE (*t_huff)[2], (*f_huff)[2];
- int t_lav, f_lav;
- int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
-
- if (sbr->bs_coupling && ch) {
- t_huff = vlc_sbr[T_HUFFMAN_NOISE_BAL_3_0DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_BAL_3_0DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
- } else {
- t_huff = vlc_sbr[T_HUFFMAN_NOISE_3_0DB].table;
- t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_3_0DB];
- f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
- f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
- }
-
- for (i = 0; i < ch_data->bs_num_noise; i++) {
- if (ch_data->bs_df_noise[i]) {
- for (j = 0; j < sbr->n_q; j++)
- ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav);
- } else {
- ch_data->noise_facs[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level
- for (j = 1; j < sbr->n_q; j++)
- ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
- }
- }
-
- //assign 0th elements of noise_facs from last elements
- memcpy(ch_data->noise_facs[0], ch_data->noise_facs[ch_data->bs_num_noise],
- sizeof(ch_data->noise_facs[0]));
-}
-
-static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
- GetBitContext *gb,
- int bs_extension_id, int *num_bits_left)
-{
- switch (bs_extension_id) {
- case EXTENSION_ID_PS:
- if (!ac->oc[1].m4ac.ps) {
- av_log(ac->avctx, AV_LOG_ERROR, "Parametric Stereo signaled to be not-present but was found in the bitstream.\n");
- skip_bits_long(gb, *num_bits_left); // bs_fill_bits
- *num_bits_left = 0;
- } else {
-#if 1
- *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps, *num_bits_left);
- ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
-#else
- avpriv_report_missing_feature(ac->avctx, "Parametric Stereo");
- skip_bits_long(gb, *num_bits_left); // bs_fill_bits
- *num_bits_left = 0;
-#endif
- }
- break;
- default:
- // some files contain 0-padding
- if (bs_extension_id || *num_bits_left > 16 || show_bits(gb, *num_bits_left))
- avpriv_request_sample(ac->avctx, "Reserved SBR extensions");
- skip_bits_long(gb, *num_bits_left); // bs_fill_bits
- *num_bits_left = 0;
- break;
- }
-}
-
-static int read_sbr_single_channel_element(AACContext *ac,
- SpectralBandReplication *sbr,
- GetBitContext *gb)
-{
- if (get_bits1(gb)) // bs_data_extra
- skip_bits(gb, 4); // bs_reserved
-
- if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
- return -1;
- read_sbr_dtdf(sbr, gb, &sbr->data[0]);
- read_sbr_invf(sbr, gb, &sbr->data[0]);
- read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
- read_sbr_noise(sbr, gb, &sbr->data[0], 0);
-
- if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
- get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
-
- return 0;
-}
-
-static int read_sbr_channel_pair_element(AACContext *ac,
- SpectralBandReplication *sbr,
- GetBitContext *gb)
-{
- if (get_bits1(gb)) // bs_data_extra
- skip_bits(gb, 8); // bs_reserved
-
- if ((sbr->bs_coupling = get_bits1(gb))) {
- if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
- return -1;
- copy_sbr_grid(&sbr->data[1], &sbr->data[0]);
- read_sbr_dtdf(sbr, gb, &sbr->data[0]);
- read_sbr_dtdf(sbr, gb, &sbr->data[1]);
- read_sbr_invf(sbr, gb, &sbr->data[0]);
- memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
- memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
- read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
- read_sbr_noise(sbr, gb, &sbr->data[0], 0);
- read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
- read_sbr_noise(sbr, gb, &sbr->data[1], 1);
- } else {
- if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]) ||
- read_sbr_grid(ac, sbr, gb, &sbr->data[1]))
- return -1;
- read_sbr_dtdf(sbr, gb, &sbr->data[0]);
- read_sbr_dtdf(sbr, gb, &sbr->data[1]);
- read_sbr_invf(sbr, gb, &sbr->data[0]);
- read_sbr_invf(sbr, gb, &sbr->data[1]);
- read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
- read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
- read_sbr_noise(sbr, gb, &sbr->data[0], 0);
- read_sbr_noise(sbr, gb, &sbr->data[1], 1);
- }
-
- if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
- get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
- if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb)))
- get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]);
-
- return 0;
-}
-
-static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
- GetBitContext *gb, int id_aac)
-{
- unsigned int cnt = get_bits_count(gb);
-
- if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
- if (read_sbr_single_channel_element(ac, sbr, gb)) {
- sbr_turnoff(sbr);
- return get_bits_count(gb) - cnt;
- }
- } else if (id_aac == TYPE_CPE) {
- if (read_sbr_channel_pair_element(ac, sbr, gb)) {
- sbr_turnoff(sbr);
- return get_bits_count(gb) - cnt;
- }
- } else {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);
- sbr_turnoff(sbr);
- return get_bits_count(gb) - cnt;
- }
- if (get_bits1(gb)) { // bs_extended_data
- int num_bits_left = get_bits(gb, 4); // bs_extension_size
- if (num_bits_left == 15)
- num_bits_left += get_bits(gb, 8); // bs_esc_count
-
- num_bits_left <<= 3;
- while (num_bits_left > 7) {
- num_bits_left -= 2;
- read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id
- }
- if (num_bits_left < 0) {
- av_log(ac->avctx, AV_LOG_ERROR, "SBR Extension over read.\n");
- }
- if (num_bits_left > 0)
- skip_bits(gb, num_bits_left);
- }
-
- return get_bits_count(gb) - cnt;
-}
-
-static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr)
-{
- int err;
- err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params);
- if (err >= 0)
- err = sbr_make_f_derived(ac, sbr);
- if (err < 0) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "SBR reset failed. Switching SBR to pure upsampling mode.\n");
- sbr_turnoff(sbr);
- }
-}
-
-/**
- * Decode Spectral Band Replication extension data; reference: table 4.55.
- *
- * @param crc flag indicating the presence of CRC checksum
- * @param cnt length of TYPE_FIL syntactic element in bytes
- *
- * @return Returns number of bytes consumed from the TYPE_FIL element.
- */
-int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
- GetBitContext *gb_host, int crc, int cnt, int id_aac)
-{
- unsigned int num_sbr_bits = 0, num_align_bits;
- unsigned bytes_read;
- GetBitContext gbc = *gb_host, *gb = &gbc;
- skip_bits_long(gb_host, cnt*8 - 4);
-
- sbr->reset = 0;
-
- if (!sbr->sample_rate)
- sbr->sample_rate = 2 * ac->oc[1].m4ac.sample_rate; //TODO use the nominal sample rate for arbitrary sample rate support
- if (!ac->oc[1].m4ac.ext_sample_rate)
- ac->oc[1].m4ac.ext_sample_rate = 2 * ac->oc[1].m4ac.sample_rate;
-
- if (crc) {
- skip_bits(gb, 10); // bs_sbr_crc_bits; TODO - implement CRC check
- num_sbr_bits += 10;
- }
-
- //Save some state from the previous frame.
- sbr->kx[0] = sbr->kx[1];
- sbr->m[0] = sbr->m[1];
- sbr->kx_and_m_pushed = 1;
-
- num_sbr_bits++;
- if (get_bits1(gb)) // bs_header_flag
- num_sbr_bits += read_sbr_header(sbr, gb);
-
- if (sbr->reset)
- sbr_reset(ac, sbr);
-
- if (sbr->start)
- num_sbr_bits += read_sbr_data(ac, sbr, gb, id_aac);
-
- num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7;
- bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3);
-
- if (bytes_read > cnt) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_read);
- }
- return cnt;
-}
-
/// Dequantization and stereo decoding (14496-3 sp04 p203)
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
{
@@ -1179,84 +126,6 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
}
}
-/**
- * Analysis QMF Bank (14496-3 sp04 p206)
- *
- * @param x pointer to the beginning of the first sample window
- * @param W array of complex-valued samples split into subbands
- */
-#ifndef sbr_qmf_analysis
-static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
- SBRDSPContext *sbrdsp, const float *in, float *x,
- float z[320], float W[2][32][32][2], int buf_idx)
-{
- int i;
- memcpy(x , x+1024, (320-32)*sizeof(x[0]));
- memcpy(x+288, in, 1024*sizeof(x[0]));
- for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
- // are not supported
- dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
- sbrdsp->sum64x5(z);
- sbrdsp->qmf_pre_shuffle(z);
- mdct->imdct_half(mdct, z, z+64);
- sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
- x += 32;
- }
-}
-#endif
-
-/**
- * Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank
- * (14496-3 sp04 p206)
- */
-#ifndef sbr_qmf_synthesis
-static void sbr_qmf_synthesis(FFTContext *mdct,
- SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp,
- float *out, float X[2][38][64],
- float mdct_buf[2][64],
- float *v0, int *v_off, const unsigned int div)
-{
- int i, n;
- const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
- const int step = 128 >> div;
- float *v;
- for (i = 0; i < 32; i++) {
- if (*v_off < step) {
- int saved_samples = (1280 - 128) >> div;
- memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
- *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
- } else {
- *v_off -= step;
- }
- v = v0 + *v_off;
- if (div) {
- for (n = 0; n < 32; n++) {
- X[0][i][ n] = -X[0][i][n];
- X[0][i][32+n] = X[1][i][31-n];
- }
- mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
- sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
- } else {
- sbrdsp->neg_odd_64(X[1][i]);
- mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
- mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
- sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
- }
- dsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 512 >> div), sbr_qmf_window + (256 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 704 >> div), sbr_qmf_window + (320 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 768 >> div), sbr_qmf_window + (384 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + ( 960 >> div), sbr_qmf_window + (448 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + (1024 >> div), sbr_qmf_window + (512 >> div), out , 64 >> div);
- dsp->vector_fmul_add(out, v + (1216 >> div), sbr_qmf_window + (576 >> div), out , 64 >> div);
- out += 64 >> div;
- }
-}
-#endif
-
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
* (14496-3 sp04 p214)
* Warning: This routine does not seem numerically stable.
@@ -1336,203 +205,6 @@ static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data)
}
}
-/// Generate the subband filtered lowband
-static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr,
- float X_low[32][40][2], const float W[2][32][32][2],
- int buf_idx)
-{
- int i, k;
- const int t_HFGen = 8;
- const int i_f = 32;
- memset(X_low, 0, 32*sizeof(*X_low));
- for (k = 0; k < sbr->kx[1]; k++) {
- for (i = t_HFGen; i < i_f + t_HFGen; i++) {
- X_low[k][i][0] = W[buf_idx][i - t_HFGen][k][0];
- X_low[k][i][1] = W[buf_idx][i - t_HFGen][k][1];
- }
- }
- buf_idx = 1-buf_idx;
- for (k = 0; k < sbr->kx[0]; k++) {
- for (i = 0; i < t_HFGen; i++) {
- X_low[k][i][0] = W[buf_idx][i + i_f - t_HFGen][k][0];
- X_low[k][i][1] = W[buf_idx][i + i_f - t_HFGen][k][1];
- }
- }
- return 0;
-}
-
-/// High Frequency Generator (14496-3 sp04 p215)
-static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr,
- float X_high[64][40][2], const float X_low[32][40][2],
- const float (*alpha0)[2], const float (*alpha1)[2],
- const float bw_array[5], const uint8_t *t_env,
- int bs_num_env)
-{
- int j, x;
- int g = 0;
- int k = sbr->kx[1];
- for (j = 0; j < sbr->num_patches; j++) {
- for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) {
- const int p = sbr->patch_start_subband[j] + x;
- while (g <= sbr->n_q && k >= sbr->f_tablenoise[g])
- g++;
- g--;
-
- if (g < 0) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "ERROR : no subband found for frequency %d\n", k);
- return -1;
- }
-
- sbr->dsp.hf_gen(X_high[k] + ENVELOPE_ADJUSTMENT_OFFSET,
- X_low[p] + ENVELOPE_ADJUSTMENT_OFFSET,
- alpha0[p], alpha1[p], bw_array[g],
- 2 * t_env[0], 2 * t_env[bs_num_env]);
- }
- }
- if (k < sbr->m[1] + sbr->kx[1])
- memset(X_high + k, 0, (sbr->m[1] + sbr->kx[1] - k) * sizeof(*X_high));
-
- return 0;
-}
-
-/// Generate the subband filtered lowband
-static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64],
- const float Y0[38][64][2], const float Y1[38][64][2],
- const float X_low[32][40][2], int ch)
-{
- int k, i;
- const int i_f = 32;
- const int i_Temp = FFMAX(2*sbr->data[ch].t_env_num_env_old - i_f, 0);
- memset(X, 0, 2*sizeof(*X));
- for (k = 0; k < sbr->kx[0]; k++) {
- for (i = 0; i < i_Temp; i++) {
- X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
- X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
- }
- }
- for (; k < sbr->kx[0] + sbr->m[0]; k++) {
- for (i = 0; i < i_Temp; i++) {
- X[0][i][k] = Y0[i + i_f][k][0];
- X[1][i][k] = Y0[i + i_f][k][1];
- }
- }
-
- for (k = 0; k < sbr->kx[1]; k++) {
- for (i = i_Temp; i < 38; i++) {
- X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
- X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
- }
- }
- for (; k < sbr->kx[1] + sbr->m[1]; k++) {
- for (i = i_Temp; i < i_f; i++) {
- X[0][i][k] = Y1[i][k][0];
- X[1][i][k] = Y1[i][k][1];
- }
- }
- return 0;
-}
-
-/** High Frequency Adjustment (14496-3 sp04 p217) and Mapping
- * (14496-3 sp04 p217)
- */
-static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
- SBRData *ch_data, int e_a[2])
-{
- int e, i, m;
-
- memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1]));
- for (e = 0; e < ch_data->bs_num_env; e++) {
- const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]];
- uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
- int k;
-
- if (sbr->kx[1] != table[0]) {
- av_log(ac->avctx, AV_LOG_ERROR, "kx != f_table{high,low}[0]. "
- "Derived frequency tables were not regenerated.\n");
- sbr_turnoff(sbr);
- return AVERROR_BUG;
- }
- for (i = 0; i < ilim; i++)
- for (m = table[i]; m < table[i + 1]; m++)
- sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];
-
- // ch_data->bs_num_noise > 1 => 2 noise floors
- k = (ch_data->bs_num_noise > 1) && (ch_data->t_env[e] >= ch_data->t_q[1]);
- for (i = 0; i < sbr->n_q; i++)
- for (m = sbr->f_tablenoise[i]; m < sbr->f_tablenoise[i + 1]; m++)
- sbr->q_mapped[e][m - sbr->kx[1]] = ch_data->noise_facs[k+1][i];
-
- for (i = 0; i < sbr->n[1]; i++) {
- if (ch_data->bs_add_harmonic_flag) {
- const unsigned int m_midpoint =
- (sbr->f_tablehigh[i] + sbr->f_tablehigh[i + 1]) >> 1;
-
- ch_data->s_indexmapped[e + 1][m_midpoint - sbr->kx[1]] = ch_data->bs_add_harmonic[i] *
- (e >= e_a[1] || (ch_data->s_indexmapped[0][m_midpoint - sbr->kx[1]] == 1));
- }
- }
-
- for (i = 0; i < ilim; i++) {
- int additional_sinusoid_present = 0;
- for (m = table[i]; m < table[i + 1]; m++) {
- if (ch_data->s_indexmapped[e + 1][m - sbr->kx[1]]) {
- additional_sinusoid_present = 1;
- break;
- }
- }
- memset(&sbr->s_mapped[e][table[i] - sbr->kx[1]], additional_sinusoid_present,
- (table[i + 1] - table[i]) * sizeof(sbr->s_mapped[e][0]));
- }
- }
-
- memcpy(ch_data->s_indexmapped[0], ch_data->s_indexmapped[ch_data->bs_num_env], sizeof(ch_data->s_indexmapped[0]));
- return 0;
-}
-
-/// Estimation of current envelope (14496-3 sp04 p218)
-static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
- SpectralBandReplication *sbr, SBRData *ch_data)
-{
- int e, m;
- int kx1 = sbr->kx[1];
-
- if (sbr->bs_interpol_freq) {
- for (e = 0; e < ch_data->bs_num_env; e++) {
- const float recip_env_size = 0.5f / (ch_data->t_env[e + 1] - ch_data->t_env[e]);
- int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
- int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
-
- for (m = 0; m < sbr->m[1]; m++) {
- float sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
- e_curr[e][m] = sum * recip_env_size;
- }
- }
- } else {
- int k, p;
-
- for (e = 0; e < ch_data->bs_num_env; e++) {
- const int env_size = 2 * (ch_data->t_env[e + 1] - ch_data->t_env[e]);
- int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
- int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
- const uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
-
- for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
- float sum = 0.0f;
- const int den = env_size * (table[p + 1] - table[p]);
-
- for (k = table[p]; k < table[p + 1]; k++) {
- sum += sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb);
- }
- sum /= den;
- for (k = table[p]; k < table[p + 1]; k++) {
- e_curr[e][k - kx1] = sum;
- }
- }
- }
- }
-}
-
/**
* Calculation of levels of additional HF signal components (14496-3 sp04 p219)
* and Calculation of gain (14496-3 sp04 p219)
@@ -1687,92 +359,4 @@ static void sbr_hf_assemble(float Y1[38][64][2],
ch_data->f_indexsine = indexsine;
}
-void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
- float* L, float* R)
-{
- int downsampled = ac->oc[1].m4ac.ext_sample_rate < sbr->sample_rate;
- int ch;
- int nch = (id_aac == TYPE_CPE) ? 2 : 1;
- int err;
-
- if (!sbr->kx_and_m_pushed) {
- sbr->kx[0] = sbr->kx[1];
- sbr->m[0] = sbr->m[1];
- } else {
- sbr->kx_and_m_pushed = 0;
- }
-
- if (sbr->start) {
- sbr_dequant(sbr, id_aac);
- }
- for (ch = 0; ch < nch; ch++) {
- /* decode channel */
- sbr_qmf_analysis(ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
- (float*)sbr->qmf_filter_scratch,
- sbr->data[ch].W, sbr->data[ch].Ypos);
- sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low,
- (const float (*)[32][32][2]) sbr->data[ch].W,
- sbr->data[ch].Ypos);
- sbr->data[ch].Ypos ^= 1;
- if (sbr->start) {
- sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1,
- (const float (*)[40][2]) sbr->X_low, sbr->k[0]);
- sbr_chirp(sbr, &sbr->data[ch]);
- sbr_hf_gen(ac, sbr, sbr->X_high,
- (const float (*)[40][2]) sbr->X_low,
- (const float (*)[2]) sbr->alpha0,
- (const float (*)[2]) sbr->alpha1,
- sbr->data[ch].bw_array, sbr->data[ch].t_env,
- sbr->data[ch].bs_num_env);
-
- // hf_adj
- err = sbr_mapping(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
- if (!err) {
- sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]);
- sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
- sbr->c.sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
- (const float (*)[40][2]) sbr->X_high,
- sbr, &sbr->data[ch],
- sbr->data[ch].e_a);
- }
- }
-
- /* synthesis */
- sbr->c.sbr_x_gen(sbr, sbr->X[ch],
- (const float (*)[64][2]) sbr->data[ch].Y[1-sbr->data[ch].Ypos],
- (const float (*)[64][2]) sbr->data[ch].Y[ sbr->data[ch].Ypos],
- (const float (*)[40][2]) sbr->X_low, ch);
- }
-
- if (ac->oc[1].m4ac.ps == 1) {
- if (sbr->ps.start) {
- ff_ps_apply(ac->avctx, &sbr->ps, sbr->X[0], sbr->X[1], sbr->kx[1] + sbr->m[1]);
- } else {
- memcpy(sbr->X[1], sbr->X[0], sizeof(sbr->X[0]));
- }
- nch = 2;
- }
-
- sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
- L, sbr->X[0], sbr->qmf_filter_scratch,
- sbr->data[0].synthesis_filterbank_samples,
- &sbr->data[0].synthesis_filterbank_samples_offset,
- downsampled);
- if (nch == 2)
- sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
- R, sbr->X[1], sbr->qmf_filter_scratch,
- sbr->data[1].synthesis_filterbank_samples,
- &sbr->data[1].synthesis_filterbank_samples_offset,
- downsampled);
-}
-
-static void aacsbr_func_ptr_init(AACSBRContext *c)
-{
- c->sbr_lf_gen = sbr_lf_gen;
- c->sbr_hf_assemble = sbr_hf_assemble;
- c->sbr_x_gen = sbr_x_gen;
- c->sbr_hf_inverse_filter = sbr_hf_inverse_filter;
-
- if(ARCH_MIPS)
- ff_aacsbr_func_ptr_init_mips(c);
-}
+#include "aacsbr_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr.h b/chromium/third_party/ffmpeg/libavcodec/aacsbr.h
index f5e33ab6882..ed1a7f9265f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacsbr.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr.h
@@ -33,18 +33,63 @@
#include "aac.h"
#include "sbr.h"
+#define ENVELOPE_ADJUSTMENT_OFFSET 2
+#define NOISE_FLOOR_OFFSET FIXR(6.0f)
+
+/**
+ * SBR VLC tables
+ */
+enum {
+ T_HUFFMAN_ENV_1_5DB,
+ F_HUFFMAN_ENV_1_5DB,
+ T_HUFFMAN_ENV_BAL_1_5DB,
+ F_HUFFMAN_ENV_BAL_1_5DB,
+ T_HUFFMAN_ENV_3_0DB,
+ F_HUFFMAN_ENV_3_0DB,
+ T_HUFFMAN_ENV_BAL_3_0DB,
+ F_HUFFMAN_ENV_BAL_3_0DB,
+ T_HUFFMAN_NOISE_3_0DB,
+ T_HUFFMAN_NOISE_BAL_3_0DB,
+};
+
+/**
+ * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
+ */
+enum {
+ FIXFIX,
+ FIXVAR,
+ VARFIX,
+ VARVAR,
+};
+
+enum {
+ EXTENSION_ID_PS = 2,
+};
+
+static const int8_t vlc_sbr_lav[10] =
+ { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 };
+
+#define SBR_INIT_VLC_STATIC(num, size) \
+ INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \
+ sbr_tmp[num].sbr_bits , 1, 1, \
+ sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \
+ size)
+
+#define SBR_VLC_ROW(name) \
+ { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
+
/** Initialize SBR. */
-void ff_aac_sbr_init(void);
+void AAC_RENAME(ff_aac_sbr_init)(void);
/** Initialize one SBR context. */
-void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
+void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr);
/** Close one SBR context. */
-void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
+void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr);
/** Decode one SBR element. */
-int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
+int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, SpectralBandReplication *sbr,
GetBitContext *gb, int crc, int cnt, int id_aac);
/** Apply one SBR element to one AAC element. */
-void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
- float* L, float *R);
+void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
+ INTFLOAT* L, INTFLOAT *R);
void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed.c b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed.c
new file mode 100644
index 00000000000..e0480693593
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed.c
@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) 2013
+ * MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * AAC Spectral Band Replication decoding functions (fixed-point)
+ * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
+ * Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * AAC Spectral Band Replication decoding functions (fixed-point)
+ * Note: Rounding-to-nearest used unless otherwise stated
+ * @author Robert Swain ( rob opendot cl )
+ * @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
+ */
+#define USE_FIXED 1
+
+#include "aac.h"
+#include "sbr.h"
+#include "aacsbr.h"
+#include "aacsbrdata.h"
+#include "aacsbr_fixed_tablegen.h"
+#include "fft.h"
+#include "aacps.h"
+#include "sbrdsp.h"
+#include "libavutil/internal.h"
+#include "libavutil/libm.h"
+#include "libavutil/avassert.h"
+
+#include <stdint.h>
+#include <float.h>
+#include <math.h>
+
+static VLC vlc_sbr[10];
+static void aacsbr_func_ptr_init(AACSBRContext *c);
+static const int CONST_LN2 = Q31(0.6931471806/256); // ln(2)/256
+static const int CONST_RECIP_LN2 = Q31(0.7213475204); // 0.5/ln(2)
+static const int CONST_076923 = Q31(0.76923076923076923077f);
+
+static const int fixed_log_table[10] =
+{
+ Q31(1.0/2), Q31(1.0/3), Q31(1.0/4), Q31(1.0/5), Q31(1.0/6),
+ Q31(1.0/7), Q31(1.0/8), Q31(1.0/9), Q31(1.0/10), Q31(1.0/11)
+};
+
+static int fixed_log(int x)
+{
+ int i, ret, xpow, tmp;
+
+ ret = x;
+ xpow = x;
+ for (i=0; i<10; i+=2){
+ xpow = (int)(((int64_t)xpow * x + 0x40000000) >> 31);
+ tmp = (int)(((int64_t)xpow * fixed_log_table[i] + 0x40000000) >> 31);
+ ret -= tmp;
+
+ xpow = (int)(((int64_t)xpow * x + 0x40000000) >> 31);
+ tmp = (int)(((int64_t)xpow * fixed_log_table[i+1] + 0x40000000) >> 31);
+ ret += tmp;
+ }
+
+ return ret;
+}
+
+static const int fixed_exp_table[7] =
+{
+ Q31(1.0/2), Q31(1.0/6), Q31(1.0/24), Q31(1.0/120),
+ Q31(1.0/720), Q31(1.0/5040), Q31(1.0/40320)
+};
+
+static int fixed_exp(int x)
+{
+ int i, ret, xpow, tmp;
+
+ ret = 0x800000 + x;
+ xpow = x;
+ for (i=0; i<7; i++){
+ xpow = (int)(((int64_t)xpow * x + 0x400000) >> 23);
+ tmp = (int)(((int64_t)xpow * fixed_exp_table[i] + 0x40000000) >> 31);
+ ret += tmp;
+ }
+
+ return ret;
+}
+
+static void make_bands(int16_t* bands, int start, int stop, int num_bands)
+{
+ int k, previous, present;
+ int base, prod, nz = 0;
+
+ base = (stop << 23) / start;
+ while (base < 0x40000000){
+ base <<= 1;
+ nz++;
+ }
+ base = fixed_log(base - 0x80000000);
+ base = (((base + 0x80) >> 8) + (8-nz)*CONST_LN2) / num_bands;
+ base = fixed_exp(base);
+
+ previous = start;
+ prod = start << 23;
+
+ for (k = 0; k < num_bands-1; k++) {
+ prod = (int)(((int64_t)prod * base + 0x400000) >> 23);
+ present = (prod + 0x400000) >> 23;
+ bands[k] = present - previous;
+ previous = present;
+ }
+ bands[num_bands-1] = stop - previous;
+}
+
+/// Dequantization and stereo decoding (14496-3 sp04 p203)
+static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
+{
+ int k, e;
+ int ch;
+
+ if (id_aac == TYPE_CPE && sbr->bs_coupling) {
+ int alpha = sbr->data[0].bs_amp_res ? 2 : 1;
+ int pan_offset = sbr->data[0].bs_amp_res ? 12 : 24;
+ for (e = 1; e <= sbr->data[0].bs_num_env; e++) {
+ for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
+ SoftFloat temp1, temp2, fac;
+
+ temp1.exp = sbr->data[0].env_facs[e][k].mant * alpha + 14;
+ if (temp1.exp & 1)
+ temp1.mant = 759250125;
+ else
+ temp1.mant = 0x20000000;
+ temp1.exp = (temp1.exp >> 1) + 1;
+
+ temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * alpha;
+ if (temp2.exp & 1)
+ temp2.mant = 759250125;
+ else
+ temp2.mant = 0x20000000;
+ temp2.exp = (temp2.exp >> 1) + 1;
+ fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
+ sbr->data[0].env_facs[e][k] = fac;
+ sbr->data[1].env_facs[e][k] = av_mul_sf(fac, temp2);
+ }
+ }
+ for (e = 1; e <= sbr->data[0].bs_num_noise; e++) {
+ for (k = 0; k < sbr->n_q; k++) {
+ SoftFloat temp1, temp2, fac;
+
+ temp1.exp = NOISE_FLOOR_OFFSET - \
+ sbr->data[0].noise_facs[e][k].mant + 2;
+ temp1.mant = 0x20000000;
+ temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1;
+ temp2.mant = 0x20000000;
+ fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
+ sbr->data[0].noise_facs[e][k] = fac;
+ sbr->data[1].noise_facs[e][k] = av_mul_sf(fac, temp2);
+ }
+ }
+ } else { // SCE or one non-coupled CPE
+ for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
+ int alpha = sbr->data[ch].bs_amp_res ? 2 : 1;
+ for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
+ for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
+ SoftFloat temp1;
+
+ temp1.exp = alpha * sbr->data[ch].env_facs[e][k].mant + 12;
+ if (temp1.exp & 1)
+ temp1.mant = 759250125;
+ else
+ temp1.mant = 0x20000000;
+ temp1.exp = (temp1.exp >> 1) + 1;
+
+ sbr->data[ch].env_facs[e][k] = temp1;
+ }
+ for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
+ for (k = 0; k < sbr->n_q; k++){
+ sbr->data[ch].noise_facs[e][k].exp = NOISE_FLOOR_OFFSET - \
+ sbr->data[ch].noise_facs[e][k].mant + 1;
+ sbr->data[ch].noise_facs[e][k].mant = 0x20000000;
+ }
+ }
+ }
+}
+
+/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
+ * (14496-3 sp04 p214)
+ * Warning: This routine does not seem numerically stable.
+ */
+static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
+ int (*alpha0)[2], int (*alpha1)[2],
+ const int X_low[32][40][2], int k0)
+{
+ int k;
+ int shift, round;
+
+ for (k = 0; k < k0; k++) {
+ SoftFloat phi[3][2][2];
+ SoftFloat a00, a01, a10, a11;
+ SoftFloat dk;
+
+ dsp->autocorrelate(X_low[k], phi);
+
+ dk = av_sub_sf(av_mul_sf(phi[2][1][0], phi[1][0][0]),
+ av_mul_sf(av_add_sf(av_mul_sf(phi[1][1][0], phi[1][1][0]),
+ av_mul_sf(phi[1][1][1], phi[1][1][1])), FLOAT_0999999));
+
+ if (!dk.mant) {
+ a10 = FLOAT_0;
+ a11 = FLOAT_0;
+ } else {
+ SoftFloat temp_real, temp_im;
+ temp_real = av_sub_sf(av_sub_sf(av_mul_sf(phi[0][0][0], phi[1][1][0]),
+ av_mul_sf(phi[0][0][1], phi[1][1][1])),
+ av_mul_sf(phi[0][1][0], phi[1][0][0]));
+ temp_im = av_sub_sf(av_add_sf(av_mul_sf(phi[0][0][0], phi[1][1][1]),
+ av_mul_sf(phi[0][0][1], phi[1][1][0])),
+ av_mul_sf(phi[0][1][1], phi[1][0][0]));
+
+ a10 = av_div_sf(temp_real, dk);
+ a11 = av_div_sf(temp_im, dk);
+ }
+
+ if (!phi[1][0][0].mant) {
+ a00 = FLOAT_0;
+ a01 = FLOAT_0;
+ } else {
+ SoftFloat temp_real, temp_im;
+ temp_real = av_add_sf(phi[0][0][0],
+ av_add_sf(av_mul_sf(a10, phi[1][1][0]),
+ av_mul_sf(a11, phi[1][1][1])));
+ temp_im = av_add_sf(phi[0][0][1],
+ av_sub_sf(av_mul_sf(a11, phi[1][1][0]),
+ av_mul_sf(a10, phi[1][1][1])));
+
+ temp_real.mant = -temp_real.mant;
+ temp_im.mant = -temp_im.mant;
+ a00 = av_div_sf(temp_real, phi[1][0][0]);
+ a01 = av_div_sf(temp_im, phi[1][0][0]);
+ }
+
+ shift = a00.exp;
+ if (shift >= 3)
+ alpha0[k][0] = 0x7fffffff;
+ else {
+ a00.mant <<= 1;
+ shift = 2-shift;
+ if (shift == 0)
+ alpha0[k][0] = a00.mant;
+ else {
+ round = 1 << (shift-1);
+ alpha0[k][0] = (a00.mant + round) >> shift;
+ }
+ }
+
+ shift = a01.exp;
+ if (shift >= 3)
+ alpha0[k][1] = 0x7fffffff;
+ else {
+ a01.mant <<= 1;
+ shift = 2-shift;
+ if (shift == 0)
+ alpha0[k][1] = a01.mant;
+ else {
+ round = 1 << (shift-1);
+ alpha0[k][1] = (a01.mant + round) >> shift;
+ }
+ }
+ shift = a10.exp;
+ if (shift >= 3)
+ alpha1[k][0] = 0x7fffffff;
+ else {
+ a10.mant <<= 1;
+ shift = 2-shift;
+ if (shift == 0)
+ alpha1[k][0] = a10.mant;
+ else {
+ round = 1 << (shift-1);
+ alpha1[k][0] = (a10.mant + round) >> shift;
+ }
+ }
+
+ shift = a11.exp;
+ if (shift >= 3)
+ alpha1[k][1] = 0x7fffffff;
+ else {
+ a11.mant <<= 1;
+ shift = 2-shift;
+ if (shift == 0)
+ alpha1[k][1] = a11.mant;
+ else {
+ round = 1 << (shift-1);
+ alpha1[k][1] = (a11.mant + round) >> shift;
+ }
+ }
+
+ shift = (int)(((int64_t)(alpha1[k][0]>>1) * (alpha1[k][0]>>1) + \
+ (int64_t)(alpha1[k][1]>>1) * (alpha1[k][1]>>1) + \
+ 0x40000000) >> 31);
+ if (shift >= 0x20000000){
+ alpha1[k][0] = 0;
+ alpha1[k][1] = 0;
+ alpha0[k][0] = 0;
+ alpha0[k][1] = 0;
+ }
+
+ shift = (int)(((int64_t)(alpha0[k][0]>>1) * (alpha0[k][0]>>1) + \
+ (int64_t)(alpha0[k][1]>>1) * (alpha0[k][1]>>1) + \
+ 0x40000000) >> 31);
+ if (shift >= 0x20000000){
+ alpha1[k][0] = 0;
+ alpha1[k][1] = 0;
+ alpha0[k][0] = 0;
+ alpha0[k][1] = 0;
+ }
+ }
+}
+
+/// Chirp Factors (14496-3 sp04 p214)
+static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data)
+{
+ int i;
+ int new_bw;
+ static const int bw_tab[] = { 0, 1610612736, 1932735283, 2104533975 };
+ int64_t accu;
+
+ for (i = 0; i < sbr->n_q; i++) {
+ if (ch_data->bs_invf_mode[0][i] + ch_data->bs_invf_mode[1][i] == 1)
+ new_bw = 1288490189;
+ else
+ new_bw = bw_tab[ch_data->bs_invf_mode[0][i]];
+
+ if (new_bw < ch_data->bw_array[i]){
+ accu = (int64_t)new_bw * 1610612736;
+ accu += (int64_t)ch_data->bw_array[i] * 0x20000000;
+ new_bw = (int)((accu + 0x40000000) >> 31);
+ } else {
+ accu = (int64_t)new_bw * 1946157056;
+ accu += (int64_t)ch_data->bw_array[i] * 201326592;
+ new_bw = (int)((accu + 0x40000000) >> 31);
+ }
+ ch_data->bw_array[i] = new_bw < 0x2000000 ? 0 : new_bw;
+ }
+}
+
+/**
+ * Calculation of levels of additional HF signal components (14496-3 sp04 p219)
+ * and Calculation of gain (14496-3 sp04 p219)
+ */
+static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
+ SBRData *ch_data, const int e_a[2])
+{
+ int e, k, m;
+ // max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off)
+ static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 },
+ { 758351638, 1 }, { 625000000, 34 } };
+
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+ int delta = !((e == e_a[1]) || (e == e_a[0]));
+ for (k = 0; k < sbr->n_lim; k++) {
+ SoftFloat gain_boost, gain_max;
+ SoftFloat sum[2] = { { 0, 0}, { 0, 0 } };
+ for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
+ const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m],
+ av_add_sf(FLOAT_1, sbr->q_mapped[e][m]));
+ sbr->q_m[e][m] = av_sqrt_sf(av_mul_sf(temp, sbr->q_mapped[e][m]));
+ sbr->s_m[e][m] = av_sqrt_sf(av_mul_sf(temp, av_int2sf(ch_data->s_indexmapped[e + 1][m], 0)));
+ if (!sbr->s_mapped[e][m]) {
+ if (delta) {
+ sbr->gain[e][m] = av_sqrt_sf(av_div_sf(sbr->e_origmapped[e][m],
+ av_mul_sf(av_add_sf(FLOAT_1, sbr->e_curr[e][m]),
+ av_add_sf(FLOAT_1, sbr->q_mapped[e][m]))));
+ } else {
+ sbr->gain[e][m] = av_sqrt_sf(av_div_sf(sbr->e_origmapped[e][m],
+ av_add_sf(FLOAT_1, sbr->e_curr[e][m])));
+ }
+ } else {
+ sbr->gain[e][m] = av_sqrt_sf(
+ av_div_sf(
+ av_mul_sf(sbr->e_origmapped[e][m], sbr->q_mapped[e][m]),
+ av_mul_sf(
+ av_add_sf(FLOAT_1, sbr->e_curr[e][m]),
+ av_add_sf(FLOAT_1, sbr->q_mapped[e][m]))));
+ }
+ }
+ for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
+ sum[0] = av_add_sf(sum[0], sbr->e_origmapped[e][m]);
+ sum[1] = av_add_sf(sum[1], sbr->e_curr[e][m]);
+ }
+ gain_max = av_mul_sf(limgain[sbr->bs_limiter_gains],
+ av_sqrt_sf(
+ av_div_sf(
+ av_add_sf(FLOAT_EPSILON, sum[0]),
+ av_add_sf(FLOAT_EPSILON, sum[1]))));
+ if (av_gt_sf(gain_max, FLOAT_100000))
+ gain_max = FLOAT_100000;
+ for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
+ SoftFloat q_m_max = av_div_sf(
+ av_mul_sf(sbr->q_m[e][m], gain_max),
+ sbr->gain[e][m]);
+ if (av_gt_sf(sbr->q_m[e][m], q_m_max))
+ sbr->q_m[e][m] = q_m_max;
+ if (av_gt_sf(sbr->gain[e][m], gain_max))
+ sbr->gain[e][m] = gain_max;
+ }
+ sum[0] = sum[1] = FLOAT_0;
+ for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
+ sum[0] = av_add_sf(sum[0], sbr->e_origmapped[e][m]);
+ sum[1] = av_add_sf(sum[1],
+ av_mul_sf(
+ av_mul_sf(sbr->e_curr[e][m],
+ sbr->gain[e][m]),
+ sbr->gain[e][m]));
+ sum[1] = av_add_sf(sum[1],
+ av_mul_sf(sbr->s_m[e][m], sbr->s_m[e][m]));
+ if (delta && !sbr->s_m[e][m].mant)
+ sum[1] = av_add_sf(sum[1],
+ av_mul_sf(sbr->q_m[e][m], sbr->q_m[e][m]));
+ }
+ gain_boost = av_sqrt_sf(
+ av_div_sf(
+ av_add_sf(FLOAT_EPSILON, sum[0]),
+ av_add_sf(FLOAT_EPSILON, sum[1])));
+ if (av_gt_sf(gain_boost, FLOAT_1584893192))
+ gain_boost = FLOAT_1584893192;
+
+ for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
+ sbr->gain[e][m] = av_mul_sf(sbr->gain[e][m], gain_boost);
+ sbr->q_m[e][m] = av_mul_sf(sbr->q_m[e][m], gain_boost);
+ sbr->s_m[e][m] = av_mul_sf(sbr->s_m[e][m], gain_boost);
+ }
+ }
+ }
+}
+
+/// Assembling HF Signals (14496-3 sp04 p220)
+static void sbr_hf_assemble(int Y1[38][64][2],
+ const int X_high[64][40][2],
+ SpectralBandReplication *sbr, SBRData *ch_data,
+ const int e_a[2])
+{
+ int e, i, j, m;
+ const int h_SL = 4 * !sbr->bs_smoothing_mode;
+ const int kx = sbr->kx[1];
+ const int m_max = sbr->m[1];
+ static const SoftFloat h_smooth[5] = {
+ { 715827883, -1 },
+ { 647472402, -1 },
+ { 937030863, -2 },
+ { 989249804, -3 },
+ { 546843842, -4 },
+ };
+ SoftFloat (*g_temp)[48] = ch_data->g_temp, (*q_temp)[48] = ch_data->q_temp;
+ int indexnoise = ch_data->f_indexnoise;
+ int indexsine = ch_data->f_indexsine;
+
+ if (sbr->reset) {
+ for (i = 0; i < h_SL; i++) {
+ memcpy(g_temp[i + 2*ch_data->t_env[0]], sbr->gain[0], m_max * sizeof(sbr->gain[0][0]));
+ memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0], m_max * sizeof(sbr->q_m[0][0]));
+ }
+ } else if (h_SL) {
+ for (i = 0; i < 4; i++) {
+ memcpy(g_temp[i + 2 * ch_data->t_env[0]],
+ g_temp[i + 2 * ch_data->t_env_num_env_old],
+ sizeof(g_temp[0]));
+ memcpy(q_temp[i + 2 * ch_data->t_env[0]],
+ q_temp[i + 2 * ch_data->t_env_num_env_old],
+ sizeof(q_temp[0]));
+ }
+ }
+
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+ for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
+ memcpy(g_temp[h_SL + i], sbr->gain[e], m_max * sizeof(sbr->gain[0][0]));
+ memcpy(q_temp[h_SL + i], sbr->q_m[e], m_max * sizeof(sbr->q_m[0][0]));
+ }
+ }
+
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+ for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
+ SoftFloat g_filt_tab[48];
+ SoftFloat q_filt_tab[48];
+ SoftFloat *g_filt, *q_filt;
+
+ if (h_SL && e != e_a[0] && e != e_a[1]) {
+ g_filt = g_filt_tab;
+ q_filt = q_filt_tab;
+ for (m = 0; m < m_max; m++) {
+ const int idx1 = i + h_SL;
+ g_filt[m].mant = g_filt[m].exp = 0;
+ q_filt[m].mant = q_filt[m].exp = 0;
+ for (j = 0; j <= h_SL; j++) {
+ g_filt[m] = av_add_sf(g_filt[m],
+ av_mul_sf(g_temp[idx1 - j][m],
+ h_smooth[j]));
+ q_filt[m] = av_add_sf(q_filt[m],
+ av_mul_sf(q_temp[idx1 - j][m],
+ h_smooth[j]));
+ }
+ }
+ } else {
+ g_filt = g_temp[i + h_SL];
+ q_filt = q_temp[i];
+ }
+
+ sbr->dsp.hf_g_filt(Y1[i] + kx, X_high + kx, g_filt, m_max,
+ i + ENVELOPE_ADJUSTMENT_OFFSET);
+
+ if (e != e_a[0] && e != e_a[1]) {
+ sbr->dsp.hf_apply_noise[indexsine](Y1[i] + kx, sbr->s_m[e],
+ q_filt, indexnoise,
+ kx, m_max);
+ } else {
+ int idx = indexsine&1;
+ int A = (1-((indexsine+(kx & 1))&2));
+ int B = (A^(-idx)) + idx;
+ int *out = &Y1[i][kx][idx];
+ int shift, round;
+
+ SoftFloat *in = sbr->s_m[e];
+ for (m = 0; m+1 < m_max; m+=2) {
+ shift = 22 - in[m ].exp;
+ round = 1 << (shift-1);
+ out[2*m ] += (in[m ].mant * A + round) >> shift;
+
+ shift = 22 - in[m+1].exp;
+ round = 1 << (shift-1);
+ out[2*m+2] += (in[m+1].mant * B + round) >> shift;
+ }
+ if(m_max&1)
+ {
+ shift = 22 - in[m ].exp;
+ round = 1 << (shift-1);
+
+ out[2*m ] += (in[m ].mant * A + round) >> shift;
+ }
+ }
+ indexnoise = (indexnoise + m_max) & 0x1ff;
+ indexsine = (indexsine + 1) & 3;
+ }
+ }
+ ch_data->f_indexnoise = indexnoise;
+ ch_data->f_indexsine = indexsine;
+}
+
+#include "aacsbr_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.c
new file mode 100644
index 00000000000..b896d758807
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.c
@@ -0,0 +1,42 @@
+/*
+ * Header file for hardcoded AAC SBR windows
+ *
+ * Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#include "libavutil/internal.h"
+#include "libavutil/common.h"
+#undef CONFIG_HARDCODED_TABLES
+#define CONFIG_HARDCODED_TABLES 0
+#define USE_FIXED 1
+#include "aacsbr_fixed_tablegen.h"
+#include "tableprint.h"
+
+int main(void)
+{
+ aacsbr_tableinit();
+
+ write_fileheader();
+
+ WRITE_ARRAY_ALIGNED("static const", 32, int32_t, sbr_qmf_window_ds);
+ WRITE_ARRAY_ALIGNED("static const", 32, int32_t, sbr_qmf_window_us);
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.h
new file mode 100644
index 00000000000..1439ebe3a42
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_fixed_tablegen.h
@@ -0,0 +1,32 @@
+/*
+ * Header file for hardcoded AAC SBR windows
+ *
+ * Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AACSBR_FIXED_TABLEGEN_H
+#define AVCODEC_AACSBR_FIXED_TABLEGEN_H
+
+#include "aacsbr_tablegen_common.h"
+
+#if CONFIG_HARDCODED_TABLES
+#include "libavcodec/aacsbr_fixed_tables.h"
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* AVCODEC_AACSBR_FIXED_TABLEGEN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.c
index c3c0f0ce2b3..ee0d818f81a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.c
@@ -21,8 +21,11 @@
*/
#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
+#include "libavutil/internal.h"
#include "libavutil/common.h"
+#undef CONFIG_HARDCODED_TABLES
+#define CONFIG_HARDCODED_TABLES 0
+#define USE_FIXED 0
#include "aacsbr_tablegen.h"
#include "tableprint.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.h
index 56fdccce6a1..d86eba75404 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen.h
@@ -23,107 +23,10 @@
#ifndef AVCODEC_AACSBR_TABLEGEN_H
#define AVCODEC_AACSBR_TABLEGEN_H
+#include "aacsbr_tablegen_common.h"
+
#if CONFIG_HARDCODED_TABLES
-#define aacsbr_tableinit()
#include "libavcodec/aacsbr_tables.h"
-#else
-///< window coefficients for analysis/synthesis QMF banks
-static DECLARE_ALIGNED(32, float, sbr_qmf_window_ds)[320];
-static DECLARE_ALIGNED(32, float, sbr_qmf_window_us)[640] = {
- 0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
- -0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
- -0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
- -0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
- -0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
- -0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
- -0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
- -0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
- -0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
- -0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
- -0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
- 0.0000134949, 0.0001094383, 0.0002043017, 0.0002949531,
- 0.0004026540, 0.0005107388, 0.0006239376, 0.0007458025,
- 0.0008608443, 0.0009885988, 0.0011250155, 0.0012577884,
- 0.0013902494, 0.0015443219, 0.0016868083, 0.0018348265,
- 0.0019841140, 0.0021461583, 0.0023017254, 0.0024625616,
- 0.0026201758, 0.0027870464, 0.0029469447, 0.0031125420,
- 0.0032739613, 0.0034418874, 0.0036008268, 0.0037603922,
- 0.0039207432, 0.0040819753, 0.0042264269, 0.0043730719,
- 0.0045209852, 0.0046606460, 0.0047932560, 0.0049137603,
- 0.0050393022, 0.0051407353, 0.0052461166, 0.0053471681,
- 0.0054196775, 0.0054876040, 0.0055475714, 0.0055938023,
- 0.0056220643, 0.0056455196, 0.0056389199, 0.0056266114,
- 0.0055917128, 0.0055404363, 0.0054753783, 0.0053838975,
- 0.0052715758, 0.0051382275, 0.0049839687, 0.0048109469,
- 0.0046039530, 0.0043801861, 0.0041251642, 0.0038456408,
- 0.0035401246, 0.0032091885, 0.0028446757, 0.0024508540,
- 0.0020274176, 0.0015784682, 0.0010902329, 0.0005832264,
- 0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
- -0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
- -0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
- -0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
- 0.0132718220, 0.0143904666, 0.0155405553, 0.0167324712,
- 0.0179433381, 0.0191872431, 0.0204531793, 0.0217467550,
- 0.0230680169, 0.0244160992, 0.0257875847, 0.0271859429,
- 0.0286072173, 0.0300502657, 0.0315017608, 0.0329754081,
- 0.0344620948, 0.0359697560, 0.0374812850, 0.0390053679,
- 0.0405349170, 0.0420649094, 0.0436097542, 0.0451488405,
- 0.0466843027, 0.0482165720, 0.0497385755, 0.0512556155,
- 0.0527630746, 0.0542452768, 0.0557173648, 0.0571616450,
- 0.0585915683, 0.0599837480, 0.0613455171, 0.0626857808,
- 0.0639715898, 0.0652247106, 0.0664367512, 0.0676075985,
- 0.0687043828, 0.0697630244, 0.0707628710, 0.0717002673,
- 0.0725682583, 0.0733620255, 0.0741003642, 0.0747452558,
- 0.0753137336, 0.0758008358, 0.0761992479, 0.0764992170,
- 0.0767093490, 0.0768173975, 0.0768230011, 0.0767204924,
- 0.0765050718, 0.0761748321, 0.0757305756, 0.0751576255,
- 0.0744664394, 0.0736406005, 0.0726774642, 0.0715826364,
- 0.0703533073, 0.0689664013, 0.0674525021, 0.0657690668,
- 0.0639444805, 0.0619602779, 0.0598166570, 0.0575152691,
- 0.0550460034, 0.0524093821, 0.0495978676, 0.0466303305,
- 0.0434768782, 0.0401458278, 0.0366418116, 0.0329583930,
- 0.0290824006, 0.0250307561, 0.0207997072, 0.0163701258,
- 0.0117623832, 0.0069636862, 0.0019765601, -0.0032086896,
- -0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
- -0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
- -0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
- -0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
- -0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
- -0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
- -0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
- -0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
- -0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
- -0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
- 0.3611589903, 0.3723795546, 0.3836350013, 0.3949211761,
- 0.4062317676, 0.4175696896, 0.4289119920, 0.4402553754,
- 0.4515996535, 0.4629308085, 0.4742453214, 0.4855253091,
- 0.4967708254, 0.5079817500, 0.5191234970, 0.5302240895,
- 0.5412553448, 0.5522051258, 0.5630789140, 0.5738524131,
- 0.5845403235, 0.5951123086, 0.6055783538, 0.6159109932,
- 0.6261242695, 0.6361980107, 0.6461269695, 0.6559016302,
- 0.6655139880, 0.6749663190, 0.6842353293, 0.6933282376,
- 0.7022388719, 0.7109410426, 0.7194462634, 0.7277448900,
- 0.7358211758, 0.7436827863, 0.7513137456, 0.7587080760,
- 0.7658674865, 0.7727780881, 0.7794287519, 0.7858353120,
- 0.7919735841, 0.7978466413, 0.8034485751, 0.8087695004,
- 0.8138191270, 0.8185776004, 0.8230419890, 0.8272275347,
- 0.8311038457, 0.8346937361, 0.8379717337, 0.8409541392,
- 0.8436238281, 0.8459818469, 0.8480315777, 0.8497805198,
- 0.8511971524, 0.8523047035, 0.8531020949, 0.8535720573,
- 0.8537385600,
-};
-
-static av_cold void aacsbr_tableinit(void)
-{
- int n;
- for (n = 1; n < 320; n++)
- sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
- sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
- sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
-
- for (n = 0; n < 320; n++)
- sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
-}
#endif /* CONFIG_HARDCODED_TABLES */
#endif /* AVCODEC_AACSBR_TABLEGEN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen_common.h b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen_common.h
new file mode 100644
index 00000000000..0a64552ed64
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_tablegen_common.h
@@ -0,0 +1,129 @@
+/*
+ * Header file for hardcoded AAC SBR windows
+ *
+ * Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AACSBR_TABLEGEN_COMMON_H
+#define AVCODEC_AACSBR_TABLEGEN_COMMON_H
+#include "aac.h"
+
+#if CONFIG_HARDCODED_TABLES
+#define aacsbr_tableinit()
+#else
+///< window coefficients for analysis/synthesis QMF banks
+static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320];
+static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_us)[640] = {
+ Q31( 0.0000000000f), Q31(-0.0005525286f), Q31(-0.0005617692f), Q31(-0.0004947518f),
+ Q31(-0.0004875227f), Q31(-0.0004893791f), Q31(-0.0005040714f), Q31(-0.0005226564f),
+ Q31(-0.0005466565f), Q31(-0.0005677802f), Q31(-0.0005870930f), Q31(-0.0006132747f),
+ Q31(-0.0006312493f), Q31(-0.0006540333f), Q31(-0.0006777690f), Q31(-0.0006941614f),
+ Q31(-0.0007157736f), Q31(-0.0007255043f), Q31(-0.0007440941f), Q31(-0.0007490598f),
+ Q31(-0.0007681371f), Q31(-0.0007724848f), Q31(-0.0007834332f), Q31(-0.0007779869f),
+ Q31(-0.0007803664f), Q31(-0.0007801449f), Q31(-0.0007757977f), Q31(-0.0007630793f),
+ Q31(-0.0007530001f), Q31(-0.0007319357f), Q31(-0.0007215391f), Q31(-0.0006917937f),
+ Q31(-0.0006650415f), Q31(-0.0006341594f), Q31(-0.0005946118f), Q31(-0.0005564576f),
+ Q31(-0.0005145572f), Q31(-0.0004606325f), Q31(-0.0004095121f), Q31(-0.0003501175f),
+ Q31(-0.0002896981f), Q31(-0.0002098337f), Q31(-0.0001446380f), Q31(-0.0000617334f),
+ Q31( 0.0000134949f), Q31( 0.0001094383f), Q31( 0.0002043017f), Q31( 0.0002949531f),
+ Q31( 0.0004026540f), Q31( 0.0005107388f), Q31( 0.0006239376f), Q31( 0.0007458025f),
+ Q31( 0.0008608443f), Q31( 0.0009885988f), Q31( 0.0011250155f), Q31( 0.0012577884f),
+ Q31( 0.0013902494f), Q31( 0.0015443219f), Q31( 0.0016868083f), Q31( 0.0018348265f),
+ Q31( 0.0019841140f), Q31( 0.0021461583f), Q31( 0.0023017254f), Q31( 0.0024625616f),
+ Q31( 0.0026201758f), Q31( 0.0027870464f), Q31( 0.0029469447f), Q31( 0.0031125420f),
+ Q31( 0.0032739613f), Q31( 0.0034418874f), Q31( 0.0036008268f), Q31( 0.0037603922f),
+ Q31( 0.0039207432f), Q31( 0.0040819753f), Q31( 0.0042264269f), Q31( 0.0043730719f),
+ Q31( 0.0045209852f), Q31( 0.0046606460f), Q31( 0.0047932560f), Q31( 0.0049137603f),
+ Q31( 0.0050393022f), Q31( 0.0051407353f), Q31( 0.0052461166f), Q31( 0.0053471681f),
+ Q31( 0.0054196775f), Q31( 0.0054876040f), Q31( 0.0055475714f), Q31( 0.0055938023f),
+ Q31( 0.0056220643f), Q31( 0.0056455196f), Q31( 0.0056389199f), Q31( 0.0056266114f),
+ Q31( 0.0055917128f), Q31( 0.0055404363f), Q31( 0.0054753783f), Q31( 0.0053838975f),
+ Q31( 0.0052715758f), Q31( 0.0051382275f), Q31( 0.0049839687f), Q31( 0.0048109469f),
+ Q31( 0.0046039530f), Q31( 0.0043801861f), Q31( 0.0041251642f), Q31( 0.0038456408f),
+ Q31( 0.0035401246f), Q31( 0.0032091885f), Q31( 0.0028446757f), Q31( 0.0024508540f),
+ Q31( 0.0020274176f), Q31( 0.0015784682f), Q31( 0.0010902329f), Q31( 0.0005832264f),
+ Q31( 0.0000276045f), Q31(-0.0005464280f), Q31(-0.0011568135f), Q31(-0.0018039472f),
+ Q31(-0.0024826723f), Q31(-0.0031933778f), Q31(-0.0039401124f), Q31(-0.0047222596f),
+ Q31(-0.0055337211f), Q31(-0.0063792293f), Q31(-0.0072615816f), Q31(-0.0081798233f),
+ Q31(-0.0091325329f), Q31(-0.0101150215f), Q31(-0.0111315548f), Q31(-0.0121849995f),
+ Q31( 0.0132718220f), Q31( 0.0143904666f), Q31( 0.0155405553f), Q31( 0.0167324712f),
+ Q31( 0.0179433381f), Q31( 0.0191872431f), Q31( 0.0204531793f), Q31( 0.0217467550f),
+ Q31( 0.0230680169f), Q31( 0.0244160992f), Q31( 0.0257875847f), Q31( 0.0271859429f),
+ Q31( 0.0286072173f), Q31( 0.0300502657f), Q31( 0.0315017608f), Q31( 0.0329754081f),
+ Q31( 0.0344620948f), Q31( 0.0359697560f), Q31( 0.0374812850f), Q31( 0.0390053679f),
+ Q31( 0.0405349170f), Q31( 0.0420649094f), Q31( 0.0436097542f), Q31( 0.0451488405f),
+ Q31( 0.0466843027f), Q31( 0.0482165720f), Q31( 0.0497385755f), Q31( 0.0512556155f),
+ Q31( 0.0527630746f), Q31( 0.0542452768f), Q31( 0.0557173648f), Q31( 0.0571616450f),
+ Q31( 0.0585915683f), Q31( 0.0599837480f), Q31( 0.0613455171f), Q31( 0.0626857808f),
+ Q31( 0.0639715898f), Q31( 0.0652247106f), Q31( 0.0664367512f), Q31( 0.0676075985f),
+ Q31( 0.0687043828f), Q31( 0.0697630244f), Q31( 0.0707628710f), Q31( 0.0717002673f),
+ Q31( 0.0725682583f), Q31( 0.0733620255f), Q31( 0.0741003642f), Q31( 0.0747452558f),
+ Q31( 0.0753137336f), Q31( 0.0758008358f), Q31( 0.0761992479f), Q31( 0.0764992170f),
+ Q31( 0.0767093490f), Q31( 0.0768173975f), Q31( 0.0768230011f), Q31( 0.0767204924f),
+ Q31( 0.0765050718f), Q31( 0.0761748321f), Q31( 0.0757305756f), Q31( 0.0751576255f),
+ Q31( 0.0744664394f), Q31( 0.0736406005f), Q31( 0.0726774642f), Q31( 0.0715826364f),
+ Q31( 0.0703533073f), Q31( 0.0689664013f), Q31( 0.0674525021f), Q31( 0.0657690668f),
+ Q31( 0.0639444805f), Q31( 0.0619602779f), Q31( 0.0598166570f), Q31( 0.0575152691f),
+ Q31( 0.0550460034f), Q31( 0.0524093821f), Q31( 0.0495978676f), Q31( 0.0466303305f),
+ Q31( 0.0434768782f), Q31( 0.0401458278f), Q31( 0.0366418116f), Q31( 0.0329583930f),
+ Q31( 0.0290824006f), Q31( 0.0250307561f), Q31( 0.0207997072f), Q31( 0.0163701258f),
+ Q31( 0.0117623832f), Q31( 0.0069636862f), Q31( 0.0019765601f), Q31(-0.0032086896f),
+ Q31(-0.0085711749f), Q31(-0.0141288827f), Q31(-0.0198834129f), Q31(-0.0258227288f),
+ Q31(-0.0319531274f), Q31(-0.0382776572f), Q31(-0.0447806821f), Q31(-0.0514804176f),
+ Q31(-0.0583705326f), Q31(-0.0654409853f), Q31(-0.0726943300f), Q31(-0.0801372934f),
+ Q31(-0.0877547536f), Q31(-0.0955533352f), Q31(-0.1035329531f), Q31(-0.1116826931f),
+ Q31(-0.1200077984f), Q31(-0.1285002850f), Q31(-0.1371551761f), Q31(-0.1459766491f),
+ Q31(-0.1549607071f), Q31(-0.1640958855f), Q31(-0.1733808172f), Q31(-0.1828172548f),
+ Q31(-0.1923966745f), Q31(-0.2021250176f), Q31(-0.2119735853f), Q31(-0.2219652696f),
+ Q31(-0.2320690870f), Q31(-0.2423016884f), Q31(-0.2526480309f), Q31(-0.2631053299f),
+ Q31(-0.2736634040f), Q31(-0.2843214189f), Q31(-0.2950716717f), Q31(-0.3059098575f),
+ Q31(-0.3168278913f), Q31(-0.3278113727f), Q31(-0.3388722693f), Q31(-0.3499914122f),
+ Q31( 0.3611589903f), Q31( 0.3723795546f), Q31( 0.3836350013f), Q31( 0.3949211761f),
+ Q31( 0.4062317676f), Q31( 0.4175696896f), Q31( 0.4289119920f), Q31( 0.4402553754f),
+ Q31( 0.4515996535f), Q31( 0.4629308085f), Q31( 0.4742453214f), Q31( 0.4855253091f),
+ Q31( 0.4967708254f), Q31( 0.5079817500f), Q31( 0.5191234970f), Q31( 0.5302240895f),
+ Q31( 0.5412553448f), Q31( 0.5522051258f), Q31( 0.5630789140f), Q31( 0.5738524131f),
+ Q31( 0.5845403235f), Q31( 0.5951123086f), Q31( 0.6055783538f), Q31( 0.6159109932f),
+ Q31( 0.6261242695f), Q31( 0.6361980107f), Q31( 0.6461269695f), Q31( 0.6559016302f),
+ Q31( 0.6655139880f), Q31( 0.6749663190f), Q31( 0.6842353293f), Q31( 0.6933282376f),
+ Q31( 0.7022388719f), Q31( 0.7109410426f), Q31( 0.7194462634f), Q31( 0.7277448900f),
+ Q31( 0.7358211758f), Q31( 0.7436827863f), Q31( 0.7513137456f), Q31( 0.7587080760f),
+ Q31( 0.7658674865f), Q31( 0.7727780881f), Q31( 0.7794287519f), Q31( 0.7858353120f),
+ Q31( 0.7919735841f), Q31( 0.7978466413f), Q31( 0.8034485751f), Q31( 0.8087695004f),
+ Q31( 0.8138191270f), Q31( 0.8185776004f), Q31( 0.8230419890f), Q31( 0.8272275347f),
+ Q31( 0.8311038457f), Q31( 0.8346937361f), Q31( 0.8379717337f), Q31( 0.8409541392f),
+ Q31( 0.8436238281f), Q31( 0.8459818469f), Q31( 0.8480315777f), Q31( 0.8497805198f),
+ Q31( 0.8511971524f), Q31( 0.8523047035f), Q31( 0.8531020949f), Q31( 0.8535720573f),
+ Q31( 0.8537385600f),
+};
+
+static av_cold void aacsbr_tableinit(void)
+{
+ int n;
+ for (n = 1; n < 320; n++)
+ sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
+ sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
+ sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
+
+ for (n = 0; n < 320; n++)
+ sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
+}
+#endif /* CONFIG_HARDCODED_TABLES */
+
+#endif /* AVCODEC_AACSBR_TABLEGEN_COMMON_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbr_template.c b/chromium/third_party/ffmpeg/libavcodec/aacsbr_template.c
new file mode 100644
index 00000000000..d31b71e0a89
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbr_template.c
@@ -0,0 +1,1535 @@
+/*
+ * AAC Spectral Band Replication decoding functions
+ * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
+ * Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * Fixed point code
+ * Copyright (c) 2013
+ * MIPS Technologies, Inc., California.
+ *
+ * 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
+ * AAC Spectral Band Replication decoding functions
+ * @author Robert Swain ( rob opendot cl )
+ * @author Stanislav Ocovaj ( stanislav.ocovaj@imgtec.com )
+ * @author Zoran Basaric ( zoran.basaric@imgtec.com )
+ */
+
+av_cold void AAC_RENAME(ff_aac_sbr_init)(void)
+{
+ static const struct {
+ const void *sbr_codes, *sbr_bits;
+ const unsigned int table_size, elem_size;
+ } sbr_tmp[] = {
+ SBR_VLC_ROW(t_huffman_env_1_5dB),
+ SBR_VLC_ROW(f_huffman_env_1_5dB),
+ SBR_VLC_ROW(t_huffman_env_bal_1_5dB),
+ SBR_VLC_ROW(f_huffman_env_bal_1_5dB),
+ SBR_VLC_ROW(t_huffman_env_3_0dB),
+ SBR_VLC_ROW(f_huffman_env_3_0dB),
+ SBR_VLC_ROW(t_huffman_env_bal_3_0dB),
+ SBR_VLC_ROW(f_huffman_env_bal_3_0dB),
+ SBR_VLC_ROW(t_huffman_noise_3_0dB),
+ SBR_VLC_ROW(t_huffman_noise_bal_3_0dB),
+ };
+
+ // SBR VLC table initialization
+ SBR_INIT_VLC_STATIC(0, 1098);
+ SBR_INIT_VLC_STATIC(1, 1092);
+ SBR_INIT_VLC_STATIC(2, 768);
+ SBR_INIT_VLC_STATIC(3, 1026);
+ SBR_INIT_VLC_STATIC(4, 1058);
+ SBR_INIT_VLC_STATIC(5, 1052);
+ SBR_INIT_VLC_STATIC(6, 544);
+ SBR_INIT_VLC_STATIC(7, 544);
+ SBR_INIT_VLC_STATIC(8, 592);
+ SBR_INIT_VLC_STATIC(9, 512);
+
+ aacsbr_tableinit();
+
+ AAC_RENAME(ff_ps_init)();
+}
+
+/** Places SBR in pure upsampling mode. */
+static void sbr_turnoff(SpectralBandReplication *sbr) {
+ sbr->start = 0;
+ // Init defults used in pure upsampling mode
+ sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
+ sbr->m[1] = 0;
+ // Reset values for first SBR header
+ sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
+ memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters));
+}
+
+av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr)
+{
+ if(sbr->mdct.mdct_bits)
+ return;
+ sbr->kx[0] = sbr->kx[1];
+ sbr_turnoff(sbr);
+ sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
+ sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
+ /* SBR requires samples to be scaled to +/-32768.0 to work correctly.
+ * mdct scale factors are adjusted to scale up from +/-1.0 at analysis
+ * and scale back down at synthesis. */
+ AAC_RENAME_32(ff_mdct_init)(&sbr->mdct, 7, 1, 1.0 / (64 * 32768.0));
+ AAC_RENAME_32(ff_mdct_init)(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
+ AAC_RENAME(ff_ps_ctx_init)(&sbr->ps);
+ AAC_RENAME(ff_sbrdsp_init)(&sbr->dsp);
+ aacsbr_func_ptr_init(&sbr->c);
+}
+
+av_cold void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr)
+{
+ AAC_RENAME_32(ff_mdct_end)(&sbr->mdct);
+ AAC_RENAME_32(ff_mdct_end)(&sbr->mdct_ana);
+}
+
+static int qsort_comparison_function_int16(const void *a, const void *b)
+{
+ return *(const int16_t *)a - *(const int16_t *)b;
+}
+
+static inline int in_table_int16(const int16_t *table, int last_el, int16_t needle)
+{
+ int i;
+ for (i = 0; i <= last_el; i++)
+ if (table[i] == needle)
+ return 1;
+ return 0;
+}
+
+/// Limiter Frequency Band Table (14496-3 sp04 p198)
+static void sbr_make_f_tablelim(SpectralBandReplication *sbr)
+{
+ int k;
+ if (sbr->bs_limiter_bands > 0) {
+ static const INTFLOAT bands_warped[3] = { Q23(1.32715174233856803909f), //2^(0.49/1.2)
+ Q23(1.18509277094158210129f), //2^(0.49/2)
+ Q23(1.11987160404675912501f) }; //2^(0.49/3)
+ const INTFLOAT lim_bands_per_octave_warped = bands_warped[sbr->bs_limiter_bands - 1];
+ int16_t patch_borders[7];
+ uint16_t *in = sbr->f_tablelim + 1, *out = sbr->f_tablelim;
+
+ patch_borders[0] = sbr->kx[1];
+ for (k = 1; k <= sbr->num_patches; k++)
+ patch_borders[k] = patch_borders[k-1] + sbr->patch_num_subbands[k-1];
+
+ memcpy(sbr->f_tablelim, sbr->f_tablelow,
+ (sbr->n[0] + 1) * sizeof(sbr->f_tablelow[0]));
+ if (sbr->num_patches > 1)
+ memcpy(sbr->f_tablelim + sbr->n[0] + 1, patch_borders + 1,
+ (sbr->num_patches - 1) * sizeof(patch_borders[0]));
+
+ qsort(sbr->f_tablelim, sbr->num_patches + sbr->n[0],
+ sizeof(sbr->f_tablelim[0]),
+ qsort_comparison_function_int16);
+
+ sbr->n_lim = sbr->n[0] + sbr->num_patches - 1;
+ while (out < sbr->f_tablelim + sbr->n_lim) {
+#if USE_FIXED
+ if ((*in << 23) >= *out * lim_bands_per_octave_warped) {
+#else
+ if (*in >= *out * lim_bands_per_octave_warped) {
+#endif /* USE_FIXED */
+ *++out = *in++;
+ } else if (*in == *out ||
+ !in_table_int16(patch_borders, sbr->num_patches, *in)) {
+ in++;
+ sbr->n_lim--;
+ } else if (!in_table_int16(patch_borders, sbr->num_patches, *out)) {
+ *out = *in++;
+ sbr->n_lim--;
+ } else {
+ *++out = *in++;
+ }
+ }
+ } else {
+ sbr->f_tablelim[0] = sbr->f_tablelow[0];
+ sbr->f_tablelim[1] = sbr->f_tablelow[sbr->n[0]];
+ sbr->n_lim = 1;
+ }
+}
+
+static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext *gb)
+{
+ unsigned int cnt = get_bits_count(gb);
+ uint8_t bs_header_extra_1;
+ uint8_t bs_header_extra_2;
+ int old_bs_limiter_bands = sbr->bs_limiter_bands;
+ SpectrumParameters old_spectrum_params;
+
+ sbr->start = 1;
+
+ // Save last spectrum parameters variables to compare to new ones
+ memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
+
+ sbr->bs_amp_res_header = get_bits1(gb);
+ sbr->spectrum_params.bs_start_freq = get_bits(gb, 4);
+ sbr->spectrum_params.bs_stop_freq = get_bits(gb, 4);
+ sbr->spectrum_params.bs_xover_band = get_bits(gb, 3);
+ skip_bits(gb, 2); // bs_reserved
+
+ bs_header_extra_1 = get_bits1(gb);
+ bs_header_extra_2 = get_bits1(gb);
+
+ if (bs_header_extra_1) {
+ sbr->spectrum_params.bs_freq_scale = get_bits(gb, 2);
+ sbr->spectrum_params.bs_alter_scale = get_bits1(gb);
+ sbr->spectrum_params.bs_noise_bands = get_bits(gb, 2);
+ } else {
+ sbr->spectrum_params.bs_freq_scale = 2;
+ sbr->spectrum_params.bs_alter_scale = 1;
+ sbr->spectrum_params.bs_noise_bands = 2;
+ }
+
+ // Check if spectrum parameters changed
+ if (memcmp(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters)))
+ sbr->reset = 1;
+
+ if (bs_header_extra_2) {
+ sbr->bs_limiter_bands = get_bits(gb, 2);
+ sbr->bs_limiter_gains = get_bits(gb, 2);
+ sbr->bs_interpol_freq = get_bits1(gb);
+ sbr->bs_smoothing_mode = get_bits1(gb);
+ } else {
+ sbr->bs_limiter_bands = 2;
+ sbr->bs_limiter_gains = 2;
+ sbr->bs_interpol_freq = 1;
+ sbr->bs_smoothing_mode = 1;
+ }
+
+ if (sbr->bs_limiter_bands != old_bs_limiter_bands && !sbr->reset)
+ sbr_make_f_tablelim(sbr);
+
+ return get_bits_count(gb) - cnt;
+}
+
+static int array_min_int16(const int16_t *array, int nel)
+{
+ int i, min = array[0];
+ for (i = 1; i < nel; i++)
+ min = FFMIN(array[i], min);
+ return min;
+}
+
+static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band)
+{
+ // Requirements (14496-3 sp04 p205)
+ if (n_master <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid n_master: %d\n", n_master);
+ return -1;
+ }
+ if (bs_xover_band >= n_master) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid bitstream, crossover band index beyond array bounds: %d\n",
+ bs_xover_band);
+ return -1;
+ }
+ return 0;
+}
+
+/// Master Frequency Band Table (14496-3 sp04 p194)
+static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
+ SpectrumParameters *spectrum)
+{
+ unsigned int temp, max_qmf_subbands = 0;
+ unsigned int start_min, stop_min;
+ int k;
+ const int8_t *sbr_offset_ptr;
+ int16_t stop_dk[13];
+
+ if (sbr->sample_rate < 32000) {
+ temp = 3000;
+ } else if (sbr->sample_rate < 64000) {
+ temp = 4000;
+ } else
+ temp = 5000;
+
+ switch (sbr->sample_rate) {
+ case 16000:
+ sbr_offset_ptr = sbr_offset[0];
+ break;
+ case 22050:
+ sbr_offset_ptr = sbr_offset[1];
+ break;
+ case 24000:
+ sbr_offset_ptr = sbr_offset[2];
+ break;
+ case 32000:
+ sbr_offset_ptr = sbr_offset[3];
+ break;
+ case 44100: case 48000: case 64000:
+ sbr_offset_ptr = sbr_offset[4];
+ break;
+ case 88200: case 96000: case 128000: case 176400: case 192000:
+ sbr_offset_ptr = sbr_offset[5];
+ break;
+ default:
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Unsupported sample rate for SBR: %d\n", sbr->sample_rate);
+ return -1;
+ }
+
+ start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
+ stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
+
+ sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq];
+
+ if (spectrum->bs_stop_freq < 14) {
+ sbr->k[2] = stop_min;
+ make_bands(stop_dk, stop_min, 64, 13);
+ qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16);
+ for (k = 0; k < spectrum->bs_stop_freq; k++)
+ sbr->k[2] += stop_dk[k];
+ } else if (spectrum->bs_stop_freq == 14) {
+ sbr->k[2] = 2*sbr->k[0];
+ } else if (spectrum->bs_stop_freq == 15) {
+ sbr->k[2] = 3*sbr->k[0];
+ } else {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bs_stop_freq: %d\n", spectrum->bs_stop_freq);
+ return -1;
+ }
+ sbr->k[2] = FFMIN(64, sbr->k[2]);
+
+ // Requirements (14496-3 sp04 p205)
+ if (sbr->sample_rate <= 32000) {
+ max_qmf_subbands = 48;
+ } else if (sbr->sample_rate == 44100) {
+ max_qmf_subbands = 35;
+ } else if (sbr->sample_rate >= 48000)
+ max_qmf_subbands = 32;
+ else
+ av_assert0(0);
+
+ if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bitstream, too many QMF subbands: %d\n", sbr->k[2] - sbr->k[0]);
+ return -1;
+ }
+
+ if (!spectrum->bs_freq_scale) {
+ int dk, k2diff;
+
+ dk = spectrum->bs_alter_scale + 1;
+ sbr->n_master = ((sbr->k[2] - sbr->k[0] + (dk&2)) >> dk) << 1;
+ if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
+ return -1;
+
+ for (k = 1; k <= sbr->n_master; k++)
+ sbr->f_master[k] = dk;
+
+ k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk;
+ if (k2diff < 0) {
+ sbr->f_master[1]--;
+ sbr->f_master[2]-= (k2diff < -1);
+ } else if (k2diff) {
+ sbr->f_master[sbr->n_master]++;
+ }
+
+ sbr->f_master[0] = sbr->k[0];
+ for (k = 1; k <= sbr->n_master; k++)
+ sbr->f_master[k] += sbr->f_master[k - 1];
+
+ } else {
+ int half_bands = 7 - spectrum->bs_freq_scale; // bs_freq_scale = {1,2,3}
+ int two_regions, num_bands_0;
+ int vdk0_max, vdk1_min;
+ int16_t vk0[49];
+#if USE_FIXED
+ int tmp, nz = 0;
+#endif /* USE_FIXED */
+
+ if (49 * sbr->k[2] > 110 * sbr->k[0]) {
+ two_regions = 1;
+ sbr->k[1] = 2 * sbr->k[0];
+ } else {
+ two_regions = 0;
+ sbr->k[1] = sbr->k[2];
+ }
+
+#if USE_FIXED
+ tmp = (sbr->k[1] << 23) / sbr->k[0];
+ while (tmp < 0x40000000) {
+ tmp <<= 1;
+ nz++;
+ }
+ tmp = fixed_log(tmp - 0x80000000);
+ tmp = (int)(((int64_t)tmp * CONST_RECIP_LN2 + 0x20000000) >> 30);
+ tmp = (((tmp + 0x80) >> 8) + ((8 - nz) << 23)) * half_bands;
+ num_bands_0 = ((tmp + 0x400000) >> 23) * 2;
+#else
+ num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2;
+#endif /* USE_FIXED */
+
+ if (num_bands_0 <= 0) { // Requirements (14496-3 sp04 p205)
+ av_log(ac->avctx, AV_LOG_ERROR, "Invalid num_bands_0: %d\n", num_bands_0);
+ return -1;
+ }
+
+ vk0[0] = 0;
+
+ make_bands(vk0+1, sbr->k[0], sbr->k[1], num_bands_0);
+
+ qsort(vk0 + 1, num_bands_0, sizeof(vk0[1]), qsort_comparison_function_int16);
+ vdk0_max = vk0[num_bands_0];
+
+ vk0[0] = sbr->k[0];
+ for (k = 1; k <= num_bands_0; k++) {
+ if (vk0[k] <= 0) { // Requirements (14496-3 sp04 p205)
+ av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk0[%d]: %d\n", k, vk0[k]);
+ return -1;
+ }
+ vk0[k] += vk0[k-1];
+ }
+
+ if (two_regions) {
+ int16_t vk1[49];
+#if USE_FIXED
+ int num_bands_1;
+
+ tmp = (sbr->k[2] << 23) / sbr->k[1];
+ nz = 0;
+ while (tmp < 0x40000000) {
+ tmp <<= 1;
+ nz++;
+ }
+ tmp = fixed_log(tmp - 0x80000000);
+ tmp = (int)(((int64_t)tmp * CONST_RECIP_LN2 + 0x20000000) >> 30);
+ tmp = (((tmp + 0x80) >> 8) + ((8 - nz) << 23)) * half_bands;
+ if (spectrum->bs_alter_scale)
+ tmp = (int)(((int64_t)tmp * CONST_076923 + 0x40000000) >> 31);
+ num_bands_1 = ((tmp + 0x400000) >> 23) * 2;
+#else
+ float invwarp = spectrum->bs_alter_scale ? 0.76923076923076923077f
+ : 1.0f; // bs_alter_scale = {0,1}
+ int num_bands_1 = lrintf(half_bands * invwarp *
+ log2f(sbr->k[2] / (float)sbr->k[1])) * 2;
+#endif /* USE_FIXED */
+ make_bands(vk1+1, sbr->k[1], sbr->k[2], num_bands_1);
+
+ vdk1_min = array_min_int16(vk1 + 1, num_bands_1);
+
+ if (vdk1_min < vdk0_max) {
+ int change;
+ qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
+ change = FFMIN(vdk0_max - vk1[1], (vk1[num_bands_1] - vk1[1]) >> 1);
+ vk1[1] += change;
+ vk1[num_bands_1] -= change;
+ }
+
+ qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
+
+ vk1[0] = sbr->k[1];
+ for (k = 1; k <= num_bands_1; k++) {
+ if (vk1[k] <= 0) { // Requirements (14496-3 sp04 p205)
+ av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk1[%d]: %d\n", k, vk1[k]);
+ return -1;
+ }
+ vk1[k] += vk1[k-1];
+ }
+
+ sbr->n_master = num_bands_0 + num_bands_1;
+ if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
+ return -1;
+ memcpy(&sbr->f_master[0], vk0,
+ (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
+ memcpy(&sbr->f_master[num_bands_0 + 1], vk1 + 1,
+ num_bands_1 * sizeof(sbr->f_master[0]));
+
+ } else {
+ sbr->n_master = num_bands_0;
+ if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
+ return -1;
+ memcpy(sbr->f_master, vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
+ }
+ }
+
+ return 0;
+}
+
+/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
+static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
+{
+ int i, k, last_k = -1, last_msb = -1, sb = 0;
+ int msb = sbr->k[0];
+ int usb = sbr->kx[1];
+ int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
+
+ sbr->num_patches = 0;
+
+ if (goal_sb < sbr->kx[1] + sbr->m[1]) {
+ for (k = 0; sbr->f_master[k] < goal_sb; k++) ;
+ } else
+ k = sbr->n_master;
+
+ do {
+ int odd = 0;
+ if (k == last_k && msb == last_msb) {
+ av_log(ac->avctx, AV_LOG_ERROR, "patch construction failed\n");
+ return AVERROR_INVALIDDATA;
+ }
+ last_k = k;
+ last_msb = msb;
+ for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
+ sb = sbr->f_master[i];
+ odd = (sb + sbr->k[0]) & 1;
+ }
+
+ // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5.
+ // After this check the final number of patches can still be six which is
+ // illegal however the Coding Technologies decoder check stream has a final
+ // count of 6 patches
+ if (sbr->num_patches > 5) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
+ return -1;
+ }
+
+ sbr->patch_num_subbands[sbr->num_patches] = FFMAX(sb - usb, 0);
+ sbr->patch_start_subband[sbr->num_patches] = sbr->k[0] - odd - sbr->patch_num_subbands[sbr->num_patches];
+
+ if (sbr->patch_num_subbands[sbr->num_patches] > 0) {
+ usb = sb;
+ msb = sb;
+ sbr->num_patches++;
+ } else
+ msb = sbr->kx[1];
+
+ if (sbr->f_master[k] - sb < 3)
+ k = sbr->n_master;
+ } while (sb != sbr->kx[1] + sbr->m[1]);
+
+ if (sbr->num_patches > 1 &&
+ sbr->patch_num_subbands[sbr->num_patches - 1] < 3)
+ sbr->num_patches--;
+
+ return 0;
+}
+
+/// Derived Frequency Band Tables (14496-3 sp04 p197)
+static int sbr_make_f_derived(AACContext *ac, SpectralBandReplication *sbr)
+{
+ int k, temp;
+#if USE_FIXED
+ int nz = 0;
+#endif /* USE_FIXED */
+
+ sbr->n[1] = sbr->n_master - sbr->spectrum_params.bs_xover_band;
+ sbr->n[0] = (sbr->n[1] + 1) >> 1;
+
+ memcpy(sbr->f_tablehigh, &sbr->f_master[sbr->spectrum_params.bs_xover_band],
+ (sbr->n[1] + 1) * sizeof(sbr->f_master[0]));
+ sbr->m[1] = sbr->f_tablehigh[sbr->n[1]] - sbr->f_tablehigh[0];
+ sbr->kx[1] = sbr->f_tablehigh[0];
+
+ // Requirements (14496-3 sp04 p205)
+ if (sbr->kx[1] + sbr->m[1] > 64) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Stop frequency border too high: %d\n", sbr->kx[1] + sbr->m[1]);
+ return -1;
+ }
+ if (sbr->kx[1] > 32) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Start frequency border too high: %d\n", sbr->kx[1]);
+ return -1;
+ }
+
+ sbr->f_tablelow[0] = sbr->f_tablehigh[0];
+ temp = sbr->n[1] & 1;
+ for (k = 1; k <= sbr->n[0]; k++)
+ sbr->f_tablelow[k] = sbr->f_tablehigh[2 * k - temp];
+#if USE_FIXED
+ temp = (sbr->k[2] << 23) / sbr->kx[1];
+ while (temp < 0x40000000) {
+ temp <<= 1;
+ nz++;
+ }
+ temp = fixed_log(temp - 0x80000000);
+ temp = (int)(((int64_t)temp * CONST_RECIP_LN2 + 0x20000000) >> 30);
+ temp = (((temp + 0x80) >> 8) + ((8 - nz) << 23)) * sbr->spectrum_params.bs_noise_bands;
+
+ sbr->n_q = (temp + 0x400000) >> 23;
+ if (sbr->n_q < 1)
+ sbr->n_q = 1;
+#else
+ sbr->n_q = FFMAX(1, lrintf(sbr->spectrum_params.bs_noise_bands *
+ log2f(sbr->k[2] / (float)sbr->kx[1]))); // 0 <= bs_noise_bands <= 3
+#endif /* USE_FIXED */
+
+ if (sbr->n_q > 5) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Too many noise floor scale factors: %d\n", sbr->n_q);
+ return -1;
+ }
+
+ sbr->f_tablenoise[0] = sbr->f_tablelow[0];
+ temp = 0;
+ for (k = 1; k <= sbr->n_q; k++) {
+ temp += (sbr->n[0] - temp) / (sbr->n_q + 1 - k);
+ sbr->f_tablenoise[k] = sbr->f_tablelow[temp];
+ }
+
+ if (sbr_hf_calc_npatches(ac, sbr) < 0)
+ return -1;
+
+ sbr_make_f_tablelim(sbr);
+
+ sbr->data[0].f_indexnoise = 0;
+ sbr->data[1].f_indexnoise = 0;
+
+ return 0;
+}
+
+static av_always_inline void get_bits1_vector(GetBitContext *gb, uint8_t *vec,
+ int elements)
+{
+ int i;
+ for (i = 0; i < elements; i++) {
+ vec[i] = get_bits1(gb);
+ }
+}
+
+/** ceil(log2(index+1)) */
+static const int8_t ceil_log2[] = {
+ 0, 1, 2, 2, 3, 3,
+};
+
+static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
+ GetBitContext *gb, SBRData *ch_data)
+{
+ int i;
+ int bs_pointer = 0;
+ // frameLengthFlag ? 15 : 16; 960 sample length frames unsupported; this value is numTimeSlots
+ int abs_bord_trail = 16;
+ int num_rel_lead, num_rel_trail;
+ unsigned bs_num_env_old = ch_data->bs_num_env;
+
+ ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env];
+ ch_data->bs_amp_res = sbr->bs_amp_res_header;
+ ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old];
+
+ switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
+ case FIXFIX:
+ ch_data->bs_num_env = 1 << get_bits(gb, 2);
+ num_rel_lead = ch_data->bs_num_env - 1;
+ if (ch_data->bs_num_env == 1)
+ ch_data->bs_amp_res = 0;
+
+ if (ch_data->bs_num_env > 4) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
+ ch_data->bs_num_env);
+ return -1;
+ }
+
+ ch_data->t_env[0] = 0;
+ ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
+
+ abs_bord_trail = (abs_bord_trail + (ch_data->bs_num_env >> 1)) /
+ ch_data->bs_num_env;
+ for (i = 0; i < num_rel_lead; i++)
+ ch_data->t_env[i + 1] = ch_data->t_env[i] + abs_bord_trail;
+
+ ch_data->bs_freq_res[1] = get_bits1(gb);
+ for (i = 1; i < ch_data->bs_num_env; i++)
+ ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
+ break;
+ case FIXVAR:
+ abs_bord_trail += get_bits(gb, 2);
+ num_rel_trail = get_bits(gb, 2);
+ ch_data->bs_num_env = num_rel_trail + 1;
+ ch_data->t_env[0] = 0;
+ ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
+
+ for (i = 0; i < num_rel_trail; i++)
+ ch_data->t_env[ch_data->bs_num_env - 1 - i] =
+ ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
+
+ bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
+
+ for (i = 0; i < ch_data->bs_num_env; i++)
+ ch_data->bs_freq_res[ch_data->bs_num_env - i] = get_bits1(gb);
+ break;
+ case VARFIX:
+ ch_data->t_env[0] = get_bits(gb, 2);
+ num_rel_lead = get_bits(gb, 2);
+ ch_data->bs_num_env = num_rel_lead + 1;
+ ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
+
+ for (i = 0; i < num_rel_lead; i++)
+ ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
+
+ bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
+
+ get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
+ break;
+ case VARVAR:
+ ch_data->t_env[0] = get_bits(gb, 2);
+ abs_bord_trail += get_bits(gb, 2);
+ num_rel_lead = get_bits(gb, 2);
+ num_rel_trail = get_bits(gb, 2);
+ ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1;
+
+ if (ch_data->bs_num_env > 5) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
+ ch_data->bs_num_env);
+ return -1;
+ }
+
+ ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
+
+ for (i = 0; i < num_rel_lead; i++)
+ ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
+ for (i = 0; i < num_rel_trail; i++)
+ ch_data->t_env[ch_data->bs_num_env - 1 - i] =
+ ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
+
+ bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
+
+ get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
+ break;
+ }
+
+ av_assert0(bs_pointer >= 0);
+ if (bs_pointer > ch_data->bs_num_env + 1) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
+ bs_pointer);
+ return -1;
+ }
+
+ for (i = 1; i <= ch_data->bs_num_env; i++) {
+ if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
+ return -1;
+ }
+ }
+
+ ch_data->bs_num_noise = (ch_data->bs_num_env > 1) + 1;
+
+ ch_data->t_q[0] = ch_data->t_env[0];
+ ch_data->t_q[ch_data->bs_num_noise] = ch_data->t_env[ch_data->bs_num_env];
+ if (ch_data->bs_num_noise > 1) {
+ int idx;
+ if (ch_data->bs_frame_class == FIXFIX) {
+ idx = ch_data->bs_num_env >> 1;
+ } else if (ch_data->bs_frame_class & 1) { // FIXVAR or VARVAR
+ idx = ch_data->bs_num_env - FFMAX(bs_pointer - 1, 1);
+ } else { // VARFIX
+ if (!bs_pointer)
+ idx = 1;
+ else if (bs_pointer == 1)
+ idx = ch_data->bs_num_env - 1;
+ else // bs_pointer > 1
+ idx = bs_pointer - 1;
+ }
+ ch_data->t_q[1] = ch_data->t_env[idx];
+ }
+
+ ch_data->e_a[0] = -(ch_data->e_a[1] != bs_num_env_old); // l_APrev
+ ch_data->e_a[1] = -1;
+ if ((ch_data->bs_frame_class & 1) && bs_pointer) { // FIXVAR or VARVAR and bs_pointer != 0
+ ch_data->e_a[1] = ch_data->bs_num_env + 1 - bs_pointer;
+ } else if ((ch_data->bs_frame_class == 2) && (bs_pointer > 1)) // VARFIX and bs_pointer > 1
+ ch_data->e_a[1] = bs_pointer - 1;
+
+ return 0;
+}
+
+static void copy_sbr_grid(SBRData *dst, const SBRData *src) {
+ //These variables are saved from the previous frame rather than copied
+ dst->bs_freq_res[0] = dst->bs_freq_res[dst->bs_num_env];
+ dst->t_env_num_env_old = dst->t_env[dst->bs_num_env];
+ dst->e_a[0] = -(dst->e_a[1] != dst->bs_num_env);
+
+ //These variables are read from the bitstream and therefore copied
+ memcpy(dst->bs_freq_res+1, src->bs_freq_res+1, sizeof(dst->bs_freq_res)-sizeof(*dst->bs_freq_res));
+ memcpy(dst->t_env, src->t_env, sizeof(dst->t_env));
+ memcpy(dst->t_q, src->t_q, sizeof(dst->t_q));
+ dst->bs_num_env = src->bs_num_env;
+ dst->bs_amp_res = src->bs_amp_res;
+ dst->bs_num_noise = src->bs_num_noise;
+ dst->bs_frame_class = src->bs_frame_class;
+ dst->e_a[1] = src->e_a[1];
+}
+
+/// Read how the envelope and noise floor data is delta coded
+static void read_sbr_dtdf(SpectralBandReplication *sbr, GetBitContext *gb,
+ SBRData *ch_data)
+{
+ get_bits1_vector(gb, ch_data->bs_df_env, ch_data->bs_num_env);
+ get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise);
+}
+
+/// Read inverse filtering data
+static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb,
+ SBRData *ch_data)
+{
+ int i;
+
+ memcpy(ch_data->bs_invf_mode[1], ch_data->bs_invf_mode[0], 5 * sizeof(uint8_t));
+ for (i = 0; i < sbr->n_q; i++)
+ ch_data->bs_invf_mode[0][i] = get_bits(gb, 2);
+}
+
+static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb,
+ SBRData *ch_data, int ch)
+{
+ int bits;
+ int i, j, k;
+ VLC_TYPE (*t_huff)[2], (*f_huff)[2];
+ int t_lav, f_lav;
+ const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
+ const int odd = sbr->n[1] & 1;
+
+ if (sbr->bs_coupling && ch) {
+ if (ch_data->bs_amp_res) {
+ bits = 5;
+ t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_3_0DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_3_0DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
+ } else {
+ bits = 6;
+ t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_1_5DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_1_5DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_1_5DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_1_5DB];
+ }
+ } else {
+ if (ch_data->bs_amp_res) {
+ bits = 6;
+ t_huff = vlc_sbr[T_HUFFMAN_ENV_3_0DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_3_0DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
+ } else {
+ bits = 7;
+ t_huff = vlc_sbr[T_HUFFMAN_ENV_1_5DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_ENV_1_5DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_1_5DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_1_5DB];
+ }
+ }
+
+#if USE_FIXED
+ for (i = 0; i < ch_data->bs_num_env; i++) {
+ if (ch_data->bs_df_env[i]) {
+ // bs_freq_res[0] == bs_freq_res[bs_num_env] from prev frame
+ if (ch_data->bs_freq_res[i + 1] == ch_data->bs_freq_res[i]) {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
+ ch_data->env_facs[i + 1][j].mant = ch_data->env_facs[i][j].mant + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ } else if (ch_data->bs_freq_res[i + 1]) {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
+ k = (j + odd) >> 1; // find k such that f_tablelow[k] <= f_tablehigh[j] < f_tablelow[k + 1]
+ ch_data->env_facs[i + 1][j].mant = ch_data->env_facs[i][k].mant + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ }
+ } else {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
+ k = j ? 2*j - odd : 0; // find k such that f_tablehigh[k] == f_tablelow[j]
+ ch_data->env_facs[i + 1][j].mant = ch_data->env_facs[i][k].mant + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ }
+ }
+ } else {
+ ch_data->env_facs[i + 1][0].mant = delta * get_bits(gb, bits); // bs_env_start_value_balance
+ for (j = 1; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
+ ch_data->env_facs[i + 1][j].mant = ch_data->env_facs[i + 1][j - 1].mant + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
+ }
+ }
+#else
+ for (i = 0; i < ch_data->bs_num_env; i++) {
+ if (ch_data->bs_df_env[i]) {
+ // bs_freq_res[0] == bs_freq_res[bs_num_env] from prev frame
+ if (ch_data->bs_freq_res[i + 1] == ch_data->bs_freq_res[i]) {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
+ ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ } else if (ch_data->bs_freq_res[i + 1]) {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
+ k = (j + odd) >> 1; // find k such that f_tablelow[k] <= f_tablehigh[j] < f_tablelow[k + 1]
+ ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ }
+ } else {
+ for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
+ k = j ? 2*j - odd : 0; // find k such that f_tablehigh[k] == f_tablelow[j]
+ ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
+ }
+ }
+ } else {
+ ch_data->env_facs[i + 1][0] = delta * get_bits(gb, bits); // bs_env_start_value_balance
+ for (j = 1; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
+ ch_data->env_facs[i + 1][j] = ch_data->env_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
+ }
+ }
+#endif /* USE_FIXED */
+
+ //assign 0th elements of env_facs from last elements
+ memcpy(ch_data->env_facs[0], ch_data->env_facs[ch_data->bs_num_env],
+ sizeof(ch_data->env_facs[0]));
+}
+
+static void read_sbr_noise(SpectralBandReplication *sbr, GetBitContext *gb,
+ SBRData *ch_data, int ch)
+{
+ int i, j;
+ VLC_TYPE (*t_huff)[2], (*f_huff)[2];
+ int t_lav, f_lav;
+ int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
+
+ if (sbr->bs_coupling && ch) {
+ t_huff = vlc_sbr[T_HUFFMAN_NOISE_BAL_3_0DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_BAL_3_0DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
+ } else {
+ t_huff = vlc_sbr[T_HUFFMAN_NOISE_3_0DB].table;
+ t_lav = vlc_sbr_lav[T_HUFFMAN_NOISE_3_0DB];
+ f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
+ f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
+ }
+
+#if USE_FIXED
+ for (i = 0; i < ch_data->bs_num_noise; i++) {
+ if (ch_data->bs_df_noise[i]) {
+ for (j = 0; j < sbr->n_q; j++)
+ ch_data->noise_facs[i + 1][j].mant = ch_data->noise_facs[i][j].mant + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav);
+ } else {
+ ch_data->noise_facs[i + 1][0].mant = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level
+ for (j = 1; j < sbr->n_q; j++)
+ ch_data->noise_facs[i + 1][j].mant = ch_data->noise_facs[i + 1][j - 1].mant + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
+ }
+ }
+#else
+ for (i = 0; i < ch_data->bs_num_noise; i++) {
+ if (ch_data->bs_df_noise[i]) {
+ for (j = 0; j < sbr->n_q; j++)
+ ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav);
+ } else {
+ ch_data->noise_facs[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level
+ for (j = 1; j < sbr->n_q; j++)
+ ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
+ }
+ }
+#endif /* USE_FIXED */
+
+ //assign 0th elements of noise_facs from last elements
+ memcpy(ch_data->noise_facs[0], ch_data->noise_facs[ch_data->bs_num_noise],
+ sizeof(ch_data->noise_facs[0]));
+}
+
+static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
+ GetBitContext *gb,
+ int bs_extension_id, int *num_bits_left)
+{
+ switch (bs_extension_id) {
+ case EXTENSION_ID_PS:
+ if (!ac->oc[1].m4ac.ps) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Parametric Stereo signaled to be not-present but was found in the bitstream.\n");
+ skip_bits_long(gb, *num_bits_left); // bs_fill_bits
+ *num_bits_left = 0;
+ } else {
+#if 1
+ *num_bits_left -= AAC_RENAME(ff_ps_read_data)(ac->avctx, gb, &sbr->ps, *num_bits_left);
+ ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
+#else
+ avpriv_report_missing_feature(ac->avctx, "Parametric Stereo");
+ skip_bits_long(gb, *num_bits_left); // bs_fill_bits
+ *num_bits_left = 0;
+#endif
+ }
+ break;
+ default:
+ // some files contain 0-padding
+ if (bs_extension_id || *num_bits_left > 16 || show_bits(gb, *num_bits_left))
+ avpriv_request_sample(ac->avctx, "Reserved SBR extensions");
+ skip_bits_long(gb, *num_bits_left); // bs_fill_bits
+ *num_bits_left = 0;
+ break;
+ }
+}
+
+static int read_sbr_single_channel_element(AACContext *ac,
+ SpectralBandReplication *sbr,
+ GetBitContext *gb)
+{
+ if (get_bits1(gb)) // bs_data_extra
+ skip_bits(gb, 4); // bs_reserved
+
+ if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
+ return -1;
+ read_sbr_dtdf(sbr, gb, &sbr->data[0]);
+ read_sbr_invf(sbr, gb, &sbr->data[0]);
+ read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
+ read_sbr_noise(sbr, gb, &sbr->data[0], 0);
+
+ if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
+ get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
+
+ return 0;
+}
+
+static int read_sbr_channel_pair_element(AACContext *ac,
+ SpectralBandReplication *sbr,
+ GetBitContext *gb)
+{
+ if (get_bits1(gb)) // bs_data_extra
+ skip_bits(gb, 8); // bs_reserved
+
+ if ((sbr->bs_coupling = get_bits1(gb))) {
+ if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
+ return -1;
+ copy_sbr_grid(&sbr->data[1], &sbr->data[0]);
+ read_sbr_dtdf(sbr, gb, &sbr->data[0]);
+ read_sbr_dtdf(sbr, gb, &sbr->data[1]);
+ read_sbr_invf(sbr, gb, &sbr->data[0]);
+ memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
+ memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
+ read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
+ read_sbr_noise(sbr, gb, &sbr->data[0], 0);
+ read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
+ read_sbr_noise(sbr, gb, &sbr->data[1], 1);
+ } else {
+ if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]) ||
+ read_sbr_grid(ac, sbr, gb, &sbr->data[1]))
+ return -1;
+ read_sbr_dtdf(sbr, gb, &sbr->data[0]);
+ read_sbr_dtdf(sbr, gb, &sbr->data[1]);
+ read_sbr_invf(sbr, gb, &sbr->data[0]);
+ read_sbr_invf(sbr, gb, &sbr->data[1]);
+ read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
+ read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
+ read_sbr_noise(sbr, gb, &sbr->data[0], 0);
+ read_sbr_noise(sbr, gb, &sbr->data[1], 1);
+ }
+
+ if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
+ get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
+ if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb)))
+ get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]);
+
+ return 0;
+}
+
+static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
+ GetBitContext *gb, int id_aac)
+{
+ unsigned int cnt = get_bits_count(gb);
+
+ sbr->id_aac = id_aac;
+
+ if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
+ if (read_sbr_single_channel_element(ac, sbr, gb)) {
+ sbr_turnoff(sbr);
+ return get_bits_count(gb) - cnt;
+ }
+ } else if (id_aac == TYPE_CPE) {
+ if (read_sbr_channel_pair_element(ac, sbr, gb)) {
+ sbr_turnoff(sbr);
+ return get_bits_count(gb) - cnt;
+ }
+ } else {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);
+ sbr_turnoff(sbr);
+ return get_bits_count(gb) - cnt;
+ }
+ if (get_bits1(gb)) { // bs_extended_data
+ int num_bits_left = get_bits(gb, 4); // bs_extension_size
+ if (num_bits_left == 15)
+ num_bits_left += get_bits(gb, 8); // bs_esc_count
+
+ num_bits_left <<= 3;
+ while (num_bits_left > 7) {
+ num_bits_left -= 2;
+ read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id
+ }
+ if (num_bits_left < 0) {
+ av_log(ac->avctx, AV_LOG_ERROR, "SBR Extension over read.\n");
+ }
+ if (num_bits_left > 0)
+ skip_bits(gb, num_bits_left);
+ }
+
+ return get_bits_count(gb) - cnt;
+}
+
+static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr)
+{
+ int err;
+ err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params);
+ if (err >= 0)
+ err = sbr_make_f_derived(ac, sbr);
+ if (err < 0) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "SBR reset failed. Switching SBR to pure upsampling mode.\n");
+ sbr_turnoff(sbr);
+ }
+}
+
+/**
+ * Decode Spectral Band Replication extension data; reference: table 4.55.
+ *
+ * @param crc flag indicating the presence of CRC checksum
+ * @param cnt length of TYPE_FIL syntactic element in bytes
+ *
+ * @return Returns number of bytes consumed from the TYPE_FIL element.
+ */
+int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, SpectralBandReplication *sbr,
+ GetBitContext *gb_host, int crc, int cnt, int id_aac)
+{
+ unsigned int num_sbr_bits = 0, num_align_bits;
+ unsigned bytes_read;
+ GetBitContext gbc = *gb_host, *gb = &gbc;
+ skip_bits_long(gb_host, cnt*8 - 4);
+
+ sbr->reset = 0;
+
+ if (!sbr->sample_rate)
+ sbr->sample_rate = 2 * ac->oc[1].m4ac.sample_rate; //TODO use the nominal sample rate for arbitrary sample rate support
+ if (!ac->oc[1].m4ac.ext_sample_rate)
+ ac->oc[1].m4ac.ext_sample_rate = 2 * ac->oc[1].m4ac.sample_rate;
+
+ if (crc) {
+ skip_bits(gb, 10); // bs_sbr_crc_bits; TODO - implement CRC check
+ num_sbr_bits += 10;
+ }
+
+ //Save some state from the previous frame.
+ sbr->kx[0] = sbr->kx[1];
+ sbr->m[0] = sbr->m[1];
+ sbr->kx_and_m_pushed = 1;
+
+ num_sbr_bits++;
+ if (get_bits1(gb)) // bs_header_flag
+ num_sbr_bits += read_sbr_header(sbr, gb);
+
+ if (sbr->reset)
+ sbr_reset(ac, sbr);
+
+ if (sbr->start)
+ num_sbr_bits += read_sbr_data(ac, sbr, gb, id_aac);
+
+ num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7;
+ bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3);
+
+ if (bytes_read > cnt) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_read);
+ }
+ return cnt;
+}
+
+/**
+ * Analysis QMF Bank (14496-3 sp04 p206)
+ *
+ * @param x pointer to the beginning of the first sample window
+ * @param W array of complex-valued samples split into subbands
+ */
+#ifndef sbr_qmf_analysis
+#if USE_FIXED
+static void sbr_qmf_analysis(AVFixedDSPContext *dsp, FFTContext *mdct,
+#else
+static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
+#endif /* USE_FIXED */
+ SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x,
+ INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx)
+{
+ int i;
+ memcpy(x , x+1024, (320-32)*sizeof(x[0]));
+ memcpy(x+288, in, 1024*sizeof(x[0]));
+ for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
+ // are not supported
+ dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
+ sbrdsp->sum64x5(z);
+ sbrdsp->qmf_pre_shuffle(z);
+ mdct->imdct_half(mdct, z, z+64);
+ sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
+ x += 32;
+ }
+}
+#endif
+
+/**
+ * Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank
+ * (14496-3 sp04 p206)
+ */
+#ifndef sbr_qmf_synthesis
+static void sbr_qmf_synthesis(FFTContext *mdct,
+#if USE_FIXED
+ SBRDSPContext *sbrdsp, AVFixedDSPContext *dsp,
+#else
+ SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp,
+#endif /* USE_FIXED */
+ INTFLOAT *out, INTFLOAT X[2][38][64],
+ INTFLOAT mdct_buf[2][64],
+ INTFLOAT *v0, int *v_off, const unsigned int div)
+{
+ int i, n;
+ const INTFLOAT *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
+ const int step = 128 >> div;
+ INTFLOAT *v;
+ for (i = 0; i < 32; i++) {
+ if (*v_off < step) {
+ int saved_samples = (1280 - 128) >> div;
+ memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(INTFLOAT));
+ *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
+ } else {
+ *v_off -= step;
+ }
+ v = v0 + *v_off;
+ if (div) {
+ for (n = 0; n < 32; n++) {
+ X[0][i][ n] = -X[0][i][n];
+ X[0][i][32+n] = X[1][i][31-n];
+ }
+ mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
+ sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
+ } else {
+ sbrdsp->neg_odd_64(X[1][i]);
+ mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
+ mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
+ sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
+ }
+ dsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 512 >> div), sbr_qmf_window + (256 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 704 >> div), sbr_qmf_window + (320 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 768 >> div), sbr_qmf_window + (384 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + ( 960 >> div), sbr_qmf_window + (448 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + (1024 >> div), sbr_qmf_window + (512 >> div), out , 64 >> div);
+ dsp->vector_fmul_add(out, v + (1216 >> div), sbr_qmf_window + (576 >> div), out , 64 >> div);
+ out += 64 >> div;
+ }
+}
+#endif
+
+/// Generate the subband filtered lowband
+static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr,
+ INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2],
+ int buf_idx)
+{
+ int i, k;
+ const int t_HFGen = 8;
+ const int i_f = 32;
+ memset(X_low, 0, 32*sizeof(*X_low));
+ for (k = 0; k < sbr->kx[1]; k++) {
+ for (i = t_HFGen; i < i_f + t_HFGen; i++) {
+ X_low[k][i][0] = W[buf_idx][i - t_HFGen][k][0];
+ X_low[k][i][1] = W[buf_idx][i - t_HFGen][k][1];
+ }
+ }
+ buf_idx = 1-buf_idx;
+ for (k = 0; k < sbr->kx[0]; k++) {
+ for (i = 0; i < t_HFGen; i++) {
+ X_low[k][i][0] = W[buf_idx][i + i_f - t_HFGen][k][0];
+ X_low[k][i][1] = W[buf_idx][i + i_f - t_HFGen][k][1];
+ }
+ }
+ return 0;
+}
+
+/// High Frequency Generator (14496-3 sp04 p215)
+static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr,
+ INTFLOAT X_high[64][40][2], const INTFLOAT X_low[32][40][2],
+ const INTFLOAT (*alpha0)[2], const INTFLOAT (*alpha1)[2],
+ const INTFLOAT bw_array[5], const uint8_t *t_env,
+ int bs_num_env)
+{
+ int j, x;
+ int g = 0;
+ int k = sbr->kx[1];
+ for (j = 0; j < sbr->num_patches; j++) {
+ for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) {
+ const int p = sbr->patch_start_subband[j] + x;
+ while (g <= sbr->n_q && k >= sbr->f_tablenoise[g])
+ g++;
+ g--;
+
+ if (g < 0) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "ERROR : no subband found for frequency %d\n", k);
+ return -1;
+ }
+
+ sbr->dsp.hf_gen(X_high[k] + ENVELOPE_ADJUSTMENT_OFFSET,
+ X_low[p] + ENVELOPE_ADJUSTMENT_OFFSET,
+ alpha0[p], alpha1[p], bw_array[g],
+ 2 * t_env[0], 2 * t_env[bs_num_env]);
+ }
+ }
+ if (k < sbr->m[1] + sbr->kx[1])
+ memset(X_high + k, 0, (sbr->m[1] + sbr->kx[1] - k) * sizeof(*X_high));
+
+ return 0;
+}
+
+/// Generate the subband filtered lowband
+static int sbr_x_gen(SpectralBandReplication *sbr, INTFLOAT X[2][38][64],
+ const INTFLOAT Y0[38][64][2], const INTFLOAT Y1[38][64][2],
+ const INTFLOAT X_low[32][40][2], int ch)
+{
+ int k, i;
+ const int i_f = 32;
+ const int i_Temp = FFMAX(2*sbr->data[ch].t_env_num_env_old - i_f, 0);
+ memset(X, 0, 2*sizeof(*X));
+ for (k = 0; k < sbr->kx[0]; k++) {
+ for (i = 0; i < i_Temp; i++) {
+ X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
+ X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
+ }
+ }
+ for (; k < sbr->kx[0] + sbr->m[0]; k++) {
+ for (i = 0; i < i_Temp; i++) {
+ X[0][i][k] = Y0[i + i_f][k][0];
+ X[1][i][k] = Y0[i + i_f][k][1];
+ }
+ }
+
+ for (k = 0; k < sbr->kx[1]; k++) {
+ for (i = i_Temp; i < 38; i++) {
+ X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
+ X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
+ }
+ }
+ for (; k < sbr->kx[1] + sbr->m[1]; k++) {
+ for (i = i_Temp; i < i_f; i++) {
+ X[0][i][k] = Y1[i][k][0];
+ X[1][i][k] = Y1[i][k][1];
+ }
+ }
+ return 0;
+}
+
+/** High Frequency Adjustment (14496-3 sp04 p217) and Mapping
+ * (14496-3 sp04 p217)
+ */
+static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
+ SBRData *ch_data, int e_a[2])
+{
+ int e, i, m;
+
+ memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1]));
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+ const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]];
+ uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
+ int k;
+
+ if (sbr->kx[1] != table[0]) {
+ av_log(ac->avctx, AV_LOG_ERROR, "kx != f_table{high,low}[0]. "
+ "Derived frequency tables were not regenerated.\n");
+ sbr_turnoff(sbr);
+ return AVERROR_BUG;
+ }
+ for (i = 0; i < ilim; i++)
+ for (m = table[i]; m < table[i + 1]; m++)
+ sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];
+
+ // ch_data->bs_num_noise > 1 => 2 noise floors
+ k = (ch_data->bs_num_noise > 1) && (ch_data->t_env[e] >= ch_data->t_q[1]);
+ for (i = 0; i < sbr->n_q; i++)
+ for (m = sbr->f_tablenoise[i]; m < sbr->f_tablenoise[i + 1]; m++)
+ sbr->q_mapped[e][m - sbr->kx[1]] = ch_data->noise_facs[k+1][i];
+
+ for (i = 0; i < sbr->n[1]; i++) {
+ if (ch_data->bs_add_harmonic_flag) {
+ const unsigned int m_midpoint =
+ (sbr->f_tablehigh[i] + sbr->f_tablehigh[i + 1]) >> 1;
+
+ ch_data->s_indexmapped[e + 1][m_midpoint - sbr->kx[1]] = ch_data->bs_add_harmonic[i] *
+ (e >= e_a[1] || (ch_data->s_indexmapped[0][m_midpoint - sbr->kx[1]] == 1));
+ }
+ }
+
+ for (i = 0; i < ilim; i++) {
+ int additional_sinusoid_present = 0;
+ for (m = table[i]; m < table[i + 1]; m++) {
+ if (ch_data->s_indexmapped[e + 1][m - sbr->kx[1]]) {
+ additional_sinusoid_present = 1;
+ break;
+ }
+ }
+ memset(&sbr->s_mapped[e][table[i] - sbr->kx[1]], additional_sinusoid_present,
+ (table[i + 1] - table[i]) * sizeof(sbr->s_mapped[e][0]));
+ }
+ }
+
+ memcpy(ch_data->s_indexmapped[0], ch_data->s_indexmapped[ch_data->bs_num_env], sizeof(ch_data->s_indexmapped[0]));
+ return 0;
+}
+
+/// Estimation of current envelope (14496-3 sp04 p218)
+static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2],
+ SpectralBandReplication *sbr, SBRData *ch_data)
+{
+ int e, m;
+ int kx1 = sbr->kx[1];
+
+ if (sbr->bs_interpol_freq) {
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+#if USE_FIXED
+ const SoftFloat recip_env_size = av_int2sf(0x20000000 / (ch_data->t_env[e + 1] - ch_data->t_env[e]), 30);
+#else
+ const float recip_env_size = 0.5f / (ch_data->t_env[e + 1] - ch_data->t_env[e]);
+#endif /* USE_FIXED */
+ int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
+ int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
+
+ for (m = 0; m < sbr->m[1]; m++) {
+ AAC_FLOAT sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
+#if USE_FIXED
+ e_curr[e][m] = av_mul_sf(sum, recip_env_size);
+#else
+ e_curr[e][m] = sum * recip_env_size;
+#endif /* USE_FIXED */
+ }
+ }
+ } else {
+ int k, p;
+
+ for (e = 0; e < ch_data->bs_num_env; e++) {
+ const int env_size = 2 * (ch_data->t_env[e + 1] - ch_data->t_env[e]);
+ int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
+ int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
+ const uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
+
+ for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
+#if USE_FIXED
+ SoftFloat sum = { 0, 0 };
+ const SoftFloat den = av_int2sf(0x20000000 / (env_size * (table[p + 1] - table[p])), 29);
+ for (k = table[p]; k < table[p + 1]; k++) {
+ sum = av_add_sf(sum, sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb));
+ }
+ sum = av_mul_sf(sum, den);
+#else
+ float sum = 0.0f;
+ const int den = env_size * (table[p + 1] - table[p]);
+
+ for (k = table[p]; k < table[p + 1]; k++) {
+ sum += sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb);
+ }
+ sum /= den;
+#endif /* USE_FIXED */
+ for (k = table[p]; k < table[p + 1]; k++) {
+ e_curr[e][k - kx1] = sum;
+ }
+ }
+ }
+ }
+}
+
+void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
+ INTFLOAT* L, INTFLOAT* R)
+{
+ int downsampled = ac->oc[1].m4ac.ext_sample_rate < sbr->sample_rate;
+ int ch;
+ int nch = (id_aac == TYPE_CPE) ? 2 : 1;
+ int err;
+
+ if (id_aac != sbr->id_aac) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "element type mismatch %d != %d\n", id_aac, sbr->id_aac);
+ sbr_turnoff(sbr);
+ }
+
+ if (!sbr->kx_and_m_pushed) {
+ sbr->kx[0] = sbr->kx[1];
+ sbr->m[0] = sbr->m[1];
+ } else {
+ sbr->kx_and_m_pushed = 0;
+ }
+
+ if (sbr->start) {
+ sbr_dequant(sbr, id_aac);
+ }
+ for (ch = 0; ch < nch; ch++) {
+ /* decode channel */
+ sbr_qmf_analysis(ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
+ (INTFLOAT*)sbr->qmf_filter_scratch,
+ sbr->data[ch].W, sbr->data[ch].Ypos);
+ sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low,
+ (const INTFLOAT (*)[32][32][2]) sbr->data[ch].W,
+ sbr->data[ch].Ypos);
+ sbr->data[ch].Ypos ^= 1;
+ if (sbr->start) {
+ sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1,
+ (const INTFLOAT (*)[40][2]) sbr->X_low, sbr->k[0]);
+ sbr_chirp(sbr, &sbr->data[ch]);
+ av_assert0(sbr->data[ch].bs_num_env > 0);
+ sbr_hf_gen(ac, sbr, sbr->X_high,
+ (const INTFLOAT (*)[40][2]) sbr->X_low,
+ (const INTFLOAT (*)[2]) sbr->alpha0,
+ (const INTFLOAT (*)[2]) sbr->alpha1,
+ sbr->data[ch].bw_array, sbr->data[ch].t_env,
+ sbr->data[ch].bs_num_env);
+
+ // hf_adj
+ err = sbr_mapping(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
+ if (!err) {
+ sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]);
+ sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
+ sbr->c.sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
+ (const INTFLOAT (*)[40][2]) sbr->X_high,
+ sbr, &sbr->data[ch],
+ sbr->data[ch].e_a);
+ }
+ }
+
+ /* synthesis */
+ sbr->c.sbr_x_gen(sbr, sbr->X[ch],
+ (const INTFLOAT (*)[64][2]) sbr->data[ch].Y[1-sbr->data[ch].Ypos],
+ (const INTFLOAT (*)[64][2]) sbr->data[ch].Y[ sbr->data[ch].Ypos],
+ (const INTFLOAT (*)[40][2]) sbr->X_low, ch);
+ }
+
+ if (ac->oc[1].m4ac.ps == 1) {
+ if (sbr->ps.start) {
+ AAC_RENAME(ff_ps_apply)(ac->avctx, &sbr->ps, sbr->X[0], sbr->X[1], sbr->kx[1] + sbr->m[1]);
+ } else {
+ memcpy(sbr->X[1], sbr->X[0], sizeof(sbr->X[0]));
+ }
+ nch = 2;
+ }
+
+ sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
+ L, sbr->X[0], sbr->qmf_filter_scratch,
+ sbr->data[0].synthesis_filterbank_samples,
+ &sbr->data[0].synthesis_filterbank_samples_offset,
+ downsampled);
+ if (nch == 2)
+ sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
+ R, sbr->X[1], sbr->qmf_filter_scratch,
+ sbr->data[1].synthesis_filterbank_samples,
+ &sbr->data[1].synthesis_filterbank_samples_offset,
+ downsampled);
+}
+
+static void aacsbr_func_ptr_init(AACSBRContext *c)
+{
+ c->sbr_lf_gen = sbr_lf_gen;
+ c->sbr_hf_assemble = sbr_hf_assemble;
+ c->sbr_x_gen = sbr_x_gen;
+ c->sbr_hf_inverse_filter = sbr_hf_inverse_filter;
+
+#if !USE_FIXED
+ if(ARCH_MIPS)
+ ff_aacsbr_func_ptr_init_mips(c);
+#endif
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacsbrdata.h b/chromium/third_party/ffmpeg/libavcodec/aacsbrdata.h
index c667e0b4eca..4ff8fae9136 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacsbrdata.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aacsbrdata.h
@@ -30,6 +30,7 @@
#include <stdint.h>
#include "libavutil/mem.h"
+#include "aac_defines.h"
///< Huffman tables for SBR
@@ -267,268 +268,268 @@ static const int8_t sbr_offset[6][16] = {
};
/* First eight entries repeated at end to simplify SIMD implementations. */
-const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
-{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
-{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
-{ 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087},
-{-0.01053049862020, -0.66959058036166}, {-0.91266367957293, -0.11522938140034},
-{ 0.54840422910309, 0.75221367176302}, { 0.40009252867955, -0.98929400334421},
-{-0.99867974711855, -0.88147068645358}, {-0.95531076805040, 0.90908757154593},
-{-0.45725933317144, -0.56716323646760}, {-0.72929675029275, -0.98008272727324},
-{ 0.75622801399036, 0.20950329995549}, { 0.07069442601050, -0.78247898470706},
-{ 0.74496252926055, -0.91169004445807}, {-0.96440182703856, -0.94739918296622},
-{ 0.30424629369539, -0.49438267012479}, { 0.66565033746925, 0.64652935542491},
-{ 0.91697008020594, 0.17514097332009}, {-0.70774918760427, 0.52548653416543},
-{-0.70051415345560, -0.45340028808763}, {-0.99496513054797, -0.90071908066973},
-{ 0.98164490790123, -0.77463155528697}, {-0.54671580548181, -0.02570928536004},
-{-0.01689629065389, 0.00287506445732}, {-0.86110349531986, 0.42548583726477},
-{-0.98892980586032, -0.87881132267556}, { 0.51756627678691, 0.66926784710139},
-{-0.99635026409640, -0.58107730574765}, {-0.99969370862163, 0.98369989360250},
-{ 0.55266258627194, 0.59449057465591}, { 0.34581177741673, 0.94879421061866},
-{ 0.62664209577999, -0.74402970906471}, {-0.77149701404973, -0.33883658042801},
-{-0.91592244254432, 0.03687901376713}, {-0.76285492357887, -0.91371867919124},
-{ 0.79788337195331, -0.93180971199849}, { 0.54473080610200, -0.11919206037186},
-{-0.85639281671058, 0.42429854760451}, {-0.92882402971423, 0.27871809078609},
-{-0.11708371046774, -0.99800843444966}, { 0.21356749817493, -0.90716295627033},
-{-0.76191692573909, 0.99768118356265}, { 0.98111043100884, -0.95854459734407},
-{-0.85913269895572, 0.95766566168880}, {-0.93307242253692, 0.49431757696466},
-{ 0.30485754879632, -0.70540034357529}, { 0.85289650925190, 0.46766131791044},
-{ 0.91328082618125, -0.99839597361769}, {-0.05890199924154, 0.70741827819497},
-{ 0.28398686150148, 0.34633555702188}, { 0.95258164539612, -0.54893416026939},
-{-0.78566324168507, -0.75568541079691}, {-0.95789495447877, -0.20423194696966},
-{ 0.82411158711197, 0.96654618432562}, {-0.65185446735885, -0.88734990773289},
-{-0.93643603134666, 0.99870790442385}, { 0.91427159529618, -0.98290505544444},
-{-0.70395684036886, 0.58796798221039}, { 0.00563771969365, 0.61768196727244},
-{ 0.89065051931895, 0.52783352697585}, {-0.68683707712762, 0.80806944710339},
-{ 0.72165342518718, -0.69259857349564}, {-0.62928247730667, 0.13627037407335},
-{ 0.29938434065514, -0.46051329682246}, {-0.91781958879280, -0.74012716684186},
-{ 0.99298717043688, 0.40816610075661}, { 0.82368298622748, -0.74036047190173},
-{-0.98512833386833, -0.99972330709594}, {-0.95915368242257, -0.99237800466040},
-{-0.21411126572790, -0.93424819052545}, {-0.68821476106884, -0.26892306315457},
-{ 0.91851997982317, 0.09358228901785}, {-0.96062769559127, 0.36099095133739},
-{ 0.51646184922287, -0.71373332873917}, { 0.61130721139669, 0.46950141175917},
-{ 0.47336129371299, -0.27333178296162}, { 0.90998308703519, 0.96715662938132},
-{ 0.44844799194357, 0.99211574628306}, { 0.66614891079092, 0.96590176169121},
-{ 0.74922239129237, -0.89879858826087}, {-0.99571588506485, 0.52785521494349},
-{ 0.97401082477563, -0.16855870075190}, { 0.72683747733879, -0.48060774432251},
-{ 0.95432193457128, 0.68849603408441}, {-0.72962208425191, -0.76608443420917},
-{-0.85359479233537, 0.88738125901579}, {-0.81412430338535, -0.97480768049637},
-{-0.87930772356786, 0.74748307690436}, {-0.71573331064977, -0.98570608178923},
-{ 0.83524300028228, 0.83702537075163}, {-0.48086065601423, -0.98848504923531},
-{ 0.97139128574778, 0.80093621198236}, { 0.51992825347895, 0.80247631400510},
-{-0.00848591195325, -0.76670128000486}, {-0.70294374303036, 0.55359910445577},
-{-0.95894428168140, -0.43265504344783}, { 0.97079252950321, 0.09325857238682},
-{-0.92404293670797, 0.85507704027855}, {-0.69506469500450, 0.98633412625459},
-{ 0.26559203620024, 0.73314307966524}, { 0.28038443336943, 0.14537913654427},
-{-0.74138124825523, 0.99310339807762}, {-0.01752795995444, -0.82616635284178},
-{-0.55126773094930, -0.98898543862153}, { 0.97960898850996, -0.94021446752851},
-{-0.99196309146936, 0.67019017358456}, {-0.67684928085260, 0.12631491649378},
-{ 0.09140039465500, -0.20537731453108}, {-0.71658965751996, -0.97788200391224},
-{ 0.81014640078925, 0.53722648362443}, { 0.40616991671205, -0.26469008598449},
-{-0.67680188682972, 0.94502052337695}, { 0.86849774348749, -0.18333598647899},
-{-0.99500381284851, -0.02634122068550}, { 0.84329189340667, 0.10406957462213},
-{-0.09215968531446, 0.69540012101253}, { 0.99956173327206, -0.12358542001404},
-{-0.79732779473535, -0.91582524736159}, { 0.96349973642406, 0.96640458041000},
-{-0.79942778496547, 0.64323902822857}, {-0.11566039853896, 0.28587846253726},
-{-0.39922954514662, 0.94129601616966}, { 0.99089197565987, -0.92062625581587},
-{ 0.28631285179909, -0.91035047143603}, {-0.83302725605608, -0.67330410892084},
-{ 0.95404443402072, 0.49162765398743}, {-0.06449863579434, 0.03250560813135},
-{-0.99575054486311, 0.42389784469507}, {-0.65501142790847, 0.82546114655624},
-{-0.81254441908887, -0.51627234660629}, {-0.99646369485481, 0.84490533520752},
-{ 0.00287840603348, 0.64768261158166}, { 0.70176989408455, -0.20453028573322},
-{ 0.96361882270190, 0.40706967140989}, {-0.68883758192426, 0.91338958840772},
-{-0.34875585502238, 0.71472290693300}, { 0.91980081243087, 0.66507455644919},
-{-0.99009048343881, 0.85868021604848}, { 0.68865791458395, 0.55660316809678},
-{-0.99484402129368, -0.20052559254934}, { 0.94214511408023, -0.99696425367461},
-{-0.67414626793544, 0.49548221180078}, {-0.47339353684664, -0.85904328834047},
-{ 0.14323651387360, -0.94145598222488}, {-0.29268293575672, 0.05759224927952},
-{ 0.43793861458754, -0.78904969892724}, {-0.36345126374441, 0.64874435357162},
-{-0.08750604656825, 0.97686944362527}, {-0.96495267812511, -0.53960305946511},
-{ 0.55526940659947, 0.78891523734774}, { 0.73538215752630, 0.96452072373404},
-{-0.30889773919437, -0.80664389776860}, { 0.03574995626194, -0.97325616900959},
-{ 0.98720684660488, 0.48409133691962}, {-0.81689296271203, -0.90827703628298},
-{ 0.67866860118215, 0.81284503870856}, {-0.15808569732583, 0.85279555024382},
-{ 0.80723395114371, -0.24717418514605}, { 0.47788757329038, -0.46333147839295},
-{ 0.96367554763201, 0.38486749303242}, {-0.99143875716818, -0.24945277239809},
-{ 0.83081876925833, -0.94780851414763}, {-0.58753191905341, 0.01290772389163},
-{ 0.95538108220960, -0.85557052096538}, {-0.96490920476211, -0.64020970923102},
-{-0.97327101028521, 0.12378128133110}, { 0.91400366022124, 0.57972471346930},
-{-0.99925837363824, 0.71084847864067}, {-0.86875903507313, -0.20291699203564},
-{-0.26240034795124, -0.68264554369108}, {-0.24664412953388, -0.87642273115183},
-{ 0.02416275806869, 0.27192914288905}, { 0.82068619590515, -0.85087787994476},
-{ 0.88547373760759, -0.89636802901469}, {-0.18173078152226, -0.26152145156800},
-{ 0.09355476558534, 0.54845123045604}, {-0.54668414224090, 0.95980774020221},
-{ 0.37050990604091, -0.59910140383171}, {-0.70373594262891, 0.91227665827081},
-{-0.34600785879594, -0.99441426144200}, {-0.68774481731008, -0.30238837956299},
-{-0.26843291251234, 0.83115668004362}, { 0.49072334613242, -0.45359708737775},
-{ 0.38975993093975, 0.95515358099121}, {-0.97757125224150, 0.05305894580606},
-{-0.17325552859616, -0.92770672250494}, { 0.99948035025744, 0.58285545563426},
-{-0.64946246527458, 0.68645507104960}, {-0.12016920576437, -0.57147322153312},
-{-0.58947456517751, -0.34847132454388}, {-0.41815140454465, 0.16276422358861},
-{ 0.99885650204884, 0.11136095490444}, {-0.56649614128386, -0.90494866361587},
-{ 0.94138021032330, 0.35281916733018}, {-0.75725076534641, 0.53650549640587},
-{ 0.20541973692630, -0.94435144369918}, { 0.99980371023351, 0.79835913565599},
-{ 0.29078277605775, 0.35393777921520}, {-0.62858772103030, 0.38765693387102},
-{ 0.43440904467688, -0.98546330463232}, {-0.98298583762390, 0.21021524625209},
-{ 0.19513029146934, -0.94239832251867}, {-0.95476662400101, 0.98364554179143},
-{ 0.93379635304810, -0.70881994583682}, {-0.85235410573336, -0.08342347966410},
-{-0.86425093011245, -0.45795025029466}, { 0.38879779059045, 0.97274429344593},
-{ 0.92045124735495, -0.62433652524220}, { 0.89162532251878, 0.54950955570563},
-{-0.36834336949252, 0.96458298020975}, { 0.93891760988045, -0.89968353740388},
-{ 0.99267657565094, -0.03757034316958}, {-0.94063471614176, 0.41332338538963},
-{ 0.99740224117019, -0.16830494996370}, {-0.35899413170555, -0.46633226649613},
-{ 0.05237237274947, -0.25640361602661}, { 0.36703583957424, -0.38653265641875},
-{ 0.91653180367913, -0.30587628726597}, { 0.69000803499316, 0.90952171386132},
-{-0.38658751133527, 0.99501571208985}, {-0.29250814029851, 0.37444994344615},
-{-0.60182204677608, 0.86779651036123}, {-0.97418588163217, 0.96468523666475},
-{ 0.88461574003963, 0.57508405276414}, { 0.05198933055162, 0.21269661669964},
-{-0.53499621979720, 0.97241553731237}, {-0.49429560226497, 0.98183865291903},
-{-0.98935142339139, -0.40249159006933}, {-0.98081380091130, -0.72856895534041},
-{-0.27338148835532, 0.99950922447209}, { 0.06310802338302, -0.54539587529618},
-{-0.20461677199539, -0.14209977628489}, { 0.66223843141647, 0.72528579940326},
-{-0.84764345483665, 0.02372316801261}, {-0.89039863483811, 0.88866581484602},
-{ 0.95903308477986, 0.76744927173873}, { 0.73504123909879, -0.03747203173192},
-{-0.31744434966056, -0.36834111883652}, {-0.34110827591623, 0.40211222807691},
-{ 0.47803883714199, -0.39423219786288}, { 0.98299195879514, 0.01989791390047},
-{-0.30963073129751, -0.18076720599336}, { 0.99992588229018, -0.26281872094289},
-{-0.93149731080767, -0.98313162570490}, { 0.99923472302773, -0.80142993767554},
-{-0.26024169633417, -0.75999759855752}, {-0.35712514743563, 0.19298963768574},
-{-0.99899084509530, 0.74645156992493}, { 0.86557171579452, 0.55593866696299},
-{ 0.33408042438752, 0.86185953874709}, { 0.99010736374716, 0.04602397576623},
-{-0.66694269691195, -0.91643611810148}, { 0.64016792079480, 0.15649530836856},
-{ 0.99570534804836, 0.45844586038111}, {-0.63431466947340, 0.21079116459234},
-{-0.07706847005931, -0.89581437101329}, { 0.98590090577724, 0.88241721133981},
-{ 0.80099335254678, -0.36851896710853}, { 0.78368131392666, 0.45506999802597},
-{ 0.08707806671691, 0.80938994918745}, {-0.86811883080712, 0.39347308654705},
-{-0.39466529740375, -0.66809432114456}, { 0.97875325649683, -0.72467840967746},
-{-0.95038560288864, 0.89563219587625}, { 0.17005239424212, 0.54683053962658},
-{-0.76910792026848, -0.96226617549298}, { 0.99743281016846, 0.42697157037567},
-{ 0.95437383549973, 0.97002324109952}, { 0.99578905365569, -0.54106826257356},
-{ 0.28058259829990, -0.85361420634036}, { 0.85256524470573, -0.64567607735589},
-{-0.50608540105128, -0.65846015480300}, {-0.97210735183243, -0.23095213067791},
-{ 0.95424048234441, -0.99240147091219}, {-0.96926570524023, 0.73775654896574},
-{ 0.30872163214726, 0.41514960556126}, {-0.24523839572639, 0.63206633394807},
-{-0.33813265086024, -0.38661779441897}, {-0.05826828420146, -0.06940774188029},
-{-0.22898461455054, 0.97054853316316}, {-0.18509915019881, 0.47565762892084},
-{-0.10488238045009, -0.87769947402394}, {-0.71886586182037, 0.78030982480538},
-{ 0.99793873738654, 0.90041310491497}, { 0.57563307626120, -0.91034337352097},
-{ 0.28909646383717, 0.96307783970534}, { 0.42188998312520, 0.48148651230437},
-{ 0.93335049681047, -0.43537023883588}, {-0.97087374418267, 0.86636445711364},
-{ 0.36722871286923, 0.65291654172961}, {-0.81093025665696, 0.08778370229363},
-{-0.26240603062237, -0.92774095379098}, { 0.83996497984604, 0.55839849139647},
-{-0.99909615720225, -0.96024605713970}, { 0.74649464155061, 0.12144893606462},
-{-0.74774595569805, -0.26898062008959}, { 0.95781667469567, -0.79047927052628},
-{ 0.95472308713099, -0.08588776019550}, { 0.48708332746299, 0.99999041579432},
-{ 0.46332038247497, 0.10964126185063}, {-0.76497004940162, 0.89210929242238},
-{ 0.57397389364339, 0.35289703373760}, { 0.75374316974495, 0.96705214651335},
-{-0.59174397685714, -0.89405370422752}, { 0.75087906691890, -0.29612672982396},
-{-0.98607857336230, 0.25034911730023}, {-0.40761056640505, -0.90045573444695},
-{ 0.66929266740477, 0.98629493401748}, {-0.97463695257310, -0.00190223301301},
-{ 0.90145509409859, 0.99781390365446}, {-0.87259289048043, 0.99233587353666},
-{-0.91529461447692, -0.15698707534206}, {-0.03305738840705, -0.37205262859764},
-{ 0.07223051368337, -0.88805001733626}, { 0.99498012188353, 0.97094358113387},
-{-0.74904939500519, 0.99985483641521}, { 0.04585228574211, 0.99812337444082},
-{-0.89054954257993, -0.31791913188064}, {-0.83782144651251, 0.97637632547466},
-{ 0.33454804933804, -0.86231516800408}, {-0.99707579362824, 0.93237990079441},
-{-0.22827527843994, 0.18874759397997}, { 0.67248046289143, -0.03646211390569},
-{-0.05146538187944, -0.92599700120679}, { 0.99947295749905, 0.93625229707912},
-{ 0.66951124390363, 0.98905825623893}, {-0.99602956559179, -0.44654715757688},
-{ 0.82104905483590, 0.99540741724928}, { 0.99186510988782, 0.72023001312947},
-{-0.65284592392918, 0.52186723253637}, { 0.93885443798188, -0.74895312615259},
-{ 0.96735248738388, 0.90891816978629}, {-0.22225968841114, 0.57124029781228},
-{-0.44132783753414, -0.92688840659280}, {-0.85694974219574, 0.88844532719844},
-{ 0.91783042091762, -0.46356892383970}, { 0.72556974415690, -0.99899555770747},
-{-0.99711581834508, 0.58211560180426}, { 0.77638976371966, 0.94321834873819},
-{ 0.07717324253925, 0.58638399856595}, {-0.56049829194163, 0.82522301569036},
-{ 0.98398893639988, 0.39467440420569}, { 0.47546946844938, 0.68613044836811},
-{ 0.65675089314631, 0.18331637134880}, { 0.03273375457980, -0.74933109564108},
-{-0.38684144784738, 0.51337349030406}, {-0.97346267944545, -0.96549364384098},
-{-0.53282156061942, -0.91423265091354}, { 0.99817310731176, 0.61133572482148},
-{-0.50254500772635, -0.88829338134294}, { 0.01995873238855, 0.85223515096765},
-{ 0.99930381973804, 0.94578896296649}, { 0.82907767600783, -0.06323442598128},
-{-0.58660709669728, 0.96840773806582}, {-0.17573736667267, -0.48166920859485},
-{ 0.83434292401346, -0.13023450646997}, { 0.05946491307025, 0.20511047074866},
-{ 0.81505484574602, -0.94685947861369}, {-0.44976380954860, 0.40894572671545},
-{-0.89746474625671, 0.99846578838537}, { 0.39677256130792, -0.74854668609359},
-{-0.07588948563079, 0.74096214084170}, { 0.76343198951445, 0.41746629422634},
-{-0.74490104699626, 0.94725911744610}, { 0.64880119792759, 0.41336660830571},
-{ 0.62319537462542, -0.93098313552599}, { 0.42215817594807, -0.07712787385208},
-{ 0.02704554141885, -0.05417518053666}, { 0.80001773566818, 0.91542195141039},
-{-0.79351832348816, -0.36208897989136}, { 0.63872359151636, 0.08128252493444},
-{ 0.52890520960295, 0.60048872455592}, { 0.74238552914587, 0.04491915291044},
-{ 0.99096131449250, -0.19451182854402}, {-0.80412329643109, -0.88513818199457},
-{-0.64612616129736, 0.72198674804544}, { 0.11657770663191, -0.83662833815041},
-{-0.95053182488101, -0.96939905138082}, {-0.62228872928622, 0.82767262846661},
-{ 0.03004475787316, -0.99738896333384}, {-0.97987214341034, 0.36526129686425},
-{-0.99986980746200, -0.36021610299715}, { 0.89110648599879, -0.97894250343044},
-{ 0.10407960510582, 0.77357793811619}, { 0.95964737821728, -0.35435818285502},
-{ 0.50843233159162, 0.96107691266205}, { 0.17006334670615, -0.76854025314829},
-{ 0.25872675063360, 0.99893303933816}, {-0.01115998681937, 0.98496019742444},
-{-0.79598702973261, 0.97138411318894}, {-0.99264708948101, -0.99542822402536},
-{-0.99829663752818, 0.01877138824311}, {-0.70801016548184, 0.33680685948117},
-{-0.70467057786826, 0.93272777501857}, { 0.99846021905254, -0.98725746254433},
-{-0.63364968534650, -0.16473594423746}, {-0.16258217500792, -0.95939125400802},
-{-0.43645594360633, -0.94805030113284}, {-0.99848471702976, 0.96245166923809},
-{-0.16796458968998, -0.98987511890470}, {-0.87979225745213, -0.71725725041680},
-{ 0.44183099021786, -0.93568974498761}, { 0.93310180125532, -0.99913308068246},
-{-0.93941931782002, -0.56409379640356}, {-0.88590003188677, 0.47624600491382},
-{ 0.99971463703691, -0.83889954253462}, {-0.75376385639978, 0.00814643438625},
-{ 0.93887685615875, -0.11284528204636}, { 0.85126435782309, 0.52349251543547},
-{ 0.39701421446381, 0.81779634174316}, {-0.37024464187437, -0.87071656222959},
-{-0.36024828242896, 0.34655735648287}, {-0.93388812549209, -0.84476541096429},
-{-0.65298804552119, -0.18439575450921}, { 0.11960319006843, 0.99899346780168},
-{ 0.94292565553160, 0.83163906518293}, { 0.75081145286948, -0.35533223142265},
-{ 0.56721979748394, -0.24076836414499}, { 0.46857766746029, -0.30140233457198},
-{ 0.97312313923635, -0.99548191630031}, {-0.38299976567017, 0.98516909715427},
-{ 0.41025800019463, 0.02116736935734}, { 0.09638062008048, 0.04411984381457},
-{-0.85283249275397, 0.91475563922421}, { 0.88866808958124, -0.99735267083226},
-{-0.48202429536989, -0.96805608884164}, { 0.27572582416567, 0.58634753335832},
-{-0.65889129659168, 0.58835634138583}, { 0.98838086953732, 0.99994349600236},
-{-0.20651349620689, 0.54593044066355}, {-0.62126416356920, -0.59893681700392},
-{ 0.20320105410437, -0.86879180355289}, {-0.97790548600584, 0.96290806999242},
-{ 0.11112534735126, 0.21484763313301}, {-0.41368337314182, 0.28216837680365},
-{ 0.24133038992960, 0.51294362630238}, {-0.66393410674885, -0.08249679629081},
-{-0.53697829178752, -0.97649903936228}, {-0.97224737889348, 0.22081333579837},
-{ 0.87392477144549, -0.12796173740361}, { 0.19050361015753, 0.01602615387195},
-{-0.46353441212724, -0.95249041539006}, {-0.07064096339021, -0.94479803205886},
-{-0.92444085484466, -0.10457590187436}, {-0.83822593578728, -0.01695043208885},
-{ 0.75214681811150, -0.99955681042665}, {-0.42102998829339, 0.99720941999394},
-{-0.72094786237696, -0.35008961934255}, { 0.78843311019251, 0.52851398958271},
-{ 0.97394027897442, -0.26695944086561}, { 0.99206463477946, -0.57010120849429},
-{ 0.76789609461795, -0.76519356730966}, {-0.82002421836409, -0.73530179553767},
-{ 0.81924990025724, 0.99698425250579}, {-0.26719850873357, 0.68903369776193},
-{-0.43311260380975, 0.85321815947490}, { 0.99194979673836, 0.91876249766422},
-{-0.80692001248487, -0.32627540663214}, { 0.43080003649976, -0.21919095636638},
-{ 0.67709491937357, -0.95478075822906}, { 0.56151770568316, -0.70693811747778},
-{ 0.10831862810749, -0.08628837174592}, { 0.91229417540436, -0.65987351408410},
-{-0.48972893932274, 0.56289246362686}, {-0.89033658689697, -0.71656563987082},
-{ 0.65269447475094, 0.65916004833932}, { 0.67439478141121, -0.81684380846796},
-{-0.47770832416973, -0.16789556203025}, {-0.99715979260878, -0.93565784007648},
-{-0.90889593602546, 0.62034397054380}, {-0.06618622548177, -0.23812217221359},
-{ 0.99430266919728, 0.18812555317553}, { 0.97686402381843, -0.28664534366620},
-{ 0.94813650221268, -0.97506640027128}, {-0.95434497492853, -0.79607978501983},
-{-0.49104783137150, 0.32895214359663}, { 0.99881175120751, 0.88993983831354},
-{ 0.50449166760303, -0.85995072408434}, { 0.47162891065108, -0.18680204049569},
-{-0.62081581361840, 0.75000676218956}, {-0.43867015250812, 0.99998069244322},
-{ 0.98630563232075, -0.53578899600662}, {-0.61510362277374, -0.89515019899997},
-{-0.03841517601843, -0.69888815681179}, {-0.30102157304644, -0.07667808922205},
-{ 0.41881284182683, 0.02188098922282}, {-0.86135454941237, 0.98947480909359},
-{ 0.67226861393788, -0.13494389011014}, {-0.70737398842068, -0.76547349325992},
-{ 0.94044946687963, 0.09026201157416}, {-0.82386352534327, 0.08924768823676},
-{-0.32070666698656, 0.50143421908753}, { 0.57593163224487, -0.98966422921509},
-{-0.36326018419965, 0.07440243123228}, { 0.99979044674350, -0.14130287347405},
-{-0.92366023326932, -0.97979298068180}, {-0.44607178518598, -0.54233252016394},
-{ 0.44226800932956, 0.71326756742752}, { 0.03671907158312, 0.63606389366675},
-{ 0.52175424682195, -0.85396826735705}, {-0.94701139690956, -0.01826348194255},
-{-0.98759606946049, 0.82288714303073}, { 0.87434794743625, 0.89399495655433},
-{-0.93412041758744, 0.41374052024363}, { 0.96063943315511, 0.93116709541280},
-{ 0.97534253457837, 0.86150930812689}, { 0.99642466504163, 0.70190043427512},
-{-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
+const DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sbr_noise_table))[][2] = {
+{Q31(-0.99948153278296f), Q31(-0.59483417516607f)}, {Q31( 0.97113454393991f), Q31(-0.67528515225647f)},
+{Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)},
+{Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)},
+{Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)},
+{Q31( 0.54840422910309f), Q31( 0.75221367176302f)}, {Q31( 0.40009252867955f), Q31(-0.98929400334421f)},
+{Q31(-0.99867974711855f), Q31(-0.88147068645358f)}, {Q31(-0.95531076805040f), Q31( 0.90908757154593f)},
+{Q31(-0.45725933317144f), Q31(-0.56716323646760f)}, {Q31(-0.72929675029275f), Q31(-0.98008272727324f)},
+{Q31( 0.75622801399036f), Q31( 0.20950329995549f)}, {Q31( 0.07069442601050f), Q31(-0.78247898470706f)},
+{Q31( 0.74496252926055f), Q31(-0.91169004445807f)}, {Q31(-0.96440182703856f), Q31(-0.94739918296622f)},
+{Q31( 0.30424629369539f), Q31(-0.49438267012479f)}, {Q31( 0.66565033746925f), Q31( 0.64652935542491f)},
+{Q31( 0.91697008020594f), Q31( 0.17514097332009f)}, {Q31(-0.70774918760427f), Q31( 0.52548653416543f)},
+{Q31(-0.70051415345560f), Q31(-0.45340028808763f)}, {Q31(-0.99496513054797f), Q31(-0.90071908066973f)},
+{Q31( 0.98164490790123f), Q31(-0.77463155528697f)}, {Q31(-0.54671580548181f), Q31(-0.02570928536004f)},
+{Q31(-0.01689629065389f), Q31( 0.00287506445732f)}, {Q31(-0.86110349531986f), Q31( 0.42548583726477f)},
+{Q31(-0.98892980586032f), Q31(-0.87881132267556f)}, {Q31( 0.51756627678691f), Q31( 0.66926784710139f)},
+{Q31(-0.99635026409640f), Q31(-0.58107730574765f)}, {Q31(-0.99969370862163f), Q31( 0.98369989360250f)},
+{Q31( 0.55266258627194f), Q31( 0.59449057465591f)}, {Q31( 0.34581177741673f), Q31( 0.94879421061866f)},
+{Q31( 0.62664209577999f), Q31(-0.74402970906471f)}, {Q31(-0.77149701404973f), Q31(-0.33883658042801f)},
+{Q31(-0.91592244254432f), Q31( 0.03687901376713f)}, {Q31(-0.76285492357887f), Q31(-0.91371867919124f)},
+{Q31( 0.79788337195331f), Q31(-0.93180971199849f)}, {Q31( 0.54473080610200f), Q31(-0.11919206037186f)},
+{Q31(-0.85639281671058f), Q31( 0.42429854760451f)}, {Q31(-0.92882402971423f), Q31( 0.27871809078609f)},
+{Q31(-0.11708371046774f), Q31(-0.99800843444966f)}, {Q31( 0.21356749817493f), Q31(-0.90716295627033f)},
+{Q31(-0.76191692573909f), Q31( 0.99768118356265f)}, {Q31( 0.98111043100884f), Q31(-0.95854459734407f)},
+{Q31(-0.85913269895572f), Q31( 0.95766566168880f)}, {Q31(-0.93307242253692f), Q31( 0.49431757696466f)},
+{Q31( 0.30485754879632f), Q31(-0.70540034357529f)}, {Q31( 0.85289650925190f), Q31( 0.46766131791044f)},
+{Q31( 0.91328082618125f), Q31(-0.99839597361769f)}, {Q31(-0.05890199924154f), Q31( 0.70741827819497f)},
+{Q31( 0.28398686150148f), Q31( 0.34633555702188f)}, {Q31( 0.95258164539612f), Q31(-0.54893416026939f)},
+{Q31(-0.78566324168507f), Q31(-0.75568541079691f)}, {Q31(-0.95789495447877f), Q31(-0.20423194696966f)},
+{Q31( 0.82411158711197f), Q31( 0.96654618432562f)}, {Q31(-0.65185446735885f), Q31(-0.88734990773289f)},
+{Q31(-0.93643603134666f), Q31( 0.99870790442385f)}, {Q31( 0.91427159529618f), Q31(-0.98290505544444f)},
+{Q31(-0.70395684036886f), Q31( 0.58796798221039f)}, {Q31( 0.00563771969365f), Q31( 0.61768196727244f)},
+{Q31( 0.89065051931895f), Q31( 0.52783352697585f)}, {Q31(-0.68683707712762f), Q31( 0.80806944710339f)},
+{Q31( 0.72165342518718f), Q31(-0.69259857349564f)}, {Q31(-0.62928247730667f), Q31( 0.13627037407335f)},
+{Q31( 0.29938434065514f), Q31(-0.46051329682246f)}, {Q31(-0.91781958879280f), Q31(-0.74012716684186f)},
+{Q31( 0.99298717043688f), Q31( 0.40816610075661f)}, {Q31( 0.82368298622748f), Q31(-0.74036047190173f)},
+{Q31(-0.98512833386833f), Q31(-0.99972330709594f)}, {Q31(-0.95915368242257f), Q31(-0.99237800466040f)},
+{Q31(-0.21411126572790f), Q31(-0.93424819052545f)}, {Q31(-0.68821476106884f), Q31(-0.26892306315457f)},
+{Q31( 0.91851997982317f), Q31( 0.09358228901785f)}, {Q31(-0.96062769559127f), Q31( 0.36099095133739f)},
+{Q31( 0.51646184922287f), Q31(-0.71373332873917f)}, {Q31( 0.61130721139669f), Q31( 0.46950141175917f)},
+{Q31( 0.47336129371299f), Q31(-0.27333178296162f)}, {Q31( 0.90998308703519f), Q31( 0.96715662938132f)},
+{Q31( 0.44844799194357f), Q31( 0.99211574628306f)}, {Q31( 0.66614891079092f), Q31( 0.96590176169121f)},
+{Q31( 0.74922239129237f), Q31(-0.89879858826087f)}, {Q31(-0.99571588506485f), Q31( 0.52785521494349f)},
+{Q31( 0.97401082477563f), Q31(-0.16855870075190f)}, {Q31( 0.72683747733879f), Q31(-0.48060774432251f)},
+{Q31( 0.95432193457128f), Q31( 0.68849603408441f)}, {Q31(-0.72962208425191f), Q31(-0.76608443420917f)},
+{Q31(-0.85359479233537f), Q31( 0.88738125901579f)}, {Q31(-0.81412430338535f), Q31(-0.97480768049637f)},
+{Q31(-0.87930772356786f), Q31( 0.74748307690436f)}, {Q31(-0.71573331064977f), Q31(-0.98570608178923f)},
+{Q31( 0.83524300028228f), Q31( 0.83702537075163f)}, {Q31(-0.48086065601423f), Q31(-0.98848504923531f)},
+{Q31( 0.97139128574778f), Q31( 0.80093621198236f)}, {Q31( 0.51992825347895f), Q31( 0.80247631400510f)},
+{Q31(-0.00848591195325f), Q31(-0.76670128000486f)}, {Q31(-0.70294374303036f), Q31( 0.55359910445577f)},
+{Q31(-0.95894428168140f), Q31(-0.43265504344783f)}, {Q31( 0.97079252950321f), Q31( 0.09325857238682f)},
+{Q31(-0.92404293670797f), Q31( 0.85507704027855f)}, {Q31(-0.69506469500450f), Q31( 0.98633412625459f)},
+{Q31( 0.26559203620024f), Q31( 0.73314307966524f)}, {Q31( 0.28038443336943f), Q31( 0.14537913654427f)},
+{Q31(-0.74138124825523f), Q31( 0.99310339807762f)}, {Q31(-0.01752795995444f), Q31(-0.82616635284178f)},
+{Q31(-0.55126773094930f), Q31(-0.98898543862153f)}, {Q31( 0.97960898850996f), Q31(-0.94021446752851f)},
+{Q31(-0.99196309146936f), Q31( 0.67019017358456f)}, {Q31(-0.67684928085260f), Q31( 0.12631491649378f)},
+{Q31( 0.09140039465500f), Q31(-0.20537731453108f)}, {Q31(-0.71658965751996f), Q31(-0.97788200391224f)},
+{Q31( 0.81014640078925f), Q31( 0.53722648362443f)}, {Q31( 0.40616991671205f), Q31(-0.26469008598449f)},
+{Q31(-0.67680188682972f), Q31( 0.94502052337695f)}, {Q31( 0.86849774348749f), Q31(-0.18333598647899f)},
+{Q31(-0.99500381284851f), Q31(-0.02634122068550f)}, {Q31( 0.84329189340667f), Q31( 0.10406957462213f)},
+{Q31(-0.09215968531446f), Q31( 0.69540012101253f)}, {Q31( 0.99956173327206f), Q31(-0.12358542001404f)},
+{Q31(-0.79732779473535f), Q31(-0.91582524736159f)}, {Q31( 0.96349973642406f), Q31( 0.96640458041000f)},
+{Q31(-0.79942778496547f), Q31( 0.64323902822857f)}, {Q31(-0.11566039853896f), Q31( 0.28587846253726f)},
+{Q31(-0.39922954514662f), Q31( 0.94129601616966f)}, {Q31( 0.99089197565987f), Q31(-0.92062625581587f)},
+{Q31( 0.28631285179909f), Q31(-0.91035047143603f)}, {Q31(-0.83302725605608f), Q31(-0.67330410892084f)},
+{Q31( 0.95404443402072f), Q31( 0.49162765398743f)}, {Q31(-0.06449863579434f), Q31( 0.03250560813135f)},
+{Q31(-0.99575054486311f), Q31( 0.42389784469507f)}, {Q31(-0.65501142790847f), Q31( 0.82546114655624f)},
+{Q31(-0.81254441908887f), Q31(-0.51627234660629f)}, {Q31(-0.99646369485481f), Q31( 0.84490533520752f)},
+{Q31( 0.00287840603348f), Q31( 0.64768261158166f)}, {Q31( 0.70176989408455f), Q31(-0.20453028573322f)},
+{Q31( 0.96361882270190f), Q31( 0.40706967140989f)}, {Q31(-0.68883758192426f), Q31( 0.91338958840772f)},
+{Q31(-0.34875585502238f), Q31( 0.71472290693300f)}, {Q31( 0.91980081243087f), Q31( 0.66507455644919f)},
+{Q31(-0.99009048343881f), Q31( 0.85868021604848f)}, {Q31( 0.68865791458395f), Q31( 0.55660316809678f)},
+{Q31(-0.99484402129368f), Q31(-0.20052559254934f)}, {Q31( 0.94214511408023f), Q31(-0.99696425367461f)},
+{Q31(-0.67414626793544f), Q31( 0.49548221180078f)}, {Q31(-0.47339353684664f), Q31(-0.85904328834047f)},
+{Q31( 0.14323651387360f), Q31(-0.94145598222488f)}, {Q31(-0.29268293575672f), Q31( 0.05759224927952f)},
+{Q31( 0.43793861458754f), Q31(-0.78904969892724f)}, {Q31(-0.36345126374441f), Q31( 0.64874435357162f)},
+{Q31(-0.08750604656825f), Q31( 0.97686944362527f)}, {Q31(-0.96495267812511f), Q31(-0.53960305946511f)},
+{Q31( 0.55526940659947f), Q31( 0.78891523734774f)}, {Q31( 0.73538215752630f), Q31( 0.96452072373404f)},
+{Q31(-0.30889773919437f), Q31(-0.80664389776860f)}, {Q31( 0.03574995626194f), Q31(-0.97325616900959f)},
+{Q31( 0.98720684660488f), Q31( 0.48409133691962f)}, {Q31(-0.81689296271203f), Q31(-0.90827703628298f)},
+{Q31( 0.67866860118215f), Q31( 0.81284503870856f)}, {Q31(-0.15808569732583f), Q31( 0.85279555024382f)},
+{Q31( 0.80723395114371f), Q31(-0.24717418514605f)}, {Q31( 0.47788757329038f), Q31(-0.46333147839295f)},
+{Q31( 0.96367554763201f), Q31( 0.38486749303242f)}, {Q31(-0.99143875716818f), Q31(-0.24945277239809f)},
+{Q31( 0.83081876925833f), Q31(-0.94780851414763f)}, {Q31(-0.58753191905341f), Q31( 0.01290772389163f)},
+{Q31( 0.95538108220960f), Q31(-0.85557052096538f)}, {Q31(-0.96490920476211f), Q31(-0.64020970923102f)},
+{Q31(-0.97327101028521f), Q31( 0.12378128133110f)}, {Q31( 0.91400366022124f), Q31( 0.57972471346930f)},
+{Q31(-0.99925837363824f), Q31( 0.71084847864067f)}, {Q31(-0.86875903507313f), Q31(-0.20291699203564f)},
+{Q31(-0.26240034795124f), Q31(-0.68264554369108f)}, {Q31(-0.24664412953388f), Q31(-0.87642273115183f)},
+{Q31( 0.02416275806869f), Q31( 0.27192914288905f)}, {Q31( 0.82068619590515f), Q31(-0.85087787994476f)},
+{Q31( 0.88547373760759f), Q31(-0.89636802901469f)}, {Q31(-0.18173078152226f), Q31(-0.26152145156800f)},
+{Q31( 0.09355476558534f), Q31( 0.54845123045604f)}, {Q31(-0.54668414224090f), Q31( 0.95980774020221f)},
+{Q31( 0.37050990604091f), Q31(-0.59910140383171f)}, {Q31(-0.70373594262891f), Q31( 0.91227665827081f)},
+{Q31(-0.34600785879594f), Q31(-0.99441426144200f)}, {Q31(-0.68774481731008f), Q31(-0.30238837956299f)},
+{Q31(-0.26843291251234f), Q31( 0.83115668004362f)}, {Q31( 0.49072334613242f), Q31(-0.45359708737775f)},
+{Q31( 0.38975993093975f), Q31( 0.95515358099121f)}, {Q31(-0.97757125224150f), Q31( 0.05305894580606f)},
+{Q31(-0.17325552859616f), Q31(-0.92770672250494f)}, {Q31( 0.99948035025744f), Q31( 0.58285545563426f)},
+{Q31(-0.64946246527458f), Q31( 0.68645507104960f)}, {Q31(-0.12016920576437f), Q31(-0.57147322153312f)},
+{Q31(-0.58947456517751f), Q31(-0.34847132454388f)}, {Q31(-0.41815140454465f), Q31( 0.16276422358861f)},
+{Q31( 0.99885650204884f), Q31( 0.11136095490444f)}, {Q31(-0.56649614128386f), Q31(-0.90494866361587f)},
+{Q31( 0.94138021032330f), Q31( 0.35281916733018f)}, {Q31(-0.75725076534641f), Q31( 0.53650549640587f)},
+{Q31( 0.20541973692630f), Q31(-0.94435144369918f)}, {Q31( 0.99980371023351f), Q31( 0.79835913565599f)},
+{Q31( 0.29078277605775f), Q31( 0.35393777921520f)}, {Q31(-0.62858772103030f), Q31( 0.38765693387102f)},
+{Q31( 0.43440904467688f), Q31(-0.98546330463232f)}, {Q31(-0.98298583762390f), Q31( 0.21021524625209f)},
+{Q31( 0.19513029146934f), Q31(-0.94239832251867f)}, {Q31(-0.95476662400101f), Q31( 0.98364554179143f)},
+{Q31( 0.93379635304810f), Q31(-0.70881994583682f)}, {Q31(-0.85235410573336f), Q31(-0.08342347966410f)},
+{Q31(-0.86425093011245f), Q31(-0.45795025029466f)}, {Q31( 0.38879779059045f), Q31( 0.97274429344593f)},
+{Q31( 0.92045124735495f), Q31(-0.62433652524220f)}, {Q31( 0.89162532251878f), Q31( 0.54950955570563f)},
+{Q31(-0.36834336949252f), Q31( 0.96458298020975f)}, {Q31( 0.93891760988045f), Q31(-0.89968353740388f)},
+{Q31( 0.99267657565094f), Q31(-0.03757034316958f)}, {Q31(-0.94063471614176f), Q31( 0.41332338538963f)},
+{Q31( 0.99740224117019f), Q31(-0.16830494996370f)}, {Q31(-0.35899413170555f), Q31(-0.46633226649613f)},
+{Q31( 0.05237237274947f), Q31(-0.25640361602661f)}, {Q31( 0.36703583957424f), Q31(-0.38653265641875f)},
+{Q31( 0.91653180367913f), Q31(-0.30587628726597f)}, {Q31( 0.69000803499316f), Q31( 0.90952171386132f)},
+{Q31(-0.38658751133527f), Q31( 0.99501571208985f)}, {Q31(-0.29250814029851f), Q31( 0.37444994344615f)},
+{Q31(-0.60182204677608f), Q31( 0.86779651036123f)}, {Q31(-0.97418588163217f), Q31( 0.96468523666475f)},
+{Q31( 0.88461574003963f), Q31( 0.57508405276414f)}, {Q31( 0.05198933055162f), Q31( 0.21269661669964f)},
+{Q31(-0.53499621979720f), Q31( 0.97241553731237f)}, {Q31(-0.49429560226497f), Q31( 0.98183865291903f)},
+{Q31(-0.98935142339139f), Q31(-0.40249159006933f)}, {Q31(-0.98081380091130f), Q31(-0.72856895534041f)},
+{Q31(-0.27338148835532f), Q31( 0.99950922447209f)}, {Q31( 0.06310802338302f), Q31(-0.54539587529618f)},
+{Q31(-0.20461677199539f), Q31(-0.14209977628489f)}, {Q31( 0.66223843141647f), Q31( 0.72528579940326f)},
+{Q31(-0.84764345483665f), Q31( 0.02372316801261f)}, {Q31(-0.89039863483811f), Q31( 0.88866581484602f)},
+{Q31( 0.95903308477986f), Q31( 0.76744927173873f)}, {Q31( 0.73504123909879f), Q31(-0.03747203173192f)},
+{Q31(-0.31744434966056f), Q31(-0.36834111883652f)}, {Q31(-0.34110827591623f), Q31( 0.40211222807691f)},
+{Q31( 0.47803883714199f), Q31(-0.39423219786288f)}, {Q31( 0.98299195879514f), Q31( 0.01989791390047f)},
+{Q31(-0.30963073129751f), Q31(-0.18076720599336f)}, {Q31( 0.99992588229018f), Q31(-0.26281872094289f)},
+{Q31(-0.93149731080767f), Q31(-0.98313162570490f)}, {Q31( 0.99923472302773f), Q31(-0.80142993767554f)},
+{Q31(-0.26024169633417f), Q31(-0.75999759855752f)}, {Q31(-0.35712514743563f), Q31( 0.19298963768574f)},
+{Q31(-0.99899084509530f), Q31( 0.74645156992493f)}, {Q31( 0.86557171579452f), Q31( 0.55593866696299f)},
+{Q31( 0.33408042438752f), Q31( 0.86185953874709f)}, {Q31( 0.99010736374716f), Q31( 0.04602397576623f)},
+{Q31(-0.66694269691195f), Q31(-0.91643611810148f)}, {Q31( 0.64016792079480f), Q31( 0.15649530836856f)},
+{Q31( 0.99570534804836f), Q31( 0.45844586038111f)}, {Q31(-0.63431466947340f), Q31( 0.21079116459234f)},
+{Q31(-0.07706847005931f), Q31(-0.89581437101329f)}, {Q31( 0.98590090577724f), Q31( 0.88241721133981f)},
+{Q31( 0.80099335254678f), Q31(-0.36851896710853f)}, {Q31( 0.78368131392666f), Q31( 0.45506999802597f)},
+{Q31( 0.08707806671691f), Q31( 0.80938994918745f)}, {Q31(-0.86811883080712f), Q31( 0.39347308654705f)},
+{Q31(-0.39466529740375f), Q31(-0.66809432114456f)}, {Q31( 0.97875325649683f), Q31(-0.72467840967746f)},
+{Q31(-0.95038560288864f), Q31( 0.89563219587625f)}, {Q31( 0.17005239424212f), Q31( 0.54683053962658f)},
+{Q31(-0.76910792026848f), Q31(-0.96226617549298f)}, {Q31( 0.99743281016846f), Q31( 0.42697157037567f)},
+{Q31( 0.95437383549973f), Q31( 0.97002324109952f)}, {Q31( 0.99578905365569f), Q31(-0.54106826257356f)},
+{Q31( 0.28058259829990f), Q31(-0.85361420634036f)}, {Q31( 0.85256524470573f), Q31(-0.64567607735589f)},
+{Q31(-0.50608540105128f), Q31(-0.65846015480300f)}, {Q31(-0.97210735183243f), Q31(-0.23095213067791f)},
+{Q31( 0.95424048234441f), Q31(-0.99240147091219f)}, {Q31(-0.96926570524023f), Q31( 0.73775654896574f)},
+{Q31( 0.30872163214726f), Q31( 0.41514960556126f)}, {Q31(-0.24523839572639f), Q31( 0.63206633394807f)},
+{Q31(-0.33813265086024f), Q31(-0.38661779441897f)}, {Q31(-0.05826828420146f), Q31(-0.06940774188029f)},
+{Q31(-0.22898461455054f), Q31( 0.97054853316316f)}, {Q31(-0.18509915019881f), Q31( 0.47565762892084f)},
+{Q31(-0.10488238045009f), Q31(-0.87769947402394f)}, {Q31(-0.71886586182037f), Q31( 0.78030982480538f)},
+{Q31( 0.99793873738654f), Q31( 0.90041310491497f)}, {Q31( 0.57563307626120f), Q31(-0.91034337352097f)},
+{Q31( 0.28909646383717f), Q31( 0.96307783970534f)}, {Q31( 0.42188998312520f), Q31( 0.48148651230437f)},
+{Q31( 0.93335049681047f), Q31(-0.43537023883588f)}, {Q31(-0.97087374418267f), Q31( 0.86636445711364f)},
+{Q31( 0.36722871286923f), Q31( 0.65291654172961f)}, {Q31(-0.81093025665696f), Q31( 0.08778370229363f)},
+{Q31(-0.26240603062237f), Q31(-0.92774095379098f)}, {Q31( 0.83996497984604f), Q31( 0.55839849139647f)},
+{Q31(-0.99909615720225f), Q31(-0.96024605713970f)}, {Q31( 0.74649464155061f), Q31( 0.12144893606462f)},
+{Q31(-0.74774595569805f), Q31(-0.26898062008959f)}, {Q31( 0.95781667469567f), Q31(-0.79047927052628f)},
+{Q31( 0.95472308713099f), Q31(-0.08588776019550f)}, {Q31( 0.48708332746299f), Q31( 0.99999041579432f)},
+{Q31( 0.46332038247497f), Q31( 0.10964126185063f)}, {Q31(-0.76497004940162f), Q31( 0.89210929242238f)},
+{Q31( 0.57397389364339f), Q31( 0.35289703373760f)}, {Q31( 0.75374316974495f), Q31( 0.96705214651335f)},
+{Q31(-0.59174397685714f), Q31(-0.89405370422752f)}, {Q31( 0.75087906691890f), Q31(-0.29612672982396f)},
+{Q31(-0.98607857336230f), Q31( 0.25034911730023f)}, {Q31(-0.40761056640505f), Q31(-0.90045573444695f)},
+{Q31( 0.66929266740477f), Q31( 0.98629493401748f)}, {Q31(-0.97463695257310f), Q31(-0.00190223301301f)},
+{Q31( 0.90145509409859f), Q31( 0.99781390365446f)}, {Q31(-0.87259289048043f), Q31( 0.99233587353666f)},
+{Q31(-0.91529461447692f), Q31(-0.15698707534206f)}, {Q31(-0.03305738840705f), Q31(-0.37205262859764f)},
+{Q31( 0.07223051368337f), Q31(-0.88805001733626f)}, {Q31( 0.99498012188353f), Q31( 0.97094358113387f)},
+{Q31(-0.74904939500519f), Q31( 0.99985483641521f)}, {Q31( 0.04585228574211f), Q31( 0.99812337444082f)},
+{Q31(-0.89054954257993f), Q31(-0.31791913188064f)}, {Q31(-0.83782144651251f), Q31( 0.97637632547466f)},
+{Q31( 0.33454804933804f), Q31(-0.86231516800408f)}, {Q31(-0.99707579362824f), Q31( 0.93237990079441f)},
+{Q31(-0.22827527843994f), Q31( 0.18874759397997f)}, {Q31( 0.67248046289143f), Q31(-0.03646211390569f)},
+{Q31(-0.05146538187944f), Q31(-0.92599700120679f)}, {Q31( 0.99947295749905f), Q31( 0.93625229707912f)},
+{Q31( 0.66951124390363f), Q31( 0.98905825623893f)}, {Q31(-0.99602956559179f), Q31(-0.44654715757688f)},
+{Q31( 0.82104905483590f), Q31( 0.99540741724928f)}, {Q31( 0.99186510988782f), Q31( 0.72023001312947f)},
+{Q31(-0.65284592392918f), Q31( 0.52186723253637f)}, {Q31( 0.93885443798188f), Q31(-0.74895312615259f)},
+{Q31( 0.96735248738388f), Q31( 0.90891816978629f)}, {Q31(-0.22225968841114f), Q31( 0.57124029781228f)},
+{Q31(-0.44132783753414f), Q31(-0.92688840659280f)}, {Q31(-0.85694974219574f), Q31( 0.88844532719844f)},
+{Q31( 0.91783042091762f), Q31(-0.46356892383970f)}, {Q31( 0.72556974415690f), Q31(-0.99899555770747f)},
+{Q31(-0.99711581834508f), Q31( 0.58211560180426f)}, {Q31( 0.77638976371966f), Q31( 0.94321834873819f)},
+{Q31( 0.07717324253925f), Q31( 0.58638399856595f)}, {Q31(-0.56049829194163f), Q31( 0.82522301569036f)},
+{Q31( 0.98398893639988f), Q31( 0.39467440420569f)}, {Q31( 0.47546946844938f), Q31( 0.68613044836811f)},
+{Q31( 0.65675089314631f), Q31( 0.18331637134880f)}, {Q31( 0.03273375457980f), Q31(-0.74933109564108f)},
+{Q31(-0.38684144784738f), Q31( 0.51337349030406f)}, {Q31(-0.97346267944545f), Q31(-0.96549364384098f)},
+{Q31(-0.53282156061942f), Q31(-0.91423265091354f)}, {Q31( 0.99817310731176f), Q31( 0.61133572482148f)},
+{Q31(-0.50254500772635f), Q31(-0.88829338134294f)}, {Q31( 0.01995873238855f), Q31( 0.85223515096765f)},
+{Q31( 0.99930381973804f), Q31( 0.94578896296649f)}, {Q31( 0.82907767600783f), Q31(-0.06323442598128f)},
+{Q31(-0.58660709669728f), Q31( 0.96840773806582f)}, {Q31(-0.17573736667267f), Q31(-0.48166920859485f)},
+{Q31( 0.83434292401346f), Q31(-0.13023450646997f)}, {Q31( 0.05946491307025f), Q31( 0.20511047074866f)},
+{Q31( 0.81505484574602f), Q31(-0.94685947861369f)}, {Q31(-0.44976380954860f), Q31( 0.40894572671545f)},
+{Q31(-0.89746474625671f), Q31( 0.99846578838537f)}, {Q31( 0.39677256130792f), Q31(-0.74854668609359f)},
+{Q31(-0.07588948563079f), Q31( 0.74096214084170f)}, {Q31( 0.76343198951445f), Q31( 0.41746629422634f)},
+{Q31(-0.74490104699626f), Q31( 0.94725911744610f)}, {Q31( 0.64880119792759f), Q31( 0.41336660830571f)},
+{Q31( 0.62319537462542f), Q31(-0.93098313552599f)}, {Q31( 0.42215817594807f), Q31(-0.07712787385208f)},
+{Q31( 0.02704554141885f), Q31(-0.05417518053666f)}, {Q31( 0.80001773566818f), Q31( 0.91542195141039f)},
+{Q31(-0.79351832348816f), Q31(-0.36208897989136f)}, {Q31( 0.63872359151636f), Q31( 0.08128252493444f)},
+{Q31( 0.52890520960295f), Q31( 0.60048872455592f)}, {Q31( 0.74238552914587f), Q31( 0.04491915291044f)},
+{Q31( 0.99096131449250f), Q31(-0.19451182854402f)}, {Q31(-0.80412329643109f), Q31(-0.88513818199457f)},
+{Q31(-0.64612616129736f), Q31( 0.72198674804544f)}, {Q31( 0.11657770663191f), Q31(-0.83662833815041f)},
+{Q31(-0.95053182488101f), Q31(-0.96939905138082f)}, {Q31(-0.62228872928622f), Q31( 0.82767262846661f)},
+{Q31( 0.03004475787316f), Q31(-0.99738896333384f)}, {Q31(-0.97987214341034f), Q31( 0.36526129686425f)},
+{Q31(-0.99986980746200f), Q31(-0.36021610299715f)}, {Q31( 0.89110648599879f), Q31(-0.97894250343044f)},
+{Q31( 0.10407960510582f), Q31( 0.77357793811619f)}, {Q31( 0.95964737821728f), Q31(-0.35435818285502f)},
+{Q31( 0.50843233159162f), Q31( 0.96107691266205f)}, {Q31( 0.17006334670615f), Q31(-0.76854025314829f)},
+{Q31( 0.25872675063360f), Q31( 0.99893303933816f)}, {Q31(-0.01115998681937f), Q31( 0.98496019742444f)},
+{Q31(-0.79598702973261f), Q31( 0.97138411318894f)}, {Q31(-0.99264708948101f), Q31(-0.99542822402536f)},
+{Q31(-0.99829663752818f), Q31( 0.01877138824311f)}, {Q31(-0.70801016548184f), Q31( 0.33680685948117f)},
+{Q31(-0.70467057786826f), Q31( 0.93272777501857f)}, {Q31( 0.99846021905254f), Q31(-0.98725746254433f)},
+{Q31(-0.63364968534650f), Q31(-0.16473594423746f)}, {Q31(-0.16258217500792f), Q31(-0.95939125400802f)},
+{Q31(-0.43645594360633f), Q31(-0.94805030113284f)}, {Q31(-0.99848471702976f), Q31( 0.96245166923809f)},
+{Q31(-0.16796458968998f), Q31(-0.98987511890470f)}, {Q31(-0.87979225745213f), Q31(-0.71725725041680f)},
+{Q31( 0.44183099021786f), Q31(-0.93568974498761f)}, {Q31( 0.93310180125532f), Q31(-0.99913308068246f)},
+{Q31(-0.93941931782002f), Q31(-0.56409379640356f)}, {Q31(-0.88590003188677f), Q31( 0.47624600491382f)},
+{Q31( 0.99971463703691f), Q31(-0.83889954253462f)}, {Q31(-0.75376385639978f), Q31( 0.00814643438625f)},
+{Q31( 0.93887685615875f), Q31(-0.11284528204636f)}, {Q31( 0.85126435782309f), Q31( 0.52349251543547f)},
+{Q31( 0.39701421446381f), Q31( 0.81779634174316f)}, {Q31(-0.37024464187437f), Q31(-0.87071656222959f)},
+{Q31(-0.36024828242896f), Q31( 0.34655735648287f)}, {Q31(-0.93388812549209f), Q31(-0.84476541096429f)},
+{Q31(-0.65298804552119f), Q31(-0.18439575450921f)}, {Q31( 0.11960319006843f), Q31( 0.99899346780168f)},
+{Q31( 0.94292565553160f), Q31( 0.83163906518293f)}, {Q31( 0.75081145286948f), Q31(-0.35533223142265f)},
+{Q31( 0.56721979748394f), Q31(-0.24076836414499f)}, {Q31( 0.46857766746029f), Q31(-0.30140233457198f)},
+{Q31( 0.97312313923635f), Q31(-0.99548191630031f)}, {Q31(-0.38299976567017f), Q31( 0.98516909715427f)},
+{Q31( 0.41025800019463f), Q31( 0.02116736935734f)}, {Q31( 0.09638062008048f), Q31( 0.04411984381457f)},
+{Q31(-0.85283249275397f), Q31( 0.91475563922421f)}, {Q31( 0.88866808958124f), Q31(-0.99735267083226f)},
+{Q31(-0.48202429536989f), Q31(-0.96805608884164f)}, {Q31( 0.27572582416567f), Q31( 0.58634753335832f)},
+{Q31(-0.65889129659168f), Q31( 0.58835634138583f)}, {Q31( 0.98838086953732f), Q31( 0.99994349600236f)},
+{Q31(-0.20651349620689f), Q31( 0.54593044066355f)}, {Q31(-0.62126416356920f), Q31(-0.59893681700392f)},
+{Q31( 0.20320105410437f), Q31(-0.86879180355289f)}, {Q31(-0.97790548600584f), Q31( 0.96290806999242f)},
+{Q31( 0.11112534735126f), Q31( 0.21484763313301f)}, {Q31(-0.41368337314182f), Q31( 0.28216837680365f)},
+{Q31( 0.24133038992960f), Q31( 0.51294362630238f)}, {Q31(-0.66393410674885f), Q31(-0.08249679629081f)},
+{Q31(-0.53697829178752f), Q31(-0.97649903936228f)}, {Q31(-0.97224737889348f), Q31( 0.22081333579837f)},
+{Q31( 0.87392477144549f), Q31(-0.12796173740361f)}, {Q31( 0.19050361015753f), Q31( 0.01602615387195f)},
+{Q31(-0.46353441212724f), Q31(-0.95249041539006f)}, {Q31(-0.07064096339021f), Q31(-0.94479803205886f)},
+{Q31(-0.92444085484466f), Q31(-0.10457590187436f)}, {Q31(-0.83822593578728f), Q31(-0.01695043208885f)},
+{Q31( 0.75214681811150f), Q31(-0.99955681042665f)}, {Q31(-0.42102998829339f), Q31( 0.99720941999394f)},
+{Q31(-0.72094786237696f), Q31(-0.35008961934255f)}, {Q31( 0.78843311019251f), Q31( 0.52851398958271f)},
+{Q31( 0.97394027897442f), Q31(-0.26695944086561f)}, {Q31( 0.99206463477946f), Q31(-0.57010120849429f)},
+{Q31( 0.76789609461795f), Q31(-0.76519356730966f)}, {Q31(-0.82002421836409f), Q31(-0.73530179553767f)},
+{Q31( 0.81924990025724f), Q31( 0.99698425250579f)}, {Q31(-0.26719850873357f), Q31( 0.68903369776193f)},
+{Q31(-0.43311260380975f), Q31( 0.85321815947490f)}, {Q31( 0.99194979673836f), Q31( 0.91876249766422f)},
+{Q31(-0.80692001248487f), Q31(-0.32627540663214f)}, {Q31( 0.43080003649976f), Q31(-0.21919095636638f)},
+{Q31( 0.67709491937357f), Q31(-0.95478075822906f)}, {Q31( 0.56151770568316f), Q31(-0.70693811747778f)},
+{Q31( 0.10831862810749f), Q31(-0.08628837174592f)}, {Q31( 0.91229417540436f), Q31(-0.65987351408410f)},
+{Q31(-0.48972893932274f), Q31( 0.56289246362686f)}, {Q31(-0.89033658689697f), Q31(-0.71656563987082f)},
+{Q31( 0.65269447475094f), Q31( 0.65916004833932f)}, {Q31( 0.67439478141121f), Q31(-0.81684380846796f)},
+{Q31(-0.47770832416973f), Q31(-0.16789556203025f)}, {Q31(-0.99715979260878f), Q31(-0.93565784007648f)},
+{Q31(-0.90889593602546f), Q31( 0.62034397054380f)}, {Q31(-0.06618622548177f), Q31(-0.23812217221359f)},
+{Q31( 0.99430266919728f), Q31( 0.18812555317553f)}, {Q31( 0.97686402381843f), Q31(-0.28664534366620f)},
+{Q31( 0.94813650221268f), Q31(-0.97506640027128f)}, {Q31(-0.95434497492853f), Q31(-0.79607978501983f)},
+{Q31(-0.49104783137150f), Q31( 0.32895214359663f)}, {Q31( 0.99881175120751f), Q31( 0.88993983831354f)},
+{Q31( 0.50449166760303f), Q31(-0.85995072408434f)}, {Q31( 0.47162891065108f), Q31(-0.18680204049569f)},
+{Q31(-0.62081581361840f), Q31( 0.75000676218956f)}, {Q31(-0.43867015250812f), Q31( 0.99998069244322f)},
+{Q31( 0.98630563232075f), Q31(-0.53578899600662f)}, {Q31(-0.61510362277374f), Q31(-0.89515019899997f)},
+{Q31(-0.03841517601843f), Q31(-0.69888815681179f)}, {Q31(-0.30102157304644f), Q31(-0.07667808922205f)},
+{Q31( 0.41881284182683f), Q31( 0.02188098922282f)}, {Q31(-0.86135454941237f), Q31( 0.98947480909359f)},
+{Q31( 0.67226861393788f), Q31(-0.13494389011014f)}, {Q31(-0.70737398842068f), Q31(-0.76547349325992f)},
+{Q31( 0.94044946687963f), Q31( 0.09026201157416f)}, {Q31(-0.82386352534327f), Q31( 0.08924768823676f)},
+{Q31(-0.32070666698656f), Q31( 0.50143421908753f)}, {Q31( 0.57593163224487f), Q31(-0.98966422921509f)},
+{Q31(-0.36326018419965f), Q31( 0.07440243123228f)}, {Q31( 0.99979044674350f), Q31(-0.14130287347405f)},
+{Q31(-0.92366023326932f), Q31(-0.97979298068180f)}, {Q31(-0.44607178518598f), Q31(-0.54233252016394f)},
+{Q31( 0.44226800932956f), Q31( 0.71326756742752f)}, {Q31( 0.03671907158312f), Q31( 0.63606389366675f)},
+{Q31( 0.52175424682195f), Q31(-0.85396826735705f)}, {Q31(-0.94701139690956f), Q31(-0.01826348194255f)},
+{Q31(-0.98759606946049f), Q31( 0.82288714303073f)}, {Q31( 0.87434794743625f), Q31( 0.89399495655433f)},
+{Q31(-0.93412041758744f), Q31( 0.41374052024363f)}, {Q31( 0.96063943315511f), Q31( 0.93116709541280f)},
+{Q31( 0.97534253457837f), Q31( 0.86150930812689f)}, {Q31( 0.99642466504163f), Q31( 0.70190043427512f)},
+{Q31(-0.94705089665984f), Q31(-0.29580042814306f)}, {Q31( 0.91599807087376f), Q31(-0.98147830385781f)},
// Start of duplicated table
-{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
-{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
-{ 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087},
-{-0.01053049862020, -0.66959058036166}, {-0.91266367957293, -0.11522938140034},
+{Q31(-0.99948153278296f), Q31(-0.59483417516607f)}, {Q31( 0.97113454393991f), Q31(-0.67528515225647f)},
+{Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)},
+{Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)},
+{Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)},
};
#endif /* AVCODEC_AACSBRDATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/aactab.c b/chromium/third_party/ffmpeg/libavcodec/aactab.c
index 25f6de29277..dc9acc1bf37 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aactab.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aactab.c
@@ -35,6 +35,8 @@
DECLARE_ALIGNED(32, float, ff_aac_kbd_long_1024)[1024];
DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128];
+DECLARE_ALIGNED(32, int, ff_aac_kbd_long_1024_fixed)[1024];
+DECLARE_ALIGNED(32, int, ff_aac_kbd_short_128_fixed)[128];
const uint8_t ff_aac_num_swb_1024[] = {
41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40
@@ -1767,6 +1769,490 @@ const DECLARE_ALIGNED(32, float, ff_aac_eld_window_512)[1920] = {
-0.00111144, -0.00109764, -0.00108377, -0.00106989,
};
+/* Q30 representation of ff_aac_eld_window_512 table */
+const DECLARE_ALIGNED(32, int, ff_aac_eld_window_512_fixed)[1920] = {
+ 0x003783ba, 0x005d04f4, 0x008ae226, 0x00c02021,
+ 0x00fb1804, 0x013a30a8, 0x017be9e6, 0x01bf296c,
+ 0x02033204, 0x0247502c, 0x028adab0, 0x02cd9568,
+ 0x030fa980, 0x03513dc0, 0x03927274, 0x03d363e0,
+ 0x04142e40, 0x0454edc0, 0x0495bd48, 0x04d6a060,
+ 0x051786d8, 0x05586548, 0x059935e8, 0x05d9feb0,
+ 0x061acea0, 0x065bb680, 0x069cc800, 0x06de13f0,
+ 0x071fa748, 0x07618b80, 0x07a3c7a8, 0x07e66da0,
+ 0x082999d0, 0x086d6590, 0x08b1e640, 0x08f72850,
+ 0x093d3120, 0x09840550, 0x09cba880, 0x0a1415f0,
+ 0x0a5d41b0, 0x0aa720d0, 0x0af1a9a0, 0x0b3cce70,
+ 0x0b887ec0, 0x0bd4ac10, 0x0c214a70, 0x0c6e5130,
+ 0x0cbbba50, 0x0d098130, 0x0d57a240, 0x0da61a60,
+ 0x0df4e620, 0x0e4401d0, 0x0e9369f0, 0x0ee31de0,
+ 0x0f332000, 0x0f837180, 0x0fd412a0, 0x10250260,
+ 0x10763f20, 0x10c7c660, 0x11199560, 0x116baa00,
+ 0x11be0400, 0x1210a1c0, 0x12638180, 0x12b69ee0,
+ 0x1309f3e0, 0x135d7ac0, 0x13b12dc0, 0x1404ffa0,
+ 0x1458dd40, 0x14acb720, 0x15008120, 0x15543260,
+ 0x15a7c460, 0x15fb3160, 0x164e7520, 0x16a193c0,
+ 0x16f49740, 0x17478720, 0x179a6720, 0x17ed3720,
+ 0x183ff460, 0x18929c20, 0x18e52b00, 0x19379c00,
+ 0x1989e900, 0x19dc0ca0, 0x1a2e0280, 0x1a7fc400,
+ 0x1ad14a00, 0x1b228ec0, 0x1b738ea0, 0x1bc44540,
+ 0x1c14ada0, 0x1c64c380, 0x1cb48440, 0x1d03f420,
+ 0x1d531c00, 0x1da20160, 0x1df0a660, 0x1e3f0860,
+ 0x1e8d2340, 0x1edaf340, 0x1f2875e0, 0x1f75a700,
+ 0x1fc281e0, 0x200f0380, 0x205b2ac0, 0x20a6f980,
+ 0x20f27200, 0x213d9600, 0x21886580, 0x21d2e040,
+ 0x221d0640, 0x2266d6c0, 0x22b05180, 0x22f97580,
+ 0x23424280, 0x238ab880, 0x23d2d780, 0x241aa040,
+ 0x246213c0, 0x24a93300, 0x24efff80, 0x25367b40,
+ 0x256f68c0, 0x25b53580, 0x25faa580, 0x263fb940,
+ 0x26847080, 0x26c8cbc0, 0x270ccb00, 0x27506e40,
+ 0x2793b600, 0x27d6a200, 0x281932c0, 0x285b6880,
+ 0x289d4400, 0x28dec5c0, 0x291feec0, 0x2960bf80,
+ 0x29a137c0, 0x29e15800, 0x2a212000, 0x2a609080,
+ 0x2a9fa980, 0x2ade6b40, 0x2b1cd600, 0x2b5aea00,
+ 0x2b98a740, 0x2bd60d80, 0x2c131cc0, 0x2c4fd500,
+ 0x2c8c3600, 0x2cc83f00, 0x2d03f040, 0x2d3f48c0,
+ 0x2d7a48c0, 0x2db4ef40, 0x2def3c40, 0x2e292ec0,
+ 0x2e62c700, 0x2e9c0400, 0x2ed4e580, 0x2f0d6ac0,
+ 0x2f4592c0, 0x2f7d5c80, 0x2fb4c6c0, 0x2febd140,
+ 0x30227b40, 0x3058c400, 0x308eab40, 0x30c43040,
+ 0x30f95100, 0x312e0d00, 0x31626240, 0x31965040,
+ 0x31c9d5c0, 0x31fcf240, 0x322fa480, 0x3261ec00,
+ 0x3293c7c0, 0x32c53680, 0x32f63780, 0x3326c9c0,
+ 0x3356ec00, 0x33869d00, 0x33b5db80, 0x33e4a700,
+ 0x3412fdc0, 0x3440df40, 0x346e4a80, 0x349b3e40,
+ 0x34c7ba00, 0x34f3bd80, 0x351f47c0, 0x354a5840,
+ 0x3574ee40, 0x359f0900, 0x35c8a840, 0x35f1cb80,
+ 0x361a71c0, 0x36429a80, 0x366a4580, 0x36917280,
+ 0x36b82100, 0x36de5180, 0x37040340, 0x372936c0,
+ 0x374dec40, 0x37722340, 0x3795dc40, 0x37b91780,
+ 0x37dbd600, 0x37fe18c0, 0x381fe080, 0x38412e00,
+ 0x38620280, 0x38825f40, 0x38a24540, 0x38c1b680,
+ 0x38e0b5c0, 0x38ff4540, 0x391d6800, 0x393b20c0,
+ 0x39587280, 0x39755fc0, 0x3991eb80, 0x39ae1a80,
+ 0x39c9f280, 0x39e57980, 0x3a00b600, 0x3a1bae00,
+ 0x3a366800, 0x3a50e9c0, 0x3a6b3a40, 0x3a8560c0,
+ 0x3a9f6640, 0x3ab95400, 0x3ad332c0, 0x3aed0680,
+ 0x3b06cf80, 0x3b208d40, 0x3b3a3e80, 0x3b53cb80,
+ 0x3b6d0780, 0x3b85c380, 0x3b9dd0c0, 0x3bb4eb40,
+ 0x3bcabac0, 0x3bdee680, 0x3bf11680, 0x3c011440,
+ 0x3c179ac0, 0x3c1c4f00, 0x3c21aa40, 0x3c278880,
+ 0x3c2dba80, 0x3c341140, 0x3c3a5e80, 0x3c409100,
+ 0x3c46b480, 0x3c4cd5c0, 0x3c530180, 0x3c593cc0,
+ 0x3c5f84c0, 0x3c65d640, 0x3c6c2e40, 0x3c728b40,
+ 0x3c78ee80, 0x3c7f5840, 0x3c85c940, 0x3c8c4240,
+ 0x3c92c380, 0x3c994cc0, 0x3c9fde40, 0x3ca67880,
+ 0x3cad1ac0, 0x3cb3c540, 0x3cba7800, 0x3cc132c0,
+ 0x3cc7f640, 0x3ccec280, 0x3cd59800, 0x3cdc76c0,
+ 0x3ce35e80, 0x3cea4f00, 0x3cf147c0, 0x3cf84900,
+ 0x3cff5340, 0x3d0666c0, 0x3d0d8400, 0x3d14ab40,
+ 0x3d1bdc00, 0x3d2315c0, 0x3d2a5880, 0x3d31a440,
+ 0x3d38f900, 0x3d405780, 0x3d47c040, 0x3d4f3300,
+ 0x3d56af40, 0x3d5e3500, 0x3d65c380, 0x3d6d5ac0,
+ 0x3d74fb40, 0x3d7ca540, 0x3d845900, 0x3d8c1680,
+ 0x3d93dd00, 0x3d9bac80, 0x3da38400, 0x3dab6400,
+ 0x3db34c80, 0x3dbb3dc0, 0x3dc33840, 0x3dcb3bc0,
+ 0x3dd347c0, 0x3ddb5bc0, 0x3de37780, 0x3deb9b00,
+ 0x3df3c600, 0x3dfbf940, 0x3e0434c0, 0x3e0c7840,
+ 0x3e14c3c0, 0x3e1d1640, 0x3e256f80, 0x3e2dcf40,
+ 0x3e363580, 0x3e3ea300, 0x3e4717c0, 0x3e4f9380,
+ 0x3e581600, 0x3e609e40, 0x3e692c40, 0x3e71bf80,
+ 0x3e7a5840, 0x3e82f740, 0x3e8b9c40, 0x3e944700,
+ 0x3e9cf780, 0x3ea5ad00, 0x3eae66c0, 0x3eb72500,
+ 0x3ebfe780, 0x3ec8af00, 0x3ed17b80, 0x3eda4d00,
+ 0x3ee32340, 0x3eebfd40, 0x3ef4dac0, 0x3efdbbc0,
+ 0x3f06a040, 0x3f0f88c0, 0x3f187540, 0x3f216600,
+ 0x3f2a5a80, 0x3f335200, 0x3f3c4c40, 0x3f454940,
+ 0x3f4e4940, 0x3f574c80, 0x3f605340, 0x3f695dc0,
+ 0x3f726b40, 0x3f7b7b40, 0x3f848dc0, 0x3f8da240,
+ 0x3f96b940, 0x3f9fd300, 0x3fa8f040, 0x3fb21080,
+ 0x3fbb33c0, 0x3fc459c0, 0x3fcd81c0, 0x3fd6abc0,
+ 0x3fdfd780, 0x3fe90480, 0x3ff23280, 0x3ffb6100,
+ 0x40049f80, 0x400dd080, 0x40170400, 0x40203880,
+ 0x40296f00, 0x4032a600, 0x403bde00, 0x40451680,
+ 0x404e4f00, 0x40578700, 0x4060be80, 0x4069f500,
+ 0x40732b80, 0x407c6280, 0x40859980, 0x408ed100,
+ 0x40980800, 0x40a13f00, 0x40aa7500, 0x40b3a980,
+ 0x40bcdd80, 0x40c61180, 0x40cf4500, 0x40d87800,
+ 0x40e1ab00, 0x40eadc80, 0x40f40c80, 0x40fd3a80,
+ 0x41066700, 0x410f9300, 0x4118bd80, 0x4121e700,
+ 0x412b0f80, 0x41343580, 0x413d5880, 0x41467980,
+ 0x414f9780, 0x4158b380, 0x4161cd80, 0x416ae580,
+ 0x4173fb00, 0x417d0d00, 0x41861b80, 0x418f2600,
+ 0x41982c80, 0x41a12f80, 0x41aa3000, 0x41b32c80,
+ 0x41bc2580, 0x41c51a00, 0x41ce0900, 0x41d6f300,
+ 0x41dfd800, 0x41e8b880, 0x41f19400, 0x41fa6b80,
+ 0x42033d00, 0x420c0900, 0x4214cf00, 0x421d8e00,
+ 0x42264680, 0x422ef980, 0x4237a680, 0x42404d80,
+ 0x4248ee00, 0x42518780, 0x425a1a00, 0x4262a480,
+ 0x426b2800, 0x4273a400, 0x427c1980, 0x42848880,
+ 0x428cef80, 0x42954f00, 0x429da680, 0x42a5f500,
+ 0x42ae3b80, 0x42b67a00, 0x42beb100, 0x42c6e080,
+ 0x42cf0780, 0x42d72680, 0x42df3c00, 0x42e74880,
+ 0x42ef4c80, 0x42f74880, 0x42ff3c80, 0x43072880,
+ 0x430f0c80, 0x4316e800, 0x431eba00, 0x43268380,
+ 0x432e4480, 0x4335fd00, 0x433dae80, 0x43455800,
+ 0x434cfa00, 0x43549400, 0x435c2500, 0x4363ad80,
+ 0x436b2e00, 0x4372a700, 0x437a1800, 0x43818200,
+ 0x4388e400, 0x43903f00, 0x43979200, 0x439edd00,
+ 0x43a62080, 0x43ad5c80, 0x43b49180, 0x43bbbf80,
+ 0x43c2e800, 0x43ca0b00, 0x43d12980, 0x43d84280,
+ 0x43df5200, 0x43e65500, 0x43ed4800, 0x43f43080,
+ 0x43fb1c80, 0x44021b80, 0x44093a00, 0x44106480,
+ 0x44176700, 0x441e0c00, 0x44241e00, 0x44297380,
+ 0x4425dc00, 0x44240180, 0x441ff300, 0x4419e300,
+ 0x44123f80, 0x44097500, 0x43ffe900, 0x43f5e700,
+ 0x43eb9f00, 0x43e13f00, 0x43d6f200, 0x43ccbd80,
+ 0x43c28400, 0x43b82780, 0x43ad8b00, 0x43a29c80,
+ 0x43975180, 0x438ba080, 0x437f8180, 0x4372fd00,
+ 0x43662b00, 0x43592480, 0x434c0000, 0x433ecd00,
+ 0x43319180, 0x43245300, 0x43171700, 0x4309da80,
+ 0x42fc9300, 0x42ef3500, 0x42e1b600, 0x42d40280,
+ 0x42c60000, 0x42b79300, 0x42a8a180, 0x42991a00,
+ 0x4288f200, 0x42782100, 0x42669e00, 0x42546880,
+ 0x42418800, 0x422e0480, 0x4219e500, 0x42053680,
+ 0x41f00980, 0x41da7080, 0x41c47b00, 0x41ae3600,
+ 0x4197ab80, 0x4180e400, 0x4169e780, 0x4152bb00,
+ 0x413b5e80, 0x4123d180, 0x410c1480, 0x40f42100,
+ 0x40dbed00, 0x40c36c80, 0x40aa9600, 0x40915f80,
+ 0x4077c100, 0x405db280, 0x40432c80, 0x40282580,
+ 0x400c9280, 0x3ff068c0, 0x3fd39dc0, 0x3fb62bc0,
+ 0x3f981200, 0x3f795080, 0x3f59e780, 0x3f39ebc0,
+ 0x3f198680, 0x3ef8e100, 0x3ed82440, 0x3eb76c80,
+ 0x3e96c940, 0x3e764900, 0x3e55f980, 0x3e35cb00,
+ 0x3e1590c0, 0x3df51cc0, 0x3dd44200, 0x3db2e640,
+ 0x3d910200, 0x3d6e8e40, 0x3d4b8480, 0x3d27e600,
+ 0x3d03bc00, 0x3cdf0fc0, 0x3cb9eb80, 0x3c946240,
+ 0x3c6e9180, 0x3c489700, 0x3c229000, 0x3bfc95c0,
+ 0x3bd6bd00, 0x3bb11a80, 0x3b8bc180, 0x3b669bc0,
+ 0x3b416a00, 0x3b1beb80, 0x3af5e140, 0x3acf3300,
+ 0x3aa7ef80, 0x3a802780, 0x3a57eb80, 0x3a2f5880,
+ 0x3a069640, 0x39ddcd40, 0x39b524c0, 0x398ca540,
+ 0x39643800, 0x393bc540, 0x39133580, 0x38ea7ac0,
+ 0x38c19040, 0x389871c0, 0x386f1b40, 0x38458e00,
+ 0x381bd000, 0x37f1e780, 0x37c7db00, 0x379db080,
+ 0x37736e80, 0x37491b00, 0x371ebcc0, 0x36f45980,
+ 0x36c96600, 0x369ed300, 0x36740380, 0x3648ffc0,
+ 0x361dcf40, 0x35f27a00, 0x35c70780, 0x359b7f80,
+ 0x356fe9c0, 0x35444dc0, 0x3518b280, 0x34ed1940,
+ 0x34c17c00, 0x3495d4c0, 0x346a1d40, 0x343e4300,
+ 0x34122840, 0x33e5ae00, 0x33b8b780, 0x338b4dc0,
+ 0x335d9f00, 0x332fdc00, 0x33023440, 0x32d4cc40,
+ 0x32a7bc80, 0x327b1d40, 0x324f04c0, 0x32235280,
+ 0x31f7b100, 0x31cbc7c0, 0x319f4140, 0x3171fb40,
+ 0x31440840, 0x31157d00, 0x30e66e80, 0x30b6fc40,
+ 0x30875080, 0x30579600, 0x3027f700, 0x2ff89140,
+ 0x2fc976c0, 0x2f9ab880, 0x2f6c6780, 0x2f3e8780,
+ 0x2f111000, 0x2ee3f800, 0x2eb73480, 0x2e8a9840,
+ 0x2e5dd340, 0x2e3093c0, 0x2e028ac0, 0x2dd39680,
+ 0x2da3c480, 0x2d732380, 0x2d41c400, 0x2d0fd300,
+ 0x2cdd9ac0, 0x2cab6640, 0x2c797f00, 0x2c480d40,
+ 0x2c171700, 0x2be6a0c0, 0x2bb6ae80, 0x2b8739c0,
+ 0x2b583200, 0x2b298600, 0x2afb2400, 0x2accfa40,
+ 0x2a9ef500, 0x2a710100, 0x2a430ac0, 0x2a14f9c0,
+ 0x29e6b0c0, 0x29b81240, 0x29890140, 0x29596900,
+ 0x29293e00, 0x28f87500, 0x28c70340, 0x2894efc0,
+ 0x28625140, 0x282f4040, 0x27fbd5c0, 0x27c83540,
+ 0x27948ec0, 0x27611240, 0x272def80, 0x26fb4cc0,
+ 0x26c94780, 0x2697fcc0, 0x26678880, 0x2637f740,
+ 0x26094540, 0x25db6dc0, 0x25ae6b40, 0x25821680,
+ 0x255627c0, 0x252a55c0, 0x24fe5680, 0x24d1db40,
+ 0x24a48fc0, 0x24761f40, 0x244637c0, 0x2414c900,
+ 0x23e20240, 0x23ae1740, 0x23793bc0, 0x2343cc00,
+ 0x230e4ac0, 0x22d93c80, 0x22a52400, 0x22725180,
+ 0x2240e480, 0x2210f9c0, 0x21e2ab40, 0x21b5c7c0,
+ 0x2189d2c0, 0x215e4d40, 0x2132b900, 0x2106ba80,
+ 0x20da1940, 0x20ac9d80, 0x207e11c0, 0x204e77c0,
+ 0x201e0880, 0x1fecfea0, 0x1fbb94e0, 0x1f8a0500,
+ 0x1f59d340, 0x1f27ac20, 0x1ef67c60, 0x1ec64e40,
+ 0x1e96fdc0, 0x1e686400, 0x1e3a5a00, 0x1e0cae80,
+ 0x1ddf25e0, 0x1db18460, 0x1d839020, 0x1d5536e0,
+ 0x1d268e80, 0x1cf7ae60, 0x1cc8aea0, 0x1c99af00,
+ 0x1c6ad820, 0x1c3c5280, 0x1c0e4500, 0x1be0ab60,
+ 0x1bb35620, 0x1b861400, 0x1b58b480, 0x1b2b1a00,
+ 0x1afd39c0, 0x1acf09a0, 0x1aa080c0, 0x1a71b020,
+ 0x1a42c2a0, 0x1a13e420, 0x19e53fc0, 0x19b6eb00,
+ 0x1988e620, 0x195b3060, 0x192dc8a0, 0x1900a8a0,
+ 0x18d3c4e0, 0x18a711e0, 0x187a83e0, 0x184e10e0,
+ 0x1821b060, 0x17f55a00, 0x17c90580, 0x179cb100,
+ 0x177060a0, 0x17441880, 0x1717dd20, 0x16ebb080,
+ 0x16bf9260, 0x169382e0, 0x166781c0, 0x163b8f80,
+ 0x160fade0, 0x15e3de40, 0x15b82220, 0x158c7ae0,
+ 0x1560ea80, 0x15357240, 0x150a1400, 0x14ded020,
+ 0x14b3a640, 0x148895a0, 0x145d9dc0, 0x1432bde0,
+ 0x1407f540, 0x13dd4380, 0x13b2a860, 0x13882460,
+ 0x135db880, 0x133365a0, 0x13092cc0, 0x12df0e60,
+ 0x12b50aa0, 0x128b2120, 0x12615200, 0x12379da0,
+ 0x120e04c0, 0x11e48820, 0x11bb2860, 0x1191e600,
+ 0x1168c080, 0x113fb7a0, 0x1116cb40, 0x10edfba0,
+ 0x10c54a00, 0x109cb7a0, 0x10744560, 0x104bf420,
+ 0x1023c3e0, 0x0ffbb500, 0x0fd3c790, 0x0fabfbe0,
+ 0x0f845290, 0x0f5ccc40, 0x0f356970, 0x0f0e2a60,
+ 0x0ee70eb0, 0x0ec01610, 0x0e994040, 0x0e728d50,
+ 0x0e4bfdf0, 0x0e2592c0, 0x0dff4c70, 0x0dd92af0,
+ 0x0db32da0, 0x0d8d53e0, 0x0d679cf0, 0x0d420880,
+ 0x0d1c9680, 0x0cf74700, 0x0cd219f0, 0x0cad0eb0,
+ 0x0c882450, 0x0c6359a0, 0x0c3ead90, 0x0c1a1f80,
+ 0x0bf5af40, 0x0bd15cf0, 0x0bad2870, 0x0b891440,
+ 0x0b652530, 0x0b416020, 0x0b1dca30, 0x0afa6810,
+ 0x0ad73ee0, 0x0ab45370, 0x0a91aac0, 0x0a6f49b0,
+ 0x0a4da7f0, 0x0a2c7e20, 0x0a0ba310, 0x09eb1220,
+ 0x09cac6e0, 0x09aabc70, 0x098aee40, 0x096b57a0,
+ 0x094bf400, 0x092cbea0, 0x090db2e0, 0x08eecef0,
+ 0x08d01360, 0x08b18110, 0x089318b0, 0x0874db00,
+ 0x0856c880, 0x0838e1b0, 0x081b2730, 0x07fd99a8,
+ 0x07e03a28, 0x07c309a8, 0x07a60910, 0x07893918,
+ 0x076c99d0, 0x07502b90, 0x0733ee70, 0x0717e2f8,
+ 0x06fc09b8, 0x06e06378, 0x06c4f0b8, 0x06a9b1c8,
+ 0x068ea6a0, 0x0673cf18, 0x06592b18, 0x063ebad0,
+ 0x06247ed0, 0x060a7780, 0x05f0a570, 0x05d708b8,
+ 0x05bda128, 0x05a46e80, 0x058b7078, 0x0572a740,
+ 0x055a1330, 0x0541b4d8, 0x05298c98, 0x05119a88,
+ 0x04f9de50, 0x04e257a0, 0x04cb0630, 0x04b3ea00,
+ 0x049d0378, 0x04865308, 0x046fd918, 0x045995a8,
+ 0x04438860, 0x042db0d0, 0x04180ea0, 0x0402a1d0,
+ 0x03ed6abc, 0x03d869b8, 0x03c39f28, 0x03af0af0,
+ 0x039aaca0, 0x038683b4, 0x03728fc0, 0x035ed0b0,
+ 0x034b46c4, 0x0337f254, 0x0324d3a0, 0x0311eab0,
+ 0x02ff370c, 0x02ecb85c, 0x02da6e34, 0x02c858a8,
+ 0x02b67820, 0x02a4cd28, 0x02935820, 0x02821920,
+ 0x02710fac, 0x02603b54, 0x024f9bb4, 0x023f308c,
+ 0x022ef9e8, 0x021ef7c8, 0x020f2a40, 0x01ff908e,
+ 0x01f02974, 0x01e0f38a, 0x01d1ed94, 0x01c316d6,
+ 0x01b46f5e, 0x01a5f720, 0x0197ae28, 0x018994ea,
+ 0x017bac54, 0x016df546, 0x016070ae, 0x01532078,
+ 0x01460760, 0x01392834, 0x012c85a4, 0x01201f7a,
+ 0x0113f27c, 0x0107fb6c, 0x00fc36fd, 0x00f0a2d5,
+ 0x00e53d51, 0x00da050f, 0x00cef88c, 0x00c41869,
+ 0x00b9671f, 0x00aee754, 0x00a49b80, 0x009a8384,
+ 0x00909ca6, 0x0086e400, 0x007d56e3, 0x0073f48e,
+ 0x006abe70, 0x0061b5de, 0x0058dc65, 0x005033b4,
+ 0x0047be30, 0x003f7e30, 0x00377619, 0x002fa4d4,
+ 0x002805ee, 0x002094cb, 0x00194cb8, 0x00122856,
+ 0x000b215c, 0x00043148, 0xfffd51f0, 0xfff683a0,
+ 0xffefcd4d, 0xffe9362f, 0xffe2c57d, 0xffdc855c,
+ 0xffd682c4, 0xffd0cad4, 0xffcb6a2c, 0xffc663bc,
+ 0xffc1b06f, 0xffbd48e1, 0xffb92570, 0xffb53a54,
+ 0xffb1779c, 0xffadcd38, 0xffaa2b42, 0xffa68855,
+ 0xffa2e141, 0xff9f332c, 0xff9b7b9c, 0xff97bf2e,
+ 0xff9409e2, 0xff9067e2, 0xff8ce556, 0xff898bf0,
+ 0xff866306, 0xff8371d0, 0xff80bf63, 0xff7e4eba,
+ 0xff7c1eaa, 0xff7a2e04, 0xff787b47, 0xff770280,
+ 0xff75bd06, 0xff74a3f7, 0xff73b0b2, 0xff72dd02,
+ 0xff72237e, 0xff717ebe, 0xff70e94c, 0xff705f59,
+ 0xff6fde6a, 0xff6f6426, 0xff6eee40, 0xff6e7d0b,
+ 0xff6e1359, 0xff6db403, 0xff6d61f8, 0xff6d2054,
+ 0xff6cf267, 0xff6cdb76, 0xff6cdebb, 0xff6cff47,
+ 0xff6d3fc9, 0xff6da306, 0xff6e2b82, 0xff6eda13,
+ 0xff6fad6d, 0xff70a463, 0xff71bd9d, 0xff72f662,
+ 0xff744a80, 0xff75b5c4, 0xff773409, 0xff78c0a6,
+ 0xff7a5693, 0xff7bf0dc, 0xff7d8abb, 0xff7f2301,
+ 0xff80bc08, 0xff825854, 0xff83fa56, 0xff85a55c,
+ 0xff875d22, 0xff892598, 0xff8b025d, 0xff8cf53c,
+ 0xff8efdf4, 0xff911c48, 0xff934fc9, 0xff959675,
+ 0xff97ec86, 0xff9a4e35, 0xff9cb7d2, 0xff9f26cc,
+ 0xffa199ce, 0xffa40f74, 0xffa6867c, 0xffa8feb2,
+ 0xffab78e0, 0xffadf5c7, 0xffb07640, 0xffb2fba0,
+ 0xffb587a2, 0xffb81bfb, 0xffbaba46, 0xffbd6236,
+ 0xffc011a8, 0xffc2c679, 0xffc57e84, 0xffc83894,
+ 0xffcaf41a, 0xffcdb0b8, 0xffd06e17, 0xffd32bf7,
+ 0xffd5ea38, 0xffd8a8c3, 0xffdb6764, 0xffde25fb,
+ 0xffe0e471, 0xffe3a2b2, 0xffe66087, 0xffe91da6,
+ 0xffebd978, 0xffee9351, 0xfff14ab0, 0xfff3fef6,
+ 0xfff6af94, 0xfff95c0c, 0xfffc03c7, 0xfffea659,
+ 0x00015885, 0x0003f2e9, 0x00068a73, 0x00091e8d,
+ 0x000bae7f, 0x000e39bf, 0x0010bf96, 0x00133f78,
+ 0x0015b8c4, 0x00182ae4, 0x001a9558, 0x001cf7b2,
+ 0x001f51e0, 0x0021a3b4, 0x0023ed25, 0x00262df2,
+ 0x002865c5, 0x002a9469, 0x002cb967, 0x002ed4aa,
+ 0x0030e607, 0x0032ed88, 0x0034eb2f, 0x0036de23,
+ 0x0038c503, 0x003a9e4c, 0x003c68a6, 0x003e23dd,
+ 0x003fd0db, 0x00417083, 0x0043038b, 0x00448adf,
+ 0x00460740, 0x0047799c, 0x0048e2b2, 0x004a42af,
+ 0x004b98fb, 0x004ce50b, 0x004e2654, 0x004f5b5d,
+ 0x005081c3, 0x00519716, 0x00529920, 0x005386d0,
+ 0x0054603f, 0x00552581, 0x0055d6cc, 0x00567558,
+ 0x0057033c, 0x005782b4, 0x0057f5b6, 0x00585e46,
+ 0x0058be68, 0x005917ff, 0x00596ce4, 0x0059bcc0,
+ 0x005a053a, 0x005a43ee, 0x005a76ae, 0x005a9b37,
+ 0x005aaf38, 0x005ab07a, 0x005a9cef, 0x005a7349,
+ 0x005a3328, 0x0059dc0a, 0x00596db0, 0x0058e8e5,
+ 0x00584f98, 0x0057a3c0, 0x0056e738, 0x00561bec,
+ 0x005543df, 0x0054610b, 0x0053753e, 0x0052824e,
+ 0x005189f6, 0x00508dec, 0x004f8fc0, 0x004e8fd0,
+ 0x004d8d26, 0x004c86d7, 0x004b7c0a, 0x004a6b33,
+ 0x00495239, 0x00482f0e, 0x0046ffc4, 0x0045c201,
+ 0x00447337, 0x004310cc, 0x00419871, 0x004008e4,
+ 0x003e6231, 0x003ca460, 0x003acf8a, 0x0038e57a,
+ 0x0036e981, 0x0034defa, 0x0032c94b, 0x0030acc6,
+ 0x002e8eb4, 0x002c7452, 0x002a62aa, 0x00285bbf,
+ 0x00265eda, 0x00246b24, 0x00227f9c, 0x002098e7,
+ 0x001eb13b, 0x001cc2ef, 0x001ac899, 0x0018be3d,
+ 0x0016a198, 0x00147065, 0x00122897, 0x000fcbc5,
+ 0x000d5f03, 0x000ae77a, 0x00086a52, 0x0005eb92,
+ 0x00036e4a, 0x0000f57e, 0xfffe8414, 0xfffc1a78,
+ 0xfff9b6bb, 0xfff756d9, 0xfff4f8d0, 0xfff29add,
+ 0xfff03b87, 0xffedd94c, 0xffeb7295, 0xffe9072b,
+ 0xffe6981a, 0xffe4265b, 0xffe1b30e, 0xffdf3f2b,
+ 0xffdccb9e, 0xffda5993, 0xffd7ea0c, 0xffd57d60,
+ 0xffd31302, 0xffd0aa27, 0xffce4243, 0xffcbdb40,
+ 0xffc97595, 0xffc711a2, 0xffc4af9d, 0xffc24fa6,
+ 0xffbff1de, 0xffbd9699, 0xffbb3e44, 0xffb8e8d5,
+ 0xffb695f4, 0xffb44522, 0xffb1f627, 0xffafa8f0,
+ 0xffad5d91, 0xffab140a, 0xffa8cc1c, 0xffa68590,
+ 0xffa44066, 0xffa1fca0, 0xff9fba30, 0xff9d7902,
+ 0xff9b3916, 0xff98fa6d, 0xff96bd06, 0xff9480b6,
+ 0xff924532, 0xff900a24, 0xff8dcf41, 0xff8b9433,
+ 0xff895884, 0xff871bd3, 0xff84dd8a, 0xff829d34,
+ 0xff805a43, 0xff7e142d, 0xff7bca71, 0xff797c83,
+ 0xff7729e3, 0xff74d204, 0xff727451, 0xff70101e,
+ 0xff6da493, 0xff6b30d1, 0xff68b3f4, 0xff662d31,
+ 0xff639bd1, 0xff60ff09, 0xff5e562c, 0xff5ba3e0,
+ 0xff58ee39, 0xff563c22, 0xff5394f3, 0xff50fd1e,
+ 0xff4e7599, 0xff4bff32, 0xff499ad4, 0xff47490a,
+ 0xff450a36, 0xff42deb7, 0xff40c6cf, 0xff3ec2be,
+ 0xff3cd299, 0xff3af681, 0xff392e6a, 0xff377a4a,
+ 0xff35d9f7, 0xff344d44, 0xff32d3e8, 0xff316d96,
+ 0xff3019d9, 0xff2ed83a, 0xff2da82f, 0xff2c88bf,
+ 0xff2b78b4, 0xff2a76cc, 0xff298184, 0xff289890,
+ 0xff27bc7d, 0xff26ee21, 0xff262e28, 0xff257cdc,
+ 0xff24d9f4, 0xff244524, 0xff23be15, 0xff234488,
+ 0xff22d852, 0xff227947, 0xff22273d, 0xff21e1d2,
+ 0xff21a871, 0xff217a79, 0xff215748, 0xff213eca,
+ 0xff21319e, 0xff21305c, 0xff213baf, 0xff2153c2,
+ 0xff21782b, 0xff21a892, 0xff21e477, 0xff222bda,
+ 0xff227f26, 0xff22debd, 0xff234b09, 0xff23c394,
+ 0xff24471d, 0xff24d42b, 0xff25695c, 0xff260538,
+ 0xff26a652, 0xff274b28, 0xff27f22d, 0xff2899d2,
+ 0xff295975, 0xff29f2ad, 0xff2a96d7, 0xff2b45f4,
+ 0xff2bffe3, 0xff2cc4ba, 0xff2d9458, 0xff2e6ede,
+ 0xff2f544c, 0xff3044b7, 0xff314034, 0xff3246fa,
+ 0xff33591e, 0xff3476e0, 0xff35a060, 0xff36d534,
+ 0xff38148f, 0xff395daf, 0xff3aafd4, 0xff3c0ac8,
+ 0xff3d6ed6, 0xff3edc54, 0xff405382, 0xff41d3f5,
+ 0xff435ccc, 0xff44ed0f, 0xff4683d3, 0xff482080,
+ 0xff49c297, 0xff4b69ab, 0xff4d1547, 0xff4ec4f5,
+ 0xff50781d, 0xff522e20, 0xff53e692, 0xff55a15d,
+ 0xff575f17, 0xff592022, 0xff5ae4de, 0xff5cacb4,
+ 0xff5e75e2, 0xff603ee5, 0xff62062f, 0xff63caab,
+ 0xff658b55, 0xff67476d, 0xff68fe11, 0xff6aaea0,
+ 0xff6c5899, 0xff6dfb86, 0xff6f96e7, 0xff712a65,
+ 0xff72b59f, 0xff74382b, 0xff75b1d3, 0xff772276,
+ 0xff788a20, 0xff79e8e5, 0xff7b3ef0, 0xff7c8c98,
+ 0xff7dd249, 0xff7f108c, 0xff804804, 0xff817d0e,
+ 0xff82b74a, 0xff83fde6, 0xff855762, 0xff86c622,
+ 0xff884904, 0xff89ded1, 0xff8b8646, 0xff8d3e4c,
+ 0xff8f05cc, 0xff90dbc6, 0xff92bf2a, 0xff94af04,
+ 0xff96aa26, 0xff98af9a, 0xff9abe48, 0xff9cd543,
+ 0xff9ef3c1, 0xffa118ea, 0xffa343fd, 0xffa57423,
+ 0xffa7a890, 0xffa9e084, 0xffac1b31, 0xffae5802,
+ 0xffb09680, 0xffb2d621, 0xffb51678, 0xffb75704,
+ 0xffb99726, 0xffbbd645, 0xffbe13d7, 0xffc04f26,
+ 0xffc2879a, 0xffc4bc72, 0xffc6ed24, 0xffc918e3,
+ 0xffcb3eb8, 0xffcd5dcc, 0xffcf7549, 0xffd184d8,
+ 0xffd38c8f, 0xffd58ca4, 0xffd7854d, 0xffd97694,
+ 0xffdb606e, 0xffdd42d1, 0xffdf1da8, 0xffe0f09b,
+ 0xffe2bb00, 0xffe47c41, 0xffe633c6, 0xffe7e150,
+ 0xffe98534, 0xffeb1fb4, 0xffecb10e, 0xffee3944,
+ 0xffefb7e9, 0xfff12cbe, 0xfff29762, 0xfff3f789,
+ 0xfff54cbe, 0xfff69695, 0xfff7d4b8, 0xfff90748,
+ 0xfffa2ee5, 0xfffb4c3c, 0xfffc6003, 0xfffd6af0,
+ 0xfffe6dda, 0xffff69b8, 0x00005f4b, 0x00014e7f,
+ 0x00023646, 0x000315b4, 0x0003ebd3, 0x0004b74a,
+ 0x00057677, 0x000627e2, 0x0006ca09, 0x00075ce1,
+ 0x0007e196, 0x00085955, 0x0008c556, 0x00092751,
+ 0x00098153, 0x0009d581, 0x000a25be, 0x000a732b,
+ 0x000abe1f, 0x000b06e4, 0x000b4db1, 0x000b91fa,
+ 0x000bd266, 0x000c0da0, 0x000c426e, 0x000c6ffb,
+ 0x000c95b0, 0x000cb2f7, 0x000cc76e, 0x000cd317,
+ 0x000cd647, 0x000cd17f, 0x000cc52b, 0x000cb1ea,
+ 0x000c98c0, 0x000c7a62, 0x000c57c7, 0x000c3187,
+ 0x000c0862, 0x000bdcd8, 0x000baf81, 0x000b80c7,
+ 0x000b50ec, 0x000b202f, 0x000aeec6, 0x000abcb2,
+ 0x000a89d2, 0x000a5605, 0x000a2116, 0x0009eafb,
+ 0x0009b37d, 0x00097a9d, 0x00094030, 0x00090440,
+ 0x0008c6b9, 0x000887ae, 0x0008470c, 0x00080512,
+ 0x0007c1f6, 0x00077df9, 0x0007395a, 0x0006f45b,
+ 0x0006af67, 0x00066abe, 0x000626b6, 0x0005e38f,
+ 0x0005a1a0, 0x0005611e, 0x00052234, 0x0004e502,
+ 0x0004a95d, 0x00046f46, 0x00043691, 0x0003ff33,
+ 0x0003c90d, 0x0003941f, 0x00036047, 0x00032d9c,
+ 0x0002fc1e, 0x0002cbed, 0x00029d1e, 0x00026fbc,
+ 0x000243f2, 0x000219d6, 0x0001f17d, 0x0001caf1,
+ 0x0001a63e, 0x00018363, 0x00016256, 0x00014316,
+ 0x0001258f, 0x000109cb, 0x0000efaa, 0x0000d720,
+ 0x0000c03a, 0x0000aacb, 0x000096de, 0x0000846a,
+ 0x0000736d, 0x000063d3, 0x000055a6, 0x000048d0,
+ 0x00003d47, 0x000032f6, 0x000029dc, 0x000021d9,
+ 0x00001ae3, 0x000014ee, 0x00000fdb, 0x00000ba9,
+ 0x00000839, 0x00000589, 0x00000370, 0x000001ee,
+ 0x000000d7, 0x00000036, 0xffffffe0, 0xffffffc0,
+ 0xffffffd5, 0xfffffff5, 0x0000000b, 0x0000000b,
+ 0x0000000b, 0x0000000b, 0xfffffff5, 0xffffffd5,
+ 0xffffffca, 0xffffffe0, 0x00000036, 0x000000d7,
+ 0x000001ce, 0x0000033b, 0x00000529, 0x000007ad,
+ 0x00000ac8, 0x00000e99, 0x00001316, 0x0000185e,
+ 0x00001e7e, 0x00002575, 0x00002d4c, 0x0000361b,
+ 0x00003fd6, 0x00004a93, 0x00005647, 0x00006312,
+ 0x000070de, 0x00007fad, 0x00008f87, 0x0000a064,
+ 0x0000b242, 0x0000c52d, 0x0000d919, 0x0000ee12,
+ 0x0001040c, 0x00011b13, 0x0001331b, 0x00014c30,
+ 0x0001663c, 0x0001814a, 0x00019d4f, 0x0001ba35,
+ 0x0001d7e7, 0x0001f645, 0x00021544, 0x000234c3,
+ 0x000254b9, 0x00027505, 0x000295a7, 0x0002b67e,
+ 0x0002d7a1, 0x0002f904, 0x00031ab2, 0x00033ca0,
+ 0x00035ee5, 0x0003818a, 0x0003a485, 0x0003c7e1,
+ 0x0003eb72, 0x00040f0e, 0x0004329f, 0x000455e6,
+ 0x000478c0, 0x00049aef, 0x0004bc52, 0x0004dca9,
+ 0x0004fbde, 0x000519c5, 0x00053635, 0x0005512d,
+ 0x00056aae, 0x000582a1, 0x00059927, 0x0005ae40,
+ 0x0005c1f6, 0x0005d455, 0x0005e572, 0x0005f56d,
+ 0x00060446, 0x0006121e, 0x00061f09, 0x00062b08,
+ 0x00063605, 0x00063feb, 0x00064899, 0x00064ff0,
+ 0x000655a5, 0x00065996, 0x00065b6f, 0x00065af8,
+ 0x000657e9, 0x000651d4, 0x00064884, 0x00063bae,
+ 0x00062b33, 0x00061706, 0x0005fefd, 0x0005e344,
+ 0x0005c404, 0x0005a195, 0x00057c41, 0x00055473,
+ 0x00052ac2, 0x0004ffc4, 0x0004d410, 0x0004a7e5,
+ 0x00047b4f, 0x00044e39, 0x00042096, 0x0003f208,
+ 0x0003c1e1, 0x00038f77, 0x00035a12, 0x00032127,
+ 0x0002e476, 0x0002a389, 0x00025e29, 0x0002146d,
+ 0x0001c700, 0x00017682, 0x000123a1, 0x0000cefd,
+ 0x000078f7, 0x0000221a, 0xffffcad1, 0xffff7332,
+ 0xffff1b1e, 0xfffec253, 0xfffe6891, 0xfffe0da2,
+ 0xfffdb15c, 0xfffd5393, 0xfffcf412, 0xfffc92e3,
+ 0xfffc3032, 0xfffbcc29, 0xfffb6714, 0xfffb0113,
+ 0xfffa9a5b, 0xfffa3337, 0xfff9cbd4, 0xfff96450,
+ 0xfff8fcac, 0xfff894dc, 0xfff82cd8, 0xfff7c4a8,
+ 0xfff75c6d, 0xfff6f45e, 0xfff68c84, 0xfff62500,
+ 0xfff5bde8, 0xfff5575a, 0xfff4f179, 0xfff48c64,
+ 0xfff42810, 0xfff3c488, 0xfff361d7, 0xfff30008,
+ 0xfff29f3a, 0xfff23f78, 0xfff1e0d8, 0xfff1835b,
+ 0xfff1272a, 0xfff0cc46, 0xfff072cf, 0xfff01ad0,
+ 0xffefc469, 0xffef6fa4, 0xffef1ca3, 0xffeecb7a,
+ 0xffee7c1f, 0xffee2eb2, 0xffede33d, 0xffed99c1,
+ 0xffed5249, 0xffed0cde, 0xffecc98d, 0xffec8849,
+ 0xffec4934, 0xffec0c38, 0xffebd175, 0xffeb98eb,
+ 0xffeb62a4, 0xffeb2ead, 0xffeafd19, 0xffeacdea,
+ 0xffeaa129, 0xffea76cc, 0xffea4ef4, 0xffea299f,
+ 0xffea06e5, 0xffe9e6ce, 0xffe9c97d, 0xffe9aebb,
+ 0xffe99651, 0xffe97fd6, 0xffe96ad3, 0xffe95711,
+ 0xffe9447d, 0xffe93315, 0xffe922ce, 0xffe913a0,
+ 0xffe90588, 0xffe8f887, 0xffe8ec93, 0xffe8e1c1,
+ 0xffe8d806, 0xffe8cf77, 0xffe8c816, 0xffe8c1eb,
+ 0xffe8bd03, 0xffe8b967, 0xffe8b72e, 0xffe8b64d,
+ 0xffe8b6d8, 0xffe8b8dc, 0xffe8bc6c, 0xffe8c18a,
+ 0xffe8c840, 0xffe8d0a4, 0xffe8daca, 0xffe8e69e,
+ 0xffe8f42a, 0xffe9035a, 0xffe9142b, 0xffe926a0,
+ 0xffe93ab7, 0xffe95066, 0xffe967b8, 0xffe980ad,
+ 0xffe99b3a, 0xffe9b754, 0xffe9d511, 0xffe9f45b,
+ 0xffea1532, 0xffea3797, 0xffea5b89, 0xffea8108,
+ 0xffeaa7ff, 0xffead079, 0xffeafa55, 0xffeb259e,
+ 0xffeb5254, 0xffeb8061, 0xffebafdc, 0xffebe0ae,
+ 0xffec12ce, 0xffec462f, 0xffec7add, 0xffecb0a3,
+ 0xffece774, 0xffed1f32, 0xffed57a7, 0xffed90b2,
+ 0xffedca48, 0xffee042a, 0xffee3e57, 0xffee788e,
+};
+
const DECLARE_ALIGNED(32, float, ff_aac_eld_window_480)[1800] = {
0.00101191, 0.00440397, 0.00718669, 0.01072130,
0.01459757, 0.01875954, 0.02308987, 0.02751541,
@@ -2219,3 +2705,456 @@ const DECLARE_ALIGNED(32, float, ff_aac_eld_window_480)[1800] = {
-0.00115988, -0.00114605, -0.00113200, -0.00111778,
-0.00110343, -0.00108898, -0.00107448, -0.00105995,
};
+
+const DECLARE_ALIGNED(32, int, ff_aac_eld_window_480_fixed)[1800] = {
+ 0x00109442, 0x00482797, 0x0075bf2a, 0x00afa864,
+ 0x00ef2aa5, 0x01335b36, 0x017a4df0, 0x01c2cffe,
+ 0x020bfb4c, 0x0254fd74, 0x029d557c, 0x02e50574,
+ 0x032c41a8, 0x03732c08, 0x03b9cb88, 0x040032e8,
+ 0x044686f0, 0x048cd578, 0x04d30738, 0x05190500,
+ 0x055ec210, 0x05a44750, 0x05e9aeb8, 0x062f0c80,
+ 0x067477a0, 0x06ba1ac0, 0x07001998, 0x074680e0,
+ 0x078d5ec0, 0x07d4d038, 0x081cf8f0, 0x0865f8b0,
+ 0x08afe0e0, 0x08fab150, 0x09466cd0, 0x09931910,
+ 0x09e0adb0, 0x0a2f1640, 0x0a7e43f0, 0x0ace2960,
+ 0x0b1eb180, 0x0b6fc4b0, 0x0bc15050, 0x0c134710,
+ 0x0c65a420, 0x0cb86340, 0x0d0b7df0, 0x0d5ef450,
+ 0x0db2cb60, 0x0e070180, 0x0e5b91f0, 0x0eb07f20,
+ 0x0f05d0a0, 0x0f5b8920, 0x0fb1a950, 0x10082e40,
+ 0x105f1400, 0x10b65820, 0x110df780, 0x1165f120,
+ 0x11be43e0, 0x1216eea0, 0x126feac0, 0x12c92b00,
+ 0x1322a620, 0x137c55c0, 0x13d61ae0, 0x142fc940,
+ 0x148949e0, 0x14e28da0, 0x153b9a80, 0x15947640,
+ 0x15ed1840, 0x16458660, 0x169deb20, 0x16f663c0,
+ 0x174ef8c0, 0x17a7a120, 0x180041c0, 0x1858d000,
+ 0x18b14940, 0x1909a140, 0x1961c820, 0x19b9b620,
+ 0x1a116480, 0x1a68c1a0, 0x1abfbd00, 0x1b164f60,
+ 0x1b6c7580, 0x1bc23120, 0x1c1780e0, 0x1c6c5d00,
+ 0x1cc0dbe0, 0x1d1532a0, 0x1d697660, 0x1dbdac20,
+ 0x1e11b280, 0x1e655b80, 0x1eb89e80, 0x1f0b7720,
+ 0x1f5dd680, 0x1fafaec0, 0x2000fb00, 0x2051c340,
+ 0x20a22ac0, 0x20f24580, 0x214213c0, 0x21919140,
+ 0x21e0b300, 0x222f7580, 0x227dd900, 0x22cbd880,
+ 0x23196ec0, 0x23669b00, 0x23b35d80, 0x23ffb6c0,
+ 0x244ba7c0, 0x249731c0, 0x24e25700, 0x252d1940,
+ 0x2594ae40, 0x25deea40, 0x2628bd00, 0x26722680,
+ 0x26bb2740, 0x2703bf40, 0x274beec0, 0x2793b600,
+ 0x27db1500, 0x28220c00, 0x28689b80, 0x28aec4c0,
+ 0x28f48800, 0x2939e680, 0x297ee080, 0x29c37600,
+ 0x2a07a740, 0x2a4b74c0, 0x2a8ede80, 0x2ad1e500,
+ 0x2b148880, 0x2b56c940, 0x2b98a740, 0x2bda2240,
+ 0x2c1b3a80, 0x2c5bef80, 0x2c9c4100, 0x2cdc2e80,
+ 0x2d1bb800, 0x2d5adc80, 0x2d999b80, 0x2dd7f500,
+ 0x2e15e800, 0x2e537400, 0x2e9098c0, 0x2ecd5540,
+ 0x2f09a900, 0x2f4592c0, 0x2f811140, 0x2fbc2340,
+ 0x2ff6c7c0, 0x3030fe80, 0x306ac6c0, 0x30a41f80,
+ 0x30dd07c0, 0x31157dc0, 0x314d7fc0, 0x31850c80,
+ 0x31bc22c0, 0x31f2c1c0, 0x3228e840, 0x325e9540,
+ 0x3293c7c0, 0x32c87e40, 0x32fcb800, 0x33307340,
+ 0x3363aec0, 0x33966940, 0x33c8a140, 0x33fa5580,
+ 0x342b84c0, 0x345c2dc0, 0x348c4f80, 0x34bbe900,
+ 0x34eaf9c0, 0x35198080, 0x35477d00, 0x3574ee40,
+ 0x35a1d340, 0x35ce2bc0, 0x35f9f6c0, 0x36253380,
+ 0x364fe180, 0x367a0040, 0x36a38f80, 0x36cc8ec0,
+ 0x36f4fe80, 0x371cde80, 0x37442e80, 0x376aef00,
+ 0x37912000, 0x37b6c200, 0x37dbd600, 0x38005d00,
+ 0x38245840, 0x3847c880, 0x386aaf80, 0x388d0e80,
+ 0x38aee700, 0x38d03bc0, 0x38f11000, 0x39116700,
+ 0x39314440, 0x3950ab00, 0x396f9e80, 0x398e22c0,
+ 0x39ac3c40, 0x39c9f280, 0x39e74cc0, 0x3a045280,
+ 0x3a210b40, 0x3a3d7ec0, 0x3a59b480, 0x3a75b480,
+ 0x3a918900, 0x3aad3cc0, 0x3ac8db00, 0x3ae46bc0,
+ 0x3afff080, 0x3b1b6840, 0x3b36d2c0, 0x3b521980,
+ 0x3b6d0780, 0x3b876400, 0x3ba0f4c0, 0x3bb96740,
+ 0x3bd03dc0, 0x3be56580, 0x3bf6dec0, 0x3c0c6140,
+ 0x3c15a9c0, 0x3c1a5780, 0x3c1fd0c0, 0x3c25edc0,
+ 0x3c2c78c0, 0x3c333880, 0x3c39f3c0, 0x3c409100,
+ 0x3c471d00, 0x3c4da780, 0x3c543f40, 0x3c5ae880,
+ 0x3c619f00, 0x3c685f00, 0x3c6f25c0, 0x3c75f280,
+ 0x3c7cc6c0, 0x3c83a2c0, 0x3c8a87c0, 0x3c9175c0,
+ 0x3c986d00, 0x3c9f6e00, 0x3ca67880, 0x3cad8c40,
+ 0x3cb4a980, 0x3cbbd000, 0x3cc2ffc0, 0x3cca3940,
+ 0x3cd17d40, 0x3cd8cb80, 0x3ce02480, 0x3ce78740,
+ 0x3ceef3c0, 0x3cf66a00, 0x3cfdea00, 0x3d0574c0,
+ 0x3d0d0a40, 0x3d14ab40, 0x3d1c5700, 0x3d240d00,
+ 0x3d2bcd40, 0x3d3397c0, 0x3d3b6cc0, 0x3d434d00,
+ 0x3d4b38c0, 0x3d532fc0, 0x3d5b3180, 0x3d633dc0,
+ 0x3d6b53c0, 0x3d737400, 0x3d7b9f00, 0x3d83d540,
+ 0x3d8c1680, 0x3d946200, 0x3d9cb780, 0x3da51680,
+ 0x3dad7f00, 0x3db5f140, 0x3dbe6dc0, 0x3dc6f480,
+ 0x3dcf8540, 0x3dd81fc0, 0x3de0c300, 0x3de96ec0,
+ 0x3df22340, 0x3dfae0c0, 0x3e03a800, 0x3e0c7840,
+ 0x3e155180, 0x3e1e32c0, 0x3e271bc0, 0x3e300c00,
+ 0x3e390400, 0x3e420400, 0x3e4b0c40, 0x3e541c80,
+ 0x3e5d33c0, 0x3e6651c0, 0x3e6f7580, 0x3e789fc0,
+ 0x3e81d080, 0x3e8b0880, 0x3e944700, 0x3e9d8c00,
+ 0x3ea6d680, 0x3eb02600, 0x3eb97a80, 0x3ec2d400,
+ 0x3ecc3340, 0x3ed59880, 0x3edf0300, 0x3ee87280,
+ 0x3ef1e600, 0x3efb5d40, 0x3f04d880, 0x3f0e5840,
+ 0x3f17dcc0, 0x3f216600, 0x3f2af340, 0x3f348440,
+ 0x3f3e1840, 0x3f47af40, 0x3f514a00, 0x3f5ae840,
+ 0x3f648b00, 0x3f6e3140, 0x3f77db00, 0x3f818740,
+ 0x3f8b3600, 0x3f94e780, 0x3f9e9c40, 0x3fa85480,
+ 0x3fb21080, 0x3fbbcfc0, 0x3fc59200, 0x3fcf56c0,
+ 0x3fd91dc0, 0x3fe2e640, 0x3fecb040, 0x3ff67b40,
+ 0x40098600, 0x40135580, 0x401d2700, 0x4026fa00,
+ 0x4030ce80, 0x403aa380, 0x40447900, 0x404e4f00,
+ 0x40582400, 0x4061f900, 0x406bcd00, 0x4075a080,
+ 0x407f7480, 0x40894900, 0x40931e00, 0x409cf280,
+ 0x40a6c600, 0x40b09800, 0x40ba6980, 0x40c43a80,
+ 0x40ce0b00, 0x40d7db00, 0x40e1ab00, 0x40eb7980,
+ 0x40f54600, 0x40ff1080, 0x4108d980, 0x4112a100,
+ 0x411c6800, 0x41262d80, 0x412ff080, 0x4139b180,
+ 0x41436e80, 0x414d2980, 0x4156e100, 0x41609700,
+ 0x416a4a80, 0x4173fb00, 0x417da800, 0x41875000,
+ 0x4190f400, 0x419a9400, 0x41a43000, 0x41adc880,
+ 0x41b75d00, 0x41c0ec80, 0x41ca7700, 0x41d3fb00,
+ 0x41dd7980, 0x41e6f280, 0x41f06600, 0x41f9d480,
+ 0x42033d00, 0x420c9f00, 0x4215f980, 0x421f4d00,
+ 0x42289900, 0x4231de80, 0x423b1d00, 0x42445500,
+ 0x424d8500, 0x4256ad00, 0x425fcc80, 0x4268e380,
+ 0x4271f200, 0x427af900, 0x4283f880, 0x428cef80,
+ 0x4295de00, 0x429ec280, 0x42a79d80, 0x42b06f00,
+ 0x42b93800, 0x42c1f800, 0x42caaf80, 0x42d35d80,
+ 0x42dc0100, 0x42e49b00, 0x42ed2a80, 0x42f5b080,
+ 0x42fe2d80, 0x4306a180, 0x430f0c80, 0x43176d80,
+ 0x431fc480, 0x43281100, 0x43305400, 0x43388e80,
+ 0x4340c000, 0x4348e900, 0x43510900, 0x43591f00,
+ 0x43612b80, 0x43692f00, 0x43712900, 0x43791a80,
+ 0x43810380, 0x4388e400, 0x4390bc00, 0x43988b00,
+ 0x43a05180, 0x43a80f00, 0x43afc480, 0x43b77180,
+ 0x43bf1780, 0x43c6b700, 0x43ce5100, 0x43d5e580,
+ 0x43dd7100, 0x43e4ef80, 0x43ec5b80, 0x43f3ba80,
+ 0x43fb1c80, 0x44029400, 0x440a2e80, 0x4411d080,
+ 0x44193800, 0x44202480, 0x44265880, 0x442ba780,
+ 0x442d8680, 0x4428a500, 0x44241380, 0x441ccb00,
+ 0x44140100, 0x440a1200, 0x43ff7280, 0x43f46980,
+ 0x43e93200, 0x43ddff00, 0x43d2dc80, 0x43c7ac00,
+ 0x43bc4900, 0x43b09400, 0x43a47d80, 0x4397fd80,
+ 0x438b0780, 0x437d9b80, 0x436fd380, 0x4361cd80,
+ 0x4353a800, 0x43457500, 0x43373c80, 0x43290500,
+ 0x431ad400, 0x430ca280, 0x42fe6000, 0x42f00080,
+ 0x42e17380, 0x42d29e00, 0x42c35d80, 0x42b39200,
+ 0x42a32080, 0x4291fc00, 0x42801900, 0x426d6d80,
+ 0x4259f680, 0x4245bd00, 0x4230ca80, 0x421b2900,
+ 0x4204e800, 0x41ee1d00, 0x41d6dd80, 0x41bf3c80,
+ 0x41a74680, 0x418f0680, 0x41768800, 0x415dd100,
+ 0x4144e400, 0x412bbf80, 0x41126400, 0x40f8cc00,
+ 0x40deea00, 0x40c4b100, 0x40aa1400, 0x408f0800,
+ 0x40738380, 0x40577d80, 0x403aeb80, 0x401dc180,
+ 0x3ffff240, 0x3fe170c0, 0x3fc232c0, 0x3fa23680,
+ 0x3f817c40, 0x3f6002c0, 0x3f3ddec0, 0x3f1b4180,
+ 0x3ef85d40, 0x3ed56340, 0x3eb27240, 0x3e8f9c40,
+ 0x3e6cf400, 0x3e4a81c0, 0x3e282140, 0x3e059980,
+ 0x3de2b280, 0x3dbf4100, 0x3d9b3640, 0x3d768b00,
+ 0x3d513640, 0x3d2b3840, 0x3d049b80, 0x3cdd6b40,
+ 0x3cb5b400, 0x3c8d8f40, 0x3c652080, 0x3c3c8c40,
+ 0x3c13f480, 0x3beb7580, 0x3bc327c0, 0x3b9b2680,
+ 0x3b737000, 0x3b4bc580, 0x3b23d740, 0x3afb5640,
+ 0x3ad21c40, 0x3aa83780, 0x3a7dbc40, 0x3a52bf80,
+ 0x3a276600, 0x39fbe0c0, 0x39d06140, 0x39a50ec0,
+ 0x3979e300, 0x394ebf40, 0x392386c0, 0x38f82280,
+ 0x38cc89c0, 0x38a0b7c0, 0x3874a740, 0x38485840,
+ 0x381bd1c0, 0x37ef1b40, 0x37c23cc0, 0x37953dc0,
+ 0x376825c0, 0x373afc80, 0x370dc980, 0x36e09440,
+ 0x36b41dc0, 0x36862100, 0x3657e480, 0x36297240,
+ 0x35fad380, 0x35cc1200, 0x359d36c0, 0x356e4b40,
+ 0x353f5880, 0x35106780, 0x34e17780, 0x34b28240,
+ 0x34838040, 0x345466c0, 0x34251940, 0x33f57280,
+ 0x33c54bc0, 0x33949840, 0x33638380, 0x33324980,
+ 0x33012500, 0x32d04480, 0x329fc7c0, 0x326fcbc0,
+ 0x324068c0, 0x32116fc0, 0x31e27600, 0x31b30fc0,
+ 0x3182e300, 0x3151e240, 0x312029c0, 0x30edd080,
+ 0x30baf700, 0x3087cd00, 0x30548600, 0x30215680,
+ 0x2fee65c0, 0x2fbbca40, 0x2f899980, 0x2f57e6c0,
+ 0x2f26b540, 0x2ef5f980, 0x2ec5aa00, 0x2e95afc0,
+ 0x2e65c180, 0x2e357b40, 0x2e047840, 0x2dd27380,
+ 0x2d9f6c40, 0x2d6b7780, 0x2d36a6c0, 0x2d012940,
+ 0x2ccb5680, 0x2c958a00, 0x2c601b80, 0x2c2b3640,
+ 0x2bf6dfc0, 0x2bc31ec0, 0x2b8ff500, 0x2b5d5540,
+ 0x2b2b2a00, 0x2af95e80, 0x2ac7dd80, 0x2a968f80,
+ 0x2a655d40, 0x2a342f00, 0x2a02e8c0, 0x29d16700,
+ 0x299f8640, 0x296d2380, 0x293a2740, 0x29068400,
+ 0x28d22b40, 0x289d1540, 0x28675280, 0x28310180,
+ 0x27fa3f00, 0x27c32f80, 0x278c08c0, 0x275505c0,
+ 0x271e60c0, 0x26e84b00, 0x26b2e880, 0x267e5cc0,
+ 0x264ac940, 0x26183a40, 0x25e6aa80, 0x25b615c0,
+ 0x25866b80, 0x25576b40, 0x2528ba00, 0x24f9ffc0,
+ 0x24cadfc0, 0x249af540, 0x2469da80, 0x24372780,
+ 0x2402b800, 0x23ccbfc0, 0x23957cc0, 0x235d3140,
+ 0x23245200, 0x22eb8000, 0x22b35cc0, 0x227c7940,
+ 0x22471d40, 0x22136840, 0x21e18240, 0x21b15d80,
+ 0x21827dc0, 0x21544600, 0x21261b00, 0x20f78600,
+ 0x20c83e00, 0x20980000, 0x20668e00, 0x2033f300,
+ 0x20007400, 0x1fcc64e0, 0x1f97d120, 0x1f642320,
+ 0x1f2f49e0, 0x1efaa840, 0x1ec73580, 0x1e94d880,
+ 0x1e636120, 0x1e32a160, 0x1e025ba0, 0x1dd24300,
+ 0x1da20e60, 0x1d717940, 0x1d407560, 0x1d0f2040,
+ 0x1cdd95c0, 0x1cabf500, 0x1c7a6940, 0x1c492340,
+ 0x1c185680, 0x1be818c0, 0x1bb83f60, 0x1b888d20,
+ 0x1b58c640, 0x1b28c240, 0x1af871e0, 0x1ac7c960,
+ 0x1a96bf00, 0x1a656b60, 0x1a340360, 0x1a02bd20,
+ 0x19d1c6c0, 0x19a12f40, 0x1970f480, 0x19411640,
+ 0x19119000, 0x18e255a0, 0x18b358a0, 0x18848b20,
+ 0x1855e040, 0x18274e00, 0x17f8c9e0, 0x17ca4a80,
+ 0x179bce40, 0x176d5a60, 0x173ef400, 0x17109fe0,
+ 0x16e25f60, 0x16b43240, 0x16861880, 0x16581220,
+ 0x162a20c0, 0x15fc4620, 0x15ce8420, 0x15a0dca0,
+ 0x157351c0, 0x1545e580, 0x151899a0, 0x14eb6ec0,
+ 0x14be63a0, 0x14917a00, 0x14649ae0, 0x14377060,
+ 0x1409d0c0, 0x13dbbb20, 0x13ad58e0, 0x137f0160,
+ 0x1350cc80, 0x1322b8c0, 0x12f4ca60, 0x12c704e0,
+ 0x129968a0, 0x126bf5c0, 0x123eade0, 0x12119300,
+ 0x11e4a660, 0x11b7e860, 0x118b5940, 0x115ef8a0,
+ 0x1132c600, 0x1106c1a0, 0x10daecc0, 0x10af4900,
+ 0x1083d7a0, 0x10589c00, 0x102d9a00, 0x1002d1e0,
+ 0x0fd842c0, 0x0fadde80, 0x0f839a50, 0x0f597700,
+ 0x0f2f76e0, 0x0f05a170, 0x0edbf9c0, 0x0eb27f30,
+ 0x0e8930d0, 0x0e600d70, 0x0e371550, 0x0e0e4950,
+ 0x0de5ab50, 0x0dbd3d20, 0x0d94fe10, 0x0d6cecb0,
+ 0x0d450220, 0x0d1d38f0, 0x0cf59130, 0x0cce0c30,
+ 0x0ca6af10, 0x0c7f7b80, 0x0c587010, 0x0c318960,
+ 0x0c0ac200, 0x0be418d0, 0x0bbd8da0, 0x0b9724e0,
+ 0x0b70e6c0, 0x0b4ad970, 0x0b2502f0, 0x0aff6930,
+ 0x0ada1250, 0x0ab50430, 0x0a9044d0, 0x0a6bda30,
+ 0x0a3bedf0, 0x0a18be40, 0x09f5e530, 0x09d35cf0,
+ 0x09b11ff0, 0x098f2890, 0x096d7120, 0x094bf400,
+ 0x092aab80, 0x09099240, 0x08e8a620, 0x08c7e850,
+ 0x08a75990, 0x0886fae0, 0x0866ccf0, 0x0846d070,
+ 0x08270610, 0x08076e70, 0x07e80ac8, 0x07c8dc60,
+ 0x07a9e440, 0x078b2348, 0x076c99d0, 0x074e4818,
+ 0x07302e50, 0x07124d18, 0x06f4a530, 0x06d73778,
+ 0x06ba0488, 0x069d0c88, 0x06804f68, 0x0663cce0,
+ 0x06478528, 0x062b78a0, 0x060fa7e8, 0x05f413b8,
+ 0x05d8bc38, 0x05bda128, 0x05a2c258, 0x05881f60,
+ 0x056db888, 0x05538e60, 0x0539a170, 0x051ff218,
+ 0x05068040, 0x04ed4b90, 0x04d45398, 0x04bb9820,
+ 0x04a31988, 0x048ad860, 0x0472d528, 0x045b0ff0,
+ 0x04438860, 0x042c3de8, 0x04153040, 0x03fe5f4c,
+ 0x03e7cb98, 0x03d17580, 0x03bb5d64, 0x03a582e8,
+ 0x038fe588, 0x037a8494, 0x03655fcc, 0x03507768,
+ 0x033bcbb4, 0x03275d28, 0x03132bc0, 0x02ff370c,
+ 0x02eb7e94, 0x02d801e8, 0x02c4c11c, 0x02b1bcbc,
+ 0x029ef578, 0x028c6ba8, 0x027a1f20, 0x02680f54,
+ 0x02563bac, 0x0244a3c8, 0x023347a0, 0x02222730,
+ 0x0211429c, 0x02009938, 0x01f02974, 0x01dff1ae,
+ 0x01cff058, 0x01c024c8, 0x01b08ef4, 0x01a12eda,
+ 0x019204b0, 0x01831138, 0x01745588, 0x0165d2c2,
+ 0x01578a96, 0x01497ffc, 0x013bb670, 0x012e3160,
+ 0x0120f146, 0x0113f27c, 0x0107310c, 0x00faa909,
+ 0x00ee57a1, 0x00e23b09, 0x00d6515b, 0x00ca9977,
+ 0x00bf1509, 0x00b3c74d, 0x00a8b388, 0x009ddb3d,
+ 0x00933bf2, 0x0088d22c, 0x007e9a70, 0x0074935a,
+ 0x006abe70, 0x00611d5c, 0x0057b1f8, 0x004e7e73,
+ 0x0045859b, 0x003cca96, 0x00344f32, 0x002c1074,
+ 0x00240873, 0x001c31ba, 0x0014863f, 0x000cfe8b,
+ 0x00059307, 0xfffe3b9a, 0xfff6f718, 0xffefcd4d,
+ 0xffe8c6f4, 0xffe1ed10, 0xffdb4c57, 0xffd4f484,
+ 0xffcef5dc, 0xffc95d0c, 0xffc4284e, 0xffbf4e14,
+ 0xffbac5ae, 0xffb68360, 0xffb27548, 0xffae87be,
+ 0xffaaa733, 0xffa6c67e, 0xffa2e141, 0xff9ef40c,
+ 0xff9afc25, 0xff970058, 0xff930f7c, 0xff8f3857,
+ 0xff8b8900, 0xff880bfe, 0xff84c9ea, 0xff81cbbd,
+ 0xff7f17ad, 0xff7cadc6, 0xff7a8c4e, 0xff78b1cd,
+ 0xff7719f3, 0xff75bd06, 0xff7492a4, 0xff7392bf,
+ 0xff72b600, 0xff71f5c6, 0xff714b72, 0xff70b0ed,
+ 0xff702232, 0xff6f9c90, 0xff6f1cee, 0xff6ea21f,
+ 0xff6e2e9c, 0xff6dc617, 0xff6d6c09, 0xff6d2425,
+ 0xff6cf267, 0xff6cdaca, 0xff6ce155, 0xff6d0983,
+ 0xff6d56bb, 0xff6dcc4c, 0xff6e6cd0, 0xff6f3832,
+ 0xff702cc4, 0xff71492e, 0xff728ae2, 0xff73ed63,
+ 0xff756b7c, 0xff77001c, 0xff78a5d9, 0xff7a5693,
+ 0xff7c0c40, 0xff7dc141, 0xff7f74aa, 0xff81298b,
+ 0xff82e2de, 0xff84a3de, 0xff8670bd, 0xff884e42,
+ 0xff8a410c, 0xff8c4c7f, 0xff8e70fc, 0xff90ae18,
+ 0xff93037e, 0xff956f12, 0xff97ec86, 0xff9a7724,
+ 0xff9d0a9d, 0xff9fa3ea, 0xffa2417e, 0xffa4e1ac,
+ 0xffa78332, 0xffaa265a, 0xffaccc26, 0xffaf758e,
+ 0xffb223d4, 0xffb4d906, 0xffb79726, 0xffba604e,
+ 0xffbd349e, 0xffc011a8, 0xffc2f4d2, 0xffc5db82,
+ 0xffc8c45f, 0xffcbaed5, 0xffce9a6d, 0xffd186c6,
+ 0xffd473aa, 0xffd760e5, 0xffda4e55, 0xffdd3bd0,
+ 0xffe0292b, 0xffe31645, 0xffe602ff, 0xffe8eef7,
+ 0xffebd978, 0xffeec1bf, 0xfff1a72c, 0xfff488fe,
+ 0xfff76689, 0xfffa3f2c, 0xfffd1245, 0xffffdf33,
+ 0x000020ac, 0x0002e66f, 0x0005a937, 0x00086839,
+ 0x000b22b3, 0x000dd7da, 0x001086ec, 0x00132f3c,
+ 0x0015d001, 0x00186897, 0x001af849, 0x001d7eb6,
+ 0x001ffbbe, 0x00226f41, 0x0024d8e8, 0x00273874,
+ 0x00298d82, 0x002bd7aa, 0x002e16d4, 0x00304af6,
+ 0x00327406, 0x00349203, 0x0036a416, 0x0038a893,
+ 0x003a9da0, 0x003c8170, 0x003e53b8, 0x0040159a,
+ 0x0041c816, 0x00436c92, 0x0045042c, 0x00468ff2,
+ 0x00481106, 0x004987fe, 0x004af466, 0x004c5599,
+ 0x004daae4, 0x004ef28c, 0x005029c4, 0x00514d9a,
+ 0x00525b57, 0x005351f7, 0x00543190, 0x0054fa43,
+ 0x0055ac2f, 0x00564938, 0x0056d3f7, 0x00574f3c,
+ 0x0057bdd7, 0x00582260, 0x00587f28, 0x0058d6b1,
+ 0x0059293c, 0x0059741a, 0x0059b472, 0x0059e73c,
+ 0x005a0976, 0x005a1870, 0x005a116e, 0x0059f224,
+ 0x0059b964, 0x005966ce, 0x0058f9e2, 0x005872e8,
+ 0x0057d407, 0x00571f82, 0x005657b0, 0x00557ecd,
+ 0x00549731, 0x0053a34b, 0x0052a56a, 0x00519fc6,
+ 0x00509482, 0x004f85a4, 0x004e74ee, 0x004d6214,
+ 0x004c4bd3, 0x004b314c, 0x004a1110, 0x0048e8c8,
+ 0x0047b5f7, 0x00467626, 0x00452690, 0x0043c405,
+ 0x00424b7f, 0x0040ba04, 0x003f0e53, 0x003d488b,
+ 0x003b688c, 0x00396eb6, 0x00375dfb, 0x00353aaa,
+ 0x003308ac, 0x0030ccb1, 0x002e8cf1, 0x002c4fd5,
+ 0x002a1be8, 0x0027f486, 0x0025d90d, 0x0023c852,
+ 0x0021c13b, 0x001fbf23, 0x001dbafc, 0x001badc6,
+ 0x00199136, 0x00176150, 0x00151b86, 0x0012bcd1,
+ 0x001044d1, 0x000db8d0, 0x000b1f43, 0x00087e89,
+ 0x0005dbe2, 0x00033b1e, 0x00009fee, 0xfffe0d82,
+ 0xfffb83cf, 0xfff90047, 0xfff6805a, 0xfff4019a,
+ 0xfff18203, 0xffeeffb2, 0xffec78ba, 0xffe9ec4d,
+ 0xffe75b4e, 0xffe4c71f, 0xffe23138, 0xffdf9ae6,
+ 0xffdd0574, 0xffda723c, 0xffd7e24a, 0xffd55567,
+ 0xffd2cabe, 0xffd04161, 0xffcdb890, 0xffcb306a,
+ 0xffc8a95c, 0xffc62406, 0xffc3a140, 0xffc12188,
+ 0xffbea542, 0xffbc2cc2, 0xffb9b7d2, 0xffb745f2,
+ 0xffb4d6ac, 0xffb268fe, 0xffaffc72, 0xffad90e8,
+ 0xffab263e, 0xffa8bcb8, 0xffa6547e, 0xffa3ed7b,
+ 0xffa187ba, 0xff9f2351, 0xff9cc055, 0xff9a5ebc,
+ 0xff97fe84, 0xff959f84, 0xff934146, 0xff90e37d,
+ 0xff8e858a, 0xff8c26c0, 0xff89c69e, 0xff876483,
+ 0xff84ffe4, 0xff82982b, 0xff802cb6, 0xff7dbccf,
+ 0xff7b47b4, 0xff78ccd0, 0xff764b6c, 0xff73c2db,
+ 0xff713227, 0xff6e9864, 0xff6bf470, 0xff694553,
+ 0xff668a0d, 0xff63c1a6, 0xff60ec34, 0xff5e0e9e,
+ 0xff5b30d3, 0xff585b8c, 0xff5595c9, 0xff52e1da,
+ 0xff5040a0, 0xff4db31c, 0xff4b3a3b, 0xff48d67e,
+ 0xff468850, 0xff445011, 0xff422ded, 0xff4021f9,
+ 0xff3e2c56, 0xff3c4cf8, 0xff3a83df, 0xff38d0ec,
+ 0xff3733c9, 0xff35ac14, 0xff343963, 0xff32db09,
+ 0xff319066, 0xff305898, 0xff2f323d, 0xff2e1bb2,
+ 0xff2d1369, 0xff2c18f8, 0xff2b2d2a, 0xff2a50e1,
+ 0xff2984f4, 0xff28c978, 0xff281e01, 0xff278245,
+ 0xff26f5c3, 0xff26785a, 0xff2609bf, 0xff25a9c8,
+ 0xff255814, 0xff2513f6, 0xff24dcc4, 0xff24b1a6,
+ 0xff2492b1, 0xff248093, 0xff247c0b, 0xff2485c6,
+ 0xff249daf, 0xff24c359, 0xff24f639, 0xff253605,
+ 0xff258312, 0xff25ddd5, 0xff2646e7, 0xff26be25,
+ 0xff274264, 0xff27d1f6, 0xff286b19, 0xff290c13,
+ 0xff29b30d, 0xff2a5e38, 0xff2b0bbd, 0xff2bb9a2,
+ 0xff29a9d2, 0xff2a53dc, 0xff2b0a5a, 0xff2bcd43,
+ 0xff2c9c76, 0xff2d7808, 0xff2e5ffa, 0xff2f544c,
+ 0xff305528, 0xff316299, 0xff327ce0, 0xff33a432,
+ 0xff34d8ba, 0xff361a8e, 0xff3768f8, 0xff38c2f5,
+ 0xff3a2784, 0xff3b9623, 0xff3d0ef4, 0xff3e9277,
+ 0xff4020ed, 0xff41ba14, 0xff435ccc, 0xff4507fd,
+ 0xff46ba84, 0xff4873ac, 0xff4a32ea, 0xff4bf7bb,
+ 0xff4dc17f, 0xff4f8fa0, 0xff516167, 0xff53361d,
+ 0xff550d79, 0xff56e7ee, 0xff58c5ff, 0xff5aa84d,
+ 0xff5c8e41, 0xff5e75e2, 0xff605d4d, 0xff6242b6,
+ 0xff6424b8, 0xff66023d, 0xff67da44, 0xff69abd6,
+ 0xff6b7646, 0xff6d38e8, 0xff6ef348, 0xff70a4ce,
+ 0xff724d0f, 0xff73eb95, 0xff757fff, 0xff770a2d,
+ 0xff788a20, 0xff79fff6, 0xff7b6be7, 0xff7cce52,
+ 0xff7e27e4, 0xff7f78fc, 0xff80c38a, 0xff820e98,
+ 0xff836378, 0xff84caaa, 0xff864990, 0xff87dff4,
+ 0xff898c30, 0xff8b4cda, 0xff8d207a, 0xff8f05cc,
+ 0xff90fb9b, 0xff930098, 0xff95138e, 0xff97332d,
+ 0xff995e2a, 0xff9b934e, 0xff9dd18c, 0xffa017e3,
+ 0xffa26550, 0xffa4b8e7, 0xffa711a8, 0xffa96eae,
+ 0xffabcefc, 0xffae31cc, 0xffb09680, 0xffb2fc82,
+ 0xffb5635a, 0xffb7ca52, 0xffba30a8, 0xffbc95a8,
+ 0xffbef8a4, 0xffc158d0, 0xffc3b557, 0xffc60d6b,
+ 0xffc86041, 0xffcaacb7, 0xffccf1cb, 0xffcf2e5c,
+ 0xffd161e8, 0xffd38c8f, 0xffd5ae88, 0xffd7c808,
+ 0xffd9d925, 0xffdbe1c8, 0xffdde1f3, 0xffdfd964,
+ 0xffe1c79b, 0xffe3abcc, 0xffe5852a, 0xffe75341,
+ 0xffe9162f, 0xffeace55, 0xffec7c15, 0xffee1f63,
+ 0xffefb7e9, 0xfff1453d, 0xfff2c6fd, 0xfff43ca8,
+ 0xfff5a5d4, 0xfff701ea, 0xfff850b4, 0xfff99288,
+ 0xfffac853, 0xfffbf2d5, 0xfffd12e6, 0xfffe2991,
+ 0xffff37e4, 0x00003eea, 0x00013ec4, 0x00023646,
+ 0x0003244d, 0x00040797, 0x0004de8c, 0x0005a734,
+ 0x00065fab, 0x0007068f, 0x00079c82, 0x000822fa,
+ 0x00089b70, 0x000907a6, 0x00096a01, 0x0009c506,
+ 0x000a1b37, 0x000a6e18, 0x000abe1f, 0x000b0bac,
+ 0x000b5701, 0x000b9f3b, 0x000be2c2, 0x000c1fff,
+ 0x000c5599, 0x000c829a, 0x000ca661, 0x000cc058,
+ 0x000cd028, 0x000cd63d, 0x000cd317, 0x000cc739,
+ 0x000cb36d, 0x000c98c0, 0x000c7833, 0x000c52df,
+ 0x000c2984, 0x000bfcf9, 0x000bcdea, 0x000b9cf7,
+ 0x000b6a97, 0x000b3700, 0x000b029d, 0x000acd79,
+ 0x000a977e, 0x000a6076, 0x000a2838, 0x0009eea1,
+ 0x0009b37d, 0x000976c2, 0x0009384e, 0x0008f816,
+ 0x0008b612, 0x0008724a, 0x00082cd5, 0x0007e5e8,
+ 0x00079dce, 0x000754de, 0x00070b62, 0x0006c1c6,
+ 0x0006786a, 0x00062fba, 0x0005e801, 0x0005a1a0,
+ 0x00055ce1, 0x000519fb, 0x0004d8f8, 0x000499b8,
+ 0x00045c30, 0x00042040, 0x0003e5c8, 0x0003acb3,
+ 0x000374df, 0x00033e59, 0x00030934, 0x0002d57d,
+ 0x0002a348, 0x000272b6, 0x000243f2, 0x00021711,
+ 0x0001ec3e, 0x0001c37a, 0x00019cc3, 0x00017830,
+ 0x000155a0, 0x00013514, 0x0001168b, 0x0000f9e6,
+ 0x0000df23, 0x0000c62e, 0x0000aef2, 0x00009978,
+ 0x000085a1, 0x0000736d, 0x000062dc, 0x000053d8,
+ 0x0000466c, 0x00003a62, 0x00002fd1, 0x00002681,
+ 0x00001e73, 0x00001792, 0x000011c9, 0x00000cf6,
+ 0x0000091a, 0x000005ff, 0x000003b1, 0x00000203,
+ 0x000000d7, 0x0000002b, 0xffffffd5, 0xffffffc0,
+ 0xffffffd5, 0x00000000, 0x00000015, 0x00000000,
+ 0x00000000, 0x00000015, 0x00000000, 0xffffffd5,
+ 0xffffffca, 0xffffffd5, 0x0000002b, 0x000000cc,
+ 0x000001e3, 0x0000037b, 0x0000059f, 0x0000086e,
+ 0x00000bf4, 0x0000103b, 0x00001564, 0x00001b6e,
+ 0x0000226f, 0x00002a68, 0x00003377, 0x00003d93,
+ 0x000048c5, 0x00005525, 0x000062a6, 0x00007155,
+ 0x0000812f, 0x00009237, 0x0000a455, 0x0000b7ab,
+ 0x0000cc18, 0x0000e1bd, 0x0000f878, 0x0001106c,
+ 0x00012981, 0x000143c2, 0x00015f30, 0x00017bb6,
+ 0x00019948, 0x0001b7e6, 0x0001d771, 0x0001f7bc,
+ 0x000218b4, 0x00023a42, 0x00025c3b, 0x00027ea0,
+ 0x0002a150, 0x0002c440, 0x0002e771, 0x00030aed,
+ 0x00032eb4, 0x000352db, 0x00037759, 0x00039c4c,
+ 0x0003c1ac, 0x0003e74b, 0x00040d00, 0x0004329f,
+ 0x000457de, 0x00047c9c, 0x0004a083, 0x0004c35e,
+ 0x0004e502, 0x00050543, 0x000523ec, 0x000540e7,
+ 0x00055c2b, 0x000575c0, 0x00058da9, 0x0005a3e4,
+ 0x0005b886, 0x0005cbb1, 0x0005dd65, 0x0005edcb,
+ 0x0005fcfa, 0x00060afc, 0x00061808, 0x000623fc,
+ 0x00062ec3, 0x00063849, 0x0006404b, 0x000646ac,
+ 0x00064b13, 0x00064d37, 0x00064cd6, 0x0006497b,
+ 0x000642c5, 0x0006385e, 0x000629f0, 0x00061766,
+ 0x000600a0, 0x0005e57d, 0x0005c63e, 0x0005a322,
+ 0x00057c97, 0x00055306, 0x00052711, 0x0004f96f,
+ 0x0004caeb, 0x00049bfc, 0x00046c96, 0x00043cbb,
+ 0x00040c3f, 0x0003daab, 0x0003a734, 0x000370f9,
+ 0x0003372d, 0x0002f944, 0x0002b6d4, 0x00026f71,
+ 0x000222fb, 0x0001d212, 0x00017d84, 0x00012630,
+ 0x0000ccda, 0x00007200, 0x0000163b, 0xffffba15,
+ 0xffff5da3, 0xffff0091, 0xfffea293, 0xfffe4367,
+ 0xfffde2da, 0xfffd809f, 0xfffd1c81, 0xfffcb66a,
+ 0xfffc4e90, 0xfffbe53e, 0xfffb7aa0, 0xfffb0f0a,
+ 0xfffaa2c9, 0xfffa3612, 0xfff9c92f, 0xfff95c2d,
+ 0xfff8eef4, 0xfff8817c, 0xfff813c3, 0xfff7a5d4,
+ 0xfff737e5, 0xfff6ca17, 0xfff65c9e, 0xfff5efbc,
+ 0xfff58390, 0xfff51830, 0xfff4adbc, 0xfff44435,
+ 0xfff3db9a, 0xfff373d6, 0xfff30cfd, 0xfff2a71c,
+ 0xfff24248, 0xfff1de9f, 0xfff17c44, 0xfff11b56,
+ 0xfff0bbea, 0xfff05e17, 0xfff00206, 0xffefa7d9,
+ 0xffef4f99, 0xffeef95d, 0xffeea53a, 0xffee533a,
+ 0xffee035e, 0xffedb5b0, 0xffed6a3c, 0xffed20f5,
+ 0xffecd9fe, 0xffec9555, 0xffec5305, 0xffec1319,
+ 0xffebd591, 0xffeb9a83, 0xffeb61f9, 0xffeb2bfe,
+ 0xffeaf89c, 0xffeac7ea, 0xffea99d2, 0xffea6e7e,
+ 0xffea45ef, 0xffea203a, 0xffe9fda0, 0xffe9decc,
+ 0xffe9c3de, 0xffe9ac56, 0xffe99789, 0xffe9845e,
+ 0xffe97295, 0xffe96219, 0xffe952ea, 0xffe944f3,
+ 0xffe93833, 0xffe92c9f, 0xffe92238, 0xffe918fe,
+ 0xffe910fb, 0xffe90a3a, 0xffe904c6, 0xffe900a0,
+ 0xffe8fddb, 0xffe8fc83, 0xffe8fca4, 0xffe8fe3c,
+ 0xffe9016c, 0xffe9061e, 0xffe90c74, 0xffe9146c,
+ 0xffe91e11, 0xffe929a5, 0xffe93731, 0xffe946c0,
+ 0xffe95833, 0xffe96b7e, 0xffe98082, 0xffe9975e,
+ 0xffe9affd, 0xffe9ca5e, 0xffe9e68e, 0xffea0481,
+ 0xffea242b, 0xffea458e, 0xffea6894, 0xffea8d52,
+ 0xffeab3c8, 0xffeadc0c, 0xffeb05fe, 0xffeb31a7,
+ 0xffeb5ede, 0xffeb8da2, 0xffebbdf4, 0xffebefbd,
+ 0xffec231f, 0xffec5802, 0xffec8e5e, 0xffecc61c,
+ 0xffecff1c, 0xffed391e, 0xffed740c, 0xffedafb1,
+ 0xffedebe1, 0xffee287d, 0xffee654e, 0xffeea23f,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aactab.h b/chromium/third_party/ffmpeg/libavcodec/aactab.h
index 9f5a7e47bd1..9f333801e98 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aactab.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aactab.h
@@ -41,13 +41,53 @@
* encoder.
*/
+/* @name tns_tmp2_map
+ * Tables of the tmp2[] arrays of LPC coefficients used for TNS.
+ * The suffix _M_N[] indicate the values of coef_compress and coef_res
+ * respectively.
+ * @{
+ */
+static const INTFLOAT tns_tmp2_map_1_3[4] = {
+ Q31(0.00000000f), Q31(-0.43388373f), Q31(0.64278758f), Q31(0.34202015f),
+};
+
+static const INTFLOAT tns_tmp2_map_0_3[8] = {
+ Q31(0.00000000f), Q31(-0.43388373f), Q31(-0.78183150f), Q31(-0.97492790f),
+ Q31(0.98480773f), Q31( 0.86602539f), Q31( 0.64278758f), Q31( 0.34202015f),
+};
+
+static const INTFLOAT tns_tmp2_map_1_4[8] = {
+ Q31(0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f),
+ Q31(0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f),
+};
+
+static const INTFLOAT tns_tmp2_map_0_4[16] = {
+ Q31( 0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f),
+ Q31(-0.74314481f), Q31(-0.86602539f), Q31(-0.95105654f), Q31(-0.99452192f),
+ Q31( 0.99573416f), Q31( 0.96182561f), Q31( 0.89516330f), Q31( 0.79801720f),
+ Q31( 0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f),
+};
+
+static const INTFLOAT * const tns_tmp2_map[4] = {
+ tns_tmp2_map_0_3,
+ tns_tmp2_map_0_4,
+ tns_tmp2_map_1_3,
+ tns_tmp2_map_1_4
+};
+// @}
+
/* @name window coefficients
* @{
*/
DECLARE_ALIGNED(32, extern float, ff_aac_kbd_long_1024)[1024];
DECLARE_ALIGNED(32, extern float, ff_aac_kbd_short_128)[128];
+DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_1024_fixed)[1024];
+DECLARE_ALIGNED(32, extern int, ff_aac_kbd_long_512_fixed)[512];
+DECLARE_ALIGNED(32, extern int, ff_aac_kbd_short_128_fixed)[128];
const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window_512)[1920];
+const DECLARE_ALIGNED(32, extern int, ff_aac_eld_window_512_fixed)[1920];
const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window_480)[1800];
+const DECLARE_ALIGNED(32, extern int, ff_aac_eld_window_480_fixed)[1800];
// @}
/* @name number of scalefactor window bands for long and short transform windows respectively
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile b/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile
index 2afff297dce..d001b345c00 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/Makefile
@@ -1,6 +1,7 @@
OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o
OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o
OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o
+OBJS-$(CONFIG_H264PRED) += aarch64/h264pred_init.o
OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_init_aarch64.o
OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_init_aarch64.o
OBJS-$(CONFIG_IMDCT15) += aarch64/imdct15_init.o
@@ -18,6 +19,7 @@ NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o
NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o
NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \
aarch64/h264idct_neon.o
+NEON-OBJS-$(CONFIG_H264PRED) += aarch64/h264pred_neon.o
NEON-OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_neon.o \
aarch64/hpeldsp_neon.o
NEON-OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_neon.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S
new file mode 100644
index 00000000000..213b40b3e7d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_h264pred_neon.S
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/aarch64/asm.S"
+
+.macro ldcol.8 rd, rs, rt, n=8, hi=0
+.if \n >= 8 || \hi == 0
+ ld1 {\rd\().b}[0], [\rs], \rt
+ ld1 {\rd\().b}[1], [\rs], \rt
+ ld1 {\rd\().b}[2], [\rs], \rt
+ ld1 {\rd\().b}[3], [\rs], \rt
+.endif
+.if \n >= 8 || \hi == 1
+ ld1 {\rd\().b}[4], [\rs], \rt
+ ld1 {\rd\().b}[5], [\rs], \rt
+ ld1 {\rd\().b}[6], [\rs], \rt
+ ld1 {\rd\().b}[7], [\rs], \rt
+.endif
+.if \n == 16
+ ld1 {\rd\().b}[8], [\rs], \rt
+ ld1 {\rd\().b}[9], [\rs], \rt
+ ld1 {\rd\().b}[10], [\rs], \rt
+ ld1 {\rd\().b}[11], [\rs], \rt
+ ld1 {\rd\().b}[12], [\rs], \rt
+ ld1 {\rd\().b}[13], [\rs], \rt
+ ld1 {\rd\().b}[14], [\rs], \rt
+ ld1 {\rd\().b}[15], [\rs], \rt
+.endif
+.endm
+
+function ff_pred16x16_128_dc_neon, export=1
+ movi v0.16b, #128
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_top_dc_neon, export=1
+ sub x2, x0, x1
+ ld1 {v0.16b}, [x2]
+ uaddlv h0, v0.16b
+ rshrn v0.8b, v0.8h, #4
+ dup v0.16b, v0.b[0]
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_left_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1, 16
+ uaddlv h0, v0.16b
+ rshrn v0.8b, v0.8h, #4
+ dup v0.16b, v0.b[0]
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.16b}, [x2]
+ ldcol.8 v1, x3, x1, 16
+ uaddlv h0, v0.16b
+ uaddlv h1, v1.16b
+ add v0.4h, v0.4h, v1.4h
+ rshrn v0.8b, v0.8h, #5
+ dup v0.16b, v0.b[0]
+.L_pred16x16_dc_end:
+ mov w3, #8
+6: st1 {v0.16b}, [x0], x1
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 6b
+ ret
+endfunc
+
+function ff_pred16x16_hor_neon, export=1
+ sub x2, x0, #1
+ mov w3, #16
+1: ld1r {v0.16b}, [x2], x1
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred16x16_vert_neon, export=1
+ sub x2, x0, x1
+ add x1, x1, x1
+ ld1 {v0.16b}, [x2], x1
+ mov w3, #8
+1: st1 {v0.16b}, [x0], x1
+ st1 {v0.16b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred16x16_plane_neon, export=1
+ sub x3, x0, x1
+ movrel x4, p16weight
+ add x2, x3, #8
+ sub x3, x3, #1
+ ld1 {v0.8b}, [x3]
+ ld1 {v2.8b}, [x2], x1
+ ldcol.8 v1, x3, x1
+ add x3, x3, x1
+ ldcol.8 v3, x3, x1
+ rev64 v0.8b, v0.8b
+ rev64 v1.8b, v1.8b
+ uaddl v7.8h, v2.8b, v3.8b
+ usubl v2.8h, v2.8b, v0.8b
+ usubl v3.8h, v3.8b, v1.8b
+ ld1 {v0.8h}, [x4]
+ mul v2.8h, v2.8h, v0.8h
+ mul v3.8h, v3.8h, v0.8h
+ addp v2.8h, v2.8h, v3.8h
+ addp v2.8h, v2.8h, v2.8h
+ addp v2.4h, v2.4h, v2.4h
+ sshll v3.4s, v2.4h, #2
+ saddw v2.4s, v3.4s, v2.4h
+ rshrn v4.4h, v2.4s, #6
+ trn2 v5.4h, v4.4h, v4.4h
+ add v2.4h, v4.4h, v5.4h
+ shl v3.4h, v2.4h, #3
+ ext v7.16b, v7.16b, v7.16b, #14
+ sub v3.4h, v3.4h, v2.4h // 7 * (b + c)
+ add v7.4h, v7.4h, v0.4h
+ shl v2.4h, v7.4h, #4
+ sub v2.4h, v2.4h, v3.4h
+ shl v3.4h, v4.4h, #4
+ ext v0.16b, v0.16b, v0.16b, #14
+ sub v6.4h, v5.4h, v3.4h
+ mov v0.h[0], wzr
+ mul v0.8h, v0.8h, v4.h[0]
+ dup v1.8h, v2.h[0]
+ dup v2.8h, v4.h[0]
+ dup v3.8h, v6.h[0]
+ shl v2.8h, v2.8h, #3
+ add v1.8h, v1.8h, v0.8h
+ add v3.8h, v3.8h, v2.8h
+ mov w3, #16
+1:
+ sqshrun v0.8b, v1.8h, #5
+ add v1.8h, v1.8h, v2.8h
+ sqshrun2 v0.16b, v1.8h, #5
+ add v1.8h, v1.8h, v3.8h
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+const p16weight, align=4
+ .short 1,2,3,4,5,6,7,8
+endconst
+const p8weight, align=4
+ .short 1,2,3,4,1,2,3,4
+endconst
+
+function ff_pred8x8_hor_neon, export=1
+ sub x2, x0, #1
+ mov w3, #8
+1: ld1r {v0.8b}, [x2], x1
+ st1 {v0.8b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_vert_neon, export=1
+ sub x2, x0, x1
+ lsl x1, x1, #1
+ ld1 {v0.8b}, [x2], x1
+ mov w3, #4
+1: st1 {v0.8b}, [x0], x1
+ st1 {v0.8b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_plane_neon, export=1
+ sub x3, x0, x1
+ movrel x4, p8weight
+ movrel x5, p16weight
+ add x2, x3, #4
+ sub x3, x3, #1
+ ld1 {v0.s}[0], [x3]
+ ld1 {v2.s}[0], [x2], x1
+ ldcol.8 v0, x3, x1, 4, hi=1
+ add x3, x3, x1
+ ldcol.8 v3, x3, x1, 4
+ uaddl v7.8h, v2.8b, v3.8b
+ rev32 v0.8b, v0.8b
+ trn1 v2.2s, v2.2s, v3.2s
+ usubl v2.8h, v2.8b, v0.8b
+ ld1 {v6.8h}, [x4]
+ mul v2.8h, v2.8h, v6.8h
+ ld1 {v0.8h}, [x5]
+ saddlp v2.4s, v2.8h
+ addp v2.4s, v2.4s, v2.4s
+ shl v3.4s, v2.4s, #4
+ add v2.4s, v3.4s, v2.4s
+ rshrn v5.4h, v2.4s, #5
+ addp v2.4h, v5.4h, v5.4h
+ shl v3.4h, v2.4h, #1
+ add v3.4h, v3.4h, v2.4h
+ rev64 v7.4h, v7.4h
+ add v7.4h, v7.4h, v0.4h
+ shl v2.4h, v7.4h, #4
+ sub v2.4h, v2.4h, v3.4h
+ ext v0.16b, v0.16b, v0.16b, #14
+ mov v0.h[0], wzr
+ mul v0.8h, v0.8h, v5.h[0]
+ dup v1.8h, v2.h[0]
+ dup v2.8h, v5.h[1]
+ add v1.8h, v1.8h, v0.8h
+ mov w3, #8
+1:
+ sqshrun v0.8b, v1.8h, #5
+ add v1.8h, v1.8h, v2.8h
+ st1 {v0.8b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_128_dc_neon, export=1
+ movi v0.8b, #128
+ movi v1.8b, #128
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_top_dc_neon, export=1
+ sub x2, x0, x1
+ ld1 {v0.8b}, [x2]
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ zip1 v0.8h, v0.8h, v0.8h
+ rshrn v2.8b, v0.8h, #2
+ zip1 v0.8b, v2.8b, v2.8b
+ zip1 v1.8b, v2.8b, v2.8b
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_left_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ dup v1.8b, v2.b[1]
+ dup v0.8b, v2.b[0]
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1
+ uaddlp v0.4h, v0.8b
+ uaddlp v1.4h, v1.8b
+ trn1 v2.2s, v0.2s, v1.2s
+ trn2 v3.2s, v0.2s, v1.2s
+ addp v4.4h, v2.4h, v3.4h
+ addp v5.4h, v4.4h, v4.4h
+ rshrn v6.8b, v5.8h, #3
+ rshrn v7.8b, v4.8h, #2
+ dup v0.8b, v6.b[0]
+ dup v2.8b, v7.b[2]
+ dup v1.8b, v7.b[3]
+ dup v3.8b, v6.b[1]
+ zip1 v0.2s, v0.2s, v2.2s
+ zip1 v1.2s, v1.2s, v3.2s
+.L_pred8x8_dc_end:
+ mov w3, #4
+ add x2, x0, x1, lsl #2
+6: st1 {v0.8b}, [x0], x1
+ st1 {v1.8b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 6b
+ ret
+endfunc
+
+function ff_pred8x8_l0t_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1, 4
+ zip1 v0.4s, v0.4s, v1.4s
+ uaddlp v0.8h, v0.16b
+ addp v0.8h, v0.8h, v0.8h
+ addp v1.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ rshrn v3.8b, v1.8h, #3
+ dup v4.8b, v3.b[0]
+ dup v6.8b, v2.b[2]
+ dup v5.8b, v2.b[0]
+ zip1 v0.2s, v4.2s, v6.2s
+ zip1 v1.2s, v5.2s, v6.2s
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_l00_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1, 4
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ rshrn v0.8b, v0.8h, #2
+ movi v1.8b, #128
+ dup v0.8b, v0.b[0]
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_0lt_dc_neon, export=1
+ add x3, x0, x1, lsl #2
+ sub x2, x0, x1
+ sub x3, x3, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1, 4, hi=1
+ zip1 v0.4s, v0.4s, v1.4s
+ uaddlp v0.8h, v0.16b
+ addp v0.8h, v0.8h, v0.8h
+ addp v1.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ rshrn v3.8b, v1.8h, #3
+ dup v4.8b, v2.b[0]
+ dup v5.8b, v2.b[3]
+ dup v6.8b, v2.b[2]
+ dup v7.8b, v3.b[1]
+ zip1 v0.2s, v4.2s, v6.2s
+ zip1 v1.2s, v5.2s, v7.2s
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_0l0_dc_neon, export=1
+ add x2, x0, x1, lsl #2
+ sub x2, x2, #1
+ ldcol.8 v1, x2, x1, 4
+ uaddlp v2.4h, v1.8b
+ addp v2.4h, v2.4h, v2.4h
+ rshrn v1.8b, v2.8h, #2
+ movi v0.8b, #128
+ dup v1.8b, v1.b[0]
+ b .L_pred8x8_dc_end
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_init.c b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_init.c
new file mode 100644
index 00000000000..b144376f900
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_init.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/aarch64/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/h264pred.h"
+
+void ff_pred16x16_vert_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_hor_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_plane_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_128_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_left_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_top_dc_neon(uint8_t *src, ptrdiff_t stride);
+
+void ff_pred8x8_vert_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_hor_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_plane_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_128_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_left_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_top_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_l0t_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_0lt_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_l00_dc_neon(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_0l0_dc_neon(uint8_t *src, ptrdiff_t stride);
+
+static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
+ const int bit_depth,
+ const int chroma_format_idc)
+{
+ const int high_depth = bit_depth > 8;
+
+ if (high_depth)
+ return;
+
+ if (chroma_format_idc <= 1) {
+ h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
+ h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
+ if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
+ h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
+ h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
+ if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 &&
+ codec_id != AV_CODEC_ID_VP8) {
+ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon;
+ h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
+ h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
+ }
+ }
+
+ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_neon;
+ h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vert_neon;
+ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_hor_neon;
+ h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon;
+ h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon;
+ h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon;
+ if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 &&
+ codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
+ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon;
+}
+
+av_cold void ff_h264_pred_init_aarch64(H264PredContext *h, int codec_id,
+ int bit_depth, const int chroma_format_idc)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (have_neon(cpu_flags))
+ h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_neon.S b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_neon.S
new file mode 100644
index 00000000000..213b40b3e7d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/h264pred_neon.S
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/aarch64/asm.S"
+
+.macro ldcol.8 rd, rs, rt, n=8, hi=0
+.if \n >= 8 || \hi == 0
+ ld1 {\rd\().b}[0], [\rs], \rt
+ ld1 {\rd\().b}[1], [\rs], \rt
+ ld1 {\rd\().b}[2], [\rs], \rt
+ ld1 {\rd\().b}[3], [\rs], \rt
+.endif
+.if \n >= 8 || \hi == 1
+ ld1 {\rd\().b}[4], [\rs], \rt
+ ld1 {\rd\().b}[5], [\rs], \rt
+ ld1 {\rd\().b}[6], [\rs], \rt
+ ld1 {\rd\().b}[7], [\rs], \rt
+.endif
+.if \n == 16
+ ld1 {\rd\().b}[8], [\rs], \rt
+ ld1 {\rd\().b}[9], [\rs], \rt
+ ld1 {\rd\().b}[10], [\rs], \rt
+ ld1 {\rd\().b}[11], [\rs], \rt
+ ld1 {\rd\().b}[12], [\rs], \rt
+ ld1 {\rd\().b}[13], [\rs], \rt
+ ld1 {\rd\().b}[14], [\rs], \rt
+ ld1 {\rd\().b}[15], [\rs], \rt
+.endif
+.endm
+
+function ff_pred16x16_128_dc_neon, export=1
+ movi v0.16b, #128
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_top_dc_neon, export=1
+ sub x2, x0, x1
+ ld1 {v0.16b}, [x2]
+ uaddlv h0, v0.16b
+ rshrn v0.8b, v0.8h, #4
+ dup v0.16b, v0.b[0]
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_left_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1, 16
+ uaddlv h0, v0.16b
+ rshrn v0.8b, v0.8h, #4
+ dup v0.16b, v0.b[0]
+ b .L_pred16x16_dc_end
+endfunc
+
+function ff_pred16x16_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.16b}, [x2]
+ ldcol.8 v1, x3, x1, 16
+ uaddlv h0, v0.16b
+ uaddlv h1, v1.16b
+ add v0.4h, v0.4h, v1.4h
+ rshrn v0.8b, v0.8h, #5
+ dup v0.16b, v0.b[0]
+.L_pred16x16_dc_end:
+ mov w3, #8
+6: st1 {v0.16b}, [x0], x1
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 6b
+ ret
+endfunc
+
+function ff_pred16x16_hor_neon, export=1
+ sub x2, x0, #1
+ mov w3, #16
+1: ld1r {v0.16b}, [x2], x1
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred16x16_vert_neon, export=1
+ sub x2, x0, x1
+ add x1, x1, x1
+ ld1 {v0.16b}, [x2], x1
+ mov w3, #8
+1: st1 {v0.16b}, [x0], x1
+ st1 {v0.16b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred16x16_plane_neon, export=1
+ sub x3, x0, x1
+ movrel x4, p16weight
+ add x2, x3, #8
+ sub x3, x3, #1
+ ld1 {v0.8b}, [x3]
+ ld1 {v2.8b}, [x2], x1
+ ldcol.8 v1, x3, x1
+ add x3, x3, x1
+ ldcol.8 v3, x3, x1
+ rev64 v0.8b, v0.8b
+ rev64 v1.8b, v1.8b
+ uaddl v7.8h, v2.8b, v3.8b
+ usubl v2.8h, v2.8b, v0.8b
+ usubl v3.8h, v3.8b, v1.8b
+ ld1 {v0.8h}, [x4]
+ mul v2.8h, v2.8h, v0.8h
+ mul v3.8h, v3.8h, v0.8h
+ addp v2.8h, v2.8h, v3.8h
+ addp v2.8h, v2.8h, v2.8h
+ addp v2.4h, v2.4h, v2.4h
+ sshll v3.4s, v2.4h, #2
+ saddw v2.4s, v3.4s, v2.4h
+ rshrn v4.4h, v2.4s, #6
+ trn2 v5.4h, v4.4h, v4.4h
+ add v2.4h, v4.4h, v5.4h
+ shl v3.4h, v2.4h, #3
+ ext v7.16b, v7.16b, v7.16b, #14
+ sub v3.4h, v3.4h, v2.4h // 7 * (b + c)
+ add v7.4h, v7.4h, v0.4h
+ shl v2.4h, v7.4h, #4
+ sub v2.4h, v2.4h, v3.4h
+ shl v3.4h, v4.4h, #4
+ ext v0.16b, v0.16b, v0.16b, #14
+ sub v6.4h, v5.4h, v3.4h
+ mov v0.h[0], wzr
+ mul v0.8h, v0.8h, v4.h[0]
+ dup v1.8h, v2.h[0]
+ dup v2.8h, v4.h[0]
+ dup v3.8h, v6.h[0]
+ shl v2.8h, v2.8h, #3
+ add v1.8h, v1.8h, v0.8h
+ add v3.8h, v3.8h, v2.8h
+ mov w3, #16
+1:
+ sqshrun v0.8b, v1.8h, #5
+ add v1.8h, v1.8h, v2.8h
+ sqshrun2 v0.16b, v1.8h, #5
+ add v1.8h, v1.8h, v3.8h
+ st1 {v0.16b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+const p16weight, align=4
+ .short 1,2,3,4,5,6,7,8
+endconst
+const p8weight, align=4
+ .short 1,2,3,4,1,2,3,4
+endconst
+
+function ff_pred8x8_hor_neon, export=1
+ sub x2, x0, #1
+ mov w3, #8
+1: ld1r {v0.8b}, [x2], x1
+ st1 {v0.8b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_vert_neon, export=1
+ sub x2, x0, x1
+ lsl x1, x1, #1
+ ld1 {v0.8b}, [x2], x1
+ mov w3, #4
+1: st1 {v0.8b}, [x0], x1
+ st1 {v0.8b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_plane_neon, export=1
+ sub x3, x0, x1
+ movrel x4, p8weight
+ movrel x5, p16weight
+ add x2, x3, #4
+ sub x3, x3, #1
+ ld1 {v0.s}[0], [x3]
+ ld1 {v2.s}[0], [x2], x1
+ ldcol.8 v0, x3, x1, 4, hi=1
+ add x3, x3, x1
+ ldcol.8 v3, x3, x1, 4
+ uaddl v7.8h, v2.8b, v3.8b
+ rev32 v0.8b, v0.8b
+ trn1 v2.2s, v2.2s, v3.2s
+ usubl v2.8h, v2.8b, v0.8b
+ ld1 {v6.8h}, [x4]
+ mul v2.8h, v2.8h, v6.8h
+ ld1 {v0.8h}, [x5]
+ saddlp v2.4s, v2.8h
+ addp v2.4s, v2.4s, v2.4s
+ shl v3.4s, v2.4s, #4
+ add v2.4s, v3.4s, v2.4s
+ rshrn v5.4h, v2.4s, #5
+ addp v2.4h, v5.4h, v5.4h
+ shl v3.4h, v2.4h, #1
+ add v3.4h, v3.4h, v2.4h
+ rev64 v7.4h, v7.4h
+ add v7.4h, v7.4h, v0.4h
+ shl v2.4h, v7.4h, #4
+ sub v2.4h, v2.4h, v3.4h
+ ext v0.16b, v0.16b, v0.16b, #14
+ mov v0.h[0], wzr
+ mul v0.8h, v0.8h, v5.h[0]
+ dup v1.8h, v2.h[0]
+ dup v2.8h, v5.h[1]
+ add v1.8h, v1.8h, v0.8h
+ mov w3, #8
+1:
+ sqshrun v0.8b, v1.8h, #5
+ add v1.8h, v1.8h, v2.8h
+ st1 {v0.8b}, [x0], x1
+ subs w3, w3, #1
+ b.ne 1b
+ ret
+endfunc
+
+function ff_pred8x8_128_dc_neon, export=1
+ movi v0.8b, #128
+ movi v1.8b, #128
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_top_dc_neon, export=1
+ sub x2, x0, x1
+ ld1 {v0.8b}, [x2]
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ zip1 v0.8h, v0.8h, v0.8h
+ rshrn v2.8b, v0.8h, #2
+ zip1 v0.8b, v2.8b, v2.8b
+ zip1 v1.8b, v2.8b, v2.8b
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_left_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ dup v1.8b, v2.b[1]
+ dup v0.8b, v2.b[0]
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1
+ uaddlp v0.4h, v0.8b
+ uaddlp v1.4h, v1.8b
+ trn1 v2.2s, v0.2s, v1.2s
+ trn2 v3.2s, v0.2s, v1.2s
+ addp v4.4h, v2.4h, v3.4h
+ addp v5.4h, v4.4h, v4.4h
+ rshrn v6.8b, v5.8h, #3
+ rshrn v7.8b, v4.8h, #2
+ dup v0.8b, v6.b[0]
+ dup v2.8b, v7.b[2]
+ dup v1.8b, v7.b[3]
+ dup v3.8b, v6.b[1]
+ zip1 v0.2s, v0.2s, v2.2s
+ zip1 v1.2s, v1.2s, v3.2s
+.L_pred8x8_dc_end:
+ mov w3, #4
+ add x2, x0, x1, lsl #2
+6: st1 {v0.8b}, [x0], x1
+ st1 {v1.8b}, [x2], x1
+ subs w3, w3, #1
+ b.ne 6b
+ ret
+endfunc
+
+function ff_pred8x8_l0t_dc_neon, export=1
+ sub x2, x0, x1
+ sub x3, x0, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1, 4
+ zip1 v0.4s, v0.4s, v1.4s
+ uaddlp v0.8h, v0.16b
+ addp v0.8h, v0.8h, v0.8h
+ addp v1.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ rshrn v3.8b, v1.8h, #3
+ dup v4.8b, v3.b[0]
+ dup v6.8b, v2.b[2]
+ dup v5.8b, v2.b[0]
+ zip1 v0.2s, v4.2s, v6.2s
+ zip1 v1.2s, v5.2s, v6.2s
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_l00_dc_neon, export=1
+ sub x2, x0, #1
+ ldcol.8 v0, x2, x1, 4
+ uaddlp v0.4h, v0.8b
+ addp v0.4h, v0.4h, v0.4h
+ rshrn v0.8b, v0.8h, #2
+ movi v1.8b, #128
+ dup v0.8b, v0.b[0]
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_0lt_dc_neon, export=1
+ add x3, x0, x1, lsl #2
+ sub x2, x0, x1
+ sub x3, x3, #1
+ ld1 {v0.8b}, [x2]
+ ldcol.8 v1, x3, x1, 4, hi=1
+ zip1 v0.4s, v0.4s, v1.4s
+ uaddlp v0.8h, v0.16b
+ addp v0.8h, v0.8h, v0.8h
+ addp v1.4h, v0.4h, v0.4h
+ rshrn v2.8b, v0.8h, #2
+ rshrn v3.8b, v1.8h, #3
+ dup v4.8b, v2.b[0]
+ dup v5.8b, v2.b[3]
+ dup v6.8b, v2.b[2]
+ dup v7.8b, v3.b[1]
+ zip1 v0.2s, v4.2s, v6.2s
+ zip1 v1.2s, v5.2s, v7.2s
+ b .L_pred8x8_dc_end
+endfunc
+
+function ff_pred8x8_0l0_dc_neon, export=1
+ add x2, x0, x1, lsl #2
+ sub x2, x2, #1
+ ldcol.8 v1, x2, x1, 4
+ uaddlp v2.4h, v1.8b
+ addp v2.4h, v2.4h, v2.4h
+ rshrn v1.8b, v2.8h, #2
+ movi v0.8b, #128
+ dup v1.8b, v1.b[0]
+ b .L_pred8x8_dc_end
+endfunc
diff --git a/chromium/third_party/ffmpeg/libavcodec/aasc.c b/chromium/third_party/ffmpeg/libavcodec/aasc.c
index 469fc5eef6f..a91721e28d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aasc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aasc.c
@@ -158,5 +158,5 @@ AVCodec ff_aasc_decoder = {
.init = aasc_decode_init,
.close = aasc_decode_end,
.decode = aasc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3.h b/chromium/third_party/ffmpeg/libavcodec/ac3.h
index 1fe30b95877..3f67e09aea0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3.h
@@ -190,9 +190,7 @@ typedef struct AC3HeaderInfo {
int surround_mix_level; ///< Surround mix level index
uint16_t channel_map;
int num_blocks; ///< number of audio blocks
-#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int dolby_surround_mode;
-#endif
/** @} */
/** @name Derived values
@@ -205,9 +203,6 @@ typedef struct AC3HeaderInfo {
uint16_t frame_size;
uint64_t channel_layout;
/** @} */
-#if !AV_HAVE_INCOMPATIBLE_LIBAV_ABI
- int dolby_surround_mode;
-#endif
} AC3HeaderInfo;
typedef enum {
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
index 678f08d2d75..5ab5627a46f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3_parser.c
@@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err;
union {
uint64_t u64;
- uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
} tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr, *phdr = &hdr;
GetBitContext gbc;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
index 234b469bc0e..6df697e855b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec.c
@@ -193,13 +193,13 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
ff_bswapdsp_init(&s->bdsp);
#if (USE_FIXED)
- s->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT);
#else
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
ff_fmt_convert_init(&s->fmt_conv, avctx);
#endif
- ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
+ ff_ac3dsp_init(&s->ac3dsp, avctx->flags & AV_CODEC_FLAG_BITEXACT);
av_lfg_init(&s->dith_state, 0);
if (USE_FIXED)
@@ -208,14 +208,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
/* allow downmixing to stereo or mono */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->request_channels == 1)
- avctx->request_channel_layout = AV_CH_LAYOUT_MONO;
- else if (avctx->request_channels == 2)
- avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->channels > 1 &&
avctx->request_channel_layout == AV_CH_LAYOUT_MONO)
avctx->channels = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec.h b/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
index 5259c600095..b3498fec96e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec.h
@@ -235,7 +235,7 @@ typedef struct AC3DecodeContext {
DECLARE_ALIGNED(32, INTFLOAT, window)[AC3_BLOCK_SIZE]; ///< window coefficients
DECLARE_ALIGNED(32, INTFLOAT, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
DECLARE_ALIGNED(32, SHORTFLOAT, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
- DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
+ DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
///@}
} AC3DecodeContext;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c
index b4beee6dd7f..21756eac1b1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec_fixed.c
@@ -188,7 +188,7 @@ AVCodec ff_ac3_fixed_decoder = {
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c b/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c
index d74a0df68da..6b46de27fd0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3dec_float.c
@@ -60,7 +60,7 @@ AVCodec ff_ac3_decoder = {
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
@@ -83,7 +83,7 @@ AVCodec ff_eac3_decoder = {
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
index 50803de3590..0d8a678f729 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
@@ -2484,7 +2484,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
ff_audiodsp_init(&s->adsp);
ff_me_cmp_init(&s->mecc, avctx);
- ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
+ ff_ac3dsp_init(&s->ac3dsp, avctx->flags & AV_CODEC_FLAG_BITEXACT);
dprint_options(s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
index 766b14ec13f..6c91f459d00 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc_float.c
@@ -139,7 +139,7 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
{
AC3EncodeContext *s = avctx->priv_data;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
return ff_ac3_encode_init(avctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
index c3ad76f4295..9dec9ae9cf3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc_template.c
@@ -438,7 +438,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
ff_ac3_quantize_mantissas(s);
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size, 0)) < 0)
return ret;
ff_ac3_output_frame(s, avpkt->data);
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcm.c b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
index 22b5468489c..ba38041f4af 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
@@ -84,8 +84,9 @@ static const int swf_index_tables[4][16] = {
/* end of tables */
typedef struct ADPCMDecodeContext {
- ADPCMChannelStatus status[6];
+ ADPCMChannelStatus status[14];
int vqa_version; /**< VQA version. Used for ADPCM_IMA_WS */
+ int has_status;
} ADPCMDecodeContext;
static av_cold int adpcm_decode_init(AVCodecContext * avctx)
@@ -104,9 +105,12 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
case AV_CODEC_ID_ADPCM_EA_R2:
case AV_CODEC_ID_ADPCM_EA_R3:
case AV_CODEC_ID_ADPCM_EA_XAS:
- case AV_CODEC_ID_ADPCM_THP:
max_channels = 6;
break;
+ case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
+ max_channels = 14;
+ break;
}
if (avctx->channels < min_channels || avctx->channels > max_channels) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
@@ -145,6 +149,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
case AV_CODEC_ID_ADPCM_EA_R3:
case AV_CODEC_ID_ADPCM_EA_XAS:
case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
case AV_CODEC_ID_ADPCM_AFC:
case AV_CODEC_ID_ADPCM_DTK:
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
@@ -636,15 +641,22 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
break;
}
case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
if (avctx->extradata) {
- nb_samples = buf_size / (8 * ch) * 14;
+ nb_samples = buf_size * 14 / (8 * ch);
break;
}
has_coded_samples = 1;
bytestream2_skip(gb, 4); // channel size
- *coded_samples = bytestream2_get_be32(gb);
- *coded_samples -= *coded_samples % 14;
- nb_samples = (buf_size - (8 + 36 * ch)) / (8 * ch) * 14;
+ *coded_samples = (avctx->codec->id == AV_CODEC_ID_ADPCM_THP_LE) ?
+ bytestream2_get_le32(gb) :
+ bytestream2_get_be32(gb);
+ buf_size -= 8 + 36 * ch;
+ buf_size /= ch;
+ nb_samples = buf_size / 8 * 14;
+ if (buf_size % 8 > 1)
+ nb_samples += (buf_size % 8 - 1) * 2;
+ *approx_nb_samples = 1;
break;
case AV_CODEC_ID_ADPCM_AFC:
nb_samples = buf_size / (9 * ch) * 16;
@@ -763,7 +775,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int samples_per_block = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
GetBitContext g;
- init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+ ret = init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+ if (ret < 0)
+ return ret;
for (n = 0; n < (nb_samples - 1) / samples_per_block; n++) {
for (i = 0; i < avctx->channels; i++) {
cs = &c->status[i];
@@ -1415,10 +1429,17 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
break;
}
case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
{
- int table[6][16];
+ int table[14][16];
int ch;
+#define THP_GET16(g) \
+ sign_extend( \
+ avctx->codec->id == AV_CODEC_ID_ADPCM_THP_LE ? \
+ bytestream2_get_le16u(&(g)) : \
+ bytestream2_get_be16u(&(g)), 16)
+
if (avctx->extradata) {
GetByteContext tb;
if (avctx->extradata_size < 32 * avctx->channels) {
@@ -1429,24 +1450,29 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_init(&tb, avctx->extradata, avctx->extradata_size);
for (i = 0; i < avctx->channels; i++)
for (n = 0; n < 16; n++)
- table[i][n] = sign_extend(bytestream2_get_be16u(&tb), 16);
+ table[i][n] = THP_GET16(tb);
} else {
- for (i = 0; i < avctx->channels; i++)
- for (n = 0; n < 16; n++)
- table[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
+ for (i = 0; i < avctx->channels; i++)
+ for (n = 0; n < 16; n++)
+ table[i][n] = THP_GET16(gb);
- /* Initialize the previous sample. */
- for (i = 0; i < avctx->channels; i++) {
- c->status[i].sample1 = sign_extend(bytestream2_get_be16u(&gb), 16);
- c->status[i].sample2 = sign_extend(bytestream2_get_be16u(&gb), 16);
- }
+ if (!c->has_status) {
+ /* Initialize the previous sample. */
+ for (i = 0; i < avctx->channels; i++) {
+ c->status[i].sample1 = THP_GET16(gb);
+ c->status[i].sample2 = THP_GET16(gb);
+ }
+ c->has_status = 1;
+ } else {
+ bytestream2_skip(&gb, avctx->channels * 4);
+ }
}
for (ch = 0; ch < avctx->channels; ch++) {
samples = samples_p[ch];
/* Read in every sample for this channel. */
- for (i = 0; i < nb_samples / 14; i++) {
+ for (i = 0; i < (nb_samples + 13) / 14; i++) {
int byte = bytestream2_get_byteu(&gb);
int index = (byte >> 4) & 7;
unsigned int exp = byte & 0x0F;
@@ -1454,7 +1480,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int factor2 = table[ch][index * 2 + 1];
/* Decode 14 samples. */
- for (n = 0; n < 14; n++) {
+ for (n = 0; n < 14 && (i * 14 + n < nb_samples); n++) {
int32_t sampledat;
if (n & 1) {
@@ -1542,6 +1568,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
return bytestream2_tell(&gb);
}
+static void adpcm_flush(AVCodecContext *avctx)
+{
+ ADPCMDecodeContext *c = avctx->priv_data;
+ c->has_status = 0;
+}
+
static const enum AVSampleFormat sample_fmts_s16[] = { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE };
@@ -1560,7 +1592,8 @@ AVCodec ff_ ## name_ ## _decoder = { \
.priv_data_size = sizeof(ADPCMDecodeContext), \
.init = adpcm_decode_init, \
.decode = adpcm_decode_frame, \
- .capabilities = CODEC_CAP_DR1, \
+ .flush = adpcm_flush, \
+ .capabilities = AV_CODEC_CAP_DR1, \
.sample_fmts = sample_fmts_, \
}
@@ -1593,6 +1626,7 @@ ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_2, sample_fmts_s16, adpcm_sbpro_2,
ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_3, sample_fmts_s16, adpcm_sbpro_3, "ADPCM Sound Blaster Pro 2.6-bit");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_4, sample_fmts_s16, adpcm_sbpro_4, "ADPCM Sound Blaster Pro 4-bit");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_SWF, sample_fmts_s16, adpcm_swf, "ADPCM Shockwave Flash");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP, sample_fmts_s16p, adpcm_thp, "ADPCM Nintendo Gamecube THP");
+ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP_LE, sample_fmts_s16p, adpcm_thp_le, "ADPCM Nintendo THP (little-endian)");
+ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP, sample_fmts_s16p, adpcm_thp, "ADPCM Nintendo THP");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_XA, sample_fmts_s16p, adpcm_xa, "ADPCM CDROM XA");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_YAMAHA, sample_fmts_s16, adpcm_yamaha, "ADPCM Yamaha");
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcmenc.c b/chromium/third_party/ffmpeg/libavcodec/adpcmenc.c
index 50872c3e46c..9ceea094520 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcmenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcmenc.c
@@ -113,7 +113,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2;
avctx->bits_per_coded_sample = 4;
avctx->block_align = BLKSIZE;
- if (!(avctx->extradata = av_malloc(32 + FF_INPUT_BUFFER_PADDING_SIZE)))
+ if (!(avctx->extradata = av_malloc(32 + AV_INPUT_BUFFER_PADDING_SIZE)))
goto error;
avctx->extradata_size = 32;
extradata = avctx->extradata;
@@ -486,7 +486,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
else
pkt_size = avctx->block_align;
- if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0)
return ret;
dst = avpkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/adxdec.c b/chromium/third_party/ffmpeg/libavcodec/adxdec.c
index 5115cede6ae..32cc0f005a4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adxdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adxdec.c
@@ -183,7 +183,7 @@ AVCodec ff_adpcm_adx_decoder = {
.init = adx_decode_init,
.decode = adx_decode_frame,
.flush = adx_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/adxenc.c b/chromium/third_party/ffmpeg/libavcodec/adxenc.c
index 7736d09b567..f1ba5911b33 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adxenc.c
@@ -146,7 +146,7 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int ch, out_size, ret;
out_size = BLOCK_SIZE * avctx->channels + !c->header_parsed * HEADER_SIZE;
- if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0)
return ret;
dst = avpkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/aic.c b/chromium/third_party/ffmpeg/libavcodec/aic.c
index c747bb0cef3..5decc787445 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aic.c
@@ -448,7 +448,7 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
ctx->num_x_slices = (ctx->mb_width + 15) >> 4;
ctx->slice_width = 16;
for (i = 1; i < 32; i++) {
- if (!(ctx->mb_width % i) && (ctx->mb_width / i < 32)) {
+ if (!(ctx->mb_width % i) && (ctx->mb_width / i <= 32)) {
ctx->slice_width = ctx->mb_width / i;
ctx->num_x_slices = i;
break;
@@ -488,5 +488,5 @@ AVCodec ff_aic_decoder = {
.init = aic_decode_init,
.close = aic_decode_close,
.decode = aic_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/alac.c b/chromium/third_party/ffmpeg/libavcodec/alac.c
index b0527f14395..827c0db191e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alac.c
@@ -404,7 +404,6 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
alac->extra_bits, channels, alac->nb_samples);
}
- if(av_sample_fmt_is_planar(avctx->sample_fmt)) {
switch(alac->sample_size) {
case 16: {
for (ch = 0; ch < channels; ch++) {
@@ -420,37 +419,6 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
}}
break;
}
- }else{
- switch(alac->sample_size) {
- case 16: {
- int16_t *outbuffer = ((int16_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i];
- outbuffer += alac->channels - channels;
- }
- }
- break;
- case 24: {
- int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
- outbuffer += alac->channels - channels;
- }
- }
- break;
- case 32: {
- int32_t *outbuffer = ((int32_t *)frame->extended_data[0]) + ch_index;
- for (i = 0; i < alac->nb_samples; i++) {
- for (ch = 0; ch < channels; ch++)
- *outbuffer++ = alac->output_samples_buffer[ch][i];
- outbuffer += alac->channels - channels;
- }
- }
- break;
- }
- }
return 0;
}
@@ -534,11 +502,17 @@ static int allocate_buffers(ALACContext *alac)
int ch;
int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
+ for (ch = 0; ch < 2; ch++) {
+ alac->predict_error_buffer[ch] = NULL;
+ alac->output_samples_buffer[ch] = NULL;
+ alac->extra_bits_buffer[ch] = NULL;
+ }
+
for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
buf_size, buf_alloc_fail);
- alac->direct_output = alac->sample_size > 16 && av_sample_fmt_is_planar(alac->avctx->sample_fmt);
+ alac->direct_output = alac->sample_size > 16;
if (!alac->direct_output) {
FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
buf_size, buf_alloc_fail);
@@ -587,7 +561,6 @@ static int alac_set_info(ALACContext *alac)
static av_cold int alac_decode_init(AVCodecContext * avctx)
{
int ret;
- int req_packed;
ALACContext *alac = avctx->priv_data;
alac->avctx = avctx;
@@ -601,12 +574,11 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
return -1;
}
- req_packed = LIBAVCODEC_VERSION_MAJOR < 55 && !av_sample_fmt_is_planar(avctx->request_sample_fmt);
switch (alac->sample_size) {
- case 16: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_S16P;
+ case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
break;
case 24:
- case 32: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S32P;
+ case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
break;
default: avpriv_request_sample(avctx, "Sample depth %d", alac->sample_size);
return AVERROR_PATCHWELCOME;
@@ -668,6 +640,6 @@ AVCodec ff_alac_decoder = {
.close = alac_decode_close,
.decode = alac_decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.priv_class = &alac_class
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/alacenc.c b/chromium/third_party/ffmpeg/libavcodec/alacenc.c
index ce63da6637c..a87c373e255 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alacenc.c
@@ -531,7 +531,7 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
avctx->channels,
avctx->bits_per_raw_sample);
- avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
ret = AVERROR(ENOMEM);
goto error;
@@ -618,7 +618,7 @@ static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
else
max_frame_size = s->max_coded_frame_size;
- if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size, 0)) < 0)
return ret;
/* use verbatim mode for compression_level 0 */
@@ -653,7 +653,7 @@ AVCodec ff_alac_encoder = {
.init = alac_encode_init,
.encode2 = alac_encode_frame,
.close = alac_encode_close,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.channel_layouts = ff_alac_channel_layouts,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_S16P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c b/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c
index bdc4c72c218..087b18fb91f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aliaspixdec.c
@@ -124,5 +124,5 @@ AVCodec ff_alias_pix_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ALIAS_PIX,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c b/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c
index 1fcea084159..a9ba00cd29c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aliaspixenc.c
@@ -27,22 +27,18 @@
#define ALIAS_HEADER_SIZE 10
-static av_cold int encode_init(AVCodecContext *avctx)
-{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
- return 0;
-}
-
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
int width, height, bits_pixel, i, j, length, ret;
uint8_t *in_buf, *buf;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
width = avctx->width;
height = avctx->height;
@@ -65,7 +61,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
length = ALIAS_HEADER_SIZE + 4 * width * height; // max possible
- if ((ret = ff_alloc_packet(pkt, length)) < 0) {
+ if ((ret = ff_alloc_packet2(avctx, pkt, length, ALIAS_HEADER_SIZE + height*2)) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", length);
return ret;
}
@@ -114,20 +110,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_alias_pix_encoder = {
.name = "alias_pix",
.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ALIAS_PIX,
- .init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
},
diff --git a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
index ce977467f97..f33e457ce29 100644
--- a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
@@ -76,6 +76,7 @@ void avcodec_register_all(void)
/* hardware accelerators */
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
REGISTER_HWACCEL(H263_VDPAU, h263_vdpau);
+ REGISTER_HWACCEL(H263_VIDEOTOOLBOX, h263_videotoolbox);
REGISTER_HWACCEL(H264_D3D11VA, h264_d3d11va);
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
REGISTER_HWACCEL(H264_MMAL, h264_mmal);
@@ -84,21 +85,30 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(H264_VDA, h264_vda);
REGISTER_HWACCEL(H264_VDA_OLD, h264_vda_old);
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
+ REGISTER_HWACCEL(H264_VIDEOTOOLBOX, h264_videotoolbox);
REGISTER_HWACCEL(HEVC_D3D11VA, hevc_d3d11va);
REGISTER_HWACCEL(HEVC_DXVA2, hevc_dxva2);
+ REGISTER_HWACCEL(HEVC_QSV, hevc_qsv);
+ REGISTER_HWACCEL(HEVC_VAAPI, hevc_vaapi);
+ REGISTER_HWACCEL(HEVC_VDPAU, hevc_vdpau);
REGISTER_HWACCEL(MPEG1_XVMC, mpeg1_xvmc);
REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau);
+ REGISTER_HWACCEL(MPEG1_VIDEOTOOLBOX, mpeg1_videotoolbox);
REGISTER_HWACCEL(MPEG2_XVMC, mpeg2_xvmc);
REGISTER_HWACCEL(MPEG2_D3D11VA, mpeg2_d3d11va);
REGISTER_HWACCEL(MPEG2_DXVA2, mpeg2_dxva2);
+ REGISTER_HWACCEL(MPEG2_QSV, mpeg2_qsv);
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
+ REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox);
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
+ REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox);
REGISTER_HWACCEL(VC1_D3D11VA, vc1_d3d11va);
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
+ REGISTER_HWACCEL(VC1_QSV, vc1_qsv);
REGISTER_HWACCEL(WMV3_D3D11VA, wmv3_d3d11va);
REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2);
REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi);
@@ -140,6 +150,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(CPIA, cpia);
REGISTER_DECODER(CSCD, cscd);
REGISTER_DECODER(CYUV, cyuv);
+ REGISTER_DECODER(DDS, dds);
REGISTER_DECODER(DFA, dfa);
REGISTER_DECODER(DIRAC, dirac);
REGISTER_ENCDEC (DNXHD, dnxhd);
@@ -148,6 +159,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (DVVIDEO, dvvideo);
REGISTER_DECODER(DXA, dxa);
REGISTER_DECODER(DXTORY, dxtory);
+ REGISTER_DECODER(DXV, dxv);
REGISTER_DECODER(EACMV, eacmv);
REGISTER_DECODER(EAMAD, eamad);
REGISTER_DECODER(EATGQ, eatgq);
@@ -180,8 +192,12 @@ void avcodec_register_all(void)
REGISTER_DECODER(H264_MMAL, h264_mmal);
REGISTER_DECODER(H264_QSV, h264_qsv);
REGISTER_DECODER(H264_VDA, h264_vda);
+#if FF_API_VDPAU
REGISTER_DECODER(H264_VDPAU, h264_vdpau);
+#endif
+ REGISTER_ENCDEC (HAP, hap);
REGISTER_DECODER(HEVC, hevc);
+ REGISTER_DECODER(HEVC_QSV, hevc_qsv);
REGISTER_DECODER(HNM4_VIDEO, hnm4_video);
REGISTER_DECODER(HQ_HQA, hq_hqa);
REGISTER_DECODER(HQX, hqx);
@@ -215,11 +231,16 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
REGISTER_ENCDEC (MPEG4, mpeg4);
REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd);
+#if FF_API_VDPAU
REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau);
+#endif
REGISTER_DECODER(MPEGVIDEO, mpegvideo);
+#if FF_API_VDPAU
REGISTER_DECODER(MPEG_VDPAU, mpeg_vdpau);
REGISTER_DECODER(MPEG1_VDPAU, mpeg1_vdpau);
+#endif
REGISTER_DECODER(MPEG2_CRYSTALHD, mpeg2_crystalhd);
+ REGISTER_DECODER(MPEG2_QSV, mpeg2_qsv);
REGISTER_DECODER(MSA1, msa1);
REGISTER_DECODER(MSMPEG4_CRYSTALHD, msmpeg4_crystalhd);
REGISTER_DECODER(MSMPEG4V1, msmpeg4v1);
@@ -298,8 +319,11 @@ void avcodec_register_all(void)
REGISTER_DECODER(VBLE, vble);
REGISTER_DECODER(VC1, vc1);
REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd);
+#if FF_API_VDPAU
REGISTER_DECODER(VC1_VDPAU, vc1_vdpau);
+#endif
REGISTER_DECODER(VC1IMAGE, vc1image);
+ REGISTER_DECODER(VC1_QSV, vc1_qsv);
REGISTER_DECODER(VCR1, vcr1);
REGISTER_DECODER(VMDVIDEO, vmdvideo);
REGISTER_DECODER(VMNC, vmnc);
@@ -317,7 +341,9 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (WMV2, wmv2);
REGISTER_DECODER(WMV3, wmv3);
REGISTER_DECODER(WMV3_CRYSTALHD, wmv3_crystalhd);
+#if FF_API_VDPAU
REGISTER_DECODER(WMV3_VDPAU, wmv3_vdpau);
+#endif
REGISTER_DECODER(WMV3IMAGE, wmv3image);
REGISTER_DECODER(WNV1, wnv1);
REGISTER_DECODER(XAN_WC3, xan_wc3);
@@ -336,6 +362,7 @@ void avcodec_register_all(void)
/* audio codecs */
REGISTER_ENCDEC (AAC, aac);
+ REGISTER_DECODER(AAC_FIXED, aac_fixed);
REGISTER_DECODER(AAC_LATM, aac_latm);
REGISTER_ENCDEC (AC3, ac3);
REGISTER_ENCDEC (AC3_FIXED, ac3_fixed);
@@ -486,12 +513,10 @@ void avcodec_register_all(void)
REGISTER_DECODER(ADPCM_SBPRO_4, adpcm_sbpro_4);
REGISTER_ENCDEC (ADPCM_SWF, adpcm_swf);
REGISTER_DECODER(ADPCM_THP, adpcm_thp);
+ REGISTER_DECODER(ADPCM_THP_LE, adpcm_thp_le);
REGISTER_DECODER(ADPCM_VIMA, adpcm_vima);
REGISTER_DECODER(ADPCM_XA, adpcm_xa);
REGISTER_ENCDEC (ADPCM_YAMAHA, adpcm_yamaha);
-#if FF_API_VIMA_DECODER
- REGISTER_DECODER(VIMA, vima);
-#endif
/* subtitles */
REGISTER_ENCDEC (SSA, ssa);
@@ -545,6 +570,7 @@ void avcodec_register_all(void)
REGISTER_ENCODER(LIBWAVPACK, libwavpack);
REGISTER_ENCODER(LIBWEBP_ANIM, libwebp_anim); /* preferred over libwebp */
REGISTER_ENCODER(LIBWEBP, libwebp);
+ REGISTER_ENCODER(LIBX262, libx262);
REGISTER_ENCODER(LIBX264, libx264);
REGISTER_ENCODER(LIBX264RGB, libx264rgb);
REGISTER_ENCODER(LIBX265, libx265);
@@ -565,6 +591,9 @@ void avcodec_register_all(void)
REGISTER_ENCODER(NVENC, nvenc);
REGISTER_ENCODER(NVENC_H264, nvenc_h264);
REGISTER_ENCODER(NVENC_HEVC, nvenc_hevc);
+ REGISTER_ENCODER(HEVC_QSV, hevc_qsv);
+ REGISTER_ENCODER(LIBKVAZAAR, libkvazaar);
+ REGISTER_ENCODER(MPEG2_QSV, mpeg2_qsv);
/* parsers */
REGISTER_PARSER(AAC, aac);
@@ -582,6 +611,7 @@ void avcodec_register_all(void)
REGISTER_PARSER(DVDSUB, dvdsub);
REGISTER_PARSER(DVD_NAV, dvd_nav);
REGISTER_PARSER(FLAC, flac);
+ REGISTER_PARSER(G729, g729);
REGISTER_PARSER(GSM, gsm);
REGISTER_PARSER(H261, h261);
REGISTER_PARSER(H263, h263);
@@ -609,6 +639,7 @@ void avcodec_register_all(void)
REGISTER_BSF(CHOMP, chomp);
REGISTER_BSF(DUMP_EXTRADATA, dump_extradata);
REGISTER_BSF(H264_MP4TOANNEXB, h264_mp4toannexb);
+ REGISTER_BSF(HEVC_MP4TOANNEXB, hevc_mp4toannexb);
REGISTER_BSF(IMX_DUMP_HEADER, imx_dump_header);
REGISTER_BSF(MJPEG2JPEG, mjpeg2jpeg);
REGISTER_BSF(MJPEGA_DUMP_HEADER, mjpega_dump_header);
diff --git a/chromium/third_party/ffmpeg/libavcodec/alsdec.c b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
index b7d147d681f..ebd364e0850 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
@@ -1853,5 +1853,5 @@ AVCodec ff_als_decoder = {
.close = decode_end,
.decode = decode_frame,
.flush = flush,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/amrnbdec.c b/chromium/third_party/ffmpeg/libavcodec/amrnbdec.c
index 3fa639de27b..2299a253ab0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/amrnbdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/amrnbdec.c
@@ -1088,7 +1088,7 @@ AVCodec ff_amrnb_decoder = {
.priv_data_size = sizeof(AMRContext),
.init = amrnb_decode_init,
.decode = amrnb_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/amrwbdec.c b/chromium/third_party/ffmpeg/libavcodec/amrwbdec.c
index 8771a2afc27..b73b700a718 100644
--- a/chromium/third_party/ffmpeg/libavcodec/amrwbdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/amrwbdec.c
@@ -1273,7 +1273,7 @@ AVCodec ff_amrwb_decoder = {
.priv_data_size = sizeof(AMRWBContext),
.init = amrwb_decode_init,
.decode = amrwb_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/anm.c b/chromium/third_party/ffmpeg/libavcodec/anm.c
index 3727534729d..29d59fbceb6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/anm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/anm.c
@@ -198,5 +198,5 @@ AVCodec ff_anm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ansi.c b/chromium/third_party/ffmpeg/libavcodec/ansi.c
index 202335914f9..21d5ae1db29 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ansi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ansi.c
@@ -478,5 +478,5 @@ AVCodec ff_ansi_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/apedec.c b/chromium/third_party/ffmpeg/libavcodec/apedec.c
index 03afd756dcb..5536e0f8b1f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/apedec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/apedec.c
@@ -1570,7 +1570,8 @@ AVCodec ff_ape_decoder = {
.init = ape_decode_init,
.close = ape_decode_close,
.decode = ape_decode_frame,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_DR1,
.flush = ape_flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/api-flac-test.c b/chromium/third_party/ffmpeg/libavcodec/api-flac-test.c
deleted file mode 100644
index 402d4df2e12..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/api-flac-test.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2015 Ludmila Glinskih
- * Copyright (c) 2001 Fabrice Bellard
- *
- * 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.
- */
-
-/*
- * FLAC codec test.
- * Encodes raw data to FLAC format and decodes it back to raw. Compares raw-data
- * after that.
- */
-
-#include "avcodec.h"
-#include "libavutil/common.h"
-#include "libavutil/samplefmt.h"
-
-#define NUMBER_OF_FRAMES 200
-#define NAME_BUFF_SIZE 100
-
-/* generate i-th frame of test audio */
-static int generate_raw_frame(uint16_t *frame_data, int i, int sample_rate,
- int channels, int frame_size)
-{
- int j, k;
-
- for (j = 0; j < frame_size; j++) {
- frame_data[channels * j] = 10000 * ((j / 10 * i) % 2);
- for (k = 1; k < channels; k++)
- frame_data[channels * j + k] = frame_data[channels * j] * (k + 1);
- }
- return 0;
-}
-
-static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx,
- int64_t ch_layout, int sample_rate)
-{
- AVCodecContext *ctx;
- int result;
- char name_buff[NAME_BUFF_SIZE];
-
- av_get_channel_layout_string(name_buff, NAME_BUFF_SIZE, 0, ch_layout);
- av_log(NULL, AV_LOG_INFO, "channel layout: %s, sample rate: %i\n", name_buff, sample_rate);
-
- ctx = avcodec_alloc_context3(enc);
- if (!ctx) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate encoder context\n");
- return AVERROR(ENOMEM);
- }
-
- ctx->sample_fmt = AV_SAMPLE_FMT_S16;
- ctx->sample_rate = sample_rate;
- ctx->channel_layout = ch_layout;
-
- result = avcodec_open2(ctx, enc, NULL);
- if (result < 0) {
- av_log(ctx, AV_LOG_ERROR, "Can't open encoder\n");
- return result;
- }
-
- *enc_ctx = ctx;
- return 0;
-}
-
-static int init_decoder(AVCodec *dec, AVCodecContext **dec_ctx,
- int64_t ch_layout)
-{
- AVCodecContext *ctx;
- int result;
-
- ctx = avcodec_alloc_context3(dec);
- if (!ctx) {
- av_log(NULL, AV_LOG_ERROR , "Can't allocate decoder context\n");
- return AVERROR(ENOMEM);
- }
-
- ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
- /* XXX: FLAC ignores it for some reason */
- ctx->request_channel_layout = ch_layout;
- ctx->channel_layout = ch_layout;
-
- result = avcodec_open2(ctx, dec, NULL);
- if (result < 0) {
- av_log(ctx, AV_LOG_ERROR, "Can't open decoder\n");
- return result;
- }
-
- *dec_ctx = ctx;
- return 0;
-}
-
-static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx,
- AVCodecContext *dec_ctx)
-{
- AVPacket enc_pkt;
- AVFrame *in_frame, *out_frame;
- uint8_t *raw_in = NULL, *raw_out = NULL;
- int in_offset = 0, out_offset = 0;
- int frame_data_size = 0;
- int result = 0;
- int got_output = 0;
- int i = 0;
-
- in_frame = av_frame_alloc();
- if (!in_frame) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate input frame\n");
- return AVERROR(ENOMEM);
- }
-
- in_frame->nb_samples = enc_ctx->frame_size;
- in_frame->format = enc_ctx->sample_fmt;
- in_frame->channel_layout = enc_ctx->channel_layout;
- if (av_frame_get_buffer(in_frame, 32) != 0) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate a buffer for input frame\n");
- return AVERROR(ENOMEM);
- }
-
- out_frame = av_frame_alloc();
- if (!out_frame) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate output frame\n");
- return AVERROR(ENOMEM);
- }
-
- raw_in = av_malloc(in_frame->linesize[0] * NUMBER_OF_FRAMES);
- if (!raw_in) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate memory for raw_in\n");
- return AVERROR(ENOMEM);
- }
-
- raw_out = av_malloc(in_frame->linesize[0] * NUMBER_OF_FRAMES);
- if (!raw_out) {
- av_log(NULL, AV_LOG_ERROR, "Can't allocate memory for raw_out\n");
- return AVERROR(ENOMEM);
- }
-
- for (i = 0; i < NUMBER_OF_FRAMES; i++) {
- av_init_packet(&enc_pkt);
- enc_pkt.data = NULL;
- enc_pkt.size = 0;
-
- generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate,
- enc_ctx->channels, enc_ctx->frame_size);
- memcpy(raw_in + in_offset, in_frame->data[0], in_frame->linesize[0]);
- in_offset += in_frame->linesize[0];
- result = avcodec_encode_audio2(enc_ctx, &enc_pkt, in_frame, &got_output);
- if (result < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error encoding audio frame\n");
- return result;
- }
-
- /* if we get an encoded packet, feed it straight to the decoder */
- if (got_output) {
- result = avcodec_decode_audio4(dec_ctx, out_frame, &got_output, &enc_pkt);
- if (result < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error decoding audio packet\n");
- return result;
- }
-
- if (got_output) {
- if (result != enc_pkt.size) {
- av_log(NULL, AV_LOG_INFO, "Decoder consumed only part of a packet, it is allowed to do so -- need to update this test\n");
- return AVERROR_UNKNOWN;
- }
-
- if (in_frame->nb_samples != out_frame->nb_samples) {
- av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different number of samples\n");
- return AVERROR_UNKNOWN;
- }
-
- if (in_frame->channel_layout != out_frame->channel_layout) {
- av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different channel layout\n");
- return AVERROR_UNKNOWN;
- }
-
- if (in_frame->format != out_frame->format) {
- av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n");
- return AVERROR_UNKNOWN;
- }
- memcpy(raw_out + out_offset, out_frame->data[0], out_frame->linesize[0]);
- out_offset += out_frame->linesize[0];
- }
- }
- av_free_packet(&enc_pkt);
- }
-
- if (memcmp(raw_in, raw_out, frame_data_size * NUMBER_OF_FRAMES) != 0) {
- av_log(NULL, AV_LOG_ERROR, "Output differs\n");
- return 1;
- }
-
- av_log(NULL, AV_LOG_INFO, "OK\n");
-
- av_freep(&raw_in);
- av_freep(&raw_out);
- av_frame_free(&in_frame);
- av_frame_free(&out_frame);
- return 0;
-}
-
-static int close_encoder(AVCodecContext **enc_ctx)
-{
- avcodec_close(*enc_ctx);
- av_freep(enc_ctx);
- return 0;
-}
-
-static int close_decoder(AVCodecContext **dec_ctx)
-{
- avcodec_close(*dec_ctx);
- av_freep(dec_ctx);
- return 0;
-}
-
-int main(void)
-{
- AVCodec *enc = NULL, *dec = NULL;
- AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL;
- uint64_t channel_layouts[] = {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO_DOWNMIX};
- int sample_rates[] = {8000, 44100, 48000, 192000};
- int cl, sr;
-
- avcodec_register_all();
-
- enc = avcodec_find_encoder(AV_CODEC_ID_FLAC);
- if (!enc) {
- av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n");
- return 1;
- }
-
- dec = avcodec_find_decoder(AV_CODEC_ID_FLAC);
- if (!dec) {
- av_log(NULL, AV_LOG_ERROR, "Can't find decoder\n");
- return 1;
- }
-
- for (cl = 0; cl < FF_ARRAY_ELEMS(channel_layouts); cl++) {
- for (sr = 0; sr < FF_ARRAY_ELEMS(sample_rates); sr++) {
- if (init_encoder(enc, &enc_ctx, channel_layouts[cl], sample_rates[sr]) != 0)
- return 1;
- if (init_decoder(dec, &dec_ctx, channel_layouts[cl]) != 0)
- return 1;
- if (run_test(enc, dec, enc_ctx, dec_ctx) != 0)
- return 1;
- close_encoder(&enc_ctx);
- close_decoder(&dec_ctx);
- }
- }
-
- return 0;
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/Makefile b/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
index 2f8739691e0..cdd35b08eab 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/Makefile
@@ -18,6 +18,9 @@ OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \
arm/idctdsp_arm.o \
arm/jrevdct_arm.o \
arm/simple_idct_arm.o
+OBJS-$(CONFIG_FLACDSP) += arm/flacdsp_init_arm.o \
+ arm/flacdsp_arm.o
+OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o
OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o
OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_init_arm.o
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
@@ -25,28 +28,21 @@ OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_init_arm.o
OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_init_arm.o
+OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o
OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
+OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_arm.o
# decoders/encoders
OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \
arm/sbrdsp_init_arm.o
-OBJS-$(CONFIG_ADPCM_G722_DECODER) += arm/g722dsp_init_arm.o
-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += arm/g722dsp_init_arm.o
OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o
-OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \
- arm/flacdsp_arm.o
-OBJS-$(CONFIG_FLAC_ENCODER) += arm/flacdsp_init_arm.o
OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
+OBJS-$(CONFIG_RV40_DECODER) += arm/rv40dsp_init_arm.o
OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o
-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_arm.o
-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_arm.o
-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o
-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
- arm/rv40dsp_init_arm.o
# ARMv5 optimizations
@@ -74,16 +70,13 @@ ARMV6-OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_armv6.o
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o
ARMV6-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_armv6.o
+ARMV6-OBJS-$(CONFIG_VP8DSP) += arm/vp8_armv6.o \
+ arm/vp8dsp_init_armv6.o \
+ arm/vp8dsp_armv6.o
# decoders/encoders
ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
ARMV6-OBJS-$(CONFIG_STARTCODE) += arm/startcode_armv6.o
-ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \
- arm/vp8dsp_init_armv6.o \
- arm/vp8dsp_armv6.o
-ARMV6-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8_armv6.o \
- arm/vp8dsp_init_armv6.o \
- arm/vp8dsp_armv6.o
# VFP optimizations
@@ -110,6 +103,7 @@ NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
arm/fft_fixed_neon.o
NEON-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_neon.o
+NEON-OBJS-$(CONFIG_G722DSP) += arm/g722dsp_neon.o
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
arm/h264idct_neon.o
@@ -126,12 +120,12 @@ NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o
NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
+NEON-OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_neon.o \
+ arm/vp8dsp_neon.o
# decoders/encoders
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \
arm/sbrdsp_neon.o
-NEON-OBJS-$(CONFIG_ADPCM_G722_DECODER) += arm/g722dsp_neon.o
-NEON-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += arm/g722dsp_neon.o
NEON-OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_neon.o
NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \
arm/synth_filter_neon.o
@@ -146,7 +140,3 @@ NEON-OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_neon.o \
arm/vc1dsp_neon.o
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_neon.o
-NEON-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_neon.o \
- arm/vp8dsp_neon.o
-NEON-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_neon.o \
- arm/vp8dsp_neon.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
index 6ba7592fe71..cc324d7dcac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/h264pred_init_arm.c
@@ -54,22 +54,23 @@ static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
if (high_depth)
return;
- if(chroma_format_idc == 1){
- h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
- h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
- if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
- h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
- h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
- if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 &&
- codec_id != AV_CODEC_ID_VP8) {
- h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon;
- h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
- h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
- h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
- h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
- h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
- h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
- }
+
+ if (chroma_format_idc <= 1) {
+ h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
+ h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
+ if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
+ h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
+ h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
+ if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 &&
+ codec_id != AV_CODEC_ID_VP8) {
+ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon;
+ h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
+ h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
+ h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
+ }
}
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_neon;
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_arm.c b/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_arm.c
index da5da068bea..0068e3f86c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_arm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_arm.c
@@ -64,7 +64,7 @@ av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
int cpu_flags = av_get_cpu_flags();
if (!avctx->lowres && !high_bit_depth) {
- if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & CODEC_FLAG_BITEXACT)) ||
+ if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
avctx->idct_algo == FF_IDCT_ARM) {
c->idct_put = j_rev_dct_arm_put;
c->idct_add = j_rev_dct_arm_add;
diff --git a/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_armv6.c b/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_armv6.c
index a3470a83df8..edf3070e15c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_armv6.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arm/idctdsp_init_armv6.c
@@ -33,7 +33,7 @@ av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
if (!avctx->lowres && !high_bit_depth) {
- if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & CODEC_FLAG_BITEXACT)) ||
+ if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6) {
c->idct_put = ff_simple_idct_put_armv6;
c->idct_add = ff_simple_idct_add_armv6;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ass.c b/chromium/third_party/ffmpeg/libavcodec/ass.c
index 468b8bb6cb3..227d571af1d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ass.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ass.c
@@ -66,7 +66,7 @@ int ff_ass_subtitle_header(AVCodecContext *avctx,
"\r\n"
"[Events]\r\n"
"Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
- !(avctx->flags & CODEC_FLAG_BITEXACT) ? AV_STRINGIFY(LIBAVCODEC_VERSION) : "",
+ !(avctx->flags & AV_CODEC_FLAG_BITEXACT) ? AV_STRINGIFY(LIBAVCODEC_VERSION) : "",
ASS_DEFAULT_PLAYRESX, ASS_DEFAULT_PLAYRESY,
font, font_size, color, color, back_color, back_color,
-bold, -italic, -underline, alignment);
diff --git a/chromium/third_party/ffmpeg/libavcodec/asvdec.c b/chromium/third_party/ffmpeg/libavcodec/asvdec.c
index 18e2faacd3a..036d56ed0d8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/asvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/asvdec.c
@@ -195,7 +195,7 @@ static inline void idct_put(ASV1Context *a, AVFrame *frame, int mb_x, int mb_y)
a->idsp.idct_put(dest_y + 8 * linesize, linesize, block[2]);
a->idsp.idct_put(dest_y + 8 * linesize + 8, linesize, block[3]);
- if (!(a->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(a->avctx->flags & AV_CODEC_FLAG_GRAY)) {
a->idsp.idct_put(dest_cb, frame->linesize[1], block[4]);
a->idsp.idct_put(dest_cr, frame->linesize[2], block[5]);
}
@@ -322,7 +322,7 @@ AVCodec ff_asv1_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -336,6 +336,6 @@ AVCodec ff_asv2_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/asvenc.c b/chromium/third_party/ffmpeg/libavcodec/asvenc.c
index d78fa47ed4e..d51df80331f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/asvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/asvenc.c
@@ -207,7 +207,7 @@ static inline void dct_get(ASV1Context *a, const AVFrame *frame,
for (i = 0; i < 4; i++)
a->fdsp.fdct(block[i]);
- if (!(a->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(a->avctx->flags & AV_CODEC_FLAG_GRAY)) {
a->pdsp.get_pixels(block[4], ptr_cb, frame->linesize[1]);
a->pdsp.get_pixels(block[5], ptr_cr, frame->linesize[2]);
for (i = 4; i < 6; i++)
@@ -265,7 +265,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
if ((ret = ff_alloc_packet2(avctx, pkt, a->mb_height * a->mb_width * MAX_MB_SIZE +
- FF_MIN_BUFFER_SIZE)) < 0)
+ AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
init_put_bits(&a->pb, pkt->data, pkt->size);
@@ -363,8 +363,7 @@ AVCodec ff_asv1_encoder = {
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
- FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -379,7 +378,6 @@ AVCodec ff_asv2_encoder = {
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
- FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac1.c b/chromium/third_party/ffmpeg/libavcodec/atrac1.c
index f965dcc20c0..b70cf4fd925 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac1.c
@@ -361,7 +361,7 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
ff_atrac_generate_tables();
- q->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
q->bands[0] = q->low;
q->bands[1] = q->mid;
@@ -386,7 +386,7 @@ AVCodec ff_atrac1_decoder = {
.init = atrac1_decode_init,
.close = atrac1_decode_end,
.decode = atrac1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3.c b/chromium/third_party/ffmpeg/libavcodec/atrac3.c
index 5aa3d8df1a1..4bdb63f98bf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3.c
@@ -886,7 +886,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!q->decoded_bytes_buffer)
return AVERROR(ENOMEM);
@@ -914,7 +914,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
}
ff_atrac_init_gain_compensation(&q->gainc_ctx, 4, 3);
- q->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
q->units = av_mallocz_array(avctx->channels, sizeof(*q->units));
if (!q->units || !q->fdsp) {
@@ -934,7 +934,7 @@ AVCodec ff_atrac3_decoder = {
.init = atrac3_decode_init,
.close = atrac3_decode_close,
.decode = atrac3_decode_frame,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c
index b4437f1a920..ec2b1ad3b21 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdec.c
@@ -171,7 +171,7 @@ static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
ctx->my_channel_layout = avctx->channel_layout;
ctx->ch_units = av_mallocz_array(ctx->num_channel_blocks, sizeof(*ctx->ch_units));
- ctx->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ ctx->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!ctx->ch_units || !ctx->fdsp) {
atrac3p_decode_close(avctx);
@@ -392,6 +392,7 @@ AVCodec ff_atrac3p_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3P,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(ATRAC3PContext),
.init = atrac3p_decode_init,
.close = atrac3p_decode_close,
diff --git a/chromium/third_party/ffmpeg/libavcodec/aura.c b/chromium/third_party/ffmpeg/libavcodec/aura.c
index 8d0f16a4de2..5f84d957fcf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aura.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aura.c
@@ -104,5 +104,5 @@ AVCodec ff_aura2_decoder = {
.id = AV_CODEC_ID_AURA2,
.init = aura_decode_init,
.decode = aura_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_aacdec.c b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_aacdec.c
index 622cc5c087a..837102f40a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_aacdec.c
@@ -32,54 +32,9 @@
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
-/*
- * supported tools
- *
- * Support? Name
- * N (code in SoC repo) gain control
- * Y block switching
- * Y window shapes - standard
- * N window shapes - Low Delay
- * Y filterbank - standard
- * N (code in SoC repo) filterbank - Scalable Sample Rate
- * Y Temporal Noise Shaping
- * Y Long Term Prediction
- * Y intensity stereo
- * Y channel coupling
- * Y frequency domain prediction
- * Y Perceptual Noise Substitution
- * Y Mid/Side stereo
- * N Scalable Inverse AAC Quantization
- * N Frequency Selective Switch
- * N upsampling filter
- * Y quantization & coding - AAC
- * N quantization & coding - TwinVQ
- * N quantization & coding - BSAC
- * N AAC Error Resilience tools
- * N Error Resilience payload syntax
- * N Error Protection tool
- * N CELP
- * N Silence Compression
- * N HVXC
- * N HVXC 4kbits/s VR
- * N Structured Audio tools
- * N Structured Audio Sample Bank Format
- * N MIDI
- * N Harmonic and Individual Lines plus Noise
- * N Text-To-Speech Interface
- * Y Spectral Band Replication
- * Y (not in this code) Layer-1
- * Y (not in this code) Layer-2
- * Y (not in this code) Layer-3
- * N SinuSoidal Coding (Transient, Sinusoid, Noise)
- * Y Parametric Stereo
- * N Direct Stream Transfer
- * Y Enhanced AAC Low Delay (ER AAC ELD)
- *
- * Note: - HE AAC v1 comprises LC AAC with Spectral Band Replication.
- * - HE AAC v2 comprises LC AAC with Spectral Band Replication and
- Parametric Stereo.
- */
+#define FFT_FLOAT 1
+#define FFT_FIXED_32 0
+#define USE_FIXED 0
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
@@ -113,929 +68,6 @@
# include "mips/aacdec_mips.h"
#endif
-static VLC vlc_scalefactors;
-static VLC vlc_spectral[11];
-
-static int output_configure(AACContext *ac,
- uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
- enum OCStatus oc_type, int get_new_frame);
-
-#define overread_err "Input buffer exhausted before END element found\n"
-
-static int count_channels(uint8_t (*layout)[3], int tags)
-{
- int i, sum = 0;
- for (i = 0; i < tags; i++) {
- int syn_ele = layout[i][0];
- int pos = layout[i][2];
- sum += (1 + (syn_ele == TYPE_CPE)) *
- (pos != AAC_CHANNEL_OFF && pos != AAC_CHANNEL_CC);
- }
- return sum;
-}
-
-/**
- * Check for the channel element in the current channel position configuration.
- * If it exists, make sure the appropriate element is allocated and map the
- * channel order to match the internal FFmpeg channel layout.
- *
- * @param che_pos current channel position configuration
- * @param type channel element type
- * @param id channel element id
- * @param channels count of the number of channels in the configuration
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static av_cold int che_configure(AACContext *ac,
- enum ChannelPosition che_pos,
- int type, int id, int *channels)
-{
- if (*channels >= MAX_CHANNELS)
- return AVERROR_INVALIDDATA;
- if (che_pos) {
- if (!ac->che[type][id]) {
- if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
- return AVERROR(ENOMEM);
- ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
- }
- if (type != TYPE_CCE) {
- if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) {
- av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
- return AVERROR_INVALIDDATA;
- }
- ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0];
- if (type == TYPE_CPE ||
- (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) {
- ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1];
- }
- }
- } else {
- if (ac->che[type][id])
- ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr);
- av_freep(&ac->che[type][id]);
- }
- return 0;
-}
-
-static int frame_configure_elements(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int type, id, ch, ret;
-
- /* set channel pointers to internal buffers by default */
- for (type = 0; type < 4; type++) {
- for (id = 0; id < MAX_ELEM_ID; id++) {
- ChannelElement *che = ac->che[type][id];
- if (che) {
- che->ch[0].ret = che->ch[0].ret_buf;
- che->ch[1].ret = che->ch[1].ret_buf;
- }
- }
- }
-
- /* get output buffer */
- av_frame_unref(ac->frame);
- if (!avctx->channels)
- return 1;
-
- ac->frame->nb_samples = 2048;
- if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
- return ret;
-
- /* map output channel pointers to AVFrame data */
- for (ch = 0; ch < avctx->channels; ch++) {
- if (ac->output_element[ch])
- ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
- }
-
- return 0;
-}
-
-struct elem_to_channel {
- uint64_t av_position;
- uint8_t syn_ele;
- uint8_t elem_id;
- uint8_t aac_position;
-};
-
-static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
- uint8_t (*layout_map)[3], int offset, uint64_t left,
- uint64_t right, int pos)
-{
- if (layout_map[offset][0] == TYPE_CPE) {
- e2c_vec[offset] = (struct elem_to_channel) {
- .av_position = left | right,
- .syn_ele = TYPE_CPE,
- .elem_id = layout_map[offset][1],
- .aac_position = pos
- };
- return 1;
- } else {
- e2c_vec[offset] = (struct elem_to_channel) {
- .av_position = left,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[offset][1],
- .aac_position = pos
- };
- e2c_vec[offset + 1] = (struct elem_to_channel) {
- .av_position = right,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[offset + 1][1],
- .aac_position = pos
- };
- return 2;
- }
-}
-
-static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
- int *current)
-{
- int num_pos_channels = 0;
- int first_cpe = 0;
- int sce_parity = 0;
- int i;
- for (i = *current; i < tags; i++) {
- if (layout_map[i][2] != pos)
- break;
- if (layout_map[i][0] == TYPE_CPE) {
- if (sce_parity) {
- if (pos == AAC_CHANNEL_FRONT && !first_cpe) {
- sce_parity = 0;
- } else {
- return -1;
- }
- }
- num_pos_channels += 2;
- first_cpe = 1;
- } else {
- num_pos_channels++;
- sce_parity ^= 1;
- }
- }
- if (sce_parity &&
- ((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE))
- return -1;
- *current = i;
- return num_pos_channels;
-}
-
-static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
-{
- int i, n, total_non_cc_elements;
- struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
- int num_front_channels, num_side_channels, num_back_channels;
- uint64_t layout;
-
- if (FF_ARRAY_ELEMS(e2c_vec) < tags)
- return 0;
-
- i = 0;
- num_front_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_FRONT, &i);
- if (num_front_channels < 0)
- return 0;
- num_side_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_SIDE, &i);
- if (num_side_channels < 0)
- return 0;
- num_back_channels =
- count_paired_channels(layout_map, tags, AAC_CHANNEL_BACK, &i);
- if (num_back_channels < 0)
- return 0;
-
- if (num_side_channels == 0 && num_back_channels >= 4) {
- num_side_channels = 2;
- num_back_channels -= 2;
- }
-
- i = 0;
- if (num_front_channels & 1) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_FRONT_CENTER,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_FRONT
- };
- i++;
- num_front_channels--;
- }
- if (num_front_channels >= 4) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_FRONT_LEFT_OF_CENTER,
- AV_CH_FRONT_RIGHT_OF_CENTER,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
- if (num_front_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_FRONT_LEFT,
- AV_CH_FRONT_RIGHT,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
- while (num_front_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_FRONT);
- num_front_channels -= 2;
- }
-
- if (num_side_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_SIDE_LEFT,
- AV_CH_SIDE_RIGHT,
- AAC_CHANNEL_FRONT);
- num_side_channels -= 2;
- }
- while (num_side_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_SIDE);
- num_side_channels -= 2;
- }
-
- while (num_back_channels >= 4) {
- i += assign_pair(e2c_vec, layout_map, i,
- UINT64_MAX,
- UINT64_MAX,
- AAC_CHANNEL_BACK);
- num_back_channels -= 2;
- }
- if (num_back_channels >= 2) {
- i += assign_pair(e2c_vec, layout_map, i,
- AV_CH_BACK_LEFT,
- AV_CH_BACK_RIGHT,
- AAC_CHANNEL_BACK);
- num_back_channels -= 2;
- }
- if (num_back_channels) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_BACK_CENTER,
- .syn_ele = TYPE_SCE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_BACK
- };
- i++;
- num_back_channels--;
- }
-
- if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = AV_CH_LOW_FREQUENCY,
- .syn_ele = TYPE_LFE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_LFE
- };
- i++;
- }
- while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
- e2c_vec[i] = (struct elem_to_channel) {
- .av_position = UINT64_MAX,
- .syn_ele = TYPE_LFE,
- .elem_id = layout_map[i][1],
- .aac_position = AAC_CHANNEL_LFE
- };
- i++;
- }
-
- // Must choose a stable sort
- total_non_cc_elements = n = i;
- do {
- int next_n = 0;
- for (i = 1; i < n; i++)
- if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
- FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
- next_n = i;
- }
- n = next_n;
- } while (n > 0);
-
- layout = 0;
- for (i = 0; i < total_non_cc_elements; i++) {
- layout_map[i][0] = e2c_vec[i].syn_ele;
- layout_map[i][1] = e2c_vec[i].elem_id;
- layout_map[i][2] = e2c_vec[i].aac_position;
- if (e2c_vec[i].av_position != UINT64_MAX) {
- layout |= e2c_vec[i].av_position;
- }
- }
-
- return layout;
-}
-
-/**
- * Save current output configuration if and only if it has been locked.
- */
-static void push_output_configuration(AACContext *ac) {
- if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
- ac->oc[0] = ac->oc[1];
- }
- ac->oc[1].status = OC_NONE;
-}
-
-/**
- * Restore the previous output configuration if and only if the current
- * configuration is unlocked.
- */
-static void pop_output_configuration(AACContext *ac) {
- if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
- ac->oc[1] = ac->oc[0];
- ac->avctx->channels = ac->oc[1].channels;
- ac->avctx->channel_layout = ac->oc[1].channel_layout;
- output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
- ac->oc[1].status, 0);
- }
-}
-
-/**
- * Configure output channel order based on the current program
- * configuration element.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int output_configure(AACContext *ac,
- uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
- enum OCStatus oc_type, int get_new_frame)
-{
- AVCodecContext *avctx = ac->avctx;
- int i, channels = 0, ret;
- uint64_t layout = 0;
- uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }};
- uint8_t type_counts[TYPE_END] = { 0 };
-
- if (ac->oc[1].layout_map != layout_map) {
- memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
- ac->oc[1].layout_map_tags = tags;
- }
- for (i = 0; i < tags; i++) {
- int type = layout_map[i][0];
- int id = layout_map[i][1];
- id_map[type][id] = type_counts[type]++;
- }
- // Try to sniff a reasonable channel order, otherwise output the
- // channels in the order the PCE declared them.
- if (avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE)
- layout = sniff_channel_order(layout_map, tags);
- for (i = 0; i < tags; i++) {
- int type = layout_map[i][0];
- int id = layout_map[i][1];
- int iid = id_map[type][id];
- int position = layout_map[i][2];
- // Allocate or free elements depending on if they are in the
- // current program configuration.
- ret = che_configure(ac, position, type, iid, &channels);
- if (ret < 0)
- return ret;
- ac->tag_che_map[type][id] = ac->che[type][iid];
- }
- if (ac->oc[1].m4ac.ps == 1 && channels == 2) {
- if (layout == AV_CH_FRONT_CENTER) {
- layout = AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT;
- } else {
- layout = 0;
- }
- }
-
- if (layout) avctx->channel_layout = layout;
- ac->oc[1].channel_layout = layout;
- avctx->channels = ac->oc[1].channels = channels;
- ac->oc[1].status = oc_type;
-
- if (get_new_frame) {
- if ((ret = frame_configure_elements(ac->avctx)) < 0)
- return ret;
- }
-
- return 0;
-}
-
-static void flush(AVCodecContext *avctx)
-{
- AACContext *ac= avctx->priv_data;
- int type, i, j;
-
- for (type = 3; type >= 0; type--) {
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *che = ac->che[type][i];
- if (che) {
- for (j = 0; j <= 1; j++) {
- memset(che->ch[j].saved, 0, sizeof(che->ch[j].saved));
- }
- }
- }
- }
-}
-
-/**
- * Set up channel positions based on a default channel configuration
- * as specified in table 1.17.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int set_default_channel_config(AVCodecContext *avctx,
- uint8_t (*layout_map)[3],
- int *tags,
- int channel_config)
-{
- if (channel_config < 1 || (channel_config > 7 && channel_config < 11) ||
- channel_config > 12) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid default channel configuration (%d)\n",
- channel_config);
- return AVERROR_INVALIDDATA;
- }
- *tags = tags_per_config[channel_config];
- memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
- *tags * sizeof(*layout_map));
-
- /*
- * AAC specification has 7.1(wide) as a default layout for 8-channel streams.
- * However, at least Nero AAC encoder encodes 7.1 streams using the default
- * channel config 7, mapping the side channels of the original audio stream
- * to the second AAC_CHANNEL_FRONT pair in the AAC stream. Similarly, e.g. FAAD
- * decodes the second AAC_CHANNEL_FRONT pair as side channels, therefore decoding
- * the incorrect streams as if they were correct (and as the encoder intended).
- *
- * As actual intended 7.1(wide) streams are very rare, default to assuming a
- * 7.1 layout was intended.
- */
- if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
- av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
- " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
- " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
- layout_map[2][2] = AAC_CHANNEL_SIDE;
- }
-
- return 0;
-}
-
-static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
-{
- /* For PCE based channel configurations map the channels solely based
- * on tags. */
- if (!ac->oc[1].m4ac.chan_config) {
- return ac->tag_che_map[type][elem_id];
- }
- // Allow single CPE stereo files to be signalled with mono configuration.
- if (!ac->tags_mapped && type == TYPE_CPE &&
- ac->oc[1].m4ac.chan_config == 1) {
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags;
- push_output_configuration(ac);
-
- av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
-
- if (set_default_channel_config(ac->avctx, layout_map,
- &layout_map_tags, 2) < 0)
- return NULL;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 1) < 0)
- return NULL;
-
- ac->oc[1].m4ac.chan_config = 2;
- ac->oc[1].m4ac.ps = 0;
- }
- // And vice-versa
- if (!ac->tags_mapped && type == TYPE_SCE &&
- ac->oc[1].m4ac.chan_config == 2) {
- uint8_t layout_map[MAX_ELEM_ID * 4][3];
- int layout_map_tags;
- push_output_configuration(ac);
-
- av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
-
- if (set_default_channel_config(ac->avctx, layout_map,
- &layout_map_tags, 1) < 0)
- return NULL;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 1) < 0)
- return NULL;
-
- ac->oc[1].m4ac.chan_config = 1;
- if (ac->oc[1].m4ac.sbr)
- ac->oc[1].m4ac.ps = -1;
- }
- /* For indexed channel configurations map the channels solely based
- * on position. */
- switch (ac->oc[1].m4ac.chan_config) {
- case 12:
- case 7:
- if (ac->tags_mapped == 3 && type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
- }
- case 11:
- if (ac->tags_mapped == 2 &&
- ac->oc[1].m4ac.chan_config == 11 &&
- type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
- }
- case 6:
- /* Some streams incorrectly code 5.1 audio as
- * SCE[0] CPE[0] CPE[1] SCE[1]
- * instead of
- * SCE[0] CPE[0] CPE[1] LFE[0].
- * If we seem to have encountered such a stream, transfer
- * the LFE[0] element to the SCE[1]'s mapping */
- if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
- if (!ac->warned_remapping_once && (type != TYPE_LFE || elem_id != 0)) {
- av_log(ac->avctx, AV_LOG_WARNING,
- "This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n",
- type == TYPE_SCE ? "SCE" : "LFE", elem_id);
- ac->warned_remapping_once++;
- }
- ac->tags_mapped++;
- return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
- }
- case 5:
- if (ac->tags_mapped == 2 && type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
- }
- case 4:
- /* Some streams incorrectly code 4.0 audio as
- * SCE[0] CPE[0] LFE[0]
- * instead of
- * SCE[0] CPE[0] SCE[1].
- * If we seem to have encountered such a stream, transfer
- * the SCE[1] element to the LFE[0]'s mapping */
- if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
- if (!ac->warned_remapping_once && (type != TYPE_SCE || elem_id != 1)) {
- av_log(ac->avctx, AV_LOG_WARNING,
- "This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n",
- type == TYPE_SCE ? "SCE" : "LFE", elem_id);
- ac->warned_remapping_once++;
- }
- ac->tags_mapped++;
- return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
- }
- if (ac->tags_mapped == 2 &&
- ac->oc[1].m4ac.chan_config == 4 &&
- type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
- }
- case 3:
- case 2:
- if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) &&
- type == TYPE_CPE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
- } else if (ac->oc[1].m4ac.chan_config == 2) {
- return NULL;
- }
- case 1:
- if (!ac->tags_mapped && type == TYPE_SCE) {
- ac->tags_mapped++;
- return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0];
- }
- default:
- return NULL;
- }
-}
-
-/**
- * Decode an array of 4 bit element IDs, optionally interleaved with a
- * stereo/mono switching bit.
- *
- * @param type speaker type/position for these channels
- */
-static void decode_channel_map(uint8_t layout_map[][3],
- enum ChannelPosition type,
- GetBitContext *gb, int n)
-{
- while (n--) {
- enum RawDataBlockType syn_ele;
- switch (type) {
- case AAC_CHANNEL_FRONT:
- case AAC_CHANNEL_BACK:
- case AAC_CHANNEL_SIDE:
- syn_ele = get_bits1(gb);
- break;
- case AAC_CHANNEL_CC:
- skip_bits1(gb);
- syn_ele = TYPE_CCE;
- break;
- case AAC_CHANNEL_LFE:
- syn_ele = TYPE_LFE;
- break;
- default:
- // AAC_CHANNEL_OFF has no channel map
- av_assert0(0);
- }
- layout_map[0][0] = syn_ele;
- layout_map[0][1] = get_bits(gb, 4);
- layout_map[0][2] = type;
- layout_map++;
- }
-}
-
-/**
- * Decode program configuration element; reference: table 4.2.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
- uint8_t (*layout_map)[3],
- GetBitContext *gb)
-{
- int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
- int sampling_index;
- int comment_len;
- int tags;
-
- skip_bits(gb, 2); // object_type
-
- sampling_index = get_bits(gb, 4);
- if (m4ac->sampling_index != sampling_index)
- av_log(avctx, AV_LOG_WARNING,
- "Sample rate index in program config element does not "
- "match the sample rate index configured by the container.\n");
-
- num_front = get_bits(gb, 4);
- num_side = get_bits(gb, 4);
- num_back = get_bits(gb, 4);
- num_lfe = get_bits(gb, 2);
- num_assoc_data = get_bits(gb, 3);
- num_cc = get_bits(gb, 4);
-
- if (get_bits1(gb))
- skip_bits(gb, 4); // mono_mixdown_tag
- if (get_bits1(gb))
- skip_bits(gb, 4); // stereo_mixdown_tag
-
- if (get_bits1(gb))
- skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround
-
- if (get_bits_left(gb) < 4 * (num_front + num_side + num_back + num_lfe + num_assoc_data + num_cc)) {
- av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
- return -1;
- }
- decode_channel_map(layout_map , AAC_CHANNEL_FRONT, gb, num_front);
- tags = num_front;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_SIDE, gb, num_side);
- tags += num_side;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_BACK, gb, num_back);
- tags += num_back;
- decode_channel_map(layout_map + tags, AAC_CHANNEL_LFE, gb, num_lfe);
- tags += num_lfe;
-
- skip_bits_long(gb, 4 * num_assoc_data);
-
- decode_channel_map(layout_map + tags, AAC_CHANNEL_CC, gb, num_cc);
- tags += num_cc;
-
- align_get_bits(gb);
-
- /* comment field, first byte is length */
- comment_len = get_bits(gb, 8) * 8;
- if (get_bits_left(gb) < comment_len) {
- av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, comment_len);
- return tags;
-}
-
-/**
- * Decode GA "General Audio" specific configuration; reference: table 4.1.
- *
- * @param ac pointer to AACContext, may be null
- * @param avctx pointer to AVCCodecContext, used for logging
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
- GetBitContext *gb,
- MPEG4AudioConfig *m4ac,
- int channel_config)
-{
- int extension_flag, ret, ep_config, res_flags;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags = 0;
-
- if (get_bits1(gb)) { // frameLengthFlag
- avpriv_request_sample(avctx, "960/120 MDCT window");
- return AVERROR_PATCHWELCOME;
- }
- m4ac->frame_length_short = 0;
-
- if (get_bits1(gb)) // dependsOnCoreCoder
- skip_bits(gb, 14); // coreCoderDelay
- extension_flag = get_bits1(gb);
-
- if (m4ac->object_type == AOT_AAC_SCALABLE ||
- m4ac->object_type == AOT_ER_AAC_SCALABLE)
- skip_bits(gb, 3); // layerNr
-
- if (channel_config == 0) {
- skip_bits(gb, 4); // element_instance_tag
- tags = decode_pce(avctx, m4ac, layout_map, gb);
- if (tags < 0)
- return tags;
- } else {
- if ((ret = set_default_channel_config(avctx, layout_map,
- &tags, channel_config)))
- return ret;
- }
-
- if (count_channels(layout_map, tags) > 1) {
- m4ac->ps = 0;
- } else if (m4ac->sbr == 1 && m4ac->ps == -1)
- m4ac->ps = 1;
-
- if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
- return ret;
-
- if (extension_flag) {
- switch (m4ac->object_type) {
- case AOT_ER_BSAC:
- skip_bits(gb, 5); // numOfSubFrame
- skip_bits(gb, 11); // layer_length
- break;
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_SCALABLE:
- case AOT_ER_AAC_LD:
- res_flags = get_bits(gb, 3);
- if (res_flags) {
- avpriv_report_missing_feature(avctx,
- "AAC data resilience (flags %x)",
- res_flags);
- return AVERROR_PATCHWELCOME;
- }
- break;
- }
- skip_bits1(gb); // extensionFlag3 (TBD in version 3)
- }
- switch (m4ac->object_type) {
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_SCALABLE:
- case AOT_ER_AAC_LD:
- ep_config = get_bits(gb, 2);
- if (ep_config) {
- avpriv_report_missing_feature(avctx,
- "epConfig %d", ep_config);
- return AVERROR_PATCHWELCOME;
- }
- }
- return 0;
-}
-
-static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
- GetBitContext *gb,
- MPEG4AudioConfig *m4ac,
- int channel_config)
-{
- int ret, ep_config, res_flags;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags = 0;
- const int ELDEXT_TERM = 0;
-
- m4ac->ps = 0;
- m4ac->sbr = 0;
-
- m4ac->frame_length_short = get_bits1(gb);
- res_flags = get_bits(gb, 3);
- if (res_flags) {
- avpriv_report_missing_feature(avctx,
- "AAC data resilience (flags %x)",
- res_flags);
- return AVERROR_PATCHWELCOME;
- }
-
- if (get_bits1(gb)) { // ldSbrPresentFlag
- avpriv_report_missing_feature(avctx,
- "Low Delay SBR");
- return AVERROR_PATCHWELCOME;
- }
-
- while (get_bits(gb, 4) != ELDEXT_TERM) {
- int len = get_bits(gb, 4);
- if (len == 15)
- len += get_bits(gb, 8);
- if (len == 15 + 255)
- len += get_bits(gb, 16);
- if (get_bits_left(gb) < len * 8 + 4) {
- av_log(avctx, AV_LOG_ERROR, overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, 8 * len);
- }
-
- if ((ret = set_default_channel_config(avctx, layout_map,
- &tags, channel_config)))
- return ret;
-
- if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
- return ret;
-
- ep_config = get_bits(gb, 2);
- if (ep_config) {
- avpriv_report_missing_feature(avctx,
- "epConfig %d", ep_config);
- return AVERROR_PATCHWELCOME;
- }
- return 0;
-}
-
-/**
- * Decode audio specific configuration; reference: table 1.13.
- *
- * @param ac pointer to AACContext, may be null
- * @param avctx pointer to AVCCodecContext, used for logging
- * @param m4ac pointer to MPEG4AudioConfig, used for parsing
- * @param data pointer to buffer holding an audio specific config
- * @param bit_size size of audio specific config or data in bits
- * @param sync_extension look for an appended sync extension
- *
- * @return Returns error status or number of consumed bits. <0 - error
- */
-static int decode_audio_specific_config(AACContext *ac,
- AVCodecContext *avctx,
- MPEG4AudioConfig *m4ac,
- const uint8_t *data, int bit_size,
- int sync_extension)
-{
- GetBitContext gb;
- int i, ret;
-
- ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
- for (i = 0; i < bit_size >> 3; i++)
- ff_dlog(avctx, "%02x ", data[i]);
- ff_dlog(avctx, "\n");
-
- if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
- return ret;
-
- if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,
- sync_extension)) < 0)
- return AVERROR_INVALIDDATA;
- if (m4ac->sampling_index > 12) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid sampling rate index %d\n",
- m4ac->sampling_index);
- return AVERROR_INVALIDDATA;
- }
- if (m4ac->object_type == AOT_ER_AAC_LD &&
- (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid low delay sampling rate index %d\n",
- m4ac->sampling_index);
- return AVERROR_INVALIDDATA;
- }
-
- skip_bits_long(&gb, i);
-
- switch (m4ac->object_type) {
- case AOT_AAC_MAIN:
- case AOT_AAC_LC:
- case AOT_AAC_LTP:
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LD:
- if ((ret = decode_ga_specific_config(ac, avctx, &gb,
- m4ac, m4ac->chan_config)) < 0)
- return ret;
- break;
- case AOT_ER_AAC_ELD:
- if ((ret = decode_eld_specific_config(ac, avctx, &gb,
- m4ac, m4ac->chan_config)) < 0)
- return ret;
- break;
- default:
- avpriv_report_missing_feature(avctx,
- "Audio object type %s%d",
- m4ac->sbr == 1 ? "SBR+" : "",
- m4ac->object_type);
- return AVERROR(ENOSYS);
- }
-
- ff_dlog(avctx,
- "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
- m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
- m4ac->sample_rate, m4ac->sbr,
- m4ac->ps);
-
- return get_bits_count(&gb);
-}
-
-/**
- * linear congruential pseudorandom number generator
- *
- * @param previous_val pointer to the current state of the generator
- *
- * @return Returns a 32-bit pseudorandom integer
- */
-static av_always_inline int lcg_random(unsigned previous_val)
-{
- union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
- return v.s;
-}
-
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
@@ -1046,514 +78,6 @@ static av_always_inline void reset_predict_state(PredictorState *ps)
ps->var1 = 1.0f;
}
-static void reset_all_predictors(PredictorState *ps)
-{
- int i;
- for (i = 0; i < MAX_PREDICTORS; i++)
- reset_predict_state(&ps[i]);
-}
-
-static int sample_rate_idx (int rate)
-{
- if (92017 <= rate) return 0;
- else if (75132 <= rate) return 1;
- else if (55426 <= rate) return 2;
- else if (46009 <= rate) return 3;
- else if (37566 <= rate) return 4;
- else if (27713 <= rate) return 5;
- else if (23004 <= rate) return 6;
- else if (18783 <= rate) return 7;
- else if (13856 <= rate) return 8;
- else if (11502 <= rate) return 9;
- else if (9391 <= rate) return 10;
- else return 11;
-}
-
-static void reset_predictor_group(PredictorState *ps, int group_num)
-{
- int i;
- for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
- reset_predict_state(&ps[i]);
-}
-
-#define AAC_INIT_VLC_STATIC(num, size) \
- INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
- ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]), \
- sizeof(ff_aac_spectral_bits[num][0]), \
- ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
- sizeof(ff_aac_spectral_codes[num][0]), \
- size);
-
-static void aacdec_init(AACContext *ac);
-
-static av_cold int aac_decode_init(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int ret;
-
- ac->avctx = avctx;
- ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
-
- aacdec_init(ac);
-
- avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
- if (avctx->extradata_size > 0) {
- if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
- avctx->extradata,
- avctx->extradata_size * 8,
- 1)) < 0)
- return ret;
- } else {
- int sr, i;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags;
-
- sr = sample_rate_idx(avctx->sample_rate);
- ac->oc[1].m4ac.sampling_index = sr;
- ac->oc[1].m4ac.channels = avctx->channels;
- ac->oc[1].m4ac.sbr = -1;
- ac->oc[1].m4ac.ps = -1;
-
- for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
- if (ff_mpeg4audio_channels[i] == avctx->channels)
- break;
- if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
- i = 0;
- }
- ac->oc[1].m4ac.chan_config = i;
-
- if (ac->oc[1].m4ac.chan_config) {
- int ret = set_default_channel_config(avctx, layout_map,
- &layout_map_tags, ac->oc[1].m4ac.chan_config);
- if (!ret)
- output_configure(ac, layout_map, layout_map_tags,
- OC_GLOBAL_HDR, 0);
- else if (avctx->err_recognition & AV_EF_EXPLODE)
- return AVERROR_INVALIDDATA;
- }
- }
-
- if (avctx->channels > MAX_CHANNELS) {
- av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
- return AVERROR_INVALIDDATA;
- }
-
- AAC_INIT_VLC_STATIC( 0, 304);
- AAC_INIT_VLC_STATIC( 1, 270);
- AAC_INIT_VLC_STATIC( 2, 550);
- AAC_INIT_VLC_STATIC( 3, 300);
- AAC_INIT_VLC_STATIC( 4, 328);
- AAC_INIT_VLC_STATIC( 5, 294);
- AAC_INIT_VLC_STATIC( 6, 306);
- AAC_INIT_VLC_STATIC( 7, 268);
- AAC_INIT_VLC_STATIC( 8, 510);
- AAC_INIT_VLC_STATIC( 9, 366);
- AAC_INIT_VLC_STATIC(10, 462);
-
- ff_aac_sbr_init();
-
- ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
- if (!ac->fdsp) {
- return AVERROR(ENOMEM);
- }
-
- ac->random_state = 0x1f2e3d4c;
-
- ff_aac_tableinit();
-
- INIT_VLC_STATIC(&vlc_scalefactors, 7,
- FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
- ff_aac_scalefactor_bits,
- sizeof(ff_aac_scalefactor_bits[0]),
- sizeof(ff_aac_scalefactor_bits[0]),
- ff_aac_scalefactor_code,
- sizeof(ff_aac_scalefactor_code[0]),
- sizeof(ff_aac_scalefactor_code[0]),
- 352);
-
- ff_mdct_init(&ac->mdct, 11, 1, 1.0 / (32768.0 * 1024.0));
- ff_mdct_init(&ac->mdct_ld, 10, 1, 1.0 / (32768.0 * 512.0));
- ff_mdct_init(&ac->mdct_small, 8, 1, 1.0 / (32768.0 * 128.0));
- ff_mdct_init(&ac->mdct_ltp, 11, 0, -2.0 * 32768.0);
- ret = ff_imdct15_init(&ac->mdct480, 5);
- if (ret < 0)
- return ret;
-
- // window initialization
- ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
- ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
- ff_init_ff_sine_windows(10);
- ff_init_ff_sine_windows( 9);
- ff_init_ff_sine_windows( 7);
-
- cbrt_tableinit();
-
- return 0;
-}
-
-/**
- * Skip data_stream_element; reference: table 4.10.
- */
-static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
-{
- int byte_align = get_bits1(gb);
- int count = get_bits(gb, 8);
- if (count == 255)
- count += get_bits(gb, 8);
- if (byte_align)
- align_get_bits(gb);
-
- if (get_bits_left(gb) < 8 * count) {
- av_log(ac->avctx, AV_LOG_ERROR, "skip_data_stream_element: "overread_err);
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(gb, 8 * count);
- return 0;
-}
-
-static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
- GetBitContext *gb)
-{
- int sfb;
- if (get_bits1(gb)) {
- ics->predictor_reset_group = get_bits(gb, 5);
- if (ics->predictor_reset_group == 0 ||
- ics->predictor_reset_group > 30) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Invalid Predictor Reset Group.\n");
- return AVERROR_INVALIDDATA;
- }
- }
- for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]); sfb++) {
- ics->prediction_used[sfb] = get_bits1(gb);
- }
- return 0;
-}
-
-/**
- * Decode Long Term Prediction data; reference: table 4.xx.
- */
-static void decode_ltp(LongTermPrediction *ltp,
- GetBitContext *gb, uint8_t max_sfb)
-{
- int sfb;
-
- ltp->lag = get_bits(gb, 11);
- ltp->coef = ltp_coef[get_bits(gb, 3)];
- for (sfb = 0; sfb < FFMIN(max_sfb, MAX_LTP_LONG_SFB); sfb++)
- ltp->used[sfb] = get_bits1(gb);
-}
-
-/**
- * Decode Individual Channel Stream info; reference: table 4.6.
- */
-static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
- GetBitContext *gb)
-{
- const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
- const int aot = m4ac->object_type;
- const int sampling_index = m4ac->sampling_index;
- if (aot != AOT_ER_AAC_ELD) {
- if (get_bits1(gb)) {
- av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
- if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
- return AVERROR_INVALIDDATA;
- }
- ics->window_sequence[1] = ics->window_sequence[0];
- ics->window_sequence[0] = get_bits(gb, 2);
- if (aot == AOT_ER_AAC_LD &&
- ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "AAC LD is only defined for ONLY_LONG_SEQUENCE but "
- "window sequence %d found.\n", ics->window_sequence[0]);
- ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
- return AVERROR_INVALIDDATA;
- }
- ics->use_kb_window[1] = ics->use_kb_window[0];
- ics->use_kb_window[0] = get_bits1(gb);
- }
- ics->num_window_groups = 1;
- ics->group_len[0] = 1;
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- int i;
- ics->max_sfb = get_bits(gb, 4);
- for (i = 0; i < 7; i++) {
- if (get_bits1(gb)) {
- ics->group_len[ics->num_window_groups - 1]++;
- } else {
- ics->num_window_groups++;
- ics->group_len[ics->num_window_groups - 1] = 1;
- }
- }
- ics->num_windows = 8;
- ics->swb_offset = ff_swb_offset_128[sampling_index];
- ics->num_swb = ff_aac_num_swb_128[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_128[sampling_index];
- ics->predictor_present = 0;
- } else {
- ics->max_sfb = get_bits(gb, 6);
- ics->num_windows = 1;
- if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
- if (m4ac->frame_length_short) {
- ics->swb_offset = ff_swb_offset_480[sampling_index];
- ics->num_swb = ff_aac_num_swb_480[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_480[sampling_index];
- } else {
- ics->swb_offset = ff_swb_offset_512[sampling_index];
- ics->num_swb = ff_aac_num_swb_512[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_512[sampling_index];
- }
- if (!ics->num_swb || !ics->swb_offset)
- return AVERROR_BUG;
- } else {
- ics->swb_offset = ff_swb_offset_1024[sampling_index];
- ics->num_swb = ff_aac_num_swb_1024[sampling_index];
- ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index];
- }
- if (aot != AOT_ER_AAC_ELD) {
- ics->predictor_present = get_bits1(gb);
- ics->predictor_reset_group = 0;
- }
- if (ics->predictor_present) {
- if (aot == AOT_AAC_MAIN) {
- if (decode_prediction(ac, ics, gb)) {
- goto fail;
- }
- } else if (aot == AOT_AAC_LC ||
- aot == AOT_ER_AAC_LC) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Prediction is not allowed in AAC-LC.\n");
- goto fail;
- } else {
- if (aot == AOT_ER_AAC_LD) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "LTP in ER AAC LD not yet implemented.\n");
- return AVERROR_PATCHWELCOME;
- }
- if ((ics->ltp.present = get_bits(gb, 1)))
- decode_ltp(&ics->ltp, gb, ics->max_sfb);
- }
- }
- }
-
- if (ics->max_sfb > ics->num_swb) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Number of scalefactor bands in group (%d) "
- "exceeds limit (%d).\n",
- ics->max_sfb, ics->num_swb);
- goto fail;
- }
-
- return 0;
-fail:
- ics->max_sfb = 0;
- return AVERROR_INVALIDDATA;
-}
-
-/**
- * Decode band types (section_data payload); reference: table 4.46.
- *
- * @param band_type array of the used band type
- * @param band_type_run_end array of the last scalefactor band of a band type run
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_band_types(AACContext *ac, enum BandType band_type[120],
- int band_type_run_end[120], GetBitContext *gb,
- IndividualChannelStream *ics)
-{
- int g, idx = 0;
- const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;
- for (g = 0; g < ics->num_window_groups; g++) {
- int k = 0;
- while (k < ics->max_sfb) {
- uint8_t sect_end = k;
- int sect_len_incr;
- int sect_band_type = get_bits(gb, 4);
- if (sect_band_type == 12) {
- av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
- return AVERROR_INVALIDDATA;
- }
- do {
- sect_len_incr = get_bits(gb, bits);
- sect_end += sect_len_incr;
- if (get_bits_left(gb) < 0) {
- av_log(ac->avctx, AV_LOG_ERROR, "decode_band_types: "overread_err);
- return AVERROR_INVALIDDATA;
- }
- if (sect_end > ics->max_sfb) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Number of bands (%d) exceeds limit (%d).\n",
- sect_end, ics->max_sfb);
- return AVERROR_INVALIDDATA;
- }
- } while (sect_len_incr == (1 << bits) - 1);
- for (; k < sect_end; k++) {
- band_type [idx] = sect_band_type;
- band_type_run_end[idx++] = sect_end;
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode scalefactors; reference: table 4.47.
- *
- * @param global_gain first scalefactor value as scalefactors are differentially coded
- * @param band_type array of the used band type
- * @param band_type_run_end array of the last scalefactor band of a band type run
- * @param sf array of scalefactors or intensity stereo positions
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
- unsigned int global_gain,
- IndividualChannelStream *ics,
- enum BandType band_type[120],
- int band_type_run_end[120])
-{
- int g, i, idx = 0;
- int offset[3] = { global_gain, global_gain - NOISE_OFFSET, 0 };
- int clipped_offset;
- int noise_flag = 1;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb;) {
- int run_end = band_type_run_end[idx];
- if (band_type[idx] == ZERO_BT) {
- for (; i < run_end; i++, idx++)
- sf[idx] = 0.0;
- } else if ((band_type[idx] == INTENSITY_BT) ||
- (band_type[idx] == INTENSITY_BT2)) {
- for (; i < run_end; i++, idx++) {
- offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- clipped_offset = av_clip(offset[2], -155, 100);
- if (offset[2] != clipped_offset) {
- avpriv_request_sample(ac->avctx,
- "If you heard an audible artifact, there may be a bug in the decoder. "
- "Clipped intensity stereo position (%d -> %d)",
- offset[2], clipped_offset);
- }
- sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
- }
- } else if (band_type[idx] == NOISE_BT) {
- for (; i < run_end; i++, idx++) {
- if (noise_flag-- > 0)
- offset[1] += get_bits(gb, NOISE_PRE_BITS) - NOISE_PRE;
- else
- offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- clipped_offset = av_clip(offset[1], -100, 155);
- if (offset[1] != clipped_offset) {
- avpriv_request_sample(ac->avctx,
- "If you heard an audible artifact, there may be a bug in the decoder. "
- "Clipped noise gain (%d -> %d)",
- offset[1], clipped_offset);
- }
- sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
- }
- } else {
- for (; i < run_end; i++, idx++) {
- offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - SCALE_DIFF_ZERO;
- if (offset[0] > 255U) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Scalefactor (%d) out of range.\n", offset[0]);
- return AVERROR_INVALIDDATA;
- }
- sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode pulse data; reference: table 4.7.
- */
-static int decode_pulses(Pulse *pulse, GetBitContext *gb,
- const uint16_t *swb_offset, int num_swb)
-{
- int i, pulse_swb;
- pulse->num_pulse = get_bits(gb, 2) + 1;
- pulse_swb = get_bits(gb, 6);
- if (pulse_swb >= num_swb)
- return -1;
- pulse->pos[0] = swb_offset[pulse_swb];
- pulse->pos[0] += get_bits(gb, 5);
- if (pulse->pos[0] >= swb_offset[num_swb])
- return -1;
- pulse->amp[0] = get_bits(gb, 4);
- for (i = 1; i < pulse->num_pulse; i++) {
- pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];
- if (pulse->pos[i] >= swb_offset[num_swb])
- return -1;
- pulse->amp[i] = get_bits(gb, 4);
- }
- return 0;
-}
-
-/**
- * Decode Temporal Noise Shaping data; reference: table 4.48.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
- GetBitContext *gb, const IndividualChannelStream *ics)
-{
- int w, filt, i, coef_len, coef_res, coef_compress;
- const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE;
- const int tns_max_order = is8 ? 7 : ac->oc[1].m4ac.object_type == AOT_AAC_MAIN ? 20 : 12;
- for (w = 0; w < ics->num_windows; w++) {
- if ((tns->n_filt[w] = get_bits(gb, 2 - is8))) {
- coef_res = get_bits1(gb);
-
- for (filt = 0; filt < tns->n_filt[w]; filt++) {
- int tmp2_idx;
- tns->length[w][filt] = get_bits(gb, 6 - 2 * is8);
-
- if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "TNS filter order %d is greater than maximum %d.\n",
- tns->order[w][filt], tns_max_order);
- tns->order[w][filt] = 0;
- return AVERROR_INVALIDDATA;
- }
- if (tns->order[w][filt]) {
- tns->direction[w][filt] = get_bits1(gb);
- coef_compress = get_bits1(gb);
- coef_len = coef_res + 3 - coef_compress;
- tmp2_idx = 2 * coef_compress + coef_res;
-
- for (i = 0; i < tns->order[w][filt]; i++)
- tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Decode Mid/Side data; reference: table 4.54.
- *
- * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
- * [1] mask is decoded from bitstream; [2] mask is all 1s;
- * [3] reserved for scalable AAC
- */
-static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
- int ms_present)
-{
- int idx;
- int max_idx = cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
- if (ms_present == 1) {
- for (idx = 0; idx < max_idx; idx++)
- cpe->ms_mask[idx] = get_bits1(gb);
- } else if (ms_present == 2) {
- memset(cpe->ms_mask, 1, max_idx * sizeof(cpe->ms_mask[0]));
- }
-}
-
#ifndef VMUL2
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
const float *scale)
@@ -1622,233 +146,6 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
}
#endif
-/**
- * Decode spectral data; reference: table 4.50.
- * Dequantize and scale spectral data; reference: 4.6.3.3.
- *
- * @param coef array of dequantized, scaled spectral data
- * @param sf array of scalefactors or intensity stereo positions
- * @param pulse_present set if pulses are present
- * @param pulse pointer to pulse data struct
- * @param band_type array of the used band type
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
- GetBitContext *gb, const float sf[120],
- int pulse_present, const Pulse *pulse,
- const IndividualChannelStream *ics,
- enum BandType band_type[120])
-{
- int i, k, g, idx = 0;
- const int c = 1024 / ics->num_windows;
- const uint16_t *offsets = ics->swb_offset;
- float *coef_base = coef;
-
- for (g = 0; g < ics->num_windows; g++)
- memset(coef + g * 128 + offsets[ics->max_sfb], 0,
- sizeof(float) * (c - offsets[ics->max_sfb]));
-
- for (g = 0; g < ics->num_window_groups; g++) {
- unsigned g_len = ics->group_len[g];
-
- for (i = 0; i < ics->max_sfb; i++, idx++) {
- const unsigned cbt_m1 = band_type[idx] - 1;
- float *cfo = coef + offsets[i];
- int off_len = offsets[i + 1] - offsets[i];
- int group;
-
- if (cbt_m1 >= INTENSITY_BT2 - 1) {
- for (group = 0; group < g_len; group++, cfo+=128) {
- memset(cfo, 0, off_len * sizeof(float));
- }
- } else if (cbt_m1 == NOISE_BT - 1) {
- for (group = 0; group < g_len; group++, cfo+=128) {
- float scale;
- float band_energy;
-
- 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);
- }
- } else {
- const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
- const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
- VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
- OPEN_READER(re, gb);
-
- switch (cbt_m1 >> 1) {
- case 0:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned cb_idx;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- cf = VMUL4(cf, vq, cb_idx, sf + idx);
- } while (len -= 4);
- }
- break;
-
- case 1:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned nnz;
- unsigned cb_idx;
- uint32_t bits;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 8 & 15;
- bits = nnz ? GET_CACHE(re, gb) : 0;
- LAST_SKIP_BITS(re, gb, nnz);
- cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
- } while (len -= 4);
- }
- break;
-
- case 2:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned cb_idx;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- cf = VMUL2(cf, vq, cb_idx, sf + idx);
- } while (len -= 2);
- }
- break;
-
- case 3:
- case 4:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- int len = off_len;
-
- do {
- int code;
- unsigned nnz;
- unsigned cb_idx;
- unsigned sign;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 8 & 15;
- sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
- LAST_SKIP_BITS(re, gb, nnz);
- cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
- } while (len -= 2);
- }
- break;
-
- default:
- for (group = 0; group < g_len; group++, cfo+=128) {
- float *cf = cfo;
- uint32_t *icf = (uint32_t *) cf;
- int len = off_len;
-
- do {
- int code;
- unsigned nzt, nnz;
- unsigned cb_idx;
- uint32_t bits;
- int j;
-
- UPDATE_CACHE(re, gb);
- GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (!code) {
- *icf++ = 0;
- *icf++ = 0;
- continue;
- }
-
- cb_idx = cb_vector_idx[code];
- nnz = cb_idx >> 12;
- nzt = cb_idx >> 8;
- bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
- LAST_SKIP_BITS(re, gb, nnz);
-
- for (j = 0; j < 2; j++) {
- if (nzt & 1<<j) {
- uint32_t b;
- int n;
- /* The total length of escape_sequence must be < 22 bits according
- to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
- UPDATE_CACHE(re, gb);
- b = GET_CACHE(re, gb);
- b = 31 - av_log2(~b);
-
- if (b > 8) {
- av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
- return AVERROR_INVALIDDATA;
- }
-
- SKIP_BITS(re, gb, b + 1);
- b += 4;
- n = (1 << b) + SHOW_UBITS(re, gb, b);
- LAST_SKIP_BITS(re, gb, b);
- *icf++ = cbrt_tab[n] | (bits & 1U<<31);
- bits <<= 1;
- } else {
- unsigned v = ((const uint32_t*)vq)[cb_idx & 15];
- *icf++ = (bits & 1U<<31) | v;
- bits <<= !!v;
- }
- cb_idx >>= 4;
- }
- } while (len -= 2);
-
- ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
- }
- }
-
- CLOSE_READER(re, gb);
- }
- }
- coef += g_len << 7;
- }
-
- if (pulse_present) {
- idx = 0;
- for (i = 0; i < pulse->num_pulse; i++) {
- float co = coef_base[ pulse->pos[i] ];
- while (offsets[idx + 1] <= pulse->pos[i])
- idx++;
- if (band_type[idx] != NOISE_BT && sf[idx]) {
- float ico = -pulse->amp[i];
- if (co) {
- co /= sf[idx];
- ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
- }
- coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
- }
- }
- }
- return 0;
-}
-
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
@@ -1905,771 +202,6 @@ static av_always_inline void predict(PredictorState *ps, float *coef,
}
/**
- * Apply AAC-Main style frequency domain prediction.
- */
-static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
-{
- int sfb, k;
-
- if (!sce->ics.predictor_initialized) {
- reset_all_predictors(sce->predictor_state);
- sce->ics.predictor_initialized = 1;
- }
-
- if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
- for (sfb = 0;
- sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
- sfb++) {
- for (k = sce->ics.swb_offset[sfb];
- k < sce->ics.swb_offset[sfb + 1];
- k++) {
- predict(&sce->predictor_state[k], &sce->coeffs[k],
- sce->ics.predictor_present &&
- sce->ics.prediction_used[sfb]);
- }
- }
- if (sce->ics.predictor_reset_group)
- reset_predictor_group(sce->predictor_state,
- sce->ics.predictor_reset_group);
- } else
- reset_all_predictors(sce->predictor_state);
-}
-
-/**
- * Decode an individual_channel_stream payload; reference: table 4.44.
- *
- * @param common_window Channels have independent [0], or shared [1], Individual Channel Stream information.
- * @param scale_flag scalable [1] or non-scalable [0] AAC (Unused until scalable AAC is implemented.)
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_ics(AACContext *ac, SingleChannelElement *sce,
- GetBitContext *gb, int common_window, int scale_flag)
-{
- Pulse pulse;
- TemporalNoiseShaping *tns = &sce->tns;
- IndividualChannelStream *ics = &sce->ics;
- float *out = sce->coeffs;
- int global_gain, eld_syntax, er_syntax, pulse_present = 0;
- int ret;
-
- eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
- er_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_LC ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_LTP ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_LD ||
- ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
- /* This assignment is to silence a GCC warning about the variable being used
- * uninitialized when in fact it always is.
- */
- pulse.num_pulse = 0;
-
- global_gain = get_bits(gb, 8);
-
- if (!common_window && !scale_flag) {
- if (decode_ics_info(ac, ics, gb) < 0)
- return AVERROR_INVALIDDATA;
- }
-
- if ((ret = decode_band_types(ac, sce->band_type,
- sce->band_type_run_end, gb, ics)) < 0)
- return ret;
- if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
- sce->band_type, sce->band_type_run_end)) < 0)
- return ret;
-
- pulse_present = 0;
- if (!scale_flag) {
- if (!eld_syntax && (pulse_present = get_bits1(gb))) {
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Pulse tool not allowed in eight short sequence.\n");
- return AVERROR_INVALIDDATA;
- }
- if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "Pulse data corrupt or invalid.\n");
- return AVERROR_INVALIDDATA;
- }
- }
- tns->present = get_bits1(gb);
- if (tns->present && !er_syntax)
- if (decode_tns(ac, tns, gb, ics) < 0)
- return AVERROR_INVALIDDATA;
- if (!eld_syntax && get_bits1(gb)) {
- avpriv_request_sample(ac->avctx, "SSR");
- return AVERROR_PATCHWELCOME;
- }
- // I see no textual basis in the spec for this occurring after SSR gain
- // control, but this is what both reference and real implmentations do
- if (tns->present && er_syntax)
- if (decode_tns(ac, tns, gb, ics) < 0)
- return AVERROR_INVALIDDATA;
- }
-
- if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
- &pulse, ics, sce->band_type) < 0)
- return AVERROR_INVALIDDATA;
-
- if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
- apply_prediction(ac, sce);
-
- return 0;
-}
-
-/**
- * Mid/Side stereo decoding; reference: 4.6.8.1.3.
- */
-static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
-{
- const IndividualChannelStream *ics = &cpe->ch[0].ics;
- float *ch0 = cpe->ch[0].coeffs;
- float *ch1 = cpe->ch[1].coeffs;
- int g, i, group, idx = 0;
- const uint16_t *offsets = ics->swb_offset;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb; i++, idx++) {
- if (cpe->ms_mask[idx] &&
- cpe->ch[0].band_type[idx] < NOISE_BT &&
- cpe->ch[1].band_type[idx] < NOISE_BT) {
- for (group = 0; group < ics->group_len[g]; group++) {
- ac->fdsp->butterflies_float(ch0 + group * 128 + offsets[i],
- ch1 + group * 128 + offsets[i],
- offsets[i+1] - offsets[i]);
- }
- }
- }
- ch0 += ics->group_len[g] * 128;
- ch1 += ics->group_len[g] * 128;
- }
-}
-
-/**
- * intensity stereo decoding; reference: 4.6.8.2.3
- *
- * @param ms_present Indicates mid/side stereo presence. [0] mask is all 0s;
- * [1] mask is decoded from bitstream; [2] mask is all 1s;
- * [3] reserved for scalable AAC
- */
-static void apply_intensity_stereo(AACContext *ac,
- ChannelElement *cpe, int ms_present)
-{
- const IndividualChannelStream *ics = &cpe->ch[1].ics;
- SingleChannelElement *sce1 = &cpe->ch[1];
- float *coef0 = cpe->ch[0].coeffs, *coef1 = cpe->ch[1].coeffs;
- const uint16_t *offsets = ics->swb_offset;
- int g, group, i, idx = 0;
- int c;
- float scale;
- for (g = 0; g < ics->num_window_groups; g++) {
- for (i = 0; i < ics->max_sfb;) {
- if (sce1->band_type[idx] == INTENSITY_BT ||
- sce1->band_type[idx] == INTENSITY_BT2) {
- const int bt_run_end = sce1->band_type_run_end[idx];
- for (; i < bt_run_end; i++, idx++) {
- c = -1 + 2 * (sce1->band_type[idx] - 14);
- if (ms_present)
- c *= 1 - 2 * cpe->ms_mask[idx];
- scale = c * sce1->sf[idx];
- for (group = 0; group < ics->group_len[g]; group++)
- ac->fdsp->vector_fmul_scalar(coef1 + group * 128 + offsets[i],
- coef0 + group * 128 + offsets[i],
- scale,
- offsets[i + 1] - offsets[i]);
- }
- } else {
- int bt_run_end = sce1->band_type_run_end[idx];
- idx += bt_run_end - i;
- i = bt_run_end;
- }
- }
- coef0 += ics->group_len[g] * 128;
- coef1 += ics->group_len[g] * 128;
- }
-}
-
-/**
- * Decode a channel_pair_element; reference: table 4.4.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
-{
- int i, ret, common_window, ms_present = 0;
- int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
- common_window = eld_syntax || get_bits1(gb);
- if (common_window) {
- if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
- return AVERROR_INVALIDDATA;
- i = cpe->ch[1].ics.use_kb_window[0];
- cpe->ch[1].ics = cpe->ch[0].ics;
- cpe->ch[1].ics.use_kb_window[1] = i;
- if (cpe->ch[1].ics.predictor_present &&
- (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
- if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
- decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
- ms_present = get_bits(gb, 2);
- if (ms_present == 3) {
- av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
- return AVERROR_INVALIDDATA;
- } else if (ms_present)
- decode_mid_side_stereo(cpe, gb, ms_present);
- }
- if ((ret = decode_ics(ac, &cpe->ch[0], gb, common_window, 0)))
- return ret;
- if ((ret = decode_ics(ac, &cpe->ch[1], gb, common_window, 0)))
- return ret;
-
- if (common_window) {
- if (ms_present)
- apply_mid_side_stereo(ac, cpe);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN) {
- apply_prediction(ac, &cpe->ch[0]);
- apply_prediction(ac, &cpe->ch[1]);
- }
- }
-
- apply_intensity_stereo(ac, cpe, ms_present);
- return 0;
-}
-
-static const float cce_scale[] = {
- 1.09050773266525765921, //2^(1/8)
- 1.18920711500272106672, //2^(1/4)
- M_SQRT2,
- 2,
-};
-
-/**
- * Decode coupling_channel_element; reference: table 4.8.
- *
- * @return Returns error status. 0 - OK, !0 - error
- */
-static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
-{
- int num_gain = 0;
- int c, g, sfb, ret;
- int sign;
- float scale;
- SingleChannelElement *sce = &che->ch[0];
- ChannelCoupling *coup = &che->coup;
-
- coup->coupling_point = 2 * get_bits1(gb);
- coup->num_coupled = get_bits(gb, 3);
- for (c = 0; c <= coup->num_coupled; c++) {
- num_gain++;
- coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE;
- coup->id_select[c] = get_bits(gb, 4);
- if (coup->type[c] == TYPE_CPE) {
- coup->ch_select[c] = get_bits(gb, 2);
- if (coup->ch_select[c] == 3)
- num_gain++;
- } else
- coup->ch_select[c] = 2;
- }
- coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
-
- sign = get_bits(gb, 1);
- scale = cce_scale[get_bits(gb, 2)];
-
- if ((ret = decode_ics(ac, sce, gb, 0, 0)))
- return ret;
-
- for (c = 0; c < num_gain; c++) {
- int idx = 0;
- int cge = 1;
- int gain = 0;
- float gain_cache = 1.0;
- if (c) {
- cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
- gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;
- gain_cache = powf(scale, -gain);
- }
- if (coup->coupling_point == AFTER_IMDCT) {
- coup->gain[c][0] = gain_cache;
- } else {
- for (g = 0; g < sce->ics.num_window_groups; g++) {
- for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) {
- if (sce->band_type[idx] != ZERO_BT) {
- if (!cge) {
- int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
- if (t) {
- int s = 1;
- t = gain += t;
- if (sign) {
- s -= 2 * (t & 0x1);
- t >>= 1;
- }
- gain_cache = powf(scale, -t) * s;
- }
- }
- coup->gain[c][idx] = gain_cache;
- }
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * Parse whether channels are to be excluded from Dynamic Range Compression; reference: table 4.53.
- *
- * @return Returns number of bytes consumed.
- */
-static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc,
- GetBitContext *gb)
-{
- int i;
- int num_excl_chan = 0;
-
- do {
- for (i = 0; i < 7; i++)
- che_drc->exclude_mask[num_excl_chan++] = get_bits1(gb);
- } while (num_excl_chan < MAX_CHANNELS - 7 && get_bits1(gb));
-
- return num_excl_chan / 7;
-}
-
-/**
- * Decode dynamic range information; reference: table 4.52.
- *
- * @return Returns number of bytes consumed.
- */
-static int decode_dynamic_range(DynamicRangeControl *che_drc,
- GetBitContext *gb)
-{
- int n = 1;
- int drc_num_bands = 1;
- int i;
-
- /* pce_tag_present? */
- if (get_bits1(gb)) {
- che_drc->pce_instance_tag = get_bits(gb, 4);
- skip_bits(gb, 4); // tag_reserved_bits
- n++;
- }
-
- /* excluded_chns_present? */
- if (get_bits1(gb)) {
- n += decode_drc_channel_exclusions(che_drc, gb);
- }
-
- /* drc_bands_present? */
- if (get_bits1(gb)) {
- che_drc->band_incr = get_bits(gb, 4);
- che_drc->interpolation_scheme = get_bits(gb, 4);
- n++;
- drc_num_bands += che_drc->band_incr;
- for (i = 0; i < drc_num_bands; i++) {
- che_drc->band_top[i] = get_bits(gb, 8);
- n++;
- }
- }
-
- /* prog_ref_level_present? */
- if (get_bits1(gb)) {
- che_drc->prog_ref_level = get_bits(gb, 7);
- skip_bits1(gb); // prog_ref_level_reserved_bits
- n++;
- }
-
- for (i = 0; i < drc_num_bands; i++) {
- che_drc->dyn_rng_sgn[i] = get_bits1(gb);
- che_drc->dyn_rng_ctl[i] = get_bits(gb, 7);
- n++;
- }
-
- return n;
-}
-
-static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
- uint8_t buf[256];
- int i, major, minor;
-
- if (len < 13+7*8)
- goto unknown;
-
- get_bits(gb, 13); len -= 13;
-
- for(i=0; i+1<sizeof(buf) && len>=8; i++, len-=8)
- buf[i] = get_bits(gb, 8);
-
- buf[i] = 0;
- if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);
-
- if (sscanf(buf, "libfaac %d.%d", &major, &minor) == 2){
- ac->avctx->internal->skip_samples = 1024;
- }
-
-unknown:
- skip_bits_long(gb, len);
-
- return 0;
-}
-
-/**
- * Decode extension data (incomplete); reference: table 4.51.
- *
- * @param cnt length of TYPE_FIL syntactic element in bytes
- *
- * @return Returns number of bytes consumed
- */
-static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
- ChannelElement *che, enum RawDataBlockType elem_type)
-{
- int crc_flag = 0;
- int res = cnt;
- int type = get_bits(gb, 4);
-
- if (ac->avctx->debug & FF_DEBUG_STARTCODE)
- av_log(ac->avctx, AV_LOG_DEBUG, "extension type: %d len:%d\n", type, cnt);
-
- switch (type) { // extension type
- case EXT_SBR_DATA_CRC:
- crc_flag++;
- case EXT_SBR_DATA:
- if (!che) {
- av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
- return res;
- } else if (!ac->oc[1].m4ac.sbr) {
- av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
- skip_bits_long(gb, 8 * cnt - 4);
- return res;
- } else if (ac->oc[1].m4ac.sbr == -1 && ac->oc[1].status == OC_LOCKED) {
- av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n");
- skip_bits_long(gb, 8 * cnt - 4);
- return res;
- } else if (ac->oc[1].m4ac.ps == -1 && ac->oc[1].status < OC_LOCKED && ac->avctx->channels == 1) {
- ac->oc[1].m4ac.sbr = 1;
- ac->oc[1].m4ac.ps = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
- output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
- ac->oc[1].status, 1);
- } else {
- ac->oc[1].m4ac.sbr = 1;
- ac->avctx->profile = FF_PROFILE_AAC_HE;
- }
- res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
- break;
- case EXT_DYNAMIC_RANGE:
- res = decode_dynamic_range(&ac->che_drc, gb);
- break;
- case EXT_FILL:
- decode_fill(ac, gb, 8 * cnt - 4);
- break;
- case EXT_FILL_DATA:
- case EXT_DATA_ELEMENT:
- default:
- skip_bits_long(gb, 8 * cnt - 4);
- break;
- };
- return res;
-}
-
-/**
- * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
- *
- * @param decode 1 if tool is used normally, 0 if tool is used in LTP.
- * @param coef spectral coefficients
- */
-static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
- IndividualChannelStream *ics, int decode)
-{
- const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
- int w, filt, m, i;
- int bottom, top, order, start, end, size, inc;
- float lpc[TNS_MAX_ORDER];
- float tmp[TNS_MAX_ORDER+1];
-
- for (w = 0; w < ics->num_windows; w++) {
- bottom = ics->num_swb;
- for (filt = 0; filt < tns->n_filt[w]; filt++) {
- top = bottom;
- bottom = FFMAX(0, top - tns->length[w][filt]);
- order = tns->order[w][filt];
- if (order == 0)
- continue;
-
- // tns_decode_coef
- compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
-
- start = ics->swb_offset[FFMIN(bottom, mmm)];
- end = ics->swb_offset[FFMIN( top, mmm)];
- if ((size = end - start) <= 0)
- continue;
- if (tns->direction[w][filt]) {
- inc = -1;
- start = end - 1;
- } else {
- inc = 1;
- }
- start += w * 128;
-
- if (decode) {
- // ar filter
- for (m = 0; m < size; m++, start += inc)
- for (i = 1; i <= FFMIN(m, order); i++)
- coef[start] -= coef[start - i * inc] * lpc[i - 1];
- } else {
- // ma filter
- for (m = 0; m < size; m++, start += inc) {
- tmp[0] = coef[start];
- for (i = 1; i <= FFMIN(m, order); i++)
- coef[start] += tmp[i] * lpc[i - 1];
- for (i = order; i > 0; i--)
- tmp[i] = tmp[i - 1];
- }
- }
- }
- }
-}
-
-/**
- * Apply windowing and MDCT to obtain the spectral
- * coefficient from the predicted sample by LTP.
- */
-static void windowing_and_mdct_ltp(AACContext *ac, float *out,
- float *in, IndividualChannelStream *ics)
-{
- const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-
- if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
- ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
- } else {
- memset(in, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul(in + 448, in + 448, swindow_prev, 128);
- }
- if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
- ac->fdsp->vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
- } else {
- ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
- memset(in + 1024 + 576, 0, 448 * sizeof(float));
- }
- ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
-}
-
-/**
- * Apply the long term prediction
- */
-static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
-{
- const LongTermPrediction *ltp = &sce->ics.ltp;
- const uint16_t *offsets = sce->ics.swb_offset;
- int i, sfb;
-
- if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
- float *predTime = sce->ret;
- float *predFreq = ac->buf_mdct;
- int16_t num_samples = 2048;
-
- if (ltp->lag < 1024)
- num_samples = ltp->lag + 1024;
- for (i = 0; i < num_samples; i++)
- predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
- memset(&predTime[i], 0, (2048 - i) * sizeof(float));
-
- ac->windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
-
- if (sce->tns.present)
- ac->apply_tns(predFreq, &sce->tns, &sce->ics, 0);
-
- for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
- if (ltp->used[sfb])
- for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
- sce->coeffs[i] += predFreq[i];
- }
-}
-
-/**
- * Update the LTP buffer for next frame
- */
-static void update_ltp(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *saved = sce->saved;
- float *saved_ltp = sce->coeffs;
- const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- int i;
-
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- memcpy(saved_ltp, saved, 512 * sizeof(float));
- memset(saved_ltp + 576, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
- for (i = 0; i < 64; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
- } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
- memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
- memset(saved_ltp + 576, 0, 448 * sizeof(float));
- ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
- for (i = 0; i < 64; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
- } else { // LONG_STOP or ONLY_LONG
- ac->fdsp->vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
- for (i = 0; i < 512; i++)
- saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
- }
-
- memcpy(sce->ltp_state, sce->ltp_state+1024, 1024 * sizeof(*sce->ltp_state));
- memcpy(sce->ltp_state+1024, sce->ret, 1024 * sizeof(*sce->ltp_state));
- memcpy(sce->ltp_state+2048, saved_ltp, 1024 * sizeof(*sce->ltp_state));
-}
-
-/**
- * Conduct IMDCT and windowing.
- */
-static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
- const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
- const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
- float *buf = ac->buf_mdct;
- float *temp = ac->temp;
- int i;
-
- // imdct
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- for (i = 0; i < 1024; i += 128)
- ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i);
- } else
- ac->mdct.imdct_half(&ac->mdct, buf, in);
-
- /* window overlapping
- * NOTE: To simplify the overlapping code, all 'meaningless' short to long
- * and long to short transitions are considered to be short to short
- * transitions. This leaves just two cases (long to long and short to short)
- * with a little special sauce for EIGHT_SHORT_SEQUENCE.
- */
- if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
- (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
- ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 512);
- } else {
- memcpy( out, saved, 448 * sizeof(float));
-
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- ac->fdsp->vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
- ac->fdsp->vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
- ac->fdsp->vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
- memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
- } else {
- ac->fdsp->vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
- memcpy( out + 576, buf + 64, 448 * sizeof(float));
- }
- }
-
- // buffer update
- if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
- memcpy( saved, temp + 64, 64 * sizeof(float));
- ac->fdsp->vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
- ac->fdsp->vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
- ac->fdsp->vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
- memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
- } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
- memcpy( saved, buf + 512, 448 * sizeof(float));
- memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
- } else { // LONG_STOP or ONLY_LONG
- memcpy( saved, buf + 512, 512 * sizeof(float));
- }
-}
-
-static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
-{
- IndividualChannelStream *ics = &sce->ics;
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- float *buf = ac->buf_mdct;
-
- // imdct
- ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
-
- // window overlapping
- if (ics->use_kb_window[1]) {
- // AAC LD uses a low overlap sine window instead of a KBD window
- memcpy(out, saved, 192 * sizeof(float));
- ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
- memcpy( out + 320, buf + 64, 192 * sizeof(float));
- } else {
- ac->fdsp->vector_fmul_window(out, saved, buf, ff_sine_512, 256);
- }
-
- // buffer update
- memcpy(saved, buf + 256, 256 * sizeof(float));
-}
-
-static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
-{
- float *in = sce->coeffs;
- float *out = sce->ret;
- float *saved = sce->saved;
- float *buf = ac->buf_mdct;
- int i;
- const int n = ac->oc[1].m4ac.frame_length_short ? 480 : 512;
- const int n2 = n >> 1;
- const int n4 = n >> 2;
- const float *const window = n == 480 ? ff_aac_eld_window_480 :
- ff_aac_eld_window_512;
-
- // Inverse transform, mapped to the conventional IMDCT by
- // Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
- // "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
- // International Conference on Audio, Language and Image Processing, ICALIP 2008.
- // URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
- for (i = 0; i < n2; i+=2) {
- float temp;
- temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
- temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp;
- }
- if (n == 480)
- ac->mdct480->imdct_half(ac->mdct480, buf, in, 1, -1.f/(16*1024*960));
- else
- ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
- for (i = 0; i < n; i+=2) {
- buf[i] = -buf[i];
- }
- // Like with the regular IMDCT at this point we still have the middle half
- // of a transform but with even symmetry on the left and odd symmetry on
- // the right
-
- // window overlapping
- // The spec says to use samples [0..511] but the reference decoder uses
- // samples [128..639].
- for (i = n4; i < n2; i ++) {
- out[i - n4] = buf[n2 - 1 - i] * window[i - n4] +
- saved[ i + n2] * window[i + n - n4] +
- -saved[ n + n2 - 1 - i] * window[i + 2*n - n4] +
- -saved[2*n + n2 + i] * window[i + 3*n - n4];
- }
- for (i = 0; i < n2; i ++) {
- out[n4 + i] = buf[i] * window[i + n2 - n4] +
- -saved[ n - 1 - i] * window[i + n2 + n - n4] +
- -saved[ n + i] * window[i + n2 + 2*n - n4] +
- saved[2*n + n - 1 - i] * window[i + n2 + 3*n - n4];
- }
- for (i = 0; i < n4; i ++) {
- out[n2 + n4 + i] = buf[ i + n2] * window[i + n - n4] +
- -saved[ n2 - 1 - i] * window[i + 2*n - n4] +
- -saved[ n + n2 + i] * window[i + 3*n - n4];
- }
-
- // buffer update
- memmove(saved + n, saved, 2 * n * sizeof(float));
- memcpy( saved, buf, n * sizeof(float));
-}
-
-/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
@@ -2724,506 +256,7 @@ static void apply_independent_coupling(AACContext *ac,
dest[i] += gain * src[i];
}
-/**
- * channel coupling transformation interface
- *
- * @param apply_coupling_method pointer to (in)dependent coupling function
- */
-static void apply_channel_coupling(AACContext *ac, ChannelElement *cc,
- enum RawDataBlockType type, int elem_id,
- enum CouplingPoint coupling_point,
- void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index))
-{
- int i, c;
-
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *cce = ac->che[TYPE_CCE][i];
- int index = 0;
-
- if (cce && cce->coup.coupling_point == coupling_point) {
- ChannelCoupling *coup = &cce->coup;
-
- for (c = 0; c <= coup->num_coupled; c++) {
- if (coup->type[c] == type && coup->id_select[c] == elem_id) {
- if (coup->ch_select[c] != 1) {
- apply_coupling_method(ac, &cc->ch[0], cce, index);
- if (coup->ch_select[c] != 0)
- index++;
- }
- if (coup->ch_select[c] != 2)
- apply_coupling_method(ac, &cc->ch[1], cce, index++);
- } else
- index += 1 + (coup->ch_select[c] == 3);
- }
- }
- }
-}
-
-/**
- * Convert spectral data to float samples, applying all supported tools as appropriate.
- */
-static void spectral_to_sample(AACContext *ac)
-{
- int i, type;
- void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);
- switch (ac->oc[1].m4ac.object_type) {
- case AOT_ER_AAC_LD:
- imdct_and_window = imdct_and_windowing_ld;
- break;
- case AOT_ER_AAC_ELD:
- imdct_and_window = imdct_and_windowing_eld;
- break;
- default:
- imdct_and_window = ac->imdct_and_windowing;
- }
- for (type = 3; type >= 0; type--) {
- for (i = 0; i < MAX_ELEM_ID; i++) {
- ChannelElement *che = ac->che[type][i];
- if (che && che->present) {
- if (type <= TYPE_CPE)
- apply_channel_coupling(ac, che, type, i, BEFORE_TNS, apply_dependent_coupling);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
- if (che->ch[0].ics.predictor_present) {
- if (che->ch[0].ics.ltp.present)
- ac->apply_ltp(ac, &che->ch[0]);
- if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
- ac->apply_ltp(ac, &che->ch[1]);
- }
- }
- if (che->ch[0].tns.present)
- ac->apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
- if (che->ch[1].tns.present)
- ac->apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
- if (type <= TYPE_CPE)
- apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
- if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
- imdct_and_window(ac, &che->ch[0]);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
- ac->update_ltp(ac, &che->ch[0]);
- if (type == TYPE_CPE) {
- imdct_and_window(ac, &che->ch[1]);
- if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
- ac->update_ltp(ac, &che->ch[1]);
- }
- if (ac->oc[1].m4ac.sbr > 0) {
- ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
- }
- }
- if (type <= TYPE_CCE)
- apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
- che->present = 0;
- } else if (che) {
- av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
- }
- }
- }
-}
-
-static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
-{
- int size;
- AACADTSHeaderInfo hdr_info;
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int layout_map_tags, ret;
-
- size = avpriv_aac_parse_header(gb, &hdr_info);
- if (size > 0) {
- if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
- // This is 2 for "VLB " audio in NSV files.
- // See samples/nsv/vlb_audio.
- avpriv_report_missing_feature(ac->avctx,
- "More than one AAC RDB per ADTS frame");
- ac->warned_num_aac_frames = 1;
- }
- push_output_configuration(ac);
- if (hdr_info.chan_config) {
- ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
- if ((ret = set_default_channel_config(ac->avctx,
- layout_map,
- &layout_map_tags,
- hdr_info.chan_config)) < 0)
- return ret;
- if ((ret = output_configure(ac, layout_map, layout_map_tags,
- FFMAX(ac->oc[1].status,
- OC_TRIAL_FRAME), 0)) < 0)
- return ret;
- } else {
- ac->oc[1].m4ac.chan_config = 0;
- /**
- * dual mono frames in Japanese DTV can have chan_config 0
- * WITHOUT specifying PCE.
- * thus, set dual mono as default.
- */
- if (ac->dmono_mode && ac->oc[0].status == OC_NONE) {
- layout_map_tags = 2;
- layout_map[0][0] = layout_map[1][0] = TYPE_SCE;
- layout_map[0][2] = layout_map[1][2] = AAC_CHANNEL_FRONT;
- layout_map[0][1] = 0;
- layout_map[1][1] = 1;
- if (output_configure(ac, layout_map, layout_map_tags,
- OC_TRIAL_FRAME, 0))
- return -7;
- }
- }
- ac->oc[1].m4ac.sample_rate = hdr_info.sample_rate;
- ac->oc[1].m4ac.sampling_index = hdr_info.sampling_index;
- ac->oc[1].m4ac.object_type = hdr_info.object_type;
- ac->oc[1].m4ac.frame_length_short = 0;
- if (ac->oc[0].status != OC_LOCKED ||
- ac->oc[0].m4ac.chan_config != hdr_info.chan_config ||
- ac->oc[0].m4ac.sample_rate != hdr_info.sample_rate) {
- ac->oc[1].m4ac.sbr = -1;
- ac->oc[1].m4ac.ps = -1;
- }
- if (!hdr_info.crc_absent)
- skip_bits(gb, 16);
- }
- return size;
-}
-
-static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, GetBitContext *gb)
-{
- AACContext *ac = avctx->priv_data;
- const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
- ChannelElement *che;
- int err, i;
- int samples = m4ac->frame_length_short ? 960 : 1024;
- int chan_config = m4ac->chan_config;
- int aot = m4ac->object_type;
-
- if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
- samples >>= 1;
-
- ac->frame = data;
-
- if ((err = frame_configure_elements(avctx)) < 0)
- return err;
-
- // The FF_PROFILE_AAC_* defines are all object_type - 1
- // This may lead to an undefined profile being signaled
- ac->avctx->profile = aot - 1;
-
- ac->tags_mapped = 0;
-
- if (chan_config < 0 || (chan_config >= 8 && chan_config < 11) || chan_config >= 13) {
- avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
- chan_config);
- return AVERROR_INVALIDDATA;
- }
- for (i = 0; i < tags_per_config[chan_config]; i++) {
- const int elem_type = aac_channel_layout_map[chan_config-1][i][0];
- const int elem_id = aac_channel_layout_map[chan_config-1][i][1];
- if (!(che=get_che(ac, elem_type, elem_id))) {
- av_log(ac->avctx, AV_LOG_ERROR,
- "channel element %d.%d is not allocated\n",
- elem_type, elem_id);
- return AVERROR_INVALIDDATA;
- }
- che->present = 1;
- if (aot != AOT_ER_AAC_ELD)
- skip_bits(gb, 4);
- switch (elem_type) {
- case TYPE_SCE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- break;
- case TYPE_CPE:
- err = decode_cpe(ac, gb, che);
- break;
- case TYPE_LFE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- break;
- }
- if (err < 0)
- return err;
- }
-
- spectral_to_sample(ac);
-
- ac->frame->nb_samples = samples;
- ac->frame->sample_rate = avctx->sample_rate;
- *got_frame_ptr = 1;
-
- skip_bits_long(gb, get_bits_left(gb));
- return 0;
-}
-
-static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
-{
- AACContext *ac = avctx->priv_data;
- ChannelElement *che = NULL, *che_prev = NULL;
- enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
- int err, elem_id;
- int samples = 0, multiplier, audio_found = 0, pce_found = 0;
- int is_dmono, sce_count = 0;
-
- ac->frame = data;
-
- if (show_bits(gb, 12) == 0xfff) {
- if ((err = parse_adts_frame_header(ac, gb)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
- goto fail;
- }
- if (ac->oc[1].m4ac.sampling_index > 12) {
- av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- }
-
- if ((err = frame_configure_elements(avctx)) < 0)
- goto fail;
-
- // The FF_PROFILE_AAC_* defines are all object_type - 1
- // This may lead to an undefined profile being signaled
- ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
-
- ac->tags_mapped = 0;
- // parse
- while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
- elem_id = get_bits(gb, 4);
-
- if (avctx->debug & FF_DEBUG_STARTCODE)
- av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
-
- if (!avctx->channels && elem_type != TYPE_PCE) {
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
-
- if (elem_type < TYPE_DSE) {
- if (!(che=get_che(ac, elem_type, elem_id))) {
- av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
- elem_type, elem_id);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- samples = 1024;
- che->present = 1;
- }
-
- switch (elem_type) {
-
- case TYPE_SCE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- audio_found = 1;
- sce_count++;
- break;
-
- case TYPE_CPE:
- err = decode_cpe(ac, gb, che);
- audio_found = 1;
- break;
-
- case TYPE_CCE:
- err = decode_cce(ac, gb, che);
- break;
-
- case TYPE_LFE:
- err = decode_ics(ac, &che->ch[0], gb, 0, 0);
- audio_found = 1;
- break;
-
- case TYPE_DSE:
- err = skip_data_stream_element(ac, gb);
- break;
-
- case TYPE_PCE: {
- uint8_t layout_map[MAX_ELEM_ID*4][3];
- int tags;
- push_output_configuration(ac);
- tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb);
- if (tags < 0) {
- err = tags;
- break;
- }
- if (pce_found) {
- av_log(avctx, AV_LOG_ERROR,
- "Not evaluating a further program_config_element as this construct is dubious at best.\n");
- } else {
- err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
- if (!err)
- ac->oc[1].m4ac.chan_config = 0;
- pce_found = 1;
- }
- break;
- }
-
- case TYPE_FIL:
- if (elem_id == 15)
- elem_id += get_bits(gb, 8) - 1;
- if (get_bits_left(gb) < 8 * elem_id) {
- av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- while (elem_id > 0)
- elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, elem_type_prev);
- err = 0; /* FIXME */
- break;
-
- default:
- err = AVERROR_BUG; /* should not happen, but keeps compiler happy */
- break;
- }
-
- che_prev = che;
- elem_type_prev = elem_type;
-
- if (err)
- goto fail;
-
- if (get_bits_left(gb) < 3) {
- av_log(avctx, AV_LOG_ERROR, overread_err);
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
- }
-
- if (!avctx->channels) {
- *got_frame_ptr = 0;
- return 0;
- }
-
- spectral_to_sample(ac);
-
- multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
- samples <<= multiplier;
-
- if (ac->oc[1].status && audio_found) {
- avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
- avctx->frame_size = samples;
- ac->oc[1].status = OC_LOCKED;
- }
-
- if (multiplier) {
- int side_size;
- const uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size);
- if (side && side_size>=4)
- AV_WL32(side, 2*AV_RL32(side));
- }
-
- if (!ac->frame->data[0] && samples) {
- av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
- err = AVERROR_INVALIDDATA;
- goto fail;
- }
-
- if (samples) {
- ac->frame->nb_samples = samples;
- ac->frame->sample_rate = avctx->sample_rate;
- } else
- av_frame_unref(ac->frame);
- *got_frame_ptr = !!samples;
-
- /* for dual-mono audio (SCE + SCE) */
- is_dmono = ac->dmono_mode && sce_count == 2 &&
- ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
- if (is_dmono) {
- if (ac->dmono_mode == 1)
- ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0];
- else if (ac->dmono_mode == 2)
- ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1];
- }
-
- return 0;
-fail:
- pop_output_configuration(ac);
- return err;
-}
-
-static int aac_decode_frame(AVCodecContext *avctx, void *data,
- int *got_frame_ptr, AVPacket *avpkt)
-{
- AACContext *ac = avctx->priv_data;
- const uint8_t *buf = avpkt->data;
- int buf_size = avpkt->size;
- GetBitContext gb;
- int buf_consumed;
- int buf_offset;
- int err;
- int new_extradata_size;
- const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
- AV_PKT_DATA_NEW_EXTRADATA,
- &new_extradata_size);
- int jp_dualmono_size;
- const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt,
- AV_PKT_DATA_JP_DUALMONO,
- &jp_dualmono_size);
-
- if (new_extradata && 0) {
- av_free(avctx->extradata);
- avctx->extradata = av_mallocz(new_extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
- if (!avctx->extradata)
- return AVERROR(ENOMEM);
- avctx->extradata_size = new_extradata_size;
- memcpy(avctx->extradata, new_extradata, new_extradata_size);
- push_output_configuration(ac);
- if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
- avctx->extradata,
- avctx->extradata_size*8, 1) < 0) {
- pop_output_configuration(ac);
- return AVERROR_INVALIDDATA;
- }
- }
-
- ac->dmono_mode = 0;
- if (jp_dualmono && jp_dualmono_size > 0)
- ac->dmono_mode = 1 + *jp_dualmono;
- if (ac->force_dmono_mode >= 0)
- ac->dmono_mode = ac->force_dmono_mode;
-
- if (INT_MAX / 8 <= buf_size)
- return AVERROR_INVALIDDATA;
-
- if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
- return err;
-
- switch (ac->oc[1].m4ac.object_type) {
- case AOT_ER_AAC_LC:
- case AOT_ER_AAC_LTP:
- case AOT_ER_AAC_LD:
- case AOT_ER_AAC_ELD:
- err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb);
- break;
- default:
- err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt);
- }
- if (err < 0)
- return err;
-
- buf_consumed = (get_bits_count(&gb) + 7) >> 3;
- for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
- if (buf[buf_offset])
- break;
-
- return buf_size > buf_offset ? buf_consumed : buf_size;
-}
-
-static av_cold int aac_decode_close(AVCodecContext *avctx)
-{
- AACContext *ac = avctx->priv_data;
- int i, type;
-
- for (i = 0; i < MAX_ELEM_ID; i++) {
- for (type = 0; type < 4; type++) {
- if (ac->che[type][i])
- ff_aac_sbr_ctx_close(&ac->che[type][i]->sbr);
- av_freep(&ac->che[type][i]);
- }
- }
-
- ff_mdct_end(&ac->mdct);
- ff_mdct_end(&ac->mdct_small);
- ff_mdct_end(&ac->mdct_ld);
- ff_mdct_end(&ac->mdct_ltp);
- ff_imdct15_uninit(&ac->mdct480);
- av_freep(&ac->fdsp);
- return 0;
-}
-
+#include "aacdec_template.c"
#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word
@@ -3289,14 +322,14 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
if (avctx->extradata_size < esize) {
av_free(avctx->extradata);
- avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(esize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
}
avctx->extradata_size = esize;
memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
- memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(avctx->extradata+esize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
skip_bits_long(gb, bits_consumed);
@@ -3463,7 +496,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
push_output_configuration(&latmctx->aac_ctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1].m4ac,
- avctx->extradata, avctx->extradata_size*8, 1)) < 0) {
+ avctx->extradata, avctx->extradata_size*8LL, 1)) < 0) {
pop_output_configuration(&latmctx->aac_ctx);
return err;
}
@@ -3505,53 +538,6 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
return ret;
}
-static void aacdec_init(AACContext *c)
-{
- c->imdct_and_windowing = imdct_and_windowing;
- c->apply_ltp = apply_ltp;
- c->apply_tns = apply_tns;
- c->windowing_and_mdct_ltp = windowing_and_mdct_ltp;
- c->update_ltp = update_ltp;
-
- if(ARCH_MIPS)
- ff_aacdec_init_mips(c);
-}
-/**
- * AVOptions for Japanese DTV specific extensions (ADTS only)
- */
-#define AACDEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
- {"dual_mono_mode", "Select the channel to decode for dual mono",
- offsetof(AACContext, force_dmono_mode), AV_OPT_TYPE_INT, {.i64=-1}, -1, 2,
- AACDEC_FLAGS, "dual_mono_mode"},
-
- {"auto", "autoselection", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"main", "Select Main/Left channel", 0, AV_OPT_TYPE_CONST, {.i64= 1}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"sub" , "Select Sub/Right channel", 0, AV_OPT_TYPE_CONST, {.i64= 2}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
- {"both", "Select both channels", 0, AV_OPT_TYPE_CONST, {.i64= 0}, INT_MIN, INT_MAX, AACDEC_FLAGS, "dual_mono_mode"},
-
- {NULL},
-};
-
-static const AVClass aac_decoder_class = {
- .class_name = "AAC decoder",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVProfile profiles[] = {
- { FF_PROFILE_AAC_MAIN, "Main" },
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_SSR, "SSR" },
- { FF_PROFILE_AAC_LTP, "LTP" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_UNKNOWN },
-};
-
AVCodec ff_aac_decoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
@@ -3564,7 +550,7 @@ AVCodec ff_aac_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
@@ -3588,7 +574,7 @@ AVCodec ff_aac_latm_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
.flush = flush,
.profiles = profiles,
diff --git a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_gsmdec.c b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_gsmdec.c
index c4cde9295a6..cd56995183b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_gsmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_gsmdec.c
@@ -120,7 +120,7 @@ AVCodec ff_gsm_decoder = {
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_GSM_MS_DECODER
@@ -133,6 +133,6 @@ AVCodec ff_gsm_ms_decoder = {
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_mpegvideo.c b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_mpegvideo.c
index a3ff7460e90..eacebc26606 100644
--- a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_mpegvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_mpegvideo.c
@@ -297,7 +297,7 @@ static av_cold int dct_init(MpegEncContext *s)
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c;
s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c;
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c;
- if (s->avctx->flags & CODEC_FLAG_BITEXACT)
+ if (s->avctx->flags & AV_CODEC_FLAG_BITEXACT)
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
@@ -312,6 +312,8 @@ static av_cold int dct_init(MpegEncContext *s)
ff_mpv_common_init_ppc(s);
if (ARCH_X86)
ff_mpv_common_init_x86(s);
+ if (ARCH_MIPS)
+ ff_mpv_common_init_mips(s);
return 0;
}
@@ -522,7 +524,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
if(s->picture)
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
- if (s1->picture[i].f->buf[0] &&
+ if (s1->picture && s1->picture[i].f->buf[0] &&
(ret = ff_mpeg_ref_picture(s->avctx, &s->picture[i], &s1->picture[i])) < 0)
return ret;
}
@@ -571,7 +573,7 @@ do {\
if (s1->bitstream_buffer) {
if (s1->bitstream_buffer_size +
- FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size) {
+ AV_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size) {
av_fast_malloc(&s->bitstream_buffer,
&s->allocated_bitstream_buffer_size,
s1->allocated_bitstream_buffer_size);
@@ -584,7 +586,7 @@ do {\
memcpy(s->bitstream_buffer, s1->bitstream_buffer,
s1->bitstream_buffer_size);
memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
}
// linesize dependend scratch buffer allocation
@@ -729,7 +731,7 @@ static int init_context_frame(MpegEncContext *s)
}
if (s->codec_id == AV_CODEC_ID_MPEG4 ||
- (s->avctx->flags & CODEC_FLAG_INTERLACED_ME)) {
+ (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
/* interlaced direct mode decoding tables */
for (i = 0; i < 2; i++) {
int j, k;
@@ -783,6 +785,82 @@ fail:
return AVERROR(ENOMEM);
}
+static void clear_context(MpegEncContext *s)
+{
+ int i, j, k;
+
+ memset(&s->next_picture, 0, sizeof(s->next_picture));
+ memset(&s->last_picture, 0, sizeof(s->last_picture));
+ memset(&s->current_picture, 0, sizeof(s->current_picture));
+ memset(&s->new_picture, 0, sizeof(s->new_picture));
+
+ memset(s->thread_context, 0, sizeof(s->thread_context));
+
+ s->me.map = NULL;
+ s->me.score_map = NULL;
+ s->dct_error_sum = NULL;
+ s->block = NULL;
+ s->blocks = NULL;
+ memset(s->pblocks, 0, sizeof(s->pblocks));
+ s->ac_val_base = NULL;
+ s->ac_val[0] =
+ s->ac_val[1] =
+ s->ac_val[2] =NULL;
+ s->sc.edge_emu_buffer = NULL;
+ s->me.scratchpad = NULL;
+ s->me.temp =
+ s->sc.rd_scratchpad =
+ s->sc.b_scratchpad =
+ s->sc.obmc_scratchpad = NULL;
+
+ s->parse_context.buffer = NULL;
+ s->parse_context.buffer_size = 0;
+ s->bitstream_buffer = NULL;
+ s->allocated_bitstream_buffer_size = 0;
+ s->picture = NULL;
+ s->mb_type = NULL;
+ s->p_mv_table_base = NULL;
+ s->b_forw_mv_table_base = NULL;
+ s->b_back_mv_table_base = NULL;
+ s->b_bidir_forw_mv_table_base = NULL;
+ s->b_bidir_back_mv_table_base = NULL;
+ s->b_direct_mv_table_base = NULL;
+ s->p_mv_table = NULL;
+ s->b_forw_mv_table = NULL;
+ s->b_back_mv_table = NULL;
+ s->b_bidir_forw_mv_table = NULL;
+ s->b_bidir_back_mv_table = NULL;
+ s->b_direct_mv_table = NULL;
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 2; j++) {
+ for (k = 0; k < 2; k++) {
+ s->b_field_mv_table_base[i][j][k] = NULL;
+ s->b_field_mv_table[i][j][k] = NULL;
+ }
+ s->b_field_select_table[i][j] = NULL;
+ s->p_field_mv_table_base[i][j] = NULL;
+ s->p_field_mv_table[i][j] = NULL;
+ }
+ s->p_field_select_table[i] = NULL;
+ }
+
+ s->dc_val_base = NULL;
+ s->coded_block_base = NULL;
+ s->mbintra_table = NULL;
+ s->cbp_table = NULL;
+ s->pred_dir_table = NULL;
+
+ s->mbskip_table = NULL;
+
+ s->er.error_status_table = NULL;
+ s->er.er_temp_buffer = NULL;
+ s->mb_index2xy = NULL;
+ s->lambda_table = NULL;
+
+ s->cplx_tab = NULL;
+ s->bits_tab = NULL;
+}
+
/**
* init common structure for both encoder and decoder.
* this assumes that some variables like width/height are already set
@@ -794,6 +872,8 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
s->avctx->active_thread_type & FF_THREAD_SLICE) ?
s->avctx->thread_count : 1;
+ clear_context(s);
+
if (s->encoding && s->avctx->slices)
nb_slices = s->avctx->slices;
@@ -838,10 +918,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
if (!s->picture[i].f)
goto fail;
}
- memset(&s->next_picture, 0, sizeof(s->next_picture));
- memset(&s->last_picture, 0, sizeof(s->last_picture));
- memset(&s->current_picture, 0, sizeof(s->current_picture));
- memset(&s->new_picture, 0, sizeof(s->new_picture));
s->next_picture.f = av_frame_alloc();
if (!s->next_picture.f)
goto fail;
@@ -1031,6 +1107,9 @@ void ff_mpv_common_end(MpegEncContext *s)
{
int i;
+ if (!s)
+ return ;
+
if (s->slice_context_count > 1) {
for (i = 0; i < s->slice_context_count; i++) {
free_duplicate_context(s->thread_context[i]);
@@ -1122,9 +1201,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
if (&s->picture[i] != s->last_picture_ptr &&
&s->picture[i] != s->next_picture_ptr &&
s->picture[i].reference && !s->picture[i].needs_realloc) {
- if (!(avctx->active_thread_type & FF_THREAD_FRAME))
- av_log(avctx, AV_LOG_ERROR,
- "releasing zombie picture\n");
ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
}
}
@@ -1175,7 +1251,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME;
s->current_picture_ptr->f->pict_type = s->pict_type;
- // if (s->avctx->flags && CODEC_FLAG_QSCALE)
+ // if (s->avctx->flags && AV_CODEC_FLAG_QSCALE)
// s->current_picture_ptr->quality = s->new_picture_ptr->quality;
s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
@@ -1228,7 +1304,11 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return -1;
}
- if (!avctx->hwaccel && !(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
+ if (!avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ && !(avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ ) {
for(i=0; i<avctx->height; i++)
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
0x80, avctx->width);
@@ -1489,7 +1569,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
int *low_delay,
int mb_width, int mb_height, int mb_stride, int quarter_sample)
{
- if ((avctx->flags2 & CODEC_FLAG2_EXPORT_MVS) && mbtype_table && motion_val[0]) {
+ if ((avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) && mbtype_table && motion_val[0]) {
const int shift = 1 + quarter_sample;
const int mv_sample_log2 = avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_SVQ3 ? 2 : 1;
const int mv_stride = (mb_width << mv_sample_log2) +
@@ -1573,7 +1653,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
/* TODO: export all the following to make them accessible for users (and filters) */
if (avctx->hwaccel || !mbtype_table
- || (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU))
+#if FF_API_CAP_VDPAU
+ || (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ )
return;
@@ -2017,7 +2100,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
src_x, src_y << field_based, h_edge_pos,
v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize;
uint8_t *vbuf =ubuf + 9 * s->uvlinesize;
s->vdsp.emulated_edge_mc(ubuf, ptr_cb,
@@ -2052,7 +2135,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
sy = (sy << 2) >> lowres;
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
uvsx = (uvsx << 2) >> lowres;
uvsy = (uvsy << 2) >> lowres;
@@ -2172,7 +2255,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
my += s->mv[dir][i][1];
}
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture,
pix_op, mx, my);
break;
@@ -2412,7 +2495,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
s->mbintra_table[mb_xy]=1;
- if ((s->avctx->flags & CODEC_FLAG_PSNR) || s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor ||
+ if ((s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor ||
!(s->encoding && (s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) &&
s->avctx->mb_decision != FF_MB_DECISION_RD)) { // FIXME precalc
uint8_t *dest_y, *dest_cb, *dest_cr;
@@ -2515,7 +2598,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
add_dequant_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if (s->chroma_y_shift){
add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
@@ -2534,7 +2617,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize);
add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){//Chroma420
add_dct(s, block[4], 4, dest_cb, uvlinesize);
add_dct(s, block[5], 5, dest_cr, uvlinesize);
@@ -2567,7 +2650,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
put_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){
put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
@@ -2586,7 +2669,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
s->idsp.idct_put(dest_y + dct_offset, dct_linesize, block[2]);
s->idsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){
s->idsp.idct_put(dest_cb, uvlinesize, block[4]);
s->idsp.idct_put(dest_cr, uvlinesize, block[5]);
@@ -2612,7 +2695,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
skip_idct:
if(!readable){
s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_utils.c b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_utils.c
index a444a5ead8e..3e4cea531af 100755
--- a/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_utils.c
+++ b/chromium/third_party/ffmpeg/libavcodec/autorename_libavcodec_utils.c
@@ -36,6 +36,7 @@
#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
@@ -122,42 +123,28 @@ static int volatile entangled_thread_counter = 0;
static void *codec_mutex;
static void *avformat_mutex;
-static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
-{
- void **p = ptr;
- if (min_size <= *size && *p)
- return 0;
- min_size = FFMAX(17 * min_size / 16 + 32, min_size);
- av_free(*p);
- *p = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
- if (!*p)
- min_size = 0;
- *size = min_size;
- return 1;
-}
-
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
{
uint8_t **p = ptr;
- if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_freep(p);
*size = 0;
return;
}
- if (!ff_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))
- memset(*p + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!ff_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE, 1))
+ memset(*p + min_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
{
uint8_t **p = ptr;
- if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_freep(p);
*size = 0;
return;
}
- if (!ff_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))
- memset(*p, 0, min_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!ff_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE, 1))
+ memset(*p, 0, min_size + AV_INPUT_BUFFER_PADDING_SIZE);
}
/* encoder management */
@@ -428,11 +415,18 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*width = FFALIGN(*width, w_align);
*height = FFALIGN(*height, h_align);
- if (s->codec_id == AV_CODEC_ID_H264 || s->lowres)
+ if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) {
// some of the optimized chroma MC reads one line too much
// which is also done in mpeg decoders with lowres > 0
*height += 2;
+ // H.264 uses edge emulation for out of frame motion vectors, for this
+ // it requires a temporary area large enough to hold a 21x21 block,
+ // increasing witdth ensure that the temporary area is large enough,
+ // the next rounded up width is 32
+ *width = FFMAX(*width, 32);
+ }
+
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;
}
@@ -706,7 +700,7 @@ void avpriv_color_frame(AVFrame *frame, const int c[4])
int bytes = is_chroma ? FF_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width;
int height = is_chroma ? FF_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height;
for (y = 0; y < height; y++) {
- if (desc->comp[0].depth_minus1 >= 8) {
+ if (desc->comp[0].depth >= 9) {
for (x = 0; x<bytes; x++)
((uint16_t*)dst)[x] = c[p];
}else
@@ -723,12 +717,6 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
if ((ret = update_frame_pool(avctx, frame)) < 0)
return ret;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
- frame->type = FF_BUFFER_TYPE_INTERNAL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
switch (avctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
return video_get_buffer(avctx, frame);
@@ -739,6 +727,18 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
+static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame)
+{
+ int size;
+ const uint8_t *side_metadata;
+
+ AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
+
+ side_metadata = av_packet_get_side_data(avpkt,
+ AV_PKT_DATA_STRINGS_METADATA, &size);
+ return av_packet_unpack_dictionary(side_metadata, size, frame_md);
+}
+
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
{
AVPacket *pkt = avctx->internal->pkt;
@@ -772,6 +772,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
memcpy(frame_sd->data, packet_sd, size);
}
}
+ add_metadata_from_side_data(pkt, frame);
} else {
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_pkt_pos (frame, -1);
@@ -836,35 +837,6 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
return 0;
}
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
-{
- return avcodec_default_get_buffer2(avctx, frame, 0);
-}
-
-typedef struct CompatReleaseBufPriv {
- AVCodecContext avctx;
- AVFrame frame;
- uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
-} CompatReleaseBufPriv;
-
-static void compat_free_buffer(void *opaque, uint8_t *data)
-{
- CompatReleaseBufPriv *priv = opaque;
- if (priv->avctx.release_buffer)
- priv->avctx.release_buffer(&priv->avctx, &priv->frame);
- av_freep(&priv);
-}
-
-static void compat_release_buffer(void *opaque, uint8_t *data)
-{
- AVBufferRef *buf = opaque;
- av_buffer_unref(&buf);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
@@ -892,8 +864,6 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
ret = ff_decode_frame_props(avctx, frame);
if (ret < 0)
return ret;
- if ((ret = ff_init_buffer_info(avctx, frame)) < 0)
- return ret;
if (hwaccel) {
if (hwaccel->alloc_frame) {
@@ -903,124 +873,6 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
} else
avctx->sw_pix_fmt = avctx->pix_fmt;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
- /*
- * Wrap an old get_buffer()-allocated buffer in a bunch of AVBuffers.
- * We wrap each plane in its own AVBuffer. Each of those has a reference to
- * a dummy AVBuffer as its private data, unreffing it on free.
- * When all the planes are freed, the dummy buffer's free callback calls
- * release_buffer().
- */
- if (avctx->get_buffer) {
- CompatReleaseBufPriv *priv = NULL;
- AVBufferRef *dummy_buf = NULL;
- int planes, i, ret;
-
- if (flags & AV_GET_BUFFER_FLAG_REF)
- frame->reference = 1;
-
- ret = avctx->get_buffer(avctx, frame);
- if (ret < 0)
- return ret;
-
- /* return if the buffers are already set up
- * this would happen e.g. when a custom get_buffer() calls
- * avcodec_default_get_buffer
- */
- if (frame->buf[0])
- goto end0;
-
- priv = av_mallocz(sizeof(*priv));
- if (!priv) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- priv->avctx = *avctx;
- priv->frame = *frame;
-
- dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, priv, 0);
- if (!dummy_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
-#define WRAP_PLANE(ref_out, data, data_size) \
-do { \
- AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf); \
- if (!dummy_ref) { \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
- ref_out = av_buffer_create(data, data_size, compat_release_buffer, \
- dummy_ref, 0); \
- if (!ref_out) { \
- av_buffer_unref(&dummy_ref); \
- av_frame_unref(frame); \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
-} while (0)
-
- if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-
- planes = av_pix_fmt_count_planes(frame->format);
- /* workaround for AVHWAccel plane count of 0, buf[0] is used as
- check for allocated buffers: make libavcodec happy */
- if (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
- planes = 1;
- if (!desc || planes <= 0) {
- ret = AVERROR(EINVAL);
- goto fail;
- }
-
- for (i = 0; i < planes; i++) {
- int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
- int plane_size = (frame->height >> v_shift) * frame->linesize[i];
-
- WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
- }
- } else {
- int planar = av_sample_fmt_is_planar(frame->format);
- planes = planar ? avctx->channels : 1;
-
- if (planes > FF_ARRAY_ELEMS(frame->buf)) {
- frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_malloc_array(sizeof(*frame->extended_buf),
- frame->nb_extended_buf);
- if (!frame->extended_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- }
-
- for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
- WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
-
- for (i = 0; i < frame->nb_extended_buf; i++)
- WRAP_PLANE(frame->extended_buf[i],
- frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
- frame->linesize[0]);
- }
-
- av_buffer_unref(&dummy_buf);
-
-end0:
- frame->width = avctx->width;
- frame->height = avctx->height;
-
- return 0;
-
-fail:
- avctx->release_buffer(avctx, frame);
- av_freep(&priv);
- av_buffer_unref(&dummy_buf);
- return ret;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
ret = avctx->get_buffer2(avctx, frame, flags);
end:
@@ -1087,21 +939,6 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
return ret;
}
-#if FF_API_GET_BUFFER
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
-{
- av_assert0(s->codec_type == AVMEDIA_TYPE_VIDEO);
-
- av_frame_unref(pic);
-}
-
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
-{
- av_assert0(0);
- return AVERROR_BUG;
-}
-#endif
-
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
{
int i;
@@ -1176,6 +1013,13 @@ static int setup_hwaccel(AVCodecContext *avctx,
return AVERROR(ENOENT);
}
+ if (hwa->capabilities & HWACCEL_CODEC_CAP_EXPERIMENTAL &&
+ avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
+ av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n",
+ hwa->name);
+ return AVERROR_PATCHWELCOME;
+ }
+
if (hwa->priv_data_size) {
avctx->internal->hwaccel_priv_data = av_mallocz(hwa->priv_data_size);
if (!avctx->internal->hwaccel_priv_data)
@@ -1231,8 +1075,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
- if (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+#if FF_API_CAP_VDPAU
+ if (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
break;
+#endif
if (!setup_hwaccel(avctx, ret, desc->name))
break;
@@ -1250,37 +1096,17 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
return ret;
}
-#if FF_API_AVFRAME_LAVC
-void avcodec_get_frame_defaults(AVFrame *frame)
-{
-#if LIBAVCODEC_VERSION_MAJOR >= 55
- // extended_data should explicitly be freed when needed, this code is unsafe currently
- // also this is not compatible to the <55 ABI/API
- if (frame->extended_data != frame->data && 0)
- av_freep(&frame->extended_data);
-#endif
-
- memset(frame, 0, sizeof(AVFrame));
- av_frame_unref(frame);
-}
-
-AVFrame *avcodec_alloc_frame(void)
-{
- return av_frame_alloc();
-}
-
-void avcodec_free_frame(AVFrame **frame)
-{
- av_frame_free(frame);
-}
-#endif
-
MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
MAKE_ACCESSORS(AVCodecContext, codec, int, seek_preroll)
MAKE_ACCESSORS(AVCodecContext, codec, uint16_t*, chroma_intra_matrix)
+unsigned av_codec_get_codec_properties(const AVCodecContext *codec)
+{
+ return codec->properties;
+}
+
int av_codec_get_max_lowres(const AVCodec *codec)
{
return codec->max_lowres;
@@ -1401,9 +1227,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
- // only call ff_set_dimensions() for non H.264/VP6F codecs so as not to overwrite previously setup dimensions
+ // only call ff_set_dimensions() for non H.264/VP6F/DXV codecs so as not to overwrite previously setup dimensions
if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height &&
- (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F))) {
+ (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F || avctx->codec_id == AV_CODEC_ID_DXV))) {
if (avctx->coded_width && avctx->coded_height)
ret = ff_set_dimensions(avctx, avctx->coded_width, avctx->coded_height);
else if (avctx->width && avctx->height)
@@ -1454,7 +1280,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avctx->frame_number = 0;
avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
- if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder";
AVCodec *codec2;
@@ -1463,7 +1289,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
"add '-strict %d' if you want to use it.\n",
codec_string, codec->name, FF_COMPLIANCE_EXPERIMENTAL);
codec2 = av_codec_is_encoder(codec) ? avcodec_find_encoder(codec->id) : avcodec_find_decoder(codec->id);
- if (!(codec2->capabilities & CODEC_CAP_EXPERIMENTAL))
+ if (!(codec2->capabilities & AV_CODEC_CAP_EXPERIMENTAL))
av_log(avctx, AV_LOG_ERROR, "Alternatively use the non experimental %s '%s'.\n",
codec_string, codec2->name);
ret = AVERROR_EXPERIMENTAL;
@@ -1494,7 +1320,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
- if (!HAVE_THREADS && !(codec->capabilities & CODEC_CAP_AUTO_THREADS))
+ if (!HAVE_THREADS && !(codec->capabilities & AV_CODEC_CAP_AUTO_THREADS))
avctx->thread_count = 1;
if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
@@ -1512,6 +1338,15 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (av_codec_is_encoder(avctx->codec)) {
int i;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame) {
+ ret = AVERROR(ENOMEM);
+ goto free_and_end;
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (avctx->codec->sample_fmts) {
for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) {
if (avctx->sample_fmt == avctx->codec->sample_fmts[i])
@@ -1564,6 +1399,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
+ if (avctx->sample_rate < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n",
+ avctx->sample_rate);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if (avctx->codec->channel_layouts) {
if (!avctx->channel_layout) {
av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n");
@@ -1594,6 +1435,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
} else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
+ if (avctx->channels < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Specified number of channels %d is not supported\n",
+ avctx->channels);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if (avctx->width <= 0 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "dimensions not set\n");
@@ -1615,7 +1462,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avctx->pts_correction_last_pts =
avctx->pts_correction_last_dts = INT64_MIN;
- if ( !CONFIG_GRAY && avctx->flags & CODEC_FLAG_GRAY
+ if ( !CONFIG_GRAY && avctx->flags & AV_CODEC_FLAG_GRAY
&& avctx->codec_descriptor->type == AVMEDIA_TYPE_VIDEO)
av_log(avctx, AV_LOG_WARNING,
"gray decoding requested but not enabled at configuration time\n");
@@ -1722,6 +1569,12 @@ free_and_end:
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ av_frame_free(&avctx->coded_frame);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
av_dict_free(&tmp);
av_freep(&avctx->priv_data);
if (avctx->internal) {
@@ -1733,39 +1586,29 @@ free_and_end:
goto end;
}
-int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
+int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
{
if (avpkt->size < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid negative user packet size %d\n", avpkt->size);
return AVERROR(EINVAL);
}
- if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (size < 0 || size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_log(avctx, AV_LOG_ERROR, "Invalid minimum required packet size %"PRId64" (max allowed is %d)\n",
- size, INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE);
+ size, INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE);
return AVERROR(EINVAL);
}
- if (avctx) {
+ if (avctx && 2*min_size < size) { // FIXME The factor needs to be finetuned
av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
if (!avpkt->data || avpkt->size < size) {
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
avpkt->data = avctx->internal->byte_buffer;
avpkt->size = avctx->internal->byte_buffer_size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
}
if (avpkt->data) {
AVBufferRef *buf = avpkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- void *destruct = avpkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avpkt->size < size) {
av_log(avctx, AV_LOG_ERROR, "User packet is too small (%d < %"PRId64")\n", avpkt->size, size);
@@ -1773,11 +1616,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
av_init_packet(avpkt);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
avpkt->buf = buf;
avpkt->size = size;
return 0;
@@ -1791,7 +1629,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
int ff_alloc_packet(AVPacket *avpkt, int size)
{
- return ff_alloc_packet2(NULL, avpkt, size);
+ return ff_alloc_packet2(NULL, avpkt, size, 0);
}
/**
@@ -1847,7 +1685,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
*got_packet_ptr = 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
return 0;
@@ -1882,13 +1720,13 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
/* check for valid frame size */
if (frame) {
- if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
+ if (avctx->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME) {
if (frame->nb_samples > avctx->frame_size) {
av_log(avctx, AV_LOG_ERROR, "more samples than frame size (avcodec_encode_audio2)\n");
ret = AVERROR(EINVAL);
goto end;
}
- } else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
+ } else if (!(avctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) {
if (frame->nb_samples < avctx->frame_size &&
!avctx->internal->last_audio_frame) {
ret = pad_last_frame(avctx, &padded_frame, frame);
@@ -1907,10 +1745,12 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
}
+ av_assert0(avctx->codec->encode2);
+
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
if (!ret) {
if (*got_packet_ptr) {
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) {
if (avpkt->pts == AV_NOPTS_VALUE)
avpkt->pts = frame->pts;
if (!avpkt->duration)
@@ -1934,11 +1774,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = user_pkt.destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -1948,7 +1783,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!ret) {
if (needs_realloc && avpkt->data) {
- ret = av_buffer_realloc(&avpkt->buf, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ret = av_buffer_realloc(&avpkt->buf, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret >= 0)
avpkt->data = avpkt->buf->data;
}
@@ -1978,126 +1813,6 @@ end:
return ret;
}
-#if FF_API_OLD_ENCODE_AUDIO
-int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples)
-{
- AVPacket pkt;
- AVFrame *frame;
- int ret, samples_size, got_packet;
-
- av_init_packet(&pkt);
- pkt.data = buf;
- pkt.size = buf_size;
-
- if (samples) {
- frame = av_frame_alloc();
- if (!frame)
- return AVERROR(ENOMEM);
-
- if (avctx->frame_size) {
- frame->nb_samples = avctx->frame_size;
- } else {
- /* if frame_size is not set, the number of samples must be
- * calculated from the buffer size */
- int64_t nb_samples;
- if (!av_get_bits_per_sample(avctx->codec_id)) {
- av_log(avctx, AV_LOG_ERROR, "avcodec_encode_audio() does not "
- "support this codec\n");
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
- nb_samples = (int64_t)buf_size * 8 /
- (av_get_bits_per_sample(avctx->codec_id) *
- avctx->channels);
- if (nb_samples >= INT_MAX) {
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
- frame->nb_samples = nb_samples;
- }
-
- /* it is assumed that the samples buffer is large enough based on the
- * relevant parameters */
- samples_size = av_samples_get_buffer_size(NULL, avctx->channels,
- frame->nb_samples,
- avctx->sample_fmt, 1);
- if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
- avctx->sample_fmt,
- (const uint8_t *)samples,
- samples_size, 1)) < 0) {
- av_frame_free(&frame);
- return ret;
- }
-
- /* fabricate frame pts from sample count.
- * this is needed because the avcodec_encode_audio() API does not have
- * a way for the user to provide pts */
- if (avctx->sample_rate && avctx->time_base.num)
- frame->pts = ff_samples_to_time_base(avctx,
- avctx->internal->sample_count);
- else
- frame->pts = AV_NOPTS_VALUE;
- avctx->internal->sample_count += frame->nb_samples;
- } else {
- frame = NULL;
- }
-
- got_packet = 0;
- ret = avcodec_encode_audio2(avctx, &pkt, frame, &got_packet);
- if (!ret && got_packet && avctx->coded_frame) {
- avctx->coded_frame->pts = pkt.pts;
- avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
- }
- /* free any side data since we cannot return it */
- av_packet_free_side_data(&pkt);
-
- if (frame && frame->extended_data != frame->data)
- av_freep(&frame->extended_data);
-
- av_frame_free(&frame);
- return ret ? ret : pkt.size;
-}
-
-#endif
-
-#if FF_API_OLD_ENCODE_VIDEO
-int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVFrame *pict)
-{
- AVPacket pkt;
- int ret, got_packet = 0;
-
- if (buf_size < FF_MIN_BUFFER_SIZE) {
- av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
- return -1;
- }
-
- av_init_packet(&pkt);
- pkt.data = buf;
- pkt.size = buf_size;
-
- ret = avcodec_encode_video2(avctx, &pkt, pict, &got_packet);
- if (!ret && got_packet && avctx->coded_frame) {
- avctx->coded_frame->pts = pkt.pts;
- avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
- }
-
- /* free any side data since we cannot return it */
- if (pkt.side_data_elems > 0) {
- int i;
- for (i = 0; i < pkt.side_data_elems; i++)
- av_free(pkt.side_data[i].data);
- av_freep(&pkt.side_data);
- pkt.side_data_elems = 0;
- }
-
- return ret ? ret : pkt.size;
-}
-
-#endif
-
int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
AVPacket *avpkt,
const AVFrame *frame,
@@ -2113,10 +1828,10 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
avctx->internal->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))
return ff_thread_video_encode_frame(avctx, avpkt, frame, got_packet_ptr);
- if ((avctx->flags&CODEC_FLAG_PASS1) && avctx->stats_out)
+ if ((avctx->flags&AV_CODEC_FLAG_PASS1) && avctx->stats_out)
avctx->stats_out[0] = '\0';
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
avpkt->size = 0;
@@ -2148,11 +1863,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = user_pkt.destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -2163,11 +1873,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!ret) {
if (!*got_packet_ptr)
avpkt->size = 0;
- else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
+ else if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))
avpkt->pts = avpkt->dts = frame->pts;
if (needs_realloc && avpkt->data) {
- ret = av_buffer_realloc(&avpkt->buf, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ret = av_buffer_realloc(&avpkt->buf, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret >= 0)
avpkt->data = avpkt->buf->data;
}
@@ -2177,8 +1887,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (ret < 0 || !*got_packet_ptr)
av_free_packet(avpkt);
- else
- av_packet_merge_side_data(avpkt);
emms_c();
return ret;
@@ -2239,12 +1947,13 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
int size = 0, ret;
const uint8_t *data;
uint32_t flags;
+ int64_t val;
data = av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, &size);
if (!data)
return 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_PARAM_CHANGE)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE)) {
av_log(avctx, AV_LOG_ERROR, "This decoder does not support parameter "
"changes, but PARAM_CHANGE side data was sent to it.\n");
return AVERROR(EINVAL);
@@ -2259,7 +1968,12 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
if (size < 4)
goto fail;
- avctx->channels = bytestream_get_le32(&data);
+ val = bytestream_get_le32(&data);
+ if (val <= 0 || val > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid channel count");
+ return AVERROR_INVALIDDATA;
+ }
+ avctx->channels = val;
size -= 4;
}
if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
@@ -2271,7 +1985,12 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
if (size < 4)
goto fail;
- avctx->sample_rate = bytestream_get_le32(&data);
+ val = bytestream_get_le32(&data);
+ if (val <= 0 || val > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid sample rate");
+ return AVERROR_INVALIDDATA;
+ }
+ avctx->sample_rate = val;
size -= 4;
}
if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
@@ -2291,18 +2010,6 @@ fail:
return AVERROR_INVALIDDATA;
}
-static int add_metadata_from_side_data(AVCodecContext *avctx, AVFrame *frame)
-{
- int size;
- const uint8_t *side_metadata;
-
- AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
-
- side_metadata = av_packet_get_side_data(avctx->internal->pkt,
- AV_PKT_DATA_STRINGS_METADATA, &size);
- return av_packet_unpack_dictionary(side_metadata, size, frame_md);
-}
-
static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame)
{
int ret;
@@ -2371,7 +2078,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
av_frame_unref(picture);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size ||
+ (avctx->active_thread_type & FF_THREAD_FRAME)) {
int did_split = av_packet_split_side_data(&tmp);
ret = apply_param_change(avctx, &tmp);
if (ret < 0) {
@@ -2387,21 +2095,21 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
else {
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
&tmp);
- picture->pkt_dts = avpkt->dts;
+ if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
+ picture->pkt_dts = avpkt->dts;
if(!avctx->has_b_frames){
av_frame_set_pkt_pos(picture, avpkt->pos);
}
//FIXME these should be under if(!avctx->has_b_frames)
/* get_buffer is supposed to set frame parameters */
- if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DR1)) {
if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (!picture->width) picture->width = avctx->width;
if (!picture->height) picture->height = avctx->height;
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt;
}
}
- add_metadata_from_side_data(avctx, picture);
fail:
emms_c(); //needed to avoid an emms_c() call before every return;
@@ -2442,59 +2150,6 @@ fail:
return ret;
}
-#if FF_API_OLD_DECODE_AUDIO
-int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt)
-{
- AVFrame *frame = av_frame_alloc();
- int ret, got_frame = 0;
-
- if (!frame)
- return AVERROR(ENOMEM);
- if (avctx->get_buffer != avcodec_default_get_buffer) {
- av_log(avctx, AV_LOG_ERROR, "Custom get_buffer() for use with"
- "avcodec_decode_audio3() detected. Overriding with avcodec_default_get_buffer\n");
- av_log(avctx, AV_LOG_ERROR, "Please port your application to "
- "avcodec_decode_audio4()\n");
- avctx->get_buffer = avcodec_default_get_buffer;
- avctx->release_buffer = avcodec_default_release_buffer;
- }
-
- ret = avcodec_decode_audio4(avctx, frame, &got_frame, avpkt);
-
- if (ret >= 0 && got_frame) {
- int ch, plane_size;
- int planar = av_sample_fmt_is_planar(avctx->sample_fmt);
- int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels,
- frame->nb_samples,
- avctx->sample_fmt, 1);
- if (*frame_size_ptr < data_size) {
- av_log(avctx, AV_LOG_ERROR, "output buffer size is too small for "
- "the current frame (%d < %d)\n", *frame_size_ptr, data_size);
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
-
- memcpy(samples, frame->extended_data[0], plane_size);
-
- if (planar && avctx->channels > 1) {
- uint8_t *out = ((uint8_t *)samples) + plane_size;
- for (ch = 1; ch < avctx->channels; ch++) {
- memcpy(out, frame->extended_data[ch], plane_size);
- out += plane_size;
- }
- }
- *frame_size_ptr = data_size;
- } else {
- *frame_size_ptr = 0;
- }
- av_frame_free(&frame);
- return ret;
-}
-
-#endif
-
int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
AVFrame *frame,
int *got_frame_ptr,
@@ -2518,7 +2173,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
av_frame_unref(frame);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
uint8_t *side;
int side_size;
uint32_t discard_padding = 0;
@@ -2543,7 +2198,6 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
frame->pkt_dts = avpkt->dts;
}
if (ret >= 0 && *got_frame_ptr) {
- add_metadata_from_side_data(avctx, frame);
avctx->frame_number++;
av_frame_set_best_effort_timestamp(frame,
guess_correct_pts(avctx,
@@ -2569,7 +2223,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
discard_reason = AV_RL8(side + 9);
}
if (avctx->internal->skip_samples && *got_frame_ptr &&
- !(avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL)) {
+ !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
if(frame->nb_samples <= avctx->internal->skip_samples){
*got_frame_ptr = 0;
avctx->internal->skip_samples -= frame->nb_samples;
@@ -2599,7 +2253,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
}
if (discard_padding > 0 && discard_padding <= frame->nb_samples && *got_frame_ptr &&
- !(avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL)) {
+ !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
if (discard_padding == frame->nb_samples) {
*got_frame_ptr = 0;
} else {
@@ -2618,7 +2272,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
}
}
- if ((avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL) && *got_frame_ptr) {
+ if ((avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL) && *got_frame_ptr) {
AVFrameSideData *fside = av_frame_new_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES, 10);
if (fside) {
AV_WL32(fside->data, avctx->internal->skip_samples);
@@ -2671,7 +2325,7 @@ static int recode_subtitle(AVCodecContext *avctx,
inb = inpkt->data;
inl = inpkt->size;
- if (inl >= INT_MAX / UTF8_MAX_BYTES - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (inl >= INT_MAX / UTF8_MAX_BYTES - AV_INPUT_BUFFER_PADDING_SIZE) {
av_log(avctx, AV_LOG_ERROR, "Subtitles packet is too big for recoding\n");
ret = AVERROR(ENOMEM);
goto end;
@@ -2747,7 +2401,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
*got_sub_ptr = 0;
get_subtitle_defaults(sub);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
AVPacket pkt_recoded;
AVPacket tmp = *avpkt;
int did_split = av_packet_split_side_data(&tmp);
@@ -2760,7 +2414,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
* remaining bytes should have already been filled with zeros by the
* original packet allocation anyway. */
memset(tmp.data + tmp.size, 0,
- FFMIN(avpkt->size - tmp.size, FF_INPUT_BUFFER_PADDING_SIZE));
+ FFMIN(avpkt->size - tmp.size, AV_INPUT_BUFFER_PADDING_SIZE));
}
pkt_recoded = tmp;
@@ -2856,7 +2510,6 @@ av_cold int avcodec_close(AVCodecContext *avctx)
ff_thread_free(avctx);
if (avctx->codec && avctx->codec->close)
avctx->codec->close(avctx);
- avctx->coded_frame = NULL;
avctx->internal->byte_buffer_size = 0;
av_freep(&avctx->internal->byte_buffer);
av_frame_free(&avctx->internal->to_free);
@@ -2875,8 +2528,14 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
av_freep(&avctx->priv_data);
- if (av_codec_is_encoder(avctx->codec))
+ if (av_codec_is_encoder(avctx->codec)) {
av_freep(&avctx->extradata);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ av_frame_free(&avctx->coded_frame);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
avctx->codec = NULL;
avctx->active_thread_type = 0;
@@ -2888,25 +2547,6 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
switch(id){
//This is for future deprecatec codec ids, its empty since
//last major bump but will fill up again over time, please don't remove it
-// case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
- case AV_CODEC_ID_BRENDER_PIX_DEPRECATED : return AV_CODEC_ID_BRENDER_PIX;
- case AV_CODEC_ID_OPUS_DEPRECATED : return AV_CODEC_ID_OPUS;
- case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
- case AV_CODEC_ID_PAF_AUDIO_DEPRECATED : return AV_CODEC_ID_PAF_AUDIO;
- case AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S24LE_PLANAR;
- case AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S32LE_PLANAR;
- case AV_CODEC_ID_ADPCM_VIMA_DEPRECATED : return AV_CODEC_ID_ADPCM_VIMA;
- case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
- case AV_CODEC_ID_EXR_DEPRECATED : return AV_CODEC_ID_EXR;
- case AV_CODEC_ID_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
- case AV_CODEC_ID_PAF_VIDEO_DEPRECATED : return AV_CODEC_ID_PAF_VIDEO;
- case AV_CODEC_ID_WEBP_DEPRECATED : return AV_CODEC_ID_WEBP;
- case AV_CODEC_ID_HEVC_DEPRECATED : return AV_CODEC_ID_HEVC;
- case AV_CODEC_ID_MVC1_DEPRECATED : return AV_CODEC_ID_MVC1;
- case AV_CODEC_ID_MVC2_DEPRECATED : return AV_CODEC_ID_MVC2;
- case AV_CODEC_ID_SANM_DEPRECATED : return AV_CODEC_ID_SANM;
- case AV_CODEC_ID_SGIRLE_DEPRECATED : return AV_CODEC_ID_SGIRLE;
- case AV_CODEC_ID_VP7_DEPRECATED : return AV_CODEC_ID_VP7;
default : return id;
}
}
@@ -2919,7 +2559,7 @@ static AVCodec *find_encdec(enum AVCodecID id, int encoder)
while (p) {
if ((encoder ? av_codec_is_encoder(p) : av_codec_is_decoder(p)) &&
p->id == id) {
- if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
+ if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
experimental = p;
} else
return p;
@@ -3066,7 +2706,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
"%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
av_get_pix_fmt_name(enc->pix_fmt));
if (enc->bits_per_raw_sample && enc->pix_fmt != AV_PIX_FMT_NONE &&
- enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1)
+ enc->bits_per_raw_sample < av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth)
av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
av_strlcatf(detail, sizeof(detail), "%s, ",
@@ -3131,6 +2771,13 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (encode) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", q=%d-%d", enc->qmin, enc->qmax);
+ } else {
+ if (enc->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ ", Closed Captions");
+ if (enc->properties & FF_CODEC_PROPERTY_LOSSLESS)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ ", lossless");
}
break;
case AVMEDIA_TYPE_AUDIO:
@@ -3168,10 +2815,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
return;
}
if (encode) {
- if (enc->flags & CODEC_FLAG_PASS1)
+ if (enc->flags & AV_CODEC_FLAG_PASS1)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", pass 1");
- if (enc->flags & CODEC_FLAG_PASS2)
+ if (enc->flags & AV_CODEC_FLAG_PASS2)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", pass 2");
}
@@ -3207,11 +2854,6 @@ unsigned avcodec_version(void)
av_assert0(AV_CODEC_ID_SRT==94216);
av_assert0(LIBAVCODEC_VERSION_MICRO >= 100);
- av_assert0(CODEC_ID_CLLC == AV_CODEC_ID_CLLC);
- av_assert0(CODEC_ID_PCM_S8_PLANAR == AV_CODEC_ID_PCM_S8_PLANAR);
- av_assert0(CODEC_ID_ADPCM_IMA_APC == AV_CODEC_ID_ADPCM_IMA_APC);
- av_assert0(CODEC_ID_ILBC == AV_CODEC_ID_ILBC);
- av_assert0(CODEC_ID_SRT == AV_CODEC_ID_SRT);
return LIBAVCODEC_VERSION_INT;
}
@@ -3431,6 +3073,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
case AV_CODEC_ID_ADPCM_IMA_AMV:
return (frame_bytes - 8) * 2 / ch;
case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
if (avctx->extradata)
return frame_bytes * 14 / (8 * ch);
break;
@@ -3802,7 +3445,7 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
/* Note: the string is NUL terminated (so extradata can be read as a
* string), but the ending character is not accounted in the size (in
* binary formats you are likely not supposed to mux that character). When
- * extradata is copied, it is also padded with FF_INPUT_BUFFER_PADDING_SIZE
+ * extradata is copied, it is also padded with AV_INPUT_BUFFER_PADDING_SIZE
* zeros. */
avctx->extradata_size = buf->len;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/avcodec.h b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
index a592085b1ad..221bcbec2b4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avcodec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
@@ -93,8 +93,7 @@
*
* If you add a codec ID to this list, add it so that
* 1. no value of a existing codec ID changes (that would break ABI),
- * 2. Give it a value which when taken as ASCII is recognized uniquely by a human as this specific codec.
- * This ensures that 2 forks can independently add AVCodecIDs without producing conflicts.
+ * 2. it is as close as possible to similar codecs
*
* After adding new codec IDs, do not forget to add an entry to the codec
* descriptor list and bump libavcodec minor version.
@@ -276,54 +275,44 @@ enum AVCodecID {
AV_CODEC_ID_MSS2,
AV_CODEC_ID_VP9,
AV_CODEC_ID_AIC,
- AV_CODEC_ID_ESCAPE130_DEPRECATED,
- AV_CODEC_ID_G2M_DEPRECATED,
- AV_CODEC_ID_WEBP_DEPRECATED,
+ AV_CODEC_ID_ESCAPE130,
+ AV_CODEC_ID_G2M,
+ AV_CODEC_ID_WEBP,
AV_CODEC_ID_HNM4_VIDEO,
- AV_CODEC_ID_HEVC_DEPRECATED,
+ AV_CODEC_ID_HEVC,
+#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
AV_CODEC_ID_FIC,
AV_CODEC_ID_ALIAS_PIX,
- AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
- AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
- AV_CODEC_ID_EXR_DEPRECATED,
- AV_CODEC_ID_VP7_DEPRECATED,
- AV_CODEC_ID_SANM_DEPRECATED,
- AV_CODEC_ID_SGIRLE_DEPRECATED,
- AV_CODEC_ID_MVC1_DEPRECATED,
- AV_CODEC_ID_MVC2_DEPRECATED,
+ AV_CODEC_ID_BRENDER_PIX,
+ AV_CODEC_ID_PAF_VIDEO,
+ AV_CODEC_ID_EXR,
+ AV_CODEC_ID_VP7,
+ AV_CODEC_ID_SANM,
+ AV_CODEC_ID_SGIRLE,
+ AV_CODEC_ID_MVC1,
+ AV_CODEC_ID_MVC2,
AV_CODEC_ID_HQX,
AV_CODEC_ID_TDSC,
AV_CODEC_ID_HQ_HQA,
-
- AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
- AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
-
- AV_CODEC_ID_012V = MKBETAG('0','1','2','V'),
- AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'),
- AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- AV_CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'),
- AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'),
- AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'),
- AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'),
- AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'),
- AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'),
- AV_CODEC_ID_SNOW = MKBETAG('S','N','O','W'),
- AV_CODEC_ID_WEBP = MKBETAG('W','E','B','P'),
- AV_CODEC_ID_SMVJPEG = MKBETAG('S','M','V','J'),
- AV_CODEC_ID_HEVC = MKBETAG('H','2','6','5'),
-#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
- AV_CODEC_ID_VP7 = MKBETAG('V','P','7','0'),
- AV_CODEC_ID_APNG = MKBETAG('A','P','N','G'),
+ AV_CODEC_ID_HAP,
+ AV_CODEC_ID_DDS,
+ AV_CODEC_ID_DXV,
+
+ AV_CODEC_ID_Y41P = 0x8000,
+ AV_CODEC_ID_AVRP,
+ AV_CODEC_ID_012V,
+ AV_CODEC_ID_AVUI,
+ AV_CODEC_ID_AYUV,
+ AV_CODEC_ID_TARGA_Y216,
+ AV_CODEC_ID_V308,
+ AV_CODEC_ID_V408,
+ AV_CODEC_ID_YUV4,
+ AV_CODEC_ID_AVRN,
+ AV_CODEC_ID_CPIA,
+ AV_CODEC_ID_XFACE,
+ AV_CODEC_ID_SNOW,
+ AV_CODEC_ID_SMVJPEG,
+ AV_CODEC_ID_APNG,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
@@ -355,11 +344,12 @@ enum AVCodecID {
AV_CODEC_ID_PCM_LXF,
AV_CODEC_ID_S302M,
AV_CODEC_ID_PCM_S8_PLANAR,
- AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED,
- AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED,
- AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'),
- AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'),
- AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16),
+ AV_CODEC_ID_PCM_S24LE_PLANAR,
+ AV_CODEC_ID_PCM_S32LE_PLANAR,
+ AV_CODEC_ID_PCM_S16BE_PLANAR,
+ /* new PCM "codecs" should be added right below this line starting with
+ * an explicit value of for example 0x10800
+ */
/* various ADPCM codecs */
AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
@@ -392,16 +382,17 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_IMA_ISS,
AV_CODEC_ID_ADPCM_G722,
AV_CODEC_ID_ADPCM_IMA_APC,
- AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
- AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'),
+ AV_CODEC_ID_ADPCM_VIMA,
#if FF_API_VIMA_DECODER
- AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+ AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA,
#endif
- AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
- AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
- AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '),
- AV_CODEC_ID_ADPCM_IMA_RAD = MKBETAG('R','A','D',' '),
- AV_CODEC_ID_ADPCM_G726LE = MKBETAG('6','2','7','G'),
+
+ AV_CODEC_ID_ADPCM_AFC = 0x11800,
+ AV_CODEC_ID_ADPCM_IMA_OKI,
+ AV_CODEC_ID_ADPCM_DTK,
+ AV_CODEC_ID_ADPCM_IMA_RAD,
+ AV_CODEC_ID_ADPCM_G726LE,
+ AV_CODEC_ID_ADPCM_THP_LE,
/* AMR */
AV_CODEC_ID_AMR_NB = 0x12000,
@@ -481,25 +472,24 @@ enum AVCodecID {
AV_CODEC_ID_RALF,
AV_CODEC_ID_IAC,
AV_CODEC_ID_ILBC,
- AV_CODEC_ID_OPUS_DEPRECATED,
+ AV_CODEC_ID_OPUS,
AV_CODEC_ID_COMFORT_NOISE,
- AV_CODEC_ID_TAK_DEPRECATED,
+ AV_CODEC_ID_TAK,
AV_CODEC_ID_METASOUND,
- AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
+ AV_CODEC_ID_PAF_AUDIO,
AV_CODEC_ID_ON2AVC,
AV_CODEC_ID_DSS_SP,
- AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
- AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'),
- AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'),
- AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'),
- AV_CODEC_ID_DSD_LSBF = MKBETAG('D','S','D','L'),
- AV_CODEC_ID_DSD_MSBF = MKBETAG('D','S','D','M'),
- AV_CODEC_ID_DSD_LSBF_PLANAR = MKBETAG('D','S','D','1'),
- AV_CODEC_ID_DSD_MSBF_PLANAR = MKBETAG('D','S','D','8'),
+
+ AV_CODEC_ID_FFWAVESYNTH = 0x15800,
+ AV_CODEC_ID_SONIC,
+ AV_CODEC_ID_SONIC_LS,
+ AV_CODEC_ID_EVRC,
+ AV_CODEC_ID_SMV,
+ AV_CODEC_ID_DSD_LSBF,
+ AV_CODEC_ID_DSD_MSBF,
+ AV_CODEC_ID_DSD_LSBF_PLANAR,
+ AV_CODEC_ID_DSD_MSBF_PLANAR,
+ AV_CODEC_ID_4GV,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
@@ -512,32 +502,35 @@ enum AVCodecID {
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
AV_CODEC_ID_DVB_TELETEXT,
AV_CODEC_ID_SRT,
- AV_CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- AV_CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- AV_CODEC_ID_STL = MKBETAG('S','p','T','L'),
- AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'),
- AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
- AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'),
- AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'),
- AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'),
- AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'),
- AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
- AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska
+
+ AV_CODEC_ID_MICRODVD = 0x17800,
+ AV_CODEC_ID_EIA_608,
+ AV_CODEC_ID_JACOSUB,
+ AV_CODEC_ID_SAMI,
+ AV_CODEC_ID_REALTEXT,
+ AV_CODEC_ID_STL,
+ AV_CODEC_ID_SUBVIEWER1,
+ AV_CODEC_ID_SUBVIEWER,
+ AV_CODEC_ID_SUBRIP,
+ AV_CODEC_ID_WEBVTT,
+ AV_CODEC_ID_MPL2,
+ AV_CODEC_ID_VPLAYER,
+ AV_CODEC_ID_PJS,
+ AV_CODEC_ID_ASS,
+ AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
/* other specific kind of codecs (generally used for attachments) */
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
AV_CODEC_ID_TTF = 0x18000,
- AV_CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
- AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'),
- AV_CODEC_ID_DVD_NAV = MKBETAG('D','N','A','V'),
- AV_CODEC_ID_TIMED_ID3 = MKBETAG('T','I','D','3'),
- AV_CODEC_ID_BIN_DATA = MKBETAG('D','A','T','A'),
+
+ AV_CODEC_ID_BINTEXT = 0x18800,
+ AV_CODEC_ID_XBIN,
+ AV_CODEC_ID_IDF,
+ AV_CODEC_ID_OTF,
+ AV_CODEC_ID_SMPTE_KLV,
+ AV_CODEC_ID_DVD_NAV,
+ AV_CODEC_ID_TIMED_ID3,
+ AV_CODEC_ID_BIN_DATA,
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
@@ -547,10 +540,6 @@ enum AVCodecID {
AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
-
-#if FF_API_CODEC_ID
-#include "old_codec_ids.h"
-#endif
};
/**
@@ -628,20 +617,33 @@ typedef struct AVCodecDescriptor {
* Note: If the first 23 bits of the additional bytes are not 0, then damaged
* MPEG bitstreams could cause overread and segfault.
*/
-#define FF_INPUT_BUFFER_PADDING_SIZE 32
+#define AV_INPUT_BUFFER_PADDING_SIZE 32
/**
* @ingroup lavc_encoding
* minimum encoding buffer size
* Used to avoid some checks during header writing.
*/
-#define FF_MIN_BUFFER_SIZE 16384
+#define AV_INPUT_BUFFER_MIN_SIZE 16384
+#if FF_API_WITHOUT_PREFIX
+/**
+ * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead
+ */
+#define FF_INPUT_BUFFER_PADDING_SIZE 32
+
+/**
+ * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead
+ */
+#define FF_MIN_BUFFER_SIZE 16384
+#endif /* FF_API_WITHOUT_PREFIX */
/**
* @ingroup lavc_encoding
* motion estimation type.
+ * @deprecated use codec private option instead
*/
+#if FF_API_MOTION_EST
enum Motion_Est_ID {
ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed
ME_FULL,
@@ -654,6 +656,7 @@ enum Motion_Est_ID {
ME_TESA, ///< transformed exhaustive search algorithm
ME_ITER=50, ///< iterative search
};
+#endif
/**
* @ingroup lavc_decoding
@@ -709,11 +712,232 @@ typedef struct RcOverride{
* Allow decoders to produce frames with data planes that are not aligned
* to CPU requirements (e.g. due to cropping).
*/
-#define CODEC_FLAG_UNALIGNED 0x0001
-#define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale.
-#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_OUTPUT_CORRUPT 0x0008 ///< Output even those frames that might be corrupted
-#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
+#define AV_CODEC_FLAG_UNALIGNED (1 << 0)
+/**
+ * Use fixed qscale.
+ */
+#define AV_CODEC_FLAG_QSCALE (1 << 1)
+/**
+ * 4 MV per MB allowed / advanced prediction for H.263.
+ */
+#define AV_CODEC_FLAG_4MV (1 << 2)
+/**
+ * Output even those frames that might be corrupted.
+ */
+#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3)
+/**
+ * Use qpel MC.
+ */
+#define AV_CODEC_FLAG_QPEL (1 << 4)
+/**
+ * Use internal 2pass ratecontrol in first pass mode.
+ */
+#define AV_CODEC_FLAG_PASS1 (1 << 9)
+/**
+ * Use internal 2pass ratecontrol in second pass mode.
+ */
+#define AV_CODEC_FLAG_PASS2 (1 << 10)
+/**
+ * loop filter.
+ */
+#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11)
+/**
+ * Only decode/encode grayscale.
+ */
+#define AV_CODEC_FLAG_GRAY (1 << 13)
+/**
+ * error[?] variables will be set during encoding.
+ */
+#define AV_CODEC_FLAG_PSNR (1 << 15)
+/**
+ * Input bitstream might be truncated at a random location
+ * instead of only at frame boundaries.
+ */
+#define AV_CODEC_FLAG_TRUNCATED (1 << 16)
+/**
+ * Use interlaced DCT.
+ */
+#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18)
+/**
+ * Force low delay.
+ */
+#define AV_CODEC_FLAG_LOW_DELAY (1 << 19)
+/**
+ * Place global headers in extradata instead of every keyframe.
+ */
+#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
+/**
+ * Use only bitexact stuff (except (I)DCT).
+ */
+#define AV_CODEC_FLAG_BITEXACT (1 << 23)
+/* Fx : Flag for h263+ extra options */
+/**
+ * H.263 advanced intra coding / MPEG-4 AC prediction
+ */
+#define AV_CODEC_FLAG_AC_PRED (1 << 24)
+/**
+ * interlaced motion estimation
+ */
+#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29)
+/**
+ * Allow non spec compliant speedup tricks.
+ */
+#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31)
+
+#define AV_CODEC_FLAG2_FAST (1 << 0)
+/**
+ * Skip bitstream encoding.
+ */
+#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2)
+/**
+ * Place global headers at every keyframe instead of in extradata.
+ */
+#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
+
+/**
+ * timecode is in drop frame format. DEPRECATED!!!!
+ */
+#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13)
+
+/**
+ * Input bitstream might be truncated at a packet boundaries
+ * instead of only at frame boundaries.
+ */
+#define AV_CODEC_FLAG2_CHUNKS (1 << 15)
+/**
+ * Discard cropping information from SPS.
+ */
+#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16)
+
+/**
+ * Show all frames before the first keyframe
+ */
+#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22)
+/**
+ * Export motion vectors through frame side data
+ */
+#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28)
+/**
+ * Do not skip samples and export skip information as frame side data
+ */
+#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29)
+
+/* Unsupported options :
+ * Syntax Arithmetic coding (SAC)
+ * Reference Picture Selection
+ * Independent Segment Decoding */
+/* /Fx */
+/* codec capabilities */
+
+/**
+ * Decoder can use draw_horiz_band callback.
+ */
+#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
+/**
+ * Codec uses get_buffer() for allocating buffers and supports custom allocators.
+ * If not set, it might not use get_buffer() at all or use operations that
+ * assume the buffer was allocated by avcodec_default_get_buffer.
+ */
+#define AV_CODEC_CAP_DR1 (1 << 1)
+#define AV_CODEC_CAP_TRUNCATED (1 << 3)
+/**
+ * Encoder or decoder requires flushing with NULL input at the end in order to
+ * give the complete and correct output.
+ *
+ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ * with NULL data. The user can still send NULL data to the public encode
+ * or decode function, but libavcodec will not pass it along to the codec
+ * unless this flag is set.
+ *
+ * Decoders:
+ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ * returns frames.
+ *
+ * Encoders:
+ * The encoder needs to be fed with NULL data at the end of encoding until the
+ * encoder no longer returns data.
+ *
+ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ * flag also means that the encoder must set the pts and duration for
+ * each output packet. If this flag is not set, the pts and duration will
+ * be determined by libavcodec from the input frame.
+ */
+#define AV_CODEC_CAP_DELAY (1 << 5)
+/**
+ * Codec can be fed a final frame with a smaller size.
+ * This can be used to prevent truncation of the last audio samples.
+ */
+#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
+
+#if FF_API_CAP_VDPAU
+/**
+ * Codec can export data for HW decoding (VDPAU).
+ */
+#define AV_CODEC_CAP_HWACCEL_VDPAU (1 << 7)
+#endif
+
+/**
+ * Codec can output multiple frames per AVPacket
+ * Normally demuxers return one frame at a time, demuxers which do not do
+ * are connected to a parser to split what they return into proper frames.
+ * This flag is reserved to the very rare category of codecs which have a
+ * bitstream that cannot be split into frames without timeconsuming
+ * operations like full decoding. Demuxers carring such bitstreams thus
+ * may return multiple frames in a packet. This has many disadvantages like
+ * prohibiting stream copy in many cases thus it should only be considered
+ * as a last resort.
+ */
+#define AV_CODEC_CAP_SUBFRAMES (1 << 8)
+/**
+ * Codec is experimental and is thus avoided in favor of non experimental
+ * encoders
+ */
+#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
+/**
+ * Codec should fill in channel configuration and samplerate instead of container
+ */
+#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
+/**
+ * Codec supports frame-level multithreading.
+ */
+#define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
+/**
+ * Codec supports slice-based (or partition-based) multithreading.
+ */
+#define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
+/**
+ * Codec supports changed parameters at any point.
+ */
+#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
+/**
+ * Codec supports avctx->thread_count == 0 (auto).
+ */
+#define AV_CODEC_CAP_AUTO_THREADS (1 << 15)
+/**
+ * Audio encoder supports receiving a different number of samples in each call.
+ */
+#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
+/**
+ * Codec is intra only.
+ */
+#define AV_CODEC_CAP_INTRA_ONLY 0x40000000
+/**
+ * Codec is lossless.
+ */
+#define AV_CODEC_CAP_LOSSLESS 0x80000000
+
+
+#if FF_API_WITHOUT_PREFIX
+/**
+ * Allow decoders to produce frames with data planes that are not aligned
+ * to CPU requirements (e.g. due to cropping).
+ */
+#define CODEC_FLAG_UNALIGNED AV_CODEC_FLAG_UNALIGNED
+#define CODEC_FLAG_QSCALE AV_CODEC_FLAG_QSCALE
+#define CODEC_FLAG_4MV AV_CODEC_FLAG_4MV
+#define CODEC_FLAG_OUTPUT_CORRUPT AV_CODEC_FLAG_OUTPUT_CORRUPT
+#define CODEC_FLAG_QPEL AV_CODEC_FLAG_QPEL
#if FF_API_GMC
/**
* @deprecated use the "gmc" private option of the libxvid encoder
@@ -734,9 +958,9 @@ typedef struct RcOverride{
*/
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
#endif
-#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale.
+#define CODEC_FLAG_PASS1 AV_CODEC_FLAG_PASS1
+#define CODEC_FLAG_PASS2 AV_CODEC_FLAG_PASS2
+#define CODEC_FLAG_GRAY AV_CODEC_FLAG_GRAY
#if FF_API_EMU_EDGE
/**
* @deprecated edges are not used/required anymore. I.e. this flag is now always
@@ -744,9 +968,9 @@ typedef struct RcOverride{
*/
#define CODEC_FLAG_EMU_EDGE 0x4000
#endif
-#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random
- location instead of only at frame boundaries. */
+#define CODEC_FLAG_PSNR AV_CODEC_FLAG_PSNR
+#define CODEC_FLAG_TRUNCATED AV_CODEC_FLAG_TRUNCATED
+
#if FF_API_NORMALIZE_AQP
/**
* @deprecated use the flag "naq" in the "mpv_flags" private option of the
@@ -754,25 +978,24 @@ typedef struct RcOverride{
*/
#define CODEC_FLAG_NORMALIZE_AQP 0x00020000
#endif
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
-#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
-#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_CLOSED_GOP 0x80000000
-#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!!
-#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
-
-#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-#define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe
-#define CODEC_FLAG2_EXPORT_MVS 0x10000000 ///< Export motion vectors through frame side data
-#define CODEC_FLAG2_SKIP_MANUAL 0x20000000 ///< Do not skip samples and export skip information as frame side data
+#define CODEC_FLAG_INTERLACED_DCT AV_CODEC_FLAG_INTERLACED_DCT
+#define CODEC_FLAG_LOW_DELAY AV_CODEC_FLAG_LOW_DELAY
+#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
+#define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT
+#define CODEC_FLAG_AC_PRED AV_CODEC_FLAG_AC_PRED
+#define CODEC_FLAG_LOOP_FILTER AV_CODEC_FLAG_LOOP_FILTER
+#define CODEC_FLAG_INTERLACED_ME AV_CODEC_FLAG_INTERLACED_ME
+#define CODEC_FLAG_CLOSED_GOP AV_CODEC_FLAG_CLOSED_GOP
+#define CODEC_FLAG2_FAST AV_CODEC_FLAG2_FAST
+#define CODEC_FLAG2_NO_OUTPUT AV_CODEC_FLAG2_NO_OUTPUT
+#define CODEC_FLAG2_LOCAL_HEADER AV_CODEC_FLAG2_LOCAL_HEADER
+#define CODEC_FLAG2_DROP_FRAME_TIMECODE AV_CODEC_FLAG2_DROP_FRAME_TIMECODE
+#define CODEC_FLAG2_IGNORE_CROP AV_CODEC_FLAG2_IGNORE_CROP
+
+#define CODEC_FLAG2_CHUNKS AV_CODEC_FLAG2_CHUNKS
+#define CODEC_FLAG2_SHOW_ALL AV_CODEC_FLAG2_SHOW_ALL
+#define CODEC_FLAG2_EXPORT_MVS AV_CODEC_FLAG2_EXPORT_MVS
+#define CODEC_FLAG2_SKIP_MANUAL AV_CODEC_FLAG2_SKIP_MANUAL
/* Unsupported options :
* Syntax Arithmetic coding (SAC)
@@ -781,14 +1004,14 @@ typedef struct RcOverride{
/* /Fx */
/* codec capabilities */
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
+#define CODEC_CAP_DRAW_HORIZ_BAND AV_CODEC_CAP_DRAW_HORIZ_BAND ///< Decoder can use draw_horiz_band callback.
/**
* Codec uses get_buffer() for allocating buffers and supports custom allocators.
* If not set, it might not use get_buffer() at all or use operations that
* assume the buffer was allocated by avcodec_default_get_buffer.
*/
-#define CODEC_CAP_DR1 0x0002
-#define CODEC_CAP_TRUNCATED 0x0008
+#define CODEC_CAP_DR1 AV_CODEC_CAP_DR1
+#define CODEC_CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
#if FF_API_XVMC
/* Codec can export data for HW decoding. This flag indicates that
* the codec would call get_format() with list that might contain HW accelerated
@@ -822,17 +1045,17 @@ typedef struct RcOverride{
* each output packet. If this flag is not set, the pts and duration will
* be determined by libavcodec from the input frame.
*/
-#define CODEC_CAP_DELAY 0x0020
+#define CODEC_CAP_DELAY AV_CODEC_CAP_DELAY
/**
* Codec can be fed a final frame with a smaller size.
* This can be used to prevent truncation of the last audio samples.
*/
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
+#define CODEC_CAP_SMALL_LAST_FRAME AV_CODEC_CAP_SMALL_LAST_FRAME
#if FF_API_CAP_VDPAU
/**
* Codec can export data for HW decoding (VDPAU).
*/
-#define CODEC_CAP_HWACCEL_VDPAU 0x0080
+#define CODEC_CAP_HWACCEL_VDPAU AV_CODEC_CAP_HWACCEL_VDPAU
#endif
/**
* Codec can output multiple frames per AVPacket
@@ -845,16 +1068,16 @@ typedef struct RcOverride{
* prohibiting stream copy in many cases thus it should only be considered
* as a last resort.
*/
-#define CODEC_CAP_SUBFRAMES 0x0100
+#define CODEC_CAP_SUBFRAMES AV_CODEC_CAP_SUBFRAMES
/**
* Codec is experimental and is thus avoided in favor of non experimental
* encoders
*/
-#define CODEC_CAP_EXPERIMENTAL 0x0200
+#define CODEC_CAP_EXPERIMENTAL AV_CODEC_CAP_EXPERIMENTAL
/**
* Codec should fill in channel configuration and samplerate instead of container
*/
-#define CODEC_CAP_CHANNEL_CONF 0x0400
+#define CODEC_CAP_CHANNEL_CONF AV_CODEC_CAP_CHANNEL_CONF
#if FF_API_NEG_LINESIZES
/**
* @deprecated no codecs use this capability
@@ -864,31 +1087,38 @@ typedef struct RcOverride{
/**
* Codec supports frame-level multithreading.
*/
-#define CODEC_CAP_FRAME_THREADS 0x1000
+#define CODEC_CAP_FRAME_THREADS AV_CODEC_CAP_FRAME_THREADS
/**
* Codec supports slice-based (or partition-based) multithreading.
*/
-#define CODEC_CAP_SLICE_THREADS 0x2000
+#define CODEC_CAP_SLICE_THREADS AV_CODEC_CAP_SLICE_THREADS
/**
* Codec supports changed parameters at any point.
*/
-#define CODEC_CAP_PARAM_CHANGE 0x4000
+#define CODEC_CAP_PARAM_CHANGE AV_CODEC_CAP_PARAM_CHANGE
/**
* Codec supports avctx->thread_count == 0 (auto).
*/
-#define CODEC_CAP_AUTO_THREADS 0x8000
+#define CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_AUTO_THREADS
/**
* Audio encoder supports receiving a different number of samples in each call.
*/
-#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
+#define CODEC_CAP_VARIABLE_FRAME_SIZE AV_CODEC_CAP_VARIABLE_FRAME_SIZE
/**
* Codec is intra only.
*/
-#define CODEC_CAP_INTRA_ONLY 0x40000000
+#define CODEC_CAP_INTRA_ONLY AV_CODEC_CAP_INTRA_ONLY
/**
* Codec is lossless.
*/
-#define CODEC_CAP_LOSSLESS 0x80000000
+#define CODEC_CAP_LOSSLESS AV_CODEC_CAP_LOSSLESS
+
+/**
+ * HWAccel is experimental and is thus avoided in favor of non experimental
+ * codecs
+ */
+#define HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200
+#endif /* FF_API_WITHOUT_PREFIX */
#if FF_API_MB_TYPE
//The following defines may change, don't expect compatibility if you use them.
@@ -952,18 +1182,6 @@ typedef struct AVPanScan{
#define FF_QSCALE_TYPE_VP56 3
#endif
-#if FF_API_GET_BUFFER
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-#define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-#endif
-
/**
* The decoder will keep a reference to the frame and may reuse it later.
*/
@@ -1045,6 +1263,18 @@ enum AVPacketSideDataType {
AV_PKT_DATA_AUDIO_SERVICE_TYPE,
/**
+ * This side data contains quality related information from the encoder.
+ * @code
+ * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad).
+ * u8 picture type
+ * u8 error count
+ * u16 reserved
+ * u64le[error count] sum of squared differences between encoder in and output
+ * @endcode
+ */
+ AV_PKT_DATA_QUALITY_STATS,
+
+ /**
* Recommmends skipping the specified number of samples
* @code
* u32le number of samples to skip from start of this packet
@@ -1109,6 +1339,8 @@ enum AVPacketSideDataType {
AV_PKT_DATA_METADATA_UPDATE,
};
+#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
+
typedef struct AVPacketSideData {
uint8_t *data;
int size;
@@ -1121,7 +1353,9 @@ typedef struct AVPacketSideData {
* then passed to muxers.
*
* For video, it should typically contain one compressed frame. For audio it may
- * contain several compressed frames.
+ * contain several compressed frames. Encoders are allowed to output empty
+ * packets, with no compressed data, containing only side data
+ * (e.g. to update some stream parameters at the end of encoding).
*
* AVPacket is one of the few structs in FFmpeg, whose size is a part of public
* ABI. Thus it may be allocated on stack and no new fields can be added to it
@@ -1179,12 +1413,7 @@ typedef struct AVPacket {
* Equals next_pts - this_pts in presentation order.
*/
int duration;
-#if FF_API_DESTRUCT_PACKET
- attribute_deprecated
- void (*destruct)(struct AVPacket *);
- attribute_deprecated
- void *priv;
-#endif
+
int64_t pos; ///< byte position in stream, -1 if unknown
/**
@@ -1301,7 +1530,8 @@ typedef struct AVCodecContext {
/**
* the average bitrate
* - encoding: Set by user; unused for constant quantizer encoding.
- * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+ * - decoding: Set by user, may be overwritten by libavcodec
+ * if this info is available in the stream
*/
int bit_rate;
@@ -1329,14 +1559,14 @@ typedef struct AVCodecContext {
#define FF_COMPRESSION_DEFAULT -1
/**
- * CODEC_FLAG_*.
+ * AV_CODEC_FLAG_*.
* - encoding: Set by user.
* - decoding: Set by user.
*/
int flags;
/**
- * CODEC_FLAG2_*
+ * AV_CODEC_FLAG2_*
* - encoding: Set by user.
* - decoding: Set by user.
*/
@@ -1347,7 +1577,7 @@ typedef struct AVCodecContext {
* mjpeg: Huffman tables
* rv10: additional flags
* mpeg4: global headers (they can be in the bitstream or here)
- * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+ * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
* than extradata_size to avoid problems if it is read with the bitstream reader.
* The bytewise contents of extradata must not depend on the architecture or CPU endianness.
* - encoding: Set/allocated/freed by libavcodec.
@@ -1460,14 +1690,13 @@ typedef struct AVCodecContext {
*/
enum AVPixelFormat pix_fmt;
+#if FF_API_MOTION_EST
/**
- * Motion estimation algorithm used for video coding.
- * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
- * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
- * - encoding: MUST be set by user.
- * - decoding: unused
+ * This option does nothing
+ * @deprecated use codec private options instead
*/
- int me_method;
+ attribute_deprecated int me_method;
+#endif
/**
* If non NULL, 'draw_horiz_band' is called by the libavcodec
@@ -1528,9 +1757,11 @@ typedef struct AVCodecContext {
*/
float b_quant_factor;
- /** obsolete FIXME remove */
- int rc_strategy;
+#if FF_API_RC_STRATEGY
+ /** @deprecated use codec private option instead */
+ attribute_deprecated int rc_strategy;
#define FF_RC_STRATEGY_XVID 1
+#endif
int b_frame_strategy;
@@ -1751,20 +1982,18 @@ typedef struct AVCodecContext {
*/
int me_range;
+#if FF_API_QUANT_BIAS
/**
- * intra quantizer bias
- * - encoding: Set by user.
- * - decoding: unused
+ * @deprecated use encoder private option instead
*/
- int intra_quant_bias;
+ attribute_deprecated int intra_quant_bias;
#define FF_DEFAULT_QUANT_BIAS 999999
/**
- * inter quantizer bias
- * - encoding: Set by user.
- * - decoding: unused
+ * @deprecated use encoder private option instead
*/
- int inter_quant_bias;
+ attribute_deprecated int inter_quant_bias;
+#endif
/**
* slice flags
@@ -2015,7 +2244,7 @@ typedef struct AVCodecContext {
*
* - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
* except the last must contain exactly frame_size samples per channel.
- * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
+ * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
* frame size is not restricted.
* - decoding: may be set by some decoders to indicate constant frame size
*/
@@ -2045,16 +2274,6 @@ typedef struct AVCodecContext {
*/
int cutoff;
-#if FF_API_REQUEST_CHANNELS
- /**
- * Decoder should decode to this many channels if it can (0 for default)
- * - encoding: unused
- * - decoding: Set by user.
- * @deprecated Deprecated in favor of request_channel_layout.
- */
- attribute_deprecated int request_channels;
-#endif
-
/**
* Audio channel layout.
* - encoding: set by user.
@@ -2084,102 +2303,6 @@ typedef struct AVCodecContext {
*/
enum AVSampleFormat request_sample_fmt;
-#if FF_API_GET_BUFFER
- /**
- * Called at the beginning of each frame to get a buffer for it.
- *
- * The function will set AVFrame.data[], AVFrame.linesize[].
- * AVFrame.extended_data[] must also be set, but it should be the same as
- * AVFrame.data[] except for planar audio with more channels than can fit
- * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
- * many data pointers as it can hold.
- *
- * if CODEC_CAP_DR1 is not set then get_buffer() must call
- * avcodec_default_get_buffer() instead of providing buffers allocated by
- * some other means.
- *
- * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
- * need it. avcodec_default_get_buffer() aligns the output buffer properly,
- * but if get_buffer() is overridden then alignment considerations should
- * be taken into account.
- *
- * @see avcodec_default_get_buffer()
- *
- * Video:
- *
- * If pic.reference is set then the frame will be read later by libavcodec.
- * avcodec_align_dimensions2() should be used to find the required width and
- * height, as they normally need to be rounded up to the next multiple of 16.
- *
- * If frame multithreading is used and thread_safe_callbacks is set,
- * it may be called from a different thread, but not from more than one at
- * once. Does not need to be reentrant.
- *
- * @see release_buffer(), reget_buffer()
- * @see avcodec_align_dimensions2()
- *
- * Audio:
- *
- * Decoders request a buffer of a particular size by setting
- * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
- * however, utilize only part of the buffer by setting AVFrame.nb_samples
- * to a smaller value in the output frame.
- *
- * Decoders cannot use the buffer after returning from
- * avcodec_decode_audio4(), so they will not call release_buffer(), as it
- * is assumed to be released immediately upon return. In some rare cases,
- * a decoder may need to call get_buffer() more than once in a single
- * call to avcodec_decode_audio4(). In that case, when get_buffer() is
- * called again after it has already been called once, the previously
- * acquired buffer is assumed to be released at that time and may not be
- * reused by the decoder.
- *
- * As a convenience, av_samples_get_buffer_size() and
- * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
- * functions to find the required data size and to fill data pointers and
- * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
- * since all planes must be the same size.
- *
- * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
- *
- * - encoding: unused
- * - decoding: Set by libavcodec, user can override.
- *
- * @deprecated use get_buffer2()
- */
- attribute_deprecated
- int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
- * Called to release buffers which were allocated with get_buffer.
- * A released buffer can be reused in get_buffer().
- * pic.data[*] must be set to NULL.
- * May be called from a different thread if frame multithreading is used,
- * but not by more than one thread at once, so does not need to be reentrant.
- * - encoding: unused
- * - decoding: Set by libavcodec, user can override.
- *
- * @deprecated custom freeing callbacks should be set from get_buffer2()
- */
- attribute_deprecated
- void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
- * Called at the beginning of a frame to get cr buffer for it.
- * Buffer type (size, hints) must be the same. libavcodec won't check it.
- * libavcodec will pass previous buffer in pic, function should return
- * same buffer or new buffer with old frame "painted" into it.
- * If pic.data[0] == NULL must behave like get_buffer().
- * if CODEC_CAP_DR1 is not set then reget_buffer() must call
- * avcodec_default_reget_buffer() instead of providing buffers allocated by
- * some other means.
- * - encoding: unused
- * - decoding: Set by libavcodec, user can override.
- */
- attribute_deprecated
- int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-#endif
-
/**
* This callback is called at the beginning of each frame to get data
* buffer(s) for it. There may be one contiguous buffer for all the data or
@@ -2217,7 +2340,7 @@ typedef struct AVCodecContext {
* buffers than buf[] can hold. extended_buf will be freed in
* av_frame_unref().
*
- * If CODEC_CAP_DR1 is not set then get_buffer2() must call
+ * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call
* avcodec_default_get_buffer2() instead of providing buffers allocated by
* some other means.
*
@@ -2339,7 +2462,7 @@ typedef struct AVCodecContext {
/**
* maximum bitrate
* - encoding: Set by user.
- * - decoding: Set by libavcodec.
+ * - decoding: Set by user, may be overwritten by libavcodec.
*/
int rc_max_rate;
@@ -2606,6 +2729,7 @@ typedef struct AVCodecContext {
#endif
#define FF_DEBUG_BUFFERS 0x00008000
#define FF_DEBUG_THREADS 0x00010000
+#define FF_DEBUG_GREEN_MD 0x00800000
#define FF_DEBUG_NOMC 0x01000000
#if FF_API_DEBUG_MV
@@ -2674,7 +2798,7 @@ typedef struct AVCodecContext {
/**
* error
- * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
+ * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR.
* - decoding: unused
*/
uint64_t error[AV_NUM_DATA_POINTERS];
@@ -2687,9 +2811,7 @@ typedef struct AVCodecContext {
int dct_algo;
#define FF_DCT_AUTO 0
#define FF_DCT_FASTINT 1
-#if FF_API_UNUSED_MEMBERS
#define FF_DCT_INT 2
-#endif /* FF_API_UNUSED_MEMBERS */
#define FF_DCT_MMX 3
#define FF_DCT_ALTIVEC 5
#define FF_DCT_FAAN 6
@@ -2754,12 +2876,16 @@ typedef struct AVCodecContext {
int lowres;
#endif
+#if FF_API_CODED_FRAME
/**
* the picture in the bitstream
* - encoding: Set by libavcodec.
* - decoding: unused
+ *
+ * @deprecated use the quality factor packet side data instead
*/
- AVFrame *coded_frame;
+ attribute_deprecated AVFrame *coded_frame;
+#endif
/**
* thread count
@@ -2829,14 +2955,6 @@ typedef struct AVCodecContext {
*/
int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
-#if FF_API_THREAD_OPAQUE
- /**
- * @deprecated this field should not be used from outside of lavc
- */
- attribute_deprecated
- void *thread_opaque;
-#endif
-
/**
* noise vs. sse weight for the nsse comparison function
* - encoding: Set by user.
@@ -2923,17 +3041,16 @@ typedef struct AVCodecContext {
#define FF_PROFILE_JPEG2000_DCINEMA_2K 3
#define FF_PROFILE_JPEG2000_DCINEMA_4K 4
+#define FF_PROFILE_VP9_0 0
+#define FF_PROFILE_VP9_1 1
+#define FF_PROFILE_VP9_2 2
+#define FF_PROFILE_VP9_3 3
#define FF_PROFILE_HEVC_MAIN 1
#define FF_PROFILE_HEVC_MAIN_10 2
#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
#define FF_PROFILE_HEVC_REXT 4
-#define FF_PROFILE_VP9_0 0
-#define FF_PROFILE_VP9_1 1
-#define FF_PROFILE_VP9_2 2
-#define FF_PROFILE_VP9_3 3
-
/**
* level
* - encoding: Set by user.
@@ -2983,14 +3100,6 @@ typedef struct AVCodecContext {
int error_rate;
#endif
-#if FF_API_CODEC_PKT
- /**
- * @deprecated this field is not supposed to be accessed from outside lavc
- */
- attribute_deprecated
- AVPacket *pkt;
-#endif
-
/**
* VBV delay coded in the last frame (in periods of a 27 MHz clock).
* Used for compliant TS muxing.
@@ -2999,20 +3108,20 @@ typedef struct AVCodecContext {
*/
uint64_t vbv_delay;
+#if FF_API_SIDEDATA_ONLY_PKT
/**
- * Encoding only. Allow encoders to output packets that do not contain any
- * encoded data, only side data.
+ * Encoding only and set by default. Allow encoders to output packets
+ * that do not contain any encoded data, only side data.
*
* Some encoders need to output such packets, e.g. to update some stream
* parameters at the end of encoding.
*
- * All callers are strongly recommended to set this option to 1 and update
- * their code to deal with such packets, since this behaviour may become
- * always enabled in the future (then this option will be deprecated and
- * later removed). To avoid ABI issues when this happens, the callers should
- * use AVOptions to set this field.
+ * @deprecated this field disables the default behaviour and
+ * it is kept only for compatibility.
*/
+ attribute_deprecated
int side_data_only_packets;
+#endif
/**
* Audio only. The number of "priming" samples (padding) inserted by the
@@ -3163,6 +3272,16 @@ typedef struct AVCodecContext {
* - decoding: set by user through AVOPtions (NO direct access)
*/
char *codec_whitelist;
+
+ /*
+ * Properties of the stream that gets decoded
+ * To be accessed through av_codec_get_properties() (NO direct access)
+ * - encoding: unused
+ * - decoding: set by libavcodec
+ */
+ unsigned properties;
+#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001
+#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
} AVCodecContext;
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
@@ -3171,6 +3290,8 @@ void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational
const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx);
void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc);
+unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
+
int av_codec_get_lowres(const AVCodecContext *avctx);
void av_codec_set_lowres(AVCodecContext *avctx, int val);
@@ -3212,7 +3333,7 @@ typedef struct AVCodec {
enum AVCodecID id;
/**
* Codec capabilities.
- * see CODEC_CAP_*
+ * see AV_CODEC_CAP_*
*/
int capabilities;
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
@@ -3220,9 +3341,7 @@ typedef struct AVCodec {
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
-#if FF_API_LOWRES
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres()
-#endif
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
@@ -3333,7 +3452,7 @@ typedef struct AVHWAccel {
/**
* Hardware accelerated codec capabilities.
- * see FF_HWACCEL_CODEC_CAP_*
+ * see HWACCEL_CODEC_CAP_*
*/
int capabilities;
@@ -3440,6 +3559,9 @@ typedef struct AVHWAccel {
* Hardware acceleration should be used for decoding even if the codec level
* used is unknown or higher than the maximum supported level reported by the
* hardware driver.
+ *
+ * It's generally a good idea to pass this flag unless you have a specific
+ * reason not to, as hardware tends to under-report supported levels.
*/
#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
@@ -3644,39 +3766,6 @@ const AVClass *avcodec_get_subtitle_rect_class(void);
*/
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
-#if FF_API_AVFRAME_LAVC
-/**
- * @deprecated use av_frame_alloc()
- */
-attribute_deprecated
-AVFrame *avcodec_alloc_frame(void);
-
-/**
- * Set the fields of the given AVFrame to default values.
- *
- * @param frame The AVFrame of which the fields should be set to default values.
- *
- * @deprecated use av_frame_unref()
- */
-attribute_deprecated
-void avcodec_get_frame_defaults(AVFrame *frame);
-
-/**
- * Free the frame and any dynamically allocated objects in it,
- * e.g. extended_data.
- *
- * @param frame frame to be freed. The pointer will be set to NULL.
- *
- * @warning this function does NOT free the data buffers themselves
- * (it does not know how, since they might have been allocated with
- * a custom get_buffer()).
- *
- * @deprecated use av_frame_free()
- */
-attribute_deprecated
-void avcodec_free_frame(AVFrame **frame);
-#endif
-
/**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this
* function the context has to be allocated with avcodec_alloc_context3().
@@ -3745,15 +3834,6 @@ void avsubtitle_free(AVSubtitle *sub);
* @{
*/
-#if FF_API_DESTRUCT_PACKET
-/**
- * Default packet destructor.
- * @deprecated use the AVBuffer API instead
- */
-attribute_deprecated
-void av_destruct_packet(AVPacket *pkt);
-#endif
-
/**
* Initialize optional fields of a packet with default values.
*
@@ -3799,7 +3879,7 @@ int av_grow_packet(AVPacket *pkt, int grow_by);
* function returns successfully, the data is owned by the underlying AVBuffer.
* The caller may not access the data through other means.
* @param size size of data in bytes, without the padding. I.e. the full buffer
- * size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
+ * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
*
* @return 0 on success, a negative AVERROR on error
*/
@@ -3988,16 +4068,10 @@ AVCodec *avcodec_find_decoder(enum AVCodecID id);
*/
AVCodec *avcodec_find_decoder_by_name(const char *name);
-#if FF_API_GET_BUFFER
-attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-#endif
-
/**
* The default callback for AVCodecContext.get_buffer2(). It is made public so
* it can be called by custom get_buffer2() implementations for decoders without
- * CODEC_CAP_DR1 set.
+ * AV_CODEC_CAP_DR1 set.
*/
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
@@ -4021,7 +4095,7 @@ unsigned avcodec_get_edge_width(void);
* buffer that is acceptable for the codec if you do not use any horizontal
* padding.
*
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened.
*/
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
@@ -4030,7 +4104,7 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
* buffer that is acceptable for the codec if you also ensure that all
* line sizes are a multiple of the respective linesize_align[i].
*
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened.
*/
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[AV_NUM_DATA_POINTERS]);
@@ -4057,66 +4131,6 @@ int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
*/
enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
-#if FF_API_OLD_DECODE_AUDIO
-/**
- * Wrapper function which calls avcodec_decode_audio4.
- *
- * @deprecated Use avcodec_decode_audio4 instead.
- *
- * Decode the audio frame of size avpkt->size from avpkt->data into samples.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame. In this case,
- * avcodec_decode_audio3 has to be called again with an AVPacket that contains
- * the remaining data in order to decode the second frame etc.
- * If no frame
- * could be outputted, frame_size_ptr is zero. Otherwise, it is the
- * decompressed frame size in bytes.
- *
- * @warning You must set frame_size_ptr to the allocated size of the
- * output buffer before calling avcodec_decode_audio3().
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @warning You must not provide a custom get_buffer() when using
- * avcodec_decode_audio3(). Doing so will override it with
- * avcodec_default_get_buffer. Use avcodec_decode_audio4() instead,
- * which does allow the application to provide a custom get_buffer().
- *
- * @note You might have to align the input buffer avpkt->data and output buffer
- * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum and
- * samples should be 16 byte aligned unless the CPU doesn't need it
- * (AltiVec and SSE do).
- *
- * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
- * between input and output, these need to be fed with avpkt->data=NULL,
- * avpkt->size=0 at the end to return the remaining frames.
- *
- * @param avctx the codec context
- * @param[out] samples the output buffer, sample type in avctx->sample_fmt
- * If the sample format is planar, each channel plane will
- * be the same size, with no padding between channels.
- * @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] avpkt The input AVPacket containing the input buffer.
- * You can create such packet with av_init_packet() and by then setting
- * data and size, some decoders might in addition need other fields.
- * All decoders are designed to use the least fields possible though.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame data was decompressed (used) from the input AVPacket.
- */
-attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt);
-#endif
-
/**
* Decode the audio frame of size avpkt->size from avpkt->data into frame.
*
@@ -4128,15 +4142,15 @@ attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *s
* needs to be fed to the decoder with remaining data until it is completely
* consumed or an error occurs.
*
- * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
+ * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input
* and output. This means that for some packets they will not immediately
* produce decoded output and need to be flushed at the end of decoding to get
* all the decoded data. Flushing is done by calling this function with packets
* with avpkt->data set to NULL and avpkt->size set to 0 until it stops
* returning samples. It is safe to flush even those decoders that are not
- * marked with CODEC_CAP_DELAY, then no samples will be returned.
+ * marked with AV_CODEC_CAP_DELAY, then no samples will be returned.
*
- * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE
* larger than the actual read bytes because some optimized bitstream
* readers read 32 or 64 bits at once and could read over the end.
*
@@ -4159,7 +4173,7 @@ attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *s
* @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
* non-zero. Note that this field being set to zero
* does not mean that an error has occurred. For
- * decoders with CODEC_CAP_DELAY set, no given decode
+ * decoders with AV_CODEC_CAP_DELAY set, no given decode
* call is guaranteed to produce a frame.
* @param[in] avpkt The input AVPacket containing the input buffer.
* At least avpkt->data and avpkt->size should be set. Some
@@ -4176,14 +4190,14 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
* Some decoders may support multiple frames in a single AVPacket, such
* decoders would then just decode the first frame.
*
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than
* the actual read bytes because some optimized bitstream readers read 32 or 64
* bits at once and could read over the end.
*
* @warning The end of the input buffer buf should be set to 0 to ensure that
* no overreading happens for damaged MPEG streams.
*
- * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay
* between input and output, these need to be fed with avpkt->data=NULL,
* avpkt->size=0 at the end to return the remaining frames.
*
@@ -4223,7 +4237,7 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* Return a negative value on error, otherwise return the number of bytes used.
* If no subtitle could be decompressed, got_sub_ptr is zero.
* Otherwise, the subtitle is stored in *sub.
- * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for
* simplicity, because the performance difference is expect to be negligible
* and reusing a get_buffer written for video codecs would probably perform badly
* due to a potentially very different allocation pattern.
@@ -4530,36 +4544,6 @@ AVCodec *avcodec_find_encoder(enum AVCodecID id);
*/
AVCodec *avcodec_find_encoder_by_name(const char *name);
-#if FF_API_OLD_ENCODE_AUDIO
-/**
- * Encode an audio frame from samples into buf.
- *
- * @deprecated Use avcodec_encode_audio2 instead.
- *
- * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
- * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user
- * will know how much space is needed because it depends on the value passed
- * in buf_size as described below. In that case a lower value can be used.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer
- * @param[in] buf_size the output buffer size
- * @param[in] samples the input buffer containing the samples
- * The number of samples read from this buffer is frame_size*channels,
- * both of which are defined in avctx.
- * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of
- * samples read from samples is equal to:
- * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id))
- * This also implies that av_get_bits_per_sample() must not return 0 for these
- * codecs.
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used to encode the data read from the input buffer.
- */
-int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples);
-#endif
-
/**
* Encode a frame of audio.
*
@@ -4585,8 +4569,8 @@ int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
* called to free the user supplied buffer).
* @param[in] frame AVFrame containing the raw audio data to be encoded.
* May be NULL when flushing an encoder that has the
- * CODEC_CAP_DELAY capability set.
- * If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ * AV_CODEC_CAP_DELAY capability set.
+ * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
* can have any number of samples.
* If it is not set, frame->nb_samples must be equal to
* avctx->frame_size for all frames except the last.
@@ -4602,26 +4586,6 @@ int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr);
-#if FF_API_OLD_ENCODE_VIDEO
-/**
- * @deprecated use avcodec_encode_video2() instead.
- *
- * Encode a video frame from pict into buf.
- * The input picture should be
- * stored using a specific format, namely avctx.pix_fmt.
- *
- * @param avctx the codec context
- * @param[out] buf the output buffer for the bitstream of encoded frame
- * @param[in] buf_size the size of the output buffer in bytes
- * @param[in] pict the input picture to encode
- * @return On error a negative value is returned, on success zero or the number
- * of bytes used from the output buffer.
- */
-attribute_deprecated
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVFrame *pict);
-#endif
-
/**
* Encode a frame of video.
*
@@ -4647,7 +4611,7 @@ int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
* called to free the user supplied buffer).
* @param[in] frame AVFrame containing the raw video data to be encoded.
* May be NULL when flushing an encoder that has the
- * CODEC_CAP_DELAY capability set.
+ * AV_CODEC_CAP_DELAY capability set.
* @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
* output packet is non-empty, and to 0 if it is
* empty. If the function returns an error, the
@@ -4856,16 +4820,6 @@ int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
*/
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
-#if FF_API_DEINTERLACE
-/**
- * deinterlace - if not supported return -1
- *
- * @deprecated - use yadif (in libavfilter) instead
- */
-attribute_deprecated
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- enum AVPixelFormat pix_fmt, int width, int height);
-#endif
/**
* Copy image src to dst. Wraps av_image_copy().
*/
@@ -5184,7 +5138,7 @@ AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
/**
* Same behaviour av_fast_malloc but the buffer has additional
- * FF_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0.
+ * AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0.
*
* In addition the whole buffer will initially and after resizes
* be 0-initialized so that no uninitialized data will ever appear.
diff --git a/chromium/third_party/ffmpeg/libavcodec/avdct.c b/chromium/third_party/ffmpeg/libavcodec/avdct.c
index f92c691adb9..3b622bac232 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avdct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avdct.c
@@ -58,7 +58,9 @@ static const AVOption avdct_options[] = {
#if FF_API_ARCH_ALPHA
{"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
#endif
+#if FF_API_UNUSED_MEMBERS
{"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
+#endif
{"xvid", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"faani", "floating point AAN IDCT (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
diff --git a/chromium/third_party/ffmpeg/libavcodec/avpacket.c b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
index aae67c5a008..32fa51f24f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avpacket.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
@@ -30,22 +30,6 @@
#include "bytestream.h"
#include "internal.h"
-#if FF_API_DESTRUCT_PACKET
-
-void av_destruct_packet(AVPacket *pkt)
-{
- av_freep(&pkt->data);
- pkt->size = 0;
-}
-
-/* a dummy destruct callback for the callers that assume AVPacket.destruct ==
- * NULL => static data */
-static void dummy_destruct_packet(AVPacket *pkt)
-{
- av_assert0(0);
-}
-#endif
-
void av_init_packet(AVPacket *pkt)
{
pkt->pts = AV_NOPTS_VALUE;
@@ -55,11 +39,6 @@ void av_init_packet(AVPacket *pkt)
pkt->convergence_duration = 0;
pkt->flags = 0;
pkt->stream_index = 0;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->side_data = NULL;
pkt->side_data_elems = 0;
@@ -68,14 +47,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
static int packet_alloc(AVBufferRef **buf, int size)
{
int ret;
- if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
+ if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR(EINVAL);
- ret = av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
- memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
return 0;
}
@@ -91,11 +70,6 @@ int av_new_packet(AVPacket *pkt, int size)
pkt->buf = buf;
pkt->data = buf->data;
pkt->size = size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return 0;
}
@@ -105,20 +79,20 @@ void av_shrink_packet(AVPacket *pkt, int size)
if (pkt->size <= size)
return;
pkt->size = size;
- memset(pkt->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(pkt->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
int av_grow_packet(AVPacket *pkt, int grow_by)
{
int new_size;
- av_assert0((unsigned)pkt->size <= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE);
+ av_assert0((unsigned)pkt->size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE);
if (!pkt->size)
return av_new_packet(pkt, grow_by);
if ((unsigned)grow_by >
- INT_MAX - (pkt->size + FF_INPUT_BUFFER_PADDING_SIZE))
+ INT_MAX - (pkt->size + AV_INPUT_BUFFER_PADDING_SIZE))
return -1;
- new_size = pkt->size + grow_by + FF_INPUT_BUFFER_PADDING_SIZE;
+ new_size = pkt->size + grow_by + AV_INPUT_BUFFER_PADDING_SIZE;
if (pkt->buf) {
int ret = av_buffer_realloc(&pkt->buf, new_size);
if (ret < 0)
@@ -128,36 +102,26 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
if (!pkt->buf)
return AVERROR(ENOMEM);
memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by));
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
pkt->data = pkt->buf->data;
pkt->size += grow_by;
- memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
return 0;
}
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
{
- if (size >= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
+ if (size >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR(EINVAL);
- pkt->buf = av_buffer_create(data, size + FF_INPUT_BUFFER_PADDING_SIZE,
+ pkt->buf = av_buffer_create(data, size + AV_INPUT_BUFFER_PADDING_SIZE,
av_buffer_default_free, NULL, 0);
if (!pkt->buf)
return AVERROR(ENOMEM);
pkt->data = data;
pkt->size = size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return 0;
}
@@ -174,9 +138,9 @@ do { \
void *data; \
if (padding) { \
if ((unsigned)(size) > \
- (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE) \
+ (unsigned)(size) + AV_INPUT_BUFFER_PADDING_SIZE) \
goto failed_alloc; \
- ALLOC(data, size + FF_INPUT_BUFFER_PADDING_SIZE); \
+ ALLOC(data, size + AV_INPUT_BUFFER_PADDING_SIZE); \
} else { \
ALLOC(data, size); \
} \
@@ -185,7 +149,7 @@ do { \
memcpy(data, src, size); \
if (padding) \
memset((uint8_t *)data + size, 0, \
- FF_INPUT_BUFFER_PADDING_SIZE); \
+ AV_INPUT_BUFFER_PADDING_SIZE); \
dst = data; \
} while (0)
@@ -203,11 +167,6 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
} else {
DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
}
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (pkt->side_data_elems && dup)
pkt->side_data = src->side_data;
if (pkt->side_data_elems && !dup) {
@@ -249,13 +208,7 @@ int av_dup_packet(AVPacket *pkt)
{
AVPacket tmp_pkt;
-FF_DISABLE_DEPRECATION_WARNINGS
- if (!pkt->buf && pkt->data
-#if FF_API_DESTRUCT_PACKET
- && !pkt->destruct
-#endif
- ) {
-FF_ENABLE_DEPRECATION_WARNINGS
+ if (!pkt->buf && pkt->data) {
tmp_pkt = *pkt;
return copy_packet_data(pkt, &tmp_pkt, 1);
}
@@ -280,15 +233,8 @@ void av_packet_free_side_data(AVPacket *pkt)
void av_free_packet(AVPacket *pkt)
{
if (pkt) {
-FF_DISABLE_DEPRECATION_WARNINGS
if (pkt->buf)
av_buffer_unref(&pkt->buf);
-#if FF_API_DESTRUCT_PACKET
- else if (pkt->destruct)
- pkt->destruct(pkt);
- pkt->destruct = NULL;
-#endif
-FF_ENABLE_DEPRECATION_WARNINGS
pkt->data = NULL;
pkt->size = 0;
@@ -303,7 +249,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
return NULL;
- if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
+ if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
return NULL;
pkt->side_data = av_realloc(pkt->side_data,
@@ -311,7 +257,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
if (!pkt->side_data)
return NULL;
- pkt->side_data[elems].data = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ pkt->side_data[elems].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!pkt->side_data[elems].data)
return NULL;
pkt->side_data[elems].size = size;
@@ -366,7 +312,7 @@ int av_packet_merge_side_data(AVPacket *pkt){
AVBufferRef *buf;
int i;
uint8_t *p;
- uint64_t size= pkt->size + 8LL + FF_INPUT_BUFFER_PADDING_SIZE;
+ uint64_t size= pkt->size + 8LL + AV_INPUT_BUFFER_PADDING_SIZE;
AVPacket old= *pkt;
for (i=0; i<old.side_data_elems; i++) {
size += old.side_data[i].size + 5LL;
@@ -378,12 +324,7 @@ int av_packet_merge_side_data(AVPacket *pkt){
return AVERROR(ENOMEM);
pkt->buf = buf;
pkt->data = p = buf->data;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
- pkt->size = size - FF_INPUT_BUFFER_PADDING_SIZE;
+ pkt->size = size - AV_INPUT_BUFFER_PADDING_SIZE;
bytestream_put_buffer(&p, old.data, old.size);
for (i=old.side_data_elems-1; i>=0; i--) {
bytestream_put_buffer(&p, old.side_data[i].data, old.side_data[i].size);
@@ -392,7 +333,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
bytestream_put_be64(&p, FF_MERGE_MARKER);
av_assert0(p-pkt->data == pkt->size);
- memset(p, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(p, 0, AV_INPUT_BUFFER_PADDING_SIZE);
av_free_packet(&old);
pkt->side_data_elems = 0;
pkt->side_data = NULL;
@@ -425,7 +366,7 @@ int av_packet_split_side_data(AVPacket *pkt){
for (i=0; ; i++){
size= AV_RB32(p);
av_assert0(size<=INT_MAX && p - pkt->data >= size);
- pkt->side_data[i].data = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
pkt->side_data[i].size = size;
pkt->side_data[i].type = p[4]&127;
if (!pkt->side_data[i].data)
@@ -602,3 +543,28 @@ void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb)
if (pkt->convergence_duration > 0)
pkt->convergence_duration = av_rescale_q(pkt->convergence_duration, src_tb, dst_tb);
}
+
+int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
+{
+ uint8_t *side_data;
+ int side_data_size;
+ int i;
+
+ side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS, &side_data_size);
+ if (!side_data) {
+ side_data_size = 4+4+8*error_count;
+ side_data = av_packet_new_side_data(pkt, AV_PKT_DATA_QUALITY_STATS,
+ side_data_size);
+ }
+
+ if (!side_data || side_data_size < 4+4+8*error_count)
+ return AVERROR(ENOMEM);
+
+ AV_WL32(side_data , quality );
+ side_data[4] = pict_type;
+ side_data[5] = error_count;
+ for (i = 0; i<error_count; i++)
+ AV_WL64(side_data+8 + 8*i , error[i]);
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/avrndec.c b/chromium/third_party/ffmpeg/libavcodec/avrndec.c
index 7a50a5c3b1b..5e40d664dc1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avrndec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avrndec.c
@@ -26,7 +26,7 @@
#include "libavutil/imgutils.h"
typedef struct {
- MJpegDecodeContext mjpeg_ctx;
+ AVCodecContext *mjpeg_avctx;
int is_mjpeg;
int interlace; //FIXME use frame.interlaced_frame
int tff;
@@ -45,8 +45,31 @@ static av_cold int init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- if(a->is_mjpeg)
- return ff_mjpeg_decode_init(avctx);
+ if(a->is_mjpeg) {
+ AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
+ AVDictionary *thread_opt = NULL;
+ if (!codec) {
+ av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
+ return AVERROR_DECODER_NOT_FOUND;
+ }
+
+ a->mjpeg_avctx = avcodec_alloc_context3(codec);
+
+ av_dict_set(&thread_opt, "threads", "1", 0); // Is this needed ?
+ a->mjpeg_avctx->refcounted_frames = 1;
+ a->mjpeg_avctx->flags = avctx->flags;
+ a->mjpeg_avctx->idct_algo = avctx->idct_algo;
+ a->mjpeg_avctx->lowres = avctx->lowres;
+ a->mjpeg_avctx->width = avctx->width;
+ a->mjpeg_avctx->height = avctx->height;
+
+ if ((ret = ff_codec_open2_recursive(a->mjpeg_avctx, codec, &thread_opt)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "MJPEG codec failed to open\n");
+ }
+ av_dict_free(&thread_opt);
+
+ return ret;
+ }
if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
return ret;
@@ -68,8 +91,8 @@ static av_cold int end(AVCodecContext *avctx)
{
AVRnContext *a = avctx->priv_data;
- if(a->is_mjpeg)
- ff_mjpeg_decode_end(avctx);
+ avcodec_close(a->mjpeg_avctx);
+ av_freep(&a->mjpeg_avctx);
return 0;
}
@@ -83,8 +106,27 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int buf_size = avpkt->size;
int y, ret, true_height;
- if(a->is_mjpeg)
- return ff_mjpeg_decode_frame(avctx, data, got_frame, avpkt);
+ if(a->is_mjpeg) {
+ ret = avcodec_decode_video2(a->mjpeg_avctx, data, got_frame, avpkt);
+
+ if (ret >= 0 && *got_frame && avctx->width <= p->width && avctx->height <= p->height) {
+ int shift = p->height - avctx->height;
+ int subsample_h, subsample_v;
+
+ av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &subsample_h, &subsample_v);
+
+ p->data[0] += p->linesize[0] * shift;
+ if (p->data[2]) {
+ p->data[1] += p->linesize[1] * (shift>>subsample_v);
+ p->data[2] += p->linesize[2] * (shift>>subsample_v);
+ }
+
+ p->width = avctx->width;
+ p->height = avctx->height;
+ }
+ avctx->pix_fmt = a->mjpeg_avctx->pix_fmt;
+ return ret;
+ }
true_height = buf_size / (2*avctx->width);
@@ -126,6 +168,6 @@ AVCodec ff_avrn_decoder = {
.init = init,
.close = end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/avs.c b/chromium/third_party/ffmpeg/libavcodec/avs.c
index 820568964ac..345d628dd56 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avs.c
@@ -185,5 +185,5 @@ AVCodec ff_avs_decoder = {
.init = avs_decode_init,
.decode = avs_decode_frame,
.close = avs_decode_end,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/avuidec.c b/chromium/third_party/ffmpeg/libavcodec/avuidec.c
index 7fb644cc6ad..5117844fa9d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avuidec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avuidec.c
@@ -126,5 +126,5 @@ AVCodec ff_avui_decoder = {
.id = AV_CODEC_ID_AVUI,
.init = avui_decode_init,
.decode = avui_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/avuienc.c b/chromium/third_party/ffmpeg/libavcodec/avuienc.c
index b91f7829559..b219906706f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avuienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avuienc.c
@@ -30,7 +30,7 @@ static av_cold int avui_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");
return AVERROR(EINVAL);
}
- if (!(avctx->extradata = av_mallocz(144 + FF_INPUT_BUFFER_PADDING_SIZE)))
+ if (!(avctx->extradata = av_mallocz(144 + AV_INPUT_BUFFER_PADDING_SIZE)))
return AVERROR(ENOMEM);
avctx->extradata_size = 144;
memcpy(avctx->extradata, "\0\0\0\x18""APRGAPRG0001", 16);
@@ -44,11 +44,6 @@ static av_cold int avui_encode_init(AVCodecContext *avctx)
AV_WB32(avctx->extradata + 48, avctx->height);
memcpy(avctx->extradata + 52, "\0\0\0\x1\0\0\0\x20\0\0\0\x2", 12);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
return 0;
}
@@ -67,16 +62,14 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
skip = 16;
}
size = 2 * avctx->width * (avctx->height + skip) + 8 * interlaced;
- if ((ret = ff_alloc_packet2(avctx, pkt, size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, size, size)) < 0)
return ret;
dst = pkt->data;
if (!interlaced) {
+ memset(dst, 0, avctx->width * skip);
dst += avctx->width * skip;
}
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
for (i = 0; i <= interlaced; i++) {
uint8_t *src;
if (interlaced && avctx->height == 486) {
@@ -84,6 +77,7 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
} else {
src = pic->data[0] + i * pic->linesize[0];
}
+ memset(dst, 0, avctx->width * skip + 4 * i);
dst += avctx->width * skip + 4 * i;
for (j = 0; j < avctx->height; j += interlaced + 1) {
memcpy(dst, src, avctx->width * 2);
@@ -97,13 +91,6 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int avui_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
-
- return 0;
-}
-
AVCodec ff_avui_encoder = {
.name = "avui",
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
@@ -111,7 +98,6 @@ AVCodec ff_avui_encoder = {
.id = AV_CODEC_ID_AVUI,
.init = avui_encode_init,
.encode2 = avui_encode_frame,
- .close = avui_encode_close,
- .capabilities = CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bethsoftvideo.c b/chromium/third_party/ffmpeg/libavcodec/bethsoftvideo.c
index 37cd22eb399..97b745d38a0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bethsoftvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bethsoftvideo.c
@@ -162,5 +162,5 @@ AVCodec ff_bethsoftvid_decoder = {
.init = bethsoftvid_decode_init,
.close = bethsoftvid_decode_end,
.decode = bethsoftvid_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bfi.c b/chromium/third_party/ffmpeg/libavcodec/bfi.c
index 77bca4902f9..6727629b52b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bfi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bfi.c
@@ -184,5 +184,5 @@ AVCodec ff_bfi_decoder = {
.init = bfi_decode_init,
.close = bfi_decode_close,
.decode = bfi_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bink.c b/chromium/third_party/ffmpeg/libavcodec/bink.c
index c793fa79e6c..131eaa16f7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bink.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bink.c
@@ -1354,5 +1354,5 @@ AVCodec ff_bink_decoder = {
.close = decode_end,
.decode = decode_frame,
.flush = flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/binkaudio.c b/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
index f30ea1236f4..5cc23311f5e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/binkaudio.c
@@ -302,10 +302,10 @@ static int decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
return AVERROR_INVALIDDATA;
}
- buf = av_realloc(s->packet_buffer, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buf = av_realloc(s->packet_buffer, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf)
return AVERROR(ENOMEM);
- memset(buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(buf + avpkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
s->packet_buffer = buf;
memcpy(s->packet_buffer, avpkt->data, avpkt->size);
if ((ret = init_get_bits8(gb, s->packet_buffer, avpkt->size)) < 0)
@@ -343,7 +343,7 @@ AVCodec ff_binkaudio_rdft_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
};
AVCodec ff_binkaudio_dct_decoder = {
@@ -355,5 +355,5 @@ AVCodec ff_binkaudio_dct_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bintext.c b/chromium/third_party/ffmpeg/libavcodec/bintext.c
index 97fceb12b84..90bbe67b59b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bintext.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bintext.c
@@ -227,7 +227,7 @@ AVCodec ff_bintext_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_XBIN_DECODER
@@ -240,7 +240,7 @@ AVCodec ff_xbin_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_IDF_DECODER
@@ -253,6 +253,6 @@ AVCodec ff_idf_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/blockdsp.c b/chromium/third_party/ffmpeg/libavcodec/blockdsp.c
index f5259f637f5..42e177bae65 100644
--- a/chromium/third_party/ffmpeg/libavcodec/blockdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/blockdsp.c
@@ -72,9 +72,7 @@ av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
if (ARCH_PPC)
ff_blockdsp_init_ppc(c, high_bit_depth);
if (ARCH_X86)
-#if FF_API_XVMC
ff_blockdsp_init_x86(c, high_bit_depth, avctx);
-#else
- ff_blockdsp_init_x86(c, high_bit_depth);
-#endif /* FF_API_XVMC */
+ if (ARCH_MIPS)
+ ff_blockdsp_init_mips(c, high_bit_depth);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/blockdsp.h b/chromium/third_party/ffmpeg/libavcodec/blockdsp.h
index c7ad265db13..654ecdc3d89 100644
--- a/chromium/third_party/ffmpeg/libavcodec/blockdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/blockdsp.h
@@ -43,11 +43,8 @@ void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx);
void ff_blockdsp_init_alpha(BlockDSPContext *c, unsigned high_bit_depth);
void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth);
void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth);
-#if FF_API_XVMC
void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
AVCodecContext *avctx);
-#else
-void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth);
-#endif /* FF_API_XVMC */
+void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth);
#endif /* AVCODEC_BLOCKDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmp.c b/chromium/third_party/ffmpeg/libavcodec/bmp.c
index a35ed1ac1e3..3019d010160 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmp.c
@@ -337,6 +337,20 @@ static int bmp_decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
}
+ if (avctx->pix_fmt == AV_PIX_FMT_BGRA) {
+ for (i = 0; i < avctx->height; i++) {
+ int j;
+ uint8_t *ptr = p->data[0] + p->linesize[0]*i + 3;
+ for (j = 0; j < avctx->width; j++) {
+ if (ptr[4*j])
+ break;
+ }
+ if (j < avctx->width)
+ break;
+ }
+ if (i == avctx->height)
+ avctx->pix_fmt = p->format = AV_PIX_FMT_BGR0;
+ }
*got_frame = 1;
@@ -349,5 +363,5 @@ AVCodec ff_bmp_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BMP,
.decode = bmp_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmpenc.c b/chromium/third_party/ffmpeg/libavcodec/bmpenc.c
index 2a1956dc4ab..e829d684756 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmpenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmpenc.c
@@ -60,10 +60,6 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){
return AVERROR(EINVAL);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
return 0;
}
@@ -78,8 +74,12 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int bit_count = avctx->bits_per_coded_sample;
uint8_t *ptr, *buf;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGB444:
compression = BMP_BITFIELDS;
@@ -118,7 +118,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
#define SIZE_BITMAPINFOHEADER 40
hsize = SIZE_BITMAPFILEHEADER + SIZE_BITMAPINFOHEADER + (pal_entries << 2);
n_bytes = n_bytes_image + hsize;
- if ((ret = ff_alloc_packet2(avctx, pkt, n_bytes)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, n_bytes, 0)) < 0)
return ret;
buf = pkt->data;
bytestream_put_byte(&buf, 'B'); // BITMAPFILEHEADER.bfType
@@ -163,12 +163,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int bmp_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_bmp_encoder = {
.name = "bmp",
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
@@ -176,7 +170,6 @@ AVCodec ff_bmp_encoder = {
.id = AV_CODEC_ID_BMP,
.init = bmp_encode_init,
.encode2 = bmp_encode_frame,
- .close = bmp_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444,
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmvaudio.c b/chromium/third_party/ffmpeg/libavcodec/bmvaudio.c
index 0e473df90c3..b1587ab3660 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmvaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmvaudio.c
@@ -85,5 +85,5 @@ AVCodec ff_bmv_audio_decoder = {
.id = AV_CODEC_ID_BMV_AUDIO,
.init = bmv_aud_decode_init,
.decode = bmv_aud_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bmvvideo.c b/chromium/third_party/ffmpeg/libavcodec/bmvvideo.c
index 76a3d6f1f64..97f850dbae5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bmvvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bmvvideo.c
@@ -294,5 +294,5 @@ AVCodec ff_bmv_video_decoder = {
.priv_data_size = sizeof(BMVDecContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/brenderpix.c b/chromium/third_party/ffmpeg/libavcodec/brenderpix.c
index 02d922f8f5e..0556858de17 100644
--- a/chromium/third_party/ffmpeg/libavcodec/brenderpix.c
+++ b/chromium/third_party/ffmpeg/libavcodec/brenderpix.c
@@ -288,5 +288,5 @@ AVCodec ff_brender_pix_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_BRENDER_PIX,
.decode = pix_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/bytestream.h b/chromium/third_party/ffmpeg/libavcodec/bytestream.h
index c2cb6018061..7c05ea6cf54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bytestream.h
+++ b/chromium/third_party/ffmpeg/libavcodec/bytestream.h
@@ -71,8 +71,10 @@ static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \
} \
static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \
{ \
- if (g->buffer_end - g->buffer < bytes) \
+ if (g->buffer_end - g->buffer < bytes) { \
+ g->buffer = g->buffer_end; \
return 0; \
+ } \
return bytestream2_get_ ## name ## u(g); \
} \
static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \
diff --git a/chromium/third_party/ffmpeg/libavcodec/c93.c b/chromium/third_party/ffmpeg/libavcodec/c93.c
index eff8887c276..fd026acb8a0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/c93.c
+++ b/chromium/third_party/ffmpeg/libavcodec/c93.c
@@ -182,7 +182,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int from_y = offset / WIDTH;
if (block_type == C93_4X4_FROM_CURR && from_y == y+j &&
(FFABS(from_x - x-i) < 4 || FFABS(from_x - x-i) > WIDTH-4)) {
- avpriv_request_sample(avctx, "block overlap %d %d %d %d\n", from_x, x+i, from_y, y+j);
+ avpriv_request_sample(avctx, "block overlap %d %d %d %d", from_x, x+i, from_y, y+j);
return AVERROR_INVALIDDATA;
}
if ((ret = copy_block(avctx, &out[j*stride+i],
@@ -268,5 +268,5 @@ AVCodec ff_c93_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cavsdec.c b/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
index bf8c301e2e5..8f5d58d10e9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cavsdec.c
@@ -1262,6 +1262,6 @@ AVCodec ff_cavs_decoder = {
.init = ff_cavs_init,
.close = ff_cavs_end,
.decode = cavs_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = cavs_flush,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbrt_fixed_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/cbrt_fixed_tablegen.c
new file mode 100644
index 00000000000..24d2fbb7e0e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/cbrt_fixed_tablegen.c
@@ -0,0 +1,24 @@
+/*
+ * Generate a header file for hardcoded AAC cube-root table
+ *
+ * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+#include "cbrt_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.c
index e0a8e63a8bb..8c2235e9876 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.c
@@ -20,18 +20,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "cbrt_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
- cbrt_tableinit();
-
- write_fileheader();
-
- WRITE_ARRAY("static const", uint32_t, cbrt_tab);
-
- return 0;
-}
+#define USE_FIXED 0
+#include "cbrt_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.h
index d8c77c2221c..27a3e3ae29d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen.h
@@ -26,14 +26,26 @@
#include <stdint.h>
#include <math.h>
#include "libavutil/attributes.h"
+#include "libavcodec/aac_defines.h"
+
+#if USE_FIXED
+#define CBRT(x) (int)floor((x).f * 8192 + 0.5)
+#else
+#define CBRT(x) x.i
+#endif
#if CONFIG_HARDCODED_TABLES
+#if USE_FIXED
+#define cbrt_tableinit_fixed()
+#include "libavcodec/cbrt_fixed_tables.h"
+#else
#define cbrt_tableinit()
#include "libavcodec/cbrt_tables.h"
+#endif
#else
static uint32_t cbrt_tab[1 << 13];
-static av_cold void cbrt_tableinit(void)
+static av_cold void AAC_RENAME(cbrt_tableinit)(void)
{
if (!cbrt_tab[(1<<13) - 1]) {
int i;
@@ -44,7 +56,7 @@ static av_cold void cbrt_tableinit(void)
uint32_t i;
} f;
f.f = pow(i, 1.0 / 3.0) * i;
- cbrt_tab[i] = f.i;
+ cbrt_tab[i] = CBRT(f);
}
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_internal.h b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen_template.c
index 457916b0588..9dd2cf5de63 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbrt_tablegen_template.c
@@ -1,4 +1,8 @@
/*
+ * Generate a header file for hardcoded AAC cube-root table
+ *
+ * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -16,18 +20,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef AVCODEC_VDA_INTERNAL_H
-#define AVCODEC_VDA_INTERNAL_H
+#include <stdlib.h>
+#define CONFIG_HARDCODED_TABLES 0
+#include "cbrt_tablegen.h"
+#include "tableprint.h"
-#include "vda.h"
+int main(void)
+{
+ AAC_RENAME(cbrt_tableinit)();
-void ff_vda_output_callback(void *vda_hw_ctx,
- CFDictionaryRef user_info,
- OSStatus status,
- uint32_t infoFlags,
- CVImageBufferRef image_buffer);
+ write_fileheader();
-int ff_vda_default_init(AVCodecContext *avctx);
-void ff_vda_default_free(AVCodecContext *avctx);
+ WRITE_ARRAY("static const", uint32_t, cbrt_tab);
-#endif /* AVCODEC_VDA_INTERNAL_H */
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/ccaption_dec.c b/chromium/third_party/ffmpeg/libavcodec/ccaption_dec.c
index 264d21cf8bb..9f67caa0283 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ccaption_dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ccaption_dec.c
@@ -21,6 +21,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#define SCREEN_ROWS 15
@@ -451,9 +452,9 @@ static void handle_char(CCaptionSubContext *ctx, char hi, char lo, int64_t pts)
ctx->prev_cmd[0] = 0;
ctx->prev_cmd[1] = 0;
if (lo)
- av_dlog(ctx, "(%c,%c)\n",hi,lo);
+ ff_dlog(ctx, "(%c,%c)\n",hi,lo);
else
- av_dlog(ctx, "(%c)\n",hi);
+ ff_dlog(ctx, "(%c)\n",hi);
}
static int process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint8_t lo)
@@ -493,21 +494,21 @@ static int process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint8
ret = handle_edm(ctx, pts);
} else if ( COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2D ) {
/* carriage return */
- av_dlog(ctx, "carriage return\n");
+ ff_dlog(ctx, "carriage return\n");
reap_screen(ctx, pts);
roll_up(ctx);
ctx->screen_changed = 1;
ctx->cursor_column = 0;
} else if ( COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2F ) {
/* end of caption */
- av_dlog(ctx, "handle_eoc\n");
+ ff_dlog(ctx, "handle_eoc\n");
ret = handle_eoc(ctx, pts);
} else if (hi>=0x20) {
/* Standard characters (always in pairs) */
handle_char(ctx, hi, lo, pts);
} else {
/* Ignoring all other non data code */
- av_dlog(ctx, "Unknown command 0x%hhx 0x%hhx\n", hi, lo);
+ ff_dlog(ctx, "Unknown command 0x%hhx 0x%hhx\n", hi, lo);
}
/* set prev command */
@@ -553,7 +554,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
{
int start_time = av_rescale_q(ctx->start_time, avctx->time_base, (AVRational){ 1, 100 });
int end_time = av_rescale_q(ctx->end_time, avctx->time_base, (AVRational){ 1, 100 });
- av_dlog(ctx, "cdp writing data (%s)\n",ctx->buffer.str);
+ ff_dlog(ctx, "cdp writing data (%s)\n",ctx->buffer.str);
ret = ff_ass_add_rect_bprint(sub, &ctx->buffer, start_time, end_time - start_time);
if (ret < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cdgraphics.c b/chromium/third_party/ffmpeg/libavcodec/cdgraphics.c
index 340df44818b..aca7cb057b0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cdgraphics.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cdgraphics.c
@@ -376,5 +376,5 @@ AVCodec ff_cdgraphics_decoder = {
.init = cdg_decode_init,
.close = cdg_decode_end,
.decode = cdg_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cdxl.c b/chromium/third_party/ffmpeg/libavcodec/cdxl.c
index 1117cab3a15..27234adf97b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cdxl.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cdxl.c
@@ -270,7 +270,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
if (encoding) {
av_fast_padded_malloc(&c->new_video, &c->new_video_size,
- h * w + FF_INPUT_BUFFER_PADDING_SIZE);
+ h * w + AV_INPUT_BUFFER_PADDING_SIZE);
if (!c->new_video)
return AVERROR(ENOMEM);
if (c->bpp == 8)
@@ -303,5 +303,5 @@ AVCodec ff_cdxl_decoder = {
.init = cdxl_decode_init,
.close = cdxl_decode_end,
.decode = cdxl_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cinepak.c b/chromium/third_party/ffmpeg/libavcodec/cinepak.c
index 1a6d4f55fb7..f1a46563038 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cinepak.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cinepak.c
@@ -484,5 +484,5 @@ AVCodec ff_cinepak_decoder = {
.init = cinepak_decode_init,
.close = cinepak_decode_end,
.decode = cinepak_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c b/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c
index 2931fa3bc8d..0f0b8cde7a5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cinepakenc.c
@@ -1275,7 +1275,7 @@ static int cinepak_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE;
- if ((ret = ff_alloc_packet2(avctx, pkt, s->frame_buf_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->frame_buf_size, 0)) < 0)
return ret;
ret = rd_frame(s, frame, (s->curframe == 0), pkt->data, s->frame_buf_size);
pkt->size = ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cljrdec.c b/chromium/third_party/ffmpeg/libavcodec/cljrdec.c
index 68c877175bf..4b187f8cf3b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cljrdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cljrdec.c
@@ -89,6 +89,6 @@ AVCodec ff_cljr_decoder = {
.id = AV_CODEC_ID_CLJR,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cljrenc.c b/chromium/third_party/ffmpeg/libavcodec/cljrenc.c
index c672f800f68..a3718259d1c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cljrenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cljrenc.c
@@ -56,7 +56,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return AVERROR_EXPERIMENTAL;
}
- if ((ret = ff_alloc_packet2(avctx, pkt, 32*avctx->height*avctx->width/4)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, 32*avctx->height*avctx->width/4, 0)) < 0)
return ret;
init_put_bits(&pb, pkt->data, pkt->size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/cllc.c b/chromium/third_party/ffmpeg/libavcodec/cllc.c
index c9ab8b9346e..1c6902afd43 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cllc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cllc.c
@@ -495,5 +495,5 @@ AVCodec ff_cllc_decoder = {
.init = cllc_decode_init,
.decode = cllc_decode_frame,
.close = cllc_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cngdec.c b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
index c49e903ce8a..c0295cd77fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
@@ -167,5 +167,5 @@ AVCodec ff_comfortnoise_decoder = {
.close = cng_decode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cngenc.c b/chromium/third_party/ffmpeg/libavcodec/cngenc.c
index 58918aa9583..302c703f721 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cngenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cngenc.c
@@ -75,7 +75,7 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int qdbov;
int16_t *samples = (int16_t*) frame->data[0];
- if ((ret = ff_alloc_packet(avpkt, 1 + p->order))) {
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 1 + p->order, 1 + p->order))) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
return ret;
}
@@ -97,7 +97,7 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avpkt->data[1 + i] = p->ref_coef[i] * 127 + 127;
*got_packet_ptr = 1;
- avpkt->size = 1 + p->order;
+ av_assert1(avpkt->size == 1 + p->order);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
index f32843afa73..e2f5176a03b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
@@ -1252,6 +1252,20 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_HAP,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "hap",
+ .long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap decoder"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_DXV,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "dxv",
+ .long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
/* image codecs */
{
@@ -1276,6 +1290,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
+ .id = AV_CODEC_ID_DDS,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "dds",
+ .long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+ },
+ {
.id = AV_CODEC_ID_DPX,
.type = AVMEDIA_TYPE_VIDEO,
.name = "dpx",
@@ -1820,7 +1842,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
.id = AV_CODEC_ID_ADPCM_THP,
.type = AVMEDIA_TYPE_AUDIO,
.name = "adpcm_thp",
- .long_name = NULL_IF_CONFIG_SMALL("ADPCM Nintendo Gamecube THP"),
+ .long_name = NULL_IF_CONFIG_SMALL("ADPCM Nintendo THP"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
+ .id = AV_CODEC_ID_ADPCM_THP_LE,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "adpcm_thp_le",
+ .long_name = NULL_IF_CONFIG_SMALL("ADPCM Nintendo THP (Little-Endian)"),
.props = AV_CODEC_PROP_LOSSY,
},
{
@@ -2517,6 +2546,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
+ .id = AV_CODEC_ID_4GV,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "4gv",
+ .long_name = NULL_IF_CONFIG_SMALL("4GV (Fourth Generation Vocoder)"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
.id = AV_CODEC_ID_DSD_LSBF,
.type = AVMEDIA_TYPE_AUDIO,
.name = "dsd_lsbf",
@@ -2641,6 +2677,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_SUBTITLE,
.name = "eia_608",
.long_name = NULL_IF_CONFIG_SMALL("EIA-608 closed captions"),
+ .props = AV_CODEC_PROP_TEXT_SUB,
},
{
.id = AV_CODEC_ID_JACOSUB,
@@ -2705,6 +2742,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
.props = AV_CODEC_PROP_TEXT_SUB,
},
+ {
+ .id = AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
+ .type = AVMEDIA_TYPE_SUBTITLE,
+ .name = "hdmv_text_subtitle",
+ .long_name = NULL_IF_CONFIG_SMALL("HDMV Text subtitle"),
+ .props = AV_CODEC_PROP_TEXT_SUB,
+ },
/* other kind of codecs and pseudo-codecs */
{
@@ -2769,123 +2813,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
},
/* deprecated codec ids */
- {
- .id = AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "brender_pix_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image (deprecated id)"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_ESCAPE130_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "escape130_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("Escape 130 (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_EXR_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "exr_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image (deprecated id)"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
- AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_G2M_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "g2m_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_HEVC_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "hevc_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding) (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "paf_video_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_SANM_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "sanm_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/SMUSH video (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_VP7_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "vp7_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("On2 VP7 (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_WEBP_DEPRECATED,
- .type = AVMEDIA_TYPE_VIDEO,
- .name = "webp_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("WebP (deprecated id)"),
- .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
- AV_CODEC_PROP_LOSSLESS,
- },
-
-#if FF_API_VIMA_DECODER
- {
- .id = AV_CODEC_ID_VIMA,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "vima",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
-#endif
- {
- .id = AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "adpcm_vima_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_OPUS_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "opus_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec) (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "paf_audio_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSY,
- },
- {
- .id = AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "pcm_s24le_planar_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit little-endian planar (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "pcm_s32le_planar_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit little-endian planar (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSLESS,
- },
- {
- .id = AV_CODEC_ID_TAK_DEPRECATED,
- .type = AVMEDIA_TYPE_AUDIO,
- .name = "tak_deprecated",
- .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor) (deprecated id)"),
- .props = AV_CODEC_PROP_LOSSLESS,
- },
};
const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id)
diff --git a/chromium/third_party/ffmpeg/libavcodec/cook.c b/chromium/third_party/ffmpeg/libavcodec/cook.c
index 75b184a94f2..673896d6cde 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cook.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cook.c
@@ -1232,11 +1232,11 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
/* Pad the databuffer with:
DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(),
- FF_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
+ AV_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
q->decoded_bytes_buffer =
av_mallocz(avctx->block_align
+ DECODE_BYTES_PAD1(avctx->block_align)
- + FF_INPUT_BUFFER_PADDING_SIZE);
+ + AV_INPUT_BUFFER_PADDING_SIZE);
if (!q->decoded_bytes_buffer)
return AVERROR(ENOMEM);
@@ -1282,7 +1282,7 @@ AVCodec ff_cook_decoder = {
.init = cook_decode_init,
.close = cook_decode_close,
.decode = cook_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cpia.c b/chromium/third_party/ffmpeg/libavcodec/cpia.c
index 9036cb37fca..6b784b20517 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cpia.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cpia.c
@@ -229,5 +229,5 @@ AVCodec ff_cpia_decoder = {
.init = cpia_decode_init,
.close = cpia_decode_end,
.decode = cpia_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/crystalhd.c b/chromium/third_party/ffmpeg/libavcodec/crystalhd.c
index 001afa4ff46..3cb32a8c59b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/crystalhd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/crystalhd.c
@@ -422,7 +422,7 @@ static av_cold int init(AVCodecContext *avctx)
int dummy_int;
/* Back up the extradata so it can be restored at close time. */
- priv->orig_extradata = av_malloc(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ priv->orig_extradata = av_malloc(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!priv->orig_extradata) {
av_log(avctx, AV_LOG_ERROR,
"Failed to allocate copy of extradata\n");
@@ -1098,7 +1098,7 @@ AVCodec ff_h264_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &h264_class,
@@ -1122,7 +1122,7 @@ AVCodec ff_mpeg2_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &mpeg2_class,
@@ -1146,7 +1146,7 @@ AVCodec ff_mpeg4_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &mpeg4_class,
@@ -1170,7 +1170,7 @@ AVCodec ff_msmpeg4_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &msmpeg4_class,
@@ -1194,7 +1194,7 @@ AVCodec ff_vc1_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &vc1_class,
@@ -1218,7 +1218,7 @@ AVCodec ff_wmv3_crystalhd_decoder = {
.init = init,
.close = uninit,
.decode = decode,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = flush,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE},
.priv_class = &wmv3_class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/cscd.c b/chromium/third_party/ffmpeg/libavcodec/cscd.c
index 07f2f5ed8fb..9e1dec9d967 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cscd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cscd.c
@@ -127,7 +127,7 @@ static av_cold int decode_init(AVCodecContext *avctx) {
switch (avctx->bits_per_coded_sample) {
case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555LE; break;
case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break;
- case 32: avctx->pix_fmt = AV_PIX_FMT_BGRA; break;
+ case 32: avctx->pix_fmt = AV_PIX_FMT_BGR0; break;
default:
av_log(avctx, AV_LOG_ERROR,
"CamStudio codec error: invalid depth %i bpp\n",
@@ -166,5 +166,5 @@ AVCodec ff_cscd_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/cyuv.c b/chromium/third_party/ffmpeg/libavcodec/cyuv.c
index 6e8e461ae0f..c7ec0085b00 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cyuv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cyuv.c
@@ -184,7 +184,7 @@ AVCodec ff_aura_decoder = {
.priv_data_size = sizeof(CyuvDecodeContext),
.init = cyuv_decode_init,
.decode = cyuv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -197,6 +197,6 @@ AVCodec ff_cyuv_decoder = {
.priv_data_size = sizeof(CyuvDecodeContext),
.init = cyuv_decode_init,
.decode = cyuv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/d3d11va.h b/chromium/third_party/ffmpeg/libavcodec/d3d11va.h
index d51e2ff8f57..3d810f53793 100644
--- a/chromium/third_party/ffmpeg/libavcodec/d3d11va.h
+++ b/chromium/third_party/ffmpeg/libavcodec/d3d11va.h
@@ -30,9 +30,9 @@
* Public libavcodec D3D11VA header.
*/
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
+#define _WIN32_WINNT 0x0602
#endif
#include <stdint.h>
diff --git a/chromium/third_party/ffmpeg/libavcodec/dca_parser.c b/chromium/third_party/ffmpeg/libavcodec/dca_parser.c
index 9dafe706e22..337a99d2cb3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dca_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dca_parser.c
@@ -113,7 +113,7 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration,
int *sample_rate, int *framesize)
{
GetBitContext gb;
- uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
+ uint8_t hdr[12 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
int ret, sample_blocks, sr_code;
if (buf_size < 12)
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcadec.c b/chromium/third_party/ffmpeg/libavcodec/dcadec.c
index 3ea1bcfc9de..741f2f766dd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcadec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dcadec.c
@@ -1669,11 +1669,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
/* If we have XXCH then the channel layout is managed differently */
/* note that XLL will also have another way to do things */
- if (!(s->core_ext_mask & DCA_EXT_XXCH)
- || (s->core_ext_mask & DCA_EXT_XXCH && avctx->request_channels > 0
- && avctx->request_channels
- < num_core_channels + !!s->lfe + s->xxch_chset_nch[0]))
- { /* xxx should also do MA extensions */
+ if (!(s->core_ext_mask & DCA_EXT_XXCH)) {
+ /* xxx should also do MA extensions */
if (s->amode < 16) {
avctx->channel_layout = ff_dca_core_channel_layout[s->amode];
@@ -1687,15 +1684,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
s->xch_disable = 1;
}
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (s->xch_present && !s->xch_disable &&
- (!avctx->request_channels ||
- avctx->request_channels > num_core_channels + !!s->lfe)) {
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
if (s->xch_present && !s->xch_disable) {
-#endif
if (avctx->channel_layout & AV_CH_BACK_CENTER) {
avpriv_request_sample(avctx, "XCh with Back center channel");
return AVERROR_INVALIDDATA;
@@ -1750,15 +1739,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
/* we only get here if an XXCH channel set can be added to the mix */
channel_mask = s->xxch_core_spkmask;
- if (avctx->request_channels > 0
- && avctx->request_channels < s->prim_channels) {
- channels = num_core_channels + !!s->lfe;
- for (i = 0; i < s->xxch_chset && channels + s->xxch_chset_nch[i]
- <= avctx->request_channels; i++) {
- channels += s->xxch_chset_nch[i];
- channel_mask |= s->xxch_spk_masks[i];
- }
- } else {
+ {
channels = s->prim_channels + !!s->lfe;
for (i = 0; i < s->xxch_chset; i++) {
channel_mask |= s->xxch_spk_masks[i];
@@ -1988,7 +1969,7 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
dca_init_vlcs();
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
@@ -2000,12 +1981,6 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
/* allow downmixing to stereo */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->request_channels == 2)
- avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->channels > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)
avctx->channels = 2;
@@ -2056,7 +2031,7 @@ AVCodec ff_dca_decoder = {
.init = dca_decode_init,
.decode = dca_decode_frame,
.close = dca_decode_end,
- .capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
diff --git a/chromium/third_party/ffmpeg/libavcodec/dcaenc.c b/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
index c8a215c2008..23587a7bd7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dcaenc.c
@@ -916,7 +916,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const int32_t *samples;
int ret, i;
- if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size )) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size , 0)) < 0)
return ret;
samples = (const int32_t *)frame->data[0];
@@ -938,6 +938,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
for (i = 0; i < SUBFRAMES; i++)
put_subframe(c, i);
+
+ for (i = put_bits_count(&c->pb); i < 8*c->frame_size; i++)
+ put_bits(&c->pb, 1, 0);
+
flush_put_bits(&c->pb);
avpkt->pts = frame->pts;
@@ -960,7 +964,7 @@ AVCodec ff_dca_encoder = {
.priv_data_size = sizeof(DCAEncContext),
.init = encode_init,
.encode2 = encode_frame,
- .capabilities = CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = sample_rates,
diff --git a/chromium/third_party/ffmpeg/libavcodec/dct32.h b/chromium/third_party/ffmpeg/libavcodec/dct32.h
index f4b2471de21..61bf223a8d6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dct32.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dct32.h
@@ -22,4 +22,4 @@
void ff_dct32_float(float *dst, const float *src);
void ff_dct32_fixed(int *dst, const int *src);
-#endif
+#endif /* AVCODEC_DCT32_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/dds.c b/chromium/third_party/ffmpeg/libavcodec/dds.c
new file mode 100644
index 00000000000..a604d5690f9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dds.c
@@ -0,0 +1,699 @@
+/*
+ * DirectDraw Surface image decoder
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * DDS decoder
+ *
+ * https://msdn.microsoft.com/en-us/library/bb943982%28v=vs.85%29.aspx
+ */
+
+#include <stdint.h>
+
+#include "libavutil/imgutils.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+#include "texturedsp.h"
+#include "thread.h"
+
+#define DDPF_FOURCC (1 << 2)
+#define DDPF_PALETTE (1 << 5)
+#define DDPF_NORMALMAP (1 << 31)
+
+enum DDSPostProc {
+ DDS_NONE = 0,
+ DDS_ALPHA_EXP,
+ DDS_NORMAL_MAP,
+ DDS_RAW_YCOCG,
+ DDS_SWAP_ALPHA,
+ DDS_SWIZZLE_A2XY,
+ DDS_SWIZZLE_RBXG,
+ DDS_SWIZZLE_RGXB,
+ DDS_SWIZZLE_RXBG,
+ DDS_SWIZZLE_RXGB,
+ DDS_SWIZZLE_XGBR,
+ DDS_SWIZZLE_XRBG,
+ DDS_SWIZZLE_XGXR,
+};
+
+enum DDSDXGIFormat {
+ DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
+ DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
+ DXGI_FORMAT_R16G16B16A16_UNORM = 11,
+ DXGI_FORMAT_R16G16B16A16_UINT = 12,
+ DXGI_FORMAT_R16G16B16A16_SNORM = 13,
+ DXGI_FORMAT_R16G16B16A16_SINT = 14,
+
+ DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
+ DXGI_FORMAT_R8G8B8A8_UNORM = 28,
+ DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
+ DXGI_FORMAT_R8G8B8A8_UINT = 30,
+ DXGI_FORMAT_R8G8B8A8_SNORM = 31,
+ DXGI_FORMAT_R8G8B8A8_SINT = 32,
+
+ DXGI_FORMAT_BC1_TYPELESS = 70,
+ DXGI_FORMAT_BC1_UNORM = 71,
+ DXGI_FORMAT_BC1_UNORM_SRGB = 72,
+ DXGI_FORMAT_BC2_TYPELESS = 73,
+ DXGI_FORMAT_BC2_UNORM = 74,
+ DXGI_FORMAT_BC2_UNORM_SRGB = 75,
+ DXGI_FORMAT_BC3_TYPELESS = 76,
+ DXGI_FORMAT_BC3_UNORM = 77,
+ DXGI_FORMAT_BC3_UNORM_SRGB = 78,
+ DXGI_FORMAT_BC4_TYPELESS = 79,
+ DXGI_FORMAT_BC4_UNORM = 80,
+ DXGI_FORMAT_BC4_SNORM = 81,
+ DXGI_FORMAT_BC5_TYPELESS = 82,
+ DXGI_FORMAT_BC5_UNORM = 83,
+ DXGI_FORMAT_BC5_SNORM = 84,
+ DXGI_FORMAT_B5G6R5_UNORM = 85,
+ DXGI_FORMAT_B8G8R8A8_UNORM = 87,
+ DXGI_FORMAT_B8G8R8X8_UNORM = 88,
+ DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
+ DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
+ DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
+ DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
+};
+
+typedef struct DDSContext {
+ TextureDSPContext texdsp;
+ GetByteContext gbc;
+
+ int compressed;
+ int paletted;
+ enum DDSPostProc postproc;
+
+ const uint8_t *tex_data; // Compressed texture
+ int tex_ratio; // Compression ratio
+ int slice_count; // Number of slices for threaded operations
+
+ /* Pointer to the selected compress or decompress function. */
+ int (*tex_funct)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+} DDSContext;
+
+static int parse_pixel_format(AVCodecContext *avctx)
+{
+ DDSContext *ctx = avctx->priv_data;
+ GetByteContext *gbc = &ctx->gbc;
+ char buf[32];
+ uint32_t flags, fourcc, gimp_tag;
+ enum DDSDXGIFormat dxgi;
+ int size, bpp, r, g, b, a;
+ int alpha_exponent, ycocg_classic, ycocg_scaled, normal_map, array;
+
+ /* Alternative DDS implementations use reserved1 as custom header. */
+ bytestream2_skip(gbc, 4 * 3);
+ gimp_tag = bytestream2_get_le32(gbc);
+ alpha_exponent = gimp_tag == MKTAG('A', 'E', 'X', 'P');
+ ycocg_classic = gimp_tag == MKTAG('Y', 'C', 'G', '1');
+ ycocg_scaled = gimp_tag == MKTAG('Y', 'C', 'G', '2');
+ bytestream2_skip(gbc, 4 * 7);
+
+ /* Now the real DDPF starts. */
+ size = bytestream2_get_le32(gbc);
+ if (size != 32) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid pixel format header %d.\n", size);
+ return AVERROR_INVALIDDATA;
+ }
+ flags = bytestream2_get_le32(gbc);
+ ctx->compressed = flags & DDPF_FOURCC;
+ ctx->paletted = flags & DDPF_PALETTE;
+ normal_map = flags & DDPF_NORMALMAP;
+ fourcc = bytestream2_get_le32(gbc);
+
+ bpp = bytestream2_get_le32(gbc); // rgbbitcount
+ r = bytestream2_get_le32(gbc); // rbitmask
+ g = bytestream2_get_le32(gbc); // gbitmask
+ b = bytestream2_get_le32(gbc); // bbitmask
+ a = bytestream2_get_le32(gbc); // abitmask
+
+ bytestream2_skip(gbc, 4); // caps
+ bytestream2_skip(gbc, 4); // caps2
+ bytestream2_skip(gbc, 4); // caps3
+ bytestream2_skip(gbc, 4); // caps4
+ bytestream2_skip(gbc, 4); // reserved2
+
+ av_get_codec_tag_string(buf, sizeof(buf), fourcc);
+ av_log(avctx, AV_LOG_VERBOSE, "fourcc %s bpp %d "
+ "r 0x%x g 0x%x b 0x%x a 0x%x\n", buf, bpp, r, g, b, a);
+ if (gimp_tag) {
+ av_get_codec_tag_string(buf, sizeof(buf), gimp_tag);
+ av_log(avctx, AV_LOG_VERBOSE, "and GIMP-DDS tag %s\n", buf);
+ }
+
+ if (ctx->compressed)
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+
+ if (ctx->compressed) {
+ switch (fourcc) {
+ case MKTAG('D', 'X', 'T', '1'):
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.dxt1a_block;
+ break;
+ case MKTAG('D', 'X', 'T', '2'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt2_block;
+ break;
+ case MKTAG('D', 'X', 'T', '3'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt3_block;
+ break;
+ case MKTAG('D', 'X', 'T', '4'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt4_block;
+ break;
+ case MKTAG('D', 'X', 'T', '5'):
+ ctx->tex_ratio = 16;
+ if (ycocg_scaled)
+ ctx->tex_funct = ctx->texdsp.dxt5ys_block;
+ else if (ycocg_classic)
+ ctx->tex_funct = ctx->texdsp.dxt5y_block;
+ else
+ ctx->tex_funct = ctx->texdsp.dxt5_block;
+ break;
+ case MKTAG('R', 'X', 'G', 'B'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt5_block;
+ /* This format may be considered as a normal map,
+ * but it is handled differently in a separate postproc. */
+ ctx->postproc = DDS_SWIZZLE_RXGB;
+ normal_map = 0;
+ break;
+ case MKTAG('A', 'T', 'I', '1'):
+ case MKTAG('B', 'C', '4', 'U'):
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.rgtc1u_block;
+ break;
+ case MKTAG('B', 'C', '4', 'S'):
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.rgtc1s_block;
+ break;
+ case MKTAG('A', 'T', 'I', '2'):
+ /* RGT2 variant with swapped R and G (3Dc)*/
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxn3dc_block;
+ break;
+ case MKTAG('B', 'C', '5', 'U'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.rgtc2u_block;
+ break;
+ case MKTAG('B', 'C', '5', 'S'):
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.rgtc2s_block;
+ break;
+ case MKTAG('U', 'Y', 'V', 'Y'):
+ ctx->compressed = 0;
+ avctx->pix_fmt = AV_PIX_FMT_UYVY422;
+ break;
+ case MKTAG('Y', 'U', 'Y', '2'):
+ ctx->compressed = 0;
+ avctx->pix_fmt = AV_PIX_FMT_YUYV422;
+ break;
+ case MKTAG('P', '8', ' ', ' '):
+ /* ATI Palette8, same as normal palette */
+ ctx->compressed = 0;
+ ctx->paletted = 1;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ break;
+ case MKTAG('D', 'X', '1', '0'):
+ /* DirectX 10 extra header */
+ dxgi = bytestream2_get_le32(gbc);
+ bytestream2_skip(gbc, 4); // resourceDimension
+ bytestream2_skip(gbc, 4); // miscFlag
+ array = bytestream2_get_le32(gbc);
+ bytestream2_skip(gbc, 4); // miscFlag2
+
+ if (array != 0)
+ av_log(avctx, AV_LOG_VERBOSE,
+ "Found array of size %d (ignored).\n", array);
+
+ /* Only BC[1-5] are actually compressed. */
+ ctx->compressed = (dxgi >= 70) && (dxgi <= 84);
+
+ av_log(avctx, AV_LOG_VERBOSE, "DXGI format %d.\n", dxgi);
+ switch (dxgi) {
+ /* RGB types. */
+ case DXGI_FORMAT_R16G16B16A16_TYPELESS:
+ case DXGI_FORMAT_R16G16B16A16_FLOAT:
+ case DXGI_FORMAT_R16G16B16A16_UNORM:
+ case DXGI_FORMAT_R16G16B16A16_UINT:
+ case DXGI_FORMAT_R16G16B16A16_SNORM:
+ case DXGI_FORMAT_R16G16B16A16_SINT:
+ avctx->pix_fmt = AV_PIX_FMT_BGRA64;
+ break;
+ case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_R8G8B8A8_TYPELESS:
+ case DXGI_FORMAT_R8G8B8A8_UNORM:
+ case DXGI_FORMAT_R8G8B8A8_UINT:
+ case DXGI_FORMAT_R8G8B8A8_SNORM:
+ case DXGI_FORMAT_R8G8B8A8_SINT:
+ avctx->pix_fmt = AV_PIX_FMT_BGRA;
+ break;
+ case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_B8G8R8A8_TYPELESS:
+ case DXGI_FORMAT_B8G8R8A8_UNORM:
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+ break;
+ case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_B8G8R8X8_TYPELESS:
+ case DXGI_FORMAT_B8G8R8X8_UNORM:
+ avctx->pix_fmt = AV_PIX_FMT_RGBA; // opaque
+ break;
+ case DXGI_FORMAT_B5G6R5_UNORM:
+ avctx->pix_fmt = AV_PIX_FMT_RGB565LE;
+ break;
+ /* Texture types. */
+ case DXGI_FORMAT_BC1_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_BC1_TYPELESS:
+ case DXGI_FORMAT_BC1_UNORM:
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.dxt1a_block;
+ break;
+ case DXGI_FORMAT_BC2_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_BC2_TYPELESS:
+ case DXGI_FORMAT_BC2_UNORM:
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt3_block;
+ break;
+ case DXGI_FORMAT_BC3_UNORM_SRGB:
+ avctx->colorspace = AVCOL_SPC_RGB;
+ case DXGI_FORMAT_BC3_TYPELESS:
+ case DXGI_FORMAT_BC3_UNORM:
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.dxt5_block;
+ break;
+ case DXGI_FORMAT_BC4_TYPELESS:
+ case DXGI_FORMAT_BC4_UNORM:
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.rgtc1u_block;
+ break;
+ case DXGI_FORMAT_BC4_SNORM:
+ ctx->tex_ratio = 8;
+ ctx->tex_funct = ctx->texdsp.rgtc1s_block;
+ break;
+ case DXGI_FORMAT_BC5_TYPELESS:
+ case DXGI_FORMAT_BC5_UNORM:
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.rgtc2u_block;
+ break;
+ case DXGI_FORMAT_BC5_SNORM:
+ ctx->tex_ratio = 16;
+ ctx->tex_funct = ctx->texdsp.rgtc2s_block;
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR,
+ "Unsupported DXGI format %d.\n", dxgi);
+ return AVERROR_INVALIDDATA;
+ }
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR, "Unsupported %s fourcc.\n", buf);
+ return AVERROR_INVALIDDATA;
+ }
+ } else if (ctx->paletted) {
+ if (bpp == 8) {
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported palette bpp %d.\n", bpp);
+ return AVERROR_INVALIDDATA;
+ }
+ } else {
+ /* 8 bpp */
+ if (bpp == 8 && r == 0xff && g == 0 && b == 0 && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
+ /* 16 bpp */
+ else if (bpp == 16 && r == 0xff && g == 0 && b == 0 && a == 0xff00)
+ avctx->pix_fmt = AV_PIX_FMT_YA8;
+ else if (bpp == 16 && r == 0xffff && g == 0 && b == 0 && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
+ else if (bpp == 16 && r == 0xf800 && g == 0x7e0 && b == 0x1f && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_RGB565LE;
+ /* 24 bpp */
+ else if (bpp == 24 && r == 0xff0000 && g == 0xff00 && b == 0xff && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
+ /* 32 bpp */
+ else if (bpp == 32 && r == 0xff0000 && g == 0xff00 && b == 0xff && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_BGR0; // opaque
+ else if (bpp == 32 && r == 0xff && g == 0xff00 && b == 0xff0000 && a == 0)
+ avctx->pix_fmt = AV_PIX_FMT_RGB0; // opaque
+ else if (bpp == 32 && r == 0xff0000 && g == 0xff00 && b == 0xff && a == 0xff000000)
+ avctx->pix_fmt = AV_PIX_FMT_BGRA;
+ else if (bpp == 32 && r == 0xff && g == 0xff00 && b == 0xff0000 && a == 0xff000000)
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+ /* give up */
+ else {
+ av_log(avctx, AV_LOG_ERROR, "Unknown pixel format "
+ "[bpp %d r 0x%x g 0x%x b 0x%x a 0x%x].\n", bpp, r, g, b, a);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ /* Set any remaining post-proc that should happen before frame is ready. */
+ if (alpha_exponent)
+ ctx->postproc = DDS_ALPHA_EXP;
+ else if (normal_map)
+ ctx->postproc = DDS_NORMAL_MAP;
+ else if (ycocg_classic && !ctx->compressed)
+ ctx->postproc = DDS_RAW_YCOCG;
+ else if (avctx->pix_fmt == AV_PIX_FMT_YA8)
+ ctx->postproc = DDS_SWAP_ALPHA;
+
+ /* ATI/NVidia variants sometimes add swizzling in bpp. */
+ switch (bpp) {
+ case MKTAG('A', '2', 'X', 'Y'):
+ ctx->postproc = DDS_SWIZZLE_A2XY;
+ break;
+ case MKTAG('x', 'G', 'B', 'R'):
+ ctx->postproc = DDS_SWIZZLE_XGBR;
+ break;
+ case MKTAG('x', 'R', 'B', 'G'):
+ ctx->postproc = DDS_SWIZZLE_XRBG;
+ break;
+ case MKTAG('R', 'B', 'x', 'G'):
+ ctx->postproc = DDS_SWIZZLE_RBXG;
+ break;
+ case MKTAG('R', 'G', 'x', 'B'):
+ ctx->postproc = DDS_SWIZZLE_RGXB;
+ break;
+ case MKTAG('R', 'x', 'B', 'G'):
+ ctx->postproc = DDS_SWIZZLE_RXBG;
+ break;
+ case MKTAG('x', 'G', 'x', 'R'):
+ ctx->postproc = DDS_SWIZZLE_XGXR;
+ break;
+ case MKTAG('A', '2', 'D', '5'):
+ ctx->postproc = DDS_NORMAL_MAP;
+ break;
+ }
+
+ return 0;
+}
+
+static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
+ int slice, int thread_nb)
+{
+ DDSContext *ctx = avctx->priv_data;
+ AVFrame *frame = arg;
+ const uint8_t *d = ctx->tex_data;
+ int w_block = avctx->coded_width / TEXTURE_BLOCK_W;
+ int h_block = avctx->coded_height / TEXTURE_BLOCK_H;
+ int x, y;
+ int start_slice, end_slice;
+ int base_blocks_per_slice = h_block / ctx->slice_count;
+ int remainder_blocks = h_block % ctx->slice_count;
+
+ /* When the frame height (in blocks) doesn't divide evenly between the
+ * number of slices, spread the remaining blocks evenly between the first
+ * operations */
+ start_slice = slice * base_blocks_per_slice;
+ /* Add any extra blocks (one per slice) that have been added before this slice */
+ start_slice += FFMIN(slice, remainder_blocks);
+
+ end_slice = start_slice + base_blocks_per_slice;
+ /* Add an extra block if there are still remainder blocks to be accounted for */
+ if (slice < remainder_blocks)
+ end_slice++;
+
+ for (y = start_slice; y < end_slice; y++) {
+ uint8_t *p = frame->data[0] + y * frame->linesize[0] * TEXTURE_BLOCK_H;
+ int off = y * w_block;
+ for (x = 0; x < w_block; x++) {
+ ctx->tex_funct(p + x * 16, frame->linesize[0],
+ d + (off + x) * ctx->tex_ratio);
+ }
+ }
+
+ return 0;
+}
+
+static void do_swizzle(AVFrame *frame, int x, int y)
+{
+ int i;
+ for (i = 0; i < frame->linesize[0] * frame->height; i += 4) {
+ uint8_t *src = frame->data[0] + i;
+ FFSWAP(uint8_t, src[x], src[y]);
+ }
+}
+
+static void run_postproc(AVCodecContext *avctx, AVFrame *frame)
+{
+ DDSContext *ctx = avctx->priv_data;
+ int i, x_off;
+
+ switch (ctx->postproc) {
+ case DDS_ALPHA_EXP:
+ /* Alpha-exponential mode divides each channel by the maximum
+ * R, G or B value, and stores the multiplying factor in the
+ * alpha channel. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing alpha exponent.\n");
+
+ for (i = 0; i < frame->linesize[0] * frame->height; i += 4) {
+ uint8_t *src = frame->data[0] + i;
+ int r = src[0];
+ int g = src[1];
+ int b = src[2];
+ int a = src[3];
+
+ src[0] = r * a / 255;
+ src[1] = g * a / 255;
+ src[2] = b * a / 255;
+ src[3] = 255;
+ }
+ break;
+ case DDS_NORMAL_MAP:
+ /* Normal maps work in the XYZ color space and they encode
+ * X in R or in A, depending on the texture type, Y in G and
+ * derive Z with a square root of the distance.
+ *
+ * http://www.realtimecollisiondetection.net/blog/?p=28 */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing normal map.\n");
+
+ x_off = ctx->tex_ratio == 8 ? 0 : 3;
+ for (i = 0; i < frame->linesize[0] * frame->height; i += 4) {
+ uint8_t *src = frame->data[0] + i;
+ int x = src[x_off];
+ int y = src[1];
+ int z = 127;
+
+ int d = (255 * 255 - x * x - y * y) / 2;
+ if (d > 0)
+ z = rint(sqrtf(d));
+
+ src[0] = x;
+ src[1] = y;
+ src[2] = z;
+ src[3] = 255;
+ }
+ break;
+ case DDS_RAW_YCOCG:
+ /* Data is Y-Co-Cg-A and not RGBA, but they are represented
+ * with the same masks in the DDPF header. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing raw YCoCg.\n");
+
+ for (i = 0; i < frame->linesize[0] * frame->height; i += 4) {
+ uint8_t *src = frame->data[0] + i;
+ int a = src[0];
+ int cg = src[1] - 128;
+ int co = src[2] - 128;
+ int y = src[3];
+
+ src[0] = av_clip_uint8(y + co - cg);
+ src[1] = av_clip_uint8(y + cg);
+ src[2] = av_clip_uint8(y - co - cg);
+ src[3] = a;
+ }
+ break;
+ case DDS_SWAP_ALPHA:
+ /* Alpha and Luma are stored swapped. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing swapped Luma/Alpha.\n");
+
+ for (i = 0; i < frame->linesize[0] * frame->height; i += 2) {
+ uint8_t *src = frame->data[0] + i;
+ FFSWAP(uint8_t, src[0], src[1]);
+ }
+ break;
+ case DDS_SWIZZLE_A2XY:
+ /* Swap R and G, often used to restore a standard RGTC2. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing A2XY swizzle.\n");
+ do_swizzle(frame, 0, 1);
+ break;
+ case DDS_SWIZZLE_RBXG:
+ /* Swap G and A, then B and new A (G). */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing RBXG swizzle.\n");
+ do_swizzle(frame, 1, 3);
+ do_swizzle(frame, 2, 3);
+ break;
+ case DDS_SWIZZLE_RGXB:
+ /* Swap B and A. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing RGXB swizzle.\n");
+ do_swizzle(frame, 2, 3);
+ break;
+ case DDS_SWIZZLE_RXBG:
+ /* Swap G and A. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing RXBG swizzle.\n");
+ do_swizzle(frame, 1, 3);
+ break;
+ case DDS_SWIZZLE_RXGB:
+ /* Swap R and A (misleading name). */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing RXGB swizzle.\n");
+ do_swizzle(frame, 0, 3);
+ break;
+ case DDS_SWIZZLE_XGBR:
+ /* Swap B and A, then R and new A (B). */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing XGBR swizzle.\n");
+ do_swizzle(frame, 2, 3);
+ do_swizzle(frame, 0, 3);
+ break;
+ case DDS_SWIZZLE_XGXR:
+ /* Swap G and A, then R and new A (G), then new R (G) and new G (A).
+ * This variant does not store any B component. */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing XGXR swizzle.\n");
+ do_swizzle(frame, 1, 3);
+ do_swizzle(frame, 0, 3);
+ do_swizzle(frame, 0, 1);
+ break;
+ case DDS_SWIZZLE_XRBG:
+ /* Swap G and A, then R and new A (G). */
+ av_log(avctx, AV_LOG_DEBUG, "Post-processing XRBG swizzle.\n");
+ do_swizzle(frame, 1, 3);
+ do_swizzle(frame, 0, 3);
+ break;
+ }
+}
+
+static int dds_decode(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ DDSContext *ctx = avctx->priv_data;
+ GetByteContext *gbc = &ctx->gbc;
+ AVFrame *frame = data;
+ int mipmap;
+ int ret;
+
+ ff_texturedsp_init(&ctx->texdsp);
+ bytestream2_init(gbc, avpkt->data, avpkt->size);
+
+ if (bytestream2_get_bytes_left(gbc) < 128) {
+ av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).",
+ bytestream2_get_bytes_left(gbc));
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (bytestream2_get_le32(gbc) != MKTAG('D', 'D', 'S', ' ') ||
+ bytestream2_get_le32(gbc) != 124) { // header size
+ av_log(avctx, AV_LOG_ERROR, "Invalid DDS header.");
+ return AVERROR_INVALIDDATA;
+ }
+
+ bytestream2_skip(gbc, 4); // flags
+
+ avctx->height = bytestream2_get_le32(gbc);
+ avctx->width = bytestream2_get_le32(gbc);
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n",
+ avctx->width, avctx->height);
+ return ret;
+ }
+
+ /* Since codec is based on 4x4 blocks, size is aligned to 4. */
+ avctx->coded_width = FFALIGN(avctx->width, TEXTURE_BLOCK_W);
+ avctx->coded_height = FFALIGN(avctx->height, TEXTURE_BLOCK_H);
+
+ bytestream2_skip(gbc, 4); // pitch
+ bytestream2_skip(gbc, 4); // depth
+ mipmap = bytestream2_get_le32(gbc);
+ if (mipmap != 0)
+ av_log(avctx, AV_LOG_VERBOSE, "Found %d mipmaps (ignored).\n", mipmap);
+
+ /* Extract pixel format information, considering additional elements
+ * in reserved1 and reserved2. */
+ ret = parse_pixel_format(avctx);
+ if (ret < 0)
+ return ret;
+
+ ret = ff_get_buffer(avctx, frame, 0);
+ if (ret < 0)
+ return ret;
+
+ if (ctx->compressed) {
+ ctx->slice_count = av_clip(avctx->thread_count, 1,
+ avctx->coded_height / TEXTURE_BLOCK_H);
+
+ /* Use the decompress function on the texture, one block per thread. */
+ ctx->tex_data = gbc->buffer;
+ avctx->execute2(avctx, decompress_texture_thread, frame, NULL, ctx->slice_count);
+ } else {
+ int linesize = av_image_get_linesize(avctx->pix_fmt, frame->width, 0);
+
+ if (ctx->paletted) {
+ int i;
+ /* Use the first 1024 bytes as palette, then copy the rest. */
+ bytestream2_get_buffer(gbc, frame->data[1], 256 * 4);
+ for (i = 0; i < 256; i++)
+ AV_WN32(frame->data[1] + i*4,
+ (frame->data[1][2+i*4]<<0)+
+ (frame->data[1][1+i*4]<<8)+
+ (frame->data[1][0+i*4]<<16)+
+ (frame->data[1][3+i*4]<<24)
+ );
+
+ frame->palette_has_changed = 1;
+ }
+
+ av_image_copy_plane(frame->data[0], frame->linesize[0],
+ gbc->buffer, linesize,
+ linesize, frame->height);
+ }
+
+ /* Run any post processing here if needed. */
+ if (avctx->pix_fmt == AV_PIX_FMT_BGRA ||
+ avctx->pix_fmt == AV_PIX_FMT_RGBA ||
+ avctx->pix_fmt == AV_PIX_FMT_RGB0 ||
+ avctx->pix_fmt == AV_PIX_FMT_BGR0 ||
+ avctx->pix_fmt == AV_PIX_FMT_YA8)
+ run_postproc(avctx, frame);
+
+ /* Frame is ready to be output. */
+ frame->pict_type = AV_PICTURE_TYPE_I;
+ frame->key_frame = 1;
+ *got_frame = 1;
+
+ return avpkt->size;
+}
+
+AVCodec ff_dds_decoder = {
+ .name = "dds",
+ .long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_DDS,
+ .decode = dds_decode,
+ .priv_data_size = sizeof(DDSContext),
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dfa.c b/chromium/third_party/ffmpeg/libavcodec/dfa.c
index f13291ef28a..f45d019a792 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dfa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dfa.c
@@ -418,5 +418,5 @@ AVCodec ff_dfa_decoder = {
.init = dfa_decode_init,
.close = dfa_decode_end,
.decode = dfa_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/diracdec.c b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
index 0213048d3bd..ea16007f1d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/diracdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
@@ -83,6 +83,7 @@ typedef struct {
int interpolated[3]; /* 1 if hpel[] is valid */
uint8_t *hpel[3][4];
uint8_t *hpel_base[3][4];
+ int reference;
} DiracFrame;
typedef struct {
@@ -1563,7 +1564,7 @@ static void select_dsp_funcs(DiracContext *s, int width, int height, int xblen,
}
}
-static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
+static int interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
{
/* chroma allocates an edge of 8 when subsampled
which for 4:2:2 means an h edge of 16 and v edge of 8
@@ -1575,11 +1576,14 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
/* no need for hpel if we only have fpel vectors */
if (!s->mv_precision)
- return;
+ return 0;
for (i = 1; i < 4; i++) {
if (!ref->hpel_base[plane][i])
ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32);
+ if (!ref->hpel_base[plane][i]) {
+ return AVERROR(ENOMEM);
+ }
/* we need to be 16-byte aligned even for chroma */
ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16;
}
@@ -1593,6 +1597,8 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in
s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM);
}
ref->interpolated[plane] = 1;
+
+ return 0;
}
/**
@@ -1646,8 +1652,11 @@ static int dirac_decode_frame_internal(DiracContext *s)
select_dsp_funcs(s, p->width, p->height, p->xblen, p->yblen);
- for (i = 0; i < s->num_refs; i++)
- interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height);
+ for (i = 0; i < s->num_refs; i++) {
+ int ret = interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height);
+ if (ret < 0)
+ return ret;
+ }
memset(s->mctmp, 0, 4*p->yoffset*p->stride);
@@ -1763,13 +1772,13 @@ static int dirac_decode_picture_header(DiracContext *s)
}
/* retire the reference frames that are not used anymore */
- if (s->current_picture->avframe->reference) {
+ if (s->current_picture->reference) {
retire = (picnum + dirac_get_se_golomb(gb)) & 0xFFFFFFFF;
if (retire != picnum) {
DiracFrame *retire_pic = remove_frame(s->ref_frames, retire);
if (retire_pic)
- retire_pic->avframe->reference &= DELAYED_PIC_REF;
+ retire_pic->reference &= DELAYED_PIC_REF;
else
av_log(s->avctx, AV_LOG_DEBUG, "Frame to retire not found\n");
}
@@ -1777,7 +1786,7 @@ static int dirac_decode_picture_header(DiracContext *s)
/* if reference array is full, remove the oldest as per the spec */
while (add_frame(s->ref_frames, MAX_REFERENCE_FRAMES, s->current_picture)) {
av_log(s->avctx, AV_LOG_ERROR, "Reference frame overflow\n");
- remove_frame(s->ref_frames, s->ref_frames[0]->avframe->display_picture_number)->avframe->reference &= DELAYED_PIC_REF;
+ remove_frame(s->ref_frames, s->ref_frames[0]->avframe->display_picture_number)->reference &= DELAYED_PIC_REF;
}
}
@@ -1814,7 +1823,7 @@ static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
s->delay_frames[i] = s->delay_frames[i+1];
if (out) {
- out->avframe->reference ^= DELAYED_PIC_REF;
+ out->reference ^= DELAYED_PIC_REF;
*got_frame = 1;
if((ret = av_frame_ref(picture, out->avframe)) < 0)
return ret;
@@ -1900,7 +1909,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
s->num_refs = tmp;
s->is_arith = (parse_code & 0x48) == 0x08; /* [DIRAC_STD] using_ac() */
s->low_delay = (parse_code & 0x88) == 0x88; /* [DIRAC_STD] is_low_delay() */
- pic->avframe->reference = (parse_code & 0x0C) == 0x0C; /* [DIRAC_STD] is_reference() */
+ pic->reference = (parse_code & 0x0C) == 0x0C; /* [DIRAC_STD] is_reference() */
pic->avframe->key_frame = s->num_refs == 0; /* [DIRAC_STD] is_intra() */
pic->avframe->pict_type = s->num_refs + 1; /* Definition of AVPictureType in avutil.h */
@@ -1939,7 +1948,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* release unused frames */
for (i = 0; i < MAX_FRAMES; i++)
- if (s->all_frames[i].avframe->data[0] && !s->all_frames[i].avframe->reference) {
+ if (s->all_frames[i].avframe->data[0] && !s->all_frames[i].reference) {
av_frame_unref(s->all_frames[i].avframe);
memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated));
}
@@ -1989,7 +1998,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (s->current_picture->avframe->display_picture_number > s->frame_number) {
DiracFrame *delayed_frame = remove_frame(s->delay_frames, s->frame_number);
- s->current_picture->avframe->reference |= DELAYED_PIC_REF;
+ s->current_picture->reference |= DELAYED_PIC_REF;
if (add_frame(s->delay_frames, MAX_DELAY, s->current_picture)) {
int min_num = s->delay_frames[0]->avframe->display_picture_number;
@@ -2005,7 +2014,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
if (delayed_frame) {
- delayed_frame->avframe->reference ^= DELAYED_PIC_REF;
+ delayed_frame->reference ^= DELAYED_PIC_REF;
if((ret=av_frame_ref(data, delayed_frame->avframe)) < 0)
return ret;
*got_frame = 1;
@@ -2032,6 +2041,6 @@ AVCodec ff_dirac_decoder = {
.init = dirac_decode_init,
.close = dirac_decode_end,
.decode = dirac_decode_frame,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.flush = dirac_decode_flush,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
index ef918b02141..9d2e4e888db 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhddata.c
@@ -25,6 +25,7 @@
/* The quantization tables below are in zigzag order! */
+/* Used in CID 1235, 1256 */
static const uint8_t dnxhd_1235_luma_weight[] = {
0, 32, 32, 32, 33, 32, 32, 32,
32, 31, 32, 33, 33, 33, 33, 35,
@@ -47,6 +48,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
90, 90, 85, 79, 73, 73, 73, 73,
};
+/* Used in CID 1237, 1253 */
static const uint8_t dnxhd_1237_luma_weight[] = {
0, 32, 33, 34, 34, 36, 37, 36,
36, 37, 38, 38, 38, 39, 41, 44,
@@ -58,6 +60,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
97, 100, 104, 102, 98, 98, 99, 99,
};
+/* Used in CID 1237, 1253 */
static const uint8_t dnxhd_1237_chroma_weight[] = {
0, 32, 36, 39, 39, 38, 39, 41,
45, 51, 57, 58, 53, 48, 47, 51,
@@ -255,14 +258,71 @@ static const uint8_t dnxhd_1258_chroma_weight[] = {
74, 74, 90, 100, 128, 125, 116, 116,
};
+static const uint8_t dnxhd_1259_luma_weight[] = {
+ 0, 32, 36, 37, 41, 44, 54, 60,
+ 33, 34, 36, 39, 43, 51, 62, 78,
+ 34, 36, 38, 41, 49, 59, 73, 79,
+ 37, 38, 40, 47, 55, 66, 80, 95,
+ 38, 41, 46, 54, 63, 79, 93, 96,
+ 46, 47, 56, 64, 78, 90, 97, 98,
+ 49, 58, 66, 78, 89, 97, 102, 98,
+ 61, 65, 82, 87, 100, 104, 99, 99,
+};
+
+static const uint8_t dnxhd_1259_chroma_weight[] = {
+ 0, 32, 38, 39, 47, 51, 77, 83,
+ 36, 39, 41, 48, 55, 74, 85, 95,
+ 39, 45, 53, 58, 72, 83, 105, 89,
+ 51, 58, 66, 73, 82, 109, 92, 95,
+ 57, 75, 78, 89, 105, 95, 93, 96,
+ 81, 82, 99, 99, 94, 90, 97, 98,
+ 83, 96, 97, 93, 89, 97, 102, 98,
+ 90, 94, 92, 88, 100, 104, 99, 99,
+};
+
+static const uint8_t dnxhd_1260_luma_weight[] = {
+ 0, 32, 37, 37, 40, 41, 52, 53,
+ 33, 36, 36, 38, 40, 48, 49, 52,
+ 34, 34, 37, 39, 44, 47, 49, 54,
+ 33, 35, 38, 40, 45, 46, 54, 51,
+ 34, 37, 37, 42, 44, 49, 52, 48,
+ 34, 34, 38, 43, 44, 51, 50, 50,
+ 33, 36, 41, 44, 51, 52, 50, 54,
+ 36, 38, 44, 47, 53, 53, 54, 54,
+};
+
+static const uint8_t dnxhd_1260_chroma_weight[] = {
+ 0, 32, 40, 38, 42, 40, 45, 45,
+ 34, 42, 36, 43, 38, 46, 46, 49,
+ 38, 35, 43, 39, 44, 47, 47, 49,
+ 35, 42, 43, 42, 46, 47, 49, 52,
+ 38, 43, 43, 44, 50, 49, 56, 50,
+ 42, 43, 44, 50, 51, 57, 52, 53,
+ 41, 45, 46, 53, 53, 56, 53, 54,
+ 46, 46, 51, 49, 56, 53, 58, 58,
+};
+
+/* Used in CID 1235, 1241, 1250, 1256 */
+static const uint8_t dnxhd_1235_dc_codes[14] = {
+ 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
+};
+
+/* Used in CID 1235, 1241, 1250, 1256 */
+static const uint8_t dnxhd_1235_dc_bits[14] = {
+ 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
+};
+
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
static const uint8_t dnxhd_1237_dc_codes[12] = {
0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
};
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
static const uint8_t dnxhd_1237_dc_bits[12] = {
3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
};
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
static const uint16_t dnxhd_1237_ac_codes[257] = {
0, 1, 4, 5, 12, 26, 27, 56,
57, 58, 59, 120, 121, 244, 245, 246,
@@ -299,6 +359,7 @@ static const uint16_t dnxhd_1237_ac_codes[257] = {
65535,
};
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
static const uint8_t dnxhd_1237_ac_bits[257] = {
2, 2, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8,
8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11,
@@ -319,6 +380,7 @@ static const uint8_t dnxhd_1237_ac_bits[257] = {
16,
};
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
static const uint8_t dnxhd_1237_ac_level[257] = {
3, 3, 5, 0, 7, 9, 5, 11, 13, 15, 7, 17, 19, 21, 23, 25,
9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49,
@@ -339,6 +401,7 @@ static const uint8_t dnxhd_1237_ac_level[257] = {
129,
};
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
static const uint8_t dnxhd_1237_ac_flags[257] = {
0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0,
2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
@@ -359,39 +422,7 @@ static const uint8_t dnxhd_1237_ac_flags[257] = {
3,
};
-static const uint16_t dnxhd_1237_run_codes[62] = {
- 0, 4, 10, 11, 24, 25, 26, 54,
- 55, 56, 57, 58, 118, 119, 240, 482,
- 483, 484, 485, 486, 487, 488, 489, 490,
- 491, 492, 493, 494, 990, 991, 992, 993,
- 994, 995, 996, 997, 998, 999, 1000, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
- 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
- 1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1237_run_bits[62] = {
- 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1237_run[62] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56,
-};
-
-static const uint8_t dnxhd_1238_dc_codes[12] = {
- 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1238_dc_bits[12] = {
- 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
+/* Used in CID 1238, 1243 */
static const uint16_t dnxhd_1238_ac_codes[257] = {
0, 1, 4, 10, 11, 24, 25, 26,
54, 55, 56, 57, 116, 117, 118, 119,
@@ -428,6 +459,7 @@ static const uint16_t dnxhd_1238_ac_codes[257] = {
65535,
};
+/* Used in CID 1238, 1243 */
static const uint8_t dnxhd_1238_ac_bits[257] = {
2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10,
@@ -448,6 +480,7 @@ static const uint8_t dnxhd_1238_ac_bits[257] = {
16,
};
+/* Used in CID 1238, 1243 */
static const uint8_t dnxhd_1238_ac_level[257] = {
3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 45, 13, 15, 47, 49,
@@ -488,40 +521,8 @@ static const uint8_t dnxhd_1238_ac_flags[257] = {
3,
};
-static const uint16_t dnxhd_1235_1238_1241_run_codes[62] = {
- 0, 4, 10, 11, 24, 25, 26, 27,
- 56, 57, 58, 59, 120, 242, 486, 487,
- 488, 489, 980, 981, 982, 983, 984, 985,
- 986, 987, 988, 989, 990, 991, 992, 993,
- 994, 995, 996, 997, 998, 999, 1000, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
- 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
- 1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1235_1238_1241_run_bits[62] = {
- 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9,
- 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1238_run[62] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1235_1241_dc_codes[14] = {
- 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
-};
-
-static const uint8_t dnxhd_1235_1241_dc_bits[14] = {
- 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
-};
-
-static const uint16_t dnxhd_1235_1241_ac_codes[257] = {
+/* Used in CID 1235, 1241, 1256 */
+static const uint16_t dnxhd_1235_ac_codes[257] = {
0, 1, 4, 10, 11, 24, 25, 26,
54, 55, 56, 57, 116, 117, 118, 119,
240, 241, 242, 243, 244, 245, 492, 493,
@@ -557,7 +558,8 @@ static const uint16_t dnxhd_1235_1241_ac_codes[257] = {
65535,
};
-static const uint8_t dnxhd_1235_1241_ac_bits[257] = {
+/* Used in CID 1235, 1241, 1256 */
+static const uint8_t dnxhd_1235_ac_bits[257] = {
2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@@ -577,7 +579,8 @@ static const uint8_t dnxhd_1235_1241_ac_bits[257] = {
16,
};
-static const uint8_t dnxhd_1235_1241_ac_level[257] = {
+/* Used in CID 1235, 1241, 1256 */
+static const uint8_t dnxhd_1235_ac_level[257] = {
3, 3, 5, 7, 0, 9, 11, 5, 13, 15, 17, 7, 19, 21, 23, 9,
25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 13, 15, 45, 47, 49,
51, 53, 55, 57, 59, 17, 19, 61, 63, 65, 67, 69, 71, 73, 75, 77,
@@ -597,7 +600,8 @@ static const uint8_t dnxhd_1235_1241_ac_level[257] = {
129,
};
-static const uint8_t dnxhd_1235_1241_ac_flags[257] = {
+/* Used in CID 1235, 1241, 1256 */
+static const uint8_t dnxhd_1235_ac_flags[257] = {
0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0,
0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -617,19 +621,6 @@ static const uint8_t dnxhd_1235_1241_ac_flags[257] = {
3,
};
-static const uint8_t dnxhd_1235_1241_run[62] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1250_dc_codes[14] = {
- 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127
-};
-static const uint8_t dnxhd_1250_dc_bits[14] = {
- 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7
-};
static const uint16_t dnxhd_1250_ac_codes[257] = {
0, 1, 4, 10, 11, 24, 25, 26,
54, 55, 56, 57, 116, 117, 118, 119,
@@ -722,36 +713,6 @@ static const uint8_t dnxhd_1250_ac_flags[257] = {
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3,
};
-static const uint16_t dnxhd_1250_run_codes[62] = {
- 0, 4, 5, 12, 26, 27, 28, 58,
- 118, 119, 120, 242, 486, 487, 976, 977,
- 978, 979, 980, 981, 982, 983, 984, 985,
- 986, 987, 988, 989, 990, 991, 992, 993,
- 994, 995, 996, 997, 998, 999, 1000, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
- 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
- 1018, 1019, 1020, 1021, 1022, 1023
-};
-static const uint8_t dnxhd_1250_run_bits[62] = {
- 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
-};
-static const uint8_t dnxhd_1250_run[62] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62
-};
-
-static const uint8_t dnxhd_1251_dc_codes[12] = {
- 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1251_dc_bits[12] = {
- 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
static const uint16_t dnxhd_1251_ac_codes[257] = {
0, 1, 4, 10, 11, 24, 25, 26,
@@ -849,39 +810,7 @@ static const uint8_t dnxhd_1251_ac_flags[257] = {
3,
};
-static const uint16_t dnxhd_1251_run_codes[62] = {
- 0, 4, 5, 12, 26, 27, 28, 58,
- 118, 119, 120, 242, 486, 487, 976, 977,
- 978, 979, 980, 981, 982, 983, 984, 985,
- 986, 987, 988, 989, 990, 991, 992, 993,
- 994, 995, 996, 997, 998, 999, 1000, 1001,
- 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
- 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
- 1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1251_run_bits[62] = {
- 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1251_run[62] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1252_dc_codes[12] = {
- 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1252_dc_bits[12] = {
- 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
+/* Used in CID 1252, 1258 */
static const uint16_t dnxhd_1252_ac_codes[257] = {
0, 1, 4, 10, 11, 12, 26, 27,
56, 57, 58, 118, 119, 120, 242, 243,
@@ -918,6 +847,7 @@ static const uint16_t dnxhd_1252_ac_codes[257] = {
65535,
};
+/* Used in CID 1252, 1258 */
static const uint8_t dnxhd_1252_ac_bits[257] = {
2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10,
@@ -938,6 +868,7 @@ static const uint8_t dnxhd_1252_ac_bits[257] = {
16,
};
+/* Used in CID 1252, 1258 */
static const uint8_t dnxhd_1252_ac_level[257] = {
3, 3, 5, 7, 5, 0, 9, 11, 13, 15, 7, 17, 19, 21, 23, 25,
27, 29, 9, 11, 31, 33, 35, 37, 13, 39, 41, 43, 45, 47, 49, 15,
@@ -978,21 +909,104 @@ static const uint8_t dnxhd_1252_ac_flags[257] = {
3,
};
-static const uint8_t dnxhd_1258_dc_codes[14] = {
- 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63, 0, 0,
+/* Used in CID 1235, 1238, 1241, 1256 */
+static const uint16_t dnxhd_1235_run_codes[62] = {
+ 0, 4, 10, 11, 24, 25, 26, 27,
+ 56, 57, 58, 59, 120, 242, 486, 487,
+ 488, 489, 980, 981, 982, 983, 984, 985,
+ 986, 987, 988, 989, 990, 991, 992, 993,
+ 994, 995, 996, 997, 998, 999, 1000, 1001,
+ 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
+ 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
+ 1018, 1019, 1020, 1021, 1022, 1023,
};
-static const uint8_t dnxhd_1258_dc_bits[14] = {
- 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6, 0, 0,
+/* Used in CID 1235, 1238, 1241, 1243, 1256 */
+static const uint8_t dnxhd_1235_run_bits[62] = {
+ 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 8, 9, 9,
+ 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+};
+
+/* Used in CID 1235, 1241, 1256 */
+static const uint8_t dnxhd_1235_run[62] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+};
+
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+static const uint16_t dnxhd_1237_run_codes[62] = {
+ 0, 4, 10, 11, 24, 25, 26, 54,
+ 55, 56, 57, 58, 118, 119, 240, 482,
+ 483, 484, 485, 486, 487, 488, 489, 490,
+ 491, 492, 493, 494, 990, 991, 992, 993,
+ 994, 995, 996, 997, 998, 999, 1000, 1001,
+ 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
+ 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
+ 1018, 1019, 1020, 1021, 1022, 1023,
+};
+
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+static const uint8_t dnxhd_1237_run_bits[62] = {
+ 1, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+};
+
+/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+static const uint8_t dnxhd_1237_run[62] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56,
+};
+
+static const uint8_t dnxhd_1238_run[62] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+};
+
+/* Used in CID 1250, 1251, 1252, 1258 */
+static const uint16_t dnxhd_1250_run_codes[62] = {
+ 0, 4, 5, 12, 26, 27, 28, 58,
+ 118, 119, 120, 242, 486, 487, 976, 977,
+ 978, 979, 980, 981, 982, 983, 984, 985,
+ 986, 987, 988, 989, 990, 991, 992, 993,
+ 994, 995, 996, 997, 998, 999, 1000, 1001,
+ 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
+ 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
+ 1018, 1019, 1020, 1021, 1022, 1023,
+};
+
+/* Used in CID 1250, 1251, 1252, 1258 */
+static const uint8_t dnxhd_1250_run_bits[62] = {
+ 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+};
+
+/* Used in CID 1250, 1251, 1252, 1258 */
+static const uint8_t dnxhd_1250_run[62] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
};
const CIDEntry ff_dnxhd_cid_table[] = {
{ 1235, 1920, 1080, 0, 917504, 917504, 6, 10, 4,
dnxhd_1235_luma_weight, dnxhd_1235_chroma_weight,
- dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
- dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
- dnxhd_1235_1241_ac_flags,
- dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
+ dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
+ dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
+ dnxhd_1235_ac_flags,
+ dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
{ 175, 185, 365, 440 },
{ { 24000, 1001 }, { 25, 1 }, { 50, 1 }, { 60000, 1001 } } },
{ 1237, 1920, 1080, 0, 606208, 606208, 4, 8, 3,
@@ -1005,18 +1019,18 @@ const CIDEntry ff_dnxhd_cid_table[] = {
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1238, 1920, 1080, 0, 917504, 917504, 4, 8, 4,
dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight,
- dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
dnxhd_1238_ac_flags,
- dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
+ dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run,
{ 175, 185, 220, 365, 440 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1241, 1920, 1080, 1, 917504, 458752, 6, 10, 4,
dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight,
- dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
- dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
- dnxhd_1235_1241_ac_flags,
- dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
+ dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
+ dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
+ dnxhd_1235_ac_flags,
+ dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
{ 185, 220 },
{ { 25, 1 }, { 30000, 1001 } } },
{ 1242, 1920, 1080, 1, 606208, 303104, 4, 8, 3,
@@ -1029,15 +1043,15 @@ const CIDEntry ff_dnxhd_cid_table[] = {
{ { 25, 1 }, { 30000, 1001 } } },
{ 1243, 1920, 1080, 1, 917504, 458752, 4, 8, 4,
dnxhd_1243_luma_weight, dnxhd_1243_chroma_weight,
- dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
dnxhd_1238_ac_flags,
- dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
+ dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run,
{ 185, 220 },
{ { 25, 1 }, { 30000, 1001 } } },
{ 1250, 1280, 720, 0, 458752, 458752, 6, 10, 4,
dnxhd_1250_luma_weight, dnxhd_1250_chroma_weight,
- dnxhd_1250_dc_codes, dnxhd_1250_dc_bits,
+ dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
dnxhd_1250_ac_codes, dnxhd_1250_ac_bits, dnxhd_1250_ac_level,
dnxhd_1250_ac_flags,
dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
@@ -1045,18 +1059,18 @@ const CIDEntry ff_dnxhd_cid_table[] = {
{ { 24000, 1001 }, { 25, 1 }, { 50, 1 }, { 60000, 1001 } } },
{ 1251, 1280, 720, 0, 458752, 458752, 4, 8, 4,
dnxhd_1251_luma_weight, dnxhd_1251_chroma_weight,
- dnxhd_1251_dc_codes, dnxhd_1251_dc_bits,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1251_ac_codes, dnxhd_1251_ac_bits, dnxhd_1251_ac_level,
dnxhd_1251_ac_flags,
- dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
+ dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
{ 90, 90, 110, 180, 220 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1252, 1280, 720, 0, 303104, 303104, 4, 8, 5,
dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
- dnxhd_1252_dc_codes, dnxhd_1252_dc_bits,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
dnxhd_1252_ac_flags,
- dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
+ dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
{ 60, 60, 75, 120, 145 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1253, 1920, 1080, 0, 188416, 188416, 4, 8, 3,
@@ -1069,20 +1083,33 @@ const CIDEntry ff_dnxhd_cid_table[] = {
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1256, 1920, 1080, 0, 1835008, 1835008, 6, 10, 4,
dnxhd_1235_luma_weight, dnxhd_1256_chroma_weight,
- dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
- dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
- dnxhd_1235_1241_ac_flags,
- dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
+ dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
+ dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
+ dnxhd_1235_ac_flags,
+ dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
{ 350, 390, 440, 730, 880 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1258, 960, 720, 0, 212992, 212992, 4, 8, 5,
dnxhd_1258_luma_weight, dnxhd_1258_chroma_weight,
- dnxhd_1258_dc_codes, dnxhd_1258_dc_bits,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
dnxhd_1252_ac_flags,
- dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
+ dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
{ 42, 60, 75, 115 } },
-
+ { 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3,
+ dnxhd_1259_luma_weight, dnxhd_1259_chroma_weight,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
+ dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
+ dnxhd_1237_ac_flags,
+ dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
+ { 63, 84, 100, 110 } },
+ { 1260, 1440, 1080, 1, 835584, 417792, 4, 8, 3,
+ dnxhd_1260_luma_weight, dnxhd_1260_chroma_weight,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
+ dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
+ dnxhd_1237_ac_flags,
+ dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
+ { 80, 90, 100, 110 } },
};
int ff_dnxhd_get_cid_table(int cid)
@@ -1119,7 +1146,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++) {
const CIDEntry *cid = &ff_dnxhd_cid_table[i];
if (cid->width == avctx->width && cid->height == avctx->height &&
- cid->interlaced == !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT) &&
+ cid->interlaced == !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) &&
cid->bit_depth == bit_depth) {
for (j = 0; j < FF_ARRAY_ELEMS(cid->bit_rates); j++) {
if (cid->bit_rates[j] == mbs)
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c b/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
index a1376d303cd..1034d8970b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhddec.c
@@ -395,7 +395,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
ctx->idsp.idct_put(dest_y + dct_y_offset, dct_linesize_luma, ctx->blocks[4]);
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
- if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
dct_y_offset = dct_linesize_chroma << 3;
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
ctx->idsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
@@ -408,7 +408,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
ctx->idsp.idct_put(dest_y + dct_y_offset, dct_linesize_luma, ctx->blocks[6]);
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
- if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
dct_y_offset = dct_linesize_chroma << 3;
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
ctx->idsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]);
@@ -515,5 +515,5 @@ AVCodec ff_dnxhd_decoder = {
.init = dnxhd_decode_init,
.close = dnxhd_decode_close,
.decode = dnxhd_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
index 90d51ffbe51..af843996e91 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.c
@@ -46,6 +46,9 @@
static const AVOption options[] = {
{ "nitris_compat", "encode with Avid Nitris compatibility",
offsetof(DNXHDEncContext, nitris_compat), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "ibias", "intra quant bias",
+ offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT,
+ { .i64 = 0 }, INT_MIN, INT_MAX, VE },
{ NULL }
};
@@ -214,14 +217,14 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
weight_matrix[j] = ctx->cid_table->luma_weight[i];
}
ff_convert_matrix(&ctx->m, ctx->qmatrix_l, ctx->qmatrix_l16,
- weight_matrix, ctx->m.intra_quant_bias, 1,
+ weight_matrix, ctx->intra_quant_bias, 1,
ctx->m.avctx->qmax, 1);
for (i = 1; i < 64; i++) {
int j = ctx->m.idsp.idct_permutation[ff_zigzag_direct[i]];
weight_matrix[j] = ctx->cid_table->chroma_weight[i];
}
ff_convert_matrix(&ctx->m, ctx->qmatrix_c, ctx->qmatrix_c16,
- weight_matrix, ctx->m.intra_quant_bias, 1,
+ weight_matrix, ctx->intra_quant_bias, 1,
ctx->m.avctx->qmax, 1);
for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
@@ -348,17 +351,22 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->m.mb_height = (avctx->height + 15) / 16;
ctx->m.mb_width = (avctx->width + 15) / 16;
- if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
ctx->interlaced = 1;
ctx->m.mb_height /= 2;
}
ctx->m.mb_num = ctx->m.mb_height * ctx->m.mb_width;
- if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
- ctx->m.intra_quant_bias = avctx->intra_quant_bias;
+#if FF_API_QUANT_BIAS
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (ctx->intra_quant_bias == FF_DEFAULT_QUANT_BIAS &&
+ avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
+ ctx->intra_quant_bias = avctx->intra_quant_bias;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
// XXX tune lbias/cbias
- if ((ret = dnxhd_init_qmat(ctx, ctx->m.intra_quant_bias, 0)) < 0)
+ if ((ret = dnxhd_init_qmat(ctx, ctx->intra_quant_bias, 0)) < 0)
return ret;
/* Avid Nitris hardware decoder requires a minimum amount of padding
@@ -380,12 +388,12 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale,
ctx->m.mb_num * sizeof(uint8_t), fail);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (avctx->thread_count > MAX_THREADS) {
av_log(avctx, AV_LOG_ERROR, "too many threads\n");
@@ -1036,7 +1044,11 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame)
ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
ctx->m.avctx->coded_frame->interlaced_frame = frame->interlaced_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
}
@@ -1048,7 +1060,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
int offset, i, ret;
uint8_t *buf;
- if ((ret = ff_alloc_packet2(avctx, pkt, ctx->cid_table->frame_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, ctx->cid_table->frame_size, 0)) < 0)
return ret;
buf = pkt->data;
@@ -1097,7 +1109,13 @@ encode_coding_unit:
goto encode_coding_unit;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->quality = ctx->qscale * FF_QP2LAMBDA;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
@@ -1130,8 +1148,6 @@ static av_cold int dnxhd_encode_end(AVCodecContext *avctx)
for (i = 1; i < avctx->thread_count; i++)
av_freep(&ctx->thread[i]);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -1149,7 +1165,7 @@ AVCodec ff_dnxhd_encoder = {
.init = dnxhd_encode_init,
.encode2 = dnxhd_encode_picture,
.close = dnxhd_encode_end,
- .capabilities = CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV422P10,
diff --git a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
index 7ef0b96457a..3f531efcfbf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dnxhdenc.h
@@ -63,6 +63,7 @@ typedef struct DNXHDEncContext {
int nitris_compat;
unsigned min_padding;
+ int intra_quant_bias;
DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
diff --git a/chromium/third_party/ffmpeg/libavcodec/dpcm.c b/chromium/third_party/ffmpeg/libavcodec/dpcm.c
index ecc7a291acb..c13945edb6f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dpcm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dpcm.c
@@ -334,7 +334,7 @@ AVCodec ff_ ## name_ ## _decoder = { \
.priv_data_size = sizeof(DPCMContext), \
.init = dpcm_decode_init, \
.decode = dpcm_decode_frame, \
- .capabilities = CODEC_CAP_DR1, \
+ .capabilities = AV_CODEC_CAP_DR1, \
}
DPCM_DECODER(AV_CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "DPCM Interplay");
diff --git a/chromium/third_party/ffmpeg/libavcodec/dpx.c b/chromium/third_party/ffmpeg/libavcodec/dpx.c
index 66d84289517..15c939fcada 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dpx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dpx.c
@@ -392,5 +392,5 @@ AVCodec ff_dpx_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DPX,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dpxenc.c b/chromium/third_party/ffmpeg/libavcodec/dpxenc.c
index aca745bb582..9f3cbbe9779 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dpxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dpxenc.c
@@ -39,7 +39,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
s->big_endian = !!(desc->flags & AV_PIX_FMT_FLAG_BE);
- s->bits_per_component = desc->comp[0].depth_minus1 + 1;
+ s->bits_per_component = desc->comp[0].depth;
s->num_components = desc->nb_components;
s->descriptor = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? 51 : 50;
s->planar = !!(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
@@ -75,17 +75,20 @@ static av_cold int encode_init(AVCodecContext *avctx)
return 0;
}
-#define write16(p, value) \
-do { \
- if (s->big_endian) AV_WB16(p, value); \
- else AV_WL16(p, value); \
-} while(0)
+static av_always_inline void write16_internal(int big_endian, void *p, int value)
+{
+ if (big_endian) AV_WB16(p, value);
+ else AV_WL16(p, value);
+}
+
+static av_always_inline void write32_internal(int big_endian, void *p, int value)
+{
+ if (big_endian) AV_WB32(p, value);
+ else AV_WL32(p, value);
+}
-#define write32(p, value) \
-do { \
- if (s->big_endian) AV_WB32(p, value); \
- else AV_WL32(p, value); \
-} while(0)
+#define write16(p, value) write16_internal(s->big_endian, p, value)
+#define write32(p, value) write32_internal(s->big_endian, p, value)
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst)
{
@@ -192,7 +195,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
need_align = size - len;
size *= avctx->height;
}
- if ((ret = ff_alloc_packet2(avctx, pkt, size + HEADER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, size + HEADER_SIZE, 0)) < 0)
return ret;
buf = pkt->data;
@@ -204,7 +207,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memcpy (buf + 8, "V1.0", 4);
write32(buf + 20, 1); /* new image */
write32(buf + 24, HEADER_SIZE);
- if (!(avctx->flags & CODEC_FLAG_BITEXACT))
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
memcpy (buf + 160, LIBAVCODEC_IDENT, FFMIN(sizeof(LIBAVCODEC_IDENT), 100));
write32(buf + 660, 0xFFFFFFFF); /* unencrypted */
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsicinaudio.c b/chromium/third_party/ffmpeg/libavcodec/dsicinaudio.c
index b336d2c5845..290dab41a5b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsicinaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dsicinaudio.c
@@ -129,5 +129,5 @@ AVCodec ff_dsicinaudio_decoder = {
.priv_data_size = sizeof(CinAudioContext),
.init = cinaudio_decode_init,
.decode = cinaudio_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c b/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
index 48fb635c6b9..f95cbc74a07 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
@@ -313,5 +313,5 @@ AVCodec ff_dsicinvideo_decoder = {
.init = cinvideo_decode_init,
.close = cinvideo_decode_end,
.decode = cinvideo_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dss_sp.c b/chromium/third_party/ffmpeg/libavcodec/dss_sp.c
index 909ad1f2e01..7cf84899fc5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dss_sp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dss_sp.c
@@ -66,7 +66,7 @@ typedef struct DssSpContext {
int pulse_dec_mode;
DECLARE_ALIGNED(16, uint8_t, bits)[DSS_SP_FRAME_SIZE +
- FF_INPUT_BUFFER_PADDING_SIZE];
+ AV_INPUT_BUFFER_PADDING_SIZE];
} DssSpContext;
/*
@@ -783,5 +783,5 @@ AVCodec ff_dss_sp_decoder = {
.priv_data_size = sizeof(DssSpContext),
.init = dss_sp_decode_init,
.decode = dss_sp_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
index 568f9209798..08c422704d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
@@ -30,18 +30,18 @@ static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx,
int cmd= args ? *args : 0;
/* cast to avoid warning about discarding qualifiers */
if(avctx->extradata){
- if( (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
+ if( (keyframe && (avctx->flags2 & AV_CODEC_FLAG2_LOCAL_HEADER) && cmd == 'a')
||(keyframe && (cmd=='k' || !cmd))
||(cmd=='e')
/*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
int size= buf_size + avctx->extradata_size;
*poutbuf_size= size;
- *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf= av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
- memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
return 1;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dv_profile.c b/chromium/third_party/ffmpeg/libavcodec/dv_profile.c
index e336e081ea1..66505c886b4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dv_profile.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dv_profile.c
@@ -297,14 +297,6 @@ const AVDVProfile* ff_dv_frame_profile(AVCodecContext* codec, const AVDVProfile
return NULL;
}
-#if FF_API_DV_FRAME_PROFILE
-const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
- const uint8_t *frame, unsigned buf_size)
-{
- return ff_dv_frame_profile(codec, sys, frame, buf_size);
-}
-#endif
-
const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
const uint8_t *frame, unsigned buf_size)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/dv_profile.h b/chromium/third_party/ffmpeg/libavcodec/dv_profile.h
index d22ad2663fb..9380a66f070 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dv_profile.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dv_profile.h
@@ -58,15 +58,6 @@ typedef struct AVDVProfile {
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
} AVDVProfile;
-#if FF_API_DV_FRAME_PROFILE
-/**
- * @deprecated use av_dv_frame_profile()
- */
-attribute_deprecated
-const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
- const uint8_t* frame, unsigned buf_size);
-#endif
-
/**
* Get a DV profile for the provided compressed frame.
*
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c b/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
index e268e2a38e0..ab6054e99a4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvbsubdec.c
@@ -237,6 +237,8 @@ typedef struct DVBSubContext {
int time_out;
int compute_edt; /**< if 1 end display time calculated using pts
if 0 (Default) calculated using time out */
+ int compute_clut;
+ int substream;
int64_t prev_start;
DVBSubRegion *region_list;
DVBSubCLUT *clut_list;
@@ -367,17 +369,22 @@ static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
int i, r, g, b, a = 0;
DVBSubContext *ctx = avctx->priv_data;
- if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) {
+ if (ctx->substream < 0) {
+ ctx->composition_id = -1;
+ ctx->ancillary_id = -1;
+ } else if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) {
av_log(avctx, AV_LOG_WARNING, "Invalid DVB subtitles stream extradata!\n");
ctx->composition_id = -1;
ctx->ancillary_id = -1;
} else {
- if (avctx->extradata_size > 5) {
- av_log(avctx, AV_LOG_WARNING, "Decoding first DVB subtitles sub-stream\n");
+ if (avctx->extradata_size > 5*ctx->substream + 2) {
+ ctx->composition_id = AV_RB16(avctx->extradata + 5*ctx->substream);
+ ctx->ancillary_id = AV_RB16(avctx->extradata + 5*ctx->substream + 2);
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "Selected DVB subtitles sub-stream %d is not available\n", ctx->substream);
+ ctx->composition_id = AV_RB16(avctx->extradata);
+ ctx->ancillary_id = AV_RB16(avctx->extradata + 2);
}
-
- ctx->composition_id = AV_RB16(avctx->extradata);
- ctx->ancillary_id = AV_RB16(avctx->extradata + 2);
}
ctx->version = -1;
@@ -754,6 +761,63 @@ static int dvbsub_read_8bit_string(AVCodecContext *avctx,
return pixels_read;
}
+static void compute_default_clut(AVPicture *frame, int w, int h)
+{
+ uint8_t list[256] = {0};
+ uint8_t list_inv[256];
+ int counttab[256] = {0};
+ int count, i, x, y;
+
+#define V(x,y) frame->data[0][(x) + (y)*frame->linesize[0]]
+ for (y = 0; y<h; y++) {
+ for (x = 0; x<w; x++) {
+ int v = V(x,y) + 1;
+ int vl = x ? V(x-1,y) + 1 : 0;
+ int vr = x+1<w ? V(x+1,y) + 1 : 0;
+ int vt = y ? V(x,y-1) + 1 : 0;
+ int vb = y+1<h ? V(x,y+1) + 1 : 0;
+ counttab[v-1] += !!((v!=vl) + (v!=vr) + (v!=vt) + (v!=vb));
+ }
+ }
+#define L(x,y) list[ frame->data[0][(x) + (y)*frame->linesize[0]] ]
+
+ for (i = 0; i<256; i++) {
+ int scoretab[256] = {0};
+ int bestscore = 0;
+ int bestv = 0;
+ for (y = 0; y<h; y++) {
+ for (x = 0; x<w; x++) {
+ int v = frame->data[0][x + y*frame->linesize[0]];
+ int l_m = list[v];
+ int l_l = x ? L(x-1, y) : 1;
+ int l_r = x+1<w ? L(x+1, y) : 1;
+ int l_t = y ? L(x, y-1) : 1;
+ int l_b = y+1<h ? L(x, y+1) : 1;
+ int score;
+ if (l_m)
+ continue;
+ scoretab[v] += l_l + l_r + l_t + l_b;
+ score = 1024LL*scoretab[v] / counttab[v];
+ if (score > bestscore) {
+ bestscore = score;
+ bestv = v;
+ }
+ }
+ }
+ if (!bestscore)
+ break;
+ list [ bestv ] = 1;
+ list_inv[ i ] = bestv;
+ }
+
+ count = i - 1;
+ for (i--; i>=0; i--) {
+ int v = i*255/count;
+ AV_WN32(frame->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
+ }
+}
+
+
static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_output)
{
DVBSubContext *ctx = avctx->priv_data;
@@ -775,7 +839,7 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
/* Not touching AVSubtitles again*/
if(sub->num_rects) {
- avpriv_request_sample(ctx, "Different Version of Segment asked Twice\n");
+ avpriv_request_sample(ctx, "Different Version of Segment asked Twice");
return AVERROR_PATCHWELCOME;
}
for (display = ctx->display_list; display; display = display->next) {
@@ -855,6 +919,9 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
+ if ((clut == &default_clut && ctx->compute_clut == -1) || ctx->compute_clut == 1)
+ compute_default_clut(&rect->pict, rect->w, rect->h);
+
i++;
}
}
@@ -1023,7 +1090,7 @@ static int dvbsub_parse_object_segment(AVCodecContext *avctx,
buf += 2;
if (buf + top_field_len + bottom_field_len > buf_end) {
- av_log(avctx, AV_LOG_ERROR, "Field data size too large\n");
+ av_log(avctx, AV_LOG_ERROR, "Field data size %d+%d too large\n", top_field_len, bottom_field_len);
return AVERROR_INVALIDDATA;
}
@@ -1107,7 +1174,6 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
if (depth == 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid clut depth 0x%x!\n", *buf);
- return AVERROR_INVALIDDATA;
}
full_range = (*buf++) & 1;
@@ -1545,6 +1611,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
int i;
int ret = 0;
int got_segment = 0;
+ int got_dds = 0;
ff_dlog(avctx, "DVB sub packet:\n");
@@ -1607,9 +1674,15 @@ static int dvbsub_decode(AVCodecContext *avctx,
case DVBSUB_DISPLAYDEFINITION_SEGMENT:
ret = dvbsub_parse_display_definition_segment(avctx, p,
segment_length);
+ got_dds = 1;
break;
case DVBSUB_DISPLAY_SEGMENT:
ret = dvbsub_display_end_segment(avctx, p, segment_length, sub, data_size);
+ if (got_segment == 15 && !got_dds && !avctx->width && !avctx->height) {
+ // Default from ETSI EN 300 743 V1.3.1 (7.2.1)
+ avctx->width = 720;
+ avctx->height = 576;
+ }
got_segment |= 16;
break;
default:
@@ -1645,7 +1718,9 @@ end:
#define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
static const AVOption options[] = {
- {"compute_edt", "compute end of time using pts or timeout", offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
+ {"compute_edt", "compute end of time using pts or timeout", offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
+ {"compute_clut", "compute clut when not available(-1) or always(1) or never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DS},
+ {"dvb_substream", "", offsetof(DVBSubContext, substream), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
{NULL}
};
static const AVClass dvbsubdec_class = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvdec.c b/chromium/third_party/ffmpeg/libavcodec/dvdec.c
index fbd6bf504b4..679075e6a98 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvdec.c
@@ -287,14 +287,20 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
GetBitContext gb;
BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
LOCAL_ALIGNED_16(int16_t, sblock, [5 * DV_MAX_BPM], [64]);
- LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
- LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
+ LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
+ LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
const int log2_blocksize = 3-s->avctx->lowres;
int is_field_mode[5];
+ int vs_bit_buffer_damaged = 0;
+ int mb_bit_buffer_damaged[5] = {0};
+ int retried = 0;
+ int sta;
av_assert1((((int) mb_bit_buffer) & 7) == 0);
av_assert1((((int) vs_bit_buffer) & 7) == 0);
+retry:
+
memset(sblock, 0, 5 * DV_MAX_BPM * sizeof(*sblock));
/* pass 1: read DC and AC coefficients in blocks */
@@ -305,6 +311,14 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {
/* skip header */
quant = buf_ptr[3] & 0x0f;
+ if (avctx->error_concealment) {
+ if ((buf_ptr[3] >> 4) == 0x0E)
+ vs_bit_buffer_damaged = 1;
+ if (!mb_index) {
+ sta = buf_ptr[3] >> 4;
+ } else if (sta != (buf_ptr[3] >> 4))
+ vs_bit_buffer_damaged = 1;
+ }
buf_ptr += 4;
init_put_bits(&pb, mb_bit_buffer, 80);
mb = mb1;
@@ -349,11 +363,16 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
* block is finished */
if (mb->pos >= 64)
bit_copy(&pb, &gb);
+ if (mb->pos >= 64 && mb->pos < 127)
+ vs_bit_buffer_damaged = mb_bit_buffer_damaged[mb_index] = 1;
block += 64;
mb++;
}
+ if (mb_bit_buffer_damaged[mb_index] > 0)
+ continue;
+
/* pass 2: we can do it just after */
ff_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
block = block1;
@@ -367,6 +386,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
/* if still not finished, no need to parse other blocks */
if (mb->pos < 64)
break;
+ if (mb->pos < 127)
+ vs_bit_buffer_damaged = mb_bit_buffer_damaged[mb_index] = 1;
}
}
/* all blocks are finished, so the extra bytes can be used at
@@ -384,17 +405,25 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
flush_put_bits(&vs_pb);
for (mb_index = 0; mb_index < 5; mb_index++) {
for (j = 0; j < s->sys->bpm; j++) {
- if (mb->pos < 64 && get_bits_left(&gb) > 0) {
+ if (mb->pos < 64 && get_bits_left(&gb) > 0 && !vs_bit_buffer_damaged) {
ff_dlog(avctx, "start %d:%d\n", mb_index, j);
dv_decode_ac(&gb, mb, block);
}
- if (mb->pos >= 64 && mb->pos < 127)
+
+ if (mb->pos >= 64 && mb->pos < 127) {
av_log(avctx, AV_LOG_ERROR,
"AC EOB marker is absent pos=%d\n", mb->pos);
+ vs_bit_buffer_damaged = 1;
+ }
block += 64;
mb++;
}
}
+ if (vs_bit_buffer_damaged && !retried) {
+ av_log(avctx, AV_LOG_ERROR, "Concealing bitstream errors\n");
+ retried = 1;
+ goto retry;
+ }
/* compute idct and place blocks */
block = &sblock[0][0];
@@ -539,6 +568,6 @@ AVCodec ff_dvvideo_decoder = {
.priv_data_size = sizeof(DVVideoContext),
.init = dvvideo_decode_init,
.decode = dvvideo_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
.max_lowres = 3,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dvenc.c b/chromium/third_party/ffmpeg/libavcodec/dvenc.c
index 9ce72732f3a..5de12cc8435 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dvenc.c
@@ -65,10 +65,6 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
return ret;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
dv_vlc_map_tableinit();
memset(&fdsp,0, sizeof(fdsp));
@@ -208,7 +204,7 @@ static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi,
static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data,
int linesize)
{
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
int ps = s->ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
if (ps > 0) {
int is = s->ildct_cmp(NULL, data, NULL, linesize << 1, 4) +
@@ -721,13 +717,17 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
DVVideoContext *s = c->priv_data;
int ret;
- if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size)) < 0)
+ if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size, 0)) < 0)
return ret;
c->pix_fmt = s->sys->pix_fmt;
s->frame = frame;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
c->coded_frame->key_frame = 1;
c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->buf = pkt->data;
c->execute(c, dv_encode_video_segment, s->work_chunks, NULL,
@@ -743,12 +743,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
return 0;
}
-static int dvvideo_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_dvvideo_encoder = {
.name = "dvvideo",
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
@@ -757,8 +751,7 @@ AVCodec ff_dvvideo_encoder = {
.priv_data_size = sizeof(DVVideoContext),
.init = dvvideo_encode_init,
.encode2 = dvvideo_encode_frame,
- .close = dvvideo_encode_close,
- .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxa.c b/chromium/third_party/ffmpeg/libavcodec/dxa.c
index c8e3f713998..f6edc03e1a6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxa.c
@@ -284,7 +284,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
case 5:
if (!tmpptr) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
- if (!(avctx->flags2 & CODEC_FLAG2_SHOW_ALL))
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL))
return AVERROR_INVALIDDATA;
}
frame->key_frame = 0;
@@ -370,5 +370,5 @@ AVCodec ff_dxa_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxtory.c b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
index 22e7b2f4eb9..6f68c108893 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxtory.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
@@ -192,6 +192,56 @@ static inline uint8_t decode_sym(GetBitContext *gb, uint8_t lru[8])
return val;
}
+static int check_slice_size(AVCodecContext *avctx,
+ const uint8_t *src, int src_size,
+ int slice_size, int off)
+{
+ int cur_slice_size;
+
+ if (slice_size > src_size - off) {
+ av_log(avctx, AV_LOG_ERROR,
+ "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
+ slice_size, src_size - off);
+ return AVERROR_INVALIDDATA;
+ }
+ if (slice_size <= 16) {
+ av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n",
+ slice_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ cur_slice_size = AV_RL32(src + off);
+ if (cur_slice_size != slice_size - 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
+ cur_slice_size, slice_size - 16);
+ }
+
+ return 0;
+}
+
+static int load_buffer(AVCodecContext *avctx,
+ const uint8_t *src, int src_size,
+ GetByteContext *gb,
+ int *nslices, int *off)
+{
+ bytestream2_init(gb, src, src_size);
+ *nslices = bytestream2_get_le16(gb);
+ *off = FFALIGN(*nslices * 4 + 2, 16);
+ if (src_size < *off) {
+ av_log(avctx, AV_LOG_ERROR, "no slice data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (!*nslices) {
+ avpriv_request_sample(avctx, "%d slices for %dx%d", *nslices,
+ avctx->width, avctx->height);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ return 0;
+}
+
static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
int bits)
{
@@ -210,187 +260,183 @@ static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
return val;
}
-static int dx2_decode_slice_565(GetBitContext *gb, int width, int height,
- uint8_t *dst, int stride, int is_565)
-{
- int x, y;
- int r, g, b;
- uint8_t lru[3][8];
+typedef int (*decode_slice_func)(GetBitContext *gb, AVFrame *frame,
+ int line, int height, uint8_t lru[3][8]);
- memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));
- memcpy(lru[1], is_565 ? def_lru_565 : def_lru_555, 8 * sizeof(*def_lru));
- memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));
+typedef void (*setup_lru_func)(uint8_t lru[3][8]);
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- b = decode_sym_565(gb, lru[0], 5);
- g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);
- r = decode_sym_565(gb, lru[2], 5);
- dst[x * 3 + 0] = (r << 3) | (r >> 2);
- dst[x * 3 + 1] = is_565 ? (g << 2) | (g >> 4) : (g << 3) | (g >> 2);
- dst[x * 3 + 2] = (b << 3) | (b >> 2);
- }
-
- dst += stride;
- }
-
- return 0;
-}
-
-static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
- const uint8_t *src, int src_size, int is_565)
+static int dxtory_decode_v2(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size,
+ decode_slice_func decode_slice,
+ setup_lru_func setup_lru,
+ enum AVPixelFormat fmt)
{
GetByteContext gb;
GetBitContext gb2;
- int nslices, slice, slice_height;
+ int nslices, slice, line = 0;
uint32_t off, slice_size;
- uint8_t *dst;
+ uint8_t lru[3][8];
int ret;
- bytestream2_init(&gb, src, src_size);
- nslices = bytestream2_get_le16(&gb);
- off = FFALIGN(nslices * 4 + 2, 16);
- if (src_size < off) {
- av_log(avctx, AV_LOG_ERROR, "no slice data\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (!nslices || avctx->height % nslices) {
- avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
- avctx->width, avctx->height);
- return AVERROR_PATCHWELCOME;
- }
+ ret = load_buffer(avctx, src, src_size, &gb, &nslices, &off);
+ if (ret < 0)
+ return ret;
- slice_height = avctx->height / nslices;
- avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ avctx->pix_fmt = fmt;
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
return ret;
- dst = pic->data[0];
for (slice = 0; slice < nslices; slice++) {
slice_size = bytestream2_get_le32(&gb);
- if (slice_size > src_size - off) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
- slice_size, src_size - off);
- return AVERROR_INVALIDDATA;
- }
- if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
- return AVERROR_INVALIDDATA;
- }
- if (AV_RL32(src + off) != slice_size - 16) {
- av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
- AV_RL32(src + off), slice_size - 16);
- }
+ setup_lru(lru);
+
+ ret = check_slice_size(avctx, src, src_size, slice_size, off);
+ if (ret < 0)
+ return ret;
+
if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0)
return ret;
- dx2_decode_slice_565(&gb2, avctx->width, slice_height, dst,
- pic->linesize[0], is_565);
- dst += pic->linesize[0] * slice_height;
+ line += decode_slice(&gb2, pic, line, avctx->height - line, lru);
+
off += slice_size;
}
+ if (avctx->height - line) {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "Not enough slice data available, "
+ "cropping the frame by %d pixels\n",
+ avctx->height - line);
+ avctx->height = line;
+ }
+
return 0;
}
-static int dx2_decode_slice_rgb(GetBitContext *gb, int width, int height,
- uint8_t *dst, int stride)
+av_always_inline
+static int dx2_decode_slice_5x5(GetBitContext *gb, AVFrame *frame,
+ int line, int left, uint8_t lru[3][8],
+ int is_565)
{
- int x, y, i;
- uint8_t lru[3][8];
-
- for (i = 0; i < 3; i++)
- memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+ int x, y;
+ int r, g, b;
+ int width = frame->width;
+ int stride = frame->linesize[0];
+ uint8_t *dst = frame->data[0] + stride * line;
- for (y = 0; y < height; y++) {
+ for (y = 0; y < left && get_bits_left(gb) > 16; y++) {
for (x = 0; x < width; x++) {
- dst[x * 3 + 0] = decode_sym(gb, lru[0]);
- dst[x * 3 + 1] = decode_sym(gb, lru[1]);
- dst[x * 3 + 2] = decode_sym(gb, lru[2]);
+ b = decode_sym_565(gb, lru[0], 5);
+ g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);
+ r = decode_sym_565(gb, lru[2], 5);
+ dst[x * 3 + 0] = (r << 3) | (r >> 2);
+ dst[x * 3 + 1] = is_565 ? (g << 2) | (g >> 4) : (g << 3) | (g >> 2);
+ dst[x * 3 + 2] = (b << 3) | (b >> 2);
}
dst += stride;
}
- return 0;
+ return y;
}
-static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
- const uint8_t *src, int src_size)
+static void setup_lru_555(uint8_t lru[3][8])
{
- GetByteContext gb;
- GetBitContext gb2;
- int nslices, slice, slice_height;
- uint32_t off, slice_size;
- uint8_t *dst;
- int ret;
+ memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));
+ memcpy(lru[1], def_lru_555, 8 * sizeof(*def_lru));
+ memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));
+}
- bytestream2_init(&gb, src, src_size);
- nslices = bytestream2_get_le16(&gb);
- off = FFALIGN(nslices * 4 + 2, 16);
- if (src_size < off) {
- av_log(avctx, AV_LOG_ERROR, "no slice data\n");
- return AVERROR_INVALIDDATA;
- }
+static void setup_lru_565(uint8_t lru[3][8])
+{
+ memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));
+ memcpy(lru[1], def_lru_565, 8 * sizeof(*def_lru));
+ memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));
+}
- if (!nslices || avctx->height % nslices) {
- avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
- avctx->width, avctx->height);
- return AVERROR_PATCHWELCOME;
- }
+static int dx2_decode_slice_555(GetBitContext *gb, AVFrame *frame,
+ int line, int left, uint8_t lru[3][8])
+{
+ return dx2_decode_slice_5x5(gb, frame, line, left, lru, 0);
+}
- slice_height = avctx->height / nslices;
- avctx->pix_fmt = AV_PIX_FMT_BGR24;
- if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
- return ret;
+static int dx2_decode_slice_565(GetBitContext *gb, AVFrame *frame,
+ int line, int left, uint8_t lru[3][8])
+{
+ return dx2_decode_slice_5x5(gb, frame, line, left, lru, 1);
+}
- dst = pic->data[0];
- for (slice = 0; slice < nslices; slice++) {
- slice_size = bytestream2_get_le32(&gb);
- if (slice_size > src_size - off) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
- slice_size, src_size - off);
- return AVERROR_INVALIDDATA;
- }
- if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n",
- slice_size);
- return AVERROR_INVALIDDATA;
- }
+static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size, int is_565)
+{
+ enum AVPixelFormat fmt = AV_PIX_FMT_RGB24;
+ if (is_565)
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_565,
+ setup_lru_565,
+ fmt);
+ else
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_555,
+ setup_lru_555,
+ fmt);
+}
- if (AV_RL32(src + off) != slice_size - 16) {
- av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
- AV_RL32(src + off), slice_size - 16);
+static int dx2_decode_slice_rgb(GetBitContext *gb, AVFrame *frame,
+ int line, int left, uint8_t lru[3][8])
+{
+ int x, y;
+ int width = frame->width;
+ int stride = frame->linesize[0];
+ uint8_t *dst = frame->data[0] + stride * line;
+
+ for (y = 0; y < left && get_bits_left(gb) > 16; y++) {
+ for (x = 0; x < width; x++) {
+ dst[x * 3 + 0] = decode_sym(gb, lru[0]);
+ dst[x * 3 + 1] = decode_sym(gb, lru[1]);
+ dst[x * 3 + 2] = decode_sym(gb, lru[2]);
}
- if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0)
- return ret;
- dx2_decode_slice_rgb(&gb2, avctx->width, slice_height, dst,
- pic->linesize[0]);
- dst += pic->linesize[0] * slice_height;
- off += slice_size;
+ dst += stride;
}
- return 0;
+ return y;
}
-static int dx2_decode_slice_410(GetBitContext *gb, int width, int height,
- uint8_t *Y, uint8_t *U, uint8_t *V,
- int ystride, int ustride, int vstride)
+static void default_setup_lru(uint8_t lru[3][8])
{
- int x, y, i, j;
- uint8_t lru[3][8];
+ int i;
for (i = 0; i < 3; i++)
memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+}
+
+static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
+ const uint8_t *src, int src_size)
+{
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_rgb,
+ default_setup_lru,
+ AV_PIX_FMT_BGR24);
+}
+
+static int dx2_decode_slice_410(GetBitContext *gb, AVFrame *frame,
+ int line, int left,
+ uint8_t lru[3][8])
+{
+ int x, y, i, j;
+ int width = frame->width;
+
+ int ystride = frame->linesize[0];
+ int ustride = frame->linesize[1];
+ int vstride = frame->linesize[2];
+
+ uint8_t *Y = frame->data[0] + ystride * line;
+ uint8_t *U = frame->data[1] + (ustride >> 2) * line;
+ uint8_t *V = frame->data[2] + (vstride >> 2) * line;
- for (y = 0; y < height; y += 4) {
+ for (y = 0; y < left - 3 && get_bits_left(gb) > 16; y += 4) {
for (x = 0; x < width; x += 4) {
for (j = 0; j < 4; j++)
for (i = 0; i < 4; i++)
@@ -404,95 +450,37 @@ static int dx2_decode_slice_410(GetBitContext *gb, int width, int height,
V += vstride;
}
- return 0;
+ return y;
}
+
static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
- GetByteContext gb;
- GetBitContext gb2;
- int nslices, slice, slice_height;
- int cur_y, next_y;
- uint32_t off, slice_size;
- uint8_t *Y, *U, *V;
- int ret;
-
- bytestream2_init(&gb, src, src_size);
- nslices = bytestream2_get_le16(&gb);
- off = FFALIGN(nslices * 4 + 2, 16);
- if (src_size < off) {
- av_log(avctx, AV_LOG_ERROR, "no slice data\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (!nslices) {
- avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
- avctx->width, avctx->height);
- return AVERROR_PATCHWELCOME;
- }
-
- if ((avctx->width & 3) || (avctx->height & 3)) {
- avpriv_request_sample(avctx, "Frame dimensions %dx%d",
- avctx->width, avctx->height);
- }
-
- avctx->pix_fmt = AV_PIX_FMT_YUV410P;
- if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
- return ret;
-
- Y = pic->data[0];
- U = pic->data[1];
- V = pic->data[2];
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_410,
+ default_setup_lru,
+ AV_PIX_FMT_YUV410P);
+}
- cur_y = 0;
- for (slice = 0; slice < nslices; slice++) {
- slice_size = bytestream2_get_le32(&gb);
- next_y = ((slice + 1) * avctx->height) / nslices;
- slice_height = (next_y & ~3) - (cur_y & ~3);
- if (slice_size > src_size - off) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
- slice_size, src_size - off);
- return AVERROR_INVALIDDATA;
- }
- if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
- return AVERROR_INVALIDDATA;
- }
+static int dx2_decode_slice_420(GetBitContext *gb, AVFrame *frame,
+ int line, int left,
+ uint8_t lru[3][8])
+{
+ int x, y;
- if (AV_RL32(src + off) != slice_size - 16) {
- av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
- AV_RL32(src + off), slice_size - 16);
- }
- if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0)
- return ret;
- dx2_decode_slice_410(&gb2, avctx->width, slice_height, Y, U, V,
- pic->linesize[0], pic->linesize[1],
- pic->linesize[2]);
+ int width = frame->width;
- Y += pic->linesize[0] * slice_height;
- U += pic->linesize[1] * (slice_height >> 2);
- V += pic->linesize[2] * (slice_height >> 2);
- off += slice_size;
- cur_y = next_y;
- }
+ int ystride = frame->linesize[0];
+ int ustride = frame->linesize[1];
+ int vstride = frame->linesize[2];
- return 0;
-}
+ uint8_t *Y = frame->data[0] + ystride * line;
+ uint8_t *U = frame->data[1] + (ustride >> 1) * line;
+ uint8_t *V = frame->data[2] + (vstride >> 1) * line;
-static int dx2_decode_slice_420(GetBitContext *gb, int width, int height,
- uint8_t *Y, uint8_t *U, uint8_t *V,
- int ystride, int ustride, int vstride)
-{
- int x, y, i;
- uint8_t lru[3][8];
- for (i = 0; i < 3; i++)
- memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
-
- for (y = 0; y < height; y+=2) {
+ for (y = 0; y < left - 1 && get_bits_left(gb) > 16; y += 2) {
for (x = 0; x < width; x += 2) {
Y[x + 0 + 0 * ystride] = decode_sym(gb, lru[0]);
Y[x + 1 + 0 * ystride] = decode_sym(gb, lru[0]);
@@ -507,95 +495,35 @@ static int dx2_decode_slice_420(GetBitContext *gb, int width, int height,
V += vstride;
}
- return 0;
+ return y;
}
static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
- GetByteContext gb;
- GetBitContext gb2;
- int nslices, slice, slice_height;
- int cur_y, next_y;
- uint32_t off, slice_size;
- uint8_t *Y, *U, *V;
- int ret;
-
- bytestream2_init(&gb, src, src_size);
- nslices = bytestream2_get_le16(&gb);
- off = FFALIGN(nslices * 4 + 2, 16);
- if (src_size < off) {
- av_log(avctx, AV_LOG_ERROR, "no slice data\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (!nslices) {
- avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
- avctx->width, avctx->height);
- return AVERROR_PATCHWELCOME;
- }
-
- if ((avctx->width & 1) || (avctx->height & 1)) {
- avpriv_request_sample(avctx, "Frame dimensions %dx%d",
- avctx->width, avctx->height);
- }
-
- avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
- return ret;
-
- Y = pic->data[0];
- U = pic->data[1];
- V = pic->data[2];
-
- cur_y = 0;
- for (slice = 0; slice < nslices; slice++) {
- slice_size = bytestream2_get_le32(&gb);
- next_y = ((slice + 1) * avctx->height) / nslices;
- slice_height = (next_y & ~1) - (cur_y & ~1);
- if (slice_size > src_size - off) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
- slice_size, src_size - off);
- return AVERROR_INVALIDDATA;
- }
- if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
- return AVERROR_INVALIDDATA;
- }
-
- if (AV_RL32(src + off) != slice_size - 16) {
- av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
- AV_RL32(src + off), slice_size - 16);
- }
- if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0)
- return ret;
- dx2_decode_slice_420(&gb2, avctx->width, slice_height, Y, U, V,
- pic->linesize[0], pic->linesize[1],
- pic->linesize[2]);
-
- Y += pic->linesize[0] * slice_height;
- U += pic->linesize[1] * (slice_height >> 1);
- V += pic->linesize[2] * (slice_height >> 1);
- off += slice_size;
- cur_y = next_y;
- }
-
- return 0;
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_420,
+ default_setup_lru,
+ AV_PIX_FMT_YUV420P);
}
-static int dx2_decode_slice_444(GetBitContext *gb, int width, int height,
- uint8_t *Y, uint8_t *U, uint8_t *V,
- int ystride, int ustride, int vstride)
+static int dx2_decode_slice_444(GetBitContext *gb, AVFrame *frame,
+ int line, int left,
+ uint8_t lru[3][8])
{
- int x, y, i;
- uint8_t lru[3][8];
+ int x, y;
- for (i = 0; i < 3; i++)
- memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
+ int width = frame->width;
+
+ int ystride = frame->linesize[0];
+ int ustride = frame->linesize[1];
+ int vstride = frame->linesize[2];
+
+ uint8_t *Y = frame->data[0] + ystride * line;
+ uint8_t *U = frame->data[1] + ustride * line;
+ uint8_t *V = frame->data[2] + vstride * line;
- for (y = 0; y < height; y++) {
+ for (y = 0; y < left && get_bits_left(gb) > 16; y++) {
for (x = 0; x < width; x++) {
Y[x] = decode_sym(gb, lru[0]);
U[x] = decode_sym(gb, lru[1]) ^ 0x80;
@@ -607,74 +535,16 @@ static int dx2_decode_slice_444(GetBitContext *gb, int width, int height,
V += vstride;
}
- return 0;
+ return y;
}
static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
- GetByteContext gb;
- GetBitContext gb2;
- int nslices, slice, slice_height;
- uint32_t off, slice_size;
- uint8_t *Y, *U, *V;
- int ret;
-
- bytestream2_init(&gb, src, src_size);
- nslices = bytestream2_get_le16(&gb);
- off = FFALIGN(nslices * 4 + 2, 16);
- if (src_size < off) {
- av_log(avctx, AV_LOG_ERROR, "no slice data\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (!nslices || avctx->height % nslices) {
- avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
- avctx->width, avctx->height);
- return AVERROR_PATCHWELCOME;
- }
-
- slice_height = avctx->height / nslices;
-
- avctx->pix_fmt = AV_PIX_FMT_YUV444P;
- if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
- return ret;
-
- Y = pic->data[0];
- U = pic->data[1];
- V = pic->data[2];
-
- for (slice = 0; slice < nslices; slice++) {
- slice_size = bytestream2_get_le32(&gb);
- if (slice_size > src_size - off) {
- av_log(avctx, AV_LOG_ERROR,
- "invalid slice size %"PRIu32" (only %"PRIu32" bytes left)\n",
- slice_size, src_size - off);
- return AVERROR_INVALIDDATA;
- }
- if (slice_size <= 16) {
- av_log(avctx, AV_LOG_ERROR, "invalid slice size %"PRIu32"\n", slice_size);
- return AVERROR_INVALIDDATA;
- }
-
- if (AV_RL32(src + off) != slice_size - 16) {
- av_log(avctx, AV_LOG_ERROR,
- "Slice sizes mismatch: got %"PRIu32" instead of %"PRIu32"\n",
- AV_RL32(src + off), slice_size - 16);
- }
- if ((ret = init_get_bits8(&gb2, src + off + 16, slice_size - 16)) < 0)
- return ret;
- dx2_decode_slice_444(&gb2, avctx->width, slice_height, Y, U, V,
- pic->linesize[0], pic->linesize[1],
- pic->linesize[2]);
-
- Y += pic->linesize[0] * slice_height;
- U += pic->linesize[1] * slice_height;
- V += pic->linesize[2] * slice_height;
- off += slice_size;
- }
-
- return 0;
+ return dxtory_decode_v2(avctx, pic, src, src_size,
+ dx2_decode_slice_444,
+ default_setup_lru,
+ AV_PIX_FMT_YUV444P);
}
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
@@ -752,5 +622,5 @@ AVCodec ff_dxtory_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DXTORY,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxv.c b/chromium/third_party/ffmpeg/libavcodec/dxv.c
new file mode 100644
index 00000000000..e20e940fedc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/dxv.c
@@ -0,0 +1,462 @@
+/*
+ * Resolume DXV decoder
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "libavutil/imgutils.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+#include "lzf.h"
+#include "texturedsp.h"
+#include "thread.h"
+
+typedef struct DXVContext {
+ TextureDSPContext texdsp;
+ GetByteContext gbc;
+
+ uint8_t *tex_data; // Compressed texture
+ int tex_rat; // Compression ratio
+ int tex_step; // Distance between blocks
+ int64_t tex_size; // Texture size
+
+ /* Optimal number of slices for parallel decoding */
+ int slice_count;
+
+ /* Pointer to the selected decompression function */
+ int (*tex_funct)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+} DXVContext;
+
+static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
+ int slice, int thread_nb)
+{
+ DXVContext *ctx = avctx->priv_data;
+ AVFrame *frame = arg;
+ const uint8_t *d = ctx->tex_data;
+ int w_block = avctx->coded_width / TEXTURE_BLOCK_W;
+ int h_block = avctx->coded_height / TEXTURE_BLOCK_H;
+ int x, y;
+ int start_slice, end_slice;
+ int base_blocks_per_slice = h_block / ctx->slice_count;
+ int remainder_blocks = h_block % ctx->slice_count;
+
+ /* When the frame height (in blocks) doesn't divide evenly between the
+ * number of slices, spread the remaining blocks evenly between the first
+ * operations */
+ start_slice = slice * base_blocks_per_slice;
+ /* Add any extra blocks (one per slice) that have been added
+ * before this slice */
+ start_slice += FFMIN(slice, remainder_blocks);
+
+ end_slice = start_slice + base_blocks_per_slice;
+ /* Add an extra block if there are remainder blocks to be accounted for */
+ if (slice < remainder_blocks)
+ end_slice++;
+
+ for (y = start_slice; y < end_slice; y++) {
+ uint8_t *p = frame->data[0] + y * frame->linesize[0] * TEXTURE_BLOCK_H;
+ int off = y * w_block;
+ for (x = 0; x < w_block; x++) {
+ ctx->tex_funct(p + x * 16, frame->linesize[0],
+ d + (off + x) * ctx->tex_step);
+ }
+ }
+
+ return 0;
+}
+
+/* This scheme addresses already decoded elements depending on 2-bit status:
+ * 0 -> copy new element
+ * 1 -> copy one element from position -x
+ * 2 -> copy one element from position -(get_byte() + 2) * x
+ * 3 -> copy one element from position -(get_16le() + 0x102) * x
+ * x is always 2 for dxt1 and 4 for dxt5. */
+#define CHECKPOINT(x) \
+ do { \
+ if (state == 0) { \
+ value = bytestream2_get_le32(gbc); \
+ state = 16; \
+ } \
+ op = value & 0x3; \
+ value >>= 2; \
+ state--; \
+ switch (op) { \
+ case 1: \
+ idx = x; \
+ break; \
+ case 2: \
+ idx = (bytestream2_get_byte(gbc) + 2) * x; \
+ break; \
+ case 3: \
+ idx = (bytestream2_get_le16(gbc) + 0x102) * x; \
+ break; \
+ } \
+ } while(0)
+
+static int dxv_decompress_dxt1(AVCodecContext *avctx)
+{
+ DXVContext *ctx = avctx->priv_data;
+ GetByteContext *gbc = &ctx->gbc;
+ uint32_t value, prev, op;
+ int idx = 0, state = 0;
+ int pos = 2;
+
+ /* Copy the first two elements */
+ AV_WL32(ctx->tex_data, bytestream2_get_le32(gbc));
+ AV_WL32(ctx->tex_data + 4, bytestream2_get_le32(gbc));
+
+ /* Process input until the whole texture has been filled */
+ while (pos < ctx->tex_size / 4) {
+ CHECKPOINT(2);
+
+ /* Copy two elements from a previous offset or from the input buffer */
+ if (op) {
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ } else {
+ CHECKPOINT(2);
+
+ if (op)
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ else
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ CHECKPOINT(2);
+
+ if (op)
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ else
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ }
+ }
+
+ return 0;
+}
+
+static int dxv_decompress_dxt5(AVCodecContext *avctx)
+{
+ DXVContext *ctx = avctx->priv_data;
+ GetByteContext *gbc = &ctx->gbc;
+ uint32_t value, op;
+ int idx, prev, state = 0;
+ int pos = 4;
+ int run = 0;
+ int probe, check;
+
+ /* Copy the first four elements */
+ AV_WL32(ctx->tex_data + 0, bytestream2_get_le32(gbc));
+ AV_WL32(ctx->tex_data + 4, bytestream2_get_le32(gbc));
+ AV_WL32(ctx->tex_data + 8, bytestream2_get_le32(gbc));
+ AV_WL32(ctx->tex_data + 12, bytestream2_get_le32(gbc));
+
+ /* Process input until the whole texture has been filled */
+ while (pos < ctx->tex_size / 4) {
+ if (run) {
+ run--;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ } else {
+ if (state == 0) {
+ value = bytestream2_get_le32(gbc);
+ state = 16;
+ }
+ op = value & 0x3;
+ value >>= 2;
+ state--;
+
+ switch (op) {
+ case 0:
+ /* Long copy */
+ check = bytestream2_get_byte(gbc) + 1;
+ if (check == 256) {
+ do {
+ probe = bytestream2_get_le16(gbc);
+ check += probe;
+ } while (probe == 0xFFFF);
+ }
+ while (check && pos < ctx->tex_size / 4) {
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ check--;
+ }
+
+ /* Restart (or exit) the loop */
+ continue;
+ break;
+ case 1:
+ /* Load new run value */
+ run = bytestream2_get_byte(gbc);
+ if (run == 255) {
+ do {
+ probe = bytestream2_get_le16(gbc);
+ run += probe;
+ } while (probe == 0xFFFF);
+ }
+
+ /* Copy two dwords from previous data */
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ break;
+ case 2:
+ /* Copy two dwords from a previous index */
+ idx = 8 + bytestream2_get_le16(gbc);
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ break;
+ case 3:
+ /* Copy two dwords from input */
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ break;
+ }
+ }
+
+ CHECKPOINT(4);
+
+ /* Copy two elements from a previous offset or from the input buffer */
+ if (op) {
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ } else {
+ CHECKPOINT(4);
+
+ if (op)
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ else
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+
+ CHECKPOINT(4);
+
+ if (op)
+ prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
+ else
+ prev = bytestream2_get_le32(gbc);
+ AV_WL32(ctx->tex_data + 4 * pos, prev);
+ pos++;
+ }
+ }
+
+ return 0;
+}
+
+static int dxv_decompress_lzf(AVCodecContext *avctx)
+{
+ DXVContext *ctx = avctx->priv_data;
+ return ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size);
+}
+
+static int dxv_decode(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ DXVContext *ctx = avctx->priv_data;
+ ThreadFrame tframe;
+ GetByteContext *gbc = &ctx->gbc;
+ int (*decompress_tex)(AVCodecContext *avctx);
+ uint32_t tag;
+ int channels, size = 0, old_type = 0;
+ int ret;
+
+ bytestream2_init(gbc, avpkt->data, avpkt->size);
+
+ tag = bytestream2_get_le32(gbc);
+ switch (tag) {
+ case MKBETAG('D', 'X', 'T', '1'):
+ decompress_tex = dxv_decompress_dxt1;
+ ctx->tex_funct = ctx->texdsp.dxt1_block;
+ ctx->tex_rat = 8;
+ ctx->tex_step = 8;
+ av_log(avctx, AV_LOG_DEBUG, "DXTR1 compression and DXT1 texture ");
+ break;
+ case MKBETAG('D', 'X', 'T', '5'):
+ decompress_tex = dxv_decompress_dxt5;
+ ctx->tex_funct = ctx->texdsp.dxt5_block;
+ ctx->tex_rat = 4;
+ ctx->tex_step = 16;
+ av_log(avctx, AV_LOG_DEBUG, "DXTR5 compression and DXT5 texture ");
+ break;
+ case MKBETAG('Y', 'C', 'G', '6'):
+ case MKBETAG('Y', 'G', '1', '0'):
+ avpriv_report_missing_feature(avctx, "Tag 0x%08X", tag);
+ return AVERROR_PATCHWELCOME;
+ default:
+ /* Old version does not have a real header, just size and type. */
+ size = tag & 0x00FFFFFF;
+ old_type = tag >> 24;
+ channels = old_type & 0x0F;
+ if (old_type & 0x40) {
+ av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT5 texture ");
+ ctx->tex_funct = ctx->texdsp.dxt5_block;
+ ctx->tex_step = 16;
+ } else if (old_type & 0x20 || old_type & 0x2) {
+ av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT1 texture ");
+ ctx->tex_funct = ctx->texdsp.dxt1_block;
+ ctx->tex_step = 8;
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported header (0x%08X)\n.", tag);
+ return AVERROR_INVALIDDATA;
+ }
+ decompress_tex = dxv_decompress_lzf;
+ ctx->tex_rat = 1;
+ break;
+ }
+
+ /* New header is 12 bytes long. */
+ if (!old_type) {
+ channels = bytestream2_get_byte(gbc);
+ bytestream2_skip(gbc, 3); // unknown
+ size = bytestream2_get_le32(gbc);
+ }
+ av_log(avctx, AV_LOG_DEBUG, "(%d channels)\n", channels);
+
+ if (size != bytestream2_get_bytes_left(gbc)) {
+ av_log(avctx, AV_LOG_ERROR, "Incomplete or invalid file (%u > %u)\n.",
+ size, bytestream2_get_bytes_left(gbc));
+ return AVERROR_INVALIDDATA;
+ }
+
+ ctx->tex_size = avctx->coded_width * avctx->coded_height * 4 / ctx->tex_rat;
+ ret = av_reallocp(&ctx->tex_data, ctx->tex_size);
+ if (ret < 0)
+ return ret;
+
+ /* Decompress texture out of the intermediate compression. */
+ ret = decompress_tex(avctx);
+ if (ret < 0)
+ return ret;
+
+ tframe.f = data;
+ ret = ff_thread_get_buffer(avctx, &tframe, 0);
+ if (ret < 0)
+ return ret;
+ if (avctx->codec->update_thread_context)
+ ff_thread_finish_setup(avctx);
+
+ /* Now decompress the texture with the standard functions. */
+ avctx->execute2(avctx, decompress_texture_thread,
+ tframe.f, NULL, ctx->slice_count);
+
+ /* Frame is ready to be output. */
+ tframe.f->pict_type = AV_PICTURE_TYPE_I;
+ tframe.f->key_frame = 1;
+ *got_frame = 1;
+
+ return avpkt->size;
+}
+
+static int dxv_init(AVCodecContext *avctx)
+{
+ DXVContext *ctx = avctx->priv_data;
+ int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid image size %dx%d.\n",
+ avctx->width, avctx->height);
+ return ret;
+ }
+
+ /* Codec requires 16x16 alignment. */
+ avctx->coded_width = FFALIGN(avctx->width, 16);
+ avctx->coded_height = FFALIGN(avctx->height, 16);
+
+ ff_texturedsp_init(&ctx->texdsp);
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+
+ ctx->slice_count = av_clip(avctx->thread_count, 1,
+ avctx->coded_height / TEXTURE_BLOCK_H);
+
+ return 0;
+}
+
+static int dxv_close(AVCodecContext *avctx)
+{
+ DXVContext *ctx = avctx->priv_data;
+
+ av_freep(&ctx->tex_data);
+
+ return 0;
+}
+
+AVCodec ff_dxv_decoder = {
+ .name = "dxv",
+ .long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_DXV,
+ .init = dxv_init,
+ .decode = dxv_decode,
+ .close = dxv_close,
+ .priv_data_size = sizeof(DXVContext),
+ .capabilities = AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_SLICE_THREADS |
+ AV_CODEC_CAP_FRAME_THREADS,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2.h b/chromium/third_party/ffmpeg/libavcodec/dxva2.h
index be246d71980..9e3ab86a82f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2.h
@@ -29,9 +29,9 @@
* Public libavcodec DXVA2 header.
*/
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
+#define _WIN32_WINNT 0x0602
#endif
#include <stdint.h>
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_hevc.c b/chromium/third_party/ffmpeg/libavcodec/dxva2_hevc.c
index 5f5134b64d9..79d2d2824e4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_hevc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_hevc.c
@@ -57,102 +57,104 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
DXVA_PicParams_HEVC *pp)
{
const HEVCFrame *current_picture = h->ref;
+ const HEVCSPS *sps = h->ps.sps;
+ const HEVCPPS *pps = h->ps.pps;
int i, j;
memset(pp, 0, sizeof(*pp));
- pp->PicWidthInMinCbsY = h->sps->min_cb_width;
- pp->PicHeightInMinCbsY = h->sps->min_cb_height;
+ pp->PicWidthInMinCbsY = sps->min_cb_width;
+ pp->PicHeightInMinCbsY = sps->min_cb_height;
- pp->wFormatAndSequenceInfoFlags = (h->sps->chroma_format_idc << 0) |
- (h->sps->separate_colour_plane_flag << 2) |
- ((h->sps->bit_depth - 8) << 3) |
- ((h->sps->bit_depth - 8) << 6) |
- ((h->sps->log2_max_poc_lsb - 4) << 9) |
+ pp->wFormatAndSequenceInfoFlags = (sps->chroma_format_idc << 0) |
+ (sps->separate_colour_plane_flag << 2) |
+ ((sps->bit_depth - 8) << 3) |
+ ((sps->bit_depth - 8) << 6) |
+ ((sps->log2_max_poc_lsb - 4) << 9) |
(0 << 13) |
(0 << 14) |
(0 << 15);
fill_picture_entry(&pp->CurrPic, ff_dxva2_get_surface_index(avctx, ctx, current_picture->frame), 0);
- pp->sps_max_dec_pic_buffering_minus1 = h->sps->temporal_layer[h->sps->max_sub_layers - 1].max_dec_pic_buffering - 1;
- pp->log2_min_luma_coding_block_size_minus3 = h->sps->log2_min_cb_size - 3;
- pp->log2_diff_max_min_luma_coding_block_size = h->sps->log2_diff_max_min_coding_block_size;
- pp->log2_min_transform_block_size_minus2 = h->sps->log2_min_tb_size - 2;
- pp->log2_diff_max_min_transform_block_size = h->sps->log2_max_trafo_size - h->sps->log2_min_tb_size;
- pp->max_transform_hierarchy_depth_inter = h->sps->max_transform_hierarchy_depth_inter;
- pp->max_transform_hierarchy_depth_intra = h->sps->max_transform_hierarchy_depth_intra;
- pp->num_short_term_ref_pic_sets = h->sps->nb_st_rps;
- pp->num_long_term_ref_pics_sps = h->sps->num_long_term_ref_pics_sps;
+ pp->sps_max_dec_pic_buffering_minus1 = sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering - 1;
+ pp->log2_min_luma_coding_block_size_minus3 = sps->log2_min_cb_size - 3;
+ pp->log2_diff_max_min_luma_coding_block_size = sps->log2_diff_max_min_coding_block_size;
+ pp->log2_min_transform_block_size_minus2 = sps->log2_min_tb_size - 2;
+ pp->log2_diff_max_min_transform_block_size = sps->log2_max_trafo_size - sps->log2_min_tb_size;
+ pp->max_transform_hierarchy_depth_inter = sps->max_transform_hierarchy_depth_inter;
+ pp->max_transform_hierarchy_depth_intra = sps->max_transform_hierarchy_depth_intra;
+ pp->num_short_term_ref_pic_sets = sps->nb_st_rps;
+ pp->num_long_term_ref_pics_sps = sps->num_long_term_ref_pics_sps;
- pp->num_ref_idx_l0_default_active_minus1 = h->pps->num_ref_idx_l0_default_active - 1;
- pp->num_ref_idx_l1_default_active_minus1 = h->pps->num_ref_idx_l1_default_active - 1;
- pp->init_qp_minus26 = h->pps->pic_init_qp_minus26;
+ pp->num_ref_idx_l0_default_active_minus1 = pps->num_ref_idx_l0_default_active - 1;
+ pp->num_ref_idx_l1_default_active_minus1 = pps->num_ref_idx_l1_default_active - 1;
+ pp->init_qp_minus26 = pps->pic_init_qp_minus26;
if (h->sh.short_term_ref_pic_set_sps_flag == 0 && h->sh.short_term_rps) {
- pp->ucNumDeltaPocsOfRefRpsIdx = h->sh.short_term_rps->num_delta_pocs;
+ pp->ucNumDeltaPocsOfRefRpsIdx = h->sh.short_term_rps->rps_idx_num_delta_pocs;
pp->wNumBitsForShortTermRPSInSlice = h->sh.short_term_ref_pic_set_size;
}
- pp->dwCodingParamToolFlags = (h->sps->scaling_list_enable_flag << 0) |
- (h->sps->amp_enabled_flag << 1) |
- (h->sps->sao_enabled << 2) |
- (h->sps->pcm_enabled_flag << 3) |
- ((h->sps->pcm_enabled_flag ? (h->sps->pcm.bit_depth - 1) : 0) << 4) |
- ((h->sps->pcm_enabled_flag ? (h->sps->pcm.bit_depth_chroma - 1) : 0) << 8) |
- ((h->sps->pcm_enabled_flag ? (h->sps->pcm.log2_min_pcm_cb_size - 3) : 0) << 12) |
- ((h->sps->pcm_enabled_flag ? (h->sps->pcm.log2_max_pcm_cb_size - h->sps->pcm.log2_min_pcm_cb_size) : 0) << 14) |
- (h->sps->pcm.loop_filter_disable_flag << 16) |
- (h->sps->long_term_ref_pics_present_flag << 17) |
- (h->sps->sps_temporal_mvp_enabled_flag << 18) |
- (h->sps->sps_strong_intra_smoothing_enable_flag << 19) |
- (h->pps->dependent_slice_segments_enabled_flag << 20) |
- (h->pps->output_flag_present_flag << 21) |
- (h->pps->num_extra_slice_header_bits << 22) |
- (h->pps->sign_data_hiding_flag << 25) |
- (h->pps->cabac_init_present_flag << 26) |
+ pp->dwCodingParamToolFlags = (sps->scaling_list_enable_flag << 0) |
+ (sps->amp_enabled_flag << 1) |
+ (sps->sao_enabled << 2) |
+ (sps->pcm_enabled_flag << 3) |
+ ((sps->pcm_enabled_flag ? (sps->pcm.bit_depth - 1) : 0) << 4) |
+ ((sps->pcm_enabled_flag ? (sps->pcm.bit_depth_chroma - 1) : 0) << 8) |
+ ((sps->pcm_enabled_flag ? (sps->pcm.log2_min_pcm_cb_size - 3) : 0) << 12) |
+ ((sps->pcm_enabled_flag ? (sps->pcm.log2_max_pcm_cb_size - sps->pcm.log2_min_pcm_cb_size) : 0) << 14) |
+ (sps->pcm.loop_filter_disable_flag << 16) |
+ (sps->long_term_ref_pics_present_flag << 17) |
+ (sps->sps_temporal_mvp_enabled_flag << 18) |
+ (sps->sps_strong_intra_smoothing_enable_flag << 19) |
+ (pps->dependent_slice_segments_enabled_flag << 20) |
+ (pps->output_flag_present_flag << 21) |
+ (pps->num_extra_slice_header_bits << 22) |
+ (pps->sign_data_hiding_flag << 25) |
+ (pps->cabac_init_present_flag << 26) |
(0 << 27);
- pp->dwCodingSettingPicturePropertyFlags = (h->pps->constrained_intra_pred_flag << 0) |
- (h->pps->transform_skip_enabled_flag << 1) |
- (h->pps->cu_qp_delta_enabled_flag << 2) |
- (h->pps->pic_slice_level_chroma_qp_offsets_present_flag << 3) |
- (h->pps->weighted_pred_flag << 4) |
- (h->pps->weighted_bipred_flag << 5) |
- (h->pps->transquant_bypass_enable_flag << 6) |
- (h->pps->tiles_enabled_flag << 7) |
- (h->pps->entropy_coding_sync_enabled_flag << 8) |
- (h->pps->uniform_spacing_flag << 9) |
- ((h->pps->tiles_enabled_flag ? h->pps->loop_filter_across_tiles_enabled_flag : 0) << 10) |
- (h->pps->seq_loop_filter_across_slices_enabled_flag << 11) |
- (h->pps->deblocking_filter_override_enabled_flag << 12) |
- (h->pps->disable_dbf << 13) |
- (h->pps->lists_modification_present_flag << 14) |
- (h->pps->slice_header_extension_present_flag << 15) |
+ pp->dwCodingSettingPicturePropertyFlags = (pps->constrained_intra_pred_flag << 0) |
+ (pps->transform_skip_enabled_flag << 1) |
+ (pps->cu_qp_delta_enabled_flag << 2) |
+ (pps->pic_slice_level_chroma_qp_offsets_present_flag << 3) |
+ (pps->weighted_pred_flag << 4) |
+ (pps->weighted_bipred_flag << 5) |
+ (pps->transquant_bypass_enable_flag << 6) |
+ (pps->tiles_enabled_flag << 7) |
+ (pps->entropy_coding_sync_enabled_flag << 8) |
+ (pps->uniform_spacing_flag << 9) |
+ ((pps->tiles_enabled_flag ? pps->loop_filter_across_tiles_enabled_flag : 0) << 10) |
+ (pps->seq_loop_filter_across_slices_enabled_flag << 11) |
+ (pps->deblocking_filter_override_enabled_flag << 12) |
+ (pps->disable_dbf << 13) |
+ (pps->lists_modification_present_flag << 14) |
+ (pps->slice_header_extension_present_flag << 15) |
(IS_IRAP(h) << 16) |
(IS_IDR(h) << 17) |
/* IntraPicFlag */
(IS_IRAP(h) << 18) |
(0 << 19);
- pp->pps_cb_qp_offset = h->pps->cb_qp_offset;
- pp->pps_cr_qp_offset = h->pps->cr_qp_offset;
- if (h->pps->tiles_enabled_flag) {
- pp->num_tile_columns_minus1 = h->pps->num_tile_columns - 1;
- pp->num_tile_rows_minus1 = h->pps->num_tile_rows - 1;
-
- if (!h->pps->uniform_spacing_flag) {
- for (i = 0; i < h->pps->num_tile_columns; i++)
- pp->column_width_minus1[i] = h->pps->column_width[i] - 1;
-
- for (i = 0; i < h->pps->num_tile_rows; i++)
- pp->row_height_minus1[i] = h->pps->row_height[i] - 1;
+ pp->pps_cb_qp_offset = pps->cb_qp_offset;
+ pp->pps_cr_qp_offset = pps->cr_qp_offset;
+ if (pps->tiles_enabled_flag) {
+ pp->num_tile_columns_minus1 = pps->num_tile_columns - 1;
+ pp->num_tile_rows_minus1 = pps->num_tile_rows - 1;
+
+ if (!pps->uniform_spacing_flag) {
+ for (i = 0; i < pps->num_tile_columns; i++)
+ pp->column_width_minus1[i] = pps->column_width[i] - 1;
+
+ for (i = 0; i < pps->num_tile_rows; i++)
+ pp->row_height_minus1[i] = pps->row_height[i] - 1;
}
}
- pp->diff_cu_qp_delta_depth = h->pps->diff_cu_qp_delta_depth;
- pp->pps_beta_offset_div2 = h->pps->beta_offset / 2;
- pp->pps_tc_offset_div2 = h->pps->tc_offset / 2;
- pp->log2_parallel_merge_level_minus2 = h->pps->log2_parallel_merge_level - 2;
+ pp->diff_cu_qp_delta_depth = pps->diff_cu_qp_delta_depth;
+ pp->pps_beta_offset_div2 = pps->beta_offset / 2;
+ pp->pps_tc_offset_div2 = pps->tc_offset / 2;
+ pp->log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2;
pp->CurrPicOrderCntVal = h->poc;
// fill RefPicList from the DPB
@@ -197,8 +199,8 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *
static void fill_scaling_lists(AVDXVAContext *ctx, const HEVCContext *h, DXVA_Qmatrix_HEVC *qm)
{
unsigned i, j, pos;
- const ScalingList *sl = h->pps->scaling_list_data_present_flag ?
- &h->pps->scaling_list : &h->sps->scaling_list;
+ const ScalingList *sl = h->ps.pps->scaling_list_data_present_flag ?
+ &h->ps.pps->scaling_list : &h->ps.sps->scaling_list;
memset(qm, 0, sizeof(*qm));
for (i = 0; i < 6; i++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h b/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
index 426de9dc163..6c9d0bb03f6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/dxva2_internal.h
@@ -27,6 +27,9 @@
#include "config.h"
+/* define the proper COM entries before forcing desktop APIs */
+#include <objbase.h>
+
#if CONFIG_DXVA2
#include "dxva2.h"
#endif
@@ -35,6 +38,12 @@
#endif
#if HAVE_DXVA_H
+/* When targeting WINAPI_FAMILY_PHONE_APP or WINAPI_FAMILY_APP, dxva.h
+ * defines nothing. Force the struct definitions to be visible. */
+#undef WINAPI_FAMILY
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+#undef _CRT_BUILD_DESKTOP_APP
+#define _CRT_BUILD_DESKTOP_APP 0
#include <dxva.h>
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/eacmv.c b/chromium/third_party/ffmpeg/libavcodec/eacmv.c
index d1b7c68595d..047be813b10 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eacmv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eacmv.c
@@ -242,5 +242,5 @@ AVCodec ff_eacmv_decoder = {
.init = cmv_decode_init,
.close = cmv_decode_end,
.decode = cmv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/eamad.c b/chromium/third_party/ffmpeg/libavcodec/eamad.c
index 7fef1c8127f..4e202f98a31 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eamad.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eamad.c
@@ -101,7 +101,7 @@ static inline void comp_block(MadContext *t, AVFrame *frame,
frame->linesize[0],
t->last_frame->data[0] + offset,
t->last_frame->linesize[0], add);
- } else if (!(t->avctx->flags & CODEC_FLAG_GRAY)) {
+ } else if (!(t->avctx->flags & AV_CODEC_FLAG_GRAY)) {
int index = j - 3;
unsigned offset = (mb_y * 8 + (mv_y/2))*t->last_frame->linesize[index] + mb_x * 8 + (mv_x/2);
if (offset >= (t->avctx->height/2 - 7) * t->last_frame->linesize[index] - 7)
@@ -120,7 +120,7 @@ static inline void idct_put(MadContext *t, AVFrame *frame, int16_t *block,
ff_ea_idct_put_c(
frame->data[0] + (mb_y*16 + ((j&2)<<2))*frame->linesize[0] + mb_x*16 + ((j&1)<<3),
frame->linesize[0], block);
- } else if (!(t->avctx->flags & CODEC_FLAG_GRAY)) {
+ } else if (!(t->avctx->flags & AV_CODEC_FLAG_GRAY)) {
int index = j - 3;
ff_ea_idct_put_c(
frame->data[index] + (mb_y*8)*frame->linesize[index] + mb_x*8,
@@ -312,7 +312,7 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR(ENOMEM);
s->bbdsp.bswap16_buf(s->bitstream_buf, (const uint16_t *)(buf + bytestream2_tell(&gb)),
bytestream2_get_bytes_left(&gb) / 2);
- memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, AV_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(bytestream2_get_bytes_left(&gb)));
for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
@@ -348,5 +348,5 @@ AVCodec ff_eamad_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/eatgq.c b/chromium/third_party/ffmpeg/libavcodec/eatgq.c
index 771dc2fb1aa..f8a47cb1a70 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eatgq.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eatgq.c
@@ -116,7 +116,7 @@ static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame *frame,
ff_ea_idct_put_c(dest_y + 8, linesize, block[1]);
ff_ea_idct_put_c(dest_y + 8 * linesize , linesize, block[2]);
ff_ea_idct_put_c(dest_y + 8 * linesize + 8, linesize, block[3]);
- if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
ff_ea_idct_put_c(dest_cb, frame->linesize[1], block[4]);
ff_ea_idct_put_c(dest_cr, frame->linesize[2], block[5]);
}
@@ -142,7 +142,7 @@ static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame,
tgq_dconly(s, dest_y + 8, linesize, dc[1]);
tgq_dconly(s, dest_y + 8 * linesize, linesize, dc[2]);
tgq_dconly(s, dest_y + 8 * linesize + 8, linesize, dc[3]);
- if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
tgq_dconly(s, dest_cb, frame->linesize[1], dc[4]);
tgq_dconly(s, dest_cr, frame->linesize[2], dc[5]);
}
@@ -157,7 +157,10 @@ static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)
mode = bytestream2_get_byte(&s->gb);
if (mode > 12) {
GetBitContext gb;
- init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));
+ int ret = init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));
+ if (ret < 0)
+ return ret;
+
for (i = 0; i < 6; i++)
tgq_decode_block(s, s->block[i], &gb);
tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);
@@ -249,5 +252,5 @@ AVCodec ff_eatgq_decoder = {
.priv_data_size = sizeof(TgqContext),
.init = tgq_decode_init,
.decode = tgq_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/eatgv.c b/chromium/third_party/ffmpeg/libavcodec/eatgv.c
index 835ff151681..882bf077b22 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eatgv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eatgv.c
@@ -364,5 +364,5 @@ AVCodec ff_eatgv_decoder = {
.init = tgv_decode_init,
.close = tgv_decode_end,
.decode = tgv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/eatqi.c b/chromium/third_party/ffmpeg/libavcodec/eatqi.c
index 34fc30dbbad..2423e21a41b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/eatqi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/eatqi.c
@@ -85,7 +85,7 @@ static inline void tqi_idct_put(TqiContext *t, AVFrame *frame, int16_t (*block)[
ff_ea_idct_put_c(dest_y + 8, linesize, block[1]);
ff_ea_idct_put_c(dest_y + 8*linesize , linesize, block[2]);
ff_ea_idct_put_c(dest_y + 8*linesize + 8, linesize, block[3]);
- if(!(s->avctx->flags&CODEC_FLAG_GRAY)) {
+ if(!(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
ff_ea_idct_put_c(dest_cb, frame->linesize[1], block[4]);
ff_ea_idct_put_c(dest_cr, frame->linesize[2], block[5]);
}
@@ -162,5 +162,5 @@ AVCodec ff_eatqi_decoder = {
.init = tqi_decode_init,
.close = tqi_decode_end,
.decode = tqi_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/elsdec.c b/chromium/third_party/ffmpeg/libavcodec/elsdec.c
new file mode 100644
index 00000000000..4797965457a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/elsdec.c
@@ -0,0 +1,422 @@
+/*
+ * ELS (Entropy Logarithmic-Scale) decoder
+ *
+ * Copyright (c) 2013 Maxim Poliakovski
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Entropy Logarithmic-Scale binary arithmetic decoder
+ */
+
+#include <math.h>
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
+#include "avcodec.h"
+#include "elsdec.h"
+
+/* ELS coder constants and structures. */
+#define ELS_JOTS_PER_BYTE 36
+#define ELS_MAX (1 << 24)
+#define RUNG_SPACE (64 * sizeof(ElsRungNode))
+
+/* ELS coder tables. */
+static const struct Ladder {
+ int8_t AMps;
+ int8_t ALps;
+ uint8_t next0;
+ uint8_t next1;
+} Ladder[174] = {
+ { -6, -5, 2, 1 },
+ { -2, -12, 3, 6 },
+ { -2, -12, 4, 6 },
+ { -1, -16, 7, 5 },
+ { -1, -16, 8, 10 },
+ { -5, -6, 11, 9 },
+ { -6, -5, 10, 5 },
+ { -1, -18, 13, 11 },
+ { -1, -18, 12, 14 },
+ { -6, -5, 15, 18 },
+ { -5, -6, 14, 9 },
+ { -3, -8, 17, 15 },
+ { -1, -20, 20, 16 },
+ { -1, -20, 23, 17 },
+ { -3, -8, 16, 18 },
+ { -5, -6, 19, 26 },
+ { -3, -9, 22, 24 },
+ { -3, -9, 21, 19 },
+ { -5, -6, 24, 26 },
+ { -4, -7, 27, 25 },
+ { -1, -22, 34, 28 },
+ { -2, -11, 29, 27 },
+ { -2, -11, 28, 30 },
+ { -1, -22, 39, 29 },
+ { -4, -7, 30, 32 },
+ { -6, -5, 33, 31 },
+ { -6, -5, 32, 25 },
+ { -3, -8, 35, 33 },
+ { -2, -12, 36, 38 },
+ { -2, -12, 37, 35 },
+ { -3, -8, 38, 40 },
+ { -6, -5, 41, 48 },
+ { -6, -5, 40, 31 },
+ { -5, -6, 43, 41 },
+ { -1, -24, 94, 42 },
+ { -3, -8, 45, 43 },
+ { -2, -12, 42, 44 },
+ { -2, -12, 47, 45 },
+ { -3, -8, 44, 46 },
+ { -1, -24, 125, 47 },
+ { -5, -6, 46, 48 },
+ { -6, -5, 49, 49 },
+ { -2, -13, 152, 164 },
+ { -4, -7, 51, 49 },
+ { -3, -9, 164, 168 },
+ { -3, -9, 55, 51 },
+ { -4, -7, 168, 170 },
+ { -2, -13, 67, 55 },
+ { -6, -5, 170, 49 },
+ { -6, -5, 51, 170 },
+ { -1, -72, 50, 74 },
+ { -4, -7, 53, 49 },
+ { -1, -61, 50, 74 },
+ { -3, -8, 55, 49 },
+ { -1, -51, 52, 76 },
+ { -3, -9, 57, 51 },
+ { -1, -46, 54, 76 },
+ { -2, -10, 59, 53 },
+ { -1, -43, 56, 78 },
+ { -2, -11, 61, 53 },
+ { -1, -41, 58, 80 },
+ { -2, -12, 63, 55 },
+ { -1, -39, 60, 82 },
+ { -2, -12, 65, 55 },
+ { -1, -37, 62, 84 },
+ { -2, -13, 67, 57 },
+ { -1, -36, 64, 86 },
+ { -1, -14, 69, 59 },
+ { -1, -35, 66, 88 },
+ { -1, -14, 71, 59 },
+ { -1, -34, 68, 90 },
+ { -1, -15, 73, 61 },
+ { -1, -33, 70, 92 },
+ { -1, -15, 75, 61 },
+ { -1, -32, 72, 94 },
+ { -1, -15, 77, 63 },
+ { -1, -31, 74, 96 },
+ { -1, -16, 79, 65 },
+ { -1, -31, 76, 98 },
+ { -1, -16, 81, 67 },
+ { -1, -30, 78, 100 },
+ { -1, -17, 83, 67 },
+ { -1, -29, 80, 102 },
+ { -1, -17, 85, 69 },
+ { -1, -29, 82, 104 },
+ { -1, -18, 87, 71 },
+ { -1, -28, 84, 104 },
+ { -1, -18, 89, 73 },
+ { -1, -28, 86, 108 },
+ { -1, -18, 91, 73 },
+ { -1, -27, 88, 108 },
+ { -1, -19, 93, 75 },
+ { -1, -27, 90, 112 },
+ { -1, -19, 95, 77 },
+ { -1, -26, 92, 112 },
+ { -1, -20, 97, 79 },
+ { -1, -26, 94, 114 },
+ { -1, -20, 99, 81 },
+ { -1, -25, 96, 116 },
+ { -1, -20, 101, 83 },
+ { -1, -25, 98, 118 },
+ { -1, -21, 103, 83 },
+ { -1, -24, 100, 120 },
+ { -1, -21, 105, 85 },
+ { -1, -24, 102, 122 },
+ { -1, -22, 107, 87 },
+ { -1, -23, 104, 124 },
+ { -1, -22, 109, 89 },
+ { -1, -23, 106, 126 },
+ { -1, -22, 111, 91 },
+ { -1, -22, 108, 128 },
+ { -1, -23, 113, 93 },
+ { -1, -22, 110, 130 },
+ { -1, -23, 115, 95 },
+ { -1, -22, 112, 132 },
+ { -1, -24, 117, 97 },
+ { -1, -21, 114, 134 },
+ { -1, -24, 119, 99 },
+ { -1, -21, 116, 136 },
+ { -1, -25, 121, 101 },
+ { -1, -20, 118, 136 },
+ { -1, -25, 123, 103 },
+ { -1, -20, 120, 138 },
+ { -1, -26, 125, 105 },
+ { -1, -20, 122, 140 },
+ { -1, -26, 127, 107 },
+ { -1, -19, 124, 142 },
+ { -1, -27, 129, 107 },
+ { -1, -19, 126, 144 },
+ { -1, -27, 131, 111 },
+ { -1, -18, 128, 146 },
+ { -1, -28, 133, 111 },
+ { -1, -18, 130, 146 },
+ { -1, -28, 135, 115 },
+ { -1, -18, 132, 148 },
+ { -1, -29, 137, 115 },
+ { -1, -17, 134, 150 },
+ { -1, -29, 139, 117 },
+ { -1, -17, 136, 152 },
+ { -1, -30, 141, 119 },
+ { -1, -16, 138, 152 },
+ { -1, -31, 143, 121 },
+ { -1, -16, 140, 154 },
+ { -1, -31, 145, 123 },
+ { -1, -15, 142, 156 },
+ { -1, -32, 147, 125 },
+ { -1, -15, 144, 158 },
+ { -1, -33, 149, 127 },
+ { -1, -15, 146, 158 },
+ { -1, -34, 151, 129 },
+ { -1, -14, 148, 160 },
+ { -1, -35, 153, 131 },
+ { -1, -14, 150, 160 },
+ { -1, -36, 155, 133 },
+ { -2, -13, 152, 162 },
+ { -1, -37, 157, 135 },
+ { -2, -12, 154, 164 },
+ { -1, -39, 159, 137 },
+ { -2, -12, 156, 164 },
+ { -1, -41, 161, 139 },
+ { -2, -11, 158, 166 },
+ { -1, -43, 163, 141 },
+ { -2, -10, 160, 166 },
+ { -1, -46, 165, 143 },
+ { -3, -9, 162, 168 },
+ { -1, -51, 167, 143 },
+ { -3, -8, 164, 170 },
+ { -1, -61, 169, 145 },
+ { -4, -7, 166, 170 },
+ { -1, -72, 169, 145 },
+ { -6, -5, 168, 49 },
+ { 0, -108, 171, 171 },
+ { 0, -108, 172, 172 },
+ { -6, -5, 173, 173 },
+};
+
+static const uint32_t els_exp_tab[ELS_JOTS_PER_BYTE * 4 + 1] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1,
+ 1, 2, 2, 2, 3, 4, 4, 5,
+ 6, 7, 8, 10, 11, 13, 16, 18,
+ 21, 25, 29, 34, 40, 47, 54, 64,
+ 74, 87, 101, 118, 138, 161, 188, 219,
+ 256, 298, 348, 406, 474, 552, 645, 752,
+ 877, 1024, 1194, 1393, 1625, 1896, 2211, 2580,
+ 3010, 3511, 4096, 4778, 5573, 6501, 7584, 8847,
+ 10321, 12040, 14045, 16384, 19112, 22295, 26007, 30339,
+ 35391, 41285, 48160, 56180, 65536, 76288, 89088, 103936,
+ 121344, 141312, 165120, 192512, 224512, 262144, 305664, 356608,
+ 416000, 485376, 566016, 660480, 770560, 898816, 1048576, 1223168,
+ 1426688, 1664256, 1941504, 2264832, 2642176, 3082240, 3595520, 4194304,
+ 4892672, 5707520, 6657792, 7766784, 9060096, 10568960, 12328960, 14382080,
+ 16777216,
+};
+
+void ff_els_decoder_init(ElsDecCtx *ctx, const uint8_t *in, size_t data_size)
+{
+ int nbytes;
+
+ /* consume up to 3 bytes from the input data */
+ if (data_size >= 3) {
+ ctx->x = AV_RB24(in);
+ nbytes = 3;
+ } else if (data_size == 2) {
+ ctx->x = AV_RB16(in);
+ nbytes = 2;
+ } else {
+ ctx->x = *in;
+ nbytes = 1;
+ }
+
+ ctx->in_buf = in + nbytes;
+ ctx->data_size = data_size - nbytes;
+ ctx->err = 0;
+ ctx->j = ELS_JOTS_PER_BYTE;
+ ctx->t = ELS_MAX;
+ ctx->diff = FFMIN(ELS_MAX - ctx->x,
+ ELS_MAX - els_exp_tab[ELS_JOTS_PER_BYTE * 4 - 1]);
+}
+
+void ff_els_decoder_uninit(ElsUnsignedRung *rung)
+{
+ av_free(rung->rem_rung_list);
+}
+
+static int els_import_byte(ElsDecCtx *ctx)
+{
+ if (!ctx->data_size) {
+ ctx->err = AVERROR_EOF;
+ return AVERROR_EOF;
+ }
+ ctx->x = (ctx->x << 8) | *ctx->in_buf++;
+ ctx->data_size--;
+ ctx->j += ELS_JOTS_PER_BYTE;
+ ctx->t <<= 8;
+
+ return 0;
+}
+
+int ff_els_decode_bit(ElsDecCtx *ctx, uint8_t *rung)
+{
+ int z, bit, ret;
+ const uint32_t *pAllowable = &els_exp_tab[ELS_JOTS_PER_BYTE * 3];
+
+ if (ctx->err)
+ return 0;
+
+ z = pAllowable[ctx->j + Ladder[*rung].ALps];
+ ctx->t -= z;
+ ctx->diff -= z;
+ if (ctx->diff > 0)
+ return *rung & 1; /* shortcut for x < t > pAllowable[j - 1] */
+
+ if (ctx->t > ctx->x) { /* decode most probable symbol (MPS) */
+ ctx->j += Ladder[*rung].AMps;
+ while (ctx->t > pAllowable[ctx->j])
+ ctx->j++;
+
+ if (ctx->j <= 0) { /* MPS: import one byte from bytestream. */
+ ret = els_import_byte(ctx);
+ if (ret < 0)
+ return ret;
+ }
+
+ z = ctx->t;
+ bit = *rung & 1;
+ *rung = Ladder[*rung].next0;
+ } else { /* decode less probable symbol (LPS) */
+ ctx->x -= ctx->t;
+ ctx->t = z;
+
+ ctx->j += Ladder[*rung].ALps;
+ if (ctx->j <= 0) {
+ /* LPS: import one byte from bytestream. */
+ z <<= 8;
+ ret = els_import_byte(ctx);
+ if (ret < 0)
+ return ret;
+ if (ctx->j <= 0) {
+ /* LPS: import second byte from bytestream. */
+ z <<= 8;
+ ret = els_import_byte(ctx);
+ if (ret < 0)
+ return ret;
+ while (pAllowable[ctx->j - 1] >= z)
+ ctx->j--;
+ }
+ }
+
+ bit = !(*rung & 1);
+ *rung = Ladder[*rung].next1;
+ }
+
+ ctx->diff = FFMIN(z - ctx->x, z - pAllowable[ctx->j - 1]);
+
+ return bit;
+}
+
+unsigned ff_els_decode_unsigned(ElsDecCtx *ctx, ElsUnsignedRung *ur)
+{
+ int i, n, r, bit;
+ ElsRungNode *rung_node;
+
+ if (ctx->err)
+ return 0;
+
+ /* decode unary prefix */
+ for (n = 0; n < ELS_EXPGOLOMB_LEN + 1; n++)
+ if (ff_els_decode_bit(ctx, &ur->prefix_rung[n]))
+ break;
+
+ /* handle the error/overflow case */
+ if (ctx->err || n >= ELS_EXPGOLOMB_LEN) {
+ ctx->err = AVERROR_INVALIDDATA;
+ return 0;
+ }
+
+ /* handle the zero case */
+ if (!n)
+ return 0;
+
+ /* initialize probability tree */
+ if (!ur->rem_rung_list) {
+ ur->rem_rung_list = av_realloc(NULL, RUNG_SPACE);
+ if (!ur->rem_rung_list) {
+ ctx->err = AVERROR(ENOMEM);
+ return 0;
+ }
+ memset(ur->rem_rung_list, 0, RUNG_SPACE);
+ ur->rung_list_size = RUNG_SPACE;
+ ur->avail_index = ELS_EXPGOLOMB_LEN;
+ }
+
+ /* decode the remainder */
+ for (i = 0, r = 0, bit = 0; i < n; i++) {
+ if (!i)
+ rung_node = &ur->rem_rung_list[n];
+ else {
+ if (!rung_node->next_index) {
+ if (ur->rung_list_size <= (ur->avail_index + 2) * sizeof(ElsRungNode)) {
+ // remember rung_node position
+ ptrdiff_t pos = rung_node - ur->rem_rung_list;
+ ur->rem_rung_list = av_realloc(ur->rem_rung_list,
+ ur->rung_list_size +
+ RUNG_SPACE);
+ if (!ur->rem_rung_list) {
+ av_free(ur->rem_rung_list);
+ ctx->err = AVERROR(ENOMEM);
+ return 0;
+ }
+ memset((uint8_t *) ur->rem_rung_list + ur->rung_list_size, 0,
+ RUNG_SPACE);
+ ur->rung_list_size += RUNG_SPACE;
+ // restore rung_node position in the new list
+ rung_node = &ur->rem_rung_list[pos];
+ }
+ rung_node->next_index = ur->avail_index;
+ ur->avail_index += 2;
+ }
+ rung_node = &ur->rem_rung_list[rung_node->next_index + bit];
+ }
+
+ bit = ff_els_decode_bit(ctx, &rung_node->rung);
+ if (ctx->err)
+ return bit;
+
+ r = (r << 1) + bit;
+ }
+
+ return (1 << n) - 1 + r; /* make value from exp golomb code */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/elsdec.h b/chromium/third_party/ffmpeg/libavcodec/elsdec.h
new file mode 100644
index 00000000000..139a24ab8bb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/elsdec.h
@@ -0,0 +1,60 @@
+/*
+ * ELS (Entropy Logarithmic-Scale) decoder
+ *
+ * Copyright (c) 2013 Maxim Poliakovski
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Entropy Logarithmic-Scale binary arithmetic coder
+ */
+
+#ifndef AVCODEC_ELSDEC_H
+#define AVCODEC_ELSDEC_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#define ELS_EXPGOLOMB_LEN 10
+
+typedef struct ElsDecCtx {
+ const uint8_t *in_buf;
+ unsigned x;
+ size_t data_size;
+ int j, t, diff, err;
+} ElsDecCtx;
+
+typedef struct ElsRungNode {
+ uint8_t rung;
+ uint16_t next_index;
+} ElsRungNode;
+
+typedef struct ElsUnsignedRung {
+ uint8_t prefix_rung[ELS_EXPGOLOMB_LEN + 1];
+ ElsRungNode *rem_rung_list;
+ size_t rung_list_size;
+ uint16_t avail_index;
+} ElsUnsignedRung;
+
+void ff_els_decoder_init(ElsDecCtx *ctx, const uint8_t *in, size_t data_size);
+void ff_els_decoder_uninit(ElsUnsignedRung *rung);
+int ff_els_decode_bit(ElsDecCtx *ctx, unsigned char *rung);
+unsigned ff_els_decode_unsigned(ElsDecCtx *ctx, ElsUnsignedRung *ur);
+
+#endif /* AVCODEC_ELSDEC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
index df4a64d17a8..2c741a4a160 100644
--- a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
+++ b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
@@ -777,7 +777,9 @@ void ff_er_frame_start(ERContext *s)
static int er_supported(ERContext *s)
{
if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice ||
- s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
+#if FF_API_CAP_VDPAU
+ s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU ||
+#endif
!s->cur_pic.f ||
s->cur_pic.field_picture
)
diff --git a/chromium/third_party/ffmpeg/libavcodec/escape124.c b/chromium/third_party/ffmpeg/libavcodec/escape124.c
index 28167419bda..efcac64128b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/escape124.c
+++ b/chromium/third_party/ffmpeg/libavcodec/escape124.c
@@ -373,5 +373,5 @@ AVCodec ff_escape124_decoder = {
.init = escape124_decode_init,
.close = escape124_decode_close,
.decode = escape124_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/escape130.c b/chromium/third_party/ffmpeg/libavcodec/escape130.c
index 129011b960c..f4f64d84190 100644
--- a/chromium/third_party/ffmpeg/libavcodec/escape130.c
+++ b/chromium/third_party/ffmpeg/libavcodec/escape130.c
@@ -356,5 +356,5 @@ AVCodec ff_escape130_decoder = {
.init = escape130_decode_init,
.close = escape130_decode_close,
.decode = escape130_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/evrcdec.c b/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
index c605a13d745..cbbc62976f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/evrcdec.c
@@ -26,6 +26,7 @@
*/
#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
@@ -66,6 +67,10 @@ typedef struct EVRCAFrame {
} EVRCAFrame;
typedef struct EVRCContext {
+ AVClass *class;
+
+ int postfilter;
+
GetBitContext gb;
evrc_packet_rate bitrate;
evrc_packet_rate last_valid_bitrate;
@@ -876,9 +881,11 @@ static int evrc_decode_frame(AVCodecContext *avctx, void *data,
memmove(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
synthesis_filter(e->pitch + ACB_SIZE, ilpc,
- e->synthesis, subframe_size, tmp);
- postfilter(e, tmp, ilpc, samples, pitch_lag,
- &postfilter_coeffs[e->bitrate], subframe_size);
+ e->synthesis, subframe_size,
+ e->postfilter ? tmp : samples);
+ if (e->postfilter)
+ postfilter(e, tmp, ilpc, samples, pitch_lag,
+ &postfilter_coeffs[e->bitrate], subframe_size);
samples += subframe_size;
}
@@ -906,6 +913,21 @@ erasure:
return avpkt->size;
}
+#define OFFSET(x) offsetof(EVRCContext, x)
+#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+
+static const AVOption options[] = {
+ { "postfilter", "enable postfilter", OFFSET(postfilter), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AD },
+ { NULL }
+};
+
+static const AVClass evrcdec_class = {
+ .class_name = "evrc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_evrc_decoder = {
.name = "evrc",
.long_name = NULL_IF_CONFIG_SMALL("EVRC (Enhanced Variable Rate Codec)"),
@@ -913,6 +935,7 @@ AVCodec ff_evrc_decoder = {
.id = AV_CODEC_ID_EVRC,
.init = evrc_decode_init,
.decode = evrc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(EVRCContext),
+ .priv_class = &evrcdec_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/exr.c b/chromium/third_party/ffmpeg/libavcodec/exr.c
index 9308ae03a82..3b6b2451870 100644
--- a/chromium/third_party/ffmpeg/libavcodec/exr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/exr.c
@@ -37,6 +37,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
+#include "libavutil/color_utils.h"
#include "avcodec.h"
#include "bytestream.h"
@@ -110,6 +111,7 @@ typedef struct EXRContext {
const char *layer;
+ enum AVColorTransferCharacteristic apply_trc_type;
float gamma;
uint16_t gamma_table[65536];
} EXRContext;
@@ -842,6 +844,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
int bxmin = s->xmin * 2 * s->desc->nb_components;
int i, x, buf_size = s->buf_size;
float one_gamma = 1.0f / s->gamma;
+ avpriv_trc_function trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type);
int ret;
line_offset = AV_RL64(s->gb.buffer + jobnr * 8);
@@ -921,24 +924,43 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
ptr_x += s->xmin * s->desc->nb_components;
if (s->pixel_type == EXR_FLOAT) {
// 32-bit
- for (x = 0; x < xdelta; x++) {
- union av_intfloat32 t;
- t.i = bytestream_get_le32(&r);
- if (t.f > 0.0f) /* avoid negative values */
- t.f = powf(t.f, one_gamma);
- *ptr_x++ = exr_flt2uint(t.i);
-
- t.i = bytestream_get_le32(&g);
- if (t.f > 0.0f)
- t.f = powf(t.f, one_gamma);
- *ptr_x++ = exr_flt2uint(t.i);
-
- t.i = bytestream_get_le32(&b);
- if (t.f > 0.0f)
- t.f = powf(t.f, one_gamma);
- *ptr_x++ = exr_flt2uint(t.i);
- if (channel_buffer[3])
- *ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
+ if (trc_func) {
+ for (x = 0; x < xdelta; x++) {
+ union av_intfloat32 t;
+ t.i = bytestream_get_le32(&r);
+ t.f = trc_func(t.f);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&g);
+ t.f = trc_func(t.f);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&b);
+ t.f = trc_func(t.f);
+ *ptr_x++ = exr_flt2uint(t.i);
+ if (channel_buffer[3])
+ *ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
+ }
+ } else {
+ for (x = 0; x < xdelta; x++) {
+ union av_intfloat32 t;
+ t.i = bytestream_get_le32(&r);
+ if (t.f > 0.0f) /* avoid negative values */
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&g);
+ if (t.f > 0.0f)
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
+
+ t.i = bytestream_get_le32(&b);
+ if (t.f > 0.0f)
+ t.f = powf(t.f, one_gamma);
+ *ptr_x++ = exr_flt2uint(t.i);
+ if (channel_buffer[3])
+ *ptr_x++ = exr_flt2uint(bytestream_get_le32(&a));
+ }
}
} else {
// 16-bit
@@ -1287,6 +1309,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
+ if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED)
+ avctx->color_trc = s->apply_trc_type;
+
switch (s->compression) {
case EXR_RAW:
case EXR_RLE:
@@ -1364,21 +1389,31 @@ static av_cold int decode_init(AVCodecContext *avctx)
uint32_t i;
union av_intfloat32 t;
float one_gamma = 1.0f / s->gamma;
+ avpriv_trc_function trc_func = NULL;
s->avctx = avctx;
- if (one_gamma > 0.9999f && one_gamma < 1.0001f) {
- for (i = 0; i < 65536; ++i)
- s->gamma_table[i] = exr_halflt2uint(i);
- } else {
+ trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type);
+ if (trc_func) {
for (i = 0; i < 65536; ++i) {
t = exr_half2float(i);
- /* If negative value we reuse half value */
- if (t.f <= 0.0f) {
+ t.f = trc_func(t.f);
+ s->gamma_table[i] = exr_flt2uint(t.i);
+ }
+ } else {
+ if (one_gamma > 0.9999f && one_gamma < 1.0001f) {
+ for (i = 0; i < 65536; ++i)
s->gamma_table[i] = exr_halflt2uint(i);
- } else {
- t.f = powf(t.f, one_gamma);
- s->gamma_table[i] = exr_flt2uint(t.i);
+ } else {
+ for (i = 0; i < 65536; ++i) {
+ t = exr_half2float(i);
+ /* If negative value we reuse half value */
+ if (t.f <= 0.0f) {
+ s->gamma_table[i] = exr_halflt2uint(i);
+ } else {
+ t.f = powf(t.f, one_gamma);
+ s->gamma_table[i] = exr_flt2uint(t.i);
+ }
}
}
}
@@ -1427,6 +1462,43 @@ static const AVOption options[] = {
AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD },
{ "gamma", "Set the float gamma value when decoding", OFFSET(gamma),
AV_OPT_TYPE_FLOAT, { .dbl = 1.0f }, 0.001, FLT_MAX, VD },
+
+ // XXX: Note the abuse of the enum using AVCOL_TRC_UNSPECIFIED to subsume the existing gamma option
+ { "apply_trc", "color transfer characteristics to apply to EXR linear input", OFFSET(apply_trc_type),
+ AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, VD, "apply_trc_type"},
+ { "bt709", "BT.709", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT709 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "gamma", "gamma", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_UNSPECIFIED }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "gamma22", "BT.470 M", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_GAMMA22 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "gamma28", "BT.470 BG", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_GAMMA28 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "smpte170m", "SMPTE 170 M", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE170M }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "smpte240m", "SMPTE 240 M", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE240M }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "linear", "Linear", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LINEAR }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "log", "Log", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "log_sqrt", "Log square root", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "iec61966_2_4", "IEC 61966-2-4", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "bt1361", "BT.1361", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT1361_ECG }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "iec61966_2_1", "IEC 61966-2-1", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "bt2020_10bit", "BT.2020 - 10 bit", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "bt2020_12bit", "BT.2020 - 12 bit", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "smpte2084", "SMPTE ST 2084", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTEST2084 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+ { "smpte428_1", "SMPTE ST 428-1", 0,
+ AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, VD, "apply_trc_type"},
+
{ NULL },
};
@@ -1447,7 +1519,7 @@ AVCodec ff_exr_decoder = {
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS |
- CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS,
.priv_class = &exr_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/faxcompr.c b/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
index eb39ae0b20d..80df418a291 100644
--- a/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/faxcompr.c
@@ -122,6 +122,77 @@ av_cold void ff_ccitt_unpack_init(void)
initialized = 1;
}
+static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
+ unsigned int *pix_left, int **runs,
+ const int *runend, int *mode)
+{
+ int eob = 0;
+ int newmode;
+ int saved_run = 0;
+
+ do {
+ int cwi, k;
+ int cw = 0;
+ int codes[2];
+ do {
+ cwi = show_bits(gb, 11);
+ if (!cwi) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid uncompressed codeword\n");
+ return AVERROR_INVALIDDATA;
+ }
+ cwi = 10 - av_log2(cwi);
+ skip_bits(gb, cwi + 1);
+ if (cwi > 5) {
+ newmode = get_bits1(gb);
+ eob = 1;
+ cwi -= 6;
+ }
+ cw += cwi;
+ } while(cwi == 5);
+
+ codes[0] = cw;
+ codes[1] = !eob;
+
+ for (k = 0; k < 2; k++) {
+ if (codes[k]) {
+ if (*mode == !k) {
+ *(*runs)++ = saved_run;
+ if (*runs >= runend) {
+ av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (*pix_left <= saved_run) {
+ av_log(avctx, AV_LOG_ERROR, "uncompressed run went out of bounds\n");
+ return AVERROR_INVALIDDATA;
+ }
+ *pix_left -= saved_run;
+ saved_run = 0;
+ *mode = !*mode;
+ }
+ saved_run += codes[k];
+ }
+ }
+ } while (!eob);
+ *(*runs)++ = saved_run;
+ if (*runs >= runend) {
+ av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (*pix_left <= saved_run) {
+ if (*pix_left == saved_run)
+ return 1;
+ av_log(avctx, AV_LOG_ERROR, "uncompressed run went out of boundsE\n");
+ return AVERROR_INVALIDDATA;
+ }
+ *pix_left -= saved_run;
+ saved_run = 0;
+ *mode = !*mode;
+ if (newmode != *mode) { //FIXME CHECK
+ *(*runs)++ = 0;
+ *mode = newmode;
+ }
+ return 0;
+}
static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
unsigned int pix_left, int *runs,
@@ -149,8 +220,18 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
run = 0;
mode = !mode;
} else if ((int)t == -1) {
- av_log(avctx, AV_LOG_ERROR, "Incorrect code\n");
- return AVERROR_INVALIDDATA;
+ if (show_bits(gb, 12) == 15) {
+ int ret;
+ skip_bits(gb, 12);
+ ret = decode_uncompressed(avctx, gb, &pix_left, &runs, runend, &mode);
+ if (ret < 0) {
+ return ret;
+ } else if (ret)
+ break;
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "Incorrect code\n");
+ return AVERROR_INVALIDDATA;
+ }
}
}
*runs++ = 0;
@@ -211,8 +292,25 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
mode = !mode;
}
} else if (cmode == 9 || cmode == 10) {
- avpriv_report_missing_feature(avctx, "Special modes support");
- return AVERROR_PATCHWELCOME;
+ int xxx = get_bits(gb, 3);
+ if (cmode == 9 && xxx == 7) {
+ int ret;
+ int pix_left = width - offs;
+
+ if (saved_run) {
+ av_log(avctx, AV_LOG_ERROR, "saved run %d on entering uncompressed mode\n", saved_run);
+ return AVERROR_INVALIDDATA;
+ }
+ ret = decode_uncompressed(avctx, gb, &pix_left, &runs, runend, &mode);
+ offs = width - pix_left;
+ if (ret < 0) {
+ return ret;
+ } else if (ret)
+ break;
+ } else {
+ avpriv_report_missing_feature(avctx, "Special mode %d xxx=%d support", cmode, xxx);
+ return AVERROR_PATCHWELCOME;
+ }
} else { //vertical mode
run = run_off - offs + (cmode - 5);
run_off -= *--ref;
diff --git a/chromium/third_party/ffmpeg/libavcodec/fft-test.c b/chromium/third_party/ffmpeg/libavcodec/fft-test.c
index 7c3eea4b88b..d647fde1196 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fft-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fft-test.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
break;
case 'c':
{
- int cpuflags = av_get_cpu_flags();
+ unsigned cpuflags = av_get_cpu_flags();
if (av_parse_cpu_caps(&cpuflags, optarg) < 0)
return 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1.c b/chromium/third_party/ffmpeg/libavcodec/ffv1.c
index 7a38bf9212c..6bcdf7c0adc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1.c
@@ -39,7 +39,7 @@
#include "mathops.h"
#include "ffv1.h"
-av_cold int ffv1_common_init(AVCodecContext *avctx)
+av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
{
FFV1Context *s = avctx->priv_data;
@@ -64,7 +64,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx)
return 0;
}
-av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
+av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
{
int j;
@@ -98,18 +98,18 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
return 0;
}
-av_cold int ffv1_init_slices_state(FFV1Context *f)
+av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
{
int i, ret;
for (i = 0; i < f->slice_count; i++) {
FFV1Context *fs = f->slice_context[i];
- if ((ret = ffv1_init_slice_state(f, fs)) < 0)
+ if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
return AVERROR(ENOMEM);
}
return 0;
}
-av_cold int ffv1_init_slice_contexts(FFV1Context *f)
+av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
{
int i;
@@ -154,7 +154,7 @@ memfail:
return AVERROR(ENOMEM);
}
-int ffv1_allocate_initial_states(FFV1Context *f)
+int ff_ffv1_allocate_initial_states(FFV1Context *f)
{
int i;
@@ -169,7 +169,7 @@ int ffv1_allocate_initial_states(FFV1Context *f)
return 0;
}
-void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
+void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
{
int i, j;
@@ -197,7 +197,7 @@ void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
}
-av_cold int ffv1_close(AVCodecContext *avctx)
+av_cold int ff_ffv1_close(AVCodecContext *avctx)
{
FFV1Context *s = avctx->priv_data;
int i, j;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1.h b/chromium/third_party/ffmpeg/libavcodec/ffv1.h
index bfc4d71e65a..9526b1634f8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1.h
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1.h
@@ -87,6 +87,7 @@ typedef struct FFV1Context {
int transparency;
int flags;
int picture_number;
+ int key_frame;
ThreadFrame picture, last_picture;
struct FFV1Context *fsrc;
@@ -129,13 +130,13 @@ typedef struct FFV1Context {
int slice_rct_ry_coef;
} FFV1Context;
-int ffv1_common_init(AVCodecContext *avctx);
-int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs);
-int ffv1_init_slices_state(FFV1Context *f);
-int ffv1_init_slice_contexts(FFV1Context *f);
-int ffv1_allocate_initial_states(FFV1Context *f);
-void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs);
-int ffv1_close(AVCodecContext *avctx);
+int ff_ffv1_common_init(AVCodecContext *avctx);
+int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs);
+int ff_ffv1_init_slices_state(FFV1Context *f);
+int ff_ffv1_init_slice_contexts(FFV1Context *f);
+int ff_ffv1_allocate_initial_states(FFV1Context *f);
+void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs);
+int ff_ffv1_close(AVCodecContext *avctx);
static av_always_inline int fold(int diff, int bits)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
index cc7c605c6b7..557b1a09941 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1dec.c
@@ -359,7 +359,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
FFV1Context *fs = *(void **)arg;
FFV1Context *f = fs->avctx->priv_data;
int width, height, x, y, ret;
- const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step_minus1 + 1;
+ const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step;
AVFrame * const p = f->cur;
int i, si;
@@ -402,17 +402,17 @@ static int decode_slice(AVCodecContext *c, void *arg)
fs->slice_rct_ry_coef = 1;
if (f->version > 2) {
- if (ffv1_init_slice_state(f, fs) < 0)
+ if (ff_ffv1_init_slice_state(f, fs) < 0)
return AVERROR(ENOMEM);
if (decode_slice_header(f, fs) < 0) {
fs->slice_damaged = 1;
return AVERROR_INVALIDDATA;
}
}
- if ((ret = ffv1_init_slice_state(f, fs)) < 0)
+ if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
return ret;
if (f->cur->key_frame || fs->slice_reset_contexts)
- ffv1_clear_slice_state(f, fs);
+ ff_ffv1_clear_slice_state(f, fs);
width = fs->slice_width;
height = fs->slice_height;
@@ -513,6 +513,7 @@ static int read_extra_header(FFV1Context *f)
uint8_t state[CONTEXT_SIZE];
int i, j, k, ret;
uint8_t state2[32][CONTEXT_SIZE];
+ unsigned crc = 0;
memset(state2, 128, sizeof(state2));
memset(state, 128, sizeof(state));
@@ -571,7 +572,7 @@ static int read_extra_header(FFV1Context *f)
return AVERROR_INVALIDDATA;
}
}
- if ((ret = ffv1_allocate_initial_states(f)) < 0)
+ if ((ret = ff_ffv1_allocate_initial_states(f)) < 0)
return ret;
for (i = 0; i < f->quant_table_count; i++)
@@ -594,15 +595,16 @@ static int read_extra_header(FFV1Context *f)
unsigned v;
v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0,
f->avctx->extradata, f->avctx->extradata_size);
- if (v) {
+ if (v || f->avctx->extradata_size < 4) {
av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %X!\n", v);
return AVERROR_INVALIDDATA;
}
+ crc = AV_RB32(f->avctx->extradata + f->avctx->extradata_size - 4);
}
if (f->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(f->avctx, AV_LOG_DEBUG,
- "global: ver:%d.%d, coder:%d, colorspace: %d bpr:%d chroma:%d(%d:%d), alpha:%d slices:%dx%d qtabs:%d ec:%d intra:%d\n",
+ "global: ver:%d.%d, coder:%d, colorspace: %d bpr:%d chroma:%d(%d:%d), alpha:%d slices:%dx%d qtabs:%d ec:%d intra:%d CRC:0x%08X\n",
f->version, f->micro_version,
f->ac,
f->colorspace,
@@ -612,7 +614,8 @@ static int read_extra_header(FFV1Context *f)
f->num_h_slices, f->num_v_slices,
f->quant_table_count,
f->ec,
- f->intra
+ f->intra,
+ crc
);
return 0;
}
@@ -852,13 +855,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
FFV1Context *f = avctx->priv_data;
int ret;
- if ((ret = ffv1_common_init(avctx)) < 0)
+ if ((ret = ff_ffv1_common_init(avctx)) < 0)
return ret;
if (avctx->extradata && (ret = read_extra_header(f)) < 0)
return ret;
- if ((ret = ffv1_init_slice_contexts(f)) < 0)
+ if ((ret = ff_ffv1_init_slice_contexts(f)) < 0)
return ret;
avctx->internal->allocate_progress = 1;
@@ -947,6 +950,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
}
fs->slice_damaged = 1;
}
+ if (avctx->debug & FF_DEBUG_PICT_INFO) {
+ av_log(avctx, AV_LOG_DEBUG, "slice %d, CRC: 0x%08X\n", i, AV_RB32(buf_p + v - 4));
+ }
}
if (i) {
@@ -1021,7 +1027,7 @@ static int init_thread_copy(AVCodecContext *avctx)
f->picture.f = av_frame_alloc();
f->last_picture.f = av_frame_alloc();
- if ((ret = ffv1_init_slice_contexts(f)) < 0)
+ if ((ret = ff_ffv1_init_slice_contexts(f)) < 0)
return ret;
return 0;
@@ -1106,10 +1112,10 @@ AVCodec ff_ffv1_decoder = {
.id = AV_CODEC_ID_FFV1,
.priv_data_size = sizeof(FFV1Context),
.init = decode_init,
- .close = ffv1_close,
+ .close = ff_ffv1_close,
.decode = decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
- .capabilities = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/ |
- CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ |
+ AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c b/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
index af727a5cd57..265ced11724 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1enc.c
@@ -312,7 +312,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w,
diff = fold(diff, bits);
if (s->ac) {
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
put_symbol_inline(c, p->state[context], diff, 1, s->rc_stat,
s->rc_stat2[p->quant_table_index][context]);
} else {
@@ -550,7 +550,7 @@ static int write_extradata(FFV1Context *f)
f->avctx->extradata_size = 10000 + 4 +
(11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32;
- f->avctx->extradata = av_malloc(f->avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ f->avctx->extradata = av_malloc(f->avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!f->avctx->extradata)
return AVERROR(ENOMEM);
ff_init_range_encoder(c, f->avctx->extradata, f->avctx->extradata_size);
@@ -667,12 +667,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
int i, j, k, m, ret;
- if ((ret = ffv1_common_init(avctx)) < 0)
+ if ((ret = ff_ffv1_common_init(avctx)) < 0)
return ret;
s->version = 0;
- if ((avctx->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)) || avctx->slices>1)
+ if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
+ avctx->slices > 1)
s->version = FFMAX(s->version, 2);
// Unspecified level & slices, we choose version 1.2+ to ensure multithreaded decodability
@@ -753,7 +754,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->chroma_planes = desc->nb_components < 3 ? 0 : 1;
s->colorspace = 0;
s->transparency = desc->nb_components == 4;
- if (!avctx->bits_per_raw_sample)
+ if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
+ s->bits_per_raw_sample = 8;
+ else if (!s->bits_per_raw_sample)
s->bits_per_raw_sample = 8;
break;
case AV_PIX_FMT_RGB32:
@@ -848,14 +851,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
p->context_count = s->context_count[p->quant_table_index];
}
- if ((ret = ffv1_allocate_initial_states(s)) < 0)
+ if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)
return ret;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (!s->transparency)
s->plane_count = 2;
@@ -865,7 +868,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
s->picture_number = 0;
- if (avctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
+ if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) {
for (i = 0; i < s->quant_table_count; i++) {
s->rc_stat2[i] = av_mallocz(s->context_count[i] *
sizeof(*s->rc_stat2[i]));
@@ -972,13 +975,13 @@ slices_ok:
return ret;
}
- if ((ret = ffv1_init_slice_contexts(s)) < 0)
+ if ((ret = ff_ffv1_init_slice_contexts(s)) < 0)
return ret;
- if ((ret = ffv1_init_slices_state(s)) < 0)
+ if ((ret = ff_ffv1_init_slices_state(s)) < 0)
return ret;
#define STATS_OUT_SIZE 1024 * 1024 * 6
- if (avctx->flags & CODEC_FLAG_PASS1) {
+ if (avctx->flags & AV_CODEC_FLAG_PASS1) {
avctx->stats_out = av_mallocz(STATS_OUT_SIZE);
if (!avctx->stats_out)
return AVERROR(ENOMEM);
@@ -1020,7 +1023,7 @@ static void encode_slice_header(FFV1Context *f, FFV1Context *fs)
if (f->version > 3) {
put_rac(c, state, fs->slice_coding_mode == 1);
if (fs->slice_coding_mode == 1)
- ffv1_clear_slice_state(f, fs);
+ ff_ffv1_clear_slice_state(f, fs);
put_symbol(c, state, fs->slice_coding_mode, 0);
if (fs->slice_coding_mode != 1) {
put_symbol(c, state, fs->slice_rct_by_coef, 0);
@@ -1120,7 +1123,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
int x = fs->slice_x;
int y = fs->slice_y;
const AVFrame *const p = f->picture.f;
- const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step_minus1 + 1;
+ const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step;
int ret;
RangeCoder c_bak = fs->c;
const uint8_t *planes[3] = {p->data[0] + ps*x + y*p->linesize[0],
@@ -1136,8 +1139,8 @@ static int encode_slice(AVCodecContext *c, void *arg)
}
retry:
- if (c->coded_frame->key_frame)
- ffv1_clear_slice_state(f, fs);
+ if (f->key_frame)
+ ff_ffv1_clear_slice_state(f, fs);
if (f->version > 2) {
encode_slice_header(f, fs);
}
@@ -1194,11 +1197,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t keystate = 128;
uint8_t *buf_p;
int i, ret;
- int64_t maxsize = FF_MIN_BUFFER_SIZE
+ int64_t maxsize = AV_INPUT_BUFFER_MIN_SIZE
+ avctx->width*avctx->height*35LL*4;
if(!pict) {
- if (avctx->flags & CODEC_FLAG_PASS1) {
+ if (avctx->flags & AV_CODEC_FLAG_PASS1) {
int j, k, m;
char *p = avctx->stats_out;
char *end = p + STATS_OUT_SIZE;
@@ -1243,9 +1246,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
if (f->version > 3)
- maxsize = FF_MIN_BUFFER_SIZE + avctx->width*avctx->height*3LL*4;
+ maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*3LL*4;
- if ((ret = ff_alloc_packet2(avctx, pkt, maxsize)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, maxsize, 0)) < 0)
return ret;
ff_init_range_encoder(c, pkt->data, pkt->size);
@@ -1258,12 +1261,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
put_rac(c, &keystate, 1);
- avctx->coded_frame->key_frame = 1;
+ f->key_frame = 1;
f->gob_count++;
write_header(f);
} else {
put_rac(c, &keystate, 0);
- avctx->coded_frame->key_frame = 0;
+ f->key_frame = 0;
}
if (f->ac > 1) {
@@ -1313,14 +1316,20 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf_p += bytes;
}
- if (avctx->flags & CODEC_FLAG_PASS1)
+ if (avctx->flags & AV_CODEC_FLAG_PASS1)
avctx->stats_out[0] = '\0';
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->key_frame = f->key_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
f->picture_number++;
pkt->size = buf_p - pkt->data;
pkt->pts =
pkt->dts = pict->pts;
- pkt->flags |= AV_PKT_FLAG_KEY * avctx->coded_frame->key_frame;
+ pkt->flags |= AV_PKT_FLAG_KEY * f->key_frame;
*got_packet = 1;
return 0;
@@ -1328,8 +1337,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
- ffv1_close(avctx);
+ ff_ffv1_close(avctx);
return 0;
}
@@ -1361,7 +1369,7 @@ AVCodec ff_ffv1_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_close,
- .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
index e835934fa03..9d055e40195 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
@@ -477,5 +477,5 @@ AVCodec ff_ffwavesynth_decoder = {
.init = wavesynth_init,
.close = wavesynth_close,
.decode = wavesynth_decode,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/fic.c b/chromium/third_party/ffmpeg/libavcodec/fic.c
index 48e7a6ea0a9..b58b017c77e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fic.c
@@ -22,6 +22,7 @@
*/
#include "libavutil/common.h"
+#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
@@ -36,6 +37,7 @@ typedef struct FICThreadContext {
} FICThreadContext;
typedef struct FICContext {
+ AVClass *class;
AVCodecContext *avctx;
AVFrame *frame;
AVFrame *final_frame;
@@ -51,6 +53,7 @@ typedef struct FICContext {
int num_slices, slice_h;
uint8_t cursor_buf[4096];
+ int skip_cursor;
} FICContext;
static const uint8_t fic_qmat_hq[64] = {
@@ -263,7 +266,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
int msize;
int tsize;
int cur_x, cur_y;
- int skip_cursor = 0;
+ int skip_cursor = ctx->skip_cursor;
uint8_t *sdata;
if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0)
@@ -452,6 +455,18 @@ static av_cold int fic_decode_init(AVCodecContext *avctx)
return 0;
}
+static const AVOption options[] = {
+{ "skip_cursor", "skip the cursor", offsetof(FICContext, skip_cursor), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
+{ NULL },
+};
+
+static const AVClass fic_decoder_class = {
+ .class_name = "FIC encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_fic_decoder = {
.name = "fic",
.long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"),
@@ -461,5 +476,6 @@ AVCodec ff_fic_decoder = {
.init = fic_decode_init,
.decode = fic_decode_frame,
.close = fic_decode_close,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
+ .priv_class = &fic_decoder_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/flac.c b/chromium/third_party/ffmpeg/libavcodec/flac.c
index 5ff004e01b2..f5154b9149d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flac.c
@@ -235,18 +235,3 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
skip_bits_long(&gb, 64); /* md5 sum */
skip_bits_long(&gb, 64); /* md5 sum */
}
-
-#if LIBAVCODEC_VERSION_MAJOR < 57
-void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
- const uint8_t *buffer)
-{
- ff_flac_parse_streaminfo(avctx, s, buffer);
-}
-
-int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
- enum FLACExtradataFormat *format,
- uint8_t **streaminfo_start)
-{
- return ff_flac_is_extradata_valid(avctx, format, streaminfo_start);
-}
-#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/flac.h b/chromium/third_party/ffmpeg/libavcodec/flac.h
index f1307c7f507..96d971c9d7e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flac.h
+++ b/chromium/third_party/ffmpeg/libavcodec/flac.h
@@ -99,14 +99,6 @@ typedef struct FLACFrameInfo {
void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
const uint8_t *buffer);
-#if LIBAVCODEC_VERSION_MAJOR < 57
-void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
- const uint8_t *buffer);
-int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
- enum FLACExtradataFormat *format,
- uint8_t **streaminfo_start);
-#endif
-
/**
* Validate the FLAC extradata.
* @param[in] avctx codec context containing the extradata.
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacdec.c b/chromium/third_party/ffmpeg/libavcodec/flacdec.c
index 30fe41618d7..8653da7d2ae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacdec.c
@@ -665,7 +665,7 @@ AVCodec ff_flac_decoder = {
.close = flac_decode_close,
.decode = flac_decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32,
diff --git a/chromium/third_party/ffmpeg/libavcodec/flacenc.c b/chromium/third_party/ffmpeg/libavcodec/flacenc.c
index 29bd9999b5b..f849ffcca40 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flacenc.c
@@ -1346,7 +1346,13 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
av_md5_final(s->md5ctx, s->md5sum);
write_streaminfo(s, avctx->extradata);
+#if FF_API_SIDEDATA_ONLY_PKT
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->side_data_only_packets && !s->flushed) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ if (!s->flushed) {
+#endif
uint8_t *side_data = av_packet_new_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
avctx->extradata_size);
if (!side_data)
@@ -1390,7 +1396,7 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, frame_bytes)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, frame_bytes, 0)) < 0)
return ret;
out_bytes = write_frame(s, avpkt);
@@ -1475,7 +1481,7 @@ AVCodec ff_flac_encoder = {
.init = flac_encode_init,
.encode2 = flac_encode_frame,
.close = flac_encode_close,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_LOSSLESS,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_LOSSLESS,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/flashsv.c b/chromium/third_party/ffmpeg/libavcodec/flashsv.c
index f429167fe0f..69b56d116cf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flashsv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flashsv.c
@@ -509,7 +509,7 @@ AVCodec ff_flashsv_decoder = {
.init = flashsv_decode_init,
.close = flashsv_decode_end,
.decode = flashsv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
};
#endif /* CONFIG_FLASHSV_DECODER */
@@ -572,7 +572,7 @@ AVCodec ff_flashsv2_decoder = {
.init = flashsv2_decode_init,
.close = flashsv2_decode_end,
.decode = flashsv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
};
#endif /* CONFIG_FLASHSV2_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c b/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
index a8bcaa24671..c2c00f49169 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flashsv2enc.c
@@ -854,7 +854,7 @@ static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int res;
int keyframe = 0;
- if ((res = ff_alloc_packet2(avctx, pkt, s->frame_size + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((res = ff_alloc_packet2(avctx, pkt, s->frame_size + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return res;
/* First frame needs to be a keyframe */
diff --git a/chromium/third_party/ffmpeg/libavcodec/flashsvenc.c b/chromium/third_party/ffmpeg/libavcodec/flashsvenc.c
index acbc13482aa..f7f98efde34 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flashsvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flashsvenc.c
@@ -98,8 +98,6 @@ static av_cold int flashsv_encode_end(AVCodecContext *avctx)
av_freep(&s->previous_frame);
av_freep(&s->tmpblock);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -111,7 +109,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
if (avctx->width > 4095 || avctx->height > 4095) {
av_log(avctx, AV_LOG_ERROR,
- "Input dimensions too large, input must be max 4096x4096 !\n");
+ "Input dimensions too large, input must be max 4095x4095 !\n");
return AVERROR_INVALIDDATA;
}
@@ -131,12 +129,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- flashsv_encode_end(avctx);
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -246,7 +238,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
I_frame = 1;
}
- if ((res = ff_alloc_packet2(avctx, pkt, s->image_width * s->image_height * 3)) < 0)
+ if ((res = ff_alloc_packet2(avctx, pkt, s->image_width * s->image_height * 3, 0)) < 0)
return res;
pkt->size = encode_bitstream(s, p, pkt->data, pkt->size, opt_w * 16, opt_h * 16,
@@ -262,16 +254,24 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
//mark the frame type so the muxer can mux it correctly
if (I_frame) {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->last_key_frame = avctx->frame_number;
ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
} else {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
avctx->coded_frame->key_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
- if (avctx->coded_frame->key_frame)
+ if (I_frame)
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/flicvideo.c b/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
index 08dd98b5976..3e0573af93f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
@@ -193,7 +193,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
pixels = s->frame->data[0];
pixel_limit = s->avctx->height * s->frame->linesize[0];
- if (buf_size < 16 || buf_size > INT_MAX - (3 * 256 + FF_INPUT_BUFFER_PADDING_SIZE))
+ if (buf_size < 16 || buf_size > INT_MAX - (3 * 256 + AV_INPUT_BUFFER_PADDING_SIZE))
return AVERROR_INVALIDDATA;
frame_size = bytestream2_get_le32(&g2);
if (frame_size > buf_size)
@@ -814,5 +814,5 @@ AVCodec ff_flic_decoder = {
.init = flic_decode_init,
.close = flic_decode_end,
.decode = flic_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/flvdec.c b/chromium/third_party/ffmpeg/libavcodec/flvdec.c
index fd1971b2ab2..f74ba3f018c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flvdec.c
@@ -122,7 +122,7 @@ AVCodec ff_flv_decoder = {
.init = ff_h263_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/fmtconvert.c b/chromium/third_party/ffmpeg/libavcodec/fmtconvert.c
index e6fc509a969..1de1d318d2b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fmtconvert.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fmtconvert.c
@@ -51,34 +51,3 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx)
if (ARCH_X86) ff_fmt_convert_init_x86(c, avctx);
if (HAVE_MIPSFPU) ff_fmt_convert_init_mips(c);
}
-
-/* ffdshow custom code */
-void float_interleave(float *dst, const float **src, long len, int channels)
-{
- int i,j,c;
- if(channels==2){
- for(i=0; i<len; i++){
- dst[2*i] = src[0][i] / 32768.0f;
- dst[2*i+1] = src[1][i] / 32768.0f;
- }
- }else{
- for(c=0; c<channels; c++)
- for(i=0, j=c; i<len; i++, j+=channels)
- dst[j] = src[c][i] / 32768.0f;
- }
-}
-
-void float_interleave_noscale(float *dst, const float **src, long len, int channels)
-{
- int i,j,c;
- if(channels==2){
- for(i=0; i<len; i++){
- dst[2*i] = src[0][i];
- dst[2*i+1] = src[1][i];
- }
- }else{
- for(c=0; c<channels; c++)
- for(i=0, j=c; i<len; i++, j+=channels)
- dst[j] = src[c][i];
- }
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/fmtconvert.h b/chromium/third_party/ffmpeg/libavcodec/fmtconvert.h
index 401ac3a1fc5..4b8b9580d2d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fmtconvert.h
+++ b/chromium/third_party/ffmpeg/libavcodec/fmtconvert.h
@@ -63,8 +63,4 @@ void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx);
void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx);
void ff_fmt_convert_init_mips(FmtConvertContext *c);
-/* ffdshow custom code */
-void float_interleave(float *dst, const float **src, long len, int channels);
-void float_interleave_noscale(float *dst, const float **src, long len, int channels);
-
#endif /* AVCODEC_FMTCONVERT_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c b/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
index 9a49fea5271..14f2ea241b8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
+++ b/chromium/third_party/ffmpeg/libavcodec/frame_thread_encoder.c
@@ -122,12 +122,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
if( !(avctx->thread_type & FF_THREAD_FRAME)
- || !(avctx->codec->capabilities & CODEC_CAP_INTRA_ONLY))
+ || !(avctx->codec->capabilities & AV_CODEC_CAP_INTRA_ONLY))
return 0;
if( !avctx->thread_count
&& avctx->codec_id == AV_CODEC_ID_MJPEG
- && !(avctx->flags & CODEC_FLAG_QSCALE)) {
+ && !(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
av_log(avctx, AV_LOG_DEBUG,
"Forcing thread count to 1 for MJPEG encoding, use -thread_type slice "
"or a constant quantizer if you want to use multiple cpu cores\n");
@@ -135,7 +135,7 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
}
if( avctx->thread_count > 1
&& avctx->codec_id == AV_CODEC_ID_MJPEG
- && !(avctx->flags & CODEC_FLAG_QSCALE))
+ && !(avctx->flags & AV_CODEC_FLAG_QSCALE))
av_log(avctx, AV_LOG_WARNING,
"MJPEG CBR encoding works badly with frame multi-threading, consider "
"using -threads 1, -thread_type slice or a constant quantizer.\n");
@@ -143,7 +143,7 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
if (avctx->codec_id == AV_CODEC_ID_HUFFYUV ||
avctx->codec_id == AV_CODEC_ID_FFVHUFF) {
int warn = 0;
- if (avctx->flags & CODEC_FLAG_PASS1)
+ if (avctx->flags & AV_CODEC_FLAG_PASS1)
warn = 1;
else if(avctx->context_model > 0) {
AVDictionaryEntry *t = av_dict_get(options, "non_deterministic",
diff --git a/chromium/third_party/ffmpeg/libavcodec/fraps.c b/chromium/third_party/ffmpeg/libavcodec/fraps.c
index c49866e7e21..2d4d5c48c49 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fraps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fraps.c
@@ -105,7 +105,9 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
s->bdsp.bswap_buf((uint32_t *) s->tmpbuf,
(const uint32_t *) src, size >> 2);
- init_get_bits(&gb, s->tmpbuf, size * 8);
+ if ((ret = init_get_bits8(&gb, s->tmpbuf, size)) < 0)
+ return ret;
+
for (j = 0; j < h; j++) {
for (i = 0; i < w*step; i += step) {
dst[i] = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
@@ -322,5 +324,5 @@ AVCodec ff_fraps_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/frwu.c b/chromium/third_party/ffmpeg/libavcodec/frwu.c
index c778dbde1a5..1aabefeb6f6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/frwu.c
+++ b/chromium/third_party/ffmpeg/libavcodec/frwu.c
@@ -103,7 +103,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
static const AVOption frwu_options[] = {
- {"change_field_order", "Change field order", offsetof(FRWUContext, change_field_order), FF_OPT_TYPE_INT,
+ {"change_field_order", "Change field order", offsetof(FRWUContext, change_field_order), AV_OPT_TYPE_INT,
{.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM},
{NULL}
};
@@ -123,6 +123,6 @@ AVCodec ff_frwu_decoder = {
.priv_data_size = sizeof(FRWUContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &frwu_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/g2meet.c b/chromium/third_party/ffmpeg/libavcodec/g2meet.c
index 64824834445..ba83c673373 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g2meet.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g2meet.c
@@ -1,6 +1,7 @@
/*
- * Go2Webinar decoder
+ * Go2Webinar / Go2Meeting decoder
* Copyright (c) 2012 Konstantin Shishkov
+ * Copyright (c) 2013 Maxim Poliakovski
*
* This file is part of FFmpeg.
*
@@ -21,7 +22,7 @@
/**
* @file
- * Go2Webinar decoder
+ * Go2Webinar / Go2Meeting decoder
*/
#include <inttypes.h>
@@ -32,12 +33,16 @@
#include "avcodec.h"
#include "blockdsp.h"
#include "bytestream.h"
+#include "elsdec.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"
#include "jpegtables.h"
#include "mjpeg.h"
+#define EPIC_PIX_STACK_SIZE 1024
+#define EPIC_PIX_STACK_MAX (EPIC_PIX_STACK_SIZE - 1)
+
enum ChunkType {
DISPLAY_INFO = 0xC8,
TILE_DATA,
@@ -74,6 +79,42 @@ static const uint8_t chroma_quant[64] = {
50, 50, 50, 50, 50, 50, 50, 50,
};
+typedef struct ePICPixListElem {
+ struct ePICPixListElem *next;
+ uint32_t pixel;
+ uint8_t rung;
+} ePICPixListElem;
+
+typedef struct ePICPixHashElem {
+ uint32_t pix_id;
+ struct ePICPixListElem *list;
+} ePICPixHashElem;
+
+#define EPIC_HASH_SIZE 256
+typedef struct ePICPixHash {
+ ePICPixHashElem *bucket[EPIC_HASH_SIZE];
+ int bucket_size[EPIC_HASH_SIZE];
+ int bucket_fill[EPIC_HASH_SIZE];
+} ePICPixHash;
+
+typedef struct ePICContext {
+ ElsDecCtx els_ctx;
+ int next_run_pos;
+ ElsUnsignedRung unsigned_rung;
+ uint8_t W_flag_rung;
+ uint8_t N_flag_rung;
+ uint8_t W_ctx_rung[256];
+ uint8_t N_ctx_rung[512];
+ uint8_t nw_pred_rung[256];
+ uint8_t ne_pred_rung[256];
+ uint8_t prev_row_rung[14];
+ uint8_t runlen_zeroes[14];
+ uint8_t runlen_one;
+ int stack_pos;
+ uint32_t stack[EPIC_PIX_STACK_SIZE];
+ ePICPixHash hash;
+} ePICContext;
+
typedef struct JPGContext {
BlockDSPContext bdsp;
IDCTDSPContext idsp;
@@ -87,7 +128,9 @@ typedef struct JPGContext {
} JPGContext;
typedef struct G2MContext {
+ ePICContext ec;
JPGContext jc;
+
int version;
int compression;
@@ -101,8 +144,9 @@ typedef struct G2MContext {
uint8_t *framebuf;
int framebuf_stride, old_width, old_height;
- uint8_t *synth_tile, *jpeg_tile;
- int tile_stride, old_tile_w, old_tile_h;
+ uint8_t *synth_tile, *jpeg_tile, *epic_buf, *epic_buf_base;
+ int tile_stride, epic_buf_stride, old_tile_w, old_tile_h;
+ int swapuv;
uint8_t *kempf_buf, *kempf_flags;
@@ -229,11 +273,11 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
return 0;
}
-static inline void yuv2rgb(uint8_t *out, int Y, int U, int V)
+static inline void yuv2rgb(uint8_t *out, int ridx, int Y, int U, int V)
{
- out[0] = av_clip_uint8(Y + ( 91881 * V + 32768 >> 16));
- out[1] = av_clip_uint8(Y + (-22554 * U - 46802 * V + 32768 >> 16));
- out[2] = av_clip_uint8(Y + (116130 * U + 32768 >> 16));
+ out[ridx] = av_clip_uint8(Y + (91881 * V + 32768 >> 16));
+ out[1] = av_clip_uint8(Y + (-22554 * U - 46802 * V + 32768 >> 16));
+ out[2 - ridx] = av_clip_uint8(Y + (116130 * U + 32768 >> 16));
}
static int jpg_decode_data(JPGContext *c, int width, int height,
@@ -247,12 +291,13 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
int bx, by;
int unesc_size;
int ret;
+ const int ridx = swapuv ? 2 : 0;
if ((ret = av_reallocp(&c->buf,
- src_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
+ src_size + AV_INPUT_BUFFER_PADDING_SIZE)) < 0)
return ret;
jpg_unescape(src, src_size, c->buf, &unesc_size);
- memset(c->buf + unesc_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(c->buf + unesc_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
if((ret = init_get_bits8(&gb, c->buf, unesc_size)) < 0)
return ret;
@@ -299,9 +344,9 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
int Y, U, V;
Y = c->block[(j >> 3) * 2 + (i >> 3)][(i & 7) + (j & 7) * 8];
- U = c->block[4 ^ swapuv][(i >> 1) + (j >> 1) * 8] - 128;
- V = c->block[5 ^ swapuv][(i >> 1) + (j >> 1) * 8] - 128;
- yuv2rgb(out + i * 3, Y, U, V);
+ U = c->block[4][(i >> 1) + (j >> 1) * 8] - 128;
+ V = c->block[5][(i >> 1) + (j >> 1) * 8] - 128;
+ yuv2rgb(out + i * 3, ridx, Y, U, V);
}
}
@@ -318,6 +363,654 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
return 0;
}
+#define LOAD_NEIGHBOURS(x) \
+ W = curr_row[(x) - 1]; \
+ N = above_row[(x)]; \
+ WW = curr_row[(x) - 2]; \
+ NW = above_row[(x) - 1]; \
+ NE = above_row[(x) + 1]; \
+ NN = above2_row[(x)]; \
+ NNW = above2_row[(x) - 1]; \
+ NWW = above_row[(x) - 2]; \
+ NNE = above2_row[(x) + 1]
+
+#define UPDATE_NEIGHBOURS(x) \
+ NNW = NN; \
+ NN = NNE; \
+ NWW = NW; \
+ NW = N; \
+ N = NE; \
+ NE = above_row[(x) + 1]; \
+ NNE = above2_row[(x) + 1]
+
+#define R_shift 16
+#define G_shift 8
+#define B_shift 0
+
+/* improved djb2 hash from http://www.cse.yorku.ca/~oz/hash.html */
+static int djb2_hash(uint32_t key)
+{
+ uint32_t h = 5381;
+
+ h = (h * 33) ^ ((key >> 24) & 0xFF); // xxx: probably not needed at all
+ h = (h * 33) ^ ((key >> 16) & 0xFF);
+ h = (h * 33) ^ ((key >> 8) & 0xFF);
+ h = (h * 33) ^ (key & 0xFF);
+
+ return h & (EPIC_HASH_SIZE - 1);
+}
+
+static void epic_hash_init(ePICPixHash *hash)
+{
+ memset(hash, 0, sizeof(*hash));
+}
+
+static ePICPixHashElem *epic_hash_find(const ePICPixHash *hash, uint32_t key)
+{
+ int i, idx = djb2_hash(key);
+ ePICPixHashElem *bucket = hash->bucket[idx];
+
+ for (i = 0; i < hash->bucket_fill[idx]; i++)
+ if (bucket[i].pix_id == key)
+ return &bucket[i];
+
+ return NULL;
+}
+
+static ePICPixHashElem *epic_hash_add(ePICPixHash *hash, uint32_t key)
+{
+ ePICPixHashElem *bucket, *ret;
+ int idx = djb2_hash(key);
+
+ if (hash->bucket_size[idx] > INT_MAX / sizeof(**hash->bucket))
+ return NULL;
+
+ if (!(hash->bucket_fill[idx] < hash->bucket_size[idx])) {
+ int new_size = hash->bucket_size[idx] + 16;
+ bucket = av_realloc(hash->bucket[idx], new_size * sizeof(*bucket));
+ if (!bucket)
+ return NULL;
+ hash->bucket[idx] = bucket;
+ hash->bucket_size[idx] = new_size;
+ }
+
+ ret = &hash->bucket[idx][hash->bucket_fill[idx]++];
+ memset(ret, 0, sizeof(*ret));
+ ret->pix_id = key;
+ return ret;
+}
+
+static int epic_add_pixel_to_cache(ePICPixHash *hash, uint32_t key, uint32_t pix)
+{
+ ePICPixListElem *new_elem;
+ ePICPixHashElem *hash_elem = epic_hash_find(hash, key);
+
+ if (!hash_elem) {
+ if (!(hash_elem = epic_hash_add(hash, key)))
+ return AVERROR(ENOMEM);
+ }
+
+ new_elem = av_mallocz(sizeof(*new_elem));
+ if (!new_elem)
+ return AVERROR(ENOMEM);
+
+ new_elem->pixel = pix;
+ new_elem->next = hash_elem->list;
+ hash_elem->list = new_elem;
+
+ return 0;
+}
+
+static inline int epic_cache_entries_for_pixel(const ePICPixHash *hash,
+ uint32_t pix)
+{
+ ePICPixHashElem *hash_elem = epic_hash_find(hash, pix);
+
+ if (hash_elem != NULL && hash_elem->list != NULL)
+ return 1;
+
+ return 0;
+}
+
+static void epic_free_pixel_cache(ePICPixHash *hash)
+{
+ int i, j;
+
+ for (i = 0; i < EPIC_HASH_SIZE; i++) {
+ for (j = 0; j < hash->bucket_fill[i]; j++) {
+ ePICPixListElem *list_elem = hash->bucket[i][j].list;
+ while (list_elem) {
+ ePICPixListElem *tmp = list_elem->next;
+ av_free(list_elem);
+ list_elem = tmp;
+ }
+ }
+ av_freep(&hash->bucket[i]);
+ hash->bucket_size[i] =
+ hash->bucket_fill[i] = 0;
+ }
+}
+
+static inline int is_pixel_on_stack(const ePICContext *dc, uint32_t pix)
+{
+ int i;
+
+ for (i = 0; i < dc->stack_pos; i++)
+ if (dc->stack[i] == pix)
+ break;
+
+ return i != dc->stack_pos;
+}
+
+#define TOSIGNED(val) (((val) >> 1) ^ -((val) & 1))
+
+static inline int epic_decode_component_pred(ePICContext *dc,
+ int N, int W, int NW)
+{
+ unsigned delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
+ return mid_pred(N, N + W - NW, W) - TOSIGNED(delta);
+}
+
+static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
+ const uint32_t *curr_row,
+ const uint32_t *above_row)
+{
+ uint32_t N, W, NW, pred;
+ unsigned delta;
+ int GN, GW, GNW, R, G, B;
+
+ if (x && y) {
+ W = curr_row[x - 1];
+ N = above_row[x];
+ NW = above_row[x - 1];
+
+ GN = (N >> G_shift) & 0xFF;
+ GW = (W >> G_shift) & 0xFF;
+ GNW = (NW >> G_shift) & 0xFF;
+
+ G = epic_decode_component_pred(dc, GN, GW, GNW);
+
+ R = G + epic_decode_component_pred(dc,
+ ((N >> R_shift) & 0xFF) - GN,
+ ((W >> R_shift) & 0xFF) - GW,
+ ((NW >> R_shift) & 0xFF) - GNW);
+
+ B = G + epic_decode_component_pred(dc,
+ ((N >> B_shift) & 0xFF) - GN,
+ ((W >> B_shift) & 0xFF) - GW,
+ ((NW >> B_shift) & 0xFF) - GNW);
+ } else {
+ if (x)
+ pred = curr_row[x - 1];
+ else
+ pred = above_row[x];
+
+ delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
+ R = ((pred >> R_shift) & 0xFF) - TOSIGNED(delta);
+
+ delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
+ G = ((pred >> G_shift) & 0xFF) - TOSIGNED(delta);
+
+ delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
+ B = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
+ }
+
+ if (R<0 || G<0 || B<0) {
+ av_log(NULL, AV_LOG_ERROR, "RGB %d %d %d is out of range\n", R, G, B);
+ return 0;
+ }
+
+ return (R << R_shift) | (G << G_shift) | (B << B_shift);
+}
+
+static int epic_predict_pixel(ePICContext *dc, uint8_t *rung,
+ uint32_t *pPix, uint32_t pix)
+{
+ if (!ff_els_decode_bit(&dc->els_ctx, rung)) {
+ *pPix = pix;
+ return 1;
+ }
+ dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = pix;
+ return 0;
+}
+
+static int epic_handle_edges(ePICContext *dc, int x, int y,
+ const uint32_t *curr_row,
+ const uint32_t *above_row, uint32_t *pPix)
+{
+ uint32_t pix;
+
+ if (!x && !y) { /* special case: top-left pixel */
+ /* the top-left pixel is coded independently with 3 unsigned numbers */
+ *pPix = (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << R_shift) |
+ (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << G_shift) |
+ (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << B_shift);
+ return 1;
+ }
+
+ if (x) { /* predict from W first */
+ pix = curr_row[x - 1];
+ if (epic_predict_pixel(dc, &dc->W_flag_rung, pPix, pix))
+ return 1;
+ }
+
+ if (y) { /* then try to predict from N */
+ pix = above_row[x];
+ if (!dc->stack_pos || dc->stack[0] != pix) {
+ if (epic_predict_pixel(dc, &dc->N_flag_rung, pPix, pix))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int epic_decode_run_length(ePICContext *dc, int x, int y, int tile_width,
+ const uint32_t *curr_row,
+ const uint32_t *above_row,
+ const uint32_t *above2_row,
+ uint32_t *pPix, int *pRun)
+{
+ int idx, got_pixel = 0, WWneW, old_WWneW = 0;
+ uint32_t W, WW, N, NN, NW, NE, NWW, NNW, NNE;
+
+ *pRun = 0;
+
+ LOAD_NEIGHBOURS(x);
+
+ if (dc->next_run_pos == x) {
+ /* can't reuse W for the new pixel in this case */
+ WWneW = 1;
+ } else {
+ idx = (WW != W) << 7 |
+ (NW != W) << 6 |
+ (N != NE) << 5 |
+ (NW != N) << 4 |
+ (NWW != NW) << 3 |
+ (NNE != NE) << 2 |
+ (NN != N) << 1 |
+ (NNW != NW);
+ WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
+ }
+
+ if (WWneW)
+ dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = W;
+ else {
+ *pPix = W;
+ got_pixel = 1;
+ }
+
+ do {
+ int NWneW = 1;
+ if (got_pixel) // pixel value already known (derived from either W or N)
+ NWneW = *pPix != N;
+ else { // pixel value is unknown and will be decoded later
+ NWneW = *pRun ? NWneW : NW != W;
+
+ /* TODO: RFC this mess! */
+ switch (((NW != N) << 2) | (NWneW << 1) | WWneW) {
+ case 0:
+ break; // do nothing here
+ case 3:
+ case 5:
+ case 6:
+ case 7:
+ if (!is_pixel_on_stack(dc, N)) {
+ idx = WWneW << 8 |
+ (*pRun ? old_WWneW : WW != W) << 7 |
+ NWneW << 6 |
+ (N != NE) << 5 |
+ (NW != N) << 4 |
+ (NWW != NW) << 3 |
+ (NNE != NE) << 2 |
+ (NN != N) << 1 |
+ (NNW != NW);
+ if (!ff_els_decode_bit(&dc->els_ctx, &dc->N_ctx_rung[idx])) {
+ NWneW = 0;
+ *pPix = N;
+ got_pixel = 1;
+ break;
+ }
+ }
+ /* fall through */
+ default:
+ NWneW = 1;
+ old_WWneW = WWneW;
+ if (!is_pixel_on_stack(dc, N))
+ dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = N;
+ }
+ }
+
+ (*pRun)++;
+ if (x + *pRun >= tile_width - 1)
+ break;
+
+ UPDATE_NEIGHBOURS(x + *pRun);
+
+ if (!NWneW && NW == N && N == NE) {
+ int pos, run, rle;
+ int start_pos = x + *pRun;
+
+ /* scan for a run of pix in the line above */
+ uint32_t pix = above_row[start_pos + 1];
+ for (pos = start_pos + 2; pos < tile_width; pos++)
+ if (!(above_row[pos] == pix))
+ break;
+ run = pos - start_pos - 1;
+ idx = av_ceil_log2(run);
+ if (ff_els_decode_bit(&dc->els_ctx, &dc->prev_row_rung[idx]))
+ *pRun += run;
+ else {
+ int flag;
+ /* run-length is coded as plain binary number of idx - 1 bits */
+ for (pos = idx - 1, rle = 0, flag = 0; pos >= 0; pos--) {
+ if ((1 << pos) + rle < run &&
+ ff_els_decode_bit(&dc->els_ctx,
+ flag ? &dc->runlen_one
+ : &dc->runlen_zeroes[pos])) {
+ flag = 1;
+ rle |= 1 << pos;
+ }
+ }
+ *pRun += rle;
+ break; // return immediately
+ }
+ if (x + *pRun >= tile_width - 1)
+ break;
+
+ LOAD_NEIGHBOURS(x + *pRun);
+ WWneW = 0;
+ NWneW = 0;
+ }
+
+ idx = WWneW << 7 |
+ NWneW << 6 |
+ (N != NE) << 5 |
+ (NW != N) << 4 |
+ (NWW != NW) << 3 |
+ (NNE != NE) << 2 |
+ (NN != N) << 1 |
+ (NNW != NW);
+ WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
+ } while (!WWneW);
+
+ dc->next_run_pos = x + *pRun;
+ return got_pixel;
+}
+
+static int epic_predict_pixel2(ePICContext *dc, uint8_t *rung,
+ uint32_t *pPix, uint32_t pix)
+{
+ if (ff_els_decode_bit(&dc->els_ctx, rung)) {
+ *pPix = pix;
+ return 1;
+ }
+ dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = pix;
+ return 0;
+}
+
+static int epic_predict_from_NW_NE(ePICContext *dc, int x, int y, int run,
+ int tile_width, const uint32_t *curr_row,
+ const uint32_t *above_row, uint32_t *pPix)
+{
+ int pos;
+
+ /* try to reuse the NW pixel first */
+ if (x && y) {
+ uint32_t NW = above_row[x - 1];
+ if (NW != curr_row[x - 1] && NW != above_row[x] && !is_pixel_on_stack(dc, NW)) {
+ if (epic_predict_pixel2(dc, &dc->nw_pred_rung[NW & 0xFF], pPix, NW))
+ return 1;
+ }
+ }
+
+ /* try to reuse the NE[x + run, y] pixel */
+ pos = x + run - 1;
+ if (pos < tile_width - 1 && y) {
+ uint32_t NE = above_row[pos + 1];
+ if (NE != above_row[pos] && !is_pixel_on_stack(dc, NE)) {
+ if (epic_predict_pixel2(dc, &dc->ne_pred_rung[NE & 0xFF], pPix, NE))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int epic_decode_from_cache(ePICContext *dc, uint32_t W, uint32_t *pPix)
+{
+ ePICPixListElem *list, *prev = NULL;
+ ePICPixHashElem *hash_elem = epic_hash_find(&dc->hash, W);
+
+ if (!hash_elem || !hash_elem->list)
+ return 0;
+
+ list = hash_elem->list;
+ while (list) {
+ if (!is_pixel_on_stack(dc, list->pixel)) {
+ if (ff_els_decode_bit(&dc->els_ctx, &list->rung)) {
+ *pPix = list->pixel;
+ if (list != hash_elem->list) {
+ prev->next = list->next;
+ list->next = hash_elem->list;
+ hash_elem->list = list;
+ }
+ return 1;
+ }
+ dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = list->pixel;
+ }
+ prev = list;
+ list = list->next;
+ }
+
+ return 0;
+}
+
+static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
+ int tile_width, int stride)
+{
+ int x, y;
+ uint32_t pix;
+ uint32_t *curr_row = NULL, *above_row = NULL, *above2_row;
+
+ for (y = 0; y < tile_height; y++, out += stride) {
+ above2_row = above_row;
+ above_row = curr_row;
+ curr_row = (uint32_t *) out;
+
+ for (x = 0, dc->next_run_pos = 0; x < tile_width;) {
+ if (dc->els_ctx.err)
+ return AVERROR_INVALIDDATA; // bail out in the case of ELS overflow
+
+ pix = curr_row[x - 1]; // get W pixel
+
+ if (y >= 1 && x >= 2 &&
+ pix != curr_row[x - 2] && pix != above_row[x - 1] &&
+ pix != above_row[x - 2] && pix != above_row[x] &&
+ !epic_cache_entries_for_pixel(&dc->hash, pix)) {
+ curr_row[x] = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
+ x++;
+ } else {
+ int got_pixel, run;
+ dc->stack_pos = 0; // empty stack
+
+ if (y < 2 || x < 2 || x == tile_width - 1) {
+ run = 1;
+ got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
+ } else
+ got_pixel = epic_decode_run_length(dc, x, y, tile_width,
+ curr_row, above_row,
+ above2_row, &pix, &run);
+
+ if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
+ tile_width, curr_row,
+ above_row, &pix)) {
+ uint32_t ref_pix = curr_row[x - 1];
+ if (!x || !epic_decode_from_cache(dc, ref_pix, &pix)) {
+ pix = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
+ if (x) {
+ int ret = epic_add_pixel_to_cache(&dc->hash,
+ ref_pix,
+ pix);
+ if (ret)
+ return ret;
+ }
+ }
+ }
+ for (; run > 0; x++, run--)
+ curr_row[x] = pix;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int epic_jb_decode_tile(G2MContext *c, int tile_x, int tile_y,
+ const uint8_t *src, size_t src_size,
+ AVCodecContext *avctx)
+{
+ uint8_t prefix, mask = 0x80;
+ int extrabytes, tile_width, tile_height, awidth, aheight;
+ size_t els_dsize;
+ uint8_t *dst;
+
+ if (!src_size)
+ return 0;
+
+ /* get data size of the ELS partition as unsigned variable-length integer */
+ prefix = *src++;
+ src_size--;
+ for (extrabytes = 0; (prefix & mask) && (extrabytes < 7); extrabytes++)
+ mask >>= 1;
+ if (extrabytes > 3 || src_size < extrabytes) {
+ av_log(avctx, AV_LOG_ERROR, "ePIC: invalid data size VLI\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ els_dsize = prefix & ((0x80 >> extrabytes) - 1); // mask out the length prefix
+ while (extrabytes-- > 0) {
+ els_dsize = (els_dsize << 8) | *src++;
+ src_size--;
+ }
+
+ if (src_size < els_dsize) {
+ av_log(avctx, AV_LOG_ERROR, "ePIC: data too short, needed %zu, got %zu\n",
+ els_dsize, src_size);
+ return AVERROR_INVALIDDATA;
+ }
+
+ tile_width = FFMIN(c->width - tile_x * c->tile_width, c->tile_width);
+ tile_height = FFMIN(c->height - tile_y * c->tile_height, c->tile_height);
+ awidth = FFALIGN(tile_width, 16);
+ aheight = FFALIGN(tile_height, 16);
+
+ if (els_dsize) {
+ int ret, i, j, k;
+ uint8_t tr_r, tr_g, tr_b, *buf;
+ uint32_t *in;
+ /* ELS decoder initializations */
+ memset(&c->ec, 0, sizeof(c->ec));
+ ff_els_decoder_init(&c->ec.els_ctx, src, els_dsize);
+ epic_hash_init(&c->ec.hash);
+
+ /* decode transparent pixel value */
+ tr_r = ff_els_decode_unsigned(&c->ec.els_ctx, &c->ec.unsigned_rung);
+ tr_g = ff_els_decode_unsigned(&c->ec.els_ctx, &c->ec.unsigned_rung);
+ tr_b = ff_els_decode_unsigned(&c->ec.els_ctx, &c->ec.unsigned_rung);
+ if (c->ec.els_ctx.err != 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "ePIC: couldn't decode transparency pixel!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ ret = epic_decode_tile(&c->ec, c->epic_buf, tile_height, tile_width,
+ c->epic_buf_stride);
+
+ epic_free_pixel_cache(&c->ec.hash);
+ ff_els_decoder_uninit(&c->ec.unsigned_rung);
+
+ if (ret) {
+ av_log(avctx, AV_LOG_ERROR,
+ "ePIC: tile decoding failed, frame=%d, tile_x=%d, tile_y=%d\n",
+ avctx->frame_number, tile_x, tile_y);
+ return AVERROR_INVALIDDATA;
+ }
+
+ buf = c->epic_buf;
+ dst = c->framebuf + tile_x * c->tile_width * 3 +
+ tile_y * c->tile_height * c->framebuf_stride;
+
+ for (j = 0; j < tile_height; j++) {
+ uint8_t *out = dst;
+ in = (uint32_t *) buf;
+ for (i = 0; i < tile_width; i++) {
+ out[0] = (in[i] >> R_shift) & 0xFF;
+ out[1] = (in[i] >> G_shift) & 0xFF;
+ out[2] = (in[i] >> B_shift) & 0xFF;
+ out += 3;
+ }
+ buf += c->epic_buf_stride;
+ dst += c->framebuf_stride;
+ }
+
+ if (src_size > els_dsize) {
+ uint8_t *jpg;
+ uint32_t tr;
+ int bstride = FFALIGN(tile_width, 16) >> 3;
+ int nblocks = 0;
+ int estride = c->epic_buf_stride >> 2;
+
+ src += els_dsize;
+ src_size -= els_dsize;
+
+ in = (uint32_t *) c->epic_buf;
+ tr = (tr_r << R_shift) | (tr_g << G_shift) | (tr_b << B_shift);
+
+ memset(c->kempf_flags, 0,
+ (aheight >> 3) * bstride * sizeof(*c->kempf_flags));
+ for (j = 0; j < tile_height; j += 8) {
+ for (i = 0; i < tile_width; i += 8) {
+ c->kempf_flags[(i >> 3) + (j >> 3) * bstride] = 0;
+ for (k = 0; k < 8 * 8; k++) {
+ if (in[i + (k & 7) + (k >> 3) * estride] == tr) {
+ c->kempf_flags[(i >> 3) + (j >> 3) * bstride] = 1;
+ nblocks++;
+ break;
+ }
+ }
+ }
+ in += 8 * estride;
+ }
+
+ memset(c->jpeg_tile, 0, c->tile_stride * aheight);
+ jpg_decode_data(&c->jc, awidth, aheight, src, src_size,
+ c->jpeg_tile, c->tile_stride,
+ c->kempf_flags, bstride, nblocks, c->swapuv);
+
+ in = (uint32_t *) c->epic_buf;
+ dst = c->framebuf + tile_x * c->tile_width * 3 +
+ tile_y * c->tile_height * c->framebuf_stride;
+ jpg = c->jpeg_tile;
+ for (j = 0; j < tile_height; j++) {
+ for (i = 0; i < tile_width; i++)
+ if (in[i] == tr)
+ memcpy(dst + i * 3, jpg + i * 3, 3);
+ in += c->epic_buf_stride >> 2;
+ dst += c->framebuf_stride;
+ jpg += c->tile_stride;
+ }
+ }
+ } else {
+ dst = c->framebuf + tile_x * c->tile_width * 3 +
+ tile_y * c->tile_height * c->framebuf_stride;
+ return jpg_decode_data(&c->jc, tile_width, tile_height, src, src_size,
+ dst, c->framebuf_stride, NULL, 0, 0, c->swapuv);
+ }
+
+ return 0;
+}
+
static int kempf_restore_buf(const uint8_t *src, int len,
uint8_t *dst, int stride,
const uint8_t *jpeg_tile, int tile_stride,
@@ -327,6 +1020,7 @@ static int kempf_restore_buf(const uint8_t *src, int len,
GetBitContext gb;
int i, j, nb, col;
int ret;
+ int align_width = FFALIGN(width, 16);
if ((ret = init_get_bits8(&gb, src, len)) < 0)
return ret;
@@ -346,6 +1040,7 @@ static int kempf_restore_buf(const uint8_t *src, int len,
else
memcpy(dst + i * 3, jpeg_tile + i * 3, 3);
}
+ skip_bits_long(&gb, nb * (align_width - width));
}
return 0;
@@ -475,22 +1170,32 @@ static int g2m_init_buffers(G2MContext *c)
return AVERROR(ENOMEM);
}
if (!c->synth_tile || !c->jpeg_tile ||
+ (c->compression == 2 && !c->epic_buf_base) ||
c->old_tile_w < c->tile_width ||
c->old_tile_h < c->tile_height) {
- c->tile_stride = FFALIGN(c->tile_width, 16) * 3;
- aligned_height = FFALIGN(c->tile_height, 16);
- av_free(c->synth_tile);
- av_free(c->jpeg_tile);
- av_free(c->kempf_buf);
- av_free(c->kempf_flags);
+ c->tile_stride = FFALIGN(c->tile_width, 16) * 3;
+ c->epic_buf_stride = FFALIGN(c->tile_width * 4, 16);
+ aligned_height = FFALIGN(c->tile_height, 16);
+ av_freep(&c->synth_tile);
+ av_freep(&c->jpeg_tile);
+ av_freep(&c->kempf_buf);
+ av_freep(&c->kempf_flags);
+ av_freep(&c->epic_buf_base);
+ c->epic_buf = NULL;
c->synth_tile = av_mallocz(c->tile_stride * aligned_height);
c->jpeg_tile = av_mallocz(c->tile_stride * aligned_height);
- c->kempf_buf = av_mallocz((c->tile_width + 1) * aligned_height
- + FF_INPUT_BUFFER_PADDING_SIZE);
- c->kempf_flags = av_mallocz( c->tile_width * aligned_height);
+ c->kempf_buf = av_mallocz((c->tile_width + 1) * aligned_height +
+ AV_INPUT_BUFFER_PADDING_SIZE);
+ c->kempf_flags = av_mallocz(c->tile_width * aligned_height);
if (!c->synth_tile || !c->jpeg_tile ||
!c->kempf_buf || !c->kempf_flags)
return AVERROR(ENOMEM);
+ if (c->compression == 2) {
+ c->epic_buf_base = av_mallocz(c->epic_buf_stride * aligned_height + 4);
+ if (!c->epic_buf_base)
+ return AVERROR(ENOMEM);
+ c->epic_buf = c->epic_buf_base + 4;
+ }
}
return 0;
@@ -696,10 +1401,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- if ((magic & 0xF) < 4) {
- av_log(avctx, AV_LOG_ERROR, "G2M2 and G2M3 are not yet supported\n");
- return AVERROR(ENOSYS);
- }
+ c->swapuv = magic == MKBETAG('G', '2', 'M', '2');
while (bytestream2_get_bytes_left(&bc) > 5) {
chunk_size = bytestream2_get_le32(&bc) - 1;
@@ -746,7 +1448,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
c->tile_height = bytestream2_get_be32(&bc);
if (c->tile_width <= 0 || c->tile_height <= 0 ||
((c->tile_width | c->tile_height) & 0xF) ||
- c->tile_width * 4LL * c->tile_height >= INT_MAX
+ c->tile_width * (uint64_t)c->tile_height >= INT_MAX / 4
) {
av_log(avctx, AV_LOG_ERROR,
"Invalid tile dimensions %dx%d\n",
@@ -808,9 +1510,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
ret = 0;
switch (c->compression) {
case COMPR_EPIC_J_B:
- av_log(avctx, AV_LOG_ERROR,
- "ePIC j-b compression is not implemented yet\n");
- return AVERROR(ENOSYS);
+ ret = epic_jb_decode_tile(c, c->tile_x, c->tile_y,
+ buf + bytestream2_tell(&bc),
+ chunk_size - 2, avctx);
+ break;
case COMPR_KEMPF_J_B:
ret = kempf_decode_tile(c, c->tile_x, c->tile_y,
buf + bytestream2_tell(&bc),
@@ -877,6 +1580,8 @@ header_fail:
c->height = 0;
c->tiles_x =
c->tiles_y = 0;
+ c->tile_width =
+ c->tile_height = 0;
return ret;
}
@@ -906,6 +1611,8 @@ static av_cold int g2m_decode_end(AVCodecContext *avctx)
jpg_free_context(&c->jc);
+ av_freep(&c->epic_buf_base);
+ c->epic_buf = NULL;
av_freep(&c->kempf_buf);
av_freep(&c->kempf_flags);
av_freep(&c->synth_tile);
@@ -925,5 +1632,6 @@ AVCodec ff_g2m_decoder = {
.init = g2m_decode_init,
.close = g2m_decode_end,
.decode = g2m_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/g722dec.c b/chromium/third_party/ffmpeg/libavcodec/g722dec.c
index 22e90a3079b..0bfa82a3943 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g722dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g722dec.c
@@ -145,6 +145,6 @@ AVCodec ff_adpcm_g722_decoder = {
.priv_data_size = sizeof(G722Context),
.init = g722_decode_init,
.decode = g722_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &g722_decoder_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/g722enc.c b/chromium/third_party/ffmpeg/libavcodec/g722enc.c
index 38432f5006c..01a3db26fd6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g722enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g722enc.c
@@ -358,7 +358,7 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int nb_samples, out_size, ret;
out_size = (frame->nb_samples + 1) / 2;
- if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0)
return ret;
nb_samples = frame->nb_samples - (frame->nb_samples & 1);
@@ -389,7 +389,7 @@ AVCodec ff_adpcm_g722_encoder = {
.init = g722_encode_init,
.close = g722_encode_close,
.encode2 = g722_encode_frame,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/g723_1.c b/chromium/third_party/ffmpeg/libavcodec/g723_1.c
index 66afd6af6a5..4a73c3c38a2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g723_1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g723_1.c
@@ -1337,7 +1337,7 @@ AVCodec ff_g723_1_decoder = {
.priv_data_size = sizeof(G723_1_Context),
.init = g723_1_decode_init,
.decode = g723_1_decode_frame,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.priv_class = &g723_1dec_class,
};
@@ -2462,7 +2462,7 @@ static int g723_1_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
av_freep(&in_orig); in = NULL;
- if ((ret = ff_alloc_packet2(avctx, avpkt, 24)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 24, 0)) < 0)
return ret;
*got_packet_ptr = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/g726.c b/chromium/third_party/ffmpeg/libavcodec/g726.c
index 5bbf8971074..934d120b6f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g726.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g726.c
@@ -23,7 +23,6 @@
*/
#include <limits.h>
-#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "avcodec.h"
@@ -316,7 +315,11 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
"Resample or reduce the compliance level.\n");
return AVERROR(EINVAL);
}
- av_assert0(avctx->sample_rate > 0);
+ if (avctx->sample_rate <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid sample rate %d\n",
+ avctx->sample_rate);
+ return AVERROR(EINVAL);
+ }
if(avctx->channels != 1){
av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
@@ -348,7 +351,7 @@ static int g726_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int i, ret, out_size;
out_size = (frame->nb_samples * c->code_size + 7) / 8;
- if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
@@ -389,7 +392,7 @@ AVCodec ff_adpcm_g726_encoder = {
.priv_data_size = sizeof(G726Context),
.init = g726_encode_init,
.encode2 = g726_encode_frame,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.priv_class = &g726_class,
@@ -474,7 +477,7 @@ AVCodec ff_adpcm_g726_decoder = {
.init = g726_decode_init,
.decode = g726_decode_frame,
.flush = g726_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -487,7 +490,7 @@ AVCodec ff_adpcm_g726le_decoder = {
.init = g726_decode_init,
.decode = g726_decode_frame,
.flush = g726_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"),
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/g729.h b/chromium/third_party/ffmpeg/libavcodec/g729.h
index 61683130a9f..7c5f693a7a6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g729.h
+++ b/chromium/third_party/ffmpeg/libavcodec/g729.h
@@ -26,4 +26,8 @@
*/
#define SUBFRAME_SIZE 40
+/* bytes per block */
+#define G729_8K_BLOCK_SIZE 10
+#define G729D_6K4_BLOCK_SIZE 8
+
#endif // AVCODEC_G729_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/g729_parser.c b/chromium/third_party/ffmpeg/libavcodec/g729_parser.c
new file mode 100644
index 00000000000..d13c990807a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/g729_parser.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2015 Ganesh Ajjanagadde
+ *
+ * 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
+ * G.729 audio parser
+ *
+ * Splits packets into individual blocks.
+ */
+
+#include "libavutil/avassert.h"
+#include "parser.h"
+#include "g729.h"
+
+typedef struct G729ParseContext {
+ ParseContext pc;
+ int block_size;
+ int duration;
+ int remaining;
+} G729ParseContext;
+
+static int g729_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+ G729ParseContext *s = s1->priv_data;
+ ParseContext *pc = &s->pc;
+ int next;
+
+ if (!s->block_size) {
+ av_assert1(avctx->codec_id == AV_CODEC_ID_G729);
+ /* FIXME: replace this heuristic block_size with more precise estimate */
+ s->block_size = (avctx->bit_rate < 8000) ? G729D_6K4_BLOCK_SIZE : G729_8K_BLOCK_SIZE;
+ s->duration = avctx->frame_size;
+ }
+
+ if (!s->remaining)
+ s->remaining = s->block_size;
+ if (s->remaining <= buf_size) {
+ next = s->remaining;
+ s->remaining = 0;
+ } else {
+ next = END_NOT_FOUND;
+ s->remaining -= buf_size;
+ }
+
+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
+
+ s1->duration = s->duration;
+
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+ return next;
+}
+
+AVCodecParser ff_g729_parser = {
+ .codec_ids = { AV_CODEC_ID_G729 },
+ .priv_data_size = sizeof(G729ParseContext),
+ .parser_parse = g729_parse,
+ .parser_close = ff_parse_close,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/g729dec.c b/chromium/third_party/ffmpeg/libavcodec/g729dec.c
index ed717baf75b..99053add438 100644
--- a/chromium/third_party/ffmpeg/libavcodec/g729dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/g729dec.c
@@ -722,5 +722,5 @@ AVCodec ff_g729_decoder = {
.priv_data_size = sizeof(G729Context),
.init = decoder_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/get_bits.h b/chromium/third_party/ffmpeg/libavcodec/get_bits.h
index affaecb1720..0d3db1f3cf8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/get_bits.h
+++ b/chromium/third_party/ffmpeg/libavcodec/get_bits.h
@@ -401,7 +401,7 @@ static inline int check_marker(GetBitContext *s, const char *msg)
/**
* Initialize GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
+ * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
* larger than the actual read bits because some optimized bitstream
* readers read 32 or 64 bit at once and could read over the end
* @param bit_size the size of the buffer in bits
@@ -432,7 +432,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
/**
* Initialize GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
+ * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
* larger than the actual read bits because some optimized bitstream
* readers read 32 or 64 bit at once and could read over the end
* @param byte_size the size of the buffer in bytes
diff --git a/chromium/third_party/ffmpeg/libavcodec/gif.c b/chromium/third_party/ffmpeg/libavcodec/gif.c
index cf5d438a728..acdc0e1e0d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gif.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gif.c
@@ -221,13 +221,12 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");
return AVERROR(EINVAL);
}
-
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->transparent_index = -1;
@@ -270,7 +269,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const uint32_t *palette = NULL;
int ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*7/5 + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*7/5 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
outbuf_ptr = pkt->data;
end = pkt->data + pkt->size;
@@ -320,8 +319,6 @@ static int gif_encode_close(AVCodecContext *avctx)
{
GIFContext *s = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
-
av_freep(&s->lzw);
av_freep(&s->buf);
av_frame_free(&s->last_frame);
diff --git a/chromium/third_party/ffmpeg/libavcodec/gifdec.c b/chromium/third_party/ffmpeg/libavcodec/gifdec.c
index c179f45c30c..9f2e6eb3b78 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gifdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gifdec.c
@@ -553,6 +553,6 @@ AVCodec ff_gif_decoder = {
.init = gif_decode_init,
.close = gif_decode_close,
.decode = gif_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &decoder_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/gsm_parser.c b/chromium/third_party/ffmpeg/libavcodec/gsm_parser.c
index 9a3b94ef1d8..1054a30ca91 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gsm_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gsm_parser.c
@@ -25,6 +25,7 @@
* Splits packets into individual blocks.
*/
+#include "libavutil/avassert.h"
#include "parser.h"
#include "gsm.h"
@@ -55,10 +56,7 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
s->duration = GSM_FRAME_SIZE * 2;
break;
default:
- *poutbuf = buf;
- *poutbuf_size = buf_size;
- av_log(avctx, AV_LOG_ERROR, "Invalid codec_id\n");
- return buf_size;
+ av_assert0(0);
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/gsmdec.c b/chromium/third_party/ffmpeg/libavcodec/gsmdec.c
index c4cde9295a6..cd56995183b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gsmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gsmdec.c
@@ -120,7 +120,7 @@ AVCodec ff_gsm_decoder = {
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_GSM_MS_DECODER
@@ -133,6 +133,6 @@ AVCodec ff_gsm_ms_decoder = {
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/gsmdec_template.c b/chromium/third_party/ffmpeg/libavcodec/gsmdec_template.c
index 0c60813a4ab..4cb777c854c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gsmdec_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gsmdec_template.c
@@ -64,7 +64,7 @@ static inline int decode_log_area(int coded, int factor, int offset)
{
coded <<= 10;
coded -= offset;
- return gsm_mult(coded, factor) << 1;
+ return gsm_mult(coded, factor) * 2;
}
static av_noinline int get_rrp(int filtered)
@@ -121,7 +121,7 @@ static int postprocess(int16_t *data, int msr)
int i;
for (i = 0; i < 160; i++) {
msr = av_clip_int16(data[i] + gsm_mult(msr, 28180));
- data[i] = av_clip_int16(msr << 1) & ~7;
+ data[i] = av_clip_int16(msr * 2) & ~7;
}
return msr;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h261dec.c b/chromium/third_party/ffmpeg/libavcodec/h261dec.c
index 4f5994a6594..df60ac5d2ec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h261dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h261dec.c
@@ -685,6 +685,6 @@ AVCodec ff_h261_decoder = {
.init = h261_decode_init,
.close = h261_decode_end,
.decode = h261_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/h261enc.c b/chromium/third_party/ffmpeg/libavcodec/h261enc.c
index f8eb1b07021..24ef577aa6e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h261enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h261enc.c
@@ -68,14 +68,14 @@ void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number)
put_bits(&s->pb, 1, 0); /* split screen off */
put_bits(&s->pb, 1, 0); /* camera off */
- put_bits(&s->pb, 1, 0); /* freeze picture release off */
+ put_bits(&s->pb, 1, s->pict_type == AV_PICTURE_TYPE_I); /* freeze picture release on/off */
format = ff_h261_get_picture_format(s->width, s->height);
put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */
- put_bits(&s->pb, 1, 0); /* still image mode */
- put_bits(&s->pb, 1, 0); /* reserved */
+ put_bits(&s->pb, 1, 1); /* still image mode */
+ put_bits(&s->pb, 1, 1); /* reserved */
put_bits(&s->pb, 1, 0); /* no PEI */
if (format == 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h263.h b/chromium/third_party/ffmpeg/libavcodec/h263.h
index 904073e2f9e..3c3f1698ff1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h263.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h263.h
@@ -116,7 +116,7 @@ static inline int h263_get_motion_length(int val, int f_code){
}
static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code){
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT) {
skip_put_bits(&s->pb,
h263_get_motion_length(x, f_code)
+h263_get_motion_length(y, f_code));
diff --git a/chromium/third_party/ffmpeg/libavcodec/h263dec.c b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
index e8915567d01..1443f6dd889 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
@@ -48,7 +48,7 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
if (avctx->codec->id == AV_CODEC_ID_MSS2)
return AV_PIX_FMT_YUV420P;
- if (CONFIG_GRAY && (avctx->flags & CODEC_FLAG_GRAY)) {
+ if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) {
if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
avctx->color_range = AVCOL_RANGE_MPEG;
return AV_PIX_FMT_GRAY8;
@@ -163,7 +163,7 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size)
/* We would have to scan through the whole buf to handle the weird
* reordering ... */
return buf_size;
- } else if (s->avctx->flags & CODEC_FLAG_TRUNCATED) {
+ } else if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
pos -= s->parse_context.last_index;
// padding is not really read so this might be -1
if (pos < 0)
@@ -428,7 +428,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return 0;
}
- if (s->avctx->flags & CODEC_FLAG_TRUNCATED) {
+ if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
int next;
if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
@@ -601,10 +601,12 @@ retry:
if (!s->divx_packed && !avctx->hwaccel)
ff_thread_finish_setup(avctx);
- if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
+#if FF_API_CAP_VDPAU
+ if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)) {
ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, s->gb.buffer_end - s->gb.buffer);
goto frame_end;
}
+#endif
if (avctx->hwaccel) {
ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
@@ -716,11 +718,14 @@ frame_end:
const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
#if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI_VLD,
+ AV_PIX_FMT_VAAPI,
#endif
#if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
+#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL || CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL
+ AV_PIX_FMT_VIDEOTOOLBOX,
+#endif
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE
};
@@ -734,8 +739,8 @@ AVCodec ff_h263_decoder = {
.init = ff_h263_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY,
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
@@ -750,8 +755,8 @@ AVCodec ff_h263p_decoder = {
.init = ff_h263_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY,
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264.c b/chromium/third_party/ffmpeg/libavcodec/h264.c
index 2f7ef2296b8..1cd147b678c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264.c
@@ -291,7 +291,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, H264SliceContext *sl,
if(i>=length-1){ //no escaped 0
*dst_length= length;
*consumed= length+1; //+1 for the header
- if(h->avctx->flags2 & CODEC_FLAG2_FAST){
+ if(h->avctx->flags2 & AV_CODEC_FLAG2_FAST){
return src;
}else{
memcpy(dst, src, length);
@@ -322,7 +322,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, H264SliceContext *sl,
dst[di++] = src[si++];
nsc:
- memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(dst + di, 0, AV_INPUT_BUFFER_PADDING_SIZE);
*dst_length = di;
*consumed = si + 1; // +1 for the header
@@ -867,6 +867,27 @@ static void decode_postinit(H264Context *h, int setup_finished)
}
}
+ if (h->sei_reguserdata_afd_present) {
+ AVFrameSideData *sd = av_frame_new_side_data(cur->f, AV_FRAME_DATA_AFD,
+ sizeof(uint8_t));
+
+ if (sd) {
+ *sd->data = h->active_format_description;
+ h->sei_reguserdata_afd_present = 0;
+ }
+ }
+
+ if (h->a53_caption) {
+ AVFrameSideData *sd = av_frame_new_side_data(cur->f,
+ AV_FRAME_DATA_A53_CC,
+ h->a53_caption_size);
+ if (sd)
+ memcpy(sd->data, h->a53_caption, h->a53_caption_size);
+ av_freep(&h->a53_caption);
+ h->a53_caption_size = 0;
+ h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
+ }
+
cur->mmco_reset = h->mmco_reset;
h->mmco_reset = 0;
@@ -962,8 +983,12 @@ static void decode_postinit(H264Context *h, int setup_finished)
h->next_output_pic->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_SEI);
}
- if (setup_finished && !h->avctx->hwaccel)
+ if (setup_finished && !h->avctx->hwaccel) {
ff_thread_finish_setup(h->avctx);
+
+ if (h->avctx->active_thread_type & FF_THREAD_FRAME)
+ h->setup_finished = 1;
+ }
}
int ff_pred_weight_table(H264Context *h, H264SliceContext *sl)
@@ -1365,7 +1390,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
if(!h->slice_context_count)
h->slice_context_count= 1;
h->max_contexts = h->slice_context_count;
- if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS)) {
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
h->current_slice = 0;
if (!h->first_field)
h->cur_pic_ptr = NULL;
@@ -1519,8 +1544,8 @@ again:
// "recovered".
if (h->nal_unit_type == NAL_IDR_SLICE)
h->frame_recovered |= FRAME_RECOVERED_IDR;
- h->frame_recovered |= 3*!!(avctx->flags2 & CODEC_FLAG2_SHOW_ALL);
- h->frame_recovered |= 3*!!(avctx->flags & CODEC_FLAG_OUTPUT_CORRUPT);
+ h->frame_recovered |= 3*!!(avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL);
+ h->frame_recovered |= 3*!!(avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT);
#if 1
h->cur_pic_ptr->recovered |= h->frame_recovered;
#else
@@ -1528,15 +1553,17 @@ again:
#endif
if (h->current_slice == 1) {
- if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS))
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS))
decode_postinit(h, nal_index >= nals_needed);
if (h->avctx->hwaccel &&
(ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
goto end;
+#if FF_API_CAP_VDPAU
if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_start(h);
+#endif
}
if (sl->redundant_pic_count == 0) {
@@ -1546,14 +1573,16 @@ again:
consumed);
if (ret < 0)
goto end;
+#if FF_API_CAP_VDPAU
} else if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {
+ h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) {
ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
start_code,
sizeof(start_code));
ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
&buf[buf_index - consumed],
consumed);
+#endif
} else
context_count++;
}
@@ -1734,6 +1763,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
int ret;
h->flags = avctx->flags;
+ h->setup_finished = 0;
if (h->backup_width != -1) {
avctx->width = h->backup_width;
@@ -1803,7 +1833,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
goto out;
}
- if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS) && !h->cur_pic_ptr) {
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) && !h->cur_pic_ptr) {
if (avctx->skip_frame >= AVDISCARD_NONREF ||
buf_size >= 4 && !memcmp("Q264", buf, 4))
return buf_size;
@@ -1811,12 +1841,13 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS) ||
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS) ||
(h->mb_y >= h->mb_height && h->mb_height)) {
- if (avctx->flags2 & CODEC_FLAG2_CHUNKS)
+ if (avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)
decode_postinit(h, 1);
- ff_h264_field_end(h, &h->slice_ctx[0], 0);
+ if ((ret = ff_h264_field_end(h, &h->slice_ctx[0], 0)) < 0)
+ return ret;
/* Wait for second field. */
*got_frame = 0;
@@ -1914,8 +1945,8 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(H264Context, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption h264_options[] = {
- {"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
- {"nal_length_size", "nal_length_size", offsetof(H264Context, nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
+ {"is_avc", "is avc", offsetof(H264Context, is_avc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0},
+ {"nal_length_size", "nal_length_size", offsetof(H264Context, nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
{ "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
{ NULL },
};
@@ -1953,9 +1984,9 @@ AVCodec ff_h264_decoder = {
.init = ff_h264_decode_init,
.close = h264_decode_end,
.decode = h264_decode_frame,
- .capabilities = /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 |
- CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
+ AV_CODEC_CAP_FRAME_THREADS,
.flush = flush_dpb,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
@@ -1963,7 +1994,7 @@ AVCodec ff_h264_decoder = {
.priv_class = &h264_class,
};
-#if CONFIG_H264_VDPAU_DECODER
+#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
static const AVClass h264_vdpau_class = {
.class_name = "H264 VDPAU Decoder",
.item_name = av_default_item_name,
@@ -1980,7 +2011,7 @@ AVCodec ff_h264_vdpau_decoder = {
.init = ff_h264_decode_init,
.close = h264_decode_end,
.decode = h264_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HWACCEL_VDPAU,
.flush = flush_dpb,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_H264,
AV_PIX_FMT_NONE},
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264.h b/chromium/third_party/ffmpeg/libavcodec/h264.h
index 548510d7930..73562882cdb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264.h
@@ -132,11 +132,12 @@ enum {
typedef enum {
SEI_TYPE_BUFFERING_PERIOD = 0, ///< buffering period (H.264, D.1.1)
SEI_TYPE_PIC_TIMING = 1, ///< picture timing
- SEI_TYPE_USER_DATA_ITU_T_T35 = 4, ///< user data registered by ITU-T Recommendation T.35
+ SEI_TYPE_USER_DATA_REGISTERED = 4, ///< registered user data as specified by Rec. ITU-T T.35
SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data
SEI_TYPE_RECOVERY_POINT = 6, ///< recovery point (frame # to decoder sync)
SEI_TYPE_FRAME_PACKING = 45, ///< frame packing arrangement
SEI_TYPE_DISPLAY_ORIENTATION = 47, ///< display orientation
+ SEI_TYPE_GREEN_METADATA = 56 ///< GreenMPEG information
} SEI_Type;
/**
@@ -268,6 +269,22 @@ typedef struct FPA {
} FPA;
/**
+ * Green MetaData Information Type
+ */
+typedef struct GreenMetaData {
+ uint8_t green_metadata_type;
+ uint8_t period_type;
+ uint16_t num_seconds;
+ uint16_t num_pictures;
+ uint8_t percent_non_zero_macroblocks;
+ uint8_t percent_intra_coded_macroblocks;
+ uint8_t percent_six_tap_filtering;
+ uint8_t percent_alpha_point_deblocking_instance;
+ uint8_t xsd_metric_type;
+ uint16_t xsd_metric_value;
+} GreenMetaData;
+
+/**
* Memory management control operation opcode.
*/
typedef enum MMCOOpcode {
@@ -409,7 +426,8 @@ typedef struct H264SliceContext {
int mb_xy;
int resync_mb_x;
int resync_mb_y;
- int mb_index_end;
+ // index of the first MB of the next slice
+ int next_slice_idx;
int mb_skip_run;
int is_complex;
@@ -724,6 +742,14 @@ typedef struct H264Context {
int sei_hflip, sei_vflip;
/**
+ * User data registered by Rec. ITU-T T.35 SEI
+ */
+ int sei_reguserdata_afd_present;
+ uint8_t active_format_description;
+ int a53_caption_size;
+ uint8_t *a53_caption;
+
+ /**
* Bit set of clock types for fields/frames in picture timing SEI message.
* For each found ct_type, appropriate bit is set (e.g., bit 1 for
* interlaced).
@@ -781,6 +807,11 @@ typedef struct H264Context {
int missing_fields;
+/* for frame threading, this is set to 1
+ * after finish_setup() has been called, so we cannot modify
+ * some context properties (which are supposed to stay constant between
+ * slices) anymore */
+ int setup_finished;
// Timestamp stuff
int sei_buffering_period_present; ///< Buffering period SEI flag
@@ -804,6 +835,10 @@ typedef struct H264Context {
/* Motion Estimation */
qpel_mc_func (*qpel_put)[16];
qpel_mc_func (*qpel_avg)[16];
+
+ /*Green Metadata */
+ GreenMetaData sei_green_metadata;
+
} H264Context;
extern const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM + 1]; ///< One chroma qp table for each possible bit depth (8-14).
@@ -1156,15 +1191,17 @@ static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf,
{
int i, nalsize = 0;
- if (*buf_index >= buf_size - h->nal_length_size)
- return -1;
+ if (*buf_index >= buf_size - h->nal_length_size) {
+ // the end of the buffer is reached, refill it.
+ return AVERROR(EAGAIN);
+ }
for (i = 0; i < h->nal_length_size; i++)
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
av_log(h->avctx, AV_LOG_ERROR,
"AVC: nal size %d\n", nalsize);
- return -1;
+ return AVERROR_INVALIDDATA;
}
return nalsize;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c b/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
index cb911341854..00149272b04 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_loopfilter.c
@@ -242,7 +242,7 @@ static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h,
unsigned int uvlinesize,
int pixel_shift)
{
- int chroma = CHROMA(h) && !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
+ int chroma = CHROMA(h) && !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
int chroma444 = CHROMA444(h);
int chroma422 = CHROMA422(h);
@@ -723,7 +723,7 @@ void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl,
const int mb_type = h->cur_pic.mb_type[mb_xy];
const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
int first_vertical_edge_done = 0;
- int chroma = CHROMA(h) && !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
+ int chroma = CHROMA(h) && !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset;
int b = 52 + sl->slice_beta_offset - qp_bd_offset;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mb.c b/chromium/third_party/ffmpeg/libavcodec/h264_mb.c
index 634d814493b..8302de040ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mb.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mb.c
@@ -250,7 +250,7 @@ static av_always_inline void mc_dir_part(const H264Context *h, H264SliceContext
if (!square)
qpix_op[luma_xy](dest_y + delta, src_y + delta, sl->mb_linesize);
- if (CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
return;
if (chroma_idc == 3 /* yuv444 */) {
@@ -425,7 +425,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
int weight1 = 64 - weight0;
luma_weight_avg(dest_y, tmp_y, sl->mb_linesize,
height, 5, weight0, weight1, 0);
- if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize,
chroma_height, 5, weight0, weight1, 0);
chroma_weight_avg(dest_cr, tmp_cr, sl->mb_uvlinesize,
@@ -438,7 +438,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
sl->luma_weight[refn1][1][0],
sl->luma_weight[refn0][0][1] +
sl->luma_weight[refn1][1][1]);
- if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize, chroma_height,
sl->chroma_log2_weight_denom,
sl->chroma_weight[refn0][0][0][0],
@@ -465,7 +465,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
sl->luma_log2_weight_denom,
sl->luma_weight[refn][list][0],
sl->luma_weight[refn][list][1]);
- if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (sl->use_weight_chroma) {
chroma_weight_op(dest_cb, sl->mb_uvlinesize, chroma_height,
sl->chroma_log2_weight_denom,
@@ -566,7 +566,7 @@ static av_always_inline void xchg_mb_border(const H264Context *h, H264SliceConte
XCHG(sl->top_borders[top_idx][sl->mb_x + 1],
src_y + (17 << pixel_shift), 1);
}
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (chroma444) {
if (deblock_topleft) {
XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c b/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
index bc68a738b80..54420b9022f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mb_template.c
@@ -112,7 +112,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
for (j = 0; j < 16; j++)
tmp_y[j] = get_bits(&gb, bit_depth);
}
- if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (!h->sps.chroma_format_idc) {
for (i = 0; i < block_h; i++) {
uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize);
@@ -137,7 +137,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
} else {
for (i = 0; i < 16; i++)
memcpy(dest_y + i * linesize, sl->intra_pcm_ptr + i * 16, 16);
- if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (!h->sps.chroma_format_idc) {
for (i = 0; i < 8; i++) {
memset(dest_cb + i * uvlinesize, 1 << (bit_depth - 1), 8);
@@ -159,7 +159,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
xchg_mb_border(h, sl, dest_y, dest_cb, dest_cr, linesize,
uvlinesize, 1, 0, SIMPLE, PIXEL_SHIFT);
- if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
h->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize);
h->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize);
}
@@ -190,7 +190,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
hl_decode_mb_idct_luma(h, sl, mb_type, is_h264, SIMPLE, transform_bypass,
PIXEL_SHIFT, block_offset, linesize, dest_y, 0);
- if ((SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) &&
+ if ((SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) &&
(sl->cbp & 0x30)) {
uint8_t *dest[2] = { dest_cb, dest_cr };
if (transform_bypass) {
@@ -280,7 +280,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(const H264Context *h, H264SliceCo
int i, j, p;
const int *block_offset = &h->block_offset[0];
const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->sps.transform_bypass);
- const int plane_count = (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) ? 3 : 1;
+ const int plane_count = (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) ? 3 : 1;
for (p = 0; p < plane_count; p++) {
dest[p] = h->cur_pic.f->data[p] +
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c b/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
index ae96ee953dd..a5da84a7af1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mp4toannexb_bsf.c
@@ -33,6 +33,18 @@ typedef struct H264BSFContext {
uint8_t idr_sps_seen;
uint8_t idr_pps_seen;
int extradata_parsed;
+
+ /* When private_spspps is zero then spspps_buf points to global extradata
+ and bsf does replace a global extradata to own-allocated version (default
+ behaviour).
+ When private_spspps is non-zero the bsf uses a private version of spspps buf.
+ This mode necessary when bsf uses in decoder, else bsf has issues after
+ decoder re-initialization. Use the "private_spspps_buf" argument to
+ activate this mode.
+ */
+ int private_spspps;
+ uint8_t *spspps_buf;
+ uint32_t spspps_size;
} H264BSFContext;
static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
@@ -45,7 +57,7 @@ static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
*poutbuf_size += sps_pps_size + in_size + nal_header_size;
if ((err = av_reallocp(poutbuf,
- *poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
+ *poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
*poutbuf_size = 0;
return err;
}
@@ -129,9 +141,13 @@ pps:
"Warning: PPS NALU missing or invalid. "
"The resulting stream may not play.\n");
- av_free(avctx->extradata);
- avctx->extradata = out;
- avctx->extradata_size = total_size;
+ if (!ctx->private_spspps) {
+ av_free(avctx->extradata);
+ avctx->extradata = out;
+ avctx->extradata_size = total_size;
+ }
+ ctx->spspps_buf = out;
+ ctx->spspps_size = total_size;
return length_size;
}
@@ -159,7 +175,10 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
/* retrieve sps and pps NAL units from extradata */
if (!ctx->extradata_parsed) {
- ret = h264_extradata_to_annexb(ctx, avctx, FF_INPUT_BUFFER_PADDING_SIZE);
+ if (args && strstr(args, "private_spspps_buf"))
+ ctx->private_spspps = 1;
+
+ ret = h264_extradata_to_annexb(ctx, avctx, AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
ctx->length_size = ret;
@@ -182,7 +201,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
buf += ctx->length_size;
unit_type = *buf & 0x1f;
- if (buf + nal_size > buf_end || nal_size < 0)
+ if (nal_size > buf_end - buf || nal_size < 0)
goto fail;
if (unit_type == 7)
@@ -195,8 +214,8 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
av_log(avctx, AV_LOG_WARNING, "SPS not present in the stream, nor in AVCC, stream may be unreadable\n");
else {
if ((ret = alloc_and_copy(poutbuf, poutbuf_size,
- avctx->extradata + ctx->sps_offset,
- ctx->pps_offset != -1 ? ctx->pps_offset : avctx->extradata_size - ctx->sps_offset,
+ ctx->spspps_buf + ctx->sps_offset,
+ ctx->pps_offset != -1 ? ctx->pps_offset : ctx->spspps_size - ctx->sps_offset,
buf, nal_size)) < 0)
goto fail;
ctx->idr_sps_seen = 1;
@@ -214,7 +233,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
/* prepend only to the first type 5 NAL unit of an IDR picture, if no sps/pps are already present */
if (ctx->new_idr && unit_type == 5 && !ctx->idr_sps_seen && !ctx->idr_pps_seen) {
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
- avctx->extradata, avctx->extradata_size,
+ ctx->spspps_buf, ctx->spspps_size,
buf, nal_size)) < 0)
goto fail;
ctx->new_idr = 0;
@@ -226,7 +245,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
NULL, 0, buf, nal_size)) < 0)
goto fail;
} else if ((ret = alloc_and_copy(poutbuf, poutbuf_size,
- avctx->extradata + ctx->pps_offset, avctx->extradata_size - ctx->pps_offset,
+ ctx->spspps_buf + ctx->pps_offset, ctx->spspps_size - ctx->pps_offset,
buf, nal_size)) < 0)
goto fail;
} else {
@@ -253,8 +272,16 @@ fail:
return ret;
}
+static void h264_mp4toannexb_filter_close(AVBitStreamFilterContext *bsfc)
+{
+ H264BSFContext *ctx = bsfc->priv_data;
+ if (ctx->private_spspps)
+ av_free(ctx->spspps_buf);
+}
+
AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
.name = "h264_mp4toannexb",
.priv_data_size = sizeof(H264BSFContext),
.filter = h264_mp4toannexb_filter,
+ .close = h264_mp4toannexb_filter_close,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h b/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
index 57fa9b90efb..763746cc262 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_mvpred.h
@@ -771,7 +771,7 @@ static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int m
#define MAP_F2F(idx, mb_type) \
if (!IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \
- sl->ref_cache[list][idx] <<= 1; \
+ sl->ref_cache[list][idx] *= 2; \
sl->mv_cache[list][idx][1] /= 2; \
sl->mvd_cache[list][idx][1] >>= 1; \
}
@@ -783,7 +783,7 @@ static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int m
#define MAP_F2F(idx, mb_type) \
if (IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \
sl->ref_cache[list][idx] >>= 1; \
- sl->mv_cache[list][idx][1] <<= 1; \
+ sl->mv_cache[list][idx][1] *= 2; \
sl->mvd_cache[list][idx][1] <<= 1; \
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_picture.c b/chromium/third_party/ffmpeg/libavcodec/h264_picture.c
index bf1471de514..731d780e676 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_picture.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_picture.c
@@ -157,9 +157,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
int err = 0;
h->mb_y = 0;
+#if FF_API_CAP_VDPAU
if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_set_reference_frames(h);
+#endif
if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
if (!h->droppable) {
@@ -172,14 +174,17 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
}
if (avctx->hwaccel) {
- if (avctx->hwaccel->end_frame(avctx) < 0)
+ err = avctx->hwaccel->end_frame(avctx);
+ if (err < 0)
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode picture\n");
}
+#if FF_API_CAP_VDPAU
if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_complete(h);
+#endif
#if CONFIG_ERROR_RESILIENCE
av_assert0(sl == h->slice_ctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
index ae1b60a45bc..52d235cbaa9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
@@ -464,7 +464,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h, int ignore_truncation)
int width = 16 * sps->mb_width;
int height = 16 * sps->mb_height * (2 - sps->frame_mbs_only_flag);
- if (h->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
+ if (h->avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) {
av_log(h->avctx, AV_LOG_DEBUG, "discarding sps cropping, original "
"values are l:%d r:%d t:%d b:%d\n",
crop_left, crop_right, crop_top, crop_bottom);
@@ -481,7 +481,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h, int ignore_truncation)
int step_y = (2 - sps->frame_mbs_only_flag) << vsub;
if (crop_left & (0x1F >> (sps->bit_depth_luma > 8)) &&
- !(h->avctx->flags & CODEC_FLAG_UNALIGNED)) {
+ !(h->avctx->flags & AV_CODEC_FLAG_UNALIGNED)) {
crop_left &= ~(0x1F >> (sps->bit_depth_luma > 8));
av_log(h->avctx, AV_LOG_WARNING,
"Reducing left cropping to %d "
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_refs.c b/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
index 379fb26a1a9..619f2edf844 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_refs.c
@@ -125,6 +125,7 @@ static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limi
int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
{
int i, len;
+ int j;
if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
H264Picture *sorted[32];
@@ -188,6 +189,21 @@ int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
}
}
#endif
+
+ for (j = 0; j<1+(sl->slice_type_nos == AV_PICTURE_TYPE_B); j++) {
+ for (i = 0; i < sl->ref_count[j]; i++) {
+ if (h->default_ref_list[j][i].parent) {
+ AVFrame *f = h->default_ref_list[j][i].parent->f;
+ if (h->cur_pic_ptr->f->width != f->width ||
+ h->cur_pic_ptr->f->height != f->height ||
+ h->cur_pic_ptr->f->format != f->format) {
+ av_log(h->avctx, AV_LOG_ERROR, "Discarding mismatching reference\n");
+ memset(&h->default_ref_list[j][i], 0, sizeof(h->default_ref_list[j][i]));
+ }
+ }
+ }
+ }
+
return 0;
}
@@ -601,6 +617,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
{
int i, av_uninit(j);
int pps_count;
+ int pps_ref_count[2] = {0};
int current_ref_assigned = 0, err = 0;
H264Picture *av_uninit(pic);
@@ -667,15 +684,18 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
remove_short_at_index(h, 0);
}
- if (h->long_ref[mmco[i].long_arg] != h->cur_pic_ptr) {
- if (h->cur_pic_ptr->long_ref) {
- for(j=0; j<16; j++) {
- if(h->long_ref[j] == h->cur_pic_ptr) {
- remove_long(h, j, 0);
+ /* make sure the current picture is not already assigned as a long ref */
+ if (h->cur_pic_ptr->long_ref) {
+ for (j = 0; j < FF_ARRAY_ELEMS(h->long_ref); j++) {
+ if (h->long_ref[j] == h->cur_pic_ptr) {
+ if (j != mmco[i].long_arg)
av_log(h->avctx, AV_LOG_ERROR, "mmco: cannot assign current picture to 2 long term references\n");
- }
+ remove_long(h, j, 0);
}
}
+ }
+
+ if (h->long_ref[mmco[i].long_arg] != h->cur_pic_ptr) {
av_assert0(!h->cur_pic_ptr->long_ref);
remove_long(h, mmco[i].long_arg, 0);
@@ -782,13 +802,17 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
print_long_term(h);
pps_count = 0;
- for (i = 0; i < FF_ARRAY_ELEMS(h->pps_buffers); i++)
+ for (i = 0; i < FF_ARRAY_ELEMS(h->pps_buffers); i++) {
pps_count += !!h->pps_buffers[i];
+ pps_ref_count[0] = FFMAX(pps_ref_count[0], h->pps.ref_count[0]);
+ pps_ref_count[1] = FFMAX(pps_ref_count[1], h->pps.ref_count[1]);
+ }
if ( err >= 0
&& h->long_ref_count==0
- && (h->short_ref_count<=2 || h->pps.ref_count[0] <= 1 && h->pps.ref_count[1] <= 1 && pps_count == 1)
- && h->pps.ref_count[0]<=2 + (h->picture_structure != PICT_FRAME) + (2*!h->has_recovery_point)
+ && ( h->short_ref_count<=2
+ || pps_ref_count[0] <= 1 + (h->picture_structure != PICT_FRAME) && pps_ref_count[1] <= 1)
+ && pps_ref_count[0]<=2 + (h->picture_structure != PICT_FRAME) + (2*!h->has_recovery_point)
&& h->cur_pic_ptr->f->pict_type == AV_PICTURE_TYPE_I){
h->cur_pic_ptr->recovered |= 1;
if(!h->avctx->has_b_frames)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_sei.c b/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
index 8e1697a31e4..818caa8dfd6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_sei.c
@@ -42,6 +42,10 @@ void ff_h264_reset_sei(H264Context *h)
h->sei_buffering_period_present = 0;
h->sei_frame_packing_present = 0;
h->sei_display_orientation_present = 0;
+ h->sei_reguserdata_afd_present = 0;
+
+ h->a53_caption_size = 0;
+ av_freep(&h->a53_caption);
}
static int decode_picture_timing(H264Context *h)
@@ -108,35 +112,108 @@ static int decode_picture_timing(H264Context *h)
return 0;
}
-static int decode_user_data_itu_t_t35(H264Context *h, int size)
+static int decode_registered_user_data_afd(H264Context *h, int size)
+{
+ int flag;
+
+ if (size-- < 1)
+ return AVERROR_INVALIDDATA;
+ skip_bits(&h->gb, 1); // 0
+ flag = get_bits(&h->gb, 1); // active_format_flag
+ skip_bits(&h->gb, 6); // reserved
+
+ if (flag) {
+ if (size-- < 1)
+ return AVERROR_INVALIDDATA;
+ skip_bits(&h->gb, 4); // reserved
+ h->active_format_description = get_bits(&h->gb, 4);
+ h->sei_reguserdata_afd_present = 1;
+#if FF_API_AFD
+FF_DISABLE_DEPRECATION_WARNINGS
+ h->avctx->dtg_active_format = h->active_format_description;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif /* FF_API_AFD */
+ }
+
+ return 0;
+}
+
+static int decode_registered_user_data_closed_caption(H264Context *h, int size)
+{
+ int flag;
+ int user_data_type_code;
+ int cc_count;
+
+ if (size < 3)
+ return AVERROR(EINVAL);
+
+ user_data_type_code = get_bits(&h->gb, 8);
+ if (user_data_type_code == 0x3) {
+ skip_bits(&h->gb, 1); // reserved
+
+ flag = get_bits(&h->gb, 1); // process_cc_data_flag
+ if (flag) {
+ skip_bits(&h->gb, 1); // zero bit
+ cc_count = get_bits(&h->gb, 5);
+ skip_bits(&h->gb, 8); // reserved
+ size -= 2;
+
+ if (cc_count && size >= cc_count * 3) {
+ const uint64_t new_size = (h->a53_caption_size + cc_count
+ * UINT64_C(3));
+ int i, ret;
+
+ if (new_size > INT_MAX)
+ return AVERROR(EINVAL);
+
+ /* Allow merging of the cc data from two fields. */
+ ret = av_reallocp(&h->a53_caption, new_size);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < cc_count; i++) {
+ h->a53_caption[h->a53_caption_size++] = get_bits(&h->gb, 8);
+ h->a53_caption[h->a53_caption_size++] = get_bits(&h->gb, 8);
+ h->a53_caption[h->a53_caption_size++] = get_bits(&h->gb, 8);
+ }
+
+ skip_bits(&h->gb, 8); // marker_bits
+ }
+ }
+ } else {
+ int i;
+ for (i = 0; i < size - 1; i++)
+ skip_bits(&h->gb, 8);
+ }
+
+ return 0;
+}
+
+static int decode_registered_user_data(H264Context *h, int size)
{
+ uint32_t country_code;
uint32_t user_identifier;
- int dtg_active_format;
if (size < 7)
- return -1;
+ return AVERROR_INVALIDDATA;
size -= 7;
- skip_bits(&h->gb, 8); // country_code
- skip_bits(&h->gb, 16); // provider_code
+ country_code = get_bits(&h->gb, 8); // itu_t_t35_country_code
+ if (country_code == 0xFF) {
+ skip_bits(&h->gb, 8); // itu_t_t35_country_code_extension_byte
+ size--;
+ }
+
+ /* itu_t_t35_payload_byte follows */
+ skip_bits(&h->gb, 8); // terminal provider code
+ skip_bits(&h->gb, 8); // terminal provider oriented code
user_identifier = get_bits_long(&h->gb, 32);
switch (user_identifier) {
- case 0x44544731: // "DTG1" - AFD_data
- if (size < 1)
- return -1;
- skip_bits(&h->gb, 1);
- if (get_bits(&h->gb, 1)) {
- skip_bits(&h->gb, 6);
- if (size < 2)
- return -1;
- skip_bits(&h->gb, 4);
- dtg_active_format = get_bits(&h->gb, 4);
- h->avctx->dtg_active_format = dtg_active_format;
- } else {
- skip_bits(&h->gb, 6);
- }
- break;
+ case MKBETAG('D', 'T', 'G', '1'): // afd_data
+ return decode_registered_user_data_afd(h, size);
+ case MKBETAG('G', 'A', '9', '4'): // closed captions
+ return decode_registered_user_data_closed_caption(h, size);
default:
skip_bits(&h->gb, size * 8);
break;
@@ -279,6 +356,66 @@ static int decode_display_orientation(H264Context *h)
return 0;
}
+static int decode_GreenMetadata(H264Context *h)
+{
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "Green Metadata Info SEI message\n");
+
+ h->sei_green_metadata.green_metadata_type=get_bits(&h->gb, 8);
+
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "green_metadata_type = %d\n",
+ h->sei_green_metadata.green_metadata_type);
+
+ if (h->sei_green_metadata.green_metadata_type==0){
+ h->sei_green_metadata.period_type=get_bits(&h->gb, 8);
+
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "green_metadata_period_type = %d\n",
+ h->sei_green_metadata.period_type);
+
+ if (h->sei_green_metadata.green_metadata_type==2){
+ h->sei_green_metadata.num_seconds = get_bits(&h->gb, 16);
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "green_metadata_num_seconds = %d\n",
+ h->sei_green_metadata.num_seconds);
+ }
+ else if (h->sei_green_metadata.period_type==3){
+ h->sei_green_metadata.num_pictures = get_bits(&h->gb, 16);
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "green_metadata_num_pictures = %d\n",
+ h->sei_green_metadata.num_pictures);
+ }
+
+ h->sei_green_metadata.percent_non_zero_macroblocks=get_bits(&h->gb, 8);
+ h->sei_green_metadata.percent_intra_coded_macroblocks=get_bits(&h->gb, 8);
+ h->sei_green_metadata.percent_six_tap_filtering=get_bits(&h->gb, 8);
+ h->sei_green_metadata.percent_alpha_point_deblocking_instance=get_bits(&h->gb, 8);
+
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "SEI GREEN Complexity Metrics = %f %f %f %f\n",
+ (float)h->sei_green_metadata.percent_non_zero_macroblocks/255,
+ (float)h->sei_green_metadata.percent_intra_coded_macroblocks/255,
+ (float)h->sei_green_metadata.percent_six_tap_filtering/255,
+ (float)h->sei_green_metadata.percent_alpha_point_deblocking_instance/255);
+
+ }else if( h->sei_green_metadata.green_metadata_type==1){
+ h->sei_green_metadata.xsd_metric_type=get_bits(&h->gb, 8);
+ h->sei_green_metadata.xsd_metric_value=get_bits(&h->gb, 16);
+
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "xsd_metric_type = %d\n",
+ h->sei_green_metadata.xsd_metric_type);
+ if ( h->sei_green_metadata.xsd_metric_type==0){
+ if (h->avctx->debug & FF_DEBUG_GREEN_MD)
+ av_log(h->avctx, AV_LOG_DEBUG, "xsd_metric_value = %f\n",
+ (float)h->sei_green_metadata.xsd_metric_value/100);
+ }
+ }
+
+ return 0;
+}
+
int ff_h264_decode_sei(H264Context *h)
{
while (get_bits_left(&h->gb) > 16 && show_bits(&h->gb, 16)) {
@@ -312,41 +449,34 @@ int ff_h264_decode_sei(H264Context *h)
switch (type) {
case SEI_TYPE_PIC_TIMING: // Picture timing SEI
ret = decode_picture_timing(h);
- if (ret < 0)
- return ret;
break;
- case SEI_TYPE_USER_DATA_ITU_T_T35:
- if (decode_user_data_itu_t_t35(h, size) < 0)
- return -1;
+ case SEI_TYPE_USER_DATA_REGISTERED:
+ ret = decode_registered_user_data(h, size);
break;
case SEI_TYPE_USER_DATA_UNREGISTERED:
ret = decode_unregistered_user_data(h, size);
- if (ret < 0)
- return ret;
break;
case SEI_TYPE_RECOVERY_POINT:
ret = decode_recovery_point(h);
- if (ret < 0)
- return ret;
break;
case SEI_TYPE_BUFFERING_PERIOD:
ret = decode_buffering_period(h);
- if (ret < 0)
- return ret;
break;
case SEI_TYPE_FRAME_PACKING:
ret = decode_frame_packing_arrangement(h);
- if (ret < 0)
- return ret;
break;
case SEI_TYPE_DISPLAY_ORIENTATION:
ret = decode_display_orientation(h);
- if (ret < 0)
- return ret;
+ break;
+ case SEI_TYPE_GREEN_METADATA:
+ ret = decode_GreenMetadata(h);
break;
default:
av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
}
+ if (ret < 0)
+ return ret;
+
skip_bits_long(&h->gb, next - get_bits_count(&h->gb));
// FIXME check bits here
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_slice.c b/chromium/third_party/ffmpeg/libavcodec/h264_slice.c
index aee188ac5f5..a346ccbc004 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_slice.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_slice.c
@@ -246,7 +246,7 @@ static int alloc_picture(H264Context *h, H264Picture *pic)
pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
}
}
- if (CONFIG_GRAY && !h->avctx->hwaccel && h->flags & CODEC_FLAG_GRAY && pic->f->data[2]) {
+ if (CONFIG_GRAY && !h->avctx->hwaccel && h->flags & AV_CODEC_FLAG_GRAY && pic->f->data[2]) {
int h_chroma_shift, v_chroma_shift;
av_pix_fmt_get_chroma_sub_sample(pic->f->format,
&h_chroma_shift, &v_chroma_shift);
@@ -383,7 +383,7 @@ void ff_h264_init_dequant_tables(H264Context *h)
}
}
-#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
+#define IN_RANGE(a, b, size) (((void*)(a) >= (void*)(b)) && ((void*)(a) < (void*)((b) + (size))))
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
(((pic) && (pic) >= (old_ctx)->DPB && \
@@ -397,10 +397,9 @@ static void copy_picture_range(H264Picture **to, H264Picture **from, int count,
int i;
for (i = 0; i < count; i++) {
- av_assert1((IN_RANGE(from[i], old_base, 1) ||
- IN_RANGE(from[i], old_base->DPB,
- H264_MAX_PICTURE_COUNT) ||
- !from[i]));
+ av_assert1(!from[i] ||
+ IN_RANGE(from[i], old_base, 1) ||
+ IN_RANGE(from[i], old_base->DPB, H264_MAX_PICTURE_COUNT));
to[i] = REBASE_PICTURE(from[i], new_base, old_base);
}
}
@@ -613,8 +612,11 @@ static int h264_frame_start(H264Context *h)
if ((ret = alloc_picture(h, pic)) < 0)
return ret;
- if(!h->frame_recovered && !h->avctx->hwaccel &&
- !(h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU))
+ if(!h->frame_recovered && !h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ )
avpriv_color_frame(pic->f, c);
h->cur_pic_ptr = pic;
@@ -686,7 +688,7 @@ static av_always_inline void backup_mb_border(const H264Context *h, H264SliceCon
AV_COPY128(top_border, src_y + 15 * linesize);
if (pixel_shift)
AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (chroma444) {
if (pixel_shift) {
AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
@@ -729,7 +731,7 @@ static av_always_inline void backup_mb_border(const H264Context *h, H264SliceCon
if (pixel_shift)
AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
- if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
+ if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
if (chroma444) {
if (pixel_shift) {
AV_COPY128(top_border + 32, src_cb + 16 * linesize);
@@ -869,6 +871,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
CONFIG_H264_D3D11VA_HWACCEL + \
CONFIG_H264_VAAPI_HWACCEL + \
(CONFIG_H264_VDA_HWACCEL * 2) + \
+ CONFIG_H264_VIDEOTOOLBOX_HWACCEL + \
CONFIG_H264_VDPAU_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
const enum AVPixelFormat *choices = pix_fmts;
@@ -943,12 +946,15 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
*fmt++ = AV_PIX_FMT_D3D11VA_VLD;
#endif
#if CONFIG_H264_VAAPI_HWACCEL
- *fmt++ = AV_PIX_FMT_VAAPI_VLD;
+ *fmt++ = AV_PIX_FMT_VAAPI;
#endif
#if CONFIG_H264_VDA_HWACCEL
*fmt++ = AV_PIX_FMT_VDA_VLD;
*fmt++ = AV_PIX_FMT_VDA;
#endif
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
+ *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
+#endif
if (h->avctx->codec->pix_fmts)
choices = h->avctx->codec->pix_fmts;
else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
@@ -976,15 +982,15 @@ static int init_dimensions(H264Context *h)
{
int width = h->width - (h->sps.crop_right + h->sps.crop_left);
int height = h->height - (h->sps.crop_top + h->sps.crop_bottom);
- int crop_present = h->sps.crop_left || h->sps.crop_top ||
- h->sps.crop_right || h->sps.crop_bottom;
av_assert0(h->sps.crop_right + h->sps.crop_left < (unsigned)h->width);
av_assert0(h->sps.crop_top + h->sps.crop_bottom < (unsigned)h->height);
/* handle container cropping */
- if (!crop_present &&
- FFALIGN(h->avctx->width, 16) == h->width &&
- FFALIGN(h->avctx->height, 16) == h->height) {
+ if (FFALIGN(h->avctx->width, 16) == FFALIGN(width, 16) &&
+ FFALIGN(h->avctx->height, 16) == FFALIGN(height, 16) &&
+ h->avctx->width <= width &&
+ h->avctx->height <= height
+ ) {
width = h->avctx->width;
height = h->avctx->height;
}
@@ -1045,14 +1051,16 @@ static int h264_slice_header_init(H264Context *h)
goto fail;
}
+#if FF_API_CAP_VDPAU
if (h->avctx->codec &&
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU &&
+ h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU &&
(h->sps.bit_depth_luma != 8 || h->sps.chroma_format_idc > 1)) {
av_log(h->avctx, AV_LOG_ERROR,
"VDPAU decoding does not support video colorspace.\n");
ret = AVERROR_INVALIDDATA;
goto fail;
}
+#endif
if (h->sps.bit_depth_luma < 8 || h->sps.bit_depth_luma > 14 ||
h->sps.bit_depth_luma == 11 || h->sps.bit_depth_luma == 13
@@ -1151,10 +1159,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
int needs_reinit = 0;
int field_pic_flag, bottom_field_flag;
int first_slice = sl == h->slice_ctx && !h->current_slice;
- int frame_num, picture_structure, droppable;
+ int frame_num, droppable, picture_structure;
int mb_aff_frame, last_mb_aff_frame;
PPS *pps;
+ if (first_slice)
+ av_assert0(!h->setup_finished);
+
h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
@@ -1162,16 +1173,24 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_mb_in_slice == 0) { // FIXME better field boundary detection
if (h->current_slice) {
+ if (h->setup_finished) {
+ av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
+ return AVERROR_INVALIDDATA;
+ }
if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
- ff_h264_field_end(h, h->slice_ctx, 1);
+ ret = ff_h264_field_end(h, h->slice_ctx, 1);
h->current_slice = 0;
+ if (ret < 0)
+ return ret;
} else if (h->cur_pic_ptr && !FIELD_PICTURE(h) && !h->first_field && h->nal_unit_type == NAL_IDR_SLICE) {
av_log(h, AV_LOG_WARNING, "Broken frame packetizing\n");
- ff_h264_field_end(h, h->slice_ctx, 1);
+ ret = ff_h264_field_end(h, h->slice_ctx, 1);
h->current_slice = 0;
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
h->cur_pic_ptr = NULL;
+ if (ret < 0)
+ return ret;
} else
return AVERROR_INVALIDDATA;
}
@@ -1209,17 +1228,20 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
return AVERROR_INVALIDDATA;
}
- if (
- (h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) ||
- (h->avctx->skip_frame >= AVDISCARD_BIDIR && sl->slice_type_nos == AV_PICTURE_TYPE_B) ||
- (h->avctx->skip_frame >= AVDISCARD_NONINTRA && sl->slice_type_nos != AV_PICTURE_TYPE_I) ||
- (h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE) ||
- h->avctx->skip_frame >= AVDISCARD_ALL) {
- return SLICE_SKIPED;
- }
+ if (h->current_slice == 0 && !h->first_field) {
+ if (
+ (h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) ||
+ (h->avctx->skip_frame >= AVDISCARD_BIDIR && sl->slice_type_nos == AV_PICTURE_TYPE_B) ||
+ (h->avctx->skip_frame >= AVDISCARD_NONINTRA && sl->slice_type_nos != AV_PICTURE_TYPE_I) ||
+ (h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE && h->sei_recovery_frame_cnt < 0) ||
+ h->avctx->skip_frame >= AVDISCARD_ALL) {
+ return SLICE_SKIPED;
+ }
+ }
// to make a few old functions happy, it's wrong though
- h->pict_type = sl->slice_type;
+ if (!h->setup_finished)
+ h->pict_type = sl->slice_type;
pps_id = get_ue_golomb(&sl->gb);
if (pps_id >= MAX_PPS_COUNT) {
@@ -1247,8 +1269,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
h->pps.sps_id);
return AVERROR_INVALIDDATA;
}
- if (first_slice)
+
+ if (first_slice) {
h->pps = *h->pps_buffers[pps_id];
+ } else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
+ av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
+ return AVERROR_INVALIDDATA;
+ }
if (pps->sps_id != h->sps.sps_id ||
pps->sps_id != h->current_sps_id ||
@@ -1273,7 +1300,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
h->chroma_format_idc != h->sps.chroma_format_idc)
needs_reinit = 1;
- if (h->flags & CODEC_FLAG_LOW_DELAY ||
+ if (h->flags & AV_CODEC_FLAG_LOW_DELAY ||
(h->sps.bitstream_restriction_flag &&
!h->sps.num_reorder_frames)) {
if (h->avctx->has_b_frames > 1 || h->delayed_pic[0])
@@ -1288,10 +1315,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
}
- h->avctx->profile = ff_h264_get_profile(&h->sps);
- h->avctx->level = h->sps.level_idc;
- h->avctx->refs = h->sps.ref_frame_count;
-
must_reinit = (h->context_initialized &&
( 16*h->sps.mb_width != h->avctx->coded_width
|| 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
@@ -1307,31 +1330,37 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
must_reinit = 1;
- h->mb_width = h->sps.mb_width;
- h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
- h->mb_num = h->mb_width * h->mb_height;
- h->mb_stride = h->mb_width + 1;
+ if (!h->setup_finished) {
+ h->avctx->profile = ff_h264_get_profile(&h->sps);
+ h->avctx->level = h->sps.level_idc;
+ h->avctx->refs = h->sps.ref_frame_count;
- h->b_stride = h->mb_width * 4;
+ h->mb_width = h->sps.mb_width;
+ h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
+ h->mb_num = h->mb_width * h->mb_height;
+ h->mb_stride = h->mb_width + 1;
- h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
+ h->b_stride = h->mb_width * 4;
- h->width = 16 * h->mb_width;
- h->height = 16 * h->mb_height;
+ h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
- ret = init_dimensions(h);
- if (ret < 0)
- return ret;
+ h->width = 16 * h->mb_width;
+ h->height = 16 * h->mb_height;
+
+ ret = init_dimensions(h);
+ if (ret < 0)
+ return ret;
- if (h->sps.video_signal_type_present_flag) {
- h->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG
- : AVCOL_RANGE_MPEG;
- if (h->sps.colour_description_present_flag) {
- if (h->avctx->colorspace != h->sps.colorspace)
- needs_reinit = 1;
- h->avctx->color_primaries = h->sps.color_primaries;
- h->avctx->color_trc = h->sps.color_trc;
- h->avctx->colorspace = h->sps.colorspace;
+ if (h->sps.video_signal_type_present_flag) {
+ h->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG
+ : AVCOL_RANGE_MPEG;
+ if (h->sps.colour_description_present_flag) {
+ if (h->avctx->colorspace != h->sps.colorspace)
+ needs_reinit = 1;
+ h->avctx->color_primaries = h->sps.color_primaries;
+ h->avctx->color_trc = h->sps.color_trc;
+ h->avctx->colorspace = h->sps.colorspace;
+ }
}
}
@@ -1397,12 +1426,16 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
}
}
+ if (!h->setup_finished)
+ h->frame_num = frame_num;
+
sl->mb_mbaff = 0;
mb_aff_frame = 0;
last_mb_aff_frame = h->mb_aff_frame;
last_pic_structure = h->picture_structure;
last_pic_droppable = h->droppable;
- droppable = h->nal_ref_idc == 0;
+
+ droppable = h->nal_ref_idc == 0;
if (h->sps.frame_mbs_only_flag) {
picture_structure = PICT_FRAME;
} else {
@@ -1420,6 +1453,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
mb_aff_frame = h->sps.mb_aff;
}
}
+
if (h->current_slice) {
if (last_pic_structure != picture_structure ||
last_pic_droppable != droppable ||
@@ -1437,9 +1471,11 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
}
h->picture_structure = picture_structure;
- h->droppable = droppable;
- h->frame_num = frame_num;
- h->mb_aff_frame = mb_aff_frame;
+ if (!h->setup_finished) {
+ h->droppable = droppable;
+ h->picture_structure = picture_structure;
+ h->mb_aff_frame = mb_aff_frame;
+ }
sl->mb_field_decoding_flag = picture_structure != PICT_FRAME;
if (h->current_slice == 0) {
@@ -1561,8 +1597,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
(const uint8_t **)prev->f->data,
prev->f->linesize,
prev->f->format,
- h->mb_width * 16,
- h->mb_height * 16);
+ prev->f->width,
+ prev->f->height);
h->short_ref[0]->poc = prev->poc + 2;
}
h->short_ref[0]->frame_num = h->prev_frame_num;
@@ -1624,8 +1660,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
h->last_slice_type = -1;
}
-
- h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
+ if (!h->setup_finished)
+ h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
av_assert1(h->mb_num == h->mb_width * h->mb_height);
if (first_mb_in_slice << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num ||
@@ -1652,20 +1688,34 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
get_ue_golomb(&sl->gb); /* idr_pic_id */
if (h->sps.poc_type == 0) {
- h->poc_lsb = get_bits(&sl->gb, h->sps.log2_max_poc_lsb);
+ int poc_lsb = get_bits(&sl->gb, h->sps.log2_max_poc_lsb);
+
+ if (!h->setup_finished)
+ h->poc_lsb = poc_lsb;
- if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
- h->delta_poc_bottom = get_se_golomb(&sl->gb);
+ if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) {
+ int delta_poc_bottom = get_se_golomb(&sl->gb);
+ if (!h->setup_finished)
+ h->delta_poc_bottom = delta_poc_bottom;
+ }
}
if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) {
- h->delta_poc[0] = get_se_golomb(&sl->gb);
+ int delta_poc = get_se_golomb(&sl->gb);
+
+ if (!h->setup_finished)
+ h->delta_poc[0] = delta_poc;
+
+ if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) {
+ delta_poc = get_se_golomb(&sl->gb);
- if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
- h->delta_poc[1] = get_se_golomb(&sl->gb);
+ if (!h->setup_finished)
+ h->delta_poc[1] = delta_poc;
+ }
}
- ff_init_poc(h, h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc);
+ if (!h->setup_finished)
+ ff_init_poc(h, h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc);
if (h->pps.redundant_pic_cnt_present)
sl->redundant_pic_count = get_ue_golomb(&sl->gb);
@@ -1797,7 +1847,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
sl->deblocking_filter = 0;
if (sl->deblocking_filter == 1 && h->max_contexts > 1) {
- if (h->avctx->flags2 & CODEC_FLAG2_FAST) {
+ if (h->avctx->flags2 & AV_CODEC_FLAG2_FAST) {
/* Cheat slightly for speed:
* Do not bother to deblock across slices. */
sl->deblocking_filter = 2;
@@ -2295,7 +2345,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
sl->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME ||
avctx->codec_id != AV_CODEC_ID_H264 ||
- (CONFIG_GRAY && (h->flags & CODEC_FLAG_GRAY));
+ (CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && h->slice_ctx[0].er.error_status_table) {
const int start_i = av_clip(sl->resync_mb_x + sl->resync_mb_y * h->mb_width, 0, h->mb_num - 1);
@@ -2321,10 +2371,9 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
for (;;) {
// START_TIMER
int ret, eos;
-
- if (sl->mb_x + sl->mb_y * h->mb_width >= sl->mb_index_end) {
- av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps next at %d\n",
- sl->mb_index_end);
+ if (sl->mb_x + sl->mb_y * h->mb_width >= sl->next_slice_idx) {
+ av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps with next at %d\n",
+ sl->next_slice_idx);
er_add_slice(sl, sl->resync_mb_x, sl->resync_mb_y, sl->mb_x,
sl->mb_y, ER_MB_ERROR);
return AVERROR_INVALIDDATA;
@@ -2394,9 +2443,9 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
for (;;) {
int ret;
- if (sl->mb_x + sl->mb_y * h->mb_width >= sl->mb_index_end) {
- av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps next at %d\n",
- sl->mb_index_end);
+ if (sl->mb_x + sl->mb_y * h->mb_width >= sl->next_slice_idx) {
+ av_log(h->avctx, AV_LOG_ERROR, "Slice overlaps with next at %d\n",
+ sl->next_slice_idx);
er_add_slice(sl, sl->resync_mb_x, sl->resync_mb_y, sl->mb_x,
sl->mb_y, ER_MB_ERROR);
return AVERROR_INVALIDDATA;
@@ -2486,38 +2535,48 @@ int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
{
AVCodecContext *const avctx = h->avctx;
H264SliceContext *sl;
- int i;
+ int i, j;
av_assert0(context_count && h->slice_ctx[context_count - 1].mb_y < h->mb_height);
- h->slice_ctx[0].mb_index_end = INT_MAX;
+ h->slice_ctx[0].next_slice_idx = INT_MAX;
- if (h->avctx->hwaccel ||
- h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ if (h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
return 0;
if (context_count == 1) {
- int ret = decode_slice(avctx, &h->slice_ctx[0]);
+ int ret;
+
+ h->slice_ctx[0].next_slice_idx = h->mb_width * h->mb_height;
+
+ ret = decode_slice(avctx, &h->slice_ctx[0]);
h->mb_y = h->slice_ctx[0].mb_y;
return ret;
} else {
- int j, mb_index;
av_assert0(context_count > 0);
for (i = 0; i < context_count; i++) {
- int mb_index_end = h->mb_width * h->mb_height;
+ int next_slice_idx = h->mb_width * h->mb_height;
+ int slice_idx;
+
sl = &h->slice_ctx[i];
- mb_index = sl->resync_mb_x + sl->resync_mb_y * h->mb_width;
if (CONFIG_ERROR_RESILIENCE) {
sl->er.error_count = 0;
}
+
+ /* make sure none of those slices overlap */
+ slice_idx = sl->mb_y * h->mb_width + sl->mb_x;
for (j = 0; j < context_count; j++) {
H264SliceContext *sl2 = &h->slice_ctx[j];
- int mb_index2 = sl2->resync_mb_x + sl2->resync_mb_y * h->mb_width;
+ int slice_idx2 = sl2->mb_y * h->mb_width + sl2->mb_x;
- if (i==j || mb_index > mb_index2)
+ if (i == j || slice_idx2 < slice_idx)
continue;
- mb_index_end = FFMIN(mb_index_end, mb_index2);
+ next_slice_idx = FFMIN(next_slice_idx, slice_idx2);
}
- sl->mb_index_end = mb_index_end;
+ sl->next_slice_idx = next_slice_idx;
}
avctx->execute(avctx, decode_slice, h->slice_ctx,
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264dsp_template.c b/chromium/third_party/ffmpeg/libavcodec/h264dsp_template.c
index fa110196b20..9b2cc2457c6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264dsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264dsp_template.c
@@ -110,7 +110,7 @@ static av_always_inline av_flatten void FUNCC(h264_loop_filter_luma)(uint8_t *p_
alpha <<= BIT_DEPTH - 8;
beta <<= BIT_DEPTH - 8;
for( i = 0; i < 4; i++ ) {
- const int tc_orig = tc0[i] << (BIT_DEPTH - 8);
+ const int tc_orig = tc0[i] * (1 << (BIT_DEPTH - 8));
if( tc_orig < 0 ) {
pix += inner_iters*ystride;
continue;
@@ -141,7 +141,7 @@ static av_always_inline av_flatten void FUNCC(h264_loop_filter_luma)(uint8_t *p_
tc++;
}
- i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
+ i_delta = av_clip( (((q0 - p0 ) * 4) + (p1 - q1) + 4) >> 3, -tc, tc );
pix[-xstride] = av_clip_pixel( p0 + i_delta ); /* p0' */
pix[0] = av_clip_pixel( q0 - i_delta ); /* q0' */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264pred.c b/chromium/third_party/ffmpeg/libavcodec/h264pred.c
index 497b0805c0f..8f15f71f55c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264pred.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264pred.c
@@ -592,7 +592,12 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
break;
}
- if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
- if (ARCH_X86) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
- if (ARCH_MIPS) ff_h264_pred_init_mips(h, codec_id, bit_depth, chroma_format_idc);
+ if (ARCH_AARCH64)
+ ff_h264_pred_init_aarch64(h, codec_id, bit_depth, chroma_format_idc);
+ if (ARCH_ARM)
+ ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
+ if (ARCH_X86)
+ ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
+ if (ARCH_MIPS)
+ ff_h264_pred_init_mips(h, codec_id, bit_depth, chroma_format_idc);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264pred.h b/chromium/third_party/ffmpeg/libavcodec/h264pred.h
index edeca918c73..091dcbbf716 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264pred.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264pred.h
@@ -113,6 +113,9 @@ typedef struct H264PredContext {
void ff_h264_pred_init(H264PredContext *h, int codec_id,
const int bit_depth, const int chroma_format_idc);
+void ff_h264_pred_init_aarch64(H264PredContext *h, int codec_id,
+ const int bit_depth,
+ const int chroma_format_idc);
void ff_h264_pred_init_arm(H264PredContext *h, int codec_id,
const int bit_depth, const int chroma_format_idc);
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
diff --git a/chromium/third_party/ffmpeg/libavcodec/hap.c b/chromium/third_party/ffmpeg/libavcodec/hap.c
new file mode 100644
index 00000000000..5b3af5e1d0f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hap.c
@@ -0,0 +1,55 @@
+/*
+ * Vidvox Hap utility functions
+ * Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Hap utilities
+ */
+#include "hap.h"
+
+int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame)
+{
+ int ret = 0;
+ if (first_in_frame == 1 && ctx->chunk_count != count) {
+ int ret = av_reallocp_array(&ctx->chunks, count, sizeof(HapChunk));
+ if (ret == 0)
+ ret = av_reallocp_array(&ctx->chunk_results, count, sizeof(int));
+ if (ret < 0) {
+ ctx->chunk_count = 0;
+ } else {
+ ctx->chunk_count = count;
+ }
+ } else if (ctx->chunk_count != count) {
+ /* If this is not the first chunk count calculated for a frame and a
+ * different count has already been encountered, then reject the frame:
+ * each table in the Decode Instructions Container must describe the
+ * same number of chunks. */
+ ret = AVERROR_INVALIDDATA;
+ }
+ return ret;
+}
+
+av_cold void ff_hap_free_context(HapContext *ctx)
+{
+ av_freep(&ctx->tex_buf);
+ av_freep(&ctx->chunks);
+ av_freep(&ctx->chunk_results);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hap.h b/chromium/third_party/ffmpeg/libavcodec/hap.h
new file mode 100644
index 00000000000..e4762ee4387
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hap.h
@@ -0,0 +1,98 @@
+/*
+ * Vidvox Hap
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_HAP_H
+#define AVCODEC_HAP_H
+
+#include <stdint.h>
+
+#include "libavutil/opt.h"
+
+#include "bytestream.h"
+#include "texturedsp.h"
+
+enum HapTextureFormat {
+ HAP_FMT_RGBDXT1 = 0x0B,
+ HAP_FMT_RGBADXT5 = 0x0E,
+ HAP_FMT_YCOCGDXT5 = 0x0F,
+};
+
+enum HapCompressor {
+ HAP_COMP_NONE = 0xA0,
+ HAP_COMP_SNAPPY = 0xB0,
+ HAP_COMP_COMPLEX = 0xC0,
+};
+
+enum HapSectionType {
+ HAP_ST_DECODE_INSTRUCTIONS = 0x01,
+ HAP_ST_COMPRESSOR_TABLE = 0x02,
+ HAP_ST_SIZE_TABLE = 0x03,
+ HAP_ST_OFFSET_TABLE = 0x04,
+};
+
+typedef struct HapChunk {
+ enum HapCompressor compressor;
+ int compressed_offset;
+ size_t compressed_size;
+ int uncompressed_offset;
+ size_t uncompressed_size;
+} HapChunk;
+
+typedef struct HapContext {
+ AVClass *class;
+
+ TextureDSPContext dxtc;
+ GetByteContext gbc;
+
+ enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */
+ int opt_chunk_count; /* User-requested chunk count (encoder only) */
+
+ int chunk_count;
+ HapChunk *chunks;
+ int *chunk_results; /* Results from threaded operations */
+
+ int tex_rat; /* Compression ratio */
+ const uint8_t *tex_data; /* Compressed texture */
+ uint8_t *tex_buf; /* Buffer for compressed texture */
+ size_t tex_size; /* Size of the compressed texture */
+
+ size_t max_snappy; /* Maximum compressed size for snappy buffer */
+
+ int slice_count; /* Number of slices for threaded operations */
+
+ /* Pointer to the selected compress or decompress function */
+ int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+} HapContext;
+
+/*
+ * Set the number of chunks in the frame. Returns 0 on success or an error if:
+ * - first_in_frame is 0 and the number of chunks has changed
+ * - any other error occurs
+ */
+int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame);
+
+/*
+ * Free resources associated with the context
+ */
+av_cold void ff_hap_free_context(HapContext *ctx);
+
+#endif /* AVCODEC_HAP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/hapdec.c b/chromium/third_party/ffmpeg/libavcodec/hapdec.c
new file mode 100644
index 00000000000..6adac21bbbd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hapdec.c
@@ -0,0 +1,441 @@
+/*
+ * Vidvox Hap decoder
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Hap decoder
+ *
+ * Fourcc: Hap1, Hap5, HapY
+ *
+ * https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md
+ */
+
+#include <stdint.h>
+
+#include "libavutil/imgutils.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "hap.h"
+#include "internal.h"
+#include "memory.h"
+#include "snappy.h"
+#include "texturedsp.h"
+#include "thread.h"
+
+/* The first three bytes are the size of the section past the header, or zero
+ * if the length is stored in the next long word. The fourth byte in the first
+ * long word indicates the type of the current section. */
+static int parse_section_header(GetByteContext *gbc, int *section_size,
+ enum HapSectionType *section_type)
+{
+ if (bytestream2_get_bytes_left(gbc) < 4)
+ return AVERROR_INVALIDDATA;
+
+ *section_size = bytestream2_get_le24(gbc);
+ *section_type = bytestream2_get_byte(gbc);
+
+ if (*section_size == 0) {
+ if (bytestream2_get_bytes_left(gbc) < 4)
+ return AVERROR_INVALIDDATA;
+
+ *section_size = bytestream2_get_le32(gbc);
+ }
+
+ if (*section_size > bytestream2_get_bytes_left(gbc) || *section_size < 0)
+ return AVERROR_INVALIDDATA;
+ else
+ return 0;
+}
+
+static int hap_parse_decode_instructions(HapContext *ctx, int size)
+{
+ GetByteContext *gbc = &ctx->gbc;
+ int section_size;
+ enum HapSectionType section_type;
+ int is_first_table = 1, had_offsets = 0, had_compressors = 0, had_sizes = 0;
+ int i, ret;
+
+ while (size > 0) {
+ int stream_remaining = bytestream2_get_bytes_left(gbc);
+ ret = parse_section_header(gbc, &section_size, &section_type);
+ if (ret != 0)
+ return ret;
+
+ size -= stream_remaining - bytestream2_get_bytes_left(gbc);
+
+ switch (section_type) {
+ case HAP_ST_COMPRESSOR_TABLE:
+ ret = ff_hap_set_chunk_count(ctx, section_size, is_first_table);
+ if (ret != 0)
+ return ret;
+ for (i = 0; i < section_size; i++) {
+ ctx->chunks[i].compressor = bytestream2_get_byte(gbc) << 4;
+ }
+ had_compressors = 1;
+ is_first_table = 0;
+ break;
+ case HAP_ST_SIZE_TABLE:
+ ret = ff_hap_set_chunk_count(ctx, section_size / 4, is_first_table);
+ if (ret != 0)
+ return ret;
+ for (i = 0; i < section_size / 4; i++) {
+ ctx->chunks[i].compressed_size = bytestream2_get_le32(gbc);
+ }
+ had_sizes = 1;
+ is_first_table = 0;
+ break;
+ case HAP_ST_OFFSET_TABLE:
+ ret = ff_hap_set_chunk_count(ctx, section_size / 4, is_first_table);
+ if (ret != 0)
+ return ret;
+ for (i = 0; i < section_size / 4; i++) {
+ ctx->chunks[i].compressed_offset = bytestream2_get_le32(gbc);
+ }
+ had_offsets = 1;
+ is_first_table = 0;
+ break;
+ default:
+ break;
+ }
+ size -= section_size;
+ }
+
+ if (!had_sizes || !had_compressors)
+ return AVERROR_INVALIDDATA;
+
+ /* The offsets table is optional. If not present than calculate offsets by
+ * summing the sizes of preceding chunks. */
+ if (!had_offsets) {
+ size_t running_size = 0;
+ for (i = 0; i < ctx->chunk_count; i++) {
+ ctx->chunks[i].compressed_offset = running_size;
+ running_size += ctx->chunks[i].compressed_size;
+ }
+ }
+
+ return 0;
+}
+
+static int hap_can_use_tex_in_place(HapContext *ctx)
+{
+ int i;
+ size_t running_offset = 0;
+ for (i = 0; i < ctx->chunk_count; i++) {
+ if (ctx->chunks[i].compressed_offset != running_offset
+ || ctx->chunks[i].compressor != HAP_COMP_NONE)
+ return 0;
+ running_offset += ctx->chunks[i].compressed_size;
+ }
+ return 1;
+}
+
+static int hap_parse_frame_header(AVCodecContext *avctx)
+{
+ HapContext *ctx = avctx->priv_data;
+ GetByteContext *gbc = &ctx->gbc;
+ int section_size;
+ enum HapSectionType section_type;
+ const char *compressorstr;
+ int i, ret;
+
+ ret = parse_section_header(gbc, &section_size, &section_type);
+ if (ret != 0)
+ return ret;
+
+ if ((avctx->codec_tag == MKTAG('H','a','p','1') && (section_type & 0x0F) != HAP_FMT_RGBDXT1) ||
+ (avctx->codec_tag == MKTAG('H','a','p','5') && (section_type & 0x0F) != HAP_FMT_RGBADXT5) ||
+ (avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) != HAP_FMT_YCOCGDXT5)) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid texture format %#04x.\n", section_type & 0x0F);
+ return AVERROR_INVALIDDATA;
+ }
+
+ switch (section_type & 0xF0) {
+ case HAP_COMP_NONE:
+ case HAP_COMP_SNAPPY:
+ ret = ff_hap_set_chunk_count(ctx, 1, 1);
+ if (ret == 0) {
+ ctx->chunks[0].compressor = section_type & 0xF0;
+ ctx->chunks[0].compressed_offset = 0;
+ ctx->chunks[0].compressed_size = section_size;
+ }
+ if (ctx->chunks[0].compressor == HAP_COMP_NONE) {
+ compressorstr = "none";
+ } else {
+ compressorstr = "snappy";
+ }
+ break;
+ case HAP_COMP_COMPLEX:
+ ret = parse_section_header(gbc, &section_size, &section_type);
+ if (ret == 0 && section_type != HAP_ST_DECODE_INSTRUCTIONS)
+ ret = AVERROR_INVALIDDATA;
+ if (ret == 0)
+ ret = hap_parse_decode_instructions(ctx, section_size);
+ compressorstr = "complex";
+ break;
+ default:
+ ret = AVERROR_INVALIDDATA;
+ break;
+ }
+
+ if (ret != 0)
+ return ret;
+
+ /* Check the frame is valid and read the uncompressed chunk sizes */
+ ctx->tex_size = 0;
+ for (i = 0; i < ctx->chunk_count; i++) {
+ HapChunk *chunk = &ctx->chunks[i];
+
+ /* Check the compressed buffer is valid */
+ if (chunk->compressed_offset + chunk->compressed_size > bytestream2_get_bytes_left(gbc))
+ return AVERROR_INVALIDDATA;
+
+ /* Chunks are unpacked sequentially, ctx->tex_size is the uncompressed
+ * size thus far */
+ chunk->uncompressed_offset = ctx->tex_size;
+
+ /* Fill out uncompressed size */
+ if (chunk->compressor == HAP_COMP_SNAPPY) {
+ GetByteContext gbc_tmp;
+ int64_t uncompressed_size;
+ bytestream2_init(&gbc_tmp, gbc->buffer + chunk->compressed_offset,
+ chunk->compressed_size);
+ uncompressed_size = ff_snappy_peek_uncompressed_length(&gbc_tmp);
+ if (uncompressed_size < 0) {
+ return uncompressed_size;
+ }
+ chunk->uncompressed_size = uncompressed_size;
+ } else if (chunk->compressor == HAP_COMP_NONE) {
+ chunk->uncompressed_size = chunk->compressed_size;
+ } else {
+ return AVERROR_INVALIDDATA;
+ }
+ ctx->tex_size += chunk->uncompressed_size;
+ }
+
+ av_log(avctx, AV_LOG_DEBUG, "%s compressor\n", compressorstr);
+
+ return ret;
+}
+
+static int decompress_chunks_thread(AVCodecContext *avctx, void *arg,
+ int chunk_nb, int thread_nb)
+{
+ HapContext *ctx = avctx->priv_data;
+
+ HapChunk *chunk = &ctx->chunks[chunk_nb];
+ GetByteContext gbc;
+ uint8_t *dst = ctx->tex_buf + chunk->uncompressed_offset;
+
+ bytestream2_init(&gbc, ctx->gbc.buffer + chunk->compressed_offset, chunk->compressed_size);
+
+ if (chunk->compressor == HAP_COMP_SNAPPY) {
+ int ret;
+ int64_t uncompressed_size = ctx->tex_size;
+
+ /* Uncompress the frame */
+ ret = ff_snappy_uncompress(&gbc, dst, &uncompressed_size);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Snappy uncompress error\n");
+ return ret;
+ }
+ } else if (chunk->compressor == HAP_COMP_NONE) {
+ bytestream2_get_buffer(&gbc, dst, chunk->compressed_size);
+ }
+
+ return 0;
+}
+
+static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
+ int slice, int thread_nb)
+{
+ HapContext *ctx = avctx->priv_data;
+ AVFrame *frame = arg;
+ const uint8_t *d = ctx->tex_data;
+ int w_block = avctx->coded_width / TEXTURE_BLOCK_W;
+ int h_block = avctx->coded_height / TEXTURE_BLOCK_H;
+ int x, y;
+ int start_slice, end_slice;
+ int base_blocks_per_slice = h_block / ctx->slice_count;
+ int remainder_blocks = h_block % ctx->slice_count;
+
+ /* When the frame height (in blocks) doesn't divide evenly between the
+ * number of slices, spread the remaining blocks evenly between the first
+ * operations */
+ start_slice = slice * base_blocks_per_slice;
+ /* Add any extra blocks (one per slice) that have been added before this slice */
+ start_slice += FFMIN(slice, remainder_blocks);
+
+ end_slice = start_slice + base_blocks_per_slice;
+ /* Add an extra block if there are still remainder blocks to be accounted for */
+ if (slice < remainder_blocks)
+ end_slice++;
+
+ for (y = start_slice; y < end_slice; y++) {
+ uint8_t *p = frame->data[0] + y * frame->linesize[0] * TEXTURE_BLOCK_H;
+ int off = y * w_block;
+ for (x = 0; x < w_block; x++) {
+ ctx->tex_fun(p + x * 16, frame->linesize[0],
+ d + (off + x) * ctx->tex_rat);
+ }
+ }
+
+ return 0;
+}
+
+static int hap_decode(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ HapContext *ctx = avctx->priv_data;
+ ThreadFrame tframe;
+ int ret, i;
+ int tex_size;
+
+ bytestream2_init(&ctx->gbc, avpkt->data, avpkt->size);
+
+ /* Check for section header */
+ ret = hap_parse_frame_header(avctx);
+ if (ret < 0)
+ return ret;
+
+ /* Get the output frame ready to receive data */
+ tframe.f = data;
+ ret = ff_thread_get_buffer(avctx, &tframe, 0);
+ if (ret < 0)
+ return ret;
+ if (avctx->codec->update_thread_context)
+ ff_thread_finish_setup(avctx);
+
+ /* Unpack the DXT texture */
+ if (hap_can_use_tex_in_place(ctx)) {
+ /* Only DXTC texture compression in a contiguous block */
+ ctx->tex_data = ctx->gbc.buffer;
+ tex_size = bytestream2_get_bytes_left(&ctx->gbc);
+ } else {
+ /* Perform the second-stage decompression */
+ ret = av_reallocp(&ctx->tex_buf, ctx->tex_size);
+ if (ret < 0)
+ return ret;
+
+ avctx->execute2(avctx, decompress_chunks_thread, NULL,
+ ctx->chunk_results, ctx->chunk_count);
+
+ for (i = 0; i < ctx->chunk_count; i++) {
+ if (ctx->chunk_results[i] < 0)
+ return ctx->chunk_results[i];
+ }
+
+ ctx->tex_data = ctx->tex_buf;
+ tex_size = ctx->tex_size;
+ }
+
+ if (tex_size < (avctx->coded_width / TEXTURE_BLOCK_W)
+ *(avctx->coded_height / TEXTURE_BLOCK_H)
+ *ctx->tex_rat) {
+ av_log(avctx, AV_LOG_ERROR, "Insufficient data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* Use the decompress function on the texture, one block per thread */
+ avctx->execute2(avctx, decompress_texture_thread, tframe.f, NULL, ctx->slice_count);
+
+ /* Frame is ready to be output */
+ tframe.f->pict_type = AV_PICTURE_TYPE_I;
+ tframe.f->key_frame = 1;
+ *got_frame = 1;
+
+ return avpkt->size;
+}
+
+static av_cold int hap_init(AVCodecContext *avctx)
+{
+ HapContext *ctx = avctx->priv_data;
+ const char *texture_name;
+ int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid video size %dx%d.\n",
+ avctx->width, avctx->height);
+ return ret;
+ }
+
+ /* Since codec is based on 4x4 blocks, size is aligned to 4 */
+ avctx->coded_width = FFALIGN(avctx->width, TEXTURE_BLOCK_W);
+ avctx->coded_height = FFALIGN(avctx->height, TEXTURE_BLOCK_H);
+
+ /* Technically only one mode has alpha, but 32 bits are easier to handle */
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+
+ ff_texturedsp_init(&ctx->dxtc);
+
+ switch (avctx->codec_tag) {
+ case MKTAG('H','a','p','1'):
+ texture_name = "DXT1";
+ ctx->tex_rat = 8;
+ ctx->tex_fun = ctx->dxtc.dxt1_block;
+ break;
+ case MKTAG('H','a','p','5'):
+ texture_name = "DXT5";
+ ctx->tex_rat = 16;
+ ctx->tex_fun = ctx->dxtc.dxt5_block;
+ break;
+ case MKTAG('H','a','p','Y'):
+ texture_name = "DXT5-YCoCg-scaled";
+ ctx->tex_rat = 16;
+ ctx->tex_fun = ctx->dxtc.dxt5ys_block;
+ break;
+ default:
+ return AVERROR_DECODER_NOT_FOUND;
+ }
+
+ av_log(avctx, AV_LOG_DEBUG, "%s texture\n", texture_name);
+
+ ctx->slice_count = av_clip(avctx->thread_count, 1,
+ avctx->coded_height / TEXTURE_BLOCK_H);
+
+ return 0;
+}
+
+static av_cold int hap_close(AVCodecContext *avctx)
+{
+ HapContext *ctx = avctx->priv_data;
+
+ ff_hap_free_context(ctx);
+
+ return 0;
+}
+
+AVCodec ff_hap_decoder = {
+ .name = "hap",
+ .long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap decoder"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HAP,
+ .init = hap_init,
+ .decode = hap_decode,
+ .close = hap_close,
+ .priv_data_size = sizeof(HapContext),
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS |
+ AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hapenc.c b/chromium/third_party/ffmpeg/libavcodec/hapenc.c
new file mode 100644
index 00000000000..7daadce2544
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hapenc.c
@@ -0,0 +1,331 @@
+/*
+ * Vidvox Hap encoder
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Hap encoder
+ *
+ * Fourcc: Hap1, Hap5, HapY
+ *
+ * https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md
+ */
+
+#include <stdint.h>
+#include "snappy-c.h"
+
+#include "libavutil/frame.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "hap.h"
+#include "internal.h"
+#include "texturedsp.h"
+
+#define HAP_MAX_CHUNKS 64
+
+enum HapHeaderLength {
+ /* Short header: four bytes with a 24 bit size value */
+ HAP_HDR_SHORT = 4,
+ /* Long header: eight bytes with a 32 bit size value */
+ HAP_HDR_LONG = 8,
+};
+
+static void compress_texture(AVCodecContext *avctx, const AVFrame *f)
+{
+ HapContext *ctx = avctx->priv_data;
+ uint8_t *out = ctx->tex_buf;
+ int i, j;
+
+ for (j = 0; j < avctx->height; j += 4) {
+ for (i = 0; i < avctx->width; i += 4) {
+ uint8_t *p = f->data[0] + i * 4 + j * f->linesize[0];
+ const int step = ctx->tex_fun(out, f->linesize[0], p);
+ out += step;
+ }
+ }
+}
+
+/* section_length does not include the header */
+static void hap_write_section_header(PutByteContext *pbc,
+ enum HapHeaderLength header_length,
+ int section_length,
+ enum HapSectionType section_type)
+{
+ /* The first three bytes are the length of the section (not including the
+ * header) or zero if using an eight-byte header.
+ * For an eight-byte header, the length is in the last four bytes.
+ * The fourth byte stores the section type. */
+ bytestream2_put_le24(pbc, header_length == HAP_HDR_LONG ? 0 : section_length);
+ bytestream2_put_byte(pbc, section_type);
+
+ if (header_length == HAP_HDR_LONG) {
+ bytestream2_put_le32(pbc, section_length);
+ }
+}
+
+static int hap_compress_frame(AVCodecContext *avctx, uint8_t *dst)
+{
+ HapContext *ctx = avctx->priv_data;
+ int i, final_size = 0;
+
+ for (i = 0; i < ctx->chunk_count; i++) {
+ HapChunk *chunk = &ctx->chunks[i];
+ uint8_t *chunk_src, *chunk_dst;
+ int ret;
+
+ if (i == 0) {
+ chunk->compressed_offset = 0;
+ } else {
+ chunk->compressed_offset = ctx->chunks[i-1].compressed_offset
+ + ctx->chunks[i-1].compressed_size;
+ }
+ chunk->uncompressed_size = ctx->tex_size / ctx->chunk_count;
+ chunk->uncompressed_offset = i * chunk->uncompressed_size;
+ chunk->compressed_size = ctx->max_snappy;
+ chunk_src = ctx->tex_buf + chunk->uncompressed_offset;
+ chunk_dst = dst + chunk->compressed_offset;
+
+ /* Compress with snappy too, write directly on packet buffer. */
+ ret = snappy_compress(chunk_src, chunk->uncompressed_size,
+ chunk_dst, &chunk->compressed_size);
+ if (ret != SNAPPY_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Snappy compress error.\n");
+ return AVERROR_BUG;
+ }
+
+ /* If there is no gain from snappy, just use the raw texture. */
+ if (chunk->compressed_size >= chunk->uncompressed_size) {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "Snappy buffer bigger than uncompressed (%lu >= %lu bytes).\n",
+ chunk->compressed_size, chunk->uncompressed_size);
+ memcpy(chunk_dst, chunk_src, chunk->uncompressed_size);
+ chunk->compressor = HAP_COMP_NONE;
+ chunk->compressed_size = chunk->uncompressed_size;
+ } else {
+ chunk->compressor = HAP_COMP_SNAPPY;
+ }
+
+ final_size += chunk->compressed_size;
+ }
+
+ return final_size;
+}
+
+static int hap_decode_instructions_length(HapContext *ctx)
+{
+ /* Second-Stage Compressor Table (one byte per entry)
+ * + Chunk Size Table (four bytes per entry)
+ * + headers for both sections (short versions)
+ * = chunk_count + (4 * chunk_count) + 4 + 4 */
+ return (5 * ctx->chunk_count) + 8;
+}
+
+static int hap_header_length(HapContext *ctx)
+{
+ /* Top section header (long version) */
+ int length = HAP_HDR_LONG;
+
+ if (ctx->chunk_count > 1) {
+ /* Decode Instructions header (short) + Decode Instructions Container */
+ length += HAP_HDR_SHORT + hap_decode_instructions_length(ctx);
+ }
+
+ return length;
+}
+
+static void hap_write_frame_header(HapContext *ctx, uint8_t *dst, int frame_length)
+{
+ PutByteContext pbc;
+ int i;
+
+ bytestream2_init_writer(&pbc, dst, frame_length);
+ if (ctx->chunk_count == 1) {
+ /* Write a simple header */
+ hap_write_section_header(&pbc, HAP_HDR_LONG, frame_length - 8,
+ ctx->chunks[0].compressor | ctx->opt_tex_fmt);
+ } else {
+ /* Write a complex header with Decode Instructions Container */
+ hap_write_section_header(&pbc, HAP_HDR_LONG, frame_length - 8,
+ HAP_COMP_COMPLEX | ctx->opt_tex_fmt);
+ hap_write_section_header(&pbc, HAP_HDR_SHORT, hap_decode_instructions_length(ctx),
+ HAP_ST_DECODE_INSTRUCTIONS);
+ hap_write_section_header(&pbc, HAP_HDR_SHORT, ctx->chunk_count,
+ HAP_ST_COMPRESSOR_TABLE);
+
+ for (i = 0; i < ctx->chunk_count; i++) {
+ bytestream2_put_byte(&pbc, ctx->chunks[i].compressor >> 4);
+ }
+
+ hap_write_section_header(&pbc, HAP_HDR_SHORT, ctx->chunk_count * 4,
+ HAP_ST_SIZE_TABLE);
+
+ for (i = 0; i < ctx->chunk_count; i++) {
+ bytestream2_put_le32(&pbc, ctx->chunks[i].compressed_size);
+ }
+ }
+}
+
+static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ HapContext *ctx = avctx->priv_data;
+ int header_length = hap_header_length(ctx);
+ int final_data_size, ret;
+ int pktsize = FFMAX(ctx->tex_size, ctx->max_snappy * ctx->chunk_count) + header_length;
+
+ /* Allocate maximum size packet, shrink later. */
+ ret = ff_alloc_packet2(avctx, pkt, pktsize, header_length);
+ if (ret < 0)
+ return ret;
+
+ /* DXTC compression. */
+ compress_texture(avctx, frame);
+
+ /* Compress (using Snappy) the frame */
+ final_data_size = hap_compress_frame(avctx, pkt->data + header_length);
+ if (final_data_size < 0)
+ return final_data_size;
+
+ /* Write header at the start. */
+ hap_write_frame_header(ctx, pkt->data, final_data_size + header_length);
+
+ av_shrink_packet(pkt, final_data_size + header_length);
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ *got_packet = 1;
+ return 0;
+}
+
+static av_cold int hap_init(AVCodecContext *avctx)
+{
+ HapContext *ctx = avctx->priv_data;
+ int ratio;
+ int corrected_chunk_count;
+ int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid video size %dx%d.\n",
+ avctx->width, avctx->height);
+ return ret;
+ }
+
+ if (avctx->width % 4 || avctx->height % 4) {
+ av_log(avctx, AV_LOG_ERROR, "Video size %dx%d is not multiple of 4.\n",
+ avctx->width, avctx->height);
+ return AVERROR_INVALIDDATA;
+ }
+
+ ff_texturedspenc_init(&ctx->dxtc);
+
+ switch (ctx->opt_tex_fmt) {
+ case HAP_FMT_RGBDXT1:
+ ratio = 8;
+ avctx->codec_tag = MKTAG('H', 'a', 'p', '1');
+ ctx->tex_fun = ctx->dxtc.dxt1_block;
+ break;
+ case HAP_FMT_RGBADXT5:
+ ratio = 4;
+ avctx->codec_tag = MKTAG('H', 'a', 'p', '5');
+ ctx->tex_fun = ctx->dxtc.dxt5_block;
+ break;
+ case HAP_FMT_YCOCGDXT5:
+ ratio = 4;
+ avctx->codec_tag = MKTAG('H', 'a', 'p', 'Y');
+ ctx->tex_fun = ctx->dxtc.dxt5ys_block;
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR, "Invalid format %02X\n", ctx->opt_tex_fmt);
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* Texture compression ratio is constant, so can we computer
+ * beforehand the final size of the uncompressed buffer. */
+ ctx->tex_size = FFALIGN(avctx->width, TEXTURE_BLOCK_W) *
+ FFALIGN(avctx->height, TEXTURE_BLOCK_H) * 4 / ratio;
+
+ /* Round the chunk count to divide evenly on DXT block edges */
+ corrected_chunk_count = av_clip(ctx->opt_chunk_count, 1, HAP_MAX_CHUNKS);
+ while ((ctx->tex_size / (64 / ratio)) % corrected_chunk_count != 0) {
+ corrected_chunk_count--;
+ }
+ if (corrected_chunk_count != ctx->opt_chunk_count) {
+ av_log(avctx, AV_LOG_INFO, "%d chunks requested but %d used.\n",
+ ctx->opt_chunk_count, corrected_chunk_count);
+ }
+ ret = ff_hap_set_chunk_count(ctx, corrected_chunk_count, 1);
+ if (ret != 0)
+ return ret;
+
+ ctx->max_snappy = snappy_max_compressed_length(ctx->tex_size / corrected_chunk_count);
+
+ ctx->tex_buf = av_malloc(ctx->tex_size);
+ if (!ctx->tex_buf)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static av_cold int hap_close(AVCodecContext *avctx)
+{
+ HapContext *ctx = avctx->priv_data;
+
+ ff_hap_free_context(ctx);
+
+ return 0;
+}
+
+#define OFFSET(x) offsetof(HapContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "format", NULL, OFFSET(opt_tex_fmt), AV_OPT_TYPE_INT, { .i64 = HAP_FMT_RGBDXT1 }, HAP_FMT_RGBDXT1, HAP_FMT_YCOCGDXT5, FLAGS, "format" },
+ { "hap", "Hap 1 (DXT1 textures)", 0, AV_OPT_TYPE_CONST, { .i64 = HAP_FMT_RGBDXT1 }, 0, 0, FLAGS, "format" },
+ { "hap_alpha", "Hap Alpha (DXT5 textures)", 0, AV_OPT_TYPE_CONST, { .i64 = HAP_FMT_RGBADXT5 }, 0, 0, FLAGS, "format" },
+ { "hap_q", "Hap Q (DXT5-YCoCg textures)", 0, AV_OPT_TYPE_CONST, { .i64 = HAP_FMT_YCOCGDXT5 }, 0, 0, FLAGS, "format" },
+ { "chunks", "chunk count", OFFSET(opt_chunk_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, HAP_MAX_CHUNKS, FLAGS, },
+ { NULL },
+};
+
+static const AVClass hapenc_class = {
+ .class_name = "Hap encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_hap_encoder = {
+ .name = "hap",
+ .long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap encoder"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HAP,
+ .priv_data_size = sizeof(HapContext),
+ .priv_class = &hapenc_class,
+ .init = hap_init,
+ .encode2 = hap_encode,
+ .close = hap_close,
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE,
+ },
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc.c b/chromium/third_party/ffmpeg/libavcodec/hevc.c
index 5237752cd09..8d4db22c8cf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc.c
@@ -149,7 +149,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
if (luma_log2_weight_denom < 0 || luma_log2_weight_denom > 7)
av_log(s->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is invalid\n", luma_log2_weight_denom);
s->sh.luma_log2_weight_denom = av_clip_uintp2(luma_log2_weight_denom, 3);
- if (s->sps->chroma_format_idc != 0) {
+ if (s->ps.sps->chroma_format_idc != 0) {
int delta = get_se_golomb(gb);
s->sh.chroma_log2_weight_denom = av_clip_uintp2(s->sh.luma_log2_weight_denom + delta, 3);
}
@@ -161,7 +161,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
s->sh.luma_offset_l0[i] = 0;
}
}
- if (s->sps->chroma_format_idc != 0) {
+ if (s->ps.sps->chroma_format_idc != 0) {
for (i = 0; i < s->sh.nb_refs[L0]; i++)
chroma_weight_l0_flag[i] = get_bits1(gb);
} else {
@@ -197,7 +197,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
s->sh.luma_offset_l1[i] = 0;
}
}
- if (s->sps->chroma_format_idc != 0) {
+ if (s->ps.sps->chroma_format_idc != 0) {
for (i = 0; i < s->sh.nb_refs[L1]; i++)
chroma_weight_l1_flag[i] = get_bits1(gb);
} else {
@@ -230,7 +230,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
{
- const HEVCSPS *sps = s->sps;
+ const HEVCSPS *sps = s->ps.sps;
int max_poc_lsb = 1 << sps->log2_max_poc_lsb;
int prev_delta_msb = 0;
unsigned int nb_sps = 0, nb_sh;
@@ -280,10 +280,10 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
return 0;
}
-static void export_stream_params(AVCodecContext *avctx,
- const HEVCContext *s, const HEVCSPS *sps)
+static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
+ const HEVCSPS *sps)
{
- const HEVCVPS *vps = (const HEVCVPS*)s->vps_list[sps->vps_id]->data;
+ const HEVCVPS *vps = (const HEVCVPS*)ps->vps_list[sps->vps_id]->data;
unsigned int num = 0, den = 0;
avctx->pix_fmt = sps->pix_fmt;
@@ -328,17 +328,23 @@ static void export_stream_params(AVCodecContext *avctx,
static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fmt)
{
- #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL)
+ #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
int ret, i;
- export_stream_params(s->avctx, s, sps);
-
pic_arrays_free(s);
+ s->ps.sps = NULL;
+ s->ps.vps = NULL;
+
+ if (!sps)
+ return 0;
+
ret = pic_arrays_init(s, sps);
if (ret < 0)
goto fail;
+ export_stream_params(s->avctx, &s->ps, sps);
+
if (sps->pix_fmt == AV_PIX_FMT_YUV420P || sps->pix_fmt == AV_PIX_FMT_YUVJ420P) {
#if CONFIG_HEVC_DXVA2_HWACCEL
*fmt++ = AV_PIX_FMT_DXVA2_VLD;
@@ -346,6 +352,12 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fm
#if CONFIG_HEVC_D3D11VA_HWACCEL
*fmt++ = AV_PIX_FMT_D3D11VA_VLD;
#endif
+#if CONFIG_HEVC_VAAPI_HWACCEL
+ *fmt++ = AV_PIX_FMT_VAAPI;
+#endif
+#if CONFIG_HEVC_VDPAU_HWACCEL
+ *fmt++ = AV_PIX_FMT_VDPAU;
+#endif
}
if (pix_fmt == AV_PIX_FMT_NONE) {
@@ -386,14 +398,14 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fm
}
}
- s->sps = sps;
- s->vps = (HEVCVPS*) s->vps_list[s->sps->vps_id]->data;
+ s->ps.sps = sps;
+ s->ps.vps = (HEVCVPS*) s->ps.vps_list[s->ps.sps->vps_id]->data;
return 0;
fail:
pic_arrays_free(s);
- s->sps = NULL;
+ s->ps.sps = NULL;
return ret;
}
@@ -416,30 +428,30 @@ static int hls_slice_header(HEVCContext *s)
sh->no_output_of_prior_pics_flag = get_bits1(gb);
sh->pps_id = get_ue_golomb_long(gb);
- if (sh->pps_id >= MAX_PPS_COUNT || !s->pps_list[sh->pps_id]) {
+ if (sh->pps_id >= MAX_PPS_COUNT || !s->ps.pps_list[sh->pps_id]) {
av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
return AVERROR_INVALIDDATA;
}
if (!sh->first_slice_in_pic_flag &&
- s->pps != (HEVCPPS*)s->pps_list[sh->pps_id]->data) {
+ s->ps.pps != (HEVCPPS*)s->ps.pps_list[sh->pps_id]->data) {
av_log(s->avctx, AV_LOG_ERROR, "PPS changed between slices.\n");
return AVERROR_INVALIDDATA;
}
- s->pps = (HEVCPPS*)s->pps_list[sh->pps_id]->data;
+ s->ps.pps = (HEVCPPS*)s->ps.pps_list[sh->pps_id]->data;
if (s->nal_unit_type == NAL_CRA_NUT && s->last_eos == 1)
sh->no_output_of_prior_pics_flag = 1;
- if (s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]->data) {
- const HEVCSPS* last_sps = s->sps;
- s->sps = (HEVCSPS*)s->sps_list[s->pps->sps_id]->data;
+ if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) {
+ const HEVCSPS* last_sps = s->ps.sps;
+ s->ps.sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data;
if (last_sps && IS_IRAP(s) && s->nal_unit_type != NAL_CRA_NUT) {
- if (s->sps->width != last_sps->width || s->sps->height != last_sps->height ||
- s->sps->temporal_layer[s->sps->max_sub_layers - 1].max_dec_pic_buffering !=
+ if (s->ps.sps->width != last_sps->width || s->ps.sps->height != last_sps->height ||
+ s->ps.sps->temporal_layer[s->ps.sps->max_sub_layers - 1].max_dec_pic_buffering !=
last_sps->temporal_layer[last_sps->max_sub_layers - 1].max_dec_pic_buffering)
sh->no_output_of_prior_pics_flag = 0;
}
ff_hevc_clear_refs(s);
- ret = set_sps(s, s->sps, AV_PIX_FMT_NONE);
+ ret = set_sps(s, s->ps.sps, AV_PIX_FMT_NONE);
if (ret < 0)
return ret;
@@ -451,13 +463,13 @@ static int hls_slice_header(HEVCContext *s)
if (!sh->first_slice_in_pic_flag) {
int slice_address_length;
- if (s->pps->dependent_slice_segments_enabled_flag)
+ if (s->ps.pps->dependent_slice_segments_enabled_flag)
sh->dependent_slice_segment_flag = get_bits1(gb);
- slice_address_length = av_ceil_log2(s->sps->ctb_width *
- s->sps->ctb_height);
- sh->slice_segment_addr = get_bits(gb, slice_address_length);
- if (sh->slice_segment_addr >= s->sps->ctb_width * s->sps->ctb_height) {
+ slice_address_length = av_ceil_log2(s->ps.sps->ctb_width *
+ s->ps.sps->ctb_height);
+ sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0;
+ if (sh->slice_segment_addr >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid slice segment address: %u.\n",
sh->slice_segment_addr);
@@ -477,7 +489,7 @@ static int hls_slice_header(HEVCContext *s)
if (!sh->dependent_slice_segment_flag) {
s->slice_initialized = 0;
- for (i = 0; i < s->pps->num_extra_slice_header_bits; i++)
+ for (i = 0; i < s->ps.pps->num_extra_slice_header_bits; i++)
skip_bits(gb, 1); // slice_reserved_undetermined_flag[]
sh->slice_type = get_ue_golomb_long(gb);
@@ -495,16 +507,16 @@ static int hls_slice_header(HEVCContext *s)
// when flag is not present, picture is inferred to be output
sh->pic_output_flag = 1;
- if (s->pps->output_flag_present_flag)
+ if (s->ps.pps->output_flag_present_flag)
sh->pic_output_flag = get_bits1(gb);
- if (s->sps->separate_colour_plane_flag)
+ if (s->ps.sps->separate_colour_plane_flag)
sh->colour_plane_id = get_bits(gb, 2);
if (!IS_IDR(s)) {
int poc, pos;
- sh->pic_order_cnt_lsb = get_bits(gb, s->sps->log2_max_poc_lsb);
+ sh->pic_order_cnt_lsb = get_bits(gb, s->ps.sps->log2_max_poc_lsb);
poc = ff_hevc_compute_poc(s, sh->pic_order_cnt_lsb);
if (!sh->first_slice_in_pic_flag && poc != s->poc) {
av_log(s->avctx, AV_LOG_WARNING,
@@ -518,7 +530,7 @@ static int hls_slice_header(HEVCContext *s)
sh->short_term_ref_pic_set_sps_flag = get_bits1(gb);
pos = get_bits_left(gb);
if (!sh->short_term_ref_pic_set_sps_flag) {
- ret = ff_hevc_decode_short_term_rps(s, &sh->slice_rps, s->sps, 1);
+ ret = ff_hevc_decode_short_term_rps(gb, s->avctx, &sh->slice_rps, s->ps.sps, 1);
if (ret < 0)
return ret;
@@ -526,14 +538,14 @@ static int hls_slice_header(HEVCContext *s)
} else {
int numbits, rps_idx;
- if (!s->sps->nb_st_rps) {
+ if (!s->ps.sps->nb_st_rps) {
av_log(s->avctx, AV_LOG_ERROR, "No ref lists in the SPS.\n");
return AVERROR_INVALIDDATA;
}
- numbits = av_ceil_log2(s->sps->nb_st_rps);
+ numbits = av_ceil_log2(s->ps.sps->nb_st_rps);
rps_idx = numbits > 0 ? get_bits(gb, numbits) : 0;
- sh->short_term_rps = &s->sps->st_rps[rps_idx];
+ sh->short_term_rps = &s->ps.sps->st_rps[rps_idx];
}
sh->short_term_ref_pic_set_size = pos - get_bits_left(gb);
@@ -546,7 +558,7 @@ static int hls_slice_header(HEVCContext *s)
}
sh->long_term_ref_pic_set_size = pos - get_bits_left(gb);
- if (s->sps->sps_temporal_mvp_enabled_flag)
+ if (s->ps.sps->sps_temporal_mvp_enabled_flag)
sh->slice_temporal_mvp_enabled_flag = get_bits1(gb);
else
sh->slice_temporal_mvp_enabled_flag = 0;
@@ -566,9 +578,9 @@ static int hls_slice_header(HEVCContext *s)
s->nal_unit_type != NAL_RASL_R)
s->pocTid0 = s->poc;
- if (s->sps->sao_enabled) {
+ if (s->ps.sps->sao_enabled) {
sh->slice_sample_adaptive_offset_flag[0] = get_bits1(gb);
- if (s->sps->chroma_format_idc) {
+ if (s->ps.sps->chroma_format_idc) {
sh->slice_sample_adaptive_offset_flag[1] =
sh->slice_sample_adaptive_offset_flag[2] = get_bits1(gb);
}
@@ -582,9 +594,9 @@ static int hls_slice_header(HEVCContext *s)
if (sh->slice_type == P_SLICE || sh->slice_type == B_SLICE) {
int nb_refs;
- sh->nb_refs[L0] = s->pps->num_ref_idx_l0_default_active;
+ sh->nb_refs[L0] = s->ps.pps->num_ref_idx_l0_default_active;
if (sh->slice_type == B_SLICE)
- sh->nb_refs[L1] = s->pps->num_ref_idx_l1_default_active;
+ sh->nb_refs[L1] = s->ps.pps->num_ref_idx_l1_default_active;
if (get_bits1(gb)) { // num_ref_idx_active_override_flag
sh->nb_refs[L0] = get_ue_golomb_long(gb) + 1;
@@ -605,7 +617,7 @@ static int hls_slice_header(HEVCContext *s)
return AVERROR_INVALIDDATA;
}
- if (s->pps->lists_modification_present_flag && nb_refs > 1) {
+ if (s->ps.pps->lists_modification_present_flag && nb_refs > 1) {
sh->rpl_modification_flag[0] = get_bits1(gb);
if (sh->rpl_modification_flag[0]) {
for (i = 0; i < sh->nb_refs[L0]; i++)
@@ -623,7 +635,7 @@ static int hls_slice_header(HEVCContext *s)
if (sh->slice_type == B_SLICE)
sh->mvd_l1_zero_flag = get_bits1(gb);
- if (s->pps->cabac_init_present_flag)
+ if (s->ps.pps->cabac_init_present_flag)
sh->cabac_init_flag = get_bits1(gb);
else
sh->cabac_init_flag = 0;
@@ -645,8 +657,8 @@ static int hls_slice_header(HEVCContext *s)
}
}
- if ((s->pps->weighted_pred_flag && sh->slice_type == P_SLICE) ||
- (s->pps->weighted_bipred_flag && sh->slice_type == B_SLICE)) {
+ if ((s->ps.pps->weighted_pred_flag && sh->slice_type == P_SLICE) ||
+ (s->ps.pps->weighted_bipred_flag && sh->slice_type == B_SLICE)) {
pred_weight_table(s, gb);
}
@@ -661,7 +673,7 @@ static int hls_slice_header(HEVCContext *s)
sh->slice_qp_delta = get_se_golomb(gb);
- if (s->pps->pic_slice_level_chroma_qp_offsets_present_flag) {
+ if (s->ps.pps->pic_slice_level_chroma_qp_offsets_present_flag) {
sh->slice_cb_qp_offset = get_se_golomb(gb);
sh->slice_cr_qp_offset = get_se_golomb(gb);
} else {
@@ -669,15 +681,15 @@ static int hls_slice_header(HEVCContext *s)
sh->slice_cr_qp_offset = 0;
}
- if (s->pps->chroma_qp_offset_list_enabled_flag)
+ if (s->ps.pps->chroma_qp_offset_list_enabled_flag)
sh->cu_chroma_qp_offset_enabled_flag = get_bits1(gb);
else
sh->cu_chroma_qp_offset_enabled_flag = 0;
- if (s->pps->deblocking_filter_control_present_flag) {
+ if (s->ps.pps->deblocking_filter_control_present_flag) {
int deblocking_filter_override_flag = 0;
- if (s->pps->deblocking_filter_override_enabled_flag)
+ if (s->ps.pps->deblocking_filter_override_enabled_flag)
deblocking_filter_override_flag = get_bits1(gb);
if (deblocking_filter_override_flag) {
@@ -687,9 +699,9 @@ static int hls_slice_header(HEVCContext *s)
sh->tc_offset = get_se_golomb(gb) * 2;
}
} else {
- sh->disable_deblocking_filter_flag = s->pps->disable_dbf;
- sh->beta_offset = s->pps->beta_offset;
- sh->tc_offset = s->pps->tc_offset;
+ sh->disable_deblocking_filter_flag = s->ps.pps->disable_dbf;
+ sh->beta_offset = s->ps.pps->beta_offset;
+ sh->tc_offset = s->ps.pps->tc_offset;
}
} else {
sh->disable_deblocking_filter_flag = 0;
@@ -697,13 +709,13 @@ static int hls_slice_header(HEVCContext *s)
sh->tc_offset = 0;
}
- if (s->pps->seq_loop_filter_across_slices_enabled_flag &&
+ if (s->ps.pps->seq_loop_filter_across_slices_enabled_flag &&
(sh->slice_sample_adaptive_offset_flag[0] ||
sh->slice_sample_adaptive_offset_flag[1] ||
!sh->disable_deblocking_filter_flag)) {
sh->slice_loop_filter_across_slices_enabled_flag = get_bits1(gb);
} else {
- sh->slice_loop_filter_across_slices_enabled_flag = s->pps->seq_loop_filter_across_slices_enabled_flag;
+ sh->slice_loop_filter_across_slices_enabled_flag = s->ps.pps->seq_loop_filter_across_slices_enabled_flag;
}
} else if (!s->slice_initialized) {
av_log(s->avctx, AV_LOG_ERROR, "Independent slice segment missing.\n");
@@ -711,7 +723,7 @@ static int hls_slice_header(HEVCContext *s)
}
sh->num_entry_point_offsets = 0;
- if (s->pps->tiles_enabled_flag || s->pps->entropy_coding_sync_enabled_flag) {
+ if (s->ps.pps->tiles_enabled_flag || s->ps.pps->entropy_coding_sync_enabled_flag) {
unsigned num_entry_point_offsets = get_ue_golomb_long(gb);
// It would be possible to bound this tighter but this here is simpler
if (num_entry_point_offsets > get_bits_left(gb)) {
@@ -744,7 +756,7 @@ static int hls_slice_header(HEVCContext *s)
unsigned val = get_bits_long(gb, offset_len);
sh->entry_point_offset[i] = val + 1; // +1; // +1 to get the size
}
- if (s->threads_number > 1 && (s->pps->num_tile_rows > 1 || s->pps->num_tile_columns > 1)) {
+ if (s->threads_number > 1 && (s->ps.pps->num_tile_rows > 1 || s->ps.pps->num_tile_columns > 1)) {
s->enable_parallel_tiles = 0; // TODO: you can enable tiles in parallel here
s->threads_number = 1;
} else
@@ -753,7 +765,7 @@ static int hls_slice_header(HEVCContext *s)
s->enable_parallel_tiles = 0;
}
- if (s->pps->slice_header_extension_present_flag) {
+ if (s->ps.pps->slice_header_extension_present_flag) {
unsigned int length = get_ue_golomb_long(gb);
if (length*8LL > get_bits_left(gb)) {
av_log(s->avctx, AV_LOG_ERROR, "too many slice_header_extension_data_bytes\n");
@@ -764,14 +776,14 @@ static int hls_slice_header(HEVCContext *s)
}
// Inferred parameters
- sh->slice_qp = 26U + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta;
+ sh->slice_qp = 26U + s->ps.pps->pic_init_qp_minus26 + sh->slice_qp_delta;
if (sh->slice_qp > 51 ||
- sh->slice_qp < -s->sps->qp_bd_offset) {
+ sh->slice_qp < -s->ps.sps->qp_bd_offset) {
av_log(s->avctx, AV_LOG_ERROR,
"The slice_qp %d is outside the valid range "
"[%d, 51].\n",
sh->slice_qp,
- -s->sps->qp_bd_offset);
+ -s->ps.sps->qp_bd_offset);
return AVERROR_INVALIDDATA;
}
@@ -790,7 +802,7 @@ static int hls_slice_header(HEVCContext *s)
s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag;
- if (!s->pps->cu_qp_delta_enabled_flag)
+ if (!s->ps.pps->cu_qp_delta_enabled_flag)
s->HEVClc->qp_y = s->sh.slice_qp;
s->slice_initialized = 1;
@@ -800,7 +812,7 @@ static int hls_slice_header(HEVCContext *s)
return 0;
}
-#define CTB(tab, x, y) ((tab)[(y) * s->sps->ctb_width + (x)])
+#define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)])
#define SET_SAO(elem, value) \
do { \
@@ -834,9 +846,9 @@ static void hls_sao_param(HEVCContext *s, int rx, int ry)
}
}
- for (c_idx = 0; c_idx < (s->sps->chroma_format_idc ? 3 : 1); c_idx++) {
- int log2_sao_offset_scale = c_idx == 0 ? s->pps->log2_sao_offset_scale_luma :
- s->pps->log2_sao_offset_scale_chroma;
+ for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) {
+ int log2_sao_offset_scale = c_idx == 0 ? s->ps.pps->log2_sao_offset_scale_luma :
+ s->ps.pps->log2_sao_offset_scale_chroma;
if (!s->sh.slice_sample_adaptive_offset_flag[c_idx]) {
sao->type_idx[c_idx] = SAO_NOT_APPLIED;
@@ -910,7 +922,7 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
int blk_idx, int cbf_luma, int *cbf_cb, int *cbf_cr)
{
HEVCLocalContext *lc = s->HEVClc;
- const int log2_trafo_size_c = log2_trafo_size - s->sps->hshift[1];
+ const int log2_trafo_size_c = log2_trafo_size - s->ps.sps->hshift[1];
int i;
if (lc->cu.pred_mode == MODE_INTRA) {
@@ -921,28 +933,28 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
}
if (cbf_luma || cbf_cb[0] || cbf_cr[0] ||
- (s->sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) {
+ (s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) {
int scan_idx = SCAN_DIAG;
int scan_idx_c = SCAN_DIAG;
int cbf_chroma = cbf_cb[0] || cbf_cr[0] ||
- (s->sps->chroma_format_idc == 2 &&
+ (s->ps.sps->chroma_format_idc == 2 &&
(cbf_cb[1] || cbf_cr[1]));
- if (s->pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) {
+ if (s->ps.pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) {
lc->tu.cu_qp_delta = ff_hevc_cu_qp_delta_abs(s);
if (lc->tu.cu_qp_delta != 0)
if (ff_hevc_cu_qp_delta_sign_flag(s) == 1)
lc->tu.cu_qp_delta = -lc->tu.cu_qp_delta;
lc->tu.is_cu_qp_delta_coded = 1;
- if (lc->tu.cu_qp_delta < -(26 + s->sps->qp_bd_offset / 2) ||
- lc->tu.cu_qp_delta > (25 + s->sps->qp_bd_offset / 2)) {
+ if (lc->tu.cu_qp_delta < -(26 + s->ps.sps->qp_bd_offset / 2) ||
+ lc->tu.cu_qp_delta > (25 + s->ps.sps->qp_bd_offset / 2)) {
av_log(s->avctx, AV_LOG_ERROR,
"The cu_qp_delta %d is outside the valid range "
"[%d, %d].\n",
lc->tu.cu_qp_delta,
- -(26 + s->sps->qp_bd_offset / 2),
- (25 + s->sps->qp_bd_offset / 2));
+ -(26 + s->ps.sps->qp_bd_offset / 2),
+ (25 + s->ps.sps->qp_bd_offset / 2));
return AVERROR_INVALIDDATA;
}
@@ -954,13 +966,13 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
int cu_chroma_qp_offset_flag = ff_hevc_cu_chroma_qp_offset_flag(s);
if (cu_chroma_qp_offset_flag) {
int cu_chroma_qp_offset_idx = 0;
- if (s->pps->chroma_qp_offset_list_len_minus1 > 0) {
+ if (s->ps.pps->chroma_qp_offset_list_len_minus1 > 0) {
cu_chroma_qp_offset_idx = ff_hevc_cu_chroma_qp_offset_idx(s);
av_log(s->avctx, AV_LOG_ERROR,
"cu_chroma_qp_offset_idx not yet tested.\n");
}
- lc->tu.cu_qp_offset_cb = s->pps->cb_qp_offset_list[cu_chroma_qp_offset_idx];
- lc->tu.cu_qp_offset_cr = s->pps->cr_qp_offset_list[cu_chroma_qp_offset_idx];
+ lc->tu.cu_qp_offset_cb = s->ps.pps->cb_qp_offset_list[cu_chroma_qp_offset_idx];
+ lc->tu.cu_qp_offset_cr = s->ps.pps->cr_qp_offset_list[cu_chroma_qp_offset_idx];
} else {
lc->tu.cu_qp_offset_cb = 0;
lc->tu.cu_qp_offset_cr = 0;
@@ -990,17 +1002,17 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
if (cbf_luma)
ff_hevc_hls_residual_coding(s, x0, y0, log2_trafo_size, scan_idx, 0);
- if (s->sps->chroma_format_idc && (log2_trafo_size > 2 || s->sps->chroma_format_idc == 3)) {
- int trafo_size_h = 1 << (log2_trafo_size_c + s->sps->hshift[1]);
- int trafo_size_v = 1 << (log2_trafo_size_c + s->sps->vshift[1]);
- lc->tu.cross_pf = (s->pps->cross_component_prediction_enabled_flag && cbf_luma &&
+ if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) {
+ int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]);
+ int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]);
+ lc->tu.cross_pf = (s->ps.pps->cross_component_prediction_enabled_flag && cbf_luma &&
(lc->cu.pred_mode == MODE_INTER ||
(lc->tu.chroma_mode_c == 4)));
if (lc->tu.cross_pf) {
hls_cross_component_pred(s, 0);
}
- for (i = 0; i < (s->sps->chroma_format_idc == 2 ? 2 : 1); i++) {
+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) {
if (lc->cu.pred_mode == MODE_INTRA) {
ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 1);
@@ -1011,14 +1023,14 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
else
if (lc->tu.cross_pf) {
ptrdiff_t stride = s->frame->linesize[1];
- int hshift = s->sps->hshift[1];
- int vshift = s->sps->vshift[1];
+ int hshift = s->ps.sps->hshift[1];
+ int vshift = s->ps.sps->vshift[1];
int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer;
int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2;
int size = 1 << log2_trafo_size_c;
uint8_t *dst = &s->frame->data[1][(y0 >> vshift) * stride +
- ((x0 >> hshift) << s->sps->pixel_shift)];
+ ((x0 >> hshift) << s->ps.sps->pixel_shift)];
for (i = 0; i < (size * size); i++) {
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
}
@@ -1029,7 +1041,7 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
if (lc->tu.cross_pf) {
hls_cross_component_pred(s, 1);
}
- for (i = 0; i < (s->sps->chroma_format_idc == 2 ? 2 : 1); i++) {
+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) {
if (lc->cu.pred_mode == MODE_INTRA) {
ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 2);
@@ -1040,24 +1052,24 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
else
if (lc->tu.cross_pf) {
ptrdiff_t stride = s->frame->linesize[2];
- int hshift = s->sps->hshift[2];
- int vshift = s->sps->vshift[2];
+ int hshift = s->ps.sps->hshift[2];
+ int vshift = s->ps.sps->vshift[2];
int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer;
int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2;
int size = 1 << log2_trafo_size_c;
uint8_t *dst = &s->frame->data[2][(y0 >> vshift) * stride +
- ((x0 >> hshift) << s->sps->pixel_shift)];
+ ((x0 >> hshift) << s->ps.sps->pixel_shift)];
for (i = 0; i < (size * size); i++) {
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
}
s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride);
}
}
- } else if (s->sps->chroma_format_idc && blk_idx == 3) {
+ } else if (s->ps.sps->chroma_format_idc && blk_idx == 3) {
int trafo_size_h = 1 << (log2_trafo_size + 1);
- int trafo_size_v = 1 << (log2_trafo_size + s->sps->vshift[1]);
- for (i = 0; i < (s->sps->chroma_format_idc == 2 ? 2 : 1); i++) {
+ int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]);
+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) {
if (lc->cu.pred_mode == MODE_INTRA) {
ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size),
trafo_size_h, trafo_size_v);
@@ -1067,7 +1079,7 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
ff_hevc_hls_residual_coding(s, xBase, yBase + (i << log2_trafo_size),
log2_trafo_size, scan_idx_c, 1);
}
- for (i = 0; i < (s->sps->chroma_format_idc == 2 ? 2 : 1); i++) {
+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) {
if (lc->cu.pred_mode == MODE_INTRA) {
ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size),
trafo_size_h, trafo_size_v);
@@ -1078,14 +1090,14 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
log2_trafo_size, scan_idx_c, 2);
}
}
- } else if (s->sps->chroma_format_idc && lc->cu.pred_mode == MODE_INTRA) {
- if (log2_trafo_size > 2 || s->sps->chroma_format_idc == 3) {
- int trafo_size_h = 1 << (log2_trafo_size_c + s->sps->hshift[1]);
- int trafo_size_v = 1 << (log2_trafo_size_c + s->sps->vshift[1]);
+ } else if (s->ps.sps->chroma_format_idc && lc->cu.pred_mode == MODE_INTRA) {
+ if (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3) {
+ int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]);
+ int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]);
ff_hevc_set_neighbour_available(s, x0, y0, trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 1);
s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 2);
- if (s->sps->chroma_format_idc == 2) {
+ if (s->ps.sps->chroma_format_idc == 2) {
ff_hevc_set_neighbour_available(s, x0, y0 + (1 << log2_trafo_size_c),
trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (1 << log2_trafo_size_c), 1);
@@ -1093,12 +1105,12 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
}
} else if (blk_idx == 3) {
int trafo_size_h = 1 << (log2_trafo_size + 1);
- int trafo_size_v = 1 << (log2_trafo_size + s->sps->vshift[1]);
+ int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]);
ff_hevc_set_neighbour_available(s, xBase, yBase,
trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 1);
s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 2);
- if (s->sps->chroma_format_idc == 2) {
+ if (s->ps.sps->chroma_format_idc == 2) {
ff_hevc_set_neighbour_available(s, xBase, yBase + (1 << (log2_trafo_size)),
trafo_size_h, trafo_size_v);
s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (1 << (log2_trafo_size)), 1);
@@ -1113,11 +1125,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size)
{
int cb_size = 1 << log2_cb_size;
- int log2_min_pu_size = s->sps->log2_min_pu_size;
+ int log2_min_pu_size = s->ps.sps->log2_min_pu_size;
- int min_pu_width = s->sps->min_pu_width;
- int x_end = FFMIN(x0 + cb_size, s->sps->width);
- int y_end = FFMIN(y0 + cb_size, s->sps->height);
+ int min_pu_width = s->ps.sps->min_pu_width;
+ int x_end = FFMIN(x0 + cb_size, s->ps.sps->width);
+ int y_end = FFMIN(y0 + cb_size, s->ps.sps->height);
int i, j;
for (j = (y0 >> log2_min_pu_size); j < (y_end >> log2_min_pu_size); j++)
@@ -1145,7 +1157,7 @@ static int hls_transform_tree(HEVCContext *s, int x0, int y0,
if (lc->cu.intra_split_flag) {
if (trafo_depth == 1) {
lc->tu.intra_pred_mode = lc->pu.intra_pred_mode[blk_idx];
- if (s->sps->chroma_format_idc == 3) {
+ if (s->ps.sps->chroma_format_idc == 3) {
lc->tu.intra_pred_mode_c = lc->pu.intra_pred_mode_c[blk_idx];
lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[blk_idx];
} else {
@@ -1159,33 +1171,33 @@ static int hls_transform_tree(HEVCContext *s, int x0, int y0,
lc->tu.chroma_mode_c = lc->pu.chroma_mode_c[0];
}
- if (log2_trafo_size <= s->sps->log2_max_trafo_size &&
- log2_trafo_size > s->sps->log2_min_tb_size &&
+ if (log2_trafo_size <= s->ps.sps->log2_max_trafo_size &&
+ log2_trafo_size > s->ps.sps->log2_min_tb_size &&
trafo_depth < lc->cu.max_trafo_depth &&
!(lc->cu.intra_split_flag && trafo_depth == 0)) {
split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
} else {
- int inter_split = s->sps->max_transform_hierarchy_depth_inter == 0 &&
+ int inter_split = s->ps.sps->max_transform_hierarchy_depth_inter == 0 &&
lc->cu.pred_mode == MODE_INTER &&
lc->cu.part_mode != PART_2Nx2N &&
trafo_depth == 0;
- split_transform_flag = log2_trafo_size > s->sps->log2_max_trafo_size ||
+ split_transform_flag = log2_trafo_size > s->ps.sps->log2_max_trafo_size ||
(lc->cu.intra_split_flag && trafo_depth == 0) ||
inter_split;
}
- if (s->sps->chroma_format_idc && (log2_trafo_size > 2 || s->sps->chroma_format_idc == 3)) {
+ if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) {
if (trafo_depth == 0 || cbf_cb[0]) {
cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
- if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
+ if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
}
if (trafo_depth == 0 || cbf_cr[0]) {
cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
- if (s->sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
+ if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) {
cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
}
@@ -1212,14 +1224,14 @@ do {
#undef SUBDIVIDE
} else {
- int min_tu_size = 1 << s->sps->log2_min_tb_size;
- int log2_min_tu_size = s->sps->log2_min_tb_size;
- int min_tu_width = s->sps->min_tb_width;
+ int min_tu_size = 1 << s->ps.sps->log2_min_tb_size;
+ int log2_min_tu_size = s->ps.sps->log2_min_tb_size;
+ int min_tu_width = s->ps.sps->min_tb_width;
int cbf_luma = 1;
if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 ||
cbf_cb[0] || cbf_cr[0] ||
- (s->sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) {
+ (s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) {
cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
}
@@ -1240,7 +1252,7 @@ do {
}
if (!s->sh.disable_deblocking_filter_flag) {
ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size);
- if (s->pps->transquant_bypass_enable_flag &&
+ if (s->ps.pps->transquant_bypass_enable_flag &&
lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_trafo_size);
}
@@ -1254,16 +1266,16 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
GetBitContext gb;
int cb_size = 1 << log2_cb_size;
int stride0 = s->frame->linesize[0];
- uint8_t *dst0 = &s->frame->data[0][y0 * stride0 + (x0 << s->sps->pixel_shift)];
+ uint8_t *dst0 = &s->frame->data[0][y0 * stride0 + (x0 << s->ps.sps->pixel_shift)];
int stride1 = s->frame->linesize[1];
- uint8_t *dst1 = &s->frame->data[1][(y0 >> s->sps->vshift[1]) * stride1 + ((x0 >> s->sps->hshift[1]) << s->sps->pixel_shift)];
+ uint8_t *dst1 = &s->frame->data[1][(y0 >> s->ps.sps->vshift[1]) * stride1 + ((x0 >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)];
int stride2 = s->frame->linesize[2];
- uint8_t *dst2 = &s->frame->data[2][(y0 >> s->sps->vshift[2]) * stride2 + ((x0 >> s->sps->hshift[2]) << s->sps->pixel_shift)];
+ uint8_t *dst2 = &s->frame->data[2][(y0 >> s->ps.sps->vshift[2]) * stride2 + ((x0 >> s->ps.sps->hshift[2]) << s->ps.sps->pixel_shift)];
- int length = cb_size * cb_size * s->sps->pcm.bit_depth +
- (((cb_size >> s->sps->hshift[1]) * (cb_size >> s->sps->vshift[1])) +
- ((cb_size >> s->sps->hshift[2]) * (cb_size >> s->sps->vshift[2]))) *
- s->sps->pcm.bit_depth_chroma;
+ int length = cb_size * cb_size * s->ps.sps->pcm.bit_depth +
+ (((cb_size >> s->ps.sps->hshift[1]) * (cb_size >> s->ps.sps->vshift[1])) +
+ ((cb_size >> s->ps.sps->hshift[2]) * (cb_size >> s->ps.sps->vshift[2]))) *
+ s->ps.sps->pcm.bit_depth_chroma;
const uint8_t *pcm = skip_bytes(&lc->cc, (length + 7) >> 3);
int ret;
@@ -1274,16 +1286,16 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
if (ret < 0)
return ret;
- s->hevcdsp.put_pcm(dst0, stride0, cb_size, cb_size, &gb, s->sps->pcm.bit_depth);
- if (s->sps->chroma_format_idc) {
+ s->hevcdsp.put_pcm(dst0, stride0, cb_size, cb_size, &gb, s->ps.sps->pcm.bit_depth);
+ if (s->ps.sps->chroma_format_idc) {
s->hevcdsp.put_pcm(dst1, stride1,
- cb_size >> s->sps->hshift[1],
- cb_size >> s->sps->vshift[1],
- &gb, s->sps->pcm.bit_depth_chroma);
+ cb_size >> s->ps.sps->hshift[1],
+ cb_size >> s->ps.sps->vshift[1],
+ &gb, s->ps.sps->pcm.bit_depth_chroma);
s->hevcdsp.put_pcm(dst2, stride2,
- cb_size >> s->sps->hshift[2],
- cb_size >> s->sps->vshift[2],
- &gb, s->sps->pcm.bit_depth_chroma);
+ cb_size >> s->ps.sps->hshift[2],
+ cb_size >> s->ps.sps->vshift[2],
+ &gb, s->ps.sps->pcm.bit_depth_chroma);
}
return 0;
@@ -1312,24 +1324,24 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
HEVCLocalContext *lc = s->HEVClc;
uint8_t *src = ref->data[0];
ptrdiff_t srcstride = ref->linesize[0];
- int pic_width = s->sps->width;
- int pic_height = s->sps->height;
+ int pic_width = s->ps.sps->width;
+ int pic_height = s->ps.sps->height;
int mx = mv->x & 3;
int my = mv->y & 3;
- int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag);
int idx = ff_hevc_pel_weight[block_w];
x_off += mv->x >> 2;
y_off += mv->y >> 2;
- src += y_off * srcstride + x_off * (1 << s->sps->pixel_shift);
+ src += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift));
if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
- int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * srcstride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,
edge_emu_stride, srcstride,
@@ -1373,29 +1385,29 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
HEVCLocalContext *lc = s->HEVClc;
ptrdiff_t src0stride = ref0->linesize[0];
ptrdiff_t src1stride = ref1->linesize[0];
- int pic_width = s->sps->width;
- int pic_height = s->sps->height;
+ int pic_width = s->ps.sps->width;
+ int pic_height = s->ps.sps->height;
int mx0 = mv0->x & 3;
int my0 = mv0->y & 3;
int mx1 = mv1->x & 3;
int my1 = mv1->y & 3;
- int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag);
int x_off0 = x_off + (mv0->x >> 2);
int y_off0 = y_off + (mv0->y >> 2);
int x_off1 = x_off + (mv1->x >> 2);
int y_off1 = y_off + (mv1->y >> 2);
int idx = ff_hevc_pel_weight[block_w];
- uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->sps->pixel_shift);
- uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->sps->pixel_shift);
+ uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift);
+ uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift);
if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER ||
x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
- int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * src0stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset,
edge_emu_stride, src0stride,
@@ -1410,9 +1422,9 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER ||
x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
y_off1 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
- int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->sps->pixel_shift);
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset = QPEL_EXTRA_BEFORE * src1stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
+ int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + (QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src1 - offset,
edge_emu_stride, src1stride,
@@ -1462,14 +1474,14 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset)
{
HEVCLocalContext *lc = s->HEVClc;
- int pic_width = s->sps->width >> s->sps->hshift[1];
- int pic_height = s->sps->height >> s->sps->vshift[1];
+ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1];
+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1];
const Mv *mv = &current_mv->mv[reflist];
- int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag);
int idx = ff_hevc_pel_weight[block_w];
- int hshift = s->sps->hshift[1];
- int vshift = s->sps->vshift[1];
+ int hshift = s->ps.sps->hshift[1];
+ int vshift = s->ps.sps->vshift[1];
intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift);
intptr_t my = av_mod_uintp2(mv->y, 2 + vshift);
intptr_t _mx = mx << (1 - hshift);
@@ -1477,15 +1489,15 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
x_off += mv->x >> (2 + hshift);
y_off += mv->y >> (2 + vshift);
- src0 += y_off * srcstride + x_off * (1 << s->sps->pixel_shift);
+ src0 += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift));
if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||
y_off >= pic_height - block_h - EPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset0 = EPEL_EXTRA_BEFORE * (srcstride + (1 << s->sps->pixel_shift));
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset0 = EPEL_EXTRA_BEFORE * (srcstride + (1 << s->ps.sps->pixel_shift));
int buf_offset0 = EPEL_EXTRA_BEFORE *
- (edge_emu_stride + (1 << s->sps->pixel_shift));
+ (edge_emu_stride + (1 << s->ps.sps->pixel_shift));
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src0 - offset0,
edge_emu_stride, srcstride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
@@ -1530,14 +1542,14 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
uint8_t *src2 = ref1->data[cidx+1];
ptrdiff_t src1stride = ref0->linesize[cidx+1];
ptrdiff_t src2stride = ref1->linesize[cidx+1];
- int weight_flag = (s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
- (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag);
- int pic_width = s->sps->width >> s->sps->hshift[1];
- int pic_height = s->sps->height >> s->sps->vshift[1];
+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) ||
+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag);
+ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1];
+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1];
Mv *mv0 = &current_mv->mv[0];
Mv *mv1 = &current_mv->mv[1];
- int hshift = s->sps->hshift[1];
- int vshift = s->sps->vshift[1];
+ int hshift = s->ps.sps->hshift[1];
+ int vshift = s->ps.sps->vshift[1];
intptr_t mx0 = av_mod_uintp2(mv0->x, 2 + hshift);
intptr_t my0 = av_mod_uintp2(mv0->y, 2 + vshift);
@@ -1553,16 +1565,16 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
int x_off1 = x_off + (mv1->x >> (2 + hshift));
int y_off1 = y_off + (mv1->y >> (2 + vshift));
int idx = ff_hevc_pel_weight[block_w];
- src1 += y_off0 * src1stride + (int)((unsigned)x_off0 << s->sps->pixel_shift);
- src2 += y_off1 * src2stride + (int)((unsigned)x_off1 << s->sps->pixel_shift);
+ src1 += y_off0 * src1stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift);
+ src2 += y_off1 * src2stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift);
if (x_off0 < EPEL_EXTRA_BEFORE || y_off0 < EPEL_EXTRA_AFTER ||
x_off0 >= pic_width - block_w - EPEL_EXTRA_AFTER ||
y_off0 >= pic_height - block_h - EPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->sps->pixel_shift));
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->ps.sps->pixel_shift));
int buf_offset1 = EPEL_EXTRA_BEFORE *
- (edge_emu_stride + (1 << s->sps->pixel_shift));
+ (edge_emu_stride + (1 << s->ps.sps->pixel_shift));
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1,
edge_emu_stride, src1stride,
@@ -1578,10 +1590,10 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
if (x_off1 < EPEL_EXTRA_BEFORE || y_off1 < EPEL_EXTRA_AFTER ||
x_off1 >= pic_width - block_w - EPEL_EXTRA_AFTER ||
y_off1 >= pic_height - block_h - EPEL_EXTRA_AFTER) {
- const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
- int offset1 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
+ const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->ps.sps->pixel_shift;
+ int offset1 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->ps.sps->pixel_shift));
int buf_offset1 = EPEL_EXTRA_BEFORE *
- (edge_emu_stride + (1 << s->sps->pixel_shift));
+ (edge_emu_stride + (1 << s->ps.sps->pixel_shift));
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer2, src2 - offset1,
edge_emu_stride, src2stride,
@@ -1671,13 +1683,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
int log2_cb_size, int partIdx, int idx)
{
#define POS(c_idx, x, y) \
- &s->frame->data[c_idx][((y) >> s->sps->vshift[c_idx]) * s->frame->linesize[c_idx] + \
- (((x) >> s->sps->hshift[c_idx]) << s->sps->pixel_shift)]
+ &s->frame->data[c_idx][((y) >> s->ps.sps->vshift[c_idx]) * s->frame->linesize[c_idx] + \
+ (((x) >> s->ps.sps->hshift[c_idx]) << s->ps.sps->pixel_shift)]
HEVCLocalContext *lc = s->HEVClc;
int merge_idx = 0;
struct MvField current_mv = {{{ 0 }}};
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
MvField *tab_mvf = s->ref->tab_mvf;
RefPicList *refPicList = s->ref->refPicList;
@@ -1685,8 +1697,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
uint8_t *dst0 = POS(0, x0, y0);
uint8_t *dst1 = POS(1, x0, y0);
uint8_t *dst2 = POS(2, x0, y0);
- int log2_min_cb_size = s->sps->log2_min_cb_size;
- int min_cb_width = s->sps->min_cb_width;
+ int log2_min_cb_size = s->ps.sps->log2_min_cb_size;
+ int min_cb_width = s->ps.sps->min_cb_width;
int x_cb = x0 >> log2_min_cb_size;
int y_cb = y0 >> log2_min_cb_size;
int x_pu, y_pu;
@@ -1710,11 +1722,11 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
partIdx, merge_idx, &current_mv);
}
- x_pu = x0 >> s->sps->log2_min_pu_size;
- y_pu = y0 >> s->sps->log2_min_pu_size;
+ x_pu = x0 >> s->ps.sps->log2_min_pu_size;
+ y_pu = y0 >> s->ps.sps->log2_min_pu_size;
- for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
- for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
+ for (j = 0; j < nPbH >> s->ps.sps->log2_min_pu_size; j++)
+ for (i = 0; i < nPbW >> s->ps.sps->log2_min_pu_size; i++)
tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
if (current_mv.pred_flag & PF_L0) {
@@ -1731,17 +1743,17 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
}
if (current_mv.pred_flag == PF_L0) {
- int x0_c = x0 >> s->sps->hshift[1];
- int y0_c = y0 >> s->sps->vshift[1];
- int nPbW_c = nPbW >> s->sps->hshift[1];
- int nPbH_c = nPbH >> s->sps->vshift[1];
+ int x0_c = x0 >> s->ps.sps->hshift[1];
+ int y0_c = y0 >> s->ps.sps->vshift[1];
+ int nPbW_c = nPbW >> s->ps.sps->hshift[1];
+ int nPbH_c = nPbH >> s->ps.sps->vshift[1];
luma_mc_uni(s, dst0, s->frame->linesize[0], ref0->frame,
&current_mv.mv[0], x0, y0, nPbW, nPbH,
s->sh.luma_weight_l0[current_mv.ref_idx[0]],
s->sh.luma_offset_l0[current_mv.ref_idx[0]]);
- if (s->sps->chroma_format_idc) {
+ if (s->ps.sps->chroma_format_idc) {
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1],
0, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]);
@@ -1750,17 +1762,17 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]);
}
} else if (current_mv.pred_flag == PF_L1) {
- int x0_c = x0 >> s->sps->hshift[1];
- int y0_c = y0 >> s->sps->vshift[1];
- int nPbW_c = nPbW >> s->sps->hshift[1];
- int nPbH_c = nPbH >> s->sps->vshift[1];
+ int x0_c = x0 >> s->ps.sps->hshift[1];
+ int y0_c = y0 >> s->ps.sps->vshift[1];
+ int nPbW_c = nPbW >> s->ps.sps->hshift[1];
+ int nPbH_c = nPbH >> s->ps.sps->vshift[1];
luma_mc_uni(s, dst0, s->frame->linesize[0], ref1->frame,
&current_mv.mv[1], x0, y0, nPbW, nPbH,
s->sh.luma_weight_l1[current_mv.ref_idx[1]],
s->sh.luma_offset_l1[current_mv.ref_idx[1]]);
- if (s->sps->chroma_format_idc) {
+ if (s->ps.sps->chroma_format_idc) {
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1],
1, x0_c, y0_c, nPbW_c, nPbH_c, &current_mv,
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]);
@@ -1770,16 +1782,16 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]);
}
} else if (current_mv.pred_flag == PF_BI) {
- int x0_c = x0 >> s->sps->hshift[1];
- int y0_c = y0 >> s->sps->vshift[1];
- int nPbW_c = nPbW >> s->sps->hshift[1];
- int nPbH_c = nPbH >> s->sps->vshift[1];
+ int x0_c = x0 >> s->ps.sps->hshift[1];
+ int y0_c = y0 >> s->ps.sps->vshift[1];
+ int nPbW_c = nPbW >> s->ps.sps->hshift[1];
+ int nPbH_c = nPbH >> s->ps.sps->vshift[1];
luma_mc_bi(s, dst0, s->frame->linesize[0], ref0->frame,
&current_mv.mv[0], x0, y0, nPbW, nPbH,
ref1->frame, &current_mv.mv[1], &current_mv);
- if (s->sps->chroma_format_idc) {
+ if (s->ps.sps->chroma_format_idc) {
chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame,
x0_c, y0_c, nPbW_c, nPbH_c, &current_mv, 0);
@@ -1796,19 +1808,19 @@ static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size,
int prev_intra_luma_pred_flag)
{
HEVCLocalContext *lc = s->HEVClc;
- int x_pu = x0 >> s->sps->log2_min_pu_size;
- int y_pu = y0 >> s->sps->log2_min_pu_size;
- int min_pu_width = s->sps->min_pu_width;
- int size_in_pus = pu_size >> s->sps->log2_min_pu_size;
- int x0b = av_mod_uintp2(x0, s->sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, s->sps->log2_ctb_size);
+ int x_pu = x0 >> s->ps.sps->log2_min_pu_size;
+ int y_pu = y0 >> s->ps.sps->log2_min_pu_size;
+ int min_pu_width = s->ps.sps->min_pu_width;
+ int size_in_pus = pu_size >> s->ps.sps->log2_min_pu_size;
+ int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size);
+ int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size);
int cand_up = (lc->ctb_up_flag || y0b) ?
s->tab_ipm[(y_pu - 1) * min_pu_width + x_pu] : INTRA_DC;
int cand_left = (lc->ctb_left_flag || x0b) ?
s->tab_ipm[y_pu * min_pu_width + x_pu - 1] : INTRA_DC;
- int y_ctb = (y0 >> (s->sps->log2_ctb_size)) << (s->sps->log2_ctb_size);
+ int y_ctb = (y0 >> (s->ps.sps->log2_ctb_size)) << (s->ps.sps->log2_ctb_size);
MvField *tab_mvf = s->ref->tab_mvf;
int intra_pred_mode;
@@ -1875,13 +1887,13 @@ static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size,
static av_always_inline void set_ct_depth(HEVCContext *s, int x0, int y0,
int log2_cb_size, int ct_depth)
{
- int length = (1 << log2_cb_size) >> s->sps->log2_min_cb_size;
- int x_cb = x0 >> s->sps->log2_min_cb_size;
- int y_cb = y0 >> s->sps->log2_min_cb_size;
+ int length = (1 << log2_cb_size) >> s->ps.sps->log2_min_cb_size;
+ int x_cb = x0 >> s->ps.sps->log2_min_cb_size;
+ int y_cb = y0 >> s->ps.sps->log2_min_cb_size;
int y;
for (y = 0; y < length; y++)
- memset(&s->tab_ct_depth[(y_cb + y) * s->sps->min_cb_width + x_cb],
+ memset(&s->tab_ct_depth[(y_cb + y) * s->ps.sps->min_cb_width + x_cb],
ct_depth, length);
}
@@ -1918,7 +1930,7 @@ static void intra_prediction_unit(HEVCContext *s, int x0, int y0,
}
}
- if (s->sps->chroma_format_idc == 3) {
+ if (s->ps.sps->chroma_format_idc == 3) {
for (i = 0; i < side; i++) {
for (j = 0; j < side; j++) {
lc->pu.chroma_mode_c[2 * i + j] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s);
@@ -1932,7 +1944,7 @@ static void intra_prediction_unit(HEVCContext *s, int x0, int y0,
}
}
}
- } else if (s->sps->chroma_format_idc == 2) {
+ } else if (s->ps.sps->chroma_format_idc == 2) {
int mode_idx;
lc->pu.chroma_mode_c[0] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s);
if (chroma_mode != 4) {
@@ -1944,7 +1956,7 @@ static void intra_prediction_unit(HEVCContext *s, int x0, int y0,
mode_idx = lc->pu.intra_pred_mode[0];
}
lc->pu.intra_pred_mode_c[0] = tab_mode_idx[mode_idx];
- } else if (s->sps->chroma_format_idc != 0) {
+ } else if (s->ps.sps->chroma_format_idc != 0) {
chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s);
if (chroma_mode != 4) {
if (lc->pu.intra_pred_mode[0] == intra_chroma_table[chroma_mode])
@@ -1963,11 +1975,11 @@ static void intra_prediction_unit_default_value(HEVCContext *s,
{
HEVCLocalContext *lc = s->HEVClc;
int pb_size = 1 << log2_cb_size;
- int size_in_pus = pb_size >> s->sps->log2_min_pu_size;
- int min_pu_width = s->sps->min_pu_width;
+ int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size;
+ int min_pu_width = s->ps.sps->min_pu_width;
MvField *tab_mvf = s->ref->tab_mvf;
- int x_pu = x0 >> s->sps->log2_min_pu_size;
- int y_pu = y0 >> s->sps->log2_min_pu_size;
+ int x_pu = x0 >> s->ps.sps->log2_min_pu_size;
+ int y_pu = y0 >> s->ps.sps->log2_min_pu_size;
int j, k;
if (size_in_pus == 0)
@@ -1984,13 +1996,13 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
{
int cb_size = 1 << log2_cb_size;
HEVCLocalContext *lc = s->HEVClc;
- int log2_min_cb_size = s->sps->log2_min_cb_size;
+ int log2_min_cb_size = s->ps.sps->log2_min_cb_size;
int length = cb_size >> log2_min_cb_size;
- int min_cb_width = s->sps->min_cb_width;
+ int min_cb_width = s->ps.sps->min_cb_width;
int x_cb = x0 >> log2_min_cb_size;
int y_cb = y0 >> log2_min_cb_size;
int idx = log2_cb_size - 2;
- int qp_block_mask = (1<<(s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth)) - 1;
+ int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1;
int x, y, ret;
lc->cu.x = x0;
@@ -2002,7 +2014,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0;
for (x = 0; x < 4; x++)
lc->pu.intra_pred_mode[x] = 1;
- if (s->pps->transquant_bypass_enable_flag) {
+ if (s->ps.pps->transquant_bypass_enable_flag) {
lc->cu.cu_transquant_bypass_flag = ff_hevc_cu_transquant_bypass_flag_decode(s);
if (lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_cb_size);
@@ -2038,22 +2050,22 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
if (s->sh.slice_type != I_SLICE)
lc->cu.pred_mode = ff_hevc_pred_mode_decode(s);
if (lc->cu.pred_mode != MODE_INTRA ||
- log2_cb_size == s->sps->log2_min_cb_size) {
+ log2_cb_size == s->ps.sps->log2_min_cb_size) {
lc->cu.part_mode = ff_hevc_part_mode_decode(s, log2_cb_size);
lc->cu.intra_split_flag = lc->cu.part_mode == PART_NxN &&
lc->cu.pred_mode == MODE_INTRA;
}
if (lc->cu.pred_mode == MODE_INTRA) {
- if (lc->cu.part_mode == PART_2Nx2N && s->sps->pcm_enabled_flag &&
- log2_cb_size >= s->sps->pcm.log2_min_pcm_cb_size &&
- log2_cb_size <= s->sps->pcm.log2_max_pcm_cb_size) {
+ if (lc->cu.part_mode == PART_2Nx2N && s->ps.sps->pcm_enabled_flag &&
+ log2_cb_size >= s->ps.sps->pcm.log2_min_pcm_cb_size &&
+ log2_cb_size <= s->ps.sps->pcm.log2_max_pcm_cb_size) {
pcm_flag = ff_hevc_pcm_flag_decode(s);
}
if (pcm_flag) {
intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
ret = hls_pcm_sample(s, x0, y0, log2_cb_size);
- if (s->sps->pcm.loop_filter_disable_flag)
+ if (s->ps.sps->pcm.loop_filter_disable_flag)
set_deblocking_bypass(s, x0, y0, log2_cb_size);
if (ret < 0)
@@ -2110,8 +2122,8 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
if (rqt_root_cbf) {
const static int cbf[2] = { 0 };
lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ?
- s->sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
- s->sps->max_transform_hierarchy_depth_inter;
+ s->ps.sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
+ s->ps.sps->max_transform_hierarchy_depth_inter;
ret = hls_transform_tree(s, x0, y0, x0, y0, x0, y0,
log2_cb_size,
log2_cb_size, 0, 0, cbf, cbf);
@@ -2124,7 +2136,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
}
}
- if (s->pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0)
+ if (s->ps.pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0)
ff_hevc_set_qPy(s, x0, y0, log2_cb_size);
x = y_cb * min_cb_width + x_cb;
@@ -2152,26 +2164,26 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
int split_cu;
lc->ct_depth = cb_depth;
- if (x0 + cb_size <= s->sps->width &&
- y0 + cb_size <= s->sps->height &&
- log2_cb_size > s->sps->log2_min_cb_size) {
+ if (x0 + cb_size <= s->ps.sps->width &&
+ y0 + cb_size <= s->ps.sps->height &&
+ log2_cb_size > s->ps.sps->log2_min_cb_size) {
split_cu = ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0);
} else {
- split_cu = (log2_cb_size > s->sps->log2_min_cb_size);
+ split_cu = (log2_cb_size > s->ps.sps->log2_min_cb_size);
}
- if (s->pps->cu_qp_delta_enabled_flag &&
- log2_cb_size >= s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth) {
+ if (s->ps.pps->cu_qp_delta_enabled_flag &&
+ log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth) {
lc->tu.is_cu_qp_delta_coded = 0;
lc->tu.cu_qp_delta = 0;
}
if (s->sh.cu_chroma_qp_offset_enabled_flag &&
- log2_cb_size >= s->sps->log2_ctb_size - s->pps->diff_cu_chroma_qp_offset_depth) {
+ log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_chroma_qp_offset_depth) {
lc->tu.is_cu_chroma_qp_offset_coded = 0;
}
if (split_cu) {
- int qp_block_mask = (1<<(s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth)) - 1;
+ int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1;
const int cb_size_split = cb_size >> 1;
const int x1 = x0 + cb_size_split;
const int y1 = y0 + cb_size_split;
@@ -2182,18 +2194,18 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
if (more_data < 0)
return more_data;
- if (more_data && x1 < s->sps->width) {
+ if (more_data && x1 < s->ps.sps->width) {
more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1);
if (more_data < 0)
return more_data;
}
- if (more_data && y1 < s->sps->height) {
+ if (more_data && y1 < s->ps.sps->height) {
more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1);
if (more_data < 0)
return more_data;
}
- if (more_data && x1 < s->sps->width &&
- y1 < s->sps->height) {
+ if (more_data && x1 < s->ps.sps->width &&
+ y1 < s->ps.sps->height) {
more_data = hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1);
if (more_data < 0)
return more_data;
@@ -2204,8 +2216,8 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
lc->qPy_pred = lc->qp_y;
if (more_data)
- return ((x1 + cb_size_split) < s->sps->width ||
- (y1 + cb_size_split) < s->sps->height);
+ return ((x1 + cb_size_split) < s->ps.sps->width ||
+ (y1 + cb_size_split) < s->ps.sps->height);
else
return 0;
} else {
@@ -2213,11 +2225,11 @@ static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
if (ret < 0)
return ret;
if ((!((x0 + cb_size) %
- (1 << (s->sps->log2_ctb_size))) ||
- (x0 + cb_size >= s->sps->width)) &&
+ (1 << (s->ps.sps->log2_ctb_size))) ||
+ (x0 + cb_size >= s->ps.sps->width)) &&
(!((y0 + cb_size) %
- (1 << (s->sps->log2_ctb_size))) ||
- (y0 + cb_size >= s->sps->height))) {
+ (1 << (s->ps.sps->log2_ctb_size))) ||
+ (y0 + cb_size >= s->ps.sps->height))) {
int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(s);
return !end_of_slice_flag;
} else {
@@ -2232,59 +2244,59 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb,
int ctb_addr_ts)
{
HEVCLocalContext *lc = s->HEVClc;
- int ctb_size = 1 << s->sps->log2_ctb_size;
- int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
+ int ctb_size = 1 << s->ps.sps->log2_ctb_size;
+ int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts];
int ctb_addr_in_slice = ctb_addr_rs - s->sh.slice_addr;
s->tab_slice_address[ctb_addr_rs] = s->sh.slice_addr;
- if (s->pps->entropy_coding_sync_enabled_flag) {
+ if (s->ps.pps->entropy_coding_sync_enabled_flag) {
if (x_ctb == 0 && (y_ctb & (ctb_size - 1)) == 0)
lc->first_qp_group = 1;
- lc->end_of_tiles_x = s->sps->width;
- } else if (s->pps->tiles_enabled_flag) {
- if (ctb_addr_ts && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]) {
- int idxX = s->pps->col_idxX[x_ctb >> s->sps->log2_ctb_size];
- lc->end_of_tiles_x = x_ctb + (s->pps->column_width[idxX] << s->sps->log2_ctb_size);
+ lc->end_of_tiles_x = s->ps.sps->width;
+ } else if (s->ps.pps->tiles_enabled_flag) {
+ if (ctb_addr_ts && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) {
+ int idxX = s->ps.pps->col_idxX[x_ctb >> s->ps.sps->log2_ctb_size];
+ lc->end_of_tiles_x = x_ctb + (s->ps.pps->column_width[idxX] << s->ps.sps->log2_ctb_size);
lc->first_qp_group = 1;
}
} else {
- lc->end_of_tiles_x = s->sps->width;
+ lc->end_of_tiles_x = s->ps.sps->width;
}
- lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, s->sps->height);
+ lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, s->ps.sps->height);
lc->boundary_flags = 0;
- if (s->pps->tiles_enabled_flag) {
- if (x_ctb > 0 && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]])
+ if (s->ps.pps->tiles_enabled_flag) {
+ if (x_ctb > 0 && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]])
lc->boundary_flags |= BOUNDARY_LEFT_TILE;
if (x_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - 1])
lc->boundary_flags |= BOUNDARY_LEFT_SLICE;
- if (y_ctb > 0 && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]])
+ if (y_ctb > 0 && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->ps.sps->ctb_width]])
lc->boundary_flags |= BOUNDARY_UPPER_TILE;
- if (y_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - s->sps->ctb_width])
+ if (y_ctb > 0 && s->tab_slice_address[ctb_addr_rs] != s->tab_slice_address[ctb_addr_rs - s->ps.sps->ctb_width])
lc->boundary_flags |= BOUNDARY_UPPER_SLICE;
} else {
if (ctb_addr_in_slice <= 0)
lc->boundary_flags |= BOUNDARY_LEFT_SLICE;
- if (ctb_addr_in_slice < s->sps->ctb_width)
+ if (ctb_addr_in_slice < s->ps.sps->ctb_width)
lc->boundary_flags |= BOUNDARY_UPPER_SLICE;
}
lc->ctb_left_flag = ((x_ctb > 0) && (ctb_addr_in_slice > 0) && !(lc->boundary_flags & BOUNDARY_LEFT_TILE));
- lc->ctb_up_flag = ((y_ctb > 0) && (ctb_addr_in_slice >= s->sps->ctb_width) && !(lc->boundary_flags & BOUNDARY_UPPER_TILE));
- lc->ctb_up_right_flag = ((y_ctb > 0) && (ctb_addr_in_slice+1 >= s->sps->ctb_width) && (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs+1 - s->sps->ctb_width]]));
- lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0) && (ctb_addr_in_slice-1 >= s->sps->ctb_width) && (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - s->sps->ctb_width]]));
+ lc->ctb_up_flag = ((y_ctb > 0) && (ctb_addr_in_slice >= s->ps.sps->ctb_width) && !(lc->boundary_flags & BOUNDARY_UPPER_TILE));
+ lc->ctb_up_right_flag = ((y_ctb > 0) && (ctb_addr_in_slice+1 >= s->ps.sps->ctb_width) && (s->ps.pps->tile_id[ctb_addr_ts] == s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs+1 - s->ps.sps->ctb_width]]));
+ lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0) && (ctb_addr_in_slice-1 >= s->ps.sps->ctb_width) && (s->ps.pps->tile_id[ctb_addr_ts] == s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - s->ps.sps->ctb_width]]));
}
static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
{
HEVCContext *s = avctxt->priv_data;
- int ctb_size = 1 << s->sps->log2_ctb_size;
+ int ctb_size = 1 << s->ps.sps->log2_ctb_size;
int more_data = 1;
int x_ctb = 0;
int y_ctb = 0;
- int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) {
av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n");
@@ -2292,29 +2304,29 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
}
if (s->sh.dependent_slice_segment_flag) {
- int prev_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
+ int prev_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts - 1];
if (s->tab_slice_address[prev_rs] != s->sh.slice_addr) {
av_log(s->avctx, AV_LOG_ERROR, "Previous slice segment missing\n");
return AVERROR_INVALIDDATA;
}
}
- while (more_data && ctb_addr_ts < s->sps->ctb_size) {
- int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
+ while (more_data && ctb_addr_ts < s->ps.sps->ctb_size) {
+ int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts];
- x_ctb = (ctb_addr_rs % ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
- y_ctb = (ctb_addr_rs / ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
+ x_ctb = (ctb_addr_rs % ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size;
+ y_ctb = (ctb_addr_rs / ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size;
hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts);
ff_hevc_cabac_init(s, ctb_addr_ts);
- hls_sao_param(s, x_ctb >> s->sps->log2_ctb_size, y_ctb >> s->sps->log2_ctb_size);
+ hls_sao_param(s, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size);
s->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset;
s->deblock[ctb_addr_rs].tc_offset = s->sh.tc_offset;
s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag;
- more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->sps->log2_ctb_size, 0);
+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0);
if (more_data < 0) {
s->tab_slice_address[ctb_addr_rs] = -1;
return more_data;
@@ -2326,8 +2338,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size);
}
- if (x_ctb + ctb_size >= s->sps->width &&
- y_ctb + ctb_size >= s->sps->height)
+ if (x_ctb + ctb_size >= s->ps.sps->width &&
+ y_ctb + ctb_size >= s->ps.sps->height)
ff_hevc_hls_filter(s, x_ctb, y_ctb, ctb_size);
return ctb_addr_ts;
@@ -2348,12 +2360,12 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
{
HEVCContext *s1 = avctxt->priv_data, *s;
HEVCLocalContext *lc;
- int ctb_size = 1<< s1->sps->log2_ctb_size;
+ int ctb_size = 1<< s1->ps.sps->log2_ctb_size;
int more_data = 1;
int *ctb_row_p = input_ctb_row;
int ctb_row = ctb_row_p[job];
- int ctb_addr_rs = s1->sh.slice_ctb_addr_rs + ctb_row * ((s1->sps->width + ctb_size - 1) >> s1->sps->log2_ctb_size);
- int ctb_addr_ts = s1->pps->ctb_addr_rs_to_ts[ctb_addr_rs];
+ int ctb_addr_rs = s1->sh.slice_ctb_addr_rs + ctb_row * ((s1->ps.sps->width + ctb_size - 1) >> s1->ps.sps->log2_ctb_size);
+ int ctb_addr_ts = s1->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs];
int thread = ctb_row % s1->threads_number;
int ret;
@@ -2368,9 +2380,9 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
ff_init_cabac_decoder(&lc->cc, s->data + s->sh.offset[(ctb_row)-1], s->sh.size[ctb_row - 1]);
}
- while(more_data && ctb_addr_ts < s->sps->ctb_size) {
- int x_ctb = (ctb_addr_rs % s->sps->ctb_width) << s->sps->log2_ctb_size;
- int y_ctb = (ctb_addr_rs / s->sps->ctb_width) << s->sps->log2_ctb_size;
+ while(more_data && ctb_addr_ts < s->ps.sps->ctb_size) {
+ int x_ctb = (ctb_addr_rs % s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size;
+ int y_ctb = (ctb_addr_rs / s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size;
hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts);
@@ -2382,8 +2394,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
}
ff_hevc_cabac_init(s, ctb_addr_ts);
- hls_sao_param(s, x_ctb >> s->sps->log2_ctb_size, y_ctb >> s->sps->log2_ctb_size);
- more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->sps->log2_ctb_size, 0);
+ hls_sao_param(s, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size);
+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0);
if (more_data < 0) {
s->tab_slice_address[ctb_addr_rs] = -1;
@@ -2396,21 +2408,21 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
ff_thread_report_progress2(s->avctx, ctb_row, thread, 1);
ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size);
- if (!more_data && (x_ctb+ctb_size) < s->sps->width && ctb_row != s->sh.num_entry_point_offsets) {
+ if (!more_data && (x_ctb+ctb_size) < s->ps.sps->width && ctb_row != s->sh.num_entry_point_offsets) {
avpriv_atomic_int_set(&s1->wpp_err, 1);
ff_thread_report_progress2(s->avctx, ctb_row ,thread, SHIFT_CTB_WPP);
return 0;
}
- if ((x_ctb+ctb_size) >= s->sps->width && (y_ctb+ctb_size) >= s->sps->height ) {
+ if ((x_ctb+ctb_size) >= s->ps.sps->width && (y_ctb+ctb_size) >= s->ps.sps->height ) {
ff_hevc_hls_filter(s, x_ctb, y_ctb, ctb_size);
ff_thread_report_progress2(s->avctx, ctb_row , thread, SHIFT_CTB_WPP);
return ctb_addr_ts;
}
- ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
+ ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts];
x_ctb+=ctb_size;
- if(x_ctb >= s->sps->width) {
+ if(x_ctb >= s->ps.sps->width) {
break;
}
}
@@ -2419,8 +2431,10 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
return 0;
}
-static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
+static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
{
+ const uint8_t *data = nal->data;
+ int length = nal->size;
HEVCLocalContext *lc = s->HEVClc;
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
@@ -2449,8 +2463,8 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
offset = (lc->gb.index >> 3);
- for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[0]; j < s->skipped_bytes; j++) {
- if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
+ for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[0]; j < nal->skipped_bytes; j++) {
+ if (nal->skipped_bytes_pos[j] >= offset && nal->skipped_bytes_pos[j] < startheader) {
startheader--;
cmpt++;
}
@@ -2459,8 +2473,8 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
for (i = 1; i < s->sh.num_entry_point_offsets; i++) {
offset += (s->sh.entry_point_offset[i - 1] - cmpt);
for (j = 0, cmpt = 0, startheader = offset
- + s->sh.entry_point_offset[i]; j < s->skipped_bytes; j++) {
- if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
+ + s->sh.entry_point_offset[i]; j < nal->skipped_bytes; j++) {
+ if (nal->skipped_bytes_pos[j] >= offset && nal->skipped_bytes_pos[j] < startheader) {
startheader--;
cmpt++;
}
@@ -2475,7 +2489,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
}
- s->data = nal;
+ s->data = data;
for (i = 1; i < s->threads_number; i++) {
s->sList[i]->HEVClc->first_qp_group = 1;
@@ -2492,7 +2506,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
ret[i] = 0;
}
- if (s->pps->entropy_coding_sync_enabled_flag)
+ if (s->ps.pps->entropy_coding_sync_enabled_flag)
s->avctx->execute2(s->avctx, (void *) hls_decode_entry_wpp, arg, ret, s->sh.num_entry_point_offsets + 1);
for (i = 0; i <= s->sh.num_entry_point_offsets; i++)
@@ -2502,32 +2516,6 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
return res;
}
-/**
- * @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
- * 0 if the unit should be skipped, 1 otherwise
- */
-static int hls_nal_unit(HEVCContext *s)
-{
- GetBitContext *gb = &s->HEVClc->gb;
- int nuh_layer_id;
-
- if (get_bits1(gb) != 0)
- return AVERROR_INVALIDDATA;
-
- s->nal_unit_type = get_bits(gb, 6);
-
- nuh_layer_id = get_bits(gb, 6);
- s->temporal_id = get_bits(gb, 3) - 1;
- if (s->temporal_id < 0)
- return AVERROR_INVALIDDATA;
-
- av_log(s->avctx, AV_LOG_DEBUG,
- "nal_unit_type: %d, nuh_layer_id: %d, temporal_id: %d\n",
- s->nal_unit_type, nuh_layer_id, s->temporal_id);
-
- return nuh_layer_id == 0;
-}
-
static int set_side_data(HEVCContext *s)
{
AVFrame *out = s->ref->frame;
@@ -2580,21 +2568,21 @@ static int set_side_data(HEVCContext *s)
static int hevc_frame_start(HEVCContext *s)
{
HEVCLocalContext *lc = s->HEVClc;
- int pic_size_in_ctb = ((s->sps->width >> s->sps->log2_min_cb_size) + 1) *
- ((s->sps->height >> s->sps->log2_min_cb_size) + 1);
+ int pic_size_in_ctb = ((s->ps.sps->width >> s->ps.sps->log2_min_cb_size) + 1) *
+ ((s->ps.sps->height >> s->ps.sps->log2_min_cb_size) + 1);
int ret;
memset(s->horizontal_bs, 0, s->bs_width * s->bs_height);
memset(s->vertical_bs, 0, s->bs_width * s->bs_height);
- memset(s->cbf_luma, 0, s->sps->min_tb_width * s->sps->min_tb_height);
- memset(s->is_pcm, 0, (s->sps->min_pu_width + 1) * (s->sps->min_pu_height + 1));
+ memset(s->cbf_luma, 0, s->ps.sps->min_tb_width * s->ps.sps->min_tb_height);
+ memset(s->is_pcm, 0, (s->ps.sps->min_pu_width + 1) * (s->ps.sps->min_pu_height + 1));
memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address));
s->is_decoded = 0;
s->first_nal_type = s->nal_unit_type;
- if (s->pps->tiles_enabled_flag)
- lc->end_of_tiles_x = s->pps->column_width[0] << s->sps->log2_ctb_size;
+ if (s->ps.pps->tiles_enabled_flag)
+ lc->end_of_tiles_x = s->ps.pps->column_width[0] << s->ps.sps->log2_ctb_size;
ret = ff_hevc_set_new_ref(s, &s->frame, s->poc);
if (ret < 0)
@@ -2640,31 +2628,24 @@ static int decode_nal_unit(HEVCContext *s, const HEVCNAL *nal)
GetBitContext *gb = &lc->gb;
int ctb_addr_ts, ret;
- ret = init_get_bits8(gb, nal->data, nal->size);
- if (ret < 0)
- return ret;
-
- ret = hls_nal_unit(s);
- if (ret < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
- s->nal_unit_type);
- goto fail;
- } else if (!ret)
- return 0;
+ *gb = nal->gb;
+ s->nal_unit_type = nal->type;
+ s->temporal_id = nal->temporal_id;
switch (s->nal_unit_type) {
case NAL_VPS:
- ret = ff_hevc_decode_nal_vps(s);
+ ret = ff_hevc_decode_nal_vps(gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
case NAL_SPS:
- ret = ff_hevc_decode_nal_sps(s);
+ ret = ff_hevc_decode_nal_sps(gb, s->avctx, &s->ps,
+ s->apply_defdispwin);
if (ret < 0)
goto fail;
break;
case NAL_PPS:
- ret = ff_hevc_decode_nal_pps(s);
+ ret = ff_hevc_decode_nal_pps(gb, s->avctx, &s->ps);
if (ret < 0)
goto fail;
break;
@@ -2750,10 +2731,10 @@ static int decode_nal_unit(HEVCContext *s, const HEVCNAL *nal)
goto fail;
} else {
if (s->threads_number > 1 && s->sh.num_entry_point_offsets > 0)
- ctb_addr_ts = hls_slice_data_wpp(s, nal->data, nal->size);
+ ctb_addr_ts = hls_slice_data_wpp(s, nal);
else
ctb_addr_ts = hls_slice_data(s);
- if (ctb_addr_ts >= (s->sps->ctb_width * s->sps->ctb_height)) {
+ if (ctb_addr_ts >= (s->ps.sps->ctb_width * s->ps.sps->ctb_height)) {
s->is_decoded = 1;
}
@@ -2783,122 +2764,9 @@ fail:
return 0;
}
-/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
- * between these functions would be nice. */
-int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
- HEVCNAL *nal)
-{
- int i, si, di;
- uint8_t *dst;
-
- s->skipped_bytes = 0;
-#define STARTCODE_TEST \
- if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
- if (src[i + 2] != 3) { \
- /* startcode, so we must be past the end */ \
- length = i; \
- } \
- break; \
- }
-#if HAVE_FAST_UNALIGNED
-#define FIND_FIRST_ZERO \
- if (i > 0 && !src[i]) \
- i--; \
- while (src[i]) \
- i++
-#if HAVE_FAST_64BIT
- for (i = 0; i + 1 < length; i += 9) {
- if (!((~AV_RN64A(src + i) &
- (AV_RN64A(src + i) - 0x0100010001000101ULL)) &
- 0x8000800080008080ULL))
- continue;
- FIND_FIRST_ZERO;
- STARTCODE_TEST;
- i -= 7;
- }
-#else
- for (i = 0; i + 1 < length; i += 5) {
- if (!((~AV_RN32A(src + i) &
- (AV_RN32A(src + i) - 0x01000101U)) &
- 0x80008080U))
- continue;
- FIND_FIRST_ZERO;
- STARTCODE_TEST;
- i -= 3;
- }
-#endif /* HAVE_FAST_64BIT */
-#else
- for (i = 0; i + 1 < length; i += 2) {
- if (src[i])
- continue;
- if (i > 0 && src[i - 1] == 0)
- i--;
- STARTCODE_TEST;
- }
-#endif /* HAVE_FAST_UNALIGNED */
-
- if (i >= length - 1) { // no escaped 0
- nal->data =
- nal->raw_data = src;
- nal->size =
- nal->raw_size = length;
- return length;
- }
-
- av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
- length + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!nal->rbsp_buffer)
- return AVERROR(ENOMEM);
-
- dst = nal->rbsp_buffer;
-
- memcpy(dst, src, i);
- si = di = i;
- while (si + 2 < length) {
- // remove escapes (very rare 1:2^22)
- if (src[si + 2] > 3) {
- dst[di++] = src[si++];
- dst[di++] = src[si++];
- } else if (src[si] == 0 && src[si + 1] == 0) {
- if (src[si + 2] == 3) { // escape
- dst[di++] = 0;
- dst[di++] = 0;
- si += 3;
-
- s->skipped_bytes++;
- if (s->skipped_bytes_pos_size < s->skipped_bytes) {
- s->skipped_bytes_pos_size *= 2;
- av_reallocp_array(&s->skipped_bytes_pos,
- s->skipped_bytes_pos_size,
- sizeof(*s->skipped_bytes_pos));
- if (!s->skipped_bytes_pos)
- return AVERROR(ENOMEM);
- }
- if (s->skipped_bytes_pos)
- s->skipped_bytes_pos[s->skipped_bytes-1] = di - 1;
- continue;
- } else // next start code
- goto nsc;
- }
-
- dst[di++] = src[si++];
- }
- while (si < length)
- dst[di++] = src[si++];
-
-nsc:
- memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
- nal->data = dst;
- nal->size = di;
- nal->raw_data = src;
- nal->raw_size = si;
- return si;
-}
-
static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
{
- int i, consumed, ret = 0;
+ int i, ret = 0;
s->ref = NULL;
s->last_eos = s->eos;
@@ -2906,109 +2774,23 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
/* split the input packet into NAL units, so we know the upper bound on the
* number of slices in the frame */
- s->nb_nals = 0;
- while (length >= 4) {
- HEVCNAL *nal;
- int extract_length = 0;
-
- if (s->is_nalff) {
- int i;
- for (i = 0; i < s->nal_length_size; i++)
- extract_length = (extract_length << 8) | buf[i];
- buf += s->nal_length_size;
- length -= s->nal_length_size;
-
- if (extract_length > length) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit size.\n");
- ret = AVERROR_INVALIDDATA;
- goto fail;
- }
- } else {
- /* search start code */
- while (buf[0] != 0 || buf[1] != 0 || buf[2] != 1) {
- ++buf;
- --length;
- if (length < 4) {
- av_log(s->avctx, AV_LOG_ERROR, "No start code is found.\n");
- ret = AVERROR_INVALIDDATA;
- goto fail;
- }
- }
-
- buf += 3;
- length -= 3;
- }
-
- if (!s->is_nalff)
- extract_length = length;
-
- if (s->nals_allocated < s->nb_nals + 1) {
- int new_size = s->nals_allocated + 1;
- void *tmp = av_realloc_array(s->nals, new_size, sizeof(*s->nals));
- ret = AVERROR(ENOMEM);
- if (!tmp) {
- goto fail;
- }
- s->nals = tmp;
- memset(s->nals + s->nals_allocated, 0,
- (new_size - s->nals_allocated) * sizeof(*s->nals));
-
- tmp = av_realloc_array(s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
- if (!tmp)
- goto fail;
- s->skipped_bytes_nal = tmp;
-
- tmp = av_realloc_array(s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
- if (!tmp)
- goto fail;
- s->skipped_bytes_pos_size_nal = tmp;
-
- tmp = av_realloc_array(s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
- if (!tmp)
- goto fail;
- s->skipped_bytes_pos_nal = tmp;
-
- s->skipped_bytes_pos_size_nal[s->nals_allocated] = 1024; // initial buffer size
- s->skipped_bytes_pos_nal[s->nals_allocated] = av_malloc_array(s->skipped_bytes_pos_size_nal[s->nals_allocated], sizeof(*s->skipped_bytes_pos));
- if (!s->skipped_bytes_pos_nal[s->nals_allocated])
- goto fail;
- s->nals_allocated = new_size;
- }
- s->skipped_bytes_pos_size = s->skipped_bytes_pos_size_nal[s->nb_nals];
- s->skipped_bytes_pos = s->skipped_bytes_pos_nal[s->nb_nals];
- nal = &s->nals[s->nb_nals];
-
- consumed = ff_hevc_extract_rbsp(s, buf, extract_length, nal);
-
- s->skipped_bytes_nal[s->nb_nals] = s->skipped_bytes;
- s->skipped_bytes_pos_size_nal[s->nb_nals] = s->skipped_bytes_pos_size;
- s->skipped_bytes_pos_nal[s->nb_nals++] = s->skipped_bytes_pos;
-
-
- if (consumed < 0) {
- ret = consumed;
- goto fail;
- }
-
- ret = init_get_bits8(&s->HEVClc->gb, nal->data, nal->size);
- if (ret < 0)
- goto fail;
- hls_nal_unit(s);
+ ret = ff_hevc_split_packet(s, &s->pkt, buf, length, s->avctx, s->is_nalff,
+ s->nal_length_size);
+ if (ret < 0) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Error splitting the input into NAL units.\n");
+ return ret;
+ }
- if (s->nal_unit_type == NAL_EOB_NUT ||
- s->nal_unit_type == NAL_EOS_NUT)
+ for (i = 0; i < s->pkt.nb_nals; i++) {
+ if (s->pkt.nals[i].type == NAL_EOB_NUT ||
+ s->pkt.nals[i].type == NAL_EOS_NUT)
s->eos = 1;
-
- buf += consumed;
- length -= consumed;
}
- /* parse the NAL units */
- for (i = 0; i < s->nb_nals; i++) {
- s->skipped_bytes = s->skipped_bytes_nal[i];
- s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i];
-
- ret = decode_nal_unit(s, &s->nals[i]);
+ /* decode the NAL units */
+ for (i = 0; i < s->pkt.nb_nals; i++) {
+ ret = decode_nal_unit(s, &s->pkt.nals[i]);
if (ret < 0) {
av_log(s->avctx, AV_LOG_WARNING,
"Error parsing NAL unit #%d.\n", i);
@@ -3039,7 +2821,7 @@ static int verify_md5(HEVCContext *s, AVFrame *frame)
if (!desc)
return AVERROR(EINVAL);
- pixel_shift = desc->comp[0].depth_minus1 > 7;
+ pixel_shift = desc->comp[0].depth > 8;
av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ",
s->poc);
@@ -3117,9 +2899,12 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output,
return ret;
if (avctx->hwaccel) {
- if (s->ref && avctx->hwaccel->end_frame(avctx) < 0)
+ if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) {
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode picture\n");
+ ff_hevc_unref_frame(s, s->ref, ~0);
+ return ret;
+ }
} else {
/* verify the SEI checksum */
if (avctx->err_recognition & AV_EF_CRCCHECK && s->is_decoded &&
@@ -3196,13 +2981,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
av_freep(&s->md5_ctx);
- for(i=0; i < s->nals_allocated; i++) {
- av_freep(&s->skipped_bytes_pos_nal[i]);
- }
- av_freep(&s->skipped_bytes_pos_size_nal);
- av_freep(&s->skipped_bytes_nal);
- av_freep(&s->skipped_bytes_pos_nal);
-
av_freep(&s->cabac_state);
for (i = 0; i < 3; i++) {
@@ -3216,15 +2994,15 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
av_frame_free(&s->DPB[i].frame);
}
- for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++)
- av_buffer_unref(&s->vps_list[i]);
- for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++)
- av_buffer_unref(&s->sps_list[i]);
- for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++)
- av_buffer_unref(&s->pps_list[i]);
- s->sps = NULL;
- s->pps = NULL;
- s->vps = NULL;
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.vps_list); i++)
+ av_buffer_unref(&s->ps.vps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++)
+ av_buffer_unref(&s->ps.sps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.pps_list); i++)
+ av_buffer_unref(&s->ps.pps_list[i]);
+ s->ps.sps = NULL;
+ s->ps.pps = NULL;
+ s->ps.vps = NULL;
av_freep(&s->sh.entry_point_offset);
av_freep(&s->sh.offset);
@@ -3241,10 +3019,12 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
s->HEVClc = NULL;
av_freep(&s->HEVClcList[0]);
- for (i = 0; i < s->nals_allocated; i++)
- av_freep(&s->nals[i].rbsp_buffer);
- av_freep(&s->nals);
- s->nals_allocated = 0;
+ for (i = 0; i < s->pkt.nals_allocated; i++) {
+ av_freep(&s->pkt.nals[i].rbsp_buffer);
+ av_freep(&s->pkt.nals[i].skipped_bytes_pos);
+ }
+ av_freep(&s->pkt.nals);
+ s->pkt.nals_allocated = 0;
return 0;
}
@@ -3317,37 +3097,37 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
}
- if (s->sps != s0->sps)
- s->sps = NULL;
- for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++) {
- av_buffer_unref(&s->vps_list[i]);
- if (s0->vps_list[i]) {
- s->vps_list[i] = av_buffer_ref(s0->vps_list[i]);
- if (!s->vps_list[i])
+ if (s->ps.sps != s0->ps.sps)
+ s->ps.sps = NULL;
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.vps_list); i++) {
+ av_buffer_unref(&s->ps.vps_list[i]);
+ if (s0->ps.vps_list[i]) {
+ s->ps.vps_list[i] = av_buffer_ref(s0->ps.vps_list[i]);
+ if (!s->ps.vps_list[i])
return AVERROR(ENOMEM);
}
}
- for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) {
- av_buffer_unref(&s->sps_list[i]);
- if (s0->sps_list[i]) {
- s->sps_list[i] = av_buffer_ref(s0->sps_list[i]);
- if (!s->sps_list[i])
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++) {
+ av_buffer_unref(&s->ps.sps_list[i]);
+ if (s0->ps.sps_list[i]) {
+ s->ps.sps_list[i] = av_buffer_ref(s0->ps.sps_list[i]);
+ if (!s->ps.sps_list[i])
return AVERROR(ENOMEM);
}
}
- for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) {
- av_buffer_unref(&s->pps_list[i]);
- if (s0->pps_list[i]) {
- s->pps_list[i] = av_buffer_ref(s0->pps_list[i]);
- if (!s->pps_list[i])
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.pps_list); i++) {
+ av_buffer_unref(&s->ps.pps_list[i]);
+ if (s0->ps.pps_list[i]) {
+ s->ps.pps_list[i] = av_buffer_ref(s0->ps.pps_list[i]);
+ if (!s->ps.pps_list[i])
return AVERROR(ENOMEM);
}
}
- if (s->sps != s0->sps)
- if ((ret = set_sps(s, s0->sps, src->pix_fmt)) < 0)
+ if (s->ps.sps != s0->ps.sps)
+ if ((ret = set_sps(s, s0->ps.sps, src->pix_fmt)) < 0)
return ret;
s->seq_decode = s0->seq_decode;
@@ -3433,10 +3213,10 @@ static int hevc_decode_extradata(HEVCContext *s)
}
/* export stream parameters from the first SPS */
- for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) {
- if (s->sps_list[i]) {
- const HEVCSPS *sps = (const HEVCSPS*)s->sps_list[i]->data;
- export_stream_params(s->avctx, s, sps);
+ for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++) {
+ if (s->ps.sps_list[i]) {
+ const HEVCSPS *sps = (const HEVCSPS*)s->ps.sps_list[i]->data;
+ export_stream_params(s->avctx, &s->ps, sps);
break;
}
}
@@ -3541,7 +3321,7 @@ AVCodec ff_hevc_decoder = {
.flush = hevc_decode_flush,
.update_thread_context = hevc_update_thread_context,
.init_thread_copy = hevc_init_thread_copy,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
- CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
.profiles = NULL_IF_CONFIG_SMALL(profiles),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc.h b/chromium/third_party/ffmpeg/libavcodec/hevc.h
index 44c6c47a514..32d6da99681 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc.h
@@ -276,6 +276,7 @@ enum ScanType {
typedef struct ShortTermRPS {
unsigned int num_negative_pics;
int num_delta_pocs;
+ int rps_idx_num_delta_pocs;
int32_t delta_poc[32];
uint8_t used[32];
} ShortTermRPS;
@@ -557,6 +558,17 @@ typedef struct HEVCPPS {
int *min_tb_addr_zs_tab;///< MinTbAddrZS
} HEVCPPS;
+typedef struct HEVCParamSets {
+ AVBufferRef *vps_list[MAX_VPS_COUNT];
+ AVBufferRef *sps_list[MAX_SPS_COUNT];
+ AVBufferRef *pps_list[MAX_PPS_COUNT];
+
+ /* currently active parameter sets */
+ const HEVCVPS *vps;
+ const HEVCSPS *sps;
+ const HEVCPPS *pps;
+} HEVCParamSets;
+
typedef struct SliceHeader {
unsigned int pps_id;
@@ -743,8 +755,24 @@ typedef struct HEVCNAL {
int raw_size;
const uint8_t *raw_data;
+
+ GetBitContext gb;
+
+ enum NALUnitType type;
+ int temporal_id;
+
+ int skipped_bytes;
+ int skipped_bytes_pos_size;
+ int *skipped_bytes_pos;
} HEVCNAL;
+/* an input packet split into unescaped NAL units */
+typedef struct HEVCPacket {
+ HEVCNAL *nals;
+ int nb_nals;
+ int nals_allocated;
+} HEVCPacket;
+
typedef struct HEVCLocalContext {
uint8_t cabac_state[HEVC_CONTEXTS];
@@ -813,12 +841,7 @@ typedef struct HEVCContext {
uint8_t *sao_pixel_buffer_h[3];
uint8_t *sao_pixel_buffer_v[3];
- const HEVCVPS *vps;
- const HEVCSPS *sps;
- const HEVCPPS *pps;
- AVBufferRef *vps_list[MAX_VPS_COUNT];
- AVBufferRef *sps_list[MAX_SPS_COUNT];
- AVBufferRef *pps_list[MAX_PPS_COUNT];
+ HEVCParamSets ps;
AVBufferPool *tab_mvf_pool;
AVBufferPool *rpl_tab_pool;
@@ -879,19 +902,10 @@ typedef struct HEVCContext {
int enable_parallel_tiles;
int wpp_err;
- int skipped_bytes;
- int *skipped_bytes_pos;
- int skipped_bytes_pos_size;
-
- int *skipped_bytes_nal;
- int **skipped_bytes_pos_nal;
- int *skipped_bytes_pos_size_nal;
const uint8_t *data;
- HEVCNAL *nals;
- int nb_nals;
- int nals_allocated;
+ HEVCPacket pkt;
// type of the first VCL NAL of the current frame
enum NALUnitType first_nal_type;
@@ -924,15 +938,28 @@ typedef struct HEVCContext {
int picture_struct;
} HEVCContext;
-int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
- const HEVCSPS *sps, int is_slice_header);
-int ff_hevc_decode_nal_vps(HEVCContext *s);
-int ff_hevc_decode_nal_sps(HEVCContext *s);
-int ff_hevc_decode_nal_pps(HEVCContext *s);
-int ff_hevc_decode_nal_sei(HEVCContext *s);
+int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx,
+ ShortTermRPS *rps, const HEVCSPS *sps, int is_slice_header);
-int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
- HEVCNAL *nal);
+/**
+ * Parse the SPS from the bitstream into the provided HEVCSPS struct.
+ *
+ * @param sps_id the SPS id will be written here
+ * @param apply_defdispwin if set 1, the default display window from the VUI
+ * will be applied to the video dimensions
+ * @param vps_list if non-NULL, this function will validate that the SPS refers
+ * to an existing VPS
+ */
+int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
+ int apply_defdispwin, AVBufferRef **vps_list, AVCodecContext *avctx);
+
+int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps);
+int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps, int apply_defdispwin);
+int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps);
+int ff_hevc_decode_nal_sei(HEVCContext *s);
/**
* Mark all frames in DPB as unused for reference.
@@ -1038,6 +1065,21 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size);
+/**
+ * Extract the raw (unescaped) HEVC bitstream.
+ */
+int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
+ HEVCNAL *nal);
+
+/**
+ * Split an input packet into NAL units.
+ */
+int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length,
+ AVCodecContext *avctx, int is_nalff, int nal_length_size);
+
+int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
+ uint8_t *buf, int buf_size);
+
extern const uint8_t ff_hevc_qpel_extra_before[4];
extern const uint8_t ff_hevc_qpel_extra_after[4];
extern const uint8_t ff_hevc_qpel_extra[4];
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c b/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
index 3d16896b3c5..ffff87d4f0c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_cabac.c
@@ -427,20 +427,6 @@ static const uint8_t diag_scan2x2_inv[2][2] = {
{ 1, 3, },
};
-const uint8_t ff_hevc_diag_scan4x4_x[16] = {
- 0, 0, 1, 0,
- 1, 2, 0, 1,
- 2, 3, 1, 2,
- 3, 2, 3, 3,
-};
-
-const uint8_t ff_hevc_diag_scan4x4_y[16] = {
- 0, 1, 0, 2,
- 1, 0, 3, 2,
- 1, 0, 3, 2,
- 1, 3, 2, 3,
-};
-
static const uint8_t diag_scan4x4_inv[4][4] = {
{ 0, 2, 5, 9, },
{ 1, 4, 8, 12, },
@@ -448,44 +434,6 @@ static const uint8_t diag_scan4x4_inv[4][4] = {
{ 6, 10, 13, 15, },
};
-const uint8_t ff_hevc_diag_scan8x8_x[64] = {
- 0, 0, 1, 0,
- 1, 2, 0, 1,
- 2, 3, 0, 1,
- 2, 3, 4, 0,
- 1, 2, 3, 4,
- 5, 0, 1, 2,
- 3, 4, 5, 6,
- 0, 1, 2, 3,
- 4, 5, 6, 7,
- 1, 2, 3, 4,
- 5, 6, 7, 2,
- 3, 4, 5, 6,
- 7, 3, 4, 5,
- 6, 7, 4, 5,
- 6, 7, 5, 6,
- 7, 6, 7, 7,
-};
-
-const uint8_t ff_hevc_diag_scan8x8_y[64] = {
- 0, 1, 0, 2,
- 1, 0, 3, 2,
- 1, 0, 4, 3,
- 2, 1, 0, 5,
- 4, 3, 2, 1,
- 0, 6, 5, 4,
- 3, 2, 1, 0,
- 7, 6, 5, 4,
- 3, 2, 1, 0,
- 7, 6, 5, 4,
- 3, 2, 1, 7,
- 6, 5, 4, 3,
- 2, 7, 6, 5,
- 4, 3, 7, 6,
- 5, 4, 7, 6,
- 5, 7, 6, 7,
-};
-
static const uint8_t diag_scan8x8_inv[8][8] = {
{ 0, 2, 5, 9, 14, 20, 27, 35, },
{ 1, 4, 8, 13, 19, 26, 34, 42, },
@@ -499,10 +447,10 @@ static const uint8_t diag_scan8x8_inv[8][8] = {
void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts)
{
- if (s->pps->entropy_coding_sync_enabled_flag &&
- (ctb_addr_ts % s->sps->ctb_width == 2 ||
- (s->sps->ctb_width == 2 &&
- ctb_addr_ts % s->sps->ctb_width == 0))) {
+ if (s->ps.pps->entropy_coding_sync_enabled_flag &&
+ (ctb_addr_ts % s->ps.sps->ctb_width == 2 ||
+ (s->ps.sps->ctb_width == 2 &&
+ ctb_addr_ts % s->ps.sps->ctb_width == 0))) {
memcpy(s->cabac_state, s->HEVClc->cabac_state, HEVC_CONTEXTS);
}
}
@@ -553,40 +501,40 @@ static void cabac_init_state(HEVCContext *s)
void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts)
{
- if (ctb_addr_ts == s->pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) {
+ if (ctb_addr_ts == s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) {
cabac_init_decoder(s);
if (s->sh.dependent_slice_segment_flag == 0 ||
- (s->pps->tiles_enabled_flag &&
- s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]))
+ (s->ps.pps->tiles_enabled_flag &&
+ s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]))
cabac_init_state(s);
if (!s->sh.first_slice_in_pic_flag &&
- s->pps->entropy_coding_sync_enabled_flag) {
- if (ctb_addr_ts % s->sps->ctb_width == 0) {
- if (s->sps->ctb_width == 1)
+ s->ps.pps->entropy_coding_sync_enabled_flag) {
+ if (ctb_addr_ts % s->ps.sps->ctb_width == 0) {
+ if (s->ps.sps->ctb_width == 1)
cabac_init_state(s);
else if (s->sh.dependent_slice_segment_flag == 1)
load_states(s);
}
}
} else {
- if (s->pps->tiles_enabled_flag &&
- s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]) {
+ if (s->ps.pps->tiles_enabled_flag &&
+ s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) {
if (s->threads_number == 1)
cabac_reinit(s->HEVClc);
else
cabac_init_decoder(s);
cabac_init_state(s);
}
- if (s->pps->entropy_coding_sync_enabled_flag) {
- if (ctb_addr_ts % s->sps->ctb_width == 0) {
+ if (s->ps.pps->entropy_coding_sync_enabled_flag) {
+ if (ctb_addr_ts % s->ps.sps->ctb_width == 0) {
get_cabac_terminate(&s->HEVClc->cc);
if (s->threads_number == 1)
cabac_reinit(s->HEVClc);
else
cabac_init_decoder(s);
- if (s->sps->ctb_width == 1)
+ if (s->ps.sps->ctb_width == 1)
cabac_init_state(s);
else
load_states(s);
@@ -625,7 +573,7 @@ int ff_hevc_sao_band_position_decode(HEVCContext *s)
int ff_hevc_sao_offset_abs_decode(HEVCContext *s)
{
int i = 0;
- int length = (1 << (FFMIN(s->sps->bit_depth, 10) - 5)) - 1;
+ int length = (1 << (FFMIN(s->ps.sps->bit_depth, 10) - 5)) - 1;
while (i < length && get_cabac_bypass(&s->HEVClc->cc))
i++;
@@ -656,10 +604,10 @@ int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s)
int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, int x_cb, int y_cb)
{
- int min_cb_width = s->sps->min_cb_width;
+ int min_cb_width = s->ps.sps->min_cb_width;
int inc = 0;
- int x0b = av_mod_uintp2(x0, s->sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, s->sps->log2_ctb_size);
+ int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size);
+ int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size);
if (s->HEVClc->ctb_left_flag || x0b)
inc = !!SAMPLE_CTB(s->skip_flag, x_cb - 1, y_cb);
@@ -706,7 +654,7 @@ int ff_hevc_cu_chroma_qp_offset_flag(HEVCContext *s)
int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s)
{
- int c_max= FFMAX(5, s->pps->chroma_qp_offset_list_len_minus1);
+ int c_max= FFMAX(5, s->ps.pps->chroma_qp_offset_list_len_minus1);
int i = 0;
while (i < c_max && GET_CABAC(elem_offset[CU_CHROMA_QP_OFFSET_IDX]))
@@ -723,15 +671,15 @@ int ff_hevc_pred_mode_decode(HEVCContext *s)
int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, int x0, int y0)
{
int inc = 0, depth_left = 0, depth_top = 0;
- int x0b = av_mod_uintp2(x0, s->sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, s->sps->log2_ctb_size);
- int x_cb = x0 >> s->sps->log2_min_cb_size;
- int y_cb = y0 >> s->sps->log2_min_cb_size;
+ int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size);
+ int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size);
+ int x_cb = x0 >> s->ps.sps->log2_min_cb_size;
+ int y_cb = y0 >> s->ps.sps->log2_min_cb_size;
if (s->HEVClc->ctb_left_flag || x0b)
- depth_left = s->tab_ct_depth[(y_cb) * s->sps->min_cb_width + x_cb - 1];
+ depth_left = s->tab_ct_depth[(y_cb) * s->ps.sps->min_cb_width + x_cb - 1];
if (s->HEVClc->ctb_up_flag || y0b)
- depth_top = s->tab_ct_depth[(y_cb - 1) * s->sps->min_cb_width + x_cb];
+ depth_top = s->tab_ct_depth[(y_cb - 1) * s->ps.sps->min_cb_width + x_cb];
inc += (depth_left > ct_depth);
inc += (depth_top > ct_depth);
@@ -743,7 +691,7 @@ int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size)
{
if (GET_CABAC(elem_offset[PART_MODE])) // 1
return PART_2Nx2N;
- if (log2_cb_size == s->sps->log2_min_cb_size) {
+ if (log2_cb_size == s->ps.sps->log2_min_cb_size) {
if (s->HEVClc->cu.pred_mode == MODE_INTRA) // 0
return PART_NxN;
if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01
@@ -755,7 +703,7 @@ int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size)
return PART_NxN; // 000
}
- if (!s->sps->amp_enabled_flag) {
+ if (!s->ps.sps->amp_enabled_flag) {
if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01
return PART_2NxN;
return PART_Nx2N;
@@ -1075,10 +1023,10 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
const uint8_t *scan_x_cg, *scan_y_cg, *scan_x_off, *scan_y_off;
ptrdiff_t stride = s->frame->linesize[c_idx];
- int hshift = s->sps->hshift[c_idx];
- int vshift = s->sps->vshift[c_idx];
+ int hshift = s->ps.sps->hshift[c_idx];
+ int vshift = s->ps.sps->vshift[c_idx];
uint8_t *dst = &s->frame->data[c_idx][(y0 >> vshift) * stride +
- ((x0 >> hshift) << s->sps->pixel_shift)];
+ ((x0 >> hshift) << s->ps.sps->pixel_shift)];
int16_t *coeffs = (int16_t*)(c_idx ? lc->edge_emu_buffer2 : lc->edge_emu_buffer);
uint8_t significant_coeff_group_flag[8][8] = {{0}};
int explicit_rdpcm_flag = 0;
@@ -1113,25 +1061,25 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
};
int qp_y = lc->qp_y;
- if (s->pps->transform_skip_enabled_flag &&
- log2_trafo_size <= s->pps->log2_max_transform_skip_block_size) {
+ if (s->ps.pps->transform_skip_enabled_flag &&
+ log2_trafo_size <= s->ps.pps->log2_max_transform_skip_block_size) {
transform_skip_flag = hevc_transform_skip_flag_decode(s, c_idx);
}
if (c_idx == 0) {
- qp = qp_y + s->sps->qp_bd_offset;
+ qp = qp_y + s->ps.sps->qp_bd_offset;
} else {
int qp_i, offset;
if (c_idx == 1)
- offset = s->pps->cb_qp_offset + s->sh.slice_cb_qp_offset +
+ offset = s->ps.pps->cb_qp_offset + s->sh.slice_cb_qp_offset +
lc->tu.cu_qp_offset_cb;
else
- offset = s->pps->cr_qp_offset + s->sh.slice_cr_qp_offset +
+ offset = s->ps.pps->cr_qp_offset + s->sh.slice_cr_qp_offset +
lc->tu.cu_qp_offset_cr;
- qp_i = av_clip(qp_y + offset, - s->sps->qp_bd_offset, 57);
- if (s->sps->chroma_format_idc == 1) {
+ qp_i = av_clip(qp_y + offset, - s->ps.sps->qp_bd_offset, 57);
+ if (s->ps.sps->chroma_format_idc == 1) {
if (qp_i < 30)
qp = qp_i;
else if (qp_i > 43)
@@ -1145,18 +1093,18 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
qp = qp_i;
}
- qp += s->sps->qp_bd_offset;
+ qp += s->ps.sps->qp_bd_offset;
}
- shift = s->sps->bit_depth + log2_trafo_size - 5;
+ shift = s->ps.sps->bit_depth + log2_trafo_size - 5;
add = 1 << (shift-1);
scale = level_scale[rem6[qp]] << (div6[qp]);
scale_m = 16; // default when no custom scaling lists.
dc_scale = 16;
- if (s->sps->scaling_list_enable_flag && !(transform_skip_flag && log2_trafo_size > 2)) {
- const ScalingList *sl = s->pps->scaling_list_data_present_flag ?
- &s->pps->scaling_list : &s->sps->scaling_list;
+ if (s->ps.sps->scaling_list_enable_flag && !(transform_skip_flag && log2_trafo_size > 2)) {
+ const ScalingList *sl = s->ps.pps->scaling_list_data_present_flag ?
+ &s->ps.pps->scaling_list : &s->ps.sps->scaling_list;
int matrix_id = lc->cu.pred_mode != MODE_INTRA;
matrix_id = 3 * matrix_id + c_idx;
@@ -1172,7 +1120,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
dc_scale = 0;
}
- if (lc->cu.pred_mode == MODE_INTER && s->sps->explicit_rdpcm_enabled_flag &&
+ if (lc->cu.pred_mode == MODE_INTER && s->ps.sps->explicit_rdpcm_enabled_flag &&
(transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) {
explicit_rdpcm_flag = explicit_rdpcm_flag_decode(s, c_idx);
if (explicit_rdpcm_flag) {
@@ -1303,7 +1251,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
};
const uint8_t *ctx_idx_map_p;
int scf_offset = 0;
- if (s->sps->transform_skip_context_enabled_flag &&
+ if (s->ps.sps->transform_skip_context_enabled_flag &&
(transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) {
ctx_idx_map_p = (uint8_t*) &ctx_idx_map[4 * 16];
if (c_idx == 0) {
@@ -1344,7 +1292,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
}
}
if (implicit_non_zero_coeff == 0) {
- if (s->sps->transform_skip_context_enabled_flag &&
+ if (s->ps.sps->transform_skip_context_enabled_flag &&
(transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) {
if (c_idx == 0) {
scf_offset = 42;
@@ -1389,7 +1337,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
// initialize first elem of coeff_bas_level_greater1_flag
int ctx_set = (i > 0 && c_idx == 0) ? 2 : 0;
- if (s->sps->persistent_rice_adaptation_enabled_flag) {
+ if (s->ps.sps->persistent_rice_adaptation_enabled_flag) {
if (!transform_skip_flag && !lc->cu.cu_transquant_bypass_flag)
sb_type = 2 * (c_idx == 0 ? 1 : 0);
else
@@ -1418,7 +1366,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
if (lc->cu.cu_transquant_bypass_flag ||
(lc->cu.pred_mode == MODE_INTRA &&
- s->sps->implicit_rdpcm_enabled_flag && transform_skip_flag &&
+ s->ps.sps->implicit_rdpcm_enabled_flag && transform_skip_flag &&
(pred_mode_intra == 10 || pred_mode_intra == 26 )) ||
explicit_rdpcm_flag)
sign_hidden = 0;
@@ -1428,7 +1376,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
if (first_greater1_coeff_idx != -1) {
coeff_abs_level_greater1_flag[first_greater1_coeff_idx] += coeff_abs_level_greater2_flag_decode(s, c_idx, ctx_set);
}
- if (!s->pps->sign_data_hiding_flag || !sign_hidden ) {
+ if (!s->ps.pps->sign_data_hiding_flag || !sign_hidden ) {
coeff_sign_flag = coeff_sign_flag_decode(s, nb_significant_coeff_flag) << (16 - nb_significant_coeff_flag);
} else {
coeff_sign_flag = coeff_sign_flag_decode(s, nb_significant_coeff_flag - 1) << (16 - (nb_significant_coeff_flag - 1));
@@ -1444,8 +1392,8 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
trans_coeff_level += last_coeff_abs_level_remaining;
if (trans_coeff_level > (3 << c_rice_param))
- c_rice_param = s->sps->persistent_rice_adaptation_enabled_flag ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4);
- if (s->sps->persistent_rice_adaptation_enabled_flag && !rice_init) {
+ c_rice_param = s->ps.sps->persistent_rice_adaptation_enabled_flag ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4);
+ if (s->ps.sps->persistent_rice_adaptation_enabled_flag && !rice_init) {
int c_rice_p_init = lc->stat_coeff[sb_type] / 4;
if (last_coeff_abs_level_remaining >= (3 << c_rice_p_init))
lc->stat_coeff[sb_type]++;
@@ -1460,8 +1408,8 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
trans_coeff_level = 1 + last_coeff_abs_level_remaining;
if (trans_coeff_level > (3 << c_rice_param))
- c_rice_param = s->sps->persistent_rice_adaptation_enabled_flag ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4);
- if (s->sps->persistent_rice_adaptation_enabled_flag && !rice_init) {
+ c_rice_param = s->ps.sps->persistent_rice_adaptation_enabled_flag ? c_rice_param + 1 : FFMIN(c_rice_param + 1, 4);
+ if (s->ps.sps->persistent_rice_adaptation_enabled_flag && !rice_init) {
int c_rice_p_init = lc->stat_coeff[sb_type] / 4;
if (last_coeff_abs_level_remaining >= (3 << c_rice_p_init))
lc->stat_coeff[sb_type]++;
@@ -1471,7 +1419,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
rice_init = 1;
}
}
- if (s->pps->sign_data_hiding_flag && sign_hidden) {
+ if (s->ps.pps->sign_data_hiding_flag && sign_hidden) {
sum_abs += trans_coeff_level;
if (n == first_nz_pos_in_cg && (sum_abs&1))
trans_coeff_level = -trans_coeff_level;
@@ -1480,7 +1428,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
trans_coeff_level = -trans_coeff_level;
coeff_sign_flag <<= 1;
if(!lc->cu.cu_transquant_bypass_flag) {
- if (s->sps->scaling_list_enable_flag && !(transform_skip_flag && log2_trafo_size > 2)) {
+ if (s->ps.sps->scaling_list_enable_flag && !(transform_skip_flag && log2_trafo_size > 2)) {
if(y_c || x_c || log2_trafo_size < 4) {
switch(log2_trafo_size) {
case 3: pos = (y_c << 3) + x_c; break;
@@ -1508,15 +1456,15 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
}
if (lc->cu.cu_transquant_bypass_flag) {
- if (explicit_rdpcm_flag || (s->sps->implicit_rdpcm_enabled_flag &&
+ if (explicit_rdpcm_flag || (s->ps.sps->implicit_rdpcm_enabled_flag &&
(pred_mode_intra == 10 || pred_mode_intra == 26))) {
- int mode = s->sps->implicit_rdpcm_enabled_flag ? (pred_mode_intra == 26) : explicit_rdpcm_dir_flag;
+ int mode = s->ps.sps->implicit_rdpcm_enabled_flag ? (pred_mode_intra == 26) : explicit_rdpcm_dir_flag;
s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode);
}
} else {
if (transform_skip_flag) {
- int rot = s->sps->transform_skip_rotation_enabled_flag &&
+ int rot = s->ps.sps->transform_skip_rotation_enabled_flag &&
log2_trafo_size == 2 &&
lc->cu.pred_mode == MODE_INTRA;
if (rot) {
@@ -1526,7 +1474,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
s->hevcdsp.transform_skip(coeffs, log2_trafo_size);
- if (explicit_rdpcm_flag || (s->sps->implicit_rdpcm_enabled_flag &&
+ if (explicit_rdpcm_flag || (s->ps.sps->implicit_rdpcm_enabled_flag &&
lc->cu.pred_mode == MODE_INTRA &&
(pred_mode_intra == 10 || pred_mode_intra == 26))) {
int mode = explicit_rdpcm_flag ? explicit_rdpcm_dir_flag : (pred_mode_intra == 26);
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_data.c b/chromium/third_party/ffmpeg/libavcodec/hevc_data.c
new file mode 100644
index 00000000000..f74f2725c0b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_data.c
@@ -0,0 +1,75 @@
+/*
+ * HEVC shared tables
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "hevc.h"
+
+const uint8_t ff_hevc_diag_scan4x4_x[16] = {
+ 0, 0, 1, 0,
+ 1, 2, 0, 1,
+ 2, 3, 1, 2,
+ 3, 2, 3, 3,
+};
+
+const uint8_t ff_hevc_diag_scan4x4_y[16] = {
+ 0, 1, 0, 2,
+ 1, 0, 3, 2,
+ 1, 0, 3, 2,
+ 1, 3, 2, 3,
+};
+
+const uint8_t ff_hevc_diag_scan8x8_x[64] = {
+ 0, 0, 1, 0,
+ 1, 2, 0, 1,
+ 2, 3, 0, 1,
+ 2, 3, 4, 0,
+ 1, 2, 3, 4,
+ 5, 0, 1, 2,
+ 3, 4, 5, 6,
+ 0, 1, 2, 3,
+ 4, 5, 6, 7,
+ 1, 2, 3, 4,
+ 5, 6, 7, 2,
+ 3, 4, 5, 6,
+ 7, 3, 4, 5,
+ 6, 7, 4, 5,
+ 6, 7, 5, 6,
+ 7, 6, 7, 7,
+};
+
+const uint8_t ff_hevc_diag_scan8x8_y[64] = {
+ 0, 1, 0, 2,
+ 1, 0, 3, 2,
+ 1, 0, 4, 3,
+ 2, 1, 0, 5,
+ 4, 3, 2, 1,
+ 0, 6, 5, 4,
+ 3, 2, 1, 0,
+ 7, 6, 5, 4,
+ 3, 2, 1, 0,
+ 7, 6, 5, 4,
+ 3, 2, 1, 7,
+ 6, 5, 4, 3,
+ 2, 7, 6, 5,
+ 4, 3, 7, 6,
+ 5, 4, 7, 6,
+ 5, 7, 6, 7,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c b/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
index f50a640eab7..1f33b0cdfe5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_filter.c
@@ -56,12 +56,12 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
// slice qp offset is not used for deblocking
if (c_idx == 1)
- offset = s->pps->cb_qp_offset;
+ offset = s->ps.pps->cb_qp_offset;
else
- offset = s->pps->cr_qp_offset;
+ offset = s->ps.pps->cr_qp_offset;
qp_i = av_clip(qp_y + offset, 0, 57);
- if (s->sps->chroma_format_idc == 1) {
+ if (s->ps.sps->chroma_format_idc == 1) {
if (qp_i < 30)
qp = qp_i;
else if (qp_i > 43)
@@ -79,14 +79,14 @@ static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
static int get_qPy_pred(HEVCContext *s, int xBase, int yBase, int log2_cb_size)
{
HEVCLocalContext *lc = s->HEVClc;
- int ctb_size_mask = (1 << s->sps->log2_ctb_size) - 1;
- int MinCuQpDeltaSizeMask = (1 << (s->sps->log2_ctb_size -
- s->pps->diff_cu_qp_delta_depth)) - 1;
+ int ctb_size_mask = (1 << s->ps.sps->log2_ctb_size) - 1;
+ int MinCuQpDeltaSizeMask = (1 << (s->ps.sps->log2_ctb_size -
+ s->ps.pps->diff_cu_qp_delta_depth)) - 1;
int xQgBase = xBase - (xBase & MinCuQpDeltaSizeMask);
int yQgBase = yBase - (yBase & MinCuQpDeltaSizeMask);
- int min_cb_width = s->sps->min_cb_width;
- int x_cb = xQgBase >> s->sps->log2_min_cb_size;
- int y_cb = yQgBase >> s->sps->log2_min_cb_size;
+ int min_cb_width = s->ps.sps->min_cb_width;
+ int x_cb = xQgBase >> s->ps.sps->log2_min_cb_size;
+ int y_cb = yQgBase >> s->ps.sps->log2_min_cb_size;
int availableA = (xBase & ctb_size_mask) &&
(xQgBase & ctb_size_mask);
int availableB = (yBase & ctb_size_mask) &&
@@ -113,8 +113,8 @@ static int get_qPy_pred(HEVCContext *s, int xBase, int yBase, int log2_cb_size)
else
qPy_b = s->qp_y_tab[x_cb + (y_cb - 1) * min_cb_width];
- av_assert2(qPy_a >= -s->sps->qp_bd_offset && qPy_a < 52);
- av_assert2(qPy_b >= -s->sps->qp_bd_offset && qPy_b < 52);
+ av_assert2(qPy_a >= -s->ps.sps->qp_bd_offset && qPy_a < 52);
+ av_assert2(qPy_b >= -s->ps.sps->qp_bd_offset && qPy_b < 52);
return (qPy_a + qPy_b + 1) >> 1;
}
@@ -124,7 +124,7 @@ void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size)
int qp_y = get_qPy_pred(s, xBase, yBase, log2_cb_size);
if (s->HEVClc->tu.cu_qp_delta != 0) {
- int off = s->sps->qp_bd_offset;
+ int off = s->ps.sps->qp_bd_offset;
s->HEVClc->qp_y = FFUMOD(qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off,
52 + off) - off;
} else
@@ -133,10 +133,10 @@ void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size)
static int get_qPy(HEVCContext *s, int xC, int yC)
{
- int log2_min_cb_size = s->sps->log2_min_cb_size;
+ int log2_min_cb_size = s->ps.sps->log2_min_cb_size;
int x = xC >> log2_min_cb_size;
int y = yC >> log2_min_cb_size;
- return s->qp_y_tab[x + y * s->sps->min_cb_width];
+ return s->qp_y_tab[x + y * s->ps.sps->min_cb_width];
}
static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height,
@@ -193,9 +193,9 @@ static void copy_CTB_to_hv(HEVCContext *s, const uint8_t *src,
int stride_src, int x, int y, int width, int height,
int c_idx, int x_ctb, int y_ctb)
{
- int sh = s->sps->pixel_shift;
- int w = s->sps->width >> s->sps->hshift[c_idx];
- int h = s->sps->height >> s->sps->vshift[c_idx];
+ int sh = s->ps.sps->pixel_shift;
+ int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx];
+ int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx];
/* copy horizontal edges */
memcpy(s->sao_pixel_buffer_h[c_idx] + (((2 * y_ctb) * w + x) << sh),
@@ -214,23 +214,23 @@ static void restore_tqb_pixels(HEVCContext *s,
ptrdiff_t stride_src, ptrdiff_t stride_dst,
int x0, int y0, int width, int height, int c_idx)
{
- if ( s->pps->transquant_bypass_enable_flag ||
- (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) {
+ if ( s->ps.pps->transquant_bypass_enable_flag ||
+ (s->ps.sps->pcm.loop_filter_disable_flag && s->ps.sps->pcm_enabled_flag)) {
int x, y;
- int min_pu_size = 1 << s->sps->log2_min_pu_size;
- int hshift = s->sps->hshift[c_idx];
- int vshift = s->sps->vshift[c_idx];
- int x_min = ((x0 ) >> s->sps->log2_min_pu_size);
- int y_min = ((y0 ) >> s->sps->log2_min_pu_size);
- int x_max = ((x0 + width ) >> s->sps->log2_min_pu_size);
- int y_max = ((y0 + height) >> s->sps->log2_min_pu_size);
- int len = (min_pu_size >> hshift) << s->sps->pixel_shift;
+ int min_pu_size = 1 << s->ps.sps->log2_min_pu_size;
+ int hshift = s->ps.sps->hshift[c_idx];
+ int vshift = s->ps.sps->vshift[c_idx];
+ int x_min = ((x0 ) >> s->ps.sps->log2_min_pu_size);
+ int y_min = ((y0 ) >> s->ps.sps->log2_min_pu_size);
+ int x_max = ((x0 + width ) >> s->ps.sps->log2_min_pu_size);
+ int y_max = ((y0 + height) >> s->ps.sps->log2_min_pu_size);
+ int len = (min_pu_size >> hshift) << s->ps.sps->pixel_shift;
for (y = y_min; y < y_max; y++) {
for (x = x_min; x < x_max; x++) {
- if (s->is_pcm[y * s->sps->min_pu_width + x]) {
+ if (s->is_pcm[y * s->ps.sps->min_pu_width + x]) {
int n;
- uint8_t *src = src1 + (((y << s->sps->log2_min_pu_size) - y0) >> vshift) * stride_src + ((((x << s->sps->log2_min_pu_size) - x0) >> hshift) << s->sps->pixel_shift);
- const uint8_t *dst = dst1 + (((y << s->sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + ((((x << s->sps->log2_min_pu_size) - x0) >> hshift) << s->sps->pixel_shift);
+ uint8_t *src = src1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_src + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift);
+ const uint8_t *dst = dst1 + (((y << s->ps.sps->log2_min_pu_size) - y0) >> vshift) * stride_dst + ((((x << s->ps.sps->log2_min_pu_size) - x0) >> hshift) << s->ps.sps->pixel_shift);
for (n = 0; n < (min_pu_size >> vshift); n++) {
memcpy(src, dst, len);
src += stride_src;
@@ -242,7 +242,7 @@ static void restore_tqb_pixels(HEVCContext *s,
}
}
-#define CTB(tab, x, y) ((tab)[(y) * s->sps->ctb_width + (x)])
+#define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)])
static void sao_filter_CTB(HEVCContext *s, int x, int y)
{
@@ -250,18 +250,18 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
HEVCLocalContext *lc = s->HEVClc;
int c_idx;
int edges[4]; // 0 left 1 top 2 right 3 bottom
- int x_ctb = x >> s->sps->log2_ctb_size;
- int y_ctb = y >> s->sps->log2_ctb_size;
- int ctb_addr_rs = y_ctb * s->sps->ctb_width + x_ctb;
- int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[ctb_addr_rs];
+ int x_ctb = x >> s->ps.sps->log2_ctb_size;
+ int y_ctb = y >> s->ps.sps->log2_ctb_size;
+ int ctb_addr_rs = y_ctb * s->ps.sps->ctb_width + x_ctb;
+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs];
SAOParams *sao = &CTB(s->sao, x_ctb, y_ctb);
// flags indicating unfilterable edges
uint8_t vert_edge[] = { 0, 0 };
uint8_t horiz_edge[] = { 0, 0 };
uint8_t diag_edge[] = { 0, 0, 0, 0 };
uint8_t lfase = CTB(s->filter_slice_edges, x_ctb, y_ctb);
- uint8_t no_tile_filter = s->pps->tiles_enabled_flag &&
- !s->pps->loop_filter_across_tiles_enabled_flag;
+ uint8_t no_tile_filter = s->ps.pps->tiles_enabled_flag &&
+ !s->ps.pps->loop_filter_across_tiles_enabled_flag;
uint8_t restore = no_tile_filter || !lfase;
uint8_t left_tile_edge = 0;
uint8_t right_tile_edge = 0;
@@ -270,24 +270,24 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
edges[0] = x_ctb == 0;
edges[1] = y_ctb == 0;
- edges[2] = x_ctb == s->sps->ctb_width - 1;
- edges[3] = y_ctb == s->sps->ctb_height - 1;
+ edges[2] = x_ctb == s->ps.sps->ctb_width - 1;
+ edges[3] = y_ctb == s->ps.sps->ctb_height - 1;
if (restore) {
if (!edges[0]) {
- left_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]];
+ left_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]];
vert_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb)) || left_tile_edge;
}
if (!edges[2]) {
- right_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]];
+ right_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs+1]];
vert_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb + 1, y_ctb)) || right_tile_edge;
}
if (!edges[1]) {
- up_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]];
+ up_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->ps.sps->ctb_width]];
horiz_edge[0] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) || up_tile_edge;
}
if (!edges[3]) {
- bottom_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs + s->sps->ctb_width]];
+ bottom_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs + s->ps.sps->ctb_width]];
horiz_edge[1] = (!lfase && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb + 1)) || bottom_tile_edge;
}
if (!edges[0] && !edges[1]) {
@@ -304,16 +304,16 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
}
}
- for (c_idx = 0; c_idx < (s->sps->chroma_format_idc ? 3 : 1); c_idx++) {
- int x0 = x >> s->sps->hshift[c_idx];
- int y0 = y >> s->sps->vshift[c_idx];
+ for (c_idx = 0; c_idx < (s->ps.sps->chroma_format_idc ? 3 : 1); c_idx++) {
+ int x0 = x >> s->ps.sps->hshift[c_idx];
+ int y0 = y >> s->ps.sps->vshift[c_idx];
int stride_src = s->frame->linesize[c_idx];
- int ctb_size_h = (1 << (s->sps->log2_ctb_size)) >> s->sps->hshift[c_idx];
- int ctb_size_v = (1 << (s->sps->log2_ctb_size)) >> s->sps->vshift[c_idx];
- int width = FFMIN(ctb_size_h, (s->sps->width >> s->sps->hshift[c_idx]) - x0);
- int height = FFMIN(ctb_size_v, (s->sps->height >> s->sps->vshift[c_idx]) - y0);
+ int ctb_size_h = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->hshift[c_idx];
+ int ctb_size_v = (1 << (s->ps.sps->log2_ctb_size)) >> s->ps.sps->vshift[c_idx];
+ int width = FFMIN(ctb_size_h, (s->ps.sps->width >> s->ps.sps->hshift[c_idx]) - x0);
+ int height = FFMIN(ctb_size_v, (s->ps.sps->height >> s->ps.sps->vshift[c_idx]) - y0);
int tab = sao_tab[(FFALIGN(width, 8) >> 3) - 1];
- uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->sps->pixel_shift)];
+ uint8_t *src = &s->frame->data[c_idx][y0 * stride_src + (x0 << s->ps.sps->pixel_shift)];
int stride_dst;
uint8_t *dst;
@@ -321,11 +321,11 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
case SAO_BAND:
copy_CTB_to_hv(s, src, stride_src, x0, y0, width, height, c_idx,
x_ctb, y_ctb);
- if (s->pps->transquant_bypass_enable_flag ||
- (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) {
+ if (s->ps.pps->transquant_bypass_enable_flag ||
+ (s->ps.sps->pcm.loop_filter_disable_flag && s->ps.sps->pcm_enabled_flag)) {
dst = lc->edge_emu_buffer;
stride_dst = 2*MAX_PB_SIZE;
- copy_CTB(dst, src, width << s->sps->pixel_shift, height, stride_dst, stride_src);
+ copy_CTB(dst, src, width << s->ps.sps->pixel_shift, height, stride_dst, stride_src);
s->hevcdsp.sao_band_filter[tab](src, dst, stride_src, stride_dst,
sao->offset_val[c_idx], sao->band_position[c_idx],
width, height);
@@ -340,17 +340,17 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
break;
case SAO_EDGE:
{
- int w = s->sps->width >> s->sps->hshift[c_idx];
- int h = s->sps->height >> s->sps->vshift[c_idx];
+ int w = s->ps.sps->width >> s->ps.sps->hshift[c_idx];
+ int h = s->ps.sps->height >> s->ps.sps->vshift[c_idx];
int left_edge = edges[0];
int top_edge = edges[1];
int right_edge = edges[2];
int bottom_edge = edges[3];
- int sh = s->sps->pixel_shift;
+ int sh = s->ps.sps->pixel_shift;
int left_pixels, right_pixels;
- stride_dst = 2*MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE;
- dst = lc->edge_emu_buffer + stride_dst + FF_INPUT_BUFFER_PADDING_SIZE;
+ stride_dst = 2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE;
+ dst = lc->edge_emu_buffer + stride_dst + AV_INPUT_BUFFER_PADDING_SIZE;
if (!top_edge) {
int left = 1 - left_edge;
@@ -455,7 +455,7 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
static int get_pcm(HEVCContext *s, int x, int y)
{
- int log2_min_pu_size = s->sps->log2_min_pu_size;
+ int log2_min_pu_size = s->ps.sps->log2_min_pu_size;
int x_pu, y_pu;
if (x < 0 || y < 0)
@@ -464,9 +464,9 @@ static int get_pcm(HEVCContext *s, int x, int y)
x_pu = x >> log2_min_pu_size;
y_pu = y >> log2_min_pu_size;
- if (x_pu >= s->sps->min_pu_width || y_pu >= s->sps->min_pu_height)
+ if (x_pu >= s->ps.sps->min_pu_width || y_pu >= s->ps.sps->min_pu_height)
return 2;
- return s->is_pcm[y_pu * s->sps->min_pu_width + x_pu];
+ return s->is_pcm[y_pu * s->ps.sps->min_pu_width + x_pu];
}
#define TC_CALC(qp, bs) \
@@ -483,18 +483,18 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
uint8_t no_p[2] = { 0 };
uint8_t no_q[2] = { 0 };
- int log2_ctb_size = s->sps->log2_ctb_size;
+ int log2_ctb_size = s->ps.sps->log2_ctb_size;
int x_end, x_end2, y_end;
int ctb_size = 1 << log2_ctb_size;
int ctb = (x0 >> log2_ctb_size) +
- (y0 >> log2_ctb_size) * s->sps->ctb_width;
+ (y0 >> log2_ctb_size) * s->ps.sps->ctb_width;
int cur_tc_offset = s->deblock[ctb].tc_offset;
int cur_beta_offset = s->deblock[ctb].beta_offset;
int left_tc_offset, left_beta_offset;
int tc_offset, beta_offset;
- int pcmf = (s->sps->pcm_enabled_flag &&
- s->sps->pcm.loop_filter_disable_flag) ||
- s->pps->transquant_bypass_enable_flag;
+ int pcmf = (s->ps.sps->pcm_enabled_flag &&
+ s->ps.sps->pcm.loop_filter_disable_flag) ||
+ s->ps.pps->transquant_bypass_enable_flag;
if (x0) {
left_tc_offset = s->deblock[ctb - 1].tc_offset;
@@ -505,17 +505,17 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
}
x_end = x0 + ctb_size;
- if (x_end > s->sps->width)
- x_end = s->sps->width;
+ if (x_end > s->ps.sps->width)
+ x_end = s->ps.sps->width;
y_end = y0 + ctb_size;
- if (y_end > s->sps->height)
- y_end = s->sps->height;
+ if (y_end > s->ps.sps->height)
+ y_end = s->ps.sps->height;
tc_offset = cur_tc_offset;
beta_offset = cur_beta_offset;
x_end2 = x_end;
- if (x_end2 != s->sps->width)
+ if (x_end2 != s->ps.sps->width)
x_end2 -= 8;
for (y = y0; y < y_end; y += 8) {
// vertical filtering luma
@@ -529,7 +529,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
tc[0] = bs0 ? TC_CALC(qp, bs0) : 0;
tc[1] = bs1 ? TC_CALC(qp, bs1) : 0;
- src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
+ src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->ps.sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x - 1, y);
no_p[1] = get_pcm(s, x - 1, y + 4);
@@ -561,7 +561,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
beta = betatable[av_clip(qp + beta_offset, 0, MAX_QP)];
tc[0] = bs0 ? TC_CALC(qp, bs0) : 0;
tc[1] = bs1 ? TC_CALC(qp, bs1) : 0;
- src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
+ src = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->ps.sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x, y - 1);
no_p[1] = get_pcm(s, x + 4, y - 1);
@@ -578,10 +578,10 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
}
}
- if (s->sps->chroma_format_idc) {
+ if (s->ps.sps->chroma_format_idc) {
for (chroma = 1; chroma <= 2; chroma++) {
- int h = 1 << s->sps->hshift[chroma];
- int v = 1 << s->sps->vshift[chroma];
+ int h = 1 << s->ps.sps->hshift[chroma];
+ int v = 1 << s->ps.sps->vshift[chroma];
// vertical filtering chroma
for (y = y0; y < y_end; y += (8 * v)) {
@@ -595,7 +595,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
c_tc[0] = (bs0 == 2) ? chroma_tc(s, qp0, chroma, tc_offset) : 0;
c_tc[1] = (bs1 == 2) ? chroma_tc(s, qp1, chroma, tc_offset) : 0;
- src = &s->frame->data[chroma][(y >> s->sps->vshift[chroma]) * s->frame->linesize[chroma] + ((x >> s->sps->hshift[chroma]) << s->sps->pixel_shift)];
+ src = &s->frame->data[chroma][(y >> s->ps.sps->vshift[chroma]) * s->frame->linesize[chroma] + ((x >> s->ps.sps->hshift[chroma]) << s->ps.sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x - 1, y);
no_p[1] = get_pcm(s, x - 1, y + (4 * v));
@@ -617,7 +617,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
// horizontal filtering chroma
tc_offset = x0 ? left_tc_offset : cur_tc_offset;
x_end2 = x_end;
- if (x_end != s->sps->width)
+ if (x_end != s->ps.sps->width)
x_end2 = x_end - 8 * h;
for (x = x0 ? x0 - 8 * h : 0; x < x_end2; x += (8 * h)) {
const int bs0 = s->horizontal_bs[( x + y * s->bs_width) >> 2];
@@ -628,7 +628,7 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
c_tc[0] = bs0 == 2 ? chroma_tc(s, qp0, chroma, tc_offset) : 0;
c_tc[1] = bs1 == 2 ? chroma_tc(s, qp1, chroma, cur_tc_offset) : 0;
- src = &s->frame->data[chroma][(y >> s->sps->vshift[1]) * s->frame->linesize[chroma] + ((x >> s->sps->hshift[1]) << s->sps->pixel_shift)];
+ src = &s->frame->data[chroma][(y >> s->ps.sps->vshift[1]) * s->frame->linesize[chroma] + ((x >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)];
if (pcmf) {
no_p[0] = get_pcm(s, x, y - 1);
no_p[1] = get_pcm(s, x + (4 * h), y - 1);
@@ -717,10 +717,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
{
HEVCLocalContext *lc = s->HEVClc;
MvField *tab_mvf = s->ref->tab_mvf;
- int log2_min_pu_size = s->sps->log2_min_pu_size;
- int log2_min_tu_size = s->sps->log2_min_tb_size;
- int min_pu_width = s->sps->min_pu_width;
- int min_tu_width = s->sps->min_tb_width;
+ int log2_min_pu_size = s->ps.sps->log2_min_pu_size;
+ int log2_min_tu_size = s->ps.sps->log2_min_tb_size;
+ int min_pu_width = s->ps.sps->min_pu_width;
+ int min_tu_width = s->ps.sps->min_tb_width;
int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
(x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
int boundary_upper, boundary_left;
@@ -730,10 +730,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
if (boundary_upper &&
((!s->sh.slice_loop_filter_across_slices_enabled_flag &&
lc->boundary_flags & BOUNDARY_UPPER_SLICE &&
- (y0 % (1 << s->sps->log2_ctb_size)) == 0) ||
- (!s->pps->loop_filter_across_tiles_enabled_flag &&
+ (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0) ||
+ (!s->ps.pps->loop_filter_across_tiles_enabled_flag &&
lc->boundary_flags & BOUNDARY_UPPER_TILE &&
- (y0 % (1 << s->sps->log2_ctb_size)) == 0)))
+ (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0)))
boundary_upper = 0;
if (boundary_upper) {
@@ -768,10 +768,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
if (boundary_left &&
((!s->sh.slice_loop_filter_across_slices_enabled_flag &&
lc->boundary_flags & BOUNDARY_LEFT_SLICE &&
- (x0 % (1 << s->sps->log2_ctb_size)) == 0) ||
- (!s->pps->loop_filter_across_tiles_enabled_flag &&
+ (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0) ||
+ (!s->ps.pps->loop_filter_across_tiles_enabled_flag &&
lc->boundary_flags & BOUNDARY_LEFT_TILE &&
- (x0 % (1 << s->sps->log2_ctb_size)) == 0)))
+ (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0)))
boundary_left = 0;
if (boundary_left) {
@@ -842,10 +842,11 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size)
{
- int x_end = x >= s->sps->width - ctb_size;
- deblocking_filter_CTB(s, x, y);
- if (s->sps->sao_enabled) {
- int y_end = y >= s->sps->height - ctb_size;
+ int x_end = x >= s->ps.sps->width - ctb_size;
+ if (s->avctx->skip_loop_filter < AVDISCARD_ALL)
+ deblocking_filter_CTB(s, x, y);
+ if (s->ps.sps->sao_enabled) {
+ int y_end = y >= s->ps.sps->height - ctb_size;
if (y && x)
sao_filter_CTB(s, x - ctb_size, y - ctb_size);
if (x && y_end)
@@ -866,8 +867,8 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size)
void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size)
{
- int x_end = x_ctb >= s->sps->width - ctb_size;
- int y_end = y_ctb >= s->sps->height - ctb_size;
+ int x_end = x_ctb >= s->ps.sps->width - ctb_size;
+ int y_end = y_ctb >= s->ps.sps->height - ctb_size;
if (y_ctb && x_ctb)
ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size);
if (y_ctb && x_end)
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c b/chromium/third_party/ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c
new file mode 100644
index 00000000000..54d6d79b8b0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_mp4toannexb_bsf.c
@@ -0,0 +1,212 @@
+/*
+ * HEVC MP4 to Annex B byte stream format filter
+ * copyright (c) 2015 Anton Khirnov
+ *
+ * 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 <string.h>
+
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "hevc.h"
+
+#define MIN_HEVCC_LENGTH 23
+
+typedef struct HEVCBSFContext {
+ uint8_t length_size;
+ int extradata_parsed;
+
+ int logged_nonmp4_warning;
+
+ /* When private_spspps is zero then spspps_buf points to global extradata
+ and bsf does replace a global extradata to own-allocated version (default
+ behaviour).
+ When private_spspps is non-zero the bsf uses a private version of spspps buf.
+ This mode necessary when bsf uses in decoder, else bsf has issues after
+ decoder re-initialization. Use the "private_spspps_buf" argument to
+ activate this mode.
+ */
+ int private_spspps;
+ uint8_t *spspps_buf;
+ uint32_t spspps_size;
+} HEVCBSFContext;
+
+static int hevc_extradata_to_annexb(HEVCBSFContext* ctx, AVCodecContext *avctx)
+{
+ GetByteContext gb;
+ int length_size, num_arrays, i, j;
+ int ret = 0;
+
+ uint8_t *new_extradata = NULL;
+ size_t new_extradata_size = 0;
+
+ bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
+
+ bytestream2_skip(&gb, 21);
+ length_size = (bytestream2_get_byte(&gb) & 3) + 1;
+ num_arrays = bytestream2_get_byte(&gb);
+
+ for (i = 0; i < num_arrays; i++) {
+ int type = bytestream2_get_byte(&gb) & 0x3f;
+ int cnt = bytestream2_get_be16(&gb);
+
+ if (!(type == NAL_VPS || type == NAL_SPS || type == NAL_PPS ||
+ type == NAL_SEI_PREFIX || type == NAL_SEI_SUFFIX)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit type in extradata: %d\n",
+ type);
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
+ for (j = 0; j < cnt; j++) {
+ int nalu_len = bytestream2_get_be16(&gb);
+
+ if (4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > SIZE_MAX - new_extradata_size) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ ret = av_reallocp(&new_extradata, new_extradata_size + nalu_len + 4 + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (ret < 0)
+ goto fail;
+
+ AV_WB32(new_extradata + new_extradata_size, 1); // add the startcode
+ bytestream2_get_buffer(&gb, new_extradata + new_extradata_size + 4, nalu_len);
+ new_extradata_size += 4 + nalu_len;
+ memset(new_extradata + new_extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+ }
+
+ if (!ctx->private_spspps) {
+ av_freep(&avctx->extradata);
+ avctx->extradata = new_extradata;
+ avctx->extradata_size = new_extradata_size;
+ }
+ ctx->spspps_buf = new_extradata;
+ ctx->spspps_size = new_extradata_size;
+
+ if (!new_extradata_size)
+ av_log(avctx, AV_LOG_WARNING, "No parameter sets in the extradata\n");
+
+ return length_size;
+fail:
+ av_freep(&new_extradata);
+ return ret;
+}
+
+static int hevc_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
+ AVCodecContext *avctx, const char *args,
+ uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size,
+ int keyframe)
+{
+ HEVCBSFContext *ctx = bsfc->priv_data;
+ GetByteContext gb;
+
+ uint8_t *out = NULL;
+ size_t out_size = 0;
+ int got_irap = 0;
+ int i, ret = 0;
+
+ if (!ctx->extradata_parsed) {
+ if (avctx->extradata_size < MIN_HEVCC_LENGTH ||
+ AV_RB24(avctx->extradata) == 1 ||
+ AV_RB32(avctx->extradata) == 1) {
+ if (!ctx->logged_nonmp4_warning) {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "The input looks like it is Annex B already\n");
+ ctx->logged_nonmp4_warning = 1;
+ }
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+ return 0;
+ }
+ if (args && strstr(args, "private_spspps_buf"))
+ ctx->private_spspps = 1;
+
+ ret = hevc_extradata_to_annexb(ctx, avctx);
+ if (ret < 0)
+ return ret;
+ ctx->length_size = ret;
+ ctx->extradata_parsed = 1;
+ }
+
+ *poutbuf_size = 0;
+ *poutbuf = NULL;
+
+ bytestream2_init(&gb, buf, buf_size);
+
+ while (bytestream2_get_bytes_left(&gb)) {
+ uint32_t nalu_size = 0;
+ int nalu_type;
+ int is_irap, add_extradata, extra_size;
+
+ for (i = 0; i < ctx->length_size; i++)
+ nalu_size = (nalu_size << 8) | bytestream2_get_byte(&gb);
+
+ nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f;
+
+ /* prepend extradata to IRAP frames */
+ is_irap = nalu_type >= 16 && nalu_type <= 23;
+ add_extradata = is_irap && !got_irap;
+ extra_size = add_extradata * ctx->spspps_size;
+ got_irap |= is_irap;
+
+ if (SIZE_MAX - out_size < 4 ||
+ SIZE_MAX - out_size - 4 < nalu_size ||
+ SIZE_MAX - out_size - 4 - nalu_size < extra_size) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
+ ret = av_reallocp(&out, out_size + 4 + nalu_size + extra_size);
+ if (ret < 0)
+ goto fail;
+
+ if (add_extradata)
+ memcpy(out + out_size, ctx->spspps_buf, extra_size);
+ AV_WB32(out + out_size + extra_size, 1);
+ bytestream2_get_buffer(&gb, out + out_size + 4 + extra_size, nalu_size);
+ out_size += 4 + nalu_size + extra_size;
+ }
+
+ *poutbuf = out;
+ *poutbuf_size = out_size;
+
+ return 1;
+
+fail:
+ av_freep(&out);
+ return ret;
+}
+
+static void hevc_mp4toannexb_close(AVBitStreamFilterContext *bsfc)
+{
+ HEVCBSFContext *ctx = bsfc->priv_data;
+ if (ctx->private_spspps)
+ av_freep(&ctx->spspps_buf);
+}
+
+AVBitStreamFilter ff_hevc_mp4toannexb_bsf = {
+ "hevc_mp4toannexb",
+ sizeof(HEVCBSFContext),
+ hevc_mp4toannexb_filter,
+ hevc_mp4toannexb_close,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c b/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
index e504257c47d..00da575aad6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_mvs.c
@@ -42,14 +42,14 @@ void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0,
int nPbW, int nPbH)
{
HEVCLocalContext *lc = s->HEVClc;
- int x0b = av_mod_uintp2(x0, s->sps->log2_ctb_size);
- int y0b = av_mod_uintp2(y0, s->sps->log2_ctb_size);
+ int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size);
+ int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size);
lc->na.cand_up = (lc->ctb_up_flag || y0b);
lc->na.cand_left = (lc->ctb_left_flag || x0b);
lc->na.cand_up_left = (!x0b && !y0b) ? lc->ctb_up_left_flag : lc->na.cand_left && lc->na.cand_up;
lc->na.cand_up_right_sap =
- ((x0b + nPbW) == (1 << s->sps->log2_ctb_size)) ?
+ ((x0b + nPbW) == (1 << s->ps.sps->log2_ctb_size)) ?
lc->ctb_up_right_flag && !y0b : lc->na.cand_up;
lc->na.cand_up_right =
lc->na.cand_up_right_sap
@@ -64,19 +64,19 @@ static av_always_inline int z_scan_block_avail(HEVCContext *s, int xCurr, int yC
int xN, int yN)
{
#define MIN_TB_ADDR_ZS(x, y) \
- s->pps->min_tb_addr_zs[(y) * (s->sps->tb_mask+2) + (x)]
+ s->ps.pps->min_tb_addr_zs[(y) * (s->ps.sps->tb_mask+2) + (x)]
- int xCurr_ctb = xCurr >> s->sps->log2_ctb_size;
- int yCurr_ctb = yCurr >> s->sps->log2_ctb_size;
- int xN_ctb = xN >> s->sps->log2_ctb_size;
- int yN_ctb = yN >> s->sps->log2_ctb_size;
+ int xCurr_ctb = xCurr >> s->ps.sps->log2_ctb_size;
+ int yCurr_ctb = yCurr >> s->ps.sps->log2_ctb_size;
+ int xN_ctb = xN >> s->ps.sps->log2_ctb_size;
+ int yN_ctb = yN >> s->ps.sps->log2_ctb_size;
if( yN_ctb < yCurr_ctb || xN_ctb < xCurr_ctb )
return 1;
else {
- int Curr = MIN_TB_ADDR_ZS((xCurr >> s->sps->log2_min_tb_size) & s->sps->tb_mask,
- (yCurr >> s->sps->log2_min_tb_size) & s->sps->tb_mask);
- int N = MIN_TB_ADDR_ZS((xN >> s->sps->log2_min_tb_size) & s->sps->tb_mask,
- (yN >> s->sps->log2_min_tb_size) & s->sps->tb_mask);
+ int Curr = MIN_TB_ADDR_ZS((xCurr >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask,
+ (yCurr >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask);
+ int N = MIN_TB_ADDR_ZS((xN >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask,
+ (yN >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask);
return N <= Curr;
}
}
@@ -84,7 +84,7 @@ static av_always_inline int z_scan_block_avail(HEVCContext *s, int xCurr, int yC
//check if the two luma locations belong to the same mostion estimation region
static av_always_inline int is_diff_mer(HEVCContext *s, int xN, int yN, int xP, int yP)
{
- uint8_t plevel = s->pps->log2_parallel_merge_level;
+ uint8_t plevel = s->ps.pps->log2_parallel_merge_level;
return xN >> plevel == xP >> plevel &&
yN >> plevel == yP >> plevel;
@@ -203,8 +203,8 @@ static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col,
tab_mvf[(y) * min_pu_width + x]
#define TAB_MVF_PU(v) \
- TAB_MVF(((x ## v) >> s->sps->log2_min_pu_size), \
- ((y ## v) >> s->sps->log2_min_pu_size))
+ TAB_MVF(((x ## v) >> s->ps.sps->log2_min_pu_size), \
+ ((y ## v) >> s->ps.sps->log2_min_pu_size))
#define DERIVE_TEMPORAL_COLOCATED_MVS \
derive_temporal_colocated_mvs(s, temp_col, \
@@ -221,7 +221,7 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
MvField *tab_mvf;
MvField temp_col;
int x, y, x_pu, y_pu;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
int availableFlagLXCol = 0;
int colPic;
@@ -240,15 +240,15 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
y = y0 + nPbH;
if (tab_mvf &&
- (y0 >> s->sps->log2_ctb_size) == (y >> s->sps->log2_ctb_size) &&
- y < s->sps->height &&
- x < s->sps->width) {
+ (y0 >> s->ps.sps->log2_ctb_size) == (y >> s->ps.sps->log2_ctb_size) &&
+ y < s->ps.sps->height &&
+ x < s->ps.sps->width) {
x &= ~15;
y &= ~15;
if (s->threads_type == FF_THREAD_FRAME)
ff_thread_await_progress(&ref->tf, y, 0);
- x_pu = x >> s->sps->log2_min_pu_size;
- y_pu = y >> s->sps->log2_min_pu_size;
+ x_pu = x >> s->ps.sps->log2_min_pu_size;
+ y_pu = y >> s->ps.sps->log2_min_pu_size;
temp_col = TAB_MVF(x_pu, y_pu);
availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS;
}
@@ -261,8 +261,8 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
y &= ~15;
if (s->threads_type == FF_THREAD_FRAME)
ff_thread_await_progress(&ref->tf, y, 0);
- x_pu = x >> s->sps->log2_min_pu_size;
- y_pu = y >> s->sps->log2_min_pu_size;
+ x_pu = x >> s->ps.sps->log2_min_pu_size;
+ y_pu = y >> s->ps.sps->log2_min_pu_size;
temp_col = TAB_MVF(x_pu, y_pu);
availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS;
}
@@ -292,7 +292,7 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
RefPicList *refPicList = s->ref->refPicList;
MvField *tab_mvf = s->ref->tab_mvf;
- const int min_pu_width = s->sps->min_pu_width;
+ const int min_pu_width = s->ps.sps->min_pu_width;
const int cand_bottom_left = lc->na.cand_bottom_left;
const int cand_left = lc->na.cand_left;
@@ -365,7 +365,7 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
// above right spatial merge candidate
is_available_b0 = AVAILABLE(cand_up_right, B0) &&
- xB0 < s->sps->width &&
+ xB0 < s->ps.sps->width &&
PRED_BLOCK_AVAILABLE(B0) &&
!is_diff_mer(s, xB0, yB0, x0, y0);
@@ -379,7 +379,7 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
// left bottom spatial merge candidate
is_available_a0 = AVAILABLE(cand_bottom_left, A0) &&
- yA0 < s->sps->height &&
+ yA0 < s->ps.sps->height &&
PRED_BLOCK_AVAILABLE(A0) &&
!is_diff_mer(s, xA0, yA0, x0, y0);
@@ -486,7 +486,7 @@ void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW,
int nPbH2 = nPbH;
HEVCLocalContext *lc = s->HEVClc;
- if (s->pps->log2_parallel_merge_level > 2 && nCS == 8) {
+ if (s->ps.pps->log2_parallel_merge_level > 2 && nCS == 8) {
singleMCLFlag = 1;
x0 = lc->cu.x;
y0 = lc->cu.y;
@@ -529,7 +529,7 @@ static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index,
Mv *mv, int ref_idx_curr, int ref_idx)
{
MvField *tab_mvf = s->ref->tab_mvf;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
RefPicList *refPicList = s->ref->refPicList;
@@ -545,7 +545,7 @@ static int mv_mp_mode_mx_lt(HEVCContext *s, int x, int y, int pred_flag_index,
Mv *mv, int ref_idx_curr, int ref_idx)
{
MvField *tab_mvf = s->ref->tab_mvf;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
RefPicList *refPicList = s->ref->refPicList;
@@ -568,14 +568,14 @@ static int mv_mp_mode_mx_lt(HEVCContext *s, int x, int y, int pred_flag_index,
#define MP_MX(v, pred, mx) \
mv_mp_mode_mx(s, \
- (x ## v) >> s->sps->log2_min_pu_size, \
- (y ## v) >> s->sps->log2_min_pu_size, \
+ (x ## v) >> s->ps.sps->log2_min_pu_size, \
+ (y ## v) >> s->ps.sps->log2_min_pu_size, \
pred, &mx, ref_idx_curr, ref_idx)
#define MP_MX_LT(v, pred, mx) \
mv_mp_mode_mx_lt(s, \
- (x ## v) >> s->sps->log2_min_pu_size, \
- (y ## v) >> s->sps->log2_min_pu_size, \
+ (x ## v) >> s->ps.sps->log2_min_pu_size, \
+ (y ## v) >> s->ps.sps->log2_min_pu_size, \
pred, &mx, ref_idx_curr, ref_idx)
void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
@@ -589,7 +589,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
int availableFlagLXA0 = 1;
int availableFlagLXB0 = 1;
int numMVPCandLX = 0;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
int xA0, yA0;
int is_available_a0;
@@ -625,7 +625,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
yA0 = y0 + nPbH;
is_available_a0 = AVAILABLE(cand_bottom_left, A0) &&
- yA0 < s->sps->height &&
+ yA0 < s->ps.sps->height &&
PRED_BLOCK_AVAILABLE(A0);
//left spatial merge candidate
@@ -680,7 +680,7 @@ b_candidates:
yB0 = y0 - 1;
is_available_b0 = AVAILABLE(cand_up_right, B0) &&
- xB0 < s->sps->width &&
+ xB0 < s->ps.sps->width &&
PRED_BLOCK_AVAILABLE(B0);
// above spatial merge candidate
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_parse.c b/chromium/third_party/ffmpeg/libavcodec/hevc_parse.c
new file mode 100644
index 00000000000..63ed84a8de7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_parse.c
@@ -0,0 +1,291 @@
+/*
+ * HEVC common code
+ *
+ * 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 <string.h>
+
+#include "config.h"
+
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+
+#include "hevc.h"
+
+/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
+ * between these functions would be nice. */
+int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
+ HEVCNAL *nal)
+{
+ int i, si, di;
+ uint8_t *dst;
+
+ if (s)
+ nal->skipped_bytes = 0;
+#define STARTCODE_TEST \
+ if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
+ if (src[i + 2] != 3) { \
+ /* startcode, so we must be past the end */ \
+ length = i; \
+ } \
+ break; \
+ }
+#if HAVE_FAST_UNALIGNED
+#define FIND_FIRST_ZERO \
+ if (i > 0 && !src[i]) \
+ i--; \
+ while (src[i]) \
+ i++
+#if HAVE_FAST_64BIT
+ for (i = 0; i + 1 < length; i += 9) {
+ if (!((~AV_RN64A(src + i) &
+ (AV_RN64A(src + i) - 0x0100010001000101ULL)) &
+ 0x8000800080008080ULL))
+ continue;
+ FIND_FIRST_ZERO;
+ STARTCODE_TEST;
+ i -= 7;
+ }
+#else
+ for (i = 0; i + 1 < length; i += 5) {
+ if (!((~AV_RN32A(src + i) &
+ (AV_RN32A(src + i) - 0x01000101U)) &
+ 0x80008080U))
+ continue;
+ FIND_FIRST_ZERO;
+ STARTCODE_TEST;
+ i -= 3;
+ }
+#endif /* HAVE_FAST_64BIT */
+#else
+ for (i = 0; i + 1 < length; i += 2) {
+ if (src[i])
+ continue;
+ if (i > 0 && src[i - 1] == 0)
+ i--;
+ STARTCODE_TEST;
+ }
+#endif /* HAVE_FAST_UNALIGNED */
+
+ if (i >= length - 1) { // no escaped 0
+ nal->data =
+ nal->raw_data = src;
+ nal->size =
+ nal->raw_size = length;
+ return length;
+ }
+
+ av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
+ length + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!nal->rbsp_buffer)
+ return AVERROR(ENOMEM);
+
+ dst = nal->rbsp_buffer;
+
+ memcpy(dst, src, i);
+ si = di = i;
+ while (si + 2 < length) {
+ // remove escapes (very rare 1:2^22)
+ if (src[si + 2] > 3) {
+ dst[di++] = src[si++];
+ dst[di++] = src[si++];
+ } else if (src[si] == 0 && src[si + 1] == 0) {
+ if (src[si + 2] == 3) { // escape
+ dst[di++] = 0;
+ dst[di++] = 0;
+ si += 3;
+
+ if (s && nal->skipped_bytes_pos) {
+ nal->skipped_bytes++;
+ if (nal->skipped_bytes_pos_size < nal->skipped_bytes) {
+ nal->skipped_bytes_pos_size *= 2;
+ av_assert0(nal->skipped_bytes_pos_size >= nal->skipped_bytes);
+ av_reallocp_array(&nal->skipped_bytes_pos,
+ nal->skipped_bytes_pos_size,
+ sizeof(*nal->skipped_bytes_pos));
+ if (!nal->skipped_bytes_pos) {
+ nal->skipped_bytes_pos_size = 0;
+ return AVERROR(ENOMEM);
+ }
+ }
+ if (nal->skipped_bytes_pos)
+ nal->skipped_bytes_pos[nal->skipped_bytes-1] = di - 1;
+ }
+ continue;
+ } else // next start code
+ goto nsc;
+ }
+
+ dst[di++] = src[si++];
+ }
+ while (si < length)
+ dst[di++] = src[si++];
+
+nsc:
+ memset(dst + di, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
+ nal->data = dst;
+ nal->size = di;
+ nal->raw_data = src;
+ nal->raw_size = si;
+ return si;
+}
+
+static const char *nal_unit_name(int nal_type)
+{
+ switch(nal_type) {
+ case NAL_TRAIL_N : return "TRAIL_N";
+ case NAL_TRAIL_R : return "TRAIL_R";
+ case NAL_TSA_N : return "TSA_N";
+ case NAL_TSA_R : return "TSA_R";
+ case NAL_STSA_N : return "STSA_N";
+ case NAL_STSA_R : return "STSA_R";
+ case NAL_RADL_N : return "RADL_N";
+ case NAL_RADL_R : return "RADL_R";
+ case NAL_RASL_N : return "RASL_N";
+ case NAL_RASL_R : return "RASL_R";
+ case NAL_BLA_W_LP : return "BLA_W_LP";
+ case NAL_BLA_W_RADL : return "BLA_W_RADL";
+ case NAL_BLA_N_LP : return "BLA_N_LP";
+ case NAL_IDR_W_RADL : return "IDR_W_RADL";
+ case NAL_IDR_N_LP : return "IDR_N_LP";
+ case NAL_CRA_NUT : return "CRA_NUT";
+ case NAL_VPS : return "VPS";
+ case NAL_SPS : return "SPS";
+ case NAL_PPS : return "PPS";
+ case NAL_AUD : return "AUD";
+ case NAL_EOS_NUT : return "EOS_NUT";
+ case NAL_EOB_NUT : return "EOB_NUT";
+ case NAL_FD_NUT : return "FD_NUT";
+ case NAL_SEI_PREFIX : return "SEI_PREFIX";
+ case NAL_SEI_SUFFIX : return "SEI_SUFFIX";
+ default : return "?";
+ }
+}
+
+/**
+ * @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
+ * 0 if the unit should be skipped, 1 otherwise
+ */
+static int hls_nal_unit(HEVCNAL *nal, AVCodecContext *avctx)
+{
+ GetBitContext *gb = &nal->gb;
+ int nuh_layer_id;
+
+ if (get_bits1(gb) != 0)
+ return AVERROR_INVALIDDATA;
+
+ nal->type = get_bits(gb, 6);
+
+ nuh_layer_id = get_bits(gb, 6);
+ nal->temporal_id = get_bits(gb, 3) - 1;
+ if (nal->temporal_id < 0)
+ return AVERROR_INVALIDDATA;
+
+ av_log(avctx, AV_LOG_DEBUG,
+ "nal_unit_type: %d(%s), nuh_layer_id: %d, temporal_id: %d\n",
+ nal->type, nal_unit_name(nal->type), nuh_layer_id, nal->temporal_id);
+
+ return nuh_layer_id == 0;
+}
+
+
+int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length,
+ AVCodecContext *avctx, int is_nalff, int nal_length_size)
+{
+ int consumed, ret = 0;
+
+ pkt->nb_nals = 0;
+ while (length >= 4) {
+ HEVCNAL *nal;
+ int extract_length = 0;
+
+ if (is_nalff) {
+ int i;
+ for (i = 0; i < nal_length_size; i++)
+ extract_length = (extract_length << 8) | buf[i];
+ buf += nal_length_size;
+ length -= nal_length_size;
+
+ if (extract_length > length) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ } else {
+ /* search start code */
+ while (buf[0] != 0 || buf[1] != 0 || buf[2] != 1) {
+ ++buf;
+ --length;
+ if (length < 4) {
+ av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ buf += 3;
+ length -= 3;
+ extract_length = length;
+ }
+
+ if (pkt->nals_allocated < pkt->nb_nals + 1) {
+ int new_size = pkt->nals_allocated + 1;
+ void *tmp = av_realloc_array(pkt->nals, new_size, sizeof(*pkt->nals));
+
+ if (!tmp)
+ return AVERROR(ENOMEM);
+
+ pkt->nals = tmp;
+ memset(pkt->nals + pkt->nals_allocated, 0,
+ (new_size - pkt->nals_allocated) * sizeof(*pkt->nals));
+
+ nal = &pkt->nals[pkt->nb_nals];
+ nal->skipped_bytes_pos_size = 1024; // initial buffer size
+ nal->skipped_bytes_pos = av_malloc_array(nal->skipped_bytes_pos_size, sizeof(*nal->skipped_bytes_pos));
+ if (!nal->skipped_bytes_pos)
+ return AVERROR(ENOMEM);
+
+ pkt->nals_allocated = new_size;
+ }
+ nal = &pkt->nals[pkt->nb_nals];
+
+ consumed = ff_hevc_extract_rbsp(s, buf, extract_length, nal);
+ if (consumed < 0)
+ return consumed;
+
+ pkt->nb_nals++;
+
+ ret = init_get_bits8(&nal->gb, nal->data, nal->size);
+ if (ret < 0)
+ return ret;
+
+ ret = hls_nal_unit(nal, avctx);
+ if (ret <= 0) {
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
+ nal->type);
+ }
+ pkt->nb_nals--;
+ }
+
+ buf += consumed;
+ length -= consumed;
+ }
+
+ return 0;
+}
+
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_parser.c b/chromium/third_party/ffmpeg/libavcodec/hevc_parser.c
index 3c7c3c377d4..fc107978c69 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_parser.c
@@ -22,16 +22,112 @@
#include "libavutil/common.h"
-#include "parser.h"
-#include "hevc.h"
#include "golomb.h"
+#include "hevc.h"
+#include "parser.h"
#define START_CODE 0x000001 ///< start_code_prefix_one_3bytes
-typedef struct HEVCParseContext {
- HEVCContext h;
+#define IS_IRAP_NAL(nal) (nal->type >= 16 && nal->type <= 23)
+
+#define ADVANCED_PARSER CONFIG_HEVC_DECODER
+
+typedef struct HEVCParserContext {
ParseContext pc;
-} HEVCParseContext;
+
+ HEVCPacket pkt;
+ HEVCParamSets ps;
+
+ int parsed_extradata;
+
+#if ADVANCED_PARSER
+ HEVCContext h;
+#endif
+} HEVCParserContext;
+
+#if !ADVANCED_PARSER
+static int hevc_parse_slice_header(AVCodecParserContext *s, HEVCNAL *nal,
+ AVCodecContext *avctx)
+{
+ HEVCParserContext *ctx = s->priv_data;
+ GetBitContext *gb = &nal->gb;
+
+ HEVCPPS *pps;
+ HEVCSPS *sps;
+ unsigned int pps_id;
+
+ get_bits1(gb); // first slice in pic
+ if (IS_IRAP_NAL(nal))
+ get_bits1(gb); // no output of prior pics
+
+ pps_id = get_ue_golomb_long(gb);
+ if (pps_id >= MAX_PPS_COUNT || !ctx->ps.pps_list[pps_id]) {
+ av_log(avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id);
+ return AVERROR_INVALIDDATA;
+ }
+ pps = (HEVCPPS*)ctx->ps.pps_list[pps_id]->data;
+ sps = (HEVCSPS*)ctx->ps.sps_list[pps->sps_id]->data;
+
+ /* export the stream parameters */
+ s->coded_width = sps->width;
+ s->coded_height = sps->height;
+ s->width = sps->output_width;
+ s->height = sps->output_height;
+ s->format = sps->pix_fmt;
+ avctx->profile = sps->ptl.general_ptl.profile_idc;
+ avctx->level = sps->ptl.general_ptl.level_idc;
+
+ /* ignore the rest for now*/
+
+ return 0;
+}
+
+static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
+ int buf_size, AVCodecContext *avctx)
+{
+ HEVCParserContext *ctx = s->priv_data;
+ int ret, i;
+
+ ret = ff_hevc_split_packet(NULL, &ctx->pkt, buf, buf_size, avctx, 0, 0);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < ctx->pkt.nb_nals; i++) {
+ HEVCNAL *nal = &ctx->pkt.nals[i];
+
+ /* ignore everything except parameter sets and VCL NALUs */
+ switch (nal->type) {
+ case NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, avctx, &ctx->ps); break;
+ case NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, avctx, &ctx->ps, 1); break;
+ case NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, avctx, &ctx->ps); break;
+ case NAL_TRAIL_R:
+ case NAL_TRAIL_N:
+ case NAL_TSA_N:
+ case NAL_TSA_R:
+ case NAL_STSA_N:
+ case NAL_STSA_R:
+ case NAL_BLA_W_LP:
+ case NAL_BLA_W_RADL:
+ case NAL_BLA_N_LP:
+ case NAL_IDR_W_RADL:
+ case NAL_IDR_N_LP:
+ case NAL_CRA_NUT:
+ case NAL_RADL_N:
+ case NAL_RADL_R:
+ case NAL_RASL_N:
+ case NAL_RASL_R:
+ if (buf == avctx->extradata) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit: %d\n", nal->type);
+ return AVERROR_INVALIDDATA;
+ }
+ hevc_parse_slice_header(s, nal, avctx);
+ break;
+ }
+ }
+
+ return 0;
+}
+#endif
/**
* Find the end of the current frame in the bitstream.
@@ -41,7 +137,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
int buf_size)
{
int i;
- ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
+ ParseContext *pc = s->priv_data;
for (i = 0; i < buf_size; i++) {
int nut;
@@ -76,6 +172,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
return END_NOT_FOUND;
}
+#if ADVANCED_PARSER
/**
* Parse NAL units of found picture and decode some basic information.
*
@@ -84,15 +181,26 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
* @param buf buffer with field/frame data.
* @param buf_size size of the buffer.
*/
-static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
+ int buf_size, AVCodecContext *avctx)
{
- HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
- GetBitContext *gb = &h->HEVClc->gb;
- SliceHeader *sh = &h->sh;
+ HEVCParserContext *ctx = s->priv_data;
+ HEVCContext *h = &ctx->h;
+ GetBitContext *gb;
+ SliceHeader *sh = &h->sh;
+ HEVCParamSets *ps = &h->ps;
+ HEVCPacket *pkt = &ctx->pkt;
const uint8_t *buf_end = buf + buf_size;
int state = -1, i;
HEVCNAL *nal;
+ int is_global = buf == avctx->extradata;
+
+ if (!h->HEVClc)
+ h->HEVClc = av_mallocz(sizeof(HEVCLocalContext));
+ if (!h->HEVClc)
+ return AVERROR(ENOMEM);
+
+ gb = &h->HEVClc->gb;
/* set some sane default values */
s->pict_type = AV_PICTURE_TYPE_I;
@@ -104,19 +212,20 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
if (!buf_size)
return 0;
- if (h->nals_allocated < 1) {
- HEVCNAL *tmp = av_realloc_array(h->nals, 1, sizeof(*tmp));
+ if (pkt->nals_allocated < 1) {
+ HEVCNAL *tmp = av_realloc_array(pkt->nals, 1, sizeof(*tmp));
if (!tmp)
return AVERROR(ENOMEM);
- h->nals = tmp;
- memset(h->nals, 0, sizeof(*tmp));
- h->nals_allocated = 1;
+ pkt->nals = tmp;
+ memset(pkt->nals, 0, sizeof(*tmp));
+ pkt->nals_allocated = 1;
}
- nal = &h->nals[0];
+ nal = &pkt->nals[0];
for (;;) {
int src_length, consumed;
+ int ret;
buf = avpriv_find_start_code(buf, buf_end, &state);
if (--buf + 2 >= buf_end)
break;
@@ -130,20 +239,23 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
src_length = 20;
}
- consumed = ff_hevc_extract_rbsp(h, buf, src_length, nal);
+ consumed = ff_hevc_extract_rbsp(NULL, buf, src_length, nal);
if (consumed < 0)
return consumed;
- init_get_bits8(gb, nal->data + 2, nal->size);
+ ret = init_get_bits8(gb, nal->data + 2, nal->size);
+ if (ret < 0)
+ return ret;
+
switch (h->nal_unit_type) {
case NAL_VPS:
- ff_hevc_decode_nal_vps(h);
+ ff_hevc_decode_nal_vps(gb, avctx, ps);
break;
case NAL_SPS:
- ff_hevc_decode_nal_sps(h);
+ ff_hevc_decode_nal_sps(gb, avctx, ps, 1);
break;
case NAL_PPS:
- ff_hevc_decode_nal_pps(h);
+ ff_hevc_decode_nal_pps(gb, avctx, ps);
break;
case NAL_SEI_PREFIX:
case NAL_SEI_SUFFIX:
@@ -165,6 +277,12 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
case NAL_IDR_W_RADL:
case NAL_IDR_N_LP:
case NAL_CRA_NUT:
+
+ if (is_global) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit: %d\n", h->nal_unit_type);
+ return AVERROR_INVALIDDATA;
+ }
+
sh->first_slice_in_pic_flag = get_bits1(gb);
s->picture_structure = h->picture_struct;
s->field_order = h->picture_struct;
@@ -175,34 +293,34 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
}
sh->pps_id = get_ue_golomb(gb);
- if (sh->pps_id >= MAX_PPS_COUNT || !h->pps_list[sh->pps_id]) {
- av_log(h->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
+ if (sh->pps_id >= MAX_PPS_COUNT || !ps->pps_list[sh->pps_id]) {
+ av_log(avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
return AVERROR_INVALIDDATA;
}
- h->pps = (HEVCPPS*)h->pps_list[sh->pps_id]->data;
+ ps->pps = (HEVCPPS*)ps->pps_list[sh->pps_id]->data;
- if (h->pps->sps_id >= MAX_SPS_COUNT || !h->sps_list[h->pps->sps_id]) {
- av_log(h->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", h->pps->sps_id);
+ if (ps->pps->sps_id >= MAX_SPS_COUNT || !ps->sps_list[ps->pps->sps_id]) {
+ av_log(avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", ps->pps->sps_id);
return AVERROR_INVALIDDATA;
}
- if (h->sps != (HEVCSPS*)h->sps_list[h->pps->sps_id]->data) {
- h->sps = (HEVCSPS*)h->sps_list[h->pps->sps_id]->data;
- h->vps = (HEVCVPS*)h->vps_list[h->sps->vps_id]->data;
+ if (ps->sps != (HEVCSPS*)ps->sps_list[ps->pps->sps_id]->data) {
+ ps->sps = (HEVCSPS*)ps->sps_list[ps->pps->sps_id]->data;
+ ps->vps = (HEVCVPS*)ps->vps_list[ps->sps->vps_id]->data;
}
if (!sh->first_slice_in_pic_flag) {
int slice_address_length;
- if (h->pps->dependent_slice_segments_enabled_flag)
+ if (ps->pps->dependent_slice_segments_enabled_flag)
sh->dependent_slice_segment_flag = get_bits1(gb);
else
sh->dependent_slice_segment_flag = 0;
- slice_address_length = av_ceil_log2_c(h->sps->ctb_width *
- h->sps->ctb_height);
- sh->slice_segment_addr = get_bits(gb, slice_address_length);
- if (sh->slice_segment_addr >= h->sps->ctb_width * h->sps->ctb_height) {
- av_log(h->avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n",
+ slice_address_length = av_ceil_log2_c(ps->sps->ctb_width *
+ ps->sps->ctb_height);
+ sh->slice_segment_addr = slice_address_length ? get_bits(gb, slice_address_length) : 0;
+ if (sh->slice_segment_addr >= ps->sps->ctb_width * ps->sps->ctb_height) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n",
sh->slice_segment_addr);
return AVERROR_INVALIDDATA;
}
@@ -212,13 +330,13 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
if (sh->dependent_slice_segment_flag)
break;
- for (i = 0; i < h->pps->num_extra_slice_header_bits; i++)
+ for (i = 0; i < ps->pps->num_extra_slice_header_bits; i++)
skip_bits(gb, 1); // slice_reserved_undetermined_flag[]
sh->slice_type = get_ue_golomb(gb);
if (!(sh->slice_type == I_SLICE || sh->slice_type == P_SLICE ||
sh->slice_type == B_SLICE)) {
- av_log(h->avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",
+ av_log(avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",
sh->slice_type);
return AVERROR_INVALIDDATA;
}
@@ -226,14 +344,14 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
sh->slice_type == P_SLICE ? AV_PICTURE_TYPE_P :
AV_PICTURE_TYPE_I;
- if (h->pps->output_flag_present_flag)
+ if (ps->pps->output_flag_present_flag)
sh->pic_output_flag = get_bits1(gb);
- if (h->sps->separate_colour_plane_flag)
+ if (ps->sps->separate_colour_plane_flag)
sh->colour_plane_id = get_bits(gb, 2);
if (!IS_IDR(h)) {
- sh->pic_order_cnt_lsb = get_bits(gb, h->sps->log2_max_poc_lsb);
+ sh->pic_order_cnt_lsb = get_bits(gb, ps->sps->log2_max_poc_lsb);
s->output_picture_number = h->poc = ff_hevc_compute_poc(h, sh->pic_order_cnt_lsb);
} else
s->output_picture_number = h->poc = 0;
@@ -253,9 +371,11 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
buf += consumed;
}
/* didn't find a picture! */
- av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
+ if (!is_global)
+ av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
return -1;
}
+#endif
static int hevc_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
@@ -263,7 +383,13 @@ static int hevc_parse(AVCodecParserContext *s,
const uint8_t *buf, int buf_size)
{
int next;
- ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
+ HEVCParserContext *ctx = s->priv_data;
+ ParseContext *pc = &ctx->pc;
+
+ if (avctx->extradata && !ctx->parsed_extradata) {
+ parse_nal_units(s, avctx->extradata, avctx->extradata_size, avctx);
+ ctx->parsed_extradata = 1;
+ }
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
@@ -276,7 +402,7 @@ static int hevc_parse(AVCodecParserContext *s,
}
}
- parse_nal_units(s, avctx, buf, buf_size);
+ parse_nal_units(s, buf, buf_size, avctx);
*poutbuf = buf;
*poutbuf_size = buf_size;
@@ -288,64 +414,77 @@ static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
{
const uint8_t *ptr = buf, *end = buf + buf_size;
uint32_t state = -1;
- int has_ps = 0, nut;
+ int has_vps = 0;
+ int has_sps = 0;
+ int has_pps = 0;
+ int nut;
while (ptr < end) {
ptr = avpriv_find_start_code(ptr, end, &state);
if ((state >> 8) != START_CODE)
break;
nut = (state >> 1) & 0x3F;
- if (nut >= NAL_VPS && nut <= NAL_PPS)
- has_ps = 1;
- else if (has_ps)
- return ptr - 4 - buf;
- else // no parameter set at the beginning of the stream
- return 0;
+ if (nut == NAL_VPS)
+ has_vps = 1;
+ else if (nut == NAL_SPS)
+ has_sps = 1;
+ else if (nut == NAL_PPS)
+ has_pps = 1;
+ else if ((nut != NAL_SEI_PREFIX || has_pps) &&
+ nut != NAL_AUD) {
+ if (has_vps && has_sps) {
+ while (ptr - 4 > buf && ptr[-5] == 0)
+ ptr--;
+ return ptr - 4 - buf;
+ }
+ }
}
return 0;
}
-static int hevc_init(AVCodecParserContext *s)
+static void hevc_parser_close(AVCodecParserContext *s)
{
- HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
- h->HEVClc = av_mallocz(sizeof(HEVCLocalContext));
- if (!h->HEVClc)
- return AVERROR(ENOMEM);
- h->skipped_bytes_pos_size = INT_MAX;
+ HEVCParserContext *ctx = s->priv_data;
+ int i;
- return 0;
-}
+#if ADVANCED_PARSER
+ HEVCContext *h = &ctx->h;
-static void hevc_close(AVCodecParserContext *s)
-{
- int i;
- HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
- ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.vps_list); i++)
+ av_buffer_unref(&h->ps.vps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.sps_list); i++)
+ av_buffer_unref(&h->ps.sps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(h->ps.pps_list); i++)
+ av_buffer_unref(&h->ps.pps_list[i]);
+
+ h->ps.sps = NULL;
- av_freep(&h->skipped_bytes_pos);
av_freep(&h->HEVClc);
- av_freep(&pc->buffer);
+#endif
- for (i = 0; i < FF_ARRAY_ELEMS(h->vps_list); i++)
- av_buffer_unref(&h->vps_list[i]);
- for (i = 0; i < FF_ARRAY_ELEMS(h->sps_list); i++)
- av_buffer_unref(&h->sps_list[i]);
- for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++)
- av_buffer_unref(&h->pps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.vps_list); i++)
+ av_buffer_unref(&ctx->ps.vps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.sps_list); i++)
+ av_buffer_unref(&ctx->ps.sps_list[i]);
+ for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.pps_list); i++)
+ av_buffer_unref(&ctx->ps.pps_list[i]);
- h->sps = NULL;
+ ctx->ps.sps = NULL;
+
+ for (i = 0; i < ctx->pkt.nals_allocated; i++) {
+ av_freep(&ctx->pkt.nals[i].rbsp_buffer);
+ av_freep(&ctx->pkt.nals[i].skipped_bytes_pos);
+ }
+ av_freep(&ctx->pkt.nals);
+ ctx->pkt.nals_allocated = 0;
- for (i = 0; i < h->nals_allocated; i++)
- av_freep(&h->nals[i].rbsp_buffer);
- av_freep(&h->nals);
- h->nals_allocated = 0;
+ av_freep(&ctx->pc.buffer);
}
AVCodecParser ff_hevc_parser = {
.codec_ids = { AV_CODEC_ID_HEVC },
- .priv_data_size = sizeof(HEVCParseContext),
- .parser_init = hevc_init,
+ .priv_data_size = sizeof(HEVCParserContext),
.parser_parse = hevc_parse,
- .parser_close = hevc_close,
+ .parser_close = hevc_parser_close,
.split = hevc_split,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
index ced0600e322..427cf098aa7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
@@ -69,14 +69,14 @@ static const AVRational vui_sar[] = {
{ 2, 1 },
};
-static void remove_pps(HEVCContext *s, int id)
+static void remove_pps(HEVCParamSets *s, int id)
{
if (s->pps_list[id] && s->pps == (const HEVCPPS*)s->pps_list[id]->data)
s->pps = NULL;
av_buffer_unref(&s->pps_list[id]);
}
-static void remove_sps(HEVCContext *s, int id)
+static void remove_sps(HEVCParamSets *s, int id)
{
int i;
if (s->sps_list[id]) {
@@ -93,7 +93,7 @@ static void remove_sps(HEVCContext *s, int id)
av_buffer_unref(&s->sps_list[id]);
}
-static void remove_vps(HEVCContext *s, int id)
+static void remove_vps(HEVCParamSets *s, int id)
{
int i;
if (s->vps_list[id]) {
@@ -107,10 +107,9 @@ static void remove_vps(HEVCContext *s, int id)
av_buffer_unref(&s->vps_list[id]);
}
-int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
- const HEVCSPS *sps, int is_slice_header)
+int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx,
+ ShortTermRPS *rps, const HEVCSPS *sps, int is_slice_header)
{
- HEVCLocalContext *lc = s->HEVClc;
uint8_t rps_predict = 0;
int delta_poc;
int k0 = 0;
@@ -118,8 +117,6 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
int k = 0;
int i;
- GetBitContext *gb = &lc->gb;
-
if (rps != sps->st_rps && sps->nb_st_rps)
rps_predict = get_bits1(gb);
@@ -133,19 +130,20 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
if (is_slice_header) {
unsigned int delta_idx = get_ue_golomb_long(gb) + 1;
if (delta_idx > sps->nb_st_rps) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Invalid value of delta_idx in slice header RPS: %d > %d.\n",
delta_idx, sps->nb_st_rps);
return AVERROR_INVALIDDATA;
}
rps_ridx = &sps->st_rps[sps->nb_st_rps - delta_idx];
+ rps->rps_idx_num_delta_pocs = rps_ridx->num_delta_pocs;
} else
rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];
delta_rps_sign = get_bits1(gb);
abs_delta_rps = get_ue_golomb_long(gb) + 1;
if (abs_delta_rps < 1 || abs_delta_rps > 32768) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Invalid value of abs_delta_rps: %d\n",
abs_delta_rps);
return AVERROR_INVALIDDATA;
@@ -211,7 +209,7 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
if (rps->num_negative_pics >= MAX_REFS ||
nb_positive_pics >= MAX_REFS) {
- av_log(s->avctx, AV_LOG_ERROR, "Too many refs in a short term RPS.\n");
+ av_log(avctx, AV_LOG_ERROR, "Too many refs in a short term RPS.\n");
return AVERROR_INVALIDDATA;
}
@@ -237,11 +235,10 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
}
-static int decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
+static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
+ PTLCommon *ptl)
{
int i;
- HEVCLocalContext *lc = s->HEVClc;
- GetBitContext *gb = &lc->gb;
if (get_bits_left(gb) < 2+1+5 + 32 + 4 + 16 + 16 + 12)
return -1;
@@ -250,15 +247,15 @@ static int decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
ptl->tier_flag = get_bits1(gb);
ptl->profile_idc = get_bits(gb, 5);
if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN)
- av_log(s->avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
+ av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10)
- av_log(s->avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
+ av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE)
- av_log(s->avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
+ av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT)
- av_log(s->avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n");
+ av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n");
else
- av_log(s->avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
+ av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
for (i = 0; i < 32; i++)
ptl->profile_compatibility_flag[i] = get_bits1(gb);
@@ -274,14 +271,13 @@ static int decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
return 0;
}
-static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
+static int parse_ptl(GetBitContext *gb, AVCodecContext *avctx,
+ PTL *ptl, int max_num_sub_layers)
{
int i;
- HEVCLocalContext *lc = s->HEVClc;
- GetBitContext *gb = &lc->gb;
- if (decode_profile_tier_level(s, &ptl->general_ptl) < 0 ||
+ if (decode_profile_tier_level(gb, avctx, &ptl->general_ptl) < 0 ||
get_bits_left(gb) < 8 + 8*2) {
- av_log(s->avctx, AV_LOG_ERROR, "PTL information too short\n");
+ av_log(avctx, AV_LOG_ERROR, "PTL information too short\n");
return -1;
}
@@ -297,14 +293,14 @@ static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
skip_bits(gb, 2); // reserved_zero_2bits[i]
for (i = 0; i < max_num_sub_layers - 1; i++) {
if (ptl->sub_layer_profile_present_flag[i] &&
- decode_profile_tier_level(s, &ptl->sub_layer_ptl[i]) < 0) {
- av_log(s->avctx, AV_LOG_ERROR,
+ decode_profile_tier_level(gb, avctx, &ptl->sub_layer_ptl[i]) < 0) {
+ av_log(avctx, AV_LOG_ERROR,
"PTL information for sublayer %i too short\n", i);
return -1;
}
if (ptl->sub_layer_level_present_flag[i]) {
if (get_bits_left(gb) < 8) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Not enough data for sublayer %i level_idc\n", i);
return -1;
} else
@@ -315,10 +311,9 @@ static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
return 0;
}
-static void decode_sublayer_hrd(HEVCContext *s, unsigned int nb_cpb,
+static void decode_sublayer_hrd(GetBitContext *gb, unsigned int nb_cpb,
int subpic_params_present)
{
- GetBitContext *gb = &s->HEVClc->gb;
int i;
for (i = 0; i < nb_cpb; i++) {
@@ -333,10 +328,9 @@ static void decode_sublayer_hrd(HEVCContext *s, unsigned int nb_cpb,
}
}
-static int decode_hrd(HEVCContext *s, int common_inf_present,
+static int decode_hrd(GetBitContext *gb, int common_inf_present,
int max_sublayers)
{
- GetBitContext *gb = &s->HEVClc->gb;
int nal_params_present = 0, vcl_params_present = 0;
int subpic_params_present = 0;
int i;
@@ -383,23 +377,23 @@ static int decode_hrd(HEVCContext *s, int common_inf_present,
if (!low_delay) {
nb_cpb = get_ue_golomb_long(gb) + 1;
if (nb_cpb < 1 || nb_cpb > 32) {
- av_log(s->avctx, AV_LOG_ERROR, "nb_cpb %d invalid\n", nb_cpb);
+ av_log(NULL, AV_LOG_ERROR, "nb_cpb %d invalid\n", nb_cpb);
return AVERROR_INVALIDDATA;
}
}
if (nal_params_present)
- decode_sublayer_hrd(s, nb_cpb, subpic_params_present);
+ decode_sublayer_hrd(gb, nb_cpb, subpic_params_present);
if (vcl_params_present)
- decode_sublayer_hrd(s, nb_cpb, subpic_params_present);
+ decode_sublayer_hrd(gb, nb_cpb, subpic_params_present);
}
return 0;
}
-int ff_hevc_decode_nal_vps(HEVCContext *s)
+int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps)
{
int i,j;
- GetBitContext *gb = &s->HEVClc->gb;
int vps_id = 0;
HEVCVPS *vps;
AVBufferRef *vps_buf = av_buffer_allocz(sizeof(*vps));
@@ -408,16 +402,16 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
return AVERROR(ENOMEM);
vps = (HEVCVPS*)vps_buf->data;
- av_log(s->avctx, AV_LOG_DEBUG, "Decoding VPS\n");
+ av_log(avctx, AV_LOG_DEBUG, "Decoding VPS\n");
vps_id = get_bits(gb, 4);
if (vps_id >= MAX_VPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", vps_id);
+ av_log(avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", vps_id);
goto err;
}
if (get_bits(gb, 2) != 3) { // vps_reserved_three_2bits
- av_log(s->avctx, AV_LOG_ERROR, "vps_reserved_three_2bits is not three\n");
+ av_log(avctx, AV_LOG_ERROR, "vps_reserved_three_2bits is not three\n");
goto err;
}
@@ -426,17 +420,17 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
vps->vps_temporal_id_nesting_flag = get_bits1(gb);
if (get_bits(gb, 16) != 0xffff) { // vps_reserved_ffff_16bits
- av_log(s->avctx, AV_LOG_ERROR, "vps_reserved_ffff_16bits is not 0xffff\n");
+ av_log(avctx, AV_LOG_ERROR, "vps_reserved_ffff_16bits is not 0xffff\n");
goto err;
}
if (vps->vps_max_sub_layers > MAX_SUB_LAYERS) {
- av_log(s->avctx, AV_LOG_ERROR, "vps_max_sub_layers out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "vps_max_sub_layers out of range: %d\n",
vps->vps_max_sub_layers);
goto err;
}
- if (parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers) < 0)
+ if (parse_ptl(gb, avctx, &vps->ptl, vps->vps_max_sub_layers) < 0)
goto err;
vps->vps_sub_layer_ordering_info_present_flag = get_bits1(gb);
@@ -448,14 +442,14 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
vps->vps_max_latency_increase[i] = get_ue_golomb_long(gb) - 1;
if (vps->vps_max_dec_pic_buffering[i] > MAX_DPB_SIZE || !vps->vps_max_dec_pic_buffering[i]) {
- av_log(s->avctx, AV_LOG_ERROR, "vps_max_dec_pic_buffering_minus1 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "vps_max_dec_pic_buffering_minus1 out of range: %d\n",
vps->vps_max_dec_pic_buffering[i] - 1);
goto err;
}
if (vps->vps_num_reorder_pics[i] > vps->vps_max_dec_pic_buffering[i] - 1) {
- av_log(s->avctx, AV_LOG_WARNING, "vps_max_num_reorder_pics out of range: %d\n",
+ av_log(avctx, AV_LOG_WARNING, "vps_max_num_reorder_pics out of range: %d\n",
vps->vps_num_reorder_pics[i]);
- if (s->avctx->err_recognition & AV_EF_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
goto err;
}
}
@@ -464,7 +458,7 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
vps->vps_num_layer_sets = get_ue_golomb_long(gb) + 1;
if (vps->vps_num_layer_sets < 1 || vps->vps_num_layer_sets > 1024 ||
(vps->vps_num_layer_sets - 1LL) * (vps->vps_max_layer_id + 1LL) > get_bits_left(gb)) {
- av_log(s->avctx, AV_LOG_ERROR, "too many layer_id_included_flags\n");
+ av_log(avctx, AV_LOG_ERROR, "too many layer_id_included_flags\n");
goto err;
}
@@ -481,7 +475,7 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
vps->vps_num_ticks_poc_diff_one = get_ue_golomb_long(gb) + 1;
vps->vps_num_hrd_parameters = get_ue_golomb_long(gb);
if (vps->vps_num_hrd_parameters > (unsigned)vps->vps_num_layer_sets) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"vps_num_hrd_parameters %d is invalid\n", vps->vps_num_hrd_parameters);
goto err;
}
@@ -491,23 +485,24 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
get_ue_golomb_long(gb); // hrd_layer_set_idx
if (i)
common_inf_present = get_bits1(gb);
- decode_hrd(s, common_inf_present, vps->vps_max_sub_layers);
+ decode_hrd(gb, common_inf_present, vps->vps_max_sub_layers);
}
}
get_bits1(gb); /* vps_extension_flag */
if (get_bits_left(gb) < 0) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Overread VPS by %d bits\n", -get_bits_left(gb));
- goto err;
+ if (ps->vps_list[vps_id])
+ goto err;
}
- if (s->vps_list[vps_id] &&
- !memcmp(s->vps_list[vps_id]->data, vps_buf->data, vps_buf->size)) {
+ if (ps->vps_list[vps_id] &&
+ !memcmp(ps->vps_list[vps_id]->data, vps_buf->data, vps_buf->size)) {
av_buffer_unref(&vps_buf);
} else {
- remove_vps(s, vps_id);
- s->vps_list[vps_id] = vps_buf;
+ remove_vps(ps, vps_id);
+ ps->vps_list[vps_id] = vps_buf;
}
return 0;
@@ -517,14 +512,14 @@ err:
return AVERROR_INVALIDDATA;
}
-static void decode_vui(HEVCContext *s, HEVCSPS *sps)
+static void decode_vui(GetBitContext *gb, AVCodecContext *avctx,
+ int apply_defdispwin, HEVCSPS *sps)
{
VUI *vui = &sps->vui;
- GetBitContext *gb = &s->HEVClc->gb;
GetBitContext backup;
int sar_present, alt = 0;
- av_log(s->avctx, AV_LOG_DEBUG, "Decoding VUI\n");
+ av_log(avctx, AV_LOG_DEBUG, "Decoding VUI\n");
sar_present = get_bits1(gb);
if (sar_present) {
@@ -535,7 +530,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
vui->sar.num = get_bits(gb, 16);
vui->sar.den = get_bits(gb, 16);
} else
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"Unknown SAR index: %u.\n", sar_idx);
}
@@ -577,7 +572,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
if (get_bits_left(gb) >= 68 && show_bits_long(gb, 21) == 0x100000) {
vui->default_display_window_flag = 0;
- av_log(s->avctx, AV_LOG_WARNING, "Invalid default display window\n");
+ av_log(avctx, AV_LOG_WARNING, "Invalid default display window\n");
} else
vui->default_display_window_flag = get_bits1(gb);
// Backup context in case an alternate header is detected
@@ -590,9 +585,9 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
vui->def_disp_win.top_offset = get_ue_golomb_long(gb) * 2;
vui->def_disp_win.bottom_offset = get_ue_golomb_long(gb) * 2;
- if (s->apply_defdispwin &&
- s->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
- av_log(s->avctx, AV_LOG_DEBUG,
+ if (apply_defdispwin &&
+ avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) {
+ av_log(avctx, AV_LOG_DEBUG,
"discarding vui default display window, "
"original values are l:%u r:%u t:%u b:%u\n",
vui->def_disp_win.left_offset,
@@ -613,7 +608,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
if( get_bits_left(gb) < 66) {
// The alternate syntax seem to have timing info located
// at where def_disp_win is normally located
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"Strange VUI timing information, retrying...\n");
vui->default_display_window_flag = 0;
memset(&vui->def_disp_win, 0, sizeof(vui->def_disp_win));
@@ -623,7 +618,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
vui->vui_num_units_in_tick = get_bits_long(gb, 32);
vui->vui_time_scale = get_bits_long(gb, 32);
if (alt) {
- av_log(s->avctx, AV_LOG_INFO, "Retry got %i/%i fps\n",
+ av_log(avctx, AV_LOG_INFO, "Retry got %i/%i fps\n",
vui->vui_time_scale, vui->vui_num_units_in_tick);
}
vui->vui_poc_proportional_to_timing_flag = get_bits1(gb);
@@ -631,7 +626,7 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
vui->vui_num_ticks_poc_diff_one_minus1 = get_ue_golomb_long(gb);
vui->vui_hrd_parameters_present_flag = get_bits1(gb);
if (vui->vui_hrd_parameters_present_flag)
- decode_hrd(s, 1, sps->max_sub_layers);
+ decode_hrd(gb, 1, sps->max_sub_layers);
}
vui->bitstream_restriction_flag = get_bits1(gb);
@@ -677,9 +672,8 @@ static void set_default_scaling_list_data(ScalingList *sl)
memcpy(sl->sl[3][5], default_scaling_list_inter, 64);
}
-static int scaling_list_data(HEVCContext *s, ScalingList *sl, HEVCSPS *sps)
+static int scaling_list_data(GetBitContext *gb, AVCodecContext *avctx, ScalingList *sl, HEVCSPS *sps)
{
- GetBitContext *gb = &s->HEVClc->gb;
uint8_t scaling_list_pred_mode_flag;
int32_t scaling_list_dc_coef[2][6];
int size_id, matrix_id, pos;
@@ -695,7 +689,7 @@ static int scaling_list_data(HEVCContext *s, ScalingList *sl, HEVCSPS *sps)
if (delta) {
// Copy from previous array.
if (matrix_id < delta) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Invalid delta in scaling list data: %d.\n", delta);
return AVERROR_INVALIDDATA;
}
@@ -749,59 +743,94 @@ static int scaling_list_data(HEVCContext *s, ScalingList *sl, HEVCSPS *sps)
return 0;
}
-int ff_hevc_decode_nal_sps(HEVCContext *s)
+static int map_pixel_format(AVCodecContext *avctx, HEVCSPS *sps)
{
const AVPixFmtDescriptor *desc;
- GetBitContext *gb = &s->HEVClc->gb;
+ switch (sps->bit_depth) {
+ case 8:
+ if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY8;
+ if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P;
+ if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P;
+ if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P;
+ break;
+ case 9:
+ if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
+ if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P9;
+ if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P9;
+ if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P9;
+ break;
+ case 10:
+ if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
+ if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P10;
+ if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P10;
+ if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P10;
+ break;
+ case 12:
+ if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
+ if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P12;
+ if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P12;
+ if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P12;
+ break;
+ default:
+ av_log(avctx, AV_LOG_ERROR,
+ "4:2:0, 4:2:2, 4:4:4 supports are currently specified for 8, 10 and 12 bits.\n");
+ av_log(avctx, AV_LOG_ERROR,
+ "chroma_format_idc is %d, depth is %d",
+ sps->chroma_format_idc, sps->bit_depth);
+ return AVERROR_INVALIDDATA;
+ }
+
+ desc = av_pix_fmt_desc_get(sps->pix_fmt);
+ if (!desc)
+ return AVERROR(EINVAL);
+
+ sps->hshift[0] = sps->vshift[0] = 0;
+ sps->hshift[2] = sps->hshift[1] = desc->log2_chroma_w;
+ sps->vshift[2] = sps->vshift[1] = desc->log2_chroma_h;
+
+ sps->pixel_shift = sps->bit_depth > 8;
+
+ return 0;
+}
+
+int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
+ int apply_defdispwin, AVBufferRef **vps_list, AVCodecContext *avctx)
+{
int ret = 0;
- unsigned int sps_id = 0;
int log2_diff_max_min_transform_block_size;
int bit_depth_chroma, start, vui_present, sublayer_ordering_info;
int i;
- HEVCSPS *sps;
- AVBufferRef *sps_buf = av_buffer_allocz(sizeof(*sps));
-
- if (!sps_buf)
- return AVERROR(ENOMEM);
- sps = (HEVCSPS*)sps_buf->data;
-
- av_log(s->avctx, AV_LOG_DEBUG, "Decoding SPS\n");
-
// Coded parameters
sps->vps_id = get_bits(gb, 4);
if (sps->vps_id >= MAX_VPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", sps->vps_id);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", sps->vps_id);
+ return AVERROR_INVALIDDATA;
}
- if (!s->vps_list[sps->vps_id]) {
- av_log(s->avctx, AV_LOG_ERROR, "VPS %d does not exist\n",
+ if (vps_list && !vps_list[sps->vps_id]) {
+ av_log(avctx, AV_LOG_ERROR, "VPS %d does not exist\n",
sps->vps_id);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
sps->max_sub_layers = get_bits(gb, 3) + 1;
if (sps->max_sub_layers > MAX_SUB_LAYERS) {
- av_log(s->avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n",
sps->max_sub_layers);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
skip_bits1(gb); // temporal_id_nesting_flag
- if (parse_ptl(s, &sps->ptl, sps->max_sub_layers) < 0)
- goto err;
+ if ((ret = parse_ptl(gb, avctx, &sps->ptl, sps->max_sub_layers)) < 0)
+ return ret;
- sps_id = get_ue_golomb_long(gb);
- if (sps_id >= MAX_SPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", sps_id);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ *sps_id = get_ue_golomb_long(gb);
+ if (*sps_id >= MAX_SPS_COUNT) {
+ av_log(avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", *sps_id);
+ return AVERROR_INVALIDDATA;
}
sps->chroma_format_idc = get_ue_golomb_long(gb);
@@ -815,8 +844,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->width = get_ue_golomb_long(gb);
sps->height = get_ue_golomb_long(gb);
if ((ret = av_image_check_size(sps->width,
- sps->height, 0, s->avctx)) < 0)
- goto err;
+ sps->height, 0, avctx)) < 0)
+ return ret;
if (get_bits1(gb)) { // pic_conformance_flag
//TODO: * 2 is only valid for 420
@@ -825,8 +854,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->pic_conf_win.top_offset = get_ue_golomb_long(gb) * 2;
sps->pic_conf_win.bottom_offset = get_ue_golomb_long(gb) * 2;
- if (s->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
- av_log(s->avctx, AV_LOG_DEBUG,
+ if (avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) {
+ av_log(avctx, AV_LOG_DEBUG,
"discarding sps conformance window, "
"original values are l:%u r:%u t:%u b:%u\n",
sps->pic_conf_win.left_offset,
@@ -845,64 +874,22 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->bit_depth = get_ue_golomb_long(gb) + 8;
bit_depth_chroma = get_ue_golomb_long(gb) + 8;
if (sps->chroma_format_idc && bit_depth_chroma != sps->bit_depth) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Luma bit depth (%d) is different from chroma bit depth (%d), "
"this is unsupported.\n",
sps->bit_depth, bit_depth_chroma);
- ret = AVERROR_INVALIDDATA;
- goto err;
- }
-
- switch (sps->bit_depth) {
- case 8:
- if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY8;
- if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P;
- if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P;
- if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P;
- break;
- case 9:
- if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
- if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P9;
- if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P9;
- if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P9;
- break;
- case 10:
- if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
- if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P10;
- if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P10;
- if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P10;
- break;
- case 12:
- if (sps->chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY16;
- if (sps->chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P12;
- if (sps->chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P12;
- if (sps->chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P12;
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR,
- "4:2:0, 4:2:2, 4:4:4 supports are currently specified for 8, 10 and 12 bits.\n");
- ret = AVERROR_PATCHWELCOME;
- goto err;
- }
-
- desc = av_pix_fmt_desc_get(sps->pix_fmt);
- if (!desc) {
- ret = AVERROR(EINVAL);
- goto err;
+ return AVERROR_INVALIDDATA;
}
- sps->hshift[0] = sps->vshift[0] = 0;
- sps->hshift[2] = sps->hshift[1] = desc->log2_chroma_w;
- sps->vshift[2] = sps->vshift[1] = desc->log2_chroma_h;
-
- sps->pixel_shift = sps->bit_depth > 8;
+ ret = map_pixel_format(avctx, sps);
+ if (ret < 0)
+ return ret;
sps->log2_max_poc_lsb = get_ue_golomb_long(gb) + 4;
if (sps->log2_max_poc_lsb > 16) {
- av_log(s->avctx, AV_LOG_ERROR, "log2_max_pic_order_cnt_lsb_minus4 out range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "log2_max_pic_order_cnt_lsb_minus4 out range: %d\n",
sps->log2_max_poc_lsb - 4);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
sublayer_ordering_info = get_bits1(gb);
@@ -912,18 +899,16 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->temporal_layer[i].num_reorder_pics = get_ue_golomb_long(gb);
sps->temporal_layer[i].max_latency_increase = get_ue_golomb_long(gb) - 1;
if (sps->temporal_layer[i].max_dec_pic_buffering > MAX_DPB_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, "sps_max_dec_pic_buffering_minus1 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "sps_max_dec_pic_buffering_minus1 out of range: %d\n",
sps->temporal_layer[i].max_dec_pic_buffering - 1);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
if (sps->temporal_layer[i].num_reorder_pics > sps->temporal_layer[i].max_dec_pic_buffering - 1) {
- av_log(s->avctx, AV_LOG_WARNING, "sps_max_num_reorder_pics out of range: %d\n",
+ av_log(avctx, AV_LOG_WARNING, "sps_max_num_reorder_pics out of range: %d\n",
sps->temporal_layer[i].num_reorder_pics);
- if (s->avctx->err_recognition & AV_EF_EXPLODE ||
+ if (avctx->err_recognition & AV_EF_EXPLODE ||
sps->temporal_layer[i].num_reorder_pics > MAX_DPB_SIZE - 1) {
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
sps->temporal_layer[i].max_dec_pic_buffering = sps->temporal_layer[i].num_reorder_pics + 1;
}
@@ -945,27 +930,23 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->log2_min_tb_size;
if (sps->log2_min_cb_size < 3 || sps->log2_min_cb_size > 30) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for log2_min_cb_size", sps->log2_min_cb_size);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "Invalid value %d for log2_min_cb_size", sps->log2_min_cb_size);
+ return AVERROR_INVALIDDATA;
}
if (sps->log2_diff_max_min_coding_block_size > 30) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for log2_diff_max_min_coding_block_size", sps->log2_diff_max_min_coding_block_size);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "Invalid value %d for log2_diff_max_min_coding_block_size", sps->log2_diff_max_min_coding_block_size);
+ return AVERROR_INVALIDDATA;
}
if (sps->log2_min_tb_size >= sps->log2_min_cb_size || sps->log2_min_tb_size < 2) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid value for log2_min_tb_size");
- ret = AVERROR_INVALIDDATA;
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "Invalid value for log2_min_tb_size");
+ return AVERROR_INVALIDDATA;
}
if (log2_diff_max_min_transform_block_size < 0 || log2_diff_max_min_transform_block_size > 30) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid value %d for log2_diff_max_min_transform_block_size", log2_diff_max_min_transform_block_size);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "Invalid value %d for log2_diff_max_min_transform_block_size", log2_diff_max_min_transform_block_size);
+ return AVERROR_INVALIDDATA;
}
sps->max_transform_hierarchy_depth_inter = get_ue_golomb_long(gb);
@@ -976,9 +957,9 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
set_default_scaling_list_data(&sps->scaling_list);
if (get_bits1(gb)) {
- ret = scaling_list_data(s, &sps->scaling_list, sps);
+ ret = scaling_list_data(gb, avctx, &sps->scaling_list, sps);
if (ret < 0)
- goto err;
+ return ret;
}
}
@@ -993,11 +974,10 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->pcm.log2_max_pcm_cb_size = sps->pcm.log2_min_pcm_cb_size +
get_ue_golomb_long(gb);
if (sps->pcm.bit_depth > sps->bit_depth) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"PCM bit depth (%d) is greater than normal bit depth (%d)\n",
sps->pcm.bit_depth, sps->bit_depth);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
sps->pcm.loop_filter_disable_flag = get_bits1(gb);
@@ -1005,24 +985,23 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->nb_st_rps = get_ue_golomb_long(gb);
if (sps->nb_st_rps > MAX_SHORT_TERM_RPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "Too many short term RPS: %d.\n",
+ av_log(avctx, AV_LOG_ERROR, "Too many short term RPS: %d.\n",
sps->nb_st_rps);
- ret = AVERROR_INVALIDDATA;
- goto err;
+ return AVERROR_INVALIDDATA;
}
for (i = 0; i < sps->nb_st_rps; i++) {
- if ((ret = ff_hevc_decode_short_term_rps(s, &sps->st_rps[i],
+ if ((ret = ff_hevc_decode_short_term_rps(gb, avctx, &sps->st_rps[i],
sps, 0)) < 0)
- goto err;
+ return ret;
}
sps->long_term_ref_pics_present_flag = get_bits1(gb);
if (sps->long_term_ref_pics_present_flag) {
sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
if (sps->num_long_term_ref_pics_sps > 31U) {
- av_log(s->avctx, AV_LOG_ERROR, "num_long_term_ref_pics_sps %d is out of range.\n",
+ av_log(avctx, AV_LOG_ERROR, "num_long_term_ref_pics_sps %d is out of range.\n",
sps->num_long_term_ref_pics_sps);
- goto err;
+ return AVERROR_INVALIDDATA;
}
for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
sps->lt_ref_pic_poc_lsb_sps[i] = get_bits(gb, sps->log2_max_poc_lsb);
@@ -1035,7 +1014,7 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->vui.sar = (AVRational){0, 1};
vui_present = get_bits1(gb);
if (vui_present)
- decode_vui(s, sps);
+ decode_vui(gb, avctx, apply_defdispwin, sps);
if (get_bits1(gb)) { // sps_extension_flag
int sps_extension_flag[1];
@@ -1055,33 +1034,33 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
extended_precision_processing_flag = get_bits1(gb);
if (extended_precision_processing_flag)
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"extended_precision_processing_flag not yet implemented\n");
sps->intra_smoothing_disabled_flag = get_bits1(gb);
high_precision_offsets_enabled_flag = get_bits1(gb);
if (high_precision_offsets_enabled_flag)
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"high_precision_offsets_enabled_flag not yet implemented\n");
sps->persistent_rice_adaptation_enabled_flag = get_bits1(gb);
cabac_bypass_alignment_enabled_flag = get_bits1(gb);
if (cabac_bypass_alignment_enabled_flag)
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"cabac_bypass_alignment_enabled_flag not yet implemented\n");
}
}
- if (s->apply_defdispwin) {
+ if (apply_defdispwin) {
sps->output_window.left_offset += sps->vui.def_disp_win.left_offset;
sps->output_window.right_offset += sps->vui.def_disp_win.right_offset;
sps->output_window.top_offset += sps->vui.def_disp_win.top_offset;
sps->output_window.bottom_offset += sps->vui.def_disp_win.bottom_offset;
}
if (sps->output_window.left_offset & (0x1F >> (sps->pixel_shift)) &&
- !(s->avctx->flags & CODEC_FLAG_UNALIGNED)) {
+ !(avctx->flags & AV_CODEC_FLAG_UNALIGNED)) {
sps->output_window.left_offset &= ~(0x1F >> (sps->pixel_shift));
- av_log(s->avctx, AV_LOG_WARNING, "Reducing left output window to %d "
+ av_log(avctx, AV_LOG_WARNING, "Reducing left output window to %d "
"chroma samples to preserve alignment.\n",
sps->output_window.left_offset);
}
@@ -1091,13 +1070,12 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
(sps->output_window.top_offset + sps->output_window.bottom_offset);
if (sps->width <= sps->output_window.left_offset + (int64_t)sps->output_window.right_offset ||
sps->height <= sps->output_window.top_offset + (int64_t)sps->output_window.bottom_offset) {
- av_log(s->avctx, AV_LOG_WARNING, "Invalid visible frame dimensions: %dx%d.\n",
+ av_log(avctx, AV_LOG_WARNING, "Invalid visible frame dimensions: %dx%d.\n",
sps->output_width, sps->output_height);
- if (s->avctx->err_recognition & AV_EF_EXPLODE) {
- ret = AVERROR_INVALIDDATA;
- goto err;
+ if (avctx->err_recognition & AV_EF_EXPLODE) {
+ return AVERROR_INVALIDDATA;
}
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"Displaying the whole video surface.\n");
memset(&sps->pic_conf_win, 0, sizeof(sps->pic_conf_win));
memset(&sps->output_window, 0, sizeof(sps->output_window));
@@ -1111,16 +1089,16 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->log2_min_pu_size = sps->log2_min_cb_size - 1;
if (sps->log2_ctb_size > MAX_LOG2_CTB_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, "CTB size out of range: 2^%d\n", sps->log2_ctb_size);
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "CTB size out of range: 2^%d\n", sps->log2_ctb_size);
+ return AVERROR_INVALIDDATA;
}
if (sps->log2_ctb_size < 4) {
- av_log(s->avctx,
+ av_log(avctx,
AV_LOG_ERROR,
"log2_ctb_size %d differs from the bounds of any known profile\n",
sps->log2_ctb_size);
- avpriv_request_sample(s->avctx, "log2_ctb_size %d", sps->log2_ctb_size);
- goto err;
+ avpriv_request_sample(avctx, "log2_ctb_size %d", sps->log2_ctb_size);
+ return AVERROR_INVALIDDATA;
}
sps->ctb_width = (sps->width + (1 << sps->log2_ctb_size) - 1) >> sps->log2_ctb_size;
@@ -1139,35 +1117,60 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (av_mod_uintp2(sps->width, sps->log2_min_cb_size) ||
av_mod_uintp2(sps->height, sps->log2_min_cb_size)) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid coded frame dimensions.\n");
- goto err;
+ av_log(avctx, AV_LOG_ERROR, "Invalid coded frame dimensions.\n");
+ return AVERROR_INVALIDDATA;
}
if (sps->max_transform_hierarchy_depth_inter > sps->log2_ctb_size - sps->log2_min_tb_size) {
- av_log(s->avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_inter out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_inter out of range: %d\n",
sps->max_transform_hierarchy_depth_inter);
- goto err;
+ return AVERROR_INVALIDDATA;
}
if (sps->max_transform_hierarchy_depth_intra > sps->log2_ctb_size - sps->log2_min_tb_size) {
- av_log(s->avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_intra out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_intra out of range: %d\n",
sps->max_transform_hierarchy_depth_intra);
- goto err;
+ return AVERROR_INVALIDDATA;
}
if (sps->log2_max_trafo_size > FFMIN(sps->log2_ctb_size, 5)) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"max transform block size out of range: %d\n",
sps->log2_max_trafo_size);
- goto err;
+ return AVERROR_INVALIDDATA;
}
if (get_bits_left(gb) < 0) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Overread SPS by %d bits\n", -get_bits_left(gb));
- goto err;
+ return AVERROR_INVALIDDATA;
}
- if (s->avctx->debug & FF_DEBUG_BITSTREAM) {
- av_log(s->avctx, AV_LOG_DEBUG,
+ return 0;
+}
+
+int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps, int apply_defdispwin)
+{
+ HEVCSPS *sps;
+ AVBufferRef *sps_buf = av_buffer_allocz(sizeof(*sps));
+ unsigned int sps_id;
+ int ret;
+
+ if (!sps_buf)
+ return AVERROR(ENOMEM);
+ sps = (HEVCSPS*)sps_buf->data;
+
+ av_log(avctx, AV_LOG_DEBUG, "Decoding SPS\n");
+
+ ret = ff_hevc_parse_sps(sps, gb, &sps_id,
+ apply_defdispwin,
+ ps->vps_list, avctx);
+ if (ret < 0) {
+ av_buffer_unref(&sps_buf);
+ return ret;
+ }
+
+ if (avctx->debug & FF_DEBUG_BITSTREAM) {
+ av_log(avctx, AV_LOG_DEBUG,
"Parsed SPS: id %d; coded wxh: %dx%d; "
"cropped wxh: %dx%d; pix_fmt: %s.\n",
sps_id, sps->width, sps->height,
@@ -1178,19 +1181,15 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
/* check if this is a repeat of an already parsed SPS, then keep the
* original one.
* otherwise drop all PPSes that depend on it */
- if (s->sps_list[sps_id] &&
- !memcmp(s->sps_list[sps_id]->data, sps_buf->data, sps_buf->size)) {
+ if (ps->sps_list[sps_id] &&
+ !memcmp(ps->sps_list[sps_id]->data, sps_buf->data, sps_buf->size)) {
av_buffer_unref(&sps_buf);
} else {
- remove_sps(s, sps_id);
- s->sps_list[sps_id] = sps_buf;
+ remove_sps(ps, sps_id);
+ ps->sps_list[sps_id] = sps_buf;
}
return 0;
-
-err:
- av_buffer_unref(&sps_buf);
- return ret;
}
static void hevc_pps_free(void *opaque, uint8_t *data)
@@ -1211,8 +1210,8 @@ static void hevc_pps_free(void *opaque, uint8_t *data)
av_freep(&pps);
}
-static int pps_range_extensions(HEVCContext *s, HEVCPPS *pps, HEVCSPS *sps) {
- GetBitContext *gb = &s->HEVClc->gb;
+static int pps_range_extensions(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCPPS *pps, HEVCSPS *sps) {
int i;
if (pps->transform_skip_enabled_flag) {
@@ -1224,19 +1223,19 @@ static int pps_range_extensions(HEVCContext *s, HEVCPPS *pps, HEVCSPS *sps) {
pps->diff_cu_chroma_qp_offset_depth = get_ue_golomb_long(gb);
pps->chroma_qp_offset_list_len_minus1 = get_ue_golomb_long(gb);
if (pps->chroma_qp_offset_list_len_minus1 && pps->chroma_qp_offset_list_len_minus1 >= 5) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"chroma_qp_offset_list_len_minus1 shall be in the range [0, 5].\n");
return AVERROR_INVALIDDATA;
}
for (i = 0; i <= pps->chroma_qp_offset_list_len_minus1; i++) {
pps->cb_qp_offset_list[i] = get_se_golomb_long(gb);
if (pps->cb_qp_offset_list[i]) {
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"cb_qp_offset_list not tested yet.\n");
}
pps->cr_qp_offset_list[i] = get_se_golomb_long(gb);
if (pps->cr_qp_offset_list[i]) {
- av_log(s->avctx, AV_LOG_WARNING,
+ av_log(avctx, AV_LOG_WARNING,
"cb_qp_offset_list not tested yet.\n");
}
}
@@ -1247,14 +1246,143 @@ static int pps_range_extensions(HEVCContext *s, HEVCPPS *pps, HEVCSPS *sps) {
return(0);
}
-int ff_hevc_decode_nal_pps(HEVCContext *s)
+static inline int setup_pps(AVCodecContext *avctx, GetBitContext *gb,
+ HEVCPPS *pps, HEVCSPS *sps)
{
- GetBitContext *gb = &s->HEVClc->gb;
- HEVCSPS *sps = NULL;
+ int log2_diff;
int pic_area_in_ctbs;
- int log2_diff_ctb_min_tb_size;
int i, j, x, y, ctb_addr_rs, tile_id;
- int ret = 0;
+
+ // Inferred parameters
+ pps->col_bd = av_malloc_array(pps->num_tile_columns + 1, sizeof(*pps->col_bd));
+ pps->row_bd = av_malloc_array(pps->num_tile_rows + 1, sizeof(*pps->row_bd));
+ pps->col_idxX = av_malloc_array(sps->ctb_width, sizeof(*pps->col_idxX));
+ if (!pps->col_bd || !pps->row_bd || !pps->col_idxX)
+ return AVERROR(ENOMEM);
+
+ if (pps->uniform_spacing_flag) {
+ if (!pps->column_width) {
+ 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));
+ }
+ if (!pps->column_width || !pps->row_height)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < pps->num_tile_columns; i++) {
+ pps->column_width[i] = ((i + 1) * sps->ctb_width) / pps->num_tile_columns -
+ (i * sps->ctb_width) / pps->num_tile_columns;
+ }
+
+ for (i = 0; i < pps->num_tile_rows; i++) {
+ pps->row_height[i] = ((i + 1) * sps->ctb_height) / pps->num_tile_rows -
+ (i * sps->ctb_height) / pps->num_tile_rows;
+ }
+ }
+
+ pps->col_bd[0] = 0;
+ for (i = 0; i < pps->num_tile_columns; i++)
+ pps->col_bd[i + 1] = pps->col_bd[i] + pps->column_width[i];
+
+ pps->row_bd[0] = 0;
+ for (i = 0; i < pps->num_tile_rows; i++)
+ pps->row_bd[i + 1] = pps->row_bd[i] + pps->row_height[i];
+
+ for (i = 0, j = 0; i < sps->ctb_width; i++) {
+ if (i > pps->col_bd[j])
+ j++;
+ pps->col_idxX[i] = j;
+ }
+
+ /**
+ * 6.5
+ */
+ pic_area_in_ctbs = sps->ctb_width * sps->ctb_height;
+
+ pps->ctb_addr_rs_to_ts = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->ctb_addr_rs_to_ts));
+ pps->ctb_addr_ts_to_rs = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->ctb_addr_ts_to_rs));
+ pps->tile_id = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->tile_id));
+ pps->min_tb_addr_zs_tab = av_malloc_array((sps->tb_mask+2) * (sps->tb_mask+2), sizeof(*pps->min_tb_addr_zs_tab));
+ if (!pps->ctb_addr_rs_to_ts || !pps->ctb_addr_ts_to_rs ||
+ !pps->tile_id || !pps->min_tb_addr_zs_tab) {
+ return AVERROR(ENOMEM);
+ }
+
+ for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
+ int tb_x = ctb_addr_rs % sps->ctb_width;
+ int tb_y = ctb_addr_rs / sps->ctb_width;
+ int tile_x = 0;
+ int tile_y = 0;
+ int val = 0;
+
+ for (i = 0; i < pps->num_tile_columns; i++) {
+ if (tb_x < pps->col_bd[i + 1]) {
+ tile_x = i;
+ break;
+ }
+ }
+
+ for (i = 0; i < pps->num_tile_rows; i++) {
+ if (tb_y < pps->row_bd[i + 1]) {
+ tile_y = i;
+ break;
+ }
+ }
+
+ for (i = 0; i < tile_x; i++)
+ val += pps->row_height[tile_y] * pps->column_width[i];
+ for (i = 0; i < tile_y; i++)
+ val += sps->ctb_width * pps->row_height[i];
+
+ val += (tb_y - pps->row_bd[tile_y]) * pps->column_width[tile_x] +
+ tb_x - pps->col_bd[tile_x];
+
+ pps->ctb_addr_rs_to_ts[ctb_addr_rs] = val;
+ pps->ctb_addr_ts_to_rs[val] = ctb_addr_rs;
+ }
+
+ for (j = 0, tile_id = 0; j < pps->num_tile_rows; j++)
+ for (i = 0; i < pps->num_tile_columns; i++, tile_id++)
+ for (y = pps->row_bd[j]; y < pps->row_bd[j + 1]; y++)
+ for (x = pps->col_bd[i]; x < pps->col_bd[i + 1]; x++)
+ pps->tile_id[pps->ctb_addr_rs_to_ts[y * sps->ctb_width + x]] = tile_id;
+
+ pps->tile_pos_rs = av_malloc_array(tile_id, sizeof(*pps->tile_pos_rs));
+ if (!pps->tile_pos_rs)
+ return AVERROR(ENOMEM);
+
+ for (j = 0; j < pps->num_tile_rows; j++)
+ for (i = 0; i < pps->num_tile_columns; i++)
+ pps->tile_pos_rs[j * pps->num_tile_columns + i] =
+ pps->row_bd[j] * sps->ctb_width + pps->col_bd[i];
+
+ log2_diff = sps->log2_ctb_size - sps->log2_min_tb_size;
+ pps->min_tb_addr_zs = &pps->min_tb_addr_zs_tab[1*(sps->tb_mask+2)+1];
+ for (y = 0; y < sps->tb_mask+2; y++) {
+ pps->min_tb_addr_zs_tab[y*(sps->tb_mask+2)] = -1;
+ pps->min_tb_addr_zs_tab[y] = -1;
+ }
+ for (y = 0; y < sps->tb_mask+1; y++) {
+ for (x = 0; x < sps->tb_mask+1; x++) {
+ int tb_x = x >> log2_diff;
+ int tb_y = y >> log2_diff;
+ int rs = sps->ctb_width * tb_y + tb_x;
+ int val = pps->ctb_addr_rs_to_ts[rs] << (log2_diff * 2);
+ for (i = 0; i < log2_diff; i++) {
+ int m = 1 << i;
+ val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
+ }
+ pps->min_tb_addr_zs[y * (sps->tb_mask+2) + x] = val;
+ }
+ }
+
+ return 0;
+}
+
+int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
+ HEVCParamSets *ps)
+{
+ HEVCSPS *sps = NULL;
+ int i, ret = 0;
unsigned int pps_id = 0;
AVBufferRef *pps_buf;
@@ -1270,7 +1398,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
return AVERROR(ENOMEM);
}
- av_log(s->avctx, AV_LOG_DEBUG, "Decoding PPS\n");
+ av_log(avctx, AV_LOG_DEBUG, "Decoding PPS\n");
// Default values
pps->loop_filter_across_tiles_enabled_flag = 1;
@@ -1285,22 +1413,22 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
// Coded parameters
pps_id = get_ue_golomb_long(gb);
if (pps_id >= MAX_PPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id);
+ av_log(avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id);
ret = AVERROR_INVALIDDATA;
goto err;
}
pps->sps_id = get_ue_golomb_long(gb);
if (pps->sps_id >= MAX_SPS_COUNT) {
- av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", pps->sps_id);
+ av_log(avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", pps->sps_id);
ret = AVERROR_INVALIDDATA;
goto err;
}
- if (!s->sps_list[pps->sps_id]) {
- av_log(s->avctx, AV_LOG_ERROR, "SPS %u does not exist.\n", pps->sps_id);
+ if (!ps->sps_list[pps->sps_id]) {
+ av_log(avctx, AV_LOG_ERROR, "SPS %u does not exist.\n", pps->sps_id);
ret = AVERROR_INVALIDDATA;
goto err;
}
- sps = (HEVCSPS *)s->sps_list[pps->sps_id]->data;
+ sps = (HEVCSPS *)ps->sps_list[pps->sps_id]->data;
pps->dependent_slice_segments_enabled_flag = get_bits1(gb);
pps->output_flag_present_flag = get_bits1(gb);
@@ -1325,7 +1453,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
if (pps->diff_cu_qp_delta_depth < 0 ||
pps->diff_cu_qp_delta_depth > sps->log2_diff_max_min_coding_block_size) {
- av_log(s->avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
+ av_log(avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
pps->diff_cu_qp_delta_depth);
ret = AVERROR_INVALIDDATA;
goto err;
@@ -1333,14 +1461,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
pps->cb_qp_offset = get_se_golomb(gb);
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
- av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
pps->cb_qp_offset);
ret = AVERROR_INVALIDDATA;
goto err;
}
pps->cr_qp_offset = get_se_golomb(gb);
if (pps->cr_qp_offset < -12 || pps->cr_qp_offset > 12) {
- av_log(s->avctx, AV_LOG_ERROR, "pps_cr_qp_offset out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "pps_cr_qp_offset out of range: %d\n",
pps->cr_qp_offset);
ret = AVERROR_INVALIDDATA;
goto err;
@@ -1359,14 +1487,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
pps->num_tile_rows = get_ue_golomb_long(gb) + 1;
if (pps->num_tile_columns <= 0 ||
pps->num_tile_columns >= sps->width) {
- av_log(s->avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
pps->num_tile_columns - 1);
ret = AVERROR_INVALIDDATA;
goto err;
}
if (pps->num_tile_rows <= 0 ||
pps->num_tile_rows >= sps->height) {
- av_log(s->avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
pps->num_tile_rows - 1);
ret = AVERROR_INVALIDDATA;
goto err;
@@ -1387,7 +1515,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
sum += pps->column_width[i];
}
if (sum >= sps->ctb_width) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid tile widths.\n");
+ av_log(avctx, AV_LOG_ERROR, "Invalid tile widths.\n");
ret = AVERROR_INVALIDDATA;
goto err;
}
@@ -1399,7 +1527,7 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
sum += pps->row_height[i];
}
if (sum >= sps->ctb_height) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid tile heights.\n");
+ av_log(avctx, AV_LOG_ERROR, "Invalid tile heights.\n");
ret = AVERROR_INVALIDDATA;
goto err;
}
@@ -1418,13 +1546,13 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
pps->beta_offset = get_se_golomb(gb) * 2;
pps->tc_offset = get_se_golomb(gb) * 2;
if (pps->beta_offset/2 < -6 || pps->beta_offset/2 > 6) {
- av_log(s->avctx, AV_LOG_ERROR, "pps_beta_offset_div2 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "pps_beta_offset_div2 out of range: %d\n",
pps->beta_offset/2);
ret = AVERROR_INVALIDDATA;
goto err;
}
if (pps->tc_offset/2 < -6 || pps->tc_offset/2 > 6) {
- av_log(s->avctx, AV_LOG_ERROR, "pps_tc_offset_div2 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "pps_tc_offset_div2 out of range: %d\n",
pps->tc_offset/2);
ret = AVERROR_INVALIDDATA;
goto err;
@@ -1435,14 +1563,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
pps->scaling_list_data_present_flag = get_bits1(gb);
if (pps->scaling_list_data_present_flag) {
set_default_scaling_list_data(&pps->scaling_list);
- ret = scaling_list_data(s, &pps->scaling_list, sps);
+ ret = scaling_list_data(gb, avctx, &pps->scaling_list, sps);
if (ret < 0)
goto err;
}
pps->lists_modification_present_flag = get_bits1(gb);
pps->log2_parallel_merge_level = get_ue_golomb_long(gb) + 2;
if (pps->log2_parallel_merge_level > sps->log2_ctb_size) {
- av_log(s->avctx, AV_LOG_ERROR, "log2_parallel_merge_level_minus2 out of range: %d\n",
+ av_log(avctx, AV_LOG_ERROR, "log2_parallel_merge_level_minus2 out of range: %d\n",
pps->log2_parallel_merge_level - 2);
ret = AVERROR_INVALIDDATA;
goto err;
@@ -1454,148 +1582,23 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
int pps_range_extensions_flag = get_bits1(gb);
/* int pps_extension_7bits = */ get_bits(gb, 7);
if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
- if ((ret = pps_range_extensions(s, pps, sps)) < 0)
+ if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
goto err;
}
}
- // Inferred parameters
- pps->col_bd = av_malloc_array(pps->num_tile_columns + 1, sizeof(*pps->col_bd));
- pps->row_bd = av_malloc_array(pps->num_tile_rows + 1, sizeof(*pps->row_bd));
- pps->col_idxX = av_malloc_array(sps->ctb_width, sizeof(*pps->col_idxX));
- if (!pps->col_bd || !pps->row_bd || !pps->col_idxX) {
- ret = AVERROR(ENOMEM);
- goto err;
- }
-
- if (pps->uniform_spacing_flag) {
- if (!pps->column_width) {
- 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));
- }
- if (!pps->column_width || !pps->row_height) {
- ret = AVERROR(ENOMEM);
- goto err;
- }
-
- for (i = 0; i < pps->num_tile_columns; i++) {
- pps->column_width[i] = ((i + 1) * sps->ctb_width) / pps->num_tile_columns -
- (i * sps->ctb_width) / pps->num_tile_columns;
- }
-
- for (i = 0; i < pps->num_tile_rows; i++) {
- pps->row_height[i] = ((i + 1) * sps->ctb_height) / pps->num_tile_rows -
- (i * sps->ctb_height) / pps->num_tile_rows;
- }
- }
-
- pps->col_bd[0] = 0;
- for (i = 0; i < pps->num_tile_columns; i++)
- pps->col_bd[i + 1] = pps->col_bd[i] + pps->column_width[i];
-
- pps->row_bd[0] = 0;
- for (i = 0; i < pps->num_tile_rows; i++)
- pps->row_bd[i + 1] = pps->row_bd[i] + pps->row_height[i];
-
- for (i = 0, j = 0; i < sps->ctb_width; i++) {
- if (i > pps->col_bd[j])
- j++;
- pps->col_idxX[i] = j;
- }
-
- /**
- * 6.5
- */
- pic_area_in_ctbs = sps->ctb_width * sps->ctb_height;
-
- pps->ctb_addr_rs_to_ts = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->ctb_addr_rs_to_ts));
- pps->ctb_addr_ts_to_rs = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->ctb_addr_ts_to_rs));
- pps->tile_id = av_malloc_array(pic_area_in_ctbs, sizeof(*pps->tile_id));
- pps->min_tb_addr_zs_tab = av_malloc_array((sps->tb_mask+2) * (sps->tb_mask+2), sizeof(*pps->min_tb_addr_zs_tab));
- if (!pps->ctb_addr_rs_to_ts || !pps->ctb_addr_ts_to_rs ||
- !pps->tile_id || !pps->min_tb_addr_zs_tab) {
- ret = AVERROR(ENOMEM);
+ ret = setup_pps(avctx, gb, pps, sps);
+ if (ret < 0)
goto err;
- }
-
- for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
- int tb_x = ctb_addr_rs % sps->ctb_width;
- int tb_y = ctb_addr_rs / sps->ctb_width;
- int tile_x = 0;
- int tile_y = 0;
- int val = 0;
-
- for (i = 0; i < pps->num_tile_columns; i++) {
- if (tb_x < pps->col_bd[i + 1]) {
- tile_x = i;
- break;
- }
- }
-
- for (i = 0; i < pps->num_tile_rows; i++) {
- if (tb_y < pps->row_bd[i + 1]) {
- tile_y = i;
- break;
- }
- }
-
- for (i = 0; i < tile_x; i++)
- val += pps->row_height[tile_y] * pps->column_width[i];
- for (i = 0; i < tile_y; i++)
- val += sps->ctb_width * pps->row_height[i];
-
- val += (tb_y - pps->row_bd[tile_y]) * pps->column_width[tile_x] +
- tb_x - pps->col_bd[tile_x];
-
- pps->ctb_addr_rs_to_ts[ctb_addr_rs] = val;
- pps->ctb_addr_ts_to_rs[val] = ctb_addr_rs;
- }
-
- for (j = 0, tile_id = 0; j < pps->num_tile_rows; j++)
- for (i = 0; i < pps->num_tile_columns; i++, tile_id++)
- for (y = pps->row_bd[j]; y < pps->row_bd[j + 1]; y++)
- for (x = pps->col_bd[i]; x < pps->col_bd[i + 1]; x++)
- pps->tile_id[pps->ctb_addr_rs_to_ts[y * sps->ctb_width + x]] = tile_id;
-
- pps->tile_pos_rs = av_malloc_array(tile_id, sizeof(*pps->tile_pos_rs));
- if (!pps->tile_pos_rs) {
- ret = AVERROR(ENOMEM);
- goto err;
- }
-
- for (j = 0; j < pps->num_tile_rows; j++)
- for (i = 0; i < pps->num_tile_columns; i++)
- pps->tile_pos_rs[j * pps->num_tile_columns + i] = pps->row_bd[j] * sps->ctb_width + pps->col_bd[i];
-
- log2_diff_ctb_min_tb_size = sps->log2_ctb_size - sps->log2_min_tb_size;
- pps->min_tb_addr_zs = &pps->min_tb_addr_zs_tab[1*(sps->tb_mask+2)+1];
- for (y = 0; y < sps->tb_mask+2; y++) {
- pps->min_tb_addr_zs_tab[y*(sps->tb_mask+2)] = -1;
- pps->min_tb_addr_zs_tab[y] = -1;
- }
- for (y = 0; y < sps->tb_mask+1; y++) {
- for (x = 0; x < sps->tb_mask+1; x++) {
- int tb_x = x >> log2_diff_ctb_min_tb_size;
- int tb_y = y >> log2_diff_ctb_min_tb_size;
- int ctb_addr_rs = sps->ctb_width * tb_y + tb_x;
- int val = pps->ctb_addr_rs_to_ts[ctb_addr_rs] <<
- (log2_diff_ctb_min_tb_size * 2);
- for (i = 0; i < log2_diff_ctb_min_tb_size; i++) {
- int m = 1 << i;
- val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
- }
- pps->min_tb_addr_zs[y * (sps->tb_mask+2) + x] = val;
- }
- }
if (get_bits_left(gb) < 0) {
- av_log(s->avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Overread PPS by %d bits\n", -get_bits_left(gb));
goto err;
}
- remove_pps(s, pps_id);
- s->pps_list[pps_id] = pps_buf;
+ remove_pps(ps, pps_id);
+ ps->pps_list[pps_id] = pps_buf;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_ps_enc.c b/chromium/third_party/ffmpeg/libavcodec/hevc_ps_enc.c
new file mode 100644
index 00000000000..c05bf63d3b2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_ps_enc.c
@@ -0,0 +1,116 @@
+/*
+ * HEVC Parameter Set encoding
+ *
+ * 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 "golomb.h"
+#include "hevc.h"
+#include "put_bits.h"
+
+static void write_ptl_layer(PutBitContext *pb, PTLCommon *ptl)
+{
+ int i;
+
+ put_bits(pb, 2, ptl->profile_space);
+ put_bits(pb, 1, ptl->tier_flag);
+ put_bits(pb, 5, ptl->profile_idc);
+ for (i = 0; i < 32; i++)
+ put_bits(pb, 1, ptl->profile_compatibility_flag[i]);
+ put_bits(pb, 1, ptl->progressive_source_flag);
+ put_bits(pb, 1, ptl->interlaced_source_flag);
+ put_bits(pb, 1, ptl->non_packed_constraint_flag);
+ put_bits(pb, 1, ptl->frame_only_constraint_flag);
+ put_bits32(pb, 0); // reserved
+ put_bits(pb, 12, 0); // reserved
+}
+
+static void write_ptl(PutBitContext *pb, PTL *ptl, int max_num_sub_layers)
+{
+ int i;
+
+ write_ptl_layer(pb, &ptl->general_ptl);
+ put_bits(pb, 8, ptl->general_ptl.level_idc);
+
+ for (i = 0; i < max_num_sub_layers - 1; i++) {
+ put_bits(pb, 1, ptl->sub_layer_profile_present_flag[i]);
+ put_bits(pb, 1, ptl->sub_layer_level_present_flag[i]);
+ }
+
+ if (max_num_sub_layers > 1)
+ for (i = max_num_sub_layers - 1; i < 8; i++)
+ put_bits(pb, 2, 0); // reserved
+
+ for (i = 0; i < max_num_sub_layers - 1; i++) {
+ if (ptl->sub_layer_profile_present_flag[i])
+ write_ptl_layer(pb, &ptl->sub_layer_ptl[i]);
+ if (ptl->sub_layer_level_present_flag[i])
+ put_bits(pb, 8, ptl->sub_layer_ptl[i].level_idc);
+ }
+}
+
+int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
+ uint8_t *buf, int buf_size)
+{
+ PutBitContext pb;
+ int i;
+
+ init_put_bits(&pb, buf, buf_size);
+ put_bits(&pb, 4, id);
+ put_bits(&pb, 2, 3); // reserved
+ put_bits(&pb, 6, vps->vps_max_layers - 1);
+ put_bits(&pb, 3, vps->vps_max_sub_layers - 1);
+ put_bits(&pb, 1, vps->vps_temporal_id_nesting_flag);
+ put_bits(&pb, 16, 0xffff); // reserved
+
+ write_ptl(&pb, &vps->ptl, vps->vps_max_sub_layers);
+
+ put_bits(&pb, 1, vps->vps_sub_layer_ordering_info_present_flag);
+ for (i = vps->vps_sub_layer_ordering_info_present_flag ? 0 : vps->vps_max_layers - 1;
+ i < vps->vps_max_sub_layers; i++) {
+ set_ue_golomb(&pb, vps->vps_max_dec_pic_buffering[i] - 1);
+ set_ue_golomb(&pb, vps->vps_num_reorder_pics[i]);
+ set_ue_golomb(&pb, vps->vps_max_latency_increase[i] + 1);
+ }
+
+ put_bits(&pb, 6, vps->vps_max_layer_id);
+ set_ue_golomb(&pb, vps->vps_num_layer_sets - 1);
+
+ // writing layer_id_included_flag not supported
+ if (vps->vps_num_layer_sets > 1)
+ return AVERROR_PATCHWELCOME;
+
+ put_bits(&pb, 1, vps->vps_timing_info_present_flag);
+ if (vps->vps_timing_info_present_flag) {
+ put_bits32(&pb, vps->vps_num_units_in_tick);
+ put_bits32(&pb, vps->vps_time_scale);
+ put_bits(&pb, 1, vps->vps_poc_proportional_to_timing_flag);
+ if (vps->vps_poc_proportional_to_timing_flag)
+ set_ue_golomb(&pb, vps->vps_num_ticks_poc_diff_one - 1);
+
+ // writing HRD parameters not supported
+ if (vps->vps_num_hrd_parameters)
+ return AVERROR_PATCHWELCOME;
+ }
+
+ put_bits(&pb, 1, 0); // extension flag
+
+ put_bits(&pb, 1, 1); // stop bit
+ avpriv_align_put_bits(&pb);
+
+ return put_bits_count(&pb) / 8;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c b/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
index fea3d125bac..e85ce890860 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_refs.c
@@ -55,10 +55,10 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *ref, int x0, int y0)
{
- int x_cb = x0 >> s->sps->log2_ctb_size;
- int y_cb = y0 >> s->sps->log2_ctb_size;
- int pic_width_cb = s->sps->ctb_width;
- int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
+ int x_cb = x0 >> s->ps.sps->log2_ctb_size;
+ int y_cb = y0 >> s->ps.sps->log2_ctb_size;
+ int pic_width_cb = s->ps.sps->ctb_width;
+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
return (RefPicList *)ref->rpl_tab[ctb_addr_ts];
}
@@ -91,7 +91,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
if (ret < 0)
return NULL;
- frame->rpl_buf = av_buffer_allocz(s->nb_nals * sizeof(RefPicListTab));
+ frame->rpl_buf = av_buffer_allocz(s->pkt.nb_nals * sizeof(RefPicListTab));
if (!frame->rpl_buf)
goto fail;
@@ -104,7 +104,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
if (!frame->rpl_tab_buf)
goto fail;
frame->rpl_tab = (RefPicListTab **)frame->rpl_tab_buf->data;
- frame->ctb_count = s->sps->ctb_width * s->sps->ctb_height;
+ frame->ctb_count = s->ps.sps->ctb_width * s->ps.sps->ctb_height;
for (j = 0; j < frame->ctb_count; j++)
frame->rpl_tab[j] = (RefPicListTab *)frame->rpl_buf->data;
@@ -162,7 +162,7 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
ref->poc = poc;
ref->sequence = s->seq_decode;
- ref->window = s->sps->output_window;
+ ref->window = s->ps.sps->output_window;
return 0;
}
@@ -197,8 +197,8 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
}
/* wait for more frames before output */
- if (!flush && s->seq_output == s->seq_decode && s->sps &&
- nb_output <= s->sps->temporal_layer[s->sps->max_sub_layers - 1].num_reorder_pics)
+ if (!flush && s->seq_output == s->seq_decode && s->ps.sps &&
+ nb_output <= s->ps.sps->temporal_layer[s->ps.sps->max_sub_layers - 1].num_reorder_pics)
return 0;
if (nb_output) {
@@ -206,7 +206,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
AVFrame *dst = out;
AVFrame *src = frame->frame;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format);
- int pixel_shift = !!(desc->comp[0].depth_minus1 > 7);
+ int pixel_shift = !!(desc->comp[0].depth > 8);
ret = av_frame_ref(out, src);
if (frame->flags & HEVC_FRAME_FLAG_BUMPING)
@@ -252,7 +252,7 @@ void ff_hevc_bump_frame(HEVCContext *s)
}
}
- if (s->sps && dpb >= s->sps->temporal_layer[s->sps->max_sub_layers - 1].max_dec_pic_buffering) {
+ if (s->ps.sps && dpb >= s->ps.sps->temporal_layer[s->ps.sps->max_sub_layers - 1].max_dec_pic_buffering) {
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
HEVCFrame *frame = &s->DPB[i];
if ((frame->flags) &&
@@ -281,7 +281,7 @@ static int init_slice_rpl(HEVCContext *s)
{
HEVCFrame *frame = s->ref;
int ctb_count = frame->ctb_count;
- int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];
+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];
int i;
if (s->slice_idx >= frame->rpl_buf->size / sizeof(RefPicListTab))
@@ -368,7 +368,7 @@ int ff_hevc_slice_rpl(HEVCContext *s)
static HEVCFrame *find_ref_idx(HEVCContext *s, int poc)
{
int i;
- int LtMask = (1 << s->sps->log2_max_poc_lsb) - 1;
+ int LtMask = (1 << s->ps.sps->log2_max_poc_lsb) - 1;
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
HEVCFrame *ref = &s->DPB[i];
@@ -408,16 +408,16 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc)
return NULL;
if (!s->avctx->hwaccel) {
- if (!s->sps->pixel_shift) {
+ if (!s->ps.sps->pixel_shift) {
for (i = 0; frame->frame->buf[i]; i++)
- memset(frame->frame->buf[i]->data, 1 << (s->sps->bit_depth - 1),
+ memset(frame->frame->buf[i]->data, 1 << (s->ps.sps->bit_depth - 1),
frame->frame->buf[i]->size);
} else {
for (i = 0; frame->frame->data[i]; i++)
- for (y = 0; y < (s->sps->height >> s->sps->vshift[i]); y++)
- for (x = 0; x < (s->sps->width >> s->sps->hshift[i]); x++) {
+ for (y = 0; y < (s->ps.sps->height >> s->ps.sps->vshift[i]); y++)
+ for (x = 0; x < (s->ps.sps->width >> s->ps.sps->hshift[i]); x++) {
AV_WN16(frame->frame->data[i] + y * frame->frame->linesize[i] + 2 * x,
- 1 << (s->sps->bit_depth - 1));
+ 1 << (s->ps.sps->bit_depth - 1));
}
}
}
@@ -517,7 +517,7 @@ fail:
int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb)
{
- int max_poc_lsb = 1 << s->sps->log2_max_poc_lsb;
+ int max_poc_lsb = 1 << s->ps.sps->log2_max_poc_lsb;
int prev_poc_lsb = s->pocTid0 % max_poc_lsb;
int prev_poc_msb = s->pocTid0 - prev_poc_lsb;
int poc_msb;
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c b/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
index 13ebcd3ede7..179b0458640 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_sei.c
@@ -25,7 +25,35 @@
#include "golomb.h"
#include "hevc.h"
-static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
+enum HEVC_SEI_TYPE {
+ SEI_TYPE_BUFFERING_PERIOD = 0,
+ SEI_TYPE_PICTURE_TIMING = 1,
+ SEI_TYPE_PAN_SCAN_RECT = 2,
+ SEI_TYPE_FILLER_PAYLOAD = 3,
+ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35 = 4,
+ SEI_TYPE_USER_DATA_UNREGISTERED = 5,
+ SEI_TYPE_RECOVERY_POINT = 6,
+ SEI_TYPE_SCENE_INFO = 9,
+ SEI_TYPE_FULL_FRAME_SNAPSHOT = 15,
+ SEI_TYPE_PROGRESSIVE_REFINEMENT_SEGMENT_START = 16,
+ SEI_TYPE_PROGRESSIVE_REFINEMENT_SEGMENT_END = 17,
+ SEI_TYPE_FILM_GRAIN_CHARACTERISTICS = 19,
+ SEI_TYPE_POST_FILTER_HINT = 22,
+ SEI_TYPE_TONE_MAPPING_INFO = 23,
+ SEI_TYPE_FRAME_PACKING = 45,
+ SEI_TYPE_DISPLAY_ORIENTATION = 47,
+ SEI_TYPE_SOP_DESCRIPTION = 128,
+ SEI_TYPE_ACTIVE_PARAMETER_SETS = 129,
+ SEI_TYPE_DECODING_UNIT_INFO = 130,
+ SEI_TYPE_TEMPORAL_LEVEL0_INDEX = 131,
+ SEI_TYPE_DECODED_PICTURE_HASH = 132,
+ SEI_TYPE_SCALABLE_NESTING = 133,
+ SEI_TYPE_REGION_REFRESH_INFO = 134,
+ SEI_TYPE_MASTERING_DISPLAY_INFO = 137,
+ SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO = 144,
+};
+
+static int decode_nal_sei_decoded_picture_hash(HEVCContext *s)
{
int cIdx, i;
uint8_t hash_type;
@@ -47,9 +75,10 @@ static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
skip_bits(gb, 32);
}
}
+ return 0;
}
-static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
+static int decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
@@ -72,9 +101,10 @@ static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
skip_bits1(gb); // frame_packing_arrangement_persistance_flag
}
skip_bits1(gb); // upsampled_aspect_ratio_flag
+ return 0;
}
-static void decode_nal_sei_display_orientation(HEVCContext *s)
+static int decode_nal_sei_display_orientation(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
@@ -87,6 +117,8 @@ static void decode_nal_sei_display_orientation(HEVCContext *s)
s->sei_anticlockwise_rotation = get_bits(gb, 16);
skip_bits1(gb); // display_orientation_persistence_flag
}
+
+ return 0;
}
static int decode_pic_timing(HEVCContext *s)
@@ -94,9 +126,9 @@ static int decode_pic_timing(HEVCContext *s)
GetBitContext *gb = &s->HEVClc->gb;
HEVCSPS *sps;
- if (!s->sps_list[s->active_seq_parameter_set_id])
+ if (!s->ps.sps_list[s->active_seq_parameter_set_id])
return(AVERROR(ENOMEM));
- sps = (HEVCSPS*)s->sps_list[s->active_seq_parameter_set_id]->data;
+ sps = (HEVCSPS*)s->ps.sps_list[s->active_seq_parameter_set_id]->data;
if (sps->vui.frame_field_info_present_flag) {
int pic_struct = get_bits(gb, 4);
@@ -144,6 +176,49 @@ static int active_parameter_sets(HEVCContext *s)
return 0;
}
+static int decode_nal_sei_prefix(HEVCContext *s, int type, int size)
+{
+ GetBitContext *gb = &s->HEVClc->gb;
+
+ switch (type) {
+ case 256: // Mismatched value from HM 8.1
+ return decode_nal_sei_decoded_picture_hash(s);
+ case SEI_TYPE_FRAME_PACKING:
+ return decode_nal_sei_frame_packing_arrangement(s);
+ case SEI_TYPE_DISPLAY_ORIENTATION:
+ return decode_nal_sei_display_orientation(s);
+ case SEI_TYPE_PICTURE_TIMING:
+ {
+ int ret = decode_pic_timing(s);
+ av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type);
+ skip_bits(gb, 8 * size);
+ return ret;
+ }
+ case SEI_TYPE_ACTIVE_PARAMETER_SETS:
+ active_parameter_sets(s);
+ av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type);
+ return 0;
+ default:
+ av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type);
+ skip_bits_long(gb, 8 * size);
+ return 0;
+ }
+}
+
+static int decode_nal_sei_suffix(HEVCContext *s, int type, int size)
+{
+ GetBitContext *gb = &s->HEVClc->gb;
+
+ switch (type) {
+ case SEI_TYPE_DECODED_PICTURE_HASH:
+ return decode_nal_sei_decoded_picture_hash(s);
+ default:
+ av_log(s->avctx, AV_LOG_DEBUG, "Skipped SUFFIX SEI %d\n", type);
+ skip_bits_long(gb, 8 * size);
+ return 0;
+ }
+}
+
static int decode_nal_sei_message(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
@@ -163,31 +238,9 @@ static int decode_nal_sei_message(HEVCContext *s)
payload_size += byte;
}
if (s->nal_unit_type == NAL_SEI_PREFIX) {
- if (payload_type == 256 /*&& s->decode_checksum_sei*/) {
- decode_nal_sei_decoded_picture_hash(s);
- } else if (payload_type == 45) {
- decode_nal_sei_frame_packing_arrangement(s);
- } else if (payload_type == 47) {
- decode_nal_sei_display_orientation(s);
- } else if (payload_type == 1){
- int ret = decode_pic_timing(s);
- av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
- skip_bits(gb, 8 * payload_size);
- return ret;
- } else if (payload_type == 129){
- active_parameter_sets(s);
- av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
- } else {
- av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
- skip_bits(gb, 8*payload_size);
- }
+ return decode_nal_sei_prefix(s, payload_type, payload_size);
} else { /* nal_unit_type == NAL_SEI_SUFFIX */
- if (payload_type == 132 /* && s->decode_checksum_sei */)
- decode_nal_sei_decoded_picture_hash(s);
- else {
- av_log(s->avctx, AV_LOG_DEBUG, "Skipped SUFFIX SEI %d\n", payload_type);
- skip_bits(gb, 8 * payload_size);
- }
+ return decode_nal_sei_suffix(s, payload_type, payload_size);
}
return 1;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
index be01e927f1e..9d773d960ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.c
@@ -216,7 +216,7 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
hevcdsp->sao_band_filter[1] = \
hevcdsp->sao_band_filter[2] = \
hevcdsp->sao_band_filter[3] = \
- hevcdsp->sao_band_filter[4] = FUNC(sao_band_filter_0, depth); \
+ hevcdsp->sao_band_filter[4] = FUNC(sao_band_filter, depth); \
hevcdsp->sao_edge_filter[0] = \
hevcdsp->sao_edge_filter[1] = \
hevcdsp->sao_edge_filter[2] = \
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
index d2ea8672b1f..9f1f6dd59ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp.h
@@ -61,7 +61,7 @@ typedef struct HEVCDSPContext {
void (*sao_band_filter[5])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src,
int16_t *sao_offset_val, int sao_left_class, int width, int height);
- /* implicit stride_src parameter has value of 2 * MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE */
+ /* implicit stride_src parameter has value of 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE */
void (*sao_edge_filter[5])(uint8_t *_dst /* align 16 */, uint8_t *_src /* align 32 */, ptrdiff_t stride_dst,
int16_t *sao_offset_val, int sao_eo_class, int width, int height);
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c b/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
index cec28e4550d..b840d179c33 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdsp_template.c
@@ -301,10 +301,10 @@ IDCT_DC(32)
#undef SCALE
#undef ADD_AND_SCALE
-static void FUNC(sao_band_filter_0)(uint8_t *_dst, uint8_t *_src,
- ptrdiff_t stride_dst, ptrdiff_t stride_src,
- int16_t *sao_offset_val, int sao_left_class,
- int width, int height)
+static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
+ ptrdiff_t stride_dst, ptrdiff_t stride_src,
+ int16_t *sao_offset_val, int sao_left_class,
+ int width, int height)
{
pixel *dst = (pixel *)_dst;
pixel *src = (pixel *)_src;
@@ -341,7 +341,7 @@ static void FUNC(sao_edge_filter)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride
pixel *src = (pixel *)_src;
int a_stride, b_stride;
int x, y;
- ptrdiff_t stride_src = (2*MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE) / sizeof(pixel);
+ ptrdiff_t stride_src = (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(pixel);
stride_dst /= sizeof(pixel);
a_stride = pos[eo][0][0] + pos[eo][0][1] * stride_src;
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c b/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
index 6b763b3a731..6ae87cca130 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcpred_template.c
@@ -31,7 +31,7 @@ static av_always_inline void FUNC(intra_pred)(HEVCContext *s, int x0, int y0,
int log2_size, int c_idx)
{
#define PU(x) \
- ((x) >> s->sps->log2_min_pu_size)
+ ((x) >> s->ps.sps->log2_min_pu_size)
#define MVF(x, y) \
(s->ref->tab_mvf[(x) + (y) * min_pu_width])
#define MVF_PU(x, y) \
@@ -39,7 +39,7 @@ static av_always_inline void FUNC(intra_pred)(HEVCContext *s, int x0, int y0,
#define IS_INTRA(x, y) \
(MVF_PU(x, y).pred_flag == PF_INTRA)
#define MIN_TB_ADDR_ZS(x, y) \
- s->pps->min_tb_addr_zs[(y) * (s->sps->tb_mask+2) + (x)]
+ s->ps.pps->min_tb_addr_zs[(y) * (s->ps.sps->tb_mask+2) + (x)]
#define EXTEND(ptr, val, len) \
do { \
pixel4 pix = PIXEL_SPLAT_X4(val); \
@@ -72,24 +72,24 @@ do { \
HEVCLocalContext *lc = s->HEVClc;
int i;
- int hshift = s->sps->hshift[c_idx];
- int vshift = s->sps->vshift[c_idx];
+ int hshift = s->ps.sps->hshift[c_idx];
+ int vshift = s->ps.sps->vshift[c_idx];
int size = (1 << log2_size);
int size_in_luma_h = size << hshift;
- int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size;
+ int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size;
int size_in_luma_v = size << vshift;
- int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size;
+ int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size;
int x = x0 >> hshift;
int y = y0 >> vshift;
- int x_tb = (x0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
- int y_tb = (y0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
+ int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
+ int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
int cur_tb_addr = MIN_TB_ADDR_ZS(x_tb, y_tb);
ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(pixel);
pixel *src = (pixel*)s->frame->data[c_idx] + x + y * stride;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->ps.sps->min_pu_width;
enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c :
lc->tu.intra_pred_mode;
@@ -103,28 +103,28 @@ do { \
pixel *top = top_array + 1;
pixel *filtered_left = filtered_left_array + 1;
pixel *filtered_top = filtered_top_array + 1;
- int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS( x_tb - 1, (y_tb + size_in_tbs_v) & s->sps->tb_mask);
+ int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS( x_tb - 1, (y_tb + size_in_tbs_v) & s->ps.sps->tb_mask);
int cand_left = lc->na.cand_left;
int cand_up_left = lc->na.cand_up_left;
int cand_up = lc->na.cand_up;
- int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS((x_tb + size_in_tbs_h) & s->sps->tb_mask, y_tb - 1);
+ int cand_up_right = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask, y_tb - 1);
- int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, s->sps->height) -
+ int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma_v, s->ps.sps->height) -
(y0 + size_in_luma_v)) >> vshift;
- int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->sps->width) -
+ int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->ps.sps->width) -
(x0 + size_in_luma_h)) >> hshift;
- if (s->pps->constrained_intra_pred_flag == 1) {
+ if (s->ps.pps->constrained_intra_pred_flag == 1) {
int size_in_luma_pu_v = PU(size_in_luma_v);
int size_in_luma_pu_h = PU(size_in_luma_h);
- int on_pu_edge_x = !av_mod_uintp2(x0, s->sps->log2_min_pu_size);
- int on_pu_edge_y = !av_mod_uintp2(y0, s->sps->log2_min_pu_size);
+ int on_pu_edge_x = !av_mod_uintp2(x0, s->ps.sps->log2_min_pu_size);
+ int on_pu_edge_y = !av_mod_uintp2(y0, s->ps.sps->log2_min_pu_size);
if (!size_in_luma_pu_h)
size_in_luma_pu_h++;
if (cand_bottom_left == 1 && on_pu_edge_x) {
int x_left_pu = PU(x0 - 1);
int y_bottom_pu = PU(y0 + size_in_luma_v);
- int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_bottom_pu);
+ int max = FFMIN(size_in_luma_pu_v, s->ps.sps->min_pu_height - y_bottom_pu);
cand_bottom_left = 0;
for (i = 0; i < max; i += 2)
cand_bottom_left |= (MVF(x_left_pu, y_bottom_pu + i).pred_flag == PF_INTRA);
@@ -132,7 +132,7 @@ do { \
if (cand_left == 1 && on_pu_edge_x) {
int x_left_pu = PU(x0 - 1);
int y_left_pu = PU(y0);
- int max = FFMIN(size_in_luma_pu_v, s->sps->min_pu_height - y_left_pu);
+ int max = FFMIN(size_in_luma_pu_v, s->ps.sps->min_pu_height - y_left_pu);
cand_left = 0;
for (i = 0; i < max; i += 2)
cand_left |= (MVF(x_left_pu, y_left_pu + i).pred_flag == PF_INTRA);
@@ -145,7 +145,7 @@ do { \
if (cand_up == 1 && on_pu_edge_y) {
int x_top_pu = PU(x0);
int y_top_pu = PU(y0 - 1);
- int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_top_pu);
+ int max = FFMIN(size_in_luma_pu_h, s->ps.sps->min_pu_width - x_top_pu);
cand_up = 0;
for (i = 0; i < max; i += 2)
cand_up |= (MVF(x_top_pu + i, y_top_pu).pred_flag == PF_INTRA);
@@ -153,7 +153,7 @@ do { \
if (cand_up_right == 1 && on_pu_edge_y) {
int y_top_pu = PU(y0 - 1);
int x_right_pu = PU(x0 + size_in_luma_h);
- int max = FFMIN(size_in_luma_pu_h, s->sps->min_pu_width - x_right_pu);
+ int max = FFMIN(size_in_luma_pu_h, s->ps.sps->min_pu_width - x_right_pu);
cand_up_right = 0;
for (i = 0; i < max; i += 2)
cand_up_right |= (MVF(x_right_pu + i, y_top_pu).pred_flag == PF_INTRA);
@@ -183,20 +183,20 @@ do { \
size - bottom_left_size);
}
- if (s->pps->constrained_intra_pred_flag == 1) {
+ if (s->ps.pps->constrained_intra_pred_flag == 1) {
if (cand_bottom_left || cand_left || cand_up_left || cand_up || cand_up_right) {
- int size_max_x = x0 + ((2 * size) << hshift) < s->sps->width ?
- 2 * size : (s->sps->width - x0) >> hshift;
- int size_max_y = y0 + ((2 * size) << vshift) < s->sps->height ?
- 2 * size : (s->sps->height - y0) >> vshift;
+ int size_max_x = x0 + ((2 * size) << hshift) < s->ps.sps->width ?
+ 2 * size : (s->ps.sps->width - x0) >> hshift;
+ int size_max_y = y0 + ((2 * size) << vshift) < s->ps.sps->height ?
+ 2 * size : (s->ps.sps->height - y0) >> vshift;
int j = size + (cand_bottom_left? bottom_left_size: 0) -1;
if (!cand_up_right) {
- size_max_x = x0 + ((size) << hshift) < s->sps->width ?
- size : (s->sps->width - x0) >> hshift;
+ size_max_x = x0 + ((size) << hshift) < s->ps.sps->width ?
+ size : (s->ps.sps->width - x0) >> hshift;
}
if (!cand_bottom_left) {
- size_max_y = y0 + (( size) << vshift) < s->sps->height ?
- size : (s->sps->height - y0) >> vshift;
+ size_max_y = y0 + (( size) << vshift) < s->ps.sps->height ?
+ size : (s->ps.sps->height - y0) >> vshift;
}
if (cand_bottom_left || cand_left || cand_up_left) {
while (j > -1 && !IS_INTRA(-1, j))
@@ -287,14 +287,14 @@ do { \
top[-1] = left[-1];
// Filtering process
- if (!s->sps->intra_smoothing_disabled_flag && (c_idx == 0 || s->sps->chroma_format_idc == 3)) {
+ if (!s->ps.sps->intra_smoothing_disabled_flag && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) {
if (mode != INTRA_DC && size != 4){
int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
FFABS((int)(mode - 10U)));
if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
int threshold = 1 << (BIT_DEPTH - 5);
- if (s->sps->sps_strong_intra_smoothing_enable_flag && c_idx == 0 &&
+ if (s->ps.sps->sps_strong_intra_smoothing_enable_flag && c_idx == 0 &&
log2_size == 5 &&
FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/hnm4video.c b/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
index 31995bc75c0..a64dbb1746d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hnm4video.c
@@ -510,5 +510,5 @@ AVCodec ff_hnm4_video_decoder = {
.init = hnm_decode_init,
.close = hnm_decode_end,
.decode = hnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
index 7763760eb39..8e2fd8fcf50 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.c
@@ -365,4 +365,6 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
ff_hpeldsp_init_ppc(c, flags);
if (ARCH_X86)
ff_hpeldsp_init_x86(c, flags);
+ if (ARCH_MIPS)
+ ff_hpeldsp_init_mips(c, flags);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
index 07c293ae78a..1a3cea54b88 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hpeldsp.h
@@ -99,5 +99,6 @@ void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
+void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags);
#endif /* AVCODEC_HPELDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c b/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
index 44092e7cdfe..3ef83d4eb41 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
@@ -307,9 +307,11 @@ static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- info_tag = bytestream2_get_le32(&ctx->gbc);
+ info_tag = bytestream2_peek_le32(&ctx->gbc);
if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
- int info_size = bytestream2_get_le32(&ctx->gbc);
+ int info_size;
+ bytestream2_skip(&ctx->gbc, 4);
+ info_size = bytestream2_get_le32(&ctx->gbc);
if (bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size);
return AVERROR_INVALIDDATA;
@@ -379,7 +381,7 @@ AVCodec ff_hq_hqa_decoder = {
.init = hq_hqa_decode_init,
.decode = hq_hqa_decode_frame,
.close = hq_hqa_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hqx.c b/chromium/third_party/ffmpeg/libavcodec/hqx.c
index 44016ac34a8..8060c7a31c0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hqx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hqx.c
@@ -536,7 +536,7 @@ AVCodec ff_hqx_decoder = {
.init = hqx_decode_init,
.decode = hqx_decode_frame,
.close = hqx_decode_close,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/hqxdsp.h b/chromium/third_party/ffmpeg/libavcodec/hqxdsp.h
index 16a42cc2b51..39ab3e2f380 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hqxdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hqxdsp.h
@@ -37,4 +37,3 @@ typedef struct HQXDSPContext {
void ff_hqxdsp_init(HQXDSPContext *c);
#endif /* AVCODEC_HQXDSP_H */
-
diff --git a/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.c b/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.c
new file mode 100644
index 00000000000..a2cd40fad30
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avstring.h"
+#include "libavutil/common.h"
+#include "libavutil/parseutils.h"
+#include "htmlsubtitles.h"
+
+static int html_color_parse(void *log_ctx, const char *str)
+{
+ uint8_t rgba[4];
+ if (av_parse_color(rgba, str, strcspn(str, "\" >"), log_ctx) < 0)
+ return -1;
+ return rgba[0] | rgba[1] << 8 | rgba[2] << 16;
+}
+
+enum {
+ PARAM_UNKNOWN = -1,
+ PARAM_SIZE,
+ PARAM_COLOR,
+ PARAM_FACE,
+ PARAM_NUMBER
+};
+
+typedef struct SrtStack {
+ char tag[128];
+ char param[PARAM_NUMBER][128];
+} SrtStack;
+
+static void rstrip_spaces_buf(AVBPrint *buf)
+{
+ while (buf->len > 0 && buf->str[buf->len - 1] == ' ')
+ buf->str[--buf->len] = 0;
+}
+
+void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
+{
+ char *param, buffer[128], tmp[128];
+ int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0;
+ SrtStack stack[16];
+
+ stack[0].tag[0] = 0;
+ strcpy(stack[0].param[PARAM_SIZE], "{\\fs}");
+ strcpy(stack[0].param[PARAM_COLOR], "{\\c}");
+ strcpy(stack[0].param[PARAM_FACE], "{\\fn}");
+
+ for (; !end && *in; in++) {
+ switch (*in) {
+ case '\r':
+ break;
+ case '\n':
+ if (line_start) {
+ end = 1;
+ break;
+ }
+ rstrip_spaces_buf(dst);
+ av_bprintf(dst, "\\N");
+ line_start = 1;
+ break;
+ case ' ':
+ if (!line_start)
+ av_bprint_chars(dst, *in, 1);
+ break;
+ case '{': /* skip all {\xxx} substrings except for {\an%d}
+ and all microdvd like styles such as {Y:xxx} */
+ len = 0;
+ an += sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0;
+ if ((an != 1 && (len = 0, sscanf(in, "{\\%*[^}]}%n", &len) >= 0 && len > 0)) ||
+ (len = 0, sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n", &len) >= 0 && len > 0)) {
+ in += len - 1;
+ } else
+ av_bprint_chars(dst, *in, 1);
+ break;
+ case '<':
+ tag_close = in[1] == '/';
+ len = 0;
+ if (sscanf(in+tag_close+1, "%127[^>]>%n", buffer, &len) >= 1 && len > 0) {
+ const char *tagname = buffer;
+ while (*tagname == ' ')
+ tagname++;
+ if ((param = strchr(tagname, ' ')))
+ *param++ = 0;
+ if ((!tag_close && sptr < FF_ARRAY_ELEMS(stack)) ||
+ ( tag_close && sptr > 0 && !strcmp(stack[sptr-1].tag, tagname))) {
+ int i, j, unknown = 0;
+ in += len + tag_close;
+ if (!tag_close)
+ memset(stack+sptr, 0, sizeof(*stack));
+ if (!strcmp(tagname, "font")) {
+ if (tag_close) {
+ for (i=PARAM_NUMBER-1; i>=0; i--)
+ if (stack[sptr-1].param[i][0])
+ for (j=sptr-2; j>=0; j--)
+ if (stack[j].param[i][0]) {
+ av_bprintf(dst, "%s", stack[j].param[i]);
+ break;
+ }
+ } else {
+ while (param) {
+ if (!strncmp(param, "size=", 5)) {
+ unsigned font_size;
+ param += 5 + (param[5] == '"');
+ if (sscanf(param, "%u", &font_size) == 1) {
+ snprintf(stack[sptr].param[PARAM_SIZE],
+ sizeof(stack[0].param[PARAM_SIZE]),
+ "{\\fs%u}", font_size);
+ }
+ } else if (!strncmp(param, "color=", 6)) {
+ param += 6 + (param[6] == '"');
+ snprintf(stack[sptr].param[PARAM_COLOR],
+ sizeof(stack[0].param[PARAM_COLOR]),
+ "{\\c&H%X&}",
+ html_color_parse(log_ctx, param));
+ } else if (!strncmp(param, "face=", 5)) {
+ param += 5 + (param[5] == '"');
+ len = strcspn(param,
+ param[-1] == '"' ? "\"" :" ");
+ av_strlcpy(tmp, param,
+ FFMIN(sizeof(tmp), len+1));
+ param += len;
+ snprintf(stack[sptr].param[PARAM_FACE],
+ sizeof(stack[0].param[PARAM_FACE]),
+ "{\\fn%s}", tmp);
+ }
+ if ((param = strchr(param, ' ')))
+ param++;
+ }
+ for (i=0; i<PARAM_NUMBER; i++)
+ if (stack[sptr].param[i][0])
+ av_bprintf(dst, "%s", stack[sptr].param[i]);
+ }
+ } else if (!tagname[1] && strspn(tagname, "bisu") == 1) {
+ av_bprintf(dst, "{\\%c%d}", tagname[0], !tag_close);
+ } else {
+ unknown = 1;
+ snprintf(tmp, sizeof(tmp), "</%s>", tagname);
+ }
+ if (tag_close) {
+ sptr--;
+ } else if (unknown && !strstr(in, tmp)) {
+ in -= len + tag_close;
+ av_bprint_chars(dst, *in, 1);
+ } else
+ av_strlcpy(stack[sptr++].tag, tagname,
+ sizeof(stack[0].tag));
+ break;
+ }
+ }
+ default:
+ av_bprint_chars(dst, *in, 1);
+ break;
+ }
+ if (*in != ' ' && *in != '\r' && *in != '\n')
+ line_start = 0;
+ }
+
+ while (dst->len >= 2 && !strncmp(&dst->str[dst->len - 2], "\\N", 2))
+ dst->len -= 2;
+ dst->str[dst->len] = 0;
+ rstrip_spaces_buf(dst);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.h b/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.h
new file mode 100644
index 00000000000..e10cdda241e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/htmlsubtitles.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_HTMLSUBTITLES_H
+#define AVCODEC_HTMLSUBTITLES_H
+
+#include "libavutil/bprint.h"
+
+void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in);
+
+#endif /* AVCODEC_HTMLSUBTITLES_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c b/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
index 31300ec929b..48e2bda50e8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuvdec.c
@@ -35,10 +35,11 @@
#include "huffyuv.h"
#include "huffyuvdsp.h"
#include "thread.h"
+#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#define classic_shift_luma_table_size 42
-static const unsigned char classic_shift_luma[classic_shift_luma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
+static const unsigned char classic_shift_luma[classic_shift_luma_table_size + AV_INPUT_BUFFER_PADDING_SIZE] = {
34, 36, 35, 69, 135, 232, 9, 16, 10, 24, 11, 23, 12, 16, 13, 10,
14, 8, 15, 8, 16, 8, 17, 20, 16, 10, 207, 206, 205, 236, 11, 8,
10, 21, 9, 23, 8, 8, 199, 70, 69, 68, 0,
@@ -46,7 +47,7 @@ static const unsigned char classic_shift_luma[classic_shift_luma_table_size + FF
};
#define classic_shift_chroma_table_size 59
-static const unsigned char classic_shift_chroma[classic_shift_chroma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
+static const unsigned char classic_shift_chroma[classic_shift_chroma_table_size + AV_INPUT_BUFFER_PADDING_SIZE] = {
66, 36, 37, 38, 39, 40, 41, 75, 76, 77, 110, 239, 144, 81, 82, 83,
84, 85, 118, 183, 56, 57, 88, 89, 56, 89, 154, 57, 58, 57, 26, 141,
57, 56, 58, 57, 58, 57, 184, 119, 214, 245, 116, 83, 82, 49, 80, 79,
@@ -289,6 +290,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
HYuvContext *s = avctx->priv_data;
int ret;
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+ if (ret < 0)
+ return ret;
+
ff_huffyuvdsp_init(&s->hdsp);
memset(s->vlc, 0, 4 * sizeof(VLC));
@@ -1031,7 +1036,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
decode_422_bitstream(s, width - 2);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + 2, s->temp[0],
width - 2, lefty);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
}
@@ -1064,14 +1069,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
decode_422_bitstream(s, width);
lefty = s->hdsp.add_hfyu_left_pred(ydst, s->temp[0],
width, lefty);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
leftu = s->hdsp.add_hfyu_left_pred(udst, s->temp[1], width2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(vdst, s->temp[2], width2, leftv);
}
if (s->predictor == PLANE) {
if (cy > s->interlaced) {
s->hdsp.add_bytes(ydst, ydst - fake_ystride, width);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
s->hdsp.add_bytes(udst, udst - fake_ustride, width2);
s->hdsp.add_bytes(vdst, vdst - fake_vstride, width2);
}
@@ -1086,7 +1091,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
decode_422_bitstream(s, width - 2);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + 2, s->temp[0],
width - 2, lefty);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
}
@@ -1098,7 +1103,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
decode_422_bitstream(s, width);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + p->linesize[0],
s->temp[0], width, lefty);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + p->linesize[2], s->temp[1], width2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + p->linesize[1], s->temp[2], width2, leftv);
}
@@ -1110,7 +1115,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
decode_422_bitstream(s, 4);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + fake_ystride,
s->temp[0], 4, lefty);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + fake_ustride, s->temp[1], 2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + fake_vstride, s->temp[2], 2, leftv);
}
@@ -1121,7 +1126,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->hdsp.add_hfyu_median_pred(p->data[0] + fake_ystride + 4,
p->data[0] + 4, s->temp[0],
width - 4, &lefty, &lefttopy);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
lefttopu = p->data[1][1];
lefttopv = p->data[2][1];
s->hdsp.add_hfyu_median_pred(p->data[1] + fake_ustride + 2, p->data[1] + 2, s->temp[1], width2 - 2, &leftu, &lefttopu);
@@ -1156,7 +1161,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->hdsp.add_hfyu_median_pred(ydst, ydst - fake_ystride,
s->temp[0], width,
&lefty, &lefttopy);
- if (!(s->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->flags & AV_CODEC_FLAG_GRAY)) {
s->hdsp.add_hfyu_median_pred(udst, udst - fake_ustride, s->temp[1], width2, &leftu, &lefttopu);
s->hdsp.add_hfyu_median_pred(vdst, vdst - fake_vstride, s->temp[2], width2, &leftv, &lefttopv);
}
@@ -1236,8 +1241,8 @@ AVCodec ff_huffyuv_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND |
+ AV_CODEC_CAP_FRAME_THREADS,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
};
@@ -1251,8 +1256,8 @@ AVCodec ff_ffvhuff_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND |
+ AV_CODEC_CAP_FRAME_THREADS,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
};
#endif /* CONFIG_FFVHUFF_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c b/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
index 22e2cb86e3d..49d711a9487 100644
--- a/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/huffyuvenc.c
@@ -220,7 +220,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
ff_huffyuvencdsp_init(&s->hencdsp);
avctx->extradata = av_mallocz(3*MAX_N + 4);
- if (s->flags&CODEC_FLAG_PASS1) {
+ if (s->flags&AV_CODEC_FLAG_PASS1) {
#define STATS_OUT_SIZE 21*MAX_N*3 + 4
avctx->stats_out = av_mallocz(STATS_OUT_SIZE); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
if (!avctx->stats_out)
@@ -228,14 +228,17 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
s->version = 2;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->extradata || !avctx->coded_frame)
+ if (!avctx->extradata)
return AVERROR(ENOMEM);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
- s->bps = desc->comp[0].depth_minus1 + 1;
+ s->bps = desc->comp[0].depth;
s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
s->chroma = desc->nb_components > 2;
s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
@@ -311,10 +314,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = s->bitstream_bpp;
s->decorrelate = s->bitstream_bpp >= 24 && !s->yuv && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
s->predictor = avctx->prediction_method;
- s->interlaced = avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0;
+ s->interlaced = avctx->flags & AV_CODEC_FLAG_INTERLACED_ME ? 1 : 0;
if (avctx->context_model == 1) {
s->context = avctx->context_model;
- if (s->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)) {
+ if (s->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) {
av_log(avctx, AV_LOG_ERROR,
"context=1 is not compatible with "
"2 pass huffyuv encoding\n");
@@ -451,7 +454,7 @@ static int encode_422_bitstream(HYuvContext *s, int offset, int count)
count /= 2;
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
for(i = 0; i < count; i++) {
LOAD4;
s->stats[0][y0]++;
@@ -460,7 +463,7 @@ static int encode_422_bitstream(HYuvContext *s, int offset, int count)
s->stats[2][v0]++;
}
}
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)
return 0;
if (s->context) {
for (i = 0; i < count; i++) {
@@ -536,7 +539,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
put_bits(&s->pb, 2, y1&3);
if (s->bps <= 8) {
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
for (i = 0; i < count; i++) {
LOAD2;
STAT2;
@@ -546,7 +549,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
STATEND;
}
}
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)
return 0;
if (s->context) {
@@ -572,7 +575,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
}
} else if (s->bps <= 14) {
int mask = s->n - 1;
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
for (i = 0; i < count; i++) {
LOAD2_14;
STAT2;
@@ -582,7 +585,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
STATEND;
}
}
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)
return 0;
if (s->context) {
@@ -607,7 +610,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
}
}
} else {
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
for (i = 0; i < count; i++) {
LOAD2_16;
STAT2_16;
@@ -617,7 +620,7 @@ static int encode_plane_bitstream(HYuvContext *s, int width, int plane)
STATEND_16;
}
}
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)
return 0;
if (s->context) {
@@ -669,13 +672,13 @@ static int encode_gray_bitstream(HYuvContext *s, int count)
count /= 2;
- if (s->flags & CODEC_FLAG_PASS1) {
+ if (s->flags & AV_CODEC_FLAG_PASS1) {
for (i = 0; i < count; i++) {
LOAD2;
STAT2;
}
}
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)
return 0;
if (s->context) {
@@ -723,13 +726,13 @@ static inline int encode_bgra_bitstream(HYuvContext *s, int count, int planes)
if (planes == 4) \
put_bits(&s->pb, s->len[2][a], s->bits[2][a]);
- if ((s->flags & CODEC_FLAG_PASS1) &&
- (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)) {
+ if ((s->flags & AV_CODEC_FLAG_PASS1) &&
+ (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)) {
for (i = 0; i < count; i++) {
LOAD_GBRA;
STAT_BGRA;
}
- } else if (s->context || (s->flags & CODEC_FLAG_PASS1)) {
+ } else if (s->context || (s->flags & AV_CODEC_FLAG_PASS1)) {
for (i = 0; i < count; i++) {
LOAD_GBRA;
STAT_BGRA;
@@ -757,7 +760,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame * const p = pict;
int i, j, size = 0, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, width * height * 3 * 4 + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, width * height * 3 * 4 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
if (s->context) {
@@ -997,7 +1000,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
put_bits(&s->pb, 15, 0);
size /= 4;
- if ((s->flags&CODEC_FLAG_PASS1) && (s->picture_number & 31) == 0) {
+ if ((s->flags & AV_CODEC_FLAG_PASS1) && (s->picture_number & 31) == 0) {
int j;
char *p = avctx->stats_out;
char *end = p + STATS_OUT_SIZE;
@@ -1014,7 +1017,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
} else if (avctx->stats_out)
avctx->stats_out[0] = '\0';
- if (!(s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)) {
+ if (!(s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT)) {
flush_put_bits(&s->pb);
s->bdsp.bswap_buf((uint32_t *) pkt->data, (uint32_t *) pkt->data, size);
}
@@ -1037,14 +1040,12 @@ static av_cold int encode_end(AVCodecContext *avctx)
av_freep(&avctx->extradata);
av_freep(&avctx->stats_out);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
static const AVOption options[] = {
{ "non_deterministic", "Allow multithreading for e.g. context=1 at the expense of determinism",
- offsetof(HYuvContext, non_determ), AV_OPT_TYPE_INT, { .i64 = 1 },
+ offsetof(HYuvContext, non_determ), AV_OPT_TYPE_BOOL, { .i64 = 1 },
0, 1, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};
@@ -1072,7 +1073,7 @@ AVCodec ff_huffyuv_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.priv_class = &normal_class,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
@@ -1092,7 +1093,7 @@ AVCodec ff_ffvhuff_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.priv_class = &ff_class,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/idcinvideo.c b/chromium/third_party/ffmpeg/libavcodec/idcinvideo.c
index 55319e51ebe..4a0a6fb6c0e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/idcinvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/idcinvideo.c
@@ -248,5 +248,5 @@ AVCodec ff_idcin_decoder = {
.priv_data_size = sizeof(IdcinContext),
.init = idcin_decode_init,
.decode = idcin_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/idctdsp.c b/chromium/third_party/ffmpeg/libavcodec/idctdsp.c
index ae804d999a4..63e9b5216b0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/idctdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/idctdsp.c
@@ -305,6 +305,8 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
ff_idctdsp_init_ppc(c, avctx, high_bit_depth);
if (ARCH_X86)
ff_idctdsp_init_x86(c, avctx, high_bit_depth);
+ if (ARCH_MIPS)
+ ff_idctdsp_init_mips(c, avctx, high_bit_depth);
ff_put_pixels_clamped = c->put_pixels_clamped;
ff_add_pixels_clamped = c->add_pixels_clamped;
diff --git a/chromium/third_party/ffmpeg/libavcodec/idctdsp.h b/chromium/third_party/ffmpeg/libavcodec/idctdsp.h
index 538b71669ca..b180a6762a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/idctdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/idctdsp.h
@@ -108,5 +108,7 @@ void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
+void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
#endif /* AVCODEC_IDCTDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/iff.c b/chromium/third_party/ffmpeg/libavcodec/iff.c
index 03bb3f5beda..9d1f9a77d11 100644
--- a/chromium/third_party/ffmpeg/libavcodec/iff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/iff.c
@@ -240,7 +240,7 @@ static int extract_header(AVCodecContext *const avctx,
avctx->pix_fmt = AV_PIX_FMT_RGB32;
av_freep(&s->mask_buf);
av_freep(&s->mask_palbuf);
- s->mask_buf = av_malloc((s->planesize * 32) + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->mask_buf = av_malloc((s->planesize * 32) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->mask_buf)
return AVERROR(ENOMEM);
if (s->bpp > 16) {
@@ -248,7 +248,7 @@ static int extract_header(AVCodecContext *const avctx,
av_freep(&s->mask_buf);
return AVERROR(ENOMEM);
}
- s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->mask_palbuf) {
av_freep(&s->mask_buf);
return AVERROR(ENOMEM);
@@ -275,12 +275,12 @@ static int extract_header(AVCodecContext *const avctx,
int ham_count;
const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata);
- s->ham_buf = av_malloc((s->planesize * 8) + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->ham_buf = av_malloc((s->planesize * 8) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->ham_buf)
return AVERROR(ENOMEM);
ham_count = 8 * (1 << s->ham);
- s->ham_palbuf = av_malloc((ham_count << !!(s->masking == MASK_HAS_MASK)) * sizeof (uint32_t) + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->ham_palbuf = av_malloc((ham_count << !!(s->masking == MASK_HAS_MASK)) * sizeof (uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->ham_palbuf) {
av_freep(&s->ham_buf);
return AVERROR(ENOMEM);
@@ -366,7 +366,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx)))
return err;
s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
- s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->planebuf = av_malloc(s->planesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->planebuf)
return AVERROR(ENOMEM);
@@ -887,7 +887,7 @@ AVCodec ff_iff_ilbm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_IFF_BYTERUN1_DECODER
@@ -900,6 +900,6 @@ AVCodec ff_iff_byterun1_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/imc.c b/chromium/third_party/ffmpeg/libavcodec/imc.c
index b062b216e83..14f9fa30a5e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/imc.c
@@ -256,7 +256,7 @@ static av_cold int imc_decode_init(AVCodecContext *avctx)
return ret;
}
ff_bswapdsp_init(&q->bdsp);
- q->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!q->fdsp) {
ff_fft_end(&q->fft);
@@ -426,7 +426,7 @@ static void imc_decode_level_coefficients_raw(IMCContext *q, int *levlCoeffBuf,
pos = q->coef0_pos;
flcoeffs1[pos] = 20000.0 / pow (2, levlCoeffBuf[0] * 0.18945); // 0.18945 = log2(10) * 0.05703125
- flcoeffs2[pos] = log2f(flcoeffs1[0]);
+ flcoeffs2[pos] = log2f(flcoeffs1[pos]);
tmp = flcoeffs1[pos];
tmp2 = flcoeffs2[pos];
@@ -1021,7 +1021,7 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
IMCContext *q = avctx->priv_data;
- LOCAL_ALIGNED_16(uint16_t, buf16, [(IMC_BLOCK_SIZE + FF_INPUT_BUFFER_PADDING_SIZE) / 2]);
+ LOCAL_ALIGNED_16(uint16_t, buf16, [(IMC_BLOCK_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / 2]);
if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {
av_log(avctx, AV_LOG_ERROR, "frame too small!\n");
@@ -1085,7 +1085,7 @@ AVCodec ff_imc_decoder = {
.close = imc_decode_close,
.decode = imc_decode_frame,
.flush = flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
@@ -1101,7 +1101,7 @@ AVCodec ff_iac_decoder = {
.close = imc_decode_close,
.decode = imc_decode_frame,
.flush = flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/imgconvert.c b/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
index dc67560742a..7c1b22fb39e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
+++ b/chromium/third_party/ffmpeg/libavcodec/imgconvert.c
@@ -287,181 +287,6 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
return 0;
}
-#if FF_API_DEINTERLACE
-
-#if HAVE_MMX_EXTERNAL
-#define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx
-#define deinterlace_line ff_deinterlace_line_mmx
-#else
-#define deinterlace_line_inplace deinterlace_line_inplace_c
-#define deinterlace_line deinterlace_line_c
-
-/* filter parameters: [-1 4 2 4 -1] // 8 */
-static void deinterlace_line_c(uint8_t *dst,
- const uint8_t *lum_m4, const uint8_t *lum_m3,
- const uint8_t *lum_m2, const uint8_t *lum_m1,
- const uint8_t *lum,
- int size)
-{
- const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
- int sum;
-
- for(;size > 0;size--) {
- sum = -lum_m4[0];
- sum += lum_m3[0] << 2;
- sum += lum_m2[0] << 1;
- sum += lum_m1[0] << 2;
- sum += -lum[0];
- dst[0] = cm[(sum + 4) >> 3];
- lum_m4++;
- lum_m3++;
- lum_m2++;
- lum_m1++;
- lum++;
- dst++;
- }
-}
-
-static void deinterlace_line_inplace_c(uint8_t *lum_m4, uint8_t *lum_m3,
- uint8_t *lum_m2, uint8_t *lum_m1,
- uint8_t *lum, int size)
-{
- const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
- int sum;
-
- for(;size > 0;size--) {
- sum = -lum_m4[0];
- sum += lum_m3[0] << 2;
- sum += lum_m2[0] << 1;
- lum_m4[0]=lum_m2[0];
- sum += lum_m1[0] << 2;
- sum += -lum[0];
- lum_m2[0] = cm[(sum + 4) >> 3];
- lum_m4++;
- lum_m3++;
- lum_m2++;
- lum_m1++;
- lum++;
- }
-}
-#endif /* !HAVE_MMX_EXTERNAL */
-
-/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
- top field is copied as is, but the bottom field is deinterlaced
- against the top field. */
-static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
- const uint8_t *src1, int src_wrap,
- int width, int height)
-{
- const uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
- int y;
-
- src_m2 = src1;
- src_m1 = src1;
- src_0=&src_m1[src_wrap];
- src_p1=&src_0[src_wrap];
- src_p2=&src_p1[src_wrap];
- for(y=0;y<(height-2);y+=2) {
- memcpy(dst,src_m1,width);
- dst += dst_wrap;
- deinterlace_line(dst,src_m2,src_m1,src_0,src_p1,src_p2,width);
- src_m2 = src_0;
- src_m1 = src_p1;
- src_0 = src_p2;
- src_p1 += 2*src_wrap;
- src_p2 += 2*src_wrap;
- dst += dst_wrap;
- }
- memcpy(dst,src_m1,width);
- dst += dst_wrap;
- /* do last line */
- deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
-}
-
-static int deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
- int width, int height)
-{
- uint8_t *src_m1, *src_0, *src_p1, *src_p2;
- int y;
- uint8_t *buf;
- buf = av_malloc(width);
- if (!buf)
- return AVERROR(ENOMEM);
-
- src_m1 = src1;
- memcpy(buf,src_m1,width);
- src_0=&src_m1[src_wrap];
- src_p1=&src_0[src_wrap];
- src_p2=&src_p1[src_wrap];
- for(y=0;y<(height-2);y+=2) {
- deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
- src_m1 = src_p1;
- src_0 = src_p2;
- src_p1 += 2*src_wrap;
- src_p2 += 2*src_wrap;
- }
- /* do last line */
- deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
- av_free(buf);
- return 0;
-}
-
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- enum AVPixelFormat pix_fmt, int width, int height)
-{
- int i, ret;
-
- if (pix_fmt != AV_PIX_FMT_YUV420P &&
- pix_fmt != AV_PIX_FMT_YUVJ420P &&
- pix_fmt != AV_PIX_FMT_YUV422P &&
- pix_fmt != AV_PIX_FMT_YUVJ422P &&
- pix_fmt != AV_PIX_FMT_YUV444P &&
- pix_fmt != AV_PIX_FMT_YUV411P &&
- pix_fmt != AV_PIX_FMT_GRAY8)
- return -1;
- if ((width & 3) != 0 || (height & 3) != 0)
- return -1;
-
- for(i=0;i<3;i++) {
- if (i == 1) {
- switch(pix_fmt) {
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUV420P:
- width >>= 1;
- height >>= 1;
- break;
- case AV_PIX_FMT_YUV422P:
- case AV_PIX_FMT_YUVJ422P:
- width >>= 1;
- break;
- case AV_PIX_FMT_YUV411P:
- width >>= 2;
- break;
- default:
- break;
- }
- if (pix_fmt == AV_PIX_FMT_GRAY8) {
- break;
- }
- }
- if (src == dst) {
- ret = deinterlace_bottom_field_inplace(dst->data[i],
- dst->linesize[i],
- width, height);
- if (ret < 0)
- return ret;
- } else {
- deinterlace_bottom_field(dst->data[i],dst->linesize[i],
- src->data[i], src->linesize[i],
- width, height);
- }
- }
- emms_c();
- return 0;
-}
-
-#endif /* FF_API_DEINTERLACE */
-
#ifdef TEST
int main(void){
diff --git a/chromium/third_party/ffmpeg/libavcodec/imgconvert.h b/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
index 0ce626d7a24..21c5b879bdf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
+++ b/chromium/third_party/ffmpeg/libavcodec/imgconvert.h
@@ -23,22 +23,6 @@
#include "version.h"
-#if FF_API_DEINTERLACE
-
-void ff_deinterlace_line_mmx(uint8_t *dst,
- const uint8_t *lum_m4, const uint8_t *lum_m3,
- const uint8_t *lum_m2, const uint8_t *lum_m1,
- const uint8_t *lum,
- int size);
-
-void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
- const uint8_t *lum_m3,
- const uint8_t *lum_m2,
- const uint8_t *lum_m1,
- const uint8_t *lum, int size);
-
-#endif /* FF_API_DEINTERLACE */
-
/* 1/2^n downscaling functions */
void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
diff --git a/chromium/third_party/ffmpeg/libavcodec/imx_dump_header_bsf.c b/chromium/third_party/ffmpeg/libavcodec/imx_dump_header_bsf.c
index d53f338a4fa..3a69e98c047 100644
--- a/chromium/third_party/ffmpeg/libavcodec/imx_dump_header_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/imx_dump_header_bsf.c
@@ -42,7 +42,7 @@ static int imx_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx
return 0;
}
- *poutbuf = av_malloc(buf_size + 20 + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = av_malloc(buf_size + 20 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
poutbufp = *poutbuf;
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo2.c b/chromium/third_party/ffmpeg/libavcodec/indeo2.c
index 39735c2e4b5..74135b9af0f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo2.c
@@ -252,5 +252,5 @@ AVCodec ff_indeo2_decoder = {
.init = ir2_decode_init,
.close = ir2_decode_end,
.decode = ir2_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo3.c b/chromium/third_party/ffmpeg/libavcodec/indeo3.c
index 3d0f906e0fd..3f31946d66f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo3.c
@@ -1142,5 +1142,5 @@ AVCodec ff_indeo3_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo4.c b/chromium/third_party/ffmpeg/libavcodec/indeo4.c
index 1c2491d6c1b..0065b52c75e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo4.c
@@ -704,5 +704,5 @@ AVCodec ff_indeo4_decoder = {
.init = decode_init,
.close = ff_ivi_decode_close,
.decode = ff_ivi_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/indeo5.c b/chromium/third_party/ffmpeg/libavcodec/indeo5.c
index 74748633346..5f931c8b985 100644
--- a/chromium/third_party/ffmpeg/libavcodec/indeo5.c
+++ b/chromium/third_party/ffmpeg/libavcodec/indeo5.c
@@ -688,5 +688,5 @@ AVCodec ff_indeo5_decoder = {
.init = decode_init,
.close = ff_ivi_decode_close,
.decode = ff_ivi_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c b/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
index 71e0112cc8e..33f7ffd3312 100644
--- a/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/intelh263dec.c
@@ -136,7 +136,7 @@ AVCodec ff_h263i_decoder = {
.init = ff_h263_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE
diff --git a/chromium/third_party/ffmpeg/libavcodec/internal.h b/chromium/third_party/ffmpeg/libavcodec/internal.h
index 16c59a487da..79cccc9e373 100644
--- a/chromium/third_party/ffmpeg/libavcodec/internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/internal.h
@@ -46,13 +46,13 @@
* all.
*/
#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1)
-
-
-#ifdef DEBUG
-# define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__)
-#else
-# define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
-#endif
+/**
+ * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set
+ * AVFrame.pkt_dts manually. If the flag is set, utils.c won't overwrite
+ * this field. If it's unset, utils.c tries to guess the pkt_dts field
+ * from the input AVPacket.
+ */
+#define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2)
#ifdef TRACE
# define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__)
@@ -61,7 +61,11 @@
#endif
-#define FF_SANE_NB_CHANNELS 63U
+#if !FF_API_QUANT_BIAS
+#define FF_DEFAULT_QUANT_BIAS 999999
+#endif
+
+#define FF_SANE_NB_CHANNELS 64U
#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
@@ -116,14 +120,6 @@ typedef struct AVCodecInternal {
*/
int allocate_progress;
-#if FF_API_OLD_ENCODE_AUDIO
- /**
- * Internal sample count used by avcodec_encode_audio() to fabricate pts.
- * Can be removed along with avcodec_encode_audio().
- */
- int64_t sample_count;
-#endif
-
/**
* An audio frame with less than required samples has been submitted and
* padded with silence. Reject all subsequent frames.
@@ -196,7 +192,7 @@ int avpriv_unlock_avformat(void);
* This value was chosen such that every bit of the buffer is
* addressable by a 32-bit signed integer as used by get_bits.
*/
-#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
+#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
/**
* Check AVPacket size and/or allocate data.
@@ -213,11 +209,20 @@ int avpriv_unlock_avformat(void);
* avpkt->size is set to the specified size.
* All other AVPacket fields will be reset with av_init_packet().
* @param size the minimum required packet size
+ * @param min_size This is a hint to the allocation algorithm, which indicates
+ * to what minimal size the caller might later shrink the packet
+ * to. Encoders often allocate packets which are larger than the
+ * amount of data that is written into them as the exact amount is
+ * not known at the time of allocation. min_size represents the
+ * size a packet might be shrunk to by the caller. Can be set to
+ * 0. setting this roughly correctly allows the allocation code
+ * to choose between several allocation strategies to improve
+ * speed slightly.
* @return non negative on success, negative error code on failure
*/
-int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size);
+int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size);
-int ff_alloc_packet(AVPacket *avpkt, int size);
+attribute_deprecated int ff_alloc_packet(AVPacket *avpkt, int size);
/**
* Rescale from sample rate to AVCodecContext.time_base.
@@ -294,4 +299,6 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt);
*/
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame);
+int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
+
#endif /* AVCODEC_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
index 2106419da32..a29b5fe8da9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
@@ -1048,5 +1048,5 @@ AVCodec ff_interplay_video_decoder = {
.init = ipvideo_decode_init,
.close = ipvideo_decode_end,
.decode = ipvideo_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c b/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
index 29df6fd842e..038b5b170a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ituh263dec.c
@@ -30,6 +30,7 @@
#include <limits.h>
#include "libavutil/attributes.h"
+#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
@@ -138,12 +139,12 @@ int ff_h263_decode_mba(MpegEncContext *s)
{
int i, mb_pos;
- for(i=0; i<6; i++){
- if(s->mb_num-1 <= ff_mba_max[i]) break;
- }
- mb_pos= get_bits(&s->gb, ff_mba_length[i]);
- s->mb_x= mb_pos % s->mb_width;
- s->mb_y= mb_pos / s->mb_width;
+ for (i = 0; i < 6; i++)
+ if (s->mb_num - 1 <= ff_mba_max[i])
+ break;
+ mb_pos = get_bits(&s->gb, ff_mba_length[i]);
+ s->mb_x = mb_pos % s->mb_width;
+ s->mb_y = mb_pos / s->mb_width;
return mb_pos;
}
@@ -873,7 +874,7 @@ end:
/* most is hardcoded. should extend to handle all h263 streams */
int ff_h263_decode_picture_header(MpegEncContext *s)
{
- int format, width, height, i;
+ int format, width, height, i, ret;
uint32_t startcode;
align_get_bits(&s->gb);
@@ -1083,10 +1084,9 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
s->qscale = get_bits(&s->gb, 5);
}
- if (s->width == 0 || s->height == 0) {
- av_log(s->avctx, AV_LOG_ERROR, "dimensions 0\n");
- return -1;
- }
+ if ((ret = av_image_check_size(s->width, s->height, 0, s)) < 0)
+ return ret;
+
s->mb_width = (s->width + 15) / 16;
s->mb_height = (s->height + 15) / 16;
s->mb_num = s->mb_width * s->mb_height;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c b/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
index 78a47bfe335..03f4011bfa0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ituh263enc.c
@@ -453,7 +453,7 @@ void ff_h263_encode_mb(MpegEncContext * s,
int16_t pred_dc;
int16_t rec_intradc[6];
int16_t *dc_ptr[6];
- const int interleaved_stats = s->avctx->flags & CODEC_FLAG_PASS1;
+ const int interleaved_stats = s->avctx->flags & AV_CODEC_FLAG_PASS1;
if (!s->mb_intra) {
/* compute cbp */
diff --git a/chromium/third_party/ffmpeg/libavcodec/j2kenc.c b/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
index 68905cc2d36..152da8bdfd8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/j2kenc.c
@@ -31,12 +31,16 @@
#include "bytestream.h"
#include "jpeg2000.h"
#include "libavutil/common.h"
+#include "libavutil/opt.h"
#define NMSEDEC_BITS 7
#define NMSEDEC_FRACBITS (NMSEDEC_BITS-1)
#define WMSEDEC_SHIFT 13 ///< must be >= 13
#define LAMBDA_SCALE (100000000LL << (WMSEDEC_SHIFT - 13))
+#define CODEC_JP2 1
+#define CODEC_J2K 0
+
static int lut_nmsedec_ref [1<<NMSEDEC_BITS],
lut_nmsedec_ref0[1<<NMSEDEC_BITS],
lut_nmsedec_sig [1<<NMSEDEC_BITS],
@@ -59,6 +63,7 @@ typedef struct {
} Jpeg2000Tile;
typedef struct {
+ AVClass *class;
AVCodecContext *avctx;
const AVFrame *picture;
@@ -81,6 +86,8 @@ typedef struct {
Jpeg2000QuantStyle qntsty;
Jpeg2000Tile *tile;
+
+ int format;
} Jpeg2000EncoderContext;
@@ -271,7 +278,7 @@ static int put_cod(Jpeg2000EncoderContext *s)
bytestream_put_byte(&s->buf, 0); // progression level
bytestream_put_be16(&s->buf, 1); // num of layers
if(s->avctx->pix_fmt == AV_PIX_FMT_YUV444P){
- bytestream_put_byte(&s->buf, 2); // ICT
+ bytestream_put_byte(&s->buf, 0); // unspecified
}else{
bytestream_put_byte(&s->buf, 0); // unspecified
}
@@ -310,6 +317,25 @@ static int put_qcd(Jpeg2000EncoderContext *s, int compno)
return 0;
}
+static int put_com(Jpeg2000EncoderContext *s, int compno)
+{
+ int size = 4 + strlen(LIBAVCODEC_IDENT);
+
+ if (s->avctx->flags & AV_CODEC_FLAG_BITEXACT)
+ return 0;
+
+ if (s->buf_end - s->buf < size + 2)
+ return -1;
+
+ bytestream_put_be16(&s->buf, JPEG2000_COM);
+ bytestream_put_be16(&s->buf, size);
+ bytestream_put_be16(&s->buf, 1); // General use (ISO/IEC 8859-15 (Latin) values)
+
+ bytestream_put_buffer(&s->buf, LIBAVCODEC_IDENT, strlen(LIBAVCODEC_IDENT));
+
+ return 0;
+}
+
static uint8_t *put_sot(Jpeg2000EncoderContext *s, int tileno)
{
uint8_t *psotptr;
@@ -486,18 +512,18 @@ static void encode_sigpass(Jpeg2000T1Context *t1, int width, int height, int ban
for (y0 = 0; y0 < height; y0 += 4)
for (x = 0; x < width; x++)
for (y = y0; y < height && y < y0+4; y++){
- if (!(t1->flags[y+1][x+1] & JPEG2000_T1_SIG) && (t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB)){
- int ctxno = ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1], bandno),
- bit = t1->data[y][x] & mask ? 1 : 0;
+ if (!(t1->flags[(y+1) * t1->stride + x+1] & JPEG2000_T1_SIG) && (t1->flags[(y+1) * t1->stride + x+1] & JPEG2000_T1_SIG_NB)){
+ int ctxno = ff_jpeg2000_getsigctxno(t1->flags[(y+1) * t1->stride + x+1], bandno),
+ bit = t1->data[(y) * t1->stride + x] & mask ? 1 : 0;
ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, bit);
if (bit){
int xorbit;
- int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[y+1][x+1] >> 15) ^ xorbit);
- *nmsedec += getnmsedec_sig(t1->data[y][x], bpno + NMSEDEC_FRACBITS);
- ff_jpeg2000_set_significance(t1, x, y, t1->flags[y+1][x+1] >> 15);
+ int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[(y+1) * t1->stride + x+1], &xorbit);
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[(y+1) * t1->stride + x+1] >> 15) ^ xorbit);
+ *nmsedec += getnmsedec_sig(t1->data[(y) * t1->stride + x], bpno + NMSEDEC_FRACBITS);
+ ff_jpeg2000_set_significance(t1, x, y, t1->flags[(y+1) * t1->stride + x+1] >> 15);
}
- t1->flags[y+1][x+1] |= JPEG2000_T1_VIS;
+ t1->flags[(y+1) * t1->stride + x+1] |= JPEG2000_T1_VIS;
}
}
}
@@ -508,11 +534,11 @@ static void encode_refpass(Jpeg2000T1Context *t1, int width, int height, int *nm
for (y0 = 0; y0 < height; y0 += 4)
for (x = 0; x < width; x++)
for (y = y0; y < height && y < y0+4; y++)
- if ((t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS)) == JPEG2000_T1_SIG){
- int ctxno = ff_jpeg2000_getrefctxno(t1->flags[y+1][x+1]);
- *nmsedec += getnmsedec_ref(t1->data[y][x], bpno + NMSEDEC_FRACBITS);
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[y][x] & mask ? 1:0);
- t1->flags[y+1][x+1] |= JPEG2000_T1_REF;
+ if ((t1->flags[(y+1) * t1->stride + x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS)) == JPEG2000_T1_SIG){
+ int ctxno = ff_jpeg2000_getrefctxno(t1->flags[(y+1) * t1->stride + x+1]);
+ *nmsedec += getnmsedec_ref(t1->data[(y) * t1->stride + x], bpno + NMSEDEC_FRACBITS);
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[(y) * t1->stride + x] & mask ? 1:0);
+ t1->flags[(y+1) * t1->stride + x+1] |= JPEG2000_T1_REF;
}
}
@@ -522,15 +548,15 @@ static void encode_clnpass(Jpeg2000T1Context *t1, int width, int height, int ban
for (y0 = 0; y0 < height; y0 += 4)
for (x = 0; x < width; x++){
if (y0 + 3 < height && !(
- (t1->flags[y0+1][x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0+2][x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0+3][x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0+4][x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG))))
+ (t1->flags[(y0+1) * t1->stride + x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0+2) * t1->stride + x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0+3) * t1->stride + x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0+4) * t1->stride + x+1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG))))
{
// aggregation mode
int rlen;
for (rlen = 0; rlen < 4; rlen++)
- if (t1->data[y0+rlen][x] & mask)
+ if (t1->data[(y0+rlen) * t1->stride + x] & mask)
break;
ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + MQC_CX_RL, rlen != 4);
if (rlen == 4)
@@ -538,34 +564,34 @@ static void encode_clnpass(Jpeg2000T1Context *t1, int width, int height, int ban
ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI, rlen >> 1);
ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI, rlen & 1);
for (y = y0 + rlen; y < y0 + 4; y++){
- if (!(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))){
- int ctxno = ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1], bandno);
+ if (!(t1->flags[(y+1) * t1->stride + x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))){
+ int ctxno = ff_jpeg2000_getsigctxno(t1->flags[(y+1) * t1->stride + x+1], bandno);
if (y > y0 + rlen)
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[y][x] & mask ? 1:0);
- if (t1->data[y][x] & mask){ // newly significant
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[(y) * t1->stride + x] & mask ? 1:0);
+ if (t1->data[(y) * t1->stride + x] & mask){ // newly significant
int xorbit;
- int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);
- *nmsedec += getnmsedec_sig(t1->data[y][x], bpno + NMSEDEC_FRACBITS);
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[y+1][x+1] >> 15) ^ xorbit);
- ff_jpeg2000_set_significance(t1, x, y, t1->flags[y+1][x+1] >> 15);
+ int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[(y+1) * t1->stride + x+1], &xorbit);
+ *nmsedec += getnmsedec_sig(t1->data[(y) * t1->stride + x], bpno + NMSEDEC_FRACBITS);
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[(y+1) * t1->stride + x+1] >> 15) ^ xorbit);
+ ff_jpeg2000_set_significance(t1, x, y, t1->flags[(y+1) * t1->stride + x+1] >> 15);
}
}
- t1->flags[y+1][x+1] &= ~JPEG2000_T1_VIS;
+ t1->flags[(y+1) * t1->stride + x+1] &= ~JPEG2000_T1_VIS;
}
} else{
for (y = y0; y < y0 + 4 && y < height; y++){
- if (!(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))){
- int ctxno = ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1], bandno);
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[y][x] & mask ? 1:0);
- if (t1->data[y][x] & mask){ // newly significant
+ if (!(t1->flags[(y+1) * t1->stride + x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))){
+ int ctxno = ff_jpeg2000_getsigctxno(t1->flags[(y+1) * t1->stride + x+1], bandno);
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, t1->data[(y) * t1->stride + x] & mask ? 1:0);
+ if (t1->data[(y) * t1->stride + x] & mask){ // newly significant
int xorbit;
- int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);
- *nmsedec += getnmsedec_sig(t1->data[y][x], bpno + NMSEDEC_FRACBITS);
- ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[y+1][x+1] >> 15) ^ xorbit);
- ff_jpeg2000_set_significance(t1, x, y, t1->flags[y+1][x+1] >> 15);
+ int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[(y+1) * t1->stride + x+1], &xorbit);
+ *nmsedec += getnmsedec_sig(t1->data[(y) * t1->stride + x], bpno + NMSEDEC_FRACBITS);
+ ff_mqc_encode(&t1->mqc, t1->mqc.cx_states + ctxno, (t1->flags[(y+1) * t1->stride + x+1] >> 15) ^ xorbit);
+ ff_jpeg2000_set_significance(t1, x, y, t1->flags[(y+1) * t1->stride + x+1] >> 15);
}
}
- t1->flags[y+1][x+1] &= ~JPEG2000_T1_VIS;
+ t1->flags[(y+1) * t1->stride + x+1] &= ~JPEG2000_T1_VIS;
}
}
}
@@ -577,16 +603,15 @@ static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg20
int pass_t = 2, passno, x, y, max=0, nmsedec, bpno;
int64_t wmsedec = 0;
- for (y = 0; y < height+2; y++)
- memset(t1->flags[y], 0, (width+2)*sizeof(int));
+ memset(t1->flags, 0, t1->stride * (height + 2) * sizeof(*t1->flags));
for (y = 0; y < height; y++){
for (x = 0; x < width; x++){
- if (t1->data[y][x] < 0){
- t1->flags[y+1][x+1] |= JPEG2000_T1_SGN;
- t1->data[y][x] = -t1->data[y][x];
+ if (t1->data[(y) * t1->stride + x] < 0){
+ t1->flags[(y+1) * t1->stride + x+1] |= JPEG2000_T1_SGN;
+ t1->data[(y) * t1->stride + x] = -t1->data[(y) * t1->stride + x];
}
- max = FFMAX(max, t1->data[y][x]);
+ max = FFMAX(max, t1->data[(y) * t1->stride + x]);
}
}
@@ -820,6 +845,8 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
for (compno = 0; compno < s->ncomponents; compno++){
Jpeg2000Component *comp = s->tile[tileno].comp + compno;
+ t1.stride = (1<<codsty->log2_cblk_width) + 2;
+
av_log(s->avctx, AV_LOG_DEBUG,"dwt\n");
if ((ret = ff_dwt_encode(&comp->dwt, comp->i_data)) < 0)
return ret;
@@ -855,14 +882,14 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
int y, x;
if (codsty->transform == FF_DWT53){
for (y = yy0; y < yy1; y++){
- int *ptr = t1.data[y-yy0];
+ int *ptr = t1.data + (y-yy0)*t1.stride;
for (x = xx0; x < xx1; x++){
*ptr++ = comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * y + x] << NMSEDEC_FRACBITS;
}
}
} else{
for (y = yy0; y < yy1; y++){
- int *ptr = t1.data[y-yy0];
+ int *ptr = t1.data + (y-yy0)*t1.stride;
for (x = xx0; x < xx1; x++){
*ptr = (comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * y + x]);
*ptr = (int64_t)*ptr * (int64_t)(16384 * 65536 / band->i_stepsize) >> 15 - NMSEDEC_FRACBITS;
@@ -916,13 +943,19 @@ static void reinit(Jpeg2000EncoderContext *s)
}
}
+static void update_size(uint8_t *size, const uint8_t *end)
+{
+ AV_WB32(size, end-size);
+}
+
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
int tileno, ret;
Jpeg2000EncoderContext *s = avctx->priv_data;
+ uint8_t *chunkstart, *jp2cstart, *jp2hstart;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*9 + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*9 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
// init:
@@ -936,6 +969,58 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
copy_frame(s);
reinit(s);
+ if (s->format == CODEC_JP2) {
+ av_assert0(s->buf == pkt->data);
+
+ bytestream_put_be32(&s->buf, 0x0000000C);
+ bytestream_put_be32(&s->buf, 0x6A502020);
+ bytestream_put_be32(&s->buf, 0x0D0A870A);
+
+ chunkstart = s->buf;
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "ftyp", 4);
+ bytestream_put_buffer(&s->buf, "jp2\040\040", 4);
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "jp2\040", 4);
+ update_size(chunkstart, s->buf);
+
+ jp2hstart = s->buf;
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "jp2h", 4);
+
+ chunkstart = s->buf;
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "ihdr", 4);
+ bytestream_put_be32(&s->buf, avctx->height);
+ bytestream_put_be32(&s->buf, avctx->width);
+ bytestream_put_be16(&s->buf, s->ncomponents);
+ bytestream_put_byte(&s->buf, s->cbps[0]);
+ bytestream_put_byte(&s->buf, 7);
+ bytestream_put_byte(&s->buf, 0);
+ bytestream_put_byte(&s->buf, 0);
+ update_size(chunkstart, s->buf);
+
+ chunkstart = s->buf;
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "colr", 4);
+ bytestream_put_byte(&s->buf, 1);
+ bytestream_put_byte(&s->buf, 0);
+ bytestream_put_byte(&s->buf, 0);
+ if (s->ncomponents == 1) {
+ bytestream_put_be32(&s->buf, 17);
+ } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
+ bytestream_put_be32(&s->buf, 16);
+ } else {
+ bytestream_put_be32(&s->buf, 18);
+ }
+ update_size(chunkstart, s->buf);
+ update_size(jp2hstart, s->buf);
+
+ jp2cstart = s->buf;
+ bytestream_put_be32(&s->buf, 0);
+ bytestream_put_buffer(&s->buf, "jp2c", 4);
+ }
+
if (s->buf_end - s->buf < 2)
return -1;
bytestream_put_be16(&s->buf, JPEG2000_SOC);
@@ -945,6 +1030,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return ret;
if ((ret = put_qcd(s, 0)) < 0)
return ret;
+ if ((ret = put_com(s, 0)) < 0)
+ return ret;
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){
uint8_t *psotptr;
@@ -961,6 +1048,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return -1;
bytestream_put_be16(&s->buf, JPEG2000_EOC);
+ if (s->format == CODEC_JP2)
+ update_size(jp2cstart, s->buf);
+
av_log(s->avctx, AV_LOG_DEBUG, "end\n");
pkt->size = s->buf - s->buf_start;
pkt->flags |= AV_PKT_FLAG_KEY;
@@ -991,8 +1081,10 @@ static av_cold int j2kenc_init(AVCodecContext *avctx)
qntsty->nguardbits = 1;
- s->tile_width = 256;
- s->tile_height = 256;
+ if ((s->tile_width & (s->tile_width -1)) ||
+ (s->tile_height & (s->tile_height-1))) {
+ av_log(avctx, AV_LOG_WARNING, "Tile dimension not a power of 2\n");
+ }
if (codsty->transform == FF_DWT53)
qntsty->quantsty = JPEG2000_QSTY_NONE;
@@ -1037,6 +1129,27 @@ static int j2kenc_destroy(AVCodecContext *avctx)
return 0;
}
+// taken from the libopenjpeg wraper so it matches
+
+#define OFFSET(x) offsetof(Jpeg2000EncoderContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "format", "Codec Format", OFFSET(format), AV_OPT_TYPE_INT, { .i64 = CODEC_JP2 }, CODEC_J2K, CODEC_JP2, VE, "format" },
+ { "j2k", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CODEC_J2K }, 0, 0, VE, "format" },
+ { "jp2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CODEC_JP2 }, 0, 0, VE, "format" },
+ { "tile_width", "Tile Width", OFFSET(tile_width), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, 1<<30, VE, },
+ { "tile_height", "Tile Height", OFFSET(tile_height), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, 1<<30, VE, },
+
+ { NULL }
+};
+
+static const AVClass j2k_class = {
+ .class_name = "jpeg 2000 encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_jpeg2000_encoder = {
.name = "jpeg2000",
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
@@ -1046,12 +1159,11 @@ AVCodec ff_jpeg2000_encoder = {
.init = j2kenc_init,
.encode2 = encode_frame,
.close = j2kenc_destroy,
- .capabilities = CODEC_CAP_EXPERIMENTAL,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GRAY8,
-/* AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,*/
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE
- }
+ },
+ .priv_class = &j2k_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
index 427f6f7423c..09654e82f6e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
@@ -171,25 +171,25 @@ void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y,
{
x++;
y++;
- t1->flags[y][x] |= JPEG2000_T1_SIG;
+ t1->flags[(y) * t1->stride + x] |= JPEG2000_T1_SIG;
if (negative) {
- t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W;
- t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E;
- t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N | JPEG2000_T1_SGN_N;
- t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S | JPEG2000_T1_SGN_S;
+ t1->flags[(y) * t1->stride + x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W;
+ t1->flags[(y) * t1->stride + x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E;
+ t1->flags[(y + 1) * t1->stride + x] |= JPEG2000_T1_SIG_N | JPEG2000_T1_SGN_N;
+ t1->flags[(y - 1) * t1->stride + x] |= JPEG2000_T1_SIG_S | JPEG2000_T1_SGN_S;
} else {
- t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W;
- t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E;
- t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N;
- t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S;
+ t1->flags[(y) * t1->stride + x + 1] |= JPEG2000_T1_SIG_W;
+ t1->flags[(y) * t1->stride + x - 1] |= JPEG2000_T1_SIG_E;
+ t1->flags[(y + 1) * t1->stride + x] |= JPEG2000_T1_SIG_N;
+ t1->flags[(y - 1) * t1->stride + x] |= JPEG2000_T1_SIG_S;
}
- t1->flags[y + 1][x + 1] |= JPEG2000_T1_SIG_NW;
- t1->flags[y + 1][x - 1] |= JPEG2000_T1_SIG_NE;
- t1->flags[y - 1][x + 1] |= JPEG2000_T1_SIG_SW;
- t1->flags[y - 1][x - 1] |= JPEG2000_T1_SIG_SE;
+ t1->flags[(y + 1) * t1->stride + x + 1] |= JPEG2000_T1_SIG_NW;
+ t1->flags[(y + 1) * t1->stride + x - 1] |= JPEG2000_T1_SIG_NE;
+ t1->flags[(y - 1) * t1->stride + x + 1] |= JPEG2000_T1_SIG_SW;
+ t1->flags[(y - 1) * t1->stride + x - 1] |= JPEG2000_T1_SIG_SE;
}
-static const uint8_t lut_gain[2][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 2 } };
+// static const uint8_t lut_gain[2][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 2 } }; (unused)
int ff_jpeg2000_init_component(Jpeg2000Component *comp,
Jpeg2000CodingStyle *codsty,
@@ -215,13 +215,13 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
(comp->coord[1][1] - comp->coord[1][0]);
if (codsty->transform == FF_DWT97) {
- csize += FF_INPUT_BUFFER_PADDING_SIZE / sizeof(*comp->f_data);
+ csize += AV_INPUT_BUFFER_PADDING_SIZE / sizeof(*comp->f_data);
comp->i_data = NULL;
comp->f_data = av_mallocz_array(csize, sizeof(*comp->f_data));
if (!comp->f_data)
return AVERROR(ENOMEM);
} else {
- csize += FF_INPUT_BUFFER_PADDING_SIZE / sizeof(*comp->i_data);
+ csize += AV_INPUT_BUFFER_PADDING_SIZE / sizeof(*comp->i_data);
comp->f_data = NULL;
comp->i_data = av_mallocz_array(csize, sizeof(*comp->i_data));
if (!comp->i_data)
@@ -305,9 +305,6 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
* delta_b = 2 ^ (R_b - expn_b) * (1 + (mant_b / 2 ^ 11))
* R_b = R_I + log2 (gain_b )
* see ISO/IEC 15444-1:2002 E.1.1 eqn. E-3 and E-4 */
- /* TODO/WARN: value of log2 (gain_b ) not taken into account
- * but it works (compared to OpenJPEG). Why?
- * Further investigation needed. */
gain = cbps;
band->f_stepsize = pow(2.0, gain - qntsty->expn[gbandno]);
band->f_stepsize *= qntsty->mant[gbandno] / 2048.0 + 1.0;
@@ -317,13 +314,30 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
av_log(avctx, AV_LOG_ERROR, "Unknown quantization format\n");
break;
}
+ if (codsty->transform != FF_DWT53) {
+ int lband = 0;
+ switch (bandno + (reslevelno > 0)) {
+ case 1:
+ case 2:
+ band->f_stepsize *= F_LFTG_X * 2;
+ lband = 1;
+ break;
+ case 3:
+ band->f_stepsize *= F_LFTG_X * F_LFTG_X * 4;
+ break;
+ }
+ if (codsty->transform == FF_DWT97) {
+ band->f_stepsize *= pow(F_LFTG_K, 2*(codsty->nreslevels2decode - reslevelno) + lband - 2);
+ }
+ }
+
+ band->i_stepsize = band->f_stepsize * (1 << 15);
+
/* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
* If not set output of entropic decoder is not correct. */
if (!av_codec_is_encoder(avctx->codec))
band->f_stepsize *= 0.5;
- band->i_stepsize = band->f_stepsize * (1 << 15);
-
/* computation of tbx_0, tbx_1, tby_0, tby_1
* see ISO/IEC 15444-1:2002 B.5 eq. B-15 and tbl B.1
* codeblock width and height is computed for
@@ -350,7 +364,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
/* Formula example for tbx_0 = ceildiv((tcx_0 - 2 ^ (declvl - 1) * x0_b) / declvl) */
band->coord[i][j] =
ff_jpeg2000_ceildivpow2(comp->coord_o[i][j] -
- (((bandno + 1 >> i) & 1) << declvl - 1),
+ (((bandno + 1 >> i) & 1LL) << declvl - 1),
declvl);
/* TODO: Manage case of 3 band offsets here or
* in coding/decoding function? */
@@ -378,27 +392,29 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
Jpeg2000Prec *prec = band->prec + precno;
int nb_codeblocks;
+ prec->decoded_layers = 0;
+
/* TODO: Explain formula for JPEG200 DCINEMA. */
/* TODO: Verify with previous count of codeblocks per band */
/* Compute P_x0 */
- prec->coord[0][0] = ((band->coord[0][0] >> reslevel->log2_prec_width) + precno % reslevel->num_precincts_x) *
+ prec->coord[0][0] = ((band->coord[0][0] >> log2_band_prec_width) + precno % reslevel->num_precincts_x) *
(1 << log2_band_prec_width);
- prec->coord[0][0] = FFMAX(prec->coord[0][0], band->coord[0][0]);
/* Compute P_y0 */
- prec->coord[1][0] = ((band->coord[1][0] >> reslevel->log2_prec_height) + precno / reslevel->num_precincts_x) *
+ prec->coord[1][0] = ((band->coord[1][0] >> log2_band_prec_height) + precno / reslevel->num_precincts_x) *
(1 << log2_band_prec_height);
- prec->coord[1][0] = FFMAX(prec->coord[1][0], band->coord[1][0]);
/* Compute P_x1 */
prec->coord[0][1] = prec->coord[0][0] +
(1 << log2_band_prec_width);
+ prec->coord[0][0] = FFMAX(prec->coord[0][0], band->coord[0][0]);
prec->coord[0][1] = FFMIN(prec->coord[0][1], band->coord[0][1]);
/* Compute P_y1 */
prec->coord[1][1] = prec->coord[1][0] +
(1 << log2_band_prec_height);
+ prec->coord[1][0] = FFMAX(prec->coord[1][0], band->coord[1][0]);
prec->coord[1][1] = FFMIN(prec->coord[1][1], band->coord[1][1]);
prec->nb_codeblocks_width =
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.h b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.h
index f963cbeb5dd..7a21c4e45f6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.h
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.h
@@ -67,11 +67,7 @@ enum Jpeg2000Quantsty { // quantization style
JPEG2000_QSTY_SE // scalar expounded
};
-#define JPEG2000_MAX_CBLKW 64
-#define JPEG2000_MAX_CBLKH 64
-
-
-#define JPEG2000_MAX_DECLEVELS 32
+#define JPEG2000_MAX_DECLEVELS 33
#define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1)
#define JPEG2000_MAX_PASSES 100
@@ -123,9 +119,10 @@ enum Jpeg2000Quantsty { // quantization style
#define JPEG2000_PGOD_CPRL 0x04 // Component-position-resolution level-layer progression
typedef struct Jpeg2000T1Context {
- int data[JPEG2000_MAX_CBLKW][JPEG2000_MAX_CBLKH];
- int flags[JPEG2000_MAX_CBLKW + 2][JPEG2000_MAX_CBLKH + 2];
+ int data[6144];
+ uint16_t flags[6156];
MqcState mqc;
+ int stride;
} Jpeg2000T1Context;
typedef struct Jpeg2000TgtNode {
@@ -186,6 +183,7 @@ typedef struct Jpeg2000Prec {
Jpeg2000TgtNode *zerobits;
Jpeg2000TgtNode *cblkincl;
Jpeg2000Cblk *cblk;
+ int decoded_layers;
uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
} Jpeg2000Prec; // precinct
@@ -217,7 +215,7 @@ typedef struct Jpeg2000Component {
/* misc tools */
static inline int ff_jpeg2000_ceildivpow2(int a, int b)
{
- return (a + (1 << b) - 1) >> b;
+ return -(((int64_t)(-a)) >> b);
}
static inline int ff_jpeg2000_ceildiv(int a, int b)
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
index 35535423da5..68c0a178662 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
@@ -47,6 +47,23 @@
#define HAD_COC 0x01
#define HAD_QCC 0x02
+#define MAX_POCS 32
+
+typedef struct Jpeg2000POCEntry {
+ uint16_t LYEpoc;
+ uint16_t CSpoc;
+ uint16_t CEpoc;
+ uint8_t RSpoc;
+ uint8_t REpoc;
+ uint8_t Ppoc;
+} Jpeg2000POCEntry;
+
+typedef struct Jpeg2000POC {
+ Jpeg2000POCEntry poc[MAX_POCS];
+ int nb_poc;
+ int is_default;
+} Jpeg2000POC;
+
typedef struct Jpeg2000TilePart {
uint8_t tile_index; // Tile index who refers the tile-part
const uint8_t *tp_end;
@@ -60,8 +77,10 @@ typedef struct Jpeg2000Tile {
uint8_t properties[4];
Jpeg2000CodingStyle codsty[4];
Jpeg2000QuantStyle qntsty[4];
- Jpeg2000TilePart tile_part[32];
+ Jpeg2000POC poc;
+ Jpeg2000TilePart tile_part[256];
uint16_t tp_idx; // Tile-part index
+ int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
} Jpeg2000Tile;
typedef struct Jpeg2000DecoderContext {
@@ -88,6 +107,7 @@ typedef struct Jpeg2000DecoderContext {
Jpeg2000CodingStyle codsty[4];
Jpeg2000QuantStyle qntsty[4];
+ Jpeg2000POC poc;
int bit_index;
@@ -181,20 +201,20 @@ static int pix_fmt_match(enum AVPixelFormat pix_fmt, int components,
switch (components) {
case 4:
- match = match && desc->comp[3].depth_minus1 + 1 >= bpc &&
+ match = match && desc->comp[3].depth >= bpc &&
(log2_chroma_wh >> 14 & 3) == 0 &&
(log2_chroma_wh >> 12 & 3) == 0;
case 3:
- match = match && desc->comp[2].depth_minus1 + 1 >= bpc &&
+ match = match && desc->comp[2].depth >= bpc &&
(log2_chroma_wh >> 10 & 3) == desc->log2_chroma_w &&
(log2_chroma_wh >> 8 & 3) == desc->log2_chroma_h;
case 2:
- match = match && desc->comp[1].depth_minus1 + 1 >= bpc &&
+ match = match && desc->comp[1].depth >= bpc &&
(log2_chroma_wh >> 6 & 3) == desc->log2_chroma_w &&
(log2_chroma_wh >> 4 & 3) == desc->log2_chroma_h;
case 1:
- match = match && desc->comp[0].depth_minus1 + 1 >= bpc &&
+ match = match && desc->comp[0].depth >= bpc &&
(log2_chroma_wh >> 2 & 3) == 0 &&
(log2_chroma_wh & 3) == 0 &&
(desc->flags & AV_PIX_FMT_FLAG_PAL) == pal8 * AV_PIX_FMT_FLAG_PAL;
@@ -439,11 +459,6 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
return AVERROR_INVALIDDATA;
}
- if (c->log2_cblk_width > 6 || c->log2_cblk_height > 6) {
- avpriv_request_sample(s->avctx, "cblk size > 64");
- return AVERROR_PATCHWELCOME;
- }
-
c->cblk_style = bytestream2_get_byteu(&s->g);
if (c->cblk_style != 0) { // cblk style
av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style);
@@ -452,8 +467,11 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
}
c->transform = bytestream2_get_byteu(&s->g); // DWT transformation type
/* set integer 9/7 DWT in case of BITEXACT flag */
- if ((s->avctx->flags & CODEC_FLAG_BITEXACT) && (c->transform == FF_DWT97))
+ if ((s->avctx->flags & AV_CODEC_FLAG_BITEXACT) && (c->transform == FF_DWT97))
c->transform = FF_DWT97_INT;
+ else if (c->transform == FF_DWT53) {
+ s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
+ }
if (c->csty & JPEG2000_CSTY_PREC) {
int i;
@@ -461,6 +479,13 @@ static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
byte = bytestream2_get_byte(&s->g);
c->log2_prec_widths[i] = byte & 0x0F; // precinct PPx
c->log2_prec_heights[i] = (byte >> 4) & 0x0F; // precinct PPy
+ if (i)
+ if (c->log2_prec_widths[i] == 0 || c->log2_prec_heights[i] == 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "PPx %d PPy %d invalid\n",
+ c->log2_prec_widths[i], c->log2_prec_heights[i]);
+ c->log2_prec_widths[i] = c->log2_prec_heights[i] = 1;
+ return AVERROR_INVALIDDATA;
+ }
}
} else {
memset(c->log2_prec_widths , 15, sizeof(c->log2_prec_widths ));
@@ -621,13 +646,74 @@ static int get_qcc(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
return get_qcx(s, n - 1, q + compno);
}
+static int get_poc(Jpeg2000DecoderContext *s, int size, Jpeg2000POC *p)
+{
+ int i;
+ int elem_size = s->ncomponents <= 257 ? 7 : 9;
+ Jpeg2000POC tmp = {{{0}}};
+
+ if (bytestream2_get_bytes_left(&s->g) < 5 || size < 2 + elem_size) {
+ av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for POC\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (elem_size > 7) {
+ avpriv_request_sample(s->avctx, "Fat POC not supported");
+ return AVERROR_PATCHWELCOME;
+ }
+
+ tmp.nb_poc = (size - 2) / elem_size;
+ if (tmp.nb_poc > MAX_POCS) {
+ avpriv_request_sample(s->avctx, "Too many POCs (%d)", tmp.nb_poc);
+ return AVERROR_PATCHWELCOME;
+ }
+
+ for (i = 0; i<tmp.nb_poc; i++) {
+ Jpeg2000POCEntry *e = &tmp.poc[i];
+ e->RSpoc = bytestream2_get_byteu(&s->g);
+ e->CSpoc = bytestream2_get_byteu(&s->g);
+ e->LYEpoc = bytestream2_get_be16u(&s->g);
+ e->REpoc = bytestream2_get_byteu(&s->g);
+ e->CEpoc = bytestream2_get_byteu(&s->g);
+ e->Ppoc = bytestream2_get_byteu(&s->g);
+ if (!e->CEpoc)
+ e->CEpoc = 256;
+ if (e->CEpoc > s->ncomponents)
+ e->CEpoc = s->ncomponents;
+ if ( e->RSpoc >= e->REpoc || e->REpoc > 33
+ || e->CSpoc >= e->CEpoc || e->CEpoc > s->ncomponents
+ || !e->LYEpoc) {
+ av_log(s->avctx, AV_LOG_ERROR, "POC Entry %d is invalid (%d, %d, %d, %d, %d, %d)\n", i,
+ e->RSpoc, e->CSpoc, e->LYEpoc, e->REpoc, e->CEpoc, e->Ppoc
+ );
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
+ if (!p->nb_poc || p->is_default) {
+ *p = tmp;
+ } else {
+ if (p->nb_poc + tmp.nb_poc > MAX_POCS) {
+ av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for POC\n");
+ return AVERROR_INVALIDDATA;
+ }
+ memcpy(p->poc + p->nb_poc, tmp.poc, tmp.nb_poc * sizeof(tmp.poc[0]));
+ p->nb_poc += tmp.nb_poc;
+ }
+
+ p->is_default = 0;
+
+ return 0;
+}
+
+
/* Get start of tile segment. */
static int get_sot(Jpeg2000DecoderContext *s, int n)
{
Jpeg2000TilePart *tp;
uint16_t Isot;
uint32_t Psot;
- uint8_t TPsot;
+ unsigned TPsot;
if (bytestream2_get_bytes_left(&s->g) < 8)
return AVERROR_INVALIDDATA;
@@ -652,10 +738,7 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
return AVERROR_INVALIDDATA;
}
- if (TPsot >= FF_ARRAY_ELEMS(s->tile[Isot].tile_part)) {
- avpriv_request_sample(s->avctx, "Support for %"PRIu8" components", TPsot);
- return AVERROR_PATCHWELCOME;
- }
+ av_assert0(TPsot < FF_ARRAY_ELEMS(s->tile[Isot].tile_part));
s->tile[Isot].tp_idx = TPsot;
tp = s->tile[Isot].tile_part + TPsot;
@@ -668,6 +751,8 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
/* copy defaults */
memcpy(tile->codsty, s->codsty, s->ncomponents * sizeof(Jpeg2000CodingStyle));
memcpy(tile->qntsty, s->qntsty, s->ncomponents * sizeof(Jpeg2000QuantStyle));
+ memcpy(&tile->poc , &s->poc , sizeof(tile->poc));
+ tile->poc.is_default = 1;
}
return 0;
@@ -741,16 +826,21 @@ static int init_tile(Jpeg2000DecoderContext *s, int tileno)
if (!tile->comp)
return AVERROR(ENOMEM);
+ tile->coord[0][0] = FFMAX(tilex * s->tile_width + s->tile_offset_x, s->image_offset_x);
+ tile->coord[0][1] = FFMIN((tilex + 1) * s->tile_width + s->tile_offset_x, s->width);
+ tile->coord[1][0] = FFMAX(tiley * s->tile_height + s->tile_offset_y, s->image_offset_y);
+ tile->coord[1][1] = FFMIN((tiley + 1) * s->tile_height + s->tile_offset_y, s->height);
+
for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
int ret; // global bandno
- comp->coord_o[0][0] = FFMAX(tilex * s->tile_width + s->tile_offset_x, s->image_offset_x);
- comp->coord_o[0][1] = FFMIN((tilex + 1) * s->tile_width + s->tile_offset_x, s->width);
- comp->coord_o[1][0] = FFMAX(tiley * s->tile_height + s->tile_offset_y, s->image_offset_y);
- comp->coord_o[1][1] = FFMIN((tiley + 1) * s->tile_height + s->tile_offset_y, s->height);
+ comp->coord_o[0][0] = tile->coord[0][0];
+ comp->coord_o[0][1] = tile->coord[0][1];
+ comp->coord_o[1][0] = tile->coord[1][0];
+ comp->coord_o[1][1] = tile->coord[1][1];
if (compno) {
comp->coord_o[0][0] /= s->cdx[compno];
comp->coord_o[0][1] /= s->cdx[compno];
@@ -806,6 +896,10 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
int bandno, cblkno, ret, nb_code_blocks;
int cwsno;
+ if (layno < rlevel->band[0].prec[precno].decoded_layers)
+ return 0;
+ rlevel->band[0].prec[precno].decoded_layers = layno + 1;
+
if (bytestream2_get_bytes_left(&s->g) == 0 && s->bit_index == 8) {
if (*tp_index < FF_ARRAY_ELEMS(tile->tile_part) - 1) {
s->g = tile->tile_part[++(*tp_index)].tpg;
@@ -857,14 +951,14 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
return newpasses;
av_assert2(newpasses > 0);
if (cblk->npasses + newpasses >= JPEG2000_MAX_PASSES) {
- avpriv_request_sample(s->avctx, "Too many passes\n");
+ avpriv_request_sample(s->avctx, "Too many passes");
return AVERROR_PATCHWELCOME;
}
if ((llen = getlblockinc(s)) < 0)
return llen;
if (cblk->lblock + llen + av_log2(newpasses) > 16) {
avpriv_request_sample(s->avctx,
- "Block with length beyond 16 bits\n");
+ "Block with length beyond 16 bits");
return AVERROR_PATCHWELCOME;
}
@@ -903,7 +997,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
if (bytestream2_peek_be16(&s->g) == JPEG2000_EPH)
bytestream2_skip(&s->g, 2);
else
- av_log(s->avctx, AV_LOG_ERROR, "EPH marker not found.\n");
+ av_log(s->avctx, AV_LOG_ERROR, "EPH marker not found. instead %X\n", bytestream2_peek_be32(&s->g));
}
for (bandno = 0; bandno < rlevel->nbands; bandno++) {
@@ -939,23 +1033,24 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
return 0;
}
-static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
+static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
+ int RSpoc, int CSpoc,
+ int LYEpoc, int REpoc, int CEpoc,
+ int Ppoc, int *tp_index)
{
int ret = 0;
int layno, reslevelno, compno, precno, ok_reslevel;
int x, y;
- int tp_index = 0;
int step_x, step_y;
- s->bit_index = 8;
- switch (tile->codsty[0].prog_order) {
+ switch (Ppoc) {
case JPEG2000_PGOD_RLCP:
av_log(s->avctx, AV_LOG_DEBUG, "Progression order RLCP\n");
ok_reslevel = 1;
- for (reslevelno = 0; ok_reslevel; reslevelno++) {
+ for (reslevelno = RSpoc; ok_reslevel && reslevelno < REpoc; reslevelno++) {
ok_reslevel = 0;
- for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (layno = 0; layno < LYEpoc; layno++) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
if (reslevelno < codsty->nreslevels) {
@@ -963,7 +1058,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
reslevelno;
ok_reslevel = 1;
for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -977,11 +1072,11 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
case JPEG2000_PGOD_LRCP:
av_log(s->avctx, AV_LOG_DEBUG, "Progression order LRCP\n");
- for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
+ for (layno = 0; layno < LYEpoc; layno++) {
ok_reslevel = 1;
- for (reslevelno = 0; ok_reslevel; reslevelno++) {
+ for (reslevelno = RSpoc; ok_reslevel && reslevelno < REpoc; reslevelno++) {
ok_reslevel = 0;
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
if (reslevelno < codsty->nreslevels) {
@@ -989,7 +1084,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
reslevelno;
ok_reslevel = 1;
for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -1003,45 +1098,41 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
case JPEG2000_PGOD_CPRL:
av_log(s->avctx, AV_LOG_DEBUG, "Progression order CPRL\n");
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
- int maxlogstep_x = 0;
- int maxlogstep_y = 0;
- int start_x, start_y;
step_x = 32;
step_y = 32;
- for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
+ for (reslevelno = RSpoc; reslevelno < FFMIN(codsty->nreslevels, REpoc); reslevelno++) {
uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; // ==> N_L - r
Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
step_x = FFMIN(step_x, rlevel->log2_prec_width + reducedresno);
step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno);
- maxlogstep_x = FFMAX(maxlogstep_x, rlevel->log2_prec_width + reducedresno);
- maxlogstep_y = FFMAX(maxlogstep_y, rlevel->log2_prec_height + reducedresno);
}
+ av_assert0(step_x < 32 && step_y < 32);
step_x = 1<<step_x;
step_y = 1<<step_y;
- start_y = comp->coord_o[1][0] >> maxlogstep_y << maxlogstep_y;
- start_x = comp->coord_o[0][0] >> maxlogstep_x << maxlogstep_x;
- for (y = start_y; y < comp->coord_o[1][1]; y += step_y) {
- for (x = start_x; x < comp->coord_o[0][1]; x += step_x) {
- for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
+ for (y = tile->coord[1][0]; y < tile->coord[1][1]; y = (y/step_y + 1)*step_y) {
+ for (x = tile->coord[0][0]; x < tile->coord[0][1]; x = (x/step_x + 1)*step_x) {
+ for (reslevelno = RSpoc; reslevelno < FFMIN(codsty->nreslevels, REpoc); reslevelno++) {
unsigned prcx, prcy;
uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; // ==> N_L - r
Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
+ int xc = x / s->cdx[compno];
+ int yc = y / s->cdy[compno];
- if (y % (1 << (rlevel->log2_prec_height + reducedresno)))
+ if (yc % (1 << (rlevel->log2_prec_height + reducedresno)) && y != tile->coord[1][0]) //FIXME this is a subset of the check
continue;
- if (x % (1 << (rlevel->log2_prec_width + reducedresno)))
+ if (xc % (1 << (rlevel->log2_prec_width + reducedresno)) && x != tile->coord[0][0]) //FIXME this is a subset of the check
continue;
// check if a precinct exists
- prcx = ff_jpeg2000_ceildivpow2(x, reducedresno) >> rlevel->log2_prec_width;
- prcy = ff_jpeg2000_ceildivpow2(y, reducedresno) >> rlevel->log2_prec_height;
+ prcx = ff_jpeg2000_ceildivpow2(xc, reducedresno) >> rlevel->log2_prec_width;
+ prcy = ff_jpeg2000_ceildivpow2(yc, reducedresno) >> rlevel->log2_prec_height;
prcx -= ff_jpeg2000_ceildivpow2(comp->coord_o[0][0], reducedresno) >> rlevel->log2_prec_width;
prcy -= ff_jpeg2000_ceildivpow2(comp->coord_o[1][0], reducedresno) >> rlevel->log2_prec_height;
@@ -1053,8 +1144,8 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
continue;
}
- for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index, codsty, rlevel,
+ for (layno = 0; layno < LYEpoc; layno++) {
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index, codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
qntsty->nguardbits)) < 0)
@@ -1069,12 +1160,11 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
case JPEG2000_PGOD_RPCL:
av_log(s->avctx, AV_LOG_WARNING, "Progression order RPCL\n");
ok_reslevel = 1;
- for (reslevelno = 0; ok_reslevel; reslevelno++) {
+ for (reslevelno = RSpoc; ok_reslevel && reslevelno < REpoc; reslevelno++) {
ok_reslevel = 0;
-
- step_x = 32;
- step_y = 32;
- for (compno = 0; compno < s->ncomponents; compno++) {
+ step_x = 30;
+ step_y = 30;
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
@@ -1088,10 +1178,9 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
step_x = 1<<step_x;
step_y = 1<<step_y;
- //FIXME we could iterate over less than the whole image
- for (y = 0; y < s->height; y += step_y) {
- for (x = 0; x < s->width; x += step_x) {
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (y = tile->coord[1][0]; y < tile->coord[1][1]; y = (y/step_y + 1)*step_y) {
+ for (x = tile->coord[0][0]; x < tile->coord[0][1]; x = (x/step_x + 1)*step_x) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
@@ -1105,10 +1194,10 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
if (reslevelno >= codsty->nreslevels)
continue;
- if (yc % (1 << (rlevel->log2_prec_height + reducedresno)))
+ if (yc % (1 << (rlevel->log2_prec_height + reducedresno)) && y != tile->coord[1][0]) //FIXME this is a subset of the check
continue;
- if (xc % (1 << (rlevel->log2_prec_width + reducedresno)))
+ if (xc % (1 << (rlevel->log2_prec_width + reducedresno)) && x != tile->coord[0][0]) //FIXME this is a subset of the check
continue;
// check if a precinct exists
@@ -1119,15 +1208,15 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
precno = prcx + rlevel->num_precincts_x * prcy;
+ ok_reslevel = 1;
if (prcx >= rlevel->num_precincts_x || prcy >= rlevel->num_precincts_y) {
av_log(s->avctx, AV_LOG_WARNING, "prc %d %d outside limits %d %d\n",
prcx, prcy, rlevel->num_precincts_x, rlevel->num_precincts_y);
continue;
}
- ok_reslevel = 1;
- for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index,
+ for (layno = 0; layno < LYEpoc; layno++) {
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index,
codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
@@ -1141,15 +1230,14 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
break;
case JPEG2000_PGOD_PCRL:
- av_log(s->avctx, AV_LOG_WARNING, "Progression order PCRL");
+ av_log(s->avctx, AV_LOG_WARNING, "Progression order PCRL\n");
step_x = 32;
step_y = 32;
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
- Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
- for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
+ for (reslevelno = RSpoc; reslevelno < FFMIN(codsty->nreslevels, REpoc); reslevelno++) {
uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; // ==> N_L - r
Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
step_x = FFMIN(step_x, rlevel->log2_prec_width + reducedresno);
@@ -1159,25 +1247,24 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
step_x = 1<<step_x;
step_y = 1<<step_y;
- //FIXME we could iterate over less than the whole image
- for (y = 0; y < s->height; y += step_y) {
- for (x = 0; x < s->width; x += step_x) {
- for (compno = 0; compno < s->ncomponents; compno++) {
+ for (y = tile->coord[1][0]; y < tile->coord[1][1]; y = (y/step_y + 1)*step_y) {
+ for (x = tile->coord[0][0]; x < tile->coord[0][1]; x = (x/step_x + 1)*step_x) {
+ for (compno = CSpoc; compno < CEpoc; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
Jpeg2000QuantStyle *qntsty = tile->qntsty + compno;
int xc = x / s->cdx[compno];
int yc = y / s->cdy[compno];
- for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
+ for (reslevelno = RSpoc; reslevelno < FFMIN(codsty->nreslevels, REpoc); reslevelno++) {
unsigned prcx, prcy;
uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; // ==> N_L - r
Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
- if (yc % (1 << (rlevel->log2_prec_height + reducedresno)))
+ if (yc % (1 << (rlevel->log2_prec_height + reducedresno)) && y != tile->coord[1][0]) //FIXME this is a subset of the check
continue;
- if (xc % (1 << (rlevel->log2_prec_width + reducedresno)))
+ if (xc % (1 << (rlevel->log2_prec_width + reducedresno)) && x != tile->coord[0][0]) //FIXME this is a subset of the check
continue;
// check if a precinct exists
@@ -1194,8 +1281,8 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
continue;
}
- for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
- if ((ret = jpeg2000_decode_packet(s, tile, &tp_index, codsty, rlevel,
+ for (layno = 0; layno < LYEpoc; layno++) {
+ if ((ret = jpeg2000_decode_packet(s, tile, tp_index, codsty, rlevel,
precno, layno,
qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
qntsty->nguardbits)) < 0)
@@ -1211,6 +1298,39 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
break;
}
+ return ret;
+}
+
+static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
+{
+ int ret = AVERROR_BUG;
+ int i;
+ int tp_index = 0;
+
+ s->bit_index = 8;
+ if (tile->poc.nb_poc) {
+ for (i=0; i<tile->poc.nb_poc; i++) {
+ Jpeg2000POCEntry *e = &tile->poc.poc[i];
+ ret = jpeg2000_decode_packets_po_iteration(s, tile,
+ e->RSpoc, e->CSpoc,
+ FFMIN(e->LYEpoc, tile->codsty[0].nlayers),
+ e->REpoc,
+ FFMIN(e->CEpoc, s->ncomponents),
+ e->Ppoc, &tp_index
+ );
+ if (ret < 0)
+ return ret;
+ }
+ } else {
+ ret = jpeg2000_decode_packets_po_iteration(s, tile,
+ 0, 0,
+ tile->codsty[0].nlayers,
+ 33,
+ s->ncomponents,
+ tile->codsty[0].prog_order,
+ &tp_index
+ );
+ }
/* EOC marker reached */
bytestream2_skip(&s->g, 2);
@@ -1230,20 +1350,20 @@ static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,
int flags_mask = -1;
if (vert_causal_ctx_csty_symbol && y == y0 + 3)
flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);
- if ((t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB & flags_mask)
- && !(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
- if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {
- int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1] & flags_mask, &xorbit);
+ if ((t1->flags[(y+1) * t1->stride + x+1] & JPEG2000_T1_SIG_NB & flags_mask)
+ && !(t1->flags[(y+1) * t1->stride + x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
+ if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[(y+1) * t1->stride + x+1] & flags_mask, bandno))) {
+ int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[(y+1) * t1->stride + x+1] & flags_mask, &xorbit);
if (t1->mqc.raw)
- t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;
+ t1->data[(y) * t1->stride + x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;
else
- t1->data[y][x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?
+ t1->data[(y) * t1->stride + x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?
-mask : mask;
ff_jpeg2000_set_significance(t1, x, y,
- t1->data[y][x] < 0);
+ t1->data[(y) * t1->stride + x] < 0);
}
- t1->flags[y + 1][x + 1] |= JPEG2000_T1_VIS;
+ t1->flags[(y + 1) * t1->stride + x + 1] |= JPEG2000_T1_VIS;
}
}
}
@@ -1260,15 +1380,15 @@ static void decode_refpass(Jpeg2000T1Context *t1, int width, int height,
for (y0 = 0; y0 < height; y0 += 4)
for (x = 0; x < width; x++)
for (y = y0; y < height && y < y0 + 4; y++)
- if ((t1->flags[y + 1][x + 1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS)) == JPEG2000_T1_SIG) {
+ if ((t1->flags[(y + 1) * t1->stride + x + 1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS)) == JPEG2000_T1_SIG) {
int flags_mask = (vert_causal_ctx_csty_symbol && y == y0 + 3) ?
~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S) : -1;
- int ctxno = ff_jpeg2000_getrefctxno(t1->flags[y + 1][x + 1] & flags_mask);
+ int ctxno = ff_jpeg2000_getrefctxno(t1->flags[(y + 1) * t1->stride + x + 1] & flags_mask);
int r = ff_mqc_decode(&t1->mqc,
t1->mqc.cx_states + ctxno)
? phalf : nhalf;
- t1->data[y][x] += t1->data[y][x] < 0 ? -r : r;
- t1->flags[y + 1][x + 1] |= JPEG2000_T1_REF;
+ t1->data[(y) * t1->stride + x] += t1->data[(y) * t1->stride + x] < 0 ? -r : r;
+ t1->flags[(y + 1) * t1->stride + x + 1] |= JPEG2000_T1_REF;
}
}
@@ -1284,10 +1404,10 @@ static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
if (vert_causal_ctx_csty_symbol)
flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);
if (y0 + 3 < height &&
- !((t1->flags[y0 + 1][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0 + 2][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0 + 3][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
- (t1->flags[y0 + 4][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG) & flags_mask))) {
+ !((t1->flags[(y0 + 1) * t1->stride + x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0 + 2) * t1->stride + x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0 + 3) * t1->stride + x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
+ (t1->flags[(y0 + 4) * t1->stride + x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG) & flags_mask))) {
if (!ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_RL))
continue;
runlen = ff_mqc_decode(&t1->mqc,
@@ -1306,23 +1426,23 @@ static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
if (vert_causal_ctx_csty_symbol && y == y0 + 3)
flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);
if (!dec) {
- if (!(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
- dec = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask,
+ if (!(t1->flags[(y+1) * t1->stride + x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
+ dec = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[(y+1) * t1->stride + x+1] & flags_mask,
bandno));
}
}
if (dec) {
int xorbit;
- int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y + 1][x + 1] & flags_mask,
+ int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[(y + 1) * t1->stride + x + 1] & flags_mask,
&xorbit);
- t1->data[y][x] = (ff_mqc_decode(&t1->mqc,
+ t1->data[(y) * t1->stride + x] = (ff_mqc_decode(&t1->mqc,
t1->mqc.cx_states + ctxno) ^
xorbit)
? -mask : mask;
- ff_jpeg2000_set_significance(t1, x, y, t1->data[y][x] < 0);
+ ff_jpeg2000_set_significance(t1, x, y, t1->data[(y) * t1->stride + x] < 0);
}
dec = 0;
- t1->flags[y + 1][x + 1] &= ~JPEG2000_T1_VIS;
+ t1->flags[(y + 1) * t1->stride + x + 1] &= ~JPEG2000_T1_VIS;
}
}
}
@@ -1342,24 +1462,22 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
int width, int height, int bandpos)
{
- int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y;
+ int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1;
int pass_cnt = 0;
int vert_causal_ctx_csty_symbol = codsty->cblk_style & JPEG2000_CBLK_VSC;
int term_cnt = 0;
int coder_type;
- av_assert0(width <= JPEG2000_MAX_CBLKW);
- av_assert0(height <= JPEG2000_MAX_CBLKH);
+ av_assert0(width <= 1024U && height <= 1024U);
+ av_assert0(width*height <= 4096);
- for (y = 0; y < height; y++)
- memset(t1->data[y], 0, width * sizeof(**t1->data));
+ memset(t1->data, 0, t1->stride * height * sizeof(*t1->data));
/* If code-block contains no compressed data: nothing to do. */
if (!cblk->length)
return 0;
- for (y = 0; y < height + 2; y++)
- memset(t1->flags[y], 0, (width + 2) * sizeof(**t1->flags));
+ memset(t1->flags, 0, t1->stride * (height + 2) * sizeof(*t1->flags));
cblk->data[cblk->length] = 0xff;
cblk->data[cblk->length+1] = 0xff;
@@ -1389,6 +1507,12 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n");
return AVERROR_INVALIDDATA;
}
+ if (FFABS(cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp) > 0) {
+ av_log(s->avctx, AV_LOG_WARNING, "Mid mismatch %"PTRDIFF_SPECIFIER" in pass %d of %d\n",
+ cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp,
+ pass_cnt, cblk->npasses);
+ }
+
ff_mqc_initdec(&t1->mqc, cblk->data + cblk->data_start[++term_cnt], coder_type == 2, 0);
}
@@ -1423,7 +1547,7 @@ static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
int w = cblk->coord[0][1] - cblk->coord[0][0];
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
float *datap = &comp->f_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
- int *src = t1->data[j];
+ int *src = t1->data + j*t1->stride;
for (i = 0; i < w; ++i)
datap[i] = src[i] * band->f_stepsize;
}
@@ -1438,9 +1562,15 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
int w = cblk->coord[0][1] - cblk->coord[0][0];
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
- int *src = t1->data[j];
- for (i = 0; i < w; ++i)
- datap[i] = (src[i] * band->i_stepsize) / 32768;
+ int *src = t1->data + j*t1->stride;
+ if (band->i_stepsize == 32768) {
+ for (i = 0; i < w; ++i)
+ datap[i] = src[i] / 2;
+ } else {
+ // This should be VERY uncommon
+ for (i = 0; i < w; ++i)
+ datap[i] = (src[i] * (int64_t)band->i_stepsize) / 65536;
+ }
}
}
@@ -1452,9 +1582,9 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
int w = cblk->coord[0][1] - cblk->coord[0][0];
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
- int *src = t1->data[j];
+ int *src = t1->data + j*t1->stride;
for (i = 0; i < w; ++i)
- datap[i] = (src[i] * band->i_stepsize + (1<<14)) >> 15;
+ datap[i] = (src[i] * (int64_t)band->i_stepsize + (1<<15)) >> 16;
}
}
@@ -1486,23 +1616,19 @@ static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
s->dsp.mct_decode[tile->codsty[0].transform](src[0], src[1], src[2], csize);
}
-static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
- AVFrame *picture)
+static void tile_codeblocks(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
- const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
- int compno, reslevelno, bandno;
- int x, y;
- int planar = !!(pixdesc->flags & AV_PIX_FMT_FLAG_PLANAR);
- int pixelsize = planar ? 1 : pixdesc->nb_components;
-
- uint8_t *line;
Jpeg2000T1Context t1;
+ int compno, reslevelno, bandno;
+
/* Loop on tile components */
for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000Component *comp = tile->comp + compno;
Jpeg2000CodingStyle *codsty = tile->codsty + compno;
+ t1.stride = (1<<codsty->log2_cblk_width) + 2;
+
/* Loop on resolution levels */
for (reslevelno = 0; reslevelno < codsty->nreslevels2decode; reslevelno++) {
Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
@@ -1549,6 +1675,21 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
/* inverse DWT */
ff_dwt_decode(&comp->dwt, codsty->transform == FF_DWT97 ? (void*)comp->f_data : (void*)comp->i_data);
} /*end comp */
+}
+
+static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
+ AVFrame *picture)
+{
+ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
+ int planar = !!(pixdesc->flags & AV_PIX_FMT_FLAG_PLANAR);
+ int pixelsize = planar ? 1 : pixdesc->nb_components;
+
+ int compno;
+ int x, y;
+
+ uint8_t *line;
+
+ tile_codeblocks(s, tile);
/* inverse MCT transformation */
if (tile->codsty[0].mct)
@@ -1575,13 +1716,13 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1);
- y = tile->comp[compno].coord[1][0] - s->image_offset_y;
- line = picture->data[plane] + y / s->cdy[compno] * picture->linesize[plane];
+ y = tile->comp[compno].coord[1][0] - s->image_offset_y / s->cdy[compno];
+ line = picture->data[plane] + y * picture->linesize[plane];
for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y ++) {
uint8_t *dst;
- x = tile->comp[compno].coord[0][0] - s->image_offset_x;
- dst = line + x / s->cdx[compno] * pixelsize + compno*!planar;
+ x = tile->comp[compno].coord[0][0] - s->image_offset_x / s->cdx[compno];
+ dst = line + x * pixelsize + compno*!planar;
if (codsty->transform == FF_DWT97) {
for (; x < w; x ++) {
@@ -1624,13 +1765,13 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
if (planar)
plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1);
- y = tile->comp[compno].coord[1][0] - s->image_offset_y;
- linel = (uint16_t *)picture->data[plane] + y / s->cdy[compno] * (picture->linesize[plane] >> 1);
+ y = tile->comp[compno].coord[1][0] - s->image_offset_y / s->cdy[compno];
+ linel = (uint16_t *)picture->data[plane] + y * (picture->linesize[plane] >> 1);
for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y ++) {
uint16_t *dst;
- x = tile->comp[compno].coord[0][0] - s->image_offset_x;
- dst = linel + (x / s->cdx[compno] * pixelsize + compno*!planar);
+ x = tile->comp[compno].coord[0][0] - s->image_offset_x / s->cdx[compno];
+ dst = linel + (x * pixelsize + compno*!planar);
if (codsty->transform == FF_DWT97) {
for (; x < w; x ++) {
int val = lrintf(*datap) + (1 << (cbps - 1));
@@ -1677,6 +1818,7 @@ static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
av_freep(&s->tile);
memset(s->codsty, 0, sizeof(s->codsty));
memset(s->qntsty, 0, sizeof(s->qntsty));
+ memset(&s->poc , 0, sizeof(s->poc));
s->numXtiles = s->numYtiles = 0;
}
@@ -1684,6 +1826,7 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
{
Jpeg2000CodingStyle *codsty = s->codsty;
Jpeg2000QuantStyle *qntsty = s->qntsty;
+ Jpeg2000POC *poc = &s->poc;
uint8_t *properties = s->properties;
for (;;) {
@@ -1750,14 +1893,20 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
case JPEG2000_QCD:
ret = get_qcd(s, len, qntsty, properties);
break;
+ case JPEG2000_POC:
+ ret = get_poc(s, len, poc);
+ break;
case JPEG2000_SOT:
if (!(ret = get_sot(s, len))) {
av_assert1(s->curtileno >= 0);
codsty = s->tile[s->curtileno].codsty;
qntsty = s->tile[s->curtileno].qntsty;
+ poc = &s->tile[s->curtileno].poc;
properties = s->tile[s->curtileno].properties;
}
break;
+ case JPEG2000_PLM:
+ // the PLM marker is ignored
case JPEG2000_COM:
// the comment is ignored
bytestream2_skip(&s->g, len - 2);
@@ -2023,7 +2172,7 @@ AVCodec ff_jpeg2000_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_JPEG2000,
- .capabilities = CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(Jpeg2000DecoderContext),
.init_static_data = jpeg2000_init_static_data,
.init = jpeg2000_decode_init,
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
index ae150fb4336..28ac6c429ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.c
@@ -37,20 +37,16 @@
#define F_LFTG_BETA 0.052980118572961f
#define F_LFTG_GAMMA 0.882911075530934f
#define F_LFTG_DELTA 0.443506852043971f
-#define F_LFTG_K 1.230174104914001f
-#define F_LFTG_X 1.625732422f
-/* FIXME: Why use 1.625732422 instead of 1/F_LFTG_K?
- * Incorrect value in JPEG2000 norm.
- * see (ISO/IEC 15444:1 (version 2002) F.3.8.2 */
/* Lifting parameters in integer format.
* Computed as param = (float param) * (1 << 16) */
-#define I_LFTG_ALPHA 103949
-#define I_LFTG_BETA 3472
-#define I_LFTG_GAMMA 57862
-#define I_LFTG_DELTA 29066
-#define I_LFTG_K 80621
-#define I_LFTG_X 106544
+#define I_LFTG_ALPHA 103949ll
+#define I_LFTG_BETA 3472ll
+#define I_LFTG_GAMMA 57862ll
+#define I_LFTG_DELTA 29066ll
+#define I_LFTG_K 80621ll
+#define I_LFTG_X 53274ll
+#define I_PRESHIFT 8
static inline void extend53(int *p, int i0, int i1)
{
@@ -84,14 +80,17 @@ static void sd_1d53(int *p, int i0, int i1)
{
int i;
- if (i1 == i0 + 1)
+ if (i1 <= i0 + 1) {
+ if (i0 == 1)
+ p[1] <<= 1;
return;
+ }
extend53(p, i0, i1);
- for (i = (i0+1)/2 - 1; i < (i1+1)/2; i++)
+ for (i = ((i0+1)>>1) - 1; i < (i1+1)>>1; i++)
p[2*i+1] -= (p[2*i] + p[2*i+2]) >> 1;
- for (i = (i0+1)/2; i < (i1+1)/2; i++)
+ for (i = ((i0+1)>>1); i < (i1+1)>>1; i++)
p[2*i] += (p[2*i-1] + p[2*i+1] + 2) >> 2;
}
@@ -110,24 +109,6 @@ static void dwt_encode53(DWTContext *s, int *t)
lp;
int *l;
- av_assert1(!mh && !mv);
- // HOR_SD
- l = line + mh;
- for (lp = 0; lp < lv; lp++){
- int i, j = 0;
-
- for (i = 0; i < lh; i++)
- l[i] = t[w*lp + i];
-
- sd_1d53(line, mh, mh + lh);
-
- // copy back and deinterleave
- for (i = mh; i < lh; i+=2, j++)
- t[w*lp + j] = l[i];
- for (i = 1-mh; i < lh; i+=2, j++)
- t[w*lp + j] = l[i];
- }
-
// VER_SD
l = line + mv;
for (lp = 0; lp < lh; lp++) {
@@ -144,6 +125,23 @@ static void dwt_encode53(DWTContext *s, int *t)
for (i = 1-mv; i < lv; i+=2, j++)
t[w*j + lp] = l[i];
}
+
+ // HOR_SD
+ l = line + mh;
+ for (lp = 0; lp < lv; lp++){
+ int i, j = 0;
+
+ for (i = 0; i < lh; i++)
+ l[i] = t[w*lp + i];
+
+ sd_1d53(line, mh, mh + lh);
+
+ // copy back and deinterleave
+ for (i = mh; i < lh; i+=2, j++)
+ t[w*lp + j] = l[i];
+ for (i = 1-mh; i < lh; i+=2, j++)
+ t[w*lp + j] = l[i];
+ }
}
}
static void sd_1d97_float(float *p, int i0, int i1)
@@ -152,7 +150,7 @@ static void sd_1d97_float(float *p, int i0, int i1)
if (i1 <= i0 + 1) {
if (i0 == 1)
- p[1] *= F_LFTG_X;
+ p[1] *= F_LFTG_X * 2;
else
p[0] *= F_LFTG_K;
return;
@@ -161,13 +159,13 @@ static void sd_1d97_float(float *p, int i0, int i1)
extend97_float(p, i0, i1);
i0++; i1++;
- for (i = i0/2 - 2; i < i1/2 + 1; i++)
+ for (i = (i0>>1) - 2; i < (i1>>1) + 1; i++)
p[2*i+1] -= 1.586134 * (p[2*i] + p[2*i+2]);
- for (i = i0/2 - 1; i < i1/2 + 1; i++)
+ for (i = (i0>>1) - 1; i < (i1>>1) + 1; i++)
p[2*i] -= 0.052980 * (p[2*i-1] + p[2*i+1]);
- for (i = i0/2 - 1; i < i1/2; i++)
+ for (i = (i0>>1) - 1; i < (i1>>1); i++)
p[2*i+1] += 0.882911 * (p[2*i] + p[2*i+2]);
- for (i = i0/2; i < i1/2; i++)
+ for (i = (i0>>1); i < (i1>>1); i++)
p[2*i] += 0.443506 * (p[2*i-1] + p[2*i+1]);
}
@@ -186,7 +184,6 @@ static void dwt_encode97_float(DWTContext *s, float *t)
lp;
float *l;
- av_assert1(!mh && !mv);
// HOR_SD
l = line + mh;
for (lp = 0; lp < lv; lp++){
@@ -199,9 +196,9 @@ static void dwt_encode97_float(DWTContext *s, float *t)
// copy back and deinterleave
for (i = mh; i < lh; i+=2, j++)
- t[w*lp + j] = F_LFTG_X * l[i] / 2;
+ t[w*lp + j] = l[i];
for (i = 1-mh; i < lh; i+=2, j++)
- t[w*lp + j] = F_LFTG_K * l[i] / 2;
+ t[w*lp + j] = l[i];
}
// VER_SD
@@ -216,9 +213,9 @@ static void dwt_encode97_float(DWTContext *s, float *t)
// copy back and deinterleave
for (i = mv; i < lv; i+=2, j++)
- t[w*j + lp] = F_LFTG_X * l[i] / 2;
+ t[w*j + lp] = l[i];
for (i = 1-mv; i < lv; i+=2, j++)
- t[w*j + lp] = F_LFTG_K * l[i] / 2;
+ t[w*j + lp] = l[i];
}
}
}
@@ -229,7 +226,7 @@ static void sd_1d97_int(int *p, int i0, int i1)
if (i1 <= i0 + 1) {
if (i0 == 1)
- p[1] = (p[1] * I_LFTG_X + (1<<15)) >> 16;
+ p[1] = (p[1] * I_LFTG_X + (1<<14)) >> 15;
else
p[0] = (p[0] * I_LFTG_K + (1<<15)) >> 16;
return;
@@ -238,23 +235,28 @@ static void sd_1d97_int(int *p, int i0, int i1)
extend97_int(p, i0, i1);
i0++; i1++;
- for (i = i0/2 - 2; i < i1/2 + 1; i++)
+ for (i = (i0>>1) - 2; i < (i1>>1) + 1; i++)
p[2 * i + 1] -= (I_LFTG_ALPHA * (p[2 * i] + p[2 * i + 2]) + (1 << 15)) >> 16;
- for (i = i0/2 - 1; i < i1/2 + 1; i++)
+ for (i = (i0>>1) - 1; i < (i1>>1) + 1; i++)
p[2 * i] -= (I_LFTG_BETA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
- for (i = i0/2 - 1; i < i1/2; i++)
+ for (i = (i0>>1) - 1; i < (i1>>1); i++)
p[2 * i + 1] += (I_LFTG_GAMMA * (p[2 * i] + p[2 * i + 2]) + (1 << 15)) >> 16;
- for (i = i0/2; i < i1/2; i++)
+ for (i = (i0>>1); i < (i1>>1); i++)
p[2 * i] += (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
}
static void dwt_encode97_int(DWTContext *s, int *t)
{
- int lev,
- w = s->linelen[s->ndeclevels-1][0];
+ int lev;
+ int w = s->linelen[s->ndeclevels-1][0];
+ int h = s->linelen[s->ndeclevels-1][1];
+ int i;
int *line = s->i_linebuf;
line += 5;
+ for (i = 0; i < w * h; i++)
+ t[i] <<= I_PRESHIFT;
+
for (lev = s->ndeclevels-1; lev >= 0; lev--){
int lh = s->linelen[lev][0],
lv = s->linelen[lev][1],
@@ -263,7 +265,22 @@ static void dwt_encode97_int(DWTContext *s, int *t)
lp;
int *l;
- av_assert1(!mh && !mv);
+ // VER_SD
+ l = line + mv;
+ for (lp = 0; lp < lh; lp++) {
+ int i, j = 0;
+
+ for (i = 0; i < lv; i++)
+ l[i] = t[w*i + lp];
+
+ sd_1d97_int(line, mv, mv + lv);
+
+ // copy back and deinterleave
+ for (i = mv; i < lv; i+=2, j++)
+ t[w*j + lp] = ((l[i] * I_LFTG_X) + (1 << 15)) >> 16;
+ for (i = 1-mv; i < lv; i+=2, j++)
+ t[w*j + lp] = l[i];
+ }
// HOR_SD
l = line + mh;
@@ -277,28 +294,15 @@ static void dwt_encode97_int(DWTContext *s, int *t)
// copy back and deinterleave
for (i = mh; i < lh; i+=2, j++)
- t[w*lp + j] = ((l[i] * I_LFTG_X) + (1 << 16)) >> 17;
+ t[w*lp + j] = ((l[i] * I_LFTG_X) + (1 << 15)) >> 16;
for (i = 1-mh; i < lh; i+=2, j++)
- t[w*lp + j] = ((l[i] * I_LFTG_K) + (1 << 16)) >> 17;
+ t[w*lp + j] = l[i];
}
- // VER_SD
- l = line + mv;
- for (lp = 0; lp < lh; lp++) {
- int i, j = 0;
-
- for (i = 0; i < lv; i++)
- l[i] = t[w*i + lp];
-
- sd_1d97_int(line, mv, mv + lv);
-
- // copy back and deinterleave
- for (i = mv; i < lv; i+=2, j++)
- t[w*j + lp] = ((l[i] * I_LFTG_X) + (1 << 16)) >> 17;
- for (i = 1-mv; i < lv; i+=2, j++)
- t[w*j + lp] = ((l[i] * I_LFTG_K) + (1 << 16)) >> 17;
- }
}
+
+ for (i = 0; i < w * h; i++)
+ t[i] = (t[i] + ((1<<I_PRESHIFT)>>1)) >> I_PRESHIFT;
}
static void sr_1d53(int *p, int i0, int i1)
@@ -313,9 +317,9 @@ static void sr_1d53(int *p, int i0, int i1)
extend53(p, i0, i1);
- for (i = i0 / 2; i < i1 / 2 + 1; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1) + 1; i++)
p[2 * i] -= (p[2 * i - 1] + p[2 * i + 1] + 2) >> 2;
- for (i = i0 / 2; i < i1 / 2; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1); i++)
p[2 * i + 1] += (p[2 * i] + p[2 * i + 2]) >> 1;
}
@@ -376,22 +380,22 @@ static void sr_1d97_float(float *p, int i0, int i1)
if (i0 == 1)
p[1] *= F_LFTG_K/2;
else
- p[0] *= F_LFTG_X/2;
+ p[0] *= F_LFTG_X;
return;
}
extend97_float(p, i0, i1);
- for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
+ for (i = (i0 >> 1) - 1; i < (i1 >> 1) + 2; i++)
p[2 * i] -= F_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]);
/* step 4 */
- for (i = i0 / 2 - 1; i < i1 / 2 + 1; i++)
+ for (i = (i0 >> 1) - 1; i < (i1 >> 1) + 1; i++)
p[2 * i + 1] -= F_LFTG_GAMMA * (p[2 * i] + p[2 * i + 2]);
/*step 5*/
- for (i = i0 / 2; i < i1 / 2 + 1; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1) + 1; i++)
p[2 * i] += F_LFTG_BETA * (p[2 * i - 1] + p[2 * i + 1]);
/* step 6 */
- for (i = i0 / 2; i < i1 / 2; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1); i++)
p[2 * i + 1] += F_LFTG_ALPHA * (p[2 * i] + p[2 * i + 2]);
}
@@ -417,9 +421,9 @@ static void dwt_decode97_float(DWTContext *s, float *t)
int i, j = 0;
// copy with interleaving
for (i = mh; i < lh; i += 2, j++)
- l[i] = data[w * lp + j] * F_LFTG_K;
+ l[i] = data[w * lp + j];
for (i = 1 - mh; i < lh; i += 2, j++)
- l[i] = data[w * lp + j] * F_LFTG_X;
+ l[i] = data[w * lp + j];
sr_1d97_float(line, mh, mh + lh);
@@ -433,9 +437,9 @@ static void dwt_decode97_float(DWTContext *s, float *t)
int i, j = 0;
// copy with interleaving
for (i = mv; i < lv; i += 2, j++)
- l[i] = data[w * j + lp] * F_LFTG_K;
+ l[i] = data[w * j + lp];
for (i = 1 - mv; i < lv; i += 2, j++)
- l[i] = data[w * j + lp] * F_LFTG_X;
+ l[i] = data[w * j + lp];
sr_1d97_float(line, mv, mv + lv);
@@ -453,22 +457,22 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
if (i0 == 1)
p[1] = (p[1] * I_LFTG_K + (1<<16)) >> 17;
else
- p[0] = (p[0] * I_LFTG_X + (1<<16)) >> 17;
+ p[0] = (p[0] * I_LFTG_X + (1<<15)) >> 16;
return;
}
extend97_int(p, i0, i1);
- for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
+ for (i = (i0 >> 1) - 1; i < (i1 >> 1) + 2; i++)
p[2 * i] -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
/* step 4 */
- for (i = i0 / 2 - 1; i < i1 / 2 + 1; i++)
+ for (i = (i0 >> 1) - 1; i < (i1 >> 1) + 1; i++)
p[2 * i + 1] -= (I_LFTG_GAMMA * (p[2 * i] + p[2 * i + 2]) + (1 << 15)) >> 16;
/*step 5*/
- for (i = i0 / 2; i < i1 / 2 + 1; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1) + 1; i++)
p[2 * i] += (I_LFTG_BETA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
/* step 6 */
- for (i = i0 / 2; i < i1 / 2; i++)
+ for (i = (i0 >> 1); i < (i1 >> 1); i++)
p[2 * i + 1] += (I_LFTG_ALPHA * (p[2 * i] + p[2 * i + 2]) + (1 << 15)) >> 16;
}
@@ -476,11 +480,16 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
{
int lev;
int w = s->linelen[s->ndeclevels - 1][0];
+ int h = s->linelen[s->ndeclevels - 1][1];
+ int i;
int32_t *line = s->i_linebuf;
int32_t *data = t;
/* position at index O of line range [0-5,w+5] cf. extend function */
line += 5;
+ for (i = 0; i < w * h; i++)
+ data[i] <<= I_PRESHIFT;
+
for (lev = 0; lev < s->ndeclevels; lev++) {
int lh = s->linelen[lev][0],
lv = s->linelen[lev][1],
@@ -496,7 +505,7 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
for (i = mh; i < lh; i += 2, j++)
l[i] = ((data[w * lp + j] * I_LFTG_K) + (1 << 15)) >> 16;
for (i = 1 - mh; i < lh; i += 2, j++)
- l[i] = ((data[w * lp + j] * I_LFTG_X) + (1 << 15)) >> 16;
+ l[i] = data[w * lp + j];
sr_1d97_int(line, mh, mh + lh);
@@ -512,7 +521,7 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
for (i = mv; i < lv; i += 2, j++)
l[i] = ((data[w * j + lp] * I_LFTG_K) + (1 << 15)) >> 16;
for (i = 1 - mv; i < lv; i += 2, j++)
- l[i] = ((data[w * j + lp] * I_LFTG_X) + (1 << 15)) >> 16;
+ l[i] = data[w * j + lp];
sr_1d97_int(line, mv, mv + lv);
@@ -520,6 +529,9 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
data[w * i + lp] = l[i];
}
}
+
+ for (i = 0; i < w * h; i++)
+ data[i] = (data[i] + ((1<<I_PRESHIFT)>>1)) >> I_PRESHIFT;
}
int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
@@ -604,3 +616,125 @@ void ff_dwt_destroy(DWTContext *s)
av_freep(&s->f_linebuf);
av_freep(&s->i_linebuf);
}
+
+#ifdef TEST
+
+#include "libavutil/lfg.h"
+
+#define MAX_W 256
+
+static int test_dwt(int *array, int *ref, uint16_t border[2][2], int decomp_levels, int type, int max_diff) {
+ int ret, j;
+ DWTContext s1={{{0}}}, *s= &s1;
+ int64_t err2 = 0;
+
+ ret = ff_jpeg2000_dwt_init(s, border, decomp_levels, type);
+ if (ret < 0) {
+ fprintf(stderr, "ff_jpeg2000_dwt_init failed\n");
+ return 1;
+ }
+ ret = ff_dwt_encode(s, array);
+ if (ret < 0) {
+ fprintf(stderr, "ff_dwt_encode failed\n");
+ return 1;
+ }
+ ret = ff_dwt_decode(s, array);
+ if (ret < 0) {
+ fprintf(stderr, "ff_dwt_encode failed\n");
+ return 1;
+ }
+ for (j = 0; j<MAX_W * MAX_W; j++) {
+ if (FFABS(array[j] - ref[j]) > max_diff) {
+ fprintf(stderr, "missmatch at %d (%d != %d) decomp:%d border %d %d %d %d\n",
+ j, array[j], ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]);
+ return 2;
+ }
+ err2 += (array[j] - ref[j]) * (array[j] - ref[j]);
+ array[j] = ref[j];
+ }
+ ff_dwt_destroy(s);
+
+ printf("%s, decomp:%2d border %3d %3d %3d %3d milli-err2:%9"PRId64"\n",
+ type == FF_DWT53 ? "5/3i" : "9/7i",
+ decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1],
+ 1000*err2 / ((border[0][1] - border[0][0])*(border[1][1] - border[1][0])));
+
+ return 0;
+}
+
+static int test_dwtf(float *array, float *ref, uint16_t border[2][2], int decomp_levels, float max_diff) {
+ int ret, j;
+ DWTContext s1={{{0}}}, *s= &s1;
+ double err2 = 0;
+
+ ret = ff_jpeg2000_dwt_init(s, border, decomp_levels, FF_DWT97);
+ if (ret < 0) {
+ fprintf(stderr, "ff_jpeg2000_dwt_init failed\n");
+ return 1;
+ }
+ ret = ff_dwt_encode(s, array);
+ if (ret < 0) {
+ fprintf(stderr, "ff_dwt_encode failed\n");
+ return 1;
+ }
+ ret = ff_dwt_decode(s, array);
+ if (ret < 0) {
+ fprintf(stderr, "ff_dwt_encode failed\n");
+ return 1;
+ }
+ for (j = 0; j<MAX_W * MAX_W; j++) {
+ if (FFABS(array[j] - ref[j]) > max_diff) {
+ fprintf(stderr, "missmatch at %d (%f != %f) decomp:%d border %d %d %d %d\n",
+ j, array[j], ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]);
+ return 2;
+ }
+ err2 += (array[j] - ref[j]) * (array[j] - ref[j]);
+ array[j] = ref[j];
+ }
+ ff_dwt_destroy(s);
+
+ printf("9/7f, decomp:%2d border %3d %3d %3d %3d err2:%20.3f\n",
+ decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1],
+ err2 / ((border[0][1] - border[0][0])*(border[1][1] - border[1][0])));
+
+ return 0;
+}
+
+static int array[MAX_W * MAX_W];
+static int ref [MAX_W * MAX_W];
+static float arrayf[MAX_W * MAX_W];
+static float reff [MAX_W * MAX_W];
+
+int main(void) {
+ AVLFG prng;
+ int i,j;
+ uint16_t border[2][2];
+ int ret, decomp_levels;
+
+ av_lfg_init(&prng, 1);
+
+ for (i = 0; i<MAX_W * MAX_W; i++)
+ arrayf[i] = reff[i] = array[i] = ref[i] = av_lfg_get(&prng) % 2048;
+
+ for (i = 0; i < 100; i++) {
+ for (j=0; j<4; j++)
+ border[j>>1][j&1] = av_lfg_get(&prng) % MAX_W;
+ if (border[0][0] >= border[0][1] || border[1][0] >= border[1][1])
+ continue;
+ decomp_levels = av_lfg_get(&prng) % FF_DWT_MAX_DECLVLS;
+
+ ret = test_dwt(array, ref, border, decomp_levels, FF_DWT53, 0);
+ if (ret)
+ return ret;
+ ret = test_dwt(array, ref, border, decomp_levels, FF_DWT97_INT, FFMIN(7+5*decomp_levels, 15+3*decomp_levels));
+ if (ret)
+ return ret;
+ ret = test_dwtf(arrayf, reff, border, decomp_levels, 0.05);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.h b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.h
index b6d296d8a89..57297d41279 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.h
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dwt.h
@@ -30,6 +30,8 @@
#include <stdint.h>
#define FF_DWT_MAX_DECLVLS 32 ///< max number of decomposition levels
+#define F_LFTG_K 1.230174104914001f
+#define F_LFTG_X 0.812893066115961f
enum DWTType {
FF_DWT97,
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c b/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
index 2ea75f7543e..68151cbbd8e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeglsdec.c
@@ -523,6 +523,6 @@ AVCodec ff_jpegls_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
.decode = ff_mjpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeglsenc.c b/chromium/third_party/ffmpeg/libavcodec/jpeglsenc.c
index d2749101edc..1e1a22bed28 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeglsenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeglsenc.c
@@ -269,7 +269,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
comps = 3;
if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width *avctx->height * comps * 4 +
- FF_MIN_BUFFER_SIZE)) < 0)
+ AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
buf2 = av_malloc(pkt->size);
@@ -412,20 +412,14 @@ memfail:
return AVERROR(ENOMEM);
}
-static av_cold int encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
static av_cold int encode_init_ls(AVCodecContext *ctx)
{
- ctx->coded_frame = av_frame_alloc();
- if (!ctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
ctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (ctx->pix_fmt != AV_PIX_FMT_GRAY8 &&
ctx->pix_fmt != AV_PIX_FMT_GRAY16 &&
@@ -444,8 +438,7 @@ AVCodec ff_jpegls_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_JPEGLS,
.init = encode_init_ls,
- .close = encode_close,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.encode2 = encode_picture_ls,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24,
diff --git a/chromium/third_party/ffmpeg/libavcodec/jvdec.c b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
index 9c4a8d4ca3c..cbe83d3c108 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
@@ -231,5 +231,5 @@ AVCodec ff_jv_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c b/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
index 4f9329f9b78..5359411c761 100644
--- a/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/kgv1dec.c
@@ -183,5 +183,5 @@ AVCodec ff_kgv1_decoder = {
.close = decode_end,
.decode = decode_frame,
.flush = decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/kmvc.c b/chromium/third_party/ffmpeg/libavcodec/kmvc.c
index f879c353e77..7acaba7d21c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/kmvc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/kmvc.c
@@ -421,5 +421,5 @@ AVCodec ff_kmvc_decoder = {
.priv_data_size = sizeof(KmvcContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/lagarith.c b/chromium/third_party/ffmpeg/libavcodec/lagarith.c
index 2c6d70c0650..94d723d3190 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lagarith.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lagarith.c
@@ -748,5 +748,5 @@ AVCodec ff_lagarith_decoder = {
.init = lag_decode_init,
.close = lag_decode_end,
.decode = lag_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/lcldec.c b/chromium/third_party/ffmpeg/libavcodec/lcldec.c
index 1d94041fa55..c04ed5e6ca8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lcldec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lcldec.c
@@ -512,7 +512,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
if (avctx->width % 4) {
- avpriv_request_sample(avctx, "Unsupported dimensions\n");
+ avpriv_request_sample(avctx, "Unsupported dimensions");
return AVERROR_INVALIDDATA;
}
break;
@@ -547,7 +547,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &subsample_h, &subsample_v);
if (avctx->width % (1<<subsample_h) || avctx->height % (1<<subsample_v)) {
- avpriv_request_sample(avctx, "Unsupported dimensions\n");
+ avpriv_request_sample(avctx, "Unsupported dimensions");
return AVERROR_INVALIDDATA;
}
@@ -660,7 +660,7 @@ AVCodec ff_mszh_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -674,6 +674,6 @@ AVCodec ff_zlib_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/lclenc.c b/chromium/third_party/ffmpeg/libavcodec/lclenc.c
index bce1d537a28..1b1e08bd994 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lclenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lclenc.c
@@ -79,7 +79,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int zret; // Zlib return code
int max_size = deflateBound(&c->zstream, avctx->width * avctx->height * 3);
- if ((ret = ff_alloc_packet2(avctx, pkt, max_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, max_size, 0)) < 0)
return ret;
if(avctx->pix_fmt != AV_PIX_FMT_BGR24){
@@ -131,16 +131,16 @@ static av_cold int encode_init(AVCodecContext *avctx)
av_assert0(avctx->width && avctx->height);
- avctx->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(8 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
COMP_ZLIB_NORMAL :
@@ -183,8 +183,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
av_freep(&avctx->extradata);
deflateEnd(&c->zstream);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -197,7 +195,7 @@ AVCodec ff_zlib_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libaacplus.c b/chromium/third_party/ffmpeg/libavcodec/libaacplus.c
index 9087d006358..fe380871b16 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libaacplus.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libaacplus.c
@@ -63,7 +63,7 @@ static av_cold int aacPlus_encode_init(AVCodecContext *avctx)
aacplus_cfg->bitRate = avctx->bit_rate;
aacplus_cfg->bandWidth = avctx->cutoff;
- aacplus_cfg->outputFormat = !(avctx->flags & CODEC_FLAG_GLOBAL_HEADER);
+ aacplus_cfg->outputFormat = !(avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER);
aacplus_cfg->inputFormat = avctx->sample_fmt == AV_SAMPLE_FMT_FLT ? AACPLUS_INPUT_FLOAT : AACPLUS_INPUT_16BIT;
if (!aacplusEncSetConfiguration(s->aacplus_handle, aacplus_cfg)) {
av_log(avctx, AV_LOG_ERROR, "libaacplus doesn't support this output format!\n");
@@ -74,14 +74,14 @@ static av_cold int aacPlus_encode_init(AVCodecContext *avctx)
/* Set decoder specific info */
avctx->extradata_size = 0;
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
unsigned char *buffer = NULL;
unsigned long decoder_specific_info_size;
if (aacplusEncGetDecoderSpecificInfo(s->aacplus_handle, &buffer,
&decoder_specific_info_size) == 1) {
- avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(decoder_specific_info_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
free(buffer);
return AVERROR(ENOMEM);
@@ -101,7 +101,7 @@ static int aacPlus_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int32_t *input_buffer = (int32_t *)frame->data[0];
int ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes, 0)) < 0)
return ret;
pkt->size = aacplusEncEncode(s->aacplus_handle, input_buffer,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libcelt_dec.c b/chromium/third_party/ffmpeg/libavcodec/libcelt_dec.c
index 4e62fe53a6b..878e4cc673c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libcelt_dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libcelt_dec.c
@@ -136,5 +136,5 @@ AVCodec ff_libcelt_decoder = {
.init = libcelt_dec_init,
.close = libcelt_dec_close,
.decode = libcelt_dec_decode,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libdcadec.c b/chromium/third_party/ffmpeg/libavcodec/libdcadec.c
index 890d27091d5..a0e34f95281 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libdcadec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libdcadec.c
@@ -34,6 +34,7 @@ typedef struct DCADecContext {
struct dcadec_context *ctx;
uint8_t *buffer;
int buffer_size;
+ int downmix_warned;
} DCADecContext;
static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
@@ -41,6 +42,7 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
{
DCADecContext *s = avctx->priv_data;
AVFrame *frame = data;
+ av_unused struct dcadec_exss_info *exss;
int ret, i, k;
int **samples, nsamples, channel_mask, sample_rate, bits_per_sample, profile;
uint32_t mrk;
@@ -54,7 +56,7 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
}
mrk = AV_RB32(input);
if (mrk != DCA_SYNCWORD_CORE_BE && mrk != DCA_SYNCWORD_SUBSTREAM) {
- s->buffer = av_fast_realloc(s->buffer, &s->buffer_size, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->buffer = av_fast_realloc(s->buffer, &s->buffer_size, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->buffer)
return AVERROR(ENOMEM);
@@ -127,6 +129,37 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
} else
avctx->bit_rate = 0;
+#if HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING
+ if (exss = dcadec_context_get_exss_info(s->ctx)) {
+ enum AVMatrixEncoding matrix_encoding = AV_MATRIX_ENCODING_NONE;
+
+ if (!s->downmix_warned) {
+ uint64_t layout = avctx->request_channel_layout;
+
+ if (((layout == AV_CH_LAYOUT_STEREO_DOWNMIX || layout == AV_CH_LAYOUT_STEREO) && !exss->embedded_stereo) ||
+ ( layout == AV_CH_LAYOUT_5POINT1 && !exss->embedded_6ch))
+ av_log(avctx, AV_LOG_WARNING, "%s downmix was requested but no custom coefficients are available, "
+ "this may result in clipping\n",
+ layout == AV_CH_LAYOUT_5POINT1 ? "5.1" : "Stereo");
+ s->downmix_warned = 1;
+ }
+
+ switch(exss->matrix_encoding) {
+ case DCADEC_MATRIX_ENCODING_SURROUND:
+ matrix_encoding = AV_MATRIX_ENCODING_DOLBY;
+ break;
+ case DCADEC_MATRIX_ENCODING_HEADPHONE:
+ matrix_encoding = AV_MATRIX_ENCODING_DOLBYHEADPHONE;
+ break;
+ }
+ dcadec_context_free_exss_info(exss);
+
+ if (matrix_encoding != AV_MATRIX_ENCODING_NONE &&
+ (ret = ff_side_data_update_matrix_encoding(frame, matrix_encoding)) < 0)
+ return ret;
+ }
+#endif
+
frame->nb_samples = nsamples;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
@@ -173,9 +206,30 @@ static av_cold int dcadec_init(AVCodecContext *avctx)
int flags = 0;
/* Affects only lossy DTS profiles. DTS-HD MA is always bitexact */
- if (avctx->flags & CODEC_FLAG_BITEXACT)
+ if (avctx->flags & AV_CODEC_FLAG_BITEXACT)
flags |= DCADEC_FLAG_CORE_BIT_EXACT;
+ if (avctx->request_channel_layout > 0 && avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE) {
+ switch (avctx->request_channel_layout) {
+ case AV_CH_LAYOUT_STEREO:
+ case AV_CH_LAYOUT_STEREO_DOWNMIX:
+ /* libdcadec ignores the 2ch flag if used alone when no custom downmix coefficients
+ are available, silently outputting a 5.1 downmix if possible instead.
+ Using both the 2ch and 6ch flags together forces a 2ch downmix using default
+ coefficients in such cases. This matches the behavior of the 6ch flag when used
+ alone, where a 5.1 downmix is generated if possible, regardless of custom
+ coefficients being available or not. */
+ flags |= DCADEC_FLAG_KEEP_DMIX_2CH | DCADEC_FLAG_KEEP_DMIX_6CH;
+ break;
+ case AV_CH_LAYOUT_5POINT1:
+ flags |= DCADEC_FLAG_KEEP_DMIX_6CH;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING, "Invalid request_channel_layout\n");
+ break;
+ }
+ }
+
s->ctx = dcadec_context_create(flags);
if (!s->ctx)
return AVERROR(ENOMEM);
@@ -206,7 +260,7 @@ AVCodec ff_libdcadec_decoder = {
.decode = dcadec_decode_frame,
.close = dcadec_close,
.flush = dcadec_flush,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_CHANNEL_CONF,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfaac.c b/chromium/third_party/ffmpeg/libavcodec/libfaac.c
index 69c186b11a7..98b3ba81830 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libfaac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libfaac.c
@@ -117,7 +117,7 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx)
faac_cfg->allowMidside = 1;
faac_cfg->bitRate = avctx->bit_rate / avctx->channels;
faac_cfg->bandWidth = avctx->cutoff;
- if(avctx->flags & CODEC_FLAG_QSCALE) {
+ if(avctx->flags & AV_CODEC_FLAG_QSCALE) {
faac_cfg->bitRate = 0;
faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA;
}
@@ -131,14 +131,14 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx)
/* Set decoder specific info */
avctx->extradata_size = 0;
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
unsigned char *buffer = NULL;
unsigned long decoder_specific_info_size;
if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
&decoder_specific_info_size)) {
- avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(decoder_specific_info_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
ret = AVERROR(ENOMEM);
goto error;
@@ -184,7 +184,7 @@ static int Faac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int num_samples = frame ? frame->nb_samples : 0;
void *samples = frame ? frame->data[0] : NULL;
- if ((ret = ff_alloc_packet2(avctx, avpkt, (7 + 768) * avctx->channels)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, (7 + 768) * avctx->channels, 0)) < 0)
return ret;
bytes_written = faacEncEncode(s->faac_handle, samples,
@@ -240,7 +240,7 @@ AVCodec ff_libfaac_encoder = {
.init = Faac_encode_init,
.encode2 = Faac_encode_frame,
.close = Faac_encode_close,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
index f7fc8119c25..e5f7c4ebdc9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacdec.c
@@ -41,8 +41,8 @@ enum ConcealMethod {
typedef struct FDKAACDecContext {
const AVClass *class;
HANDLE_AACDECODER handle;
- int initialized;
uint8_t *decoder_buffer;
+ int decoder_buffer_size;
uint8_t *anc_buffer;
int conceal_method;
int drc_level;
@@ -54,7 +54,7 @@ typedef struct FDKAACDecContext {
#define DMX_ANC_BUFFSIZE 128
-#define DECODER_MAX_CHANNELS 6
+#define DECODER_MAX_CHANNELS 8
#define DECODER_BUFFSIZE 2048 * sizeof(INT_PCM)
#define OFFSET(x) offsetof(FDKAACDecContext, x)
@@ -209,7 +209,6 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
{
FDKAACDecContext *s = avctx->priv_data;
AAC_DECODER_ERROR err;
- int ret;
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
if (!s->handle) {
@@ -256,13 +255,11 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
s->anc_buffer = av_malloc(DMX_ANC_BUFFSIZE);
if (!s->anc_buffer) {
av_log(avctx, AV_LOG_ERROR, "Unable to allocate ancillary buffer for the decoder\n");
- ret = AVERROR(ENOMEM);
- goto fail;
+ return AVERROR(ENOMEM);
}
if (aacDecoder_AncDataInit(s->handle, s->anc_buffer, DMX_ANC_BUFFSIZE)) {
av_log(avctx, AV_LOG_ERROR, "Unable to register downmix ancillary buffer in the decoder\n");
- ret = AVERROR_UNKNOWN;
- goto fail;
+ return AVERROR_UNKNOWN;
}
}
}
@@ -305,10 +302,12 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
+ s->decoder_buffer = av_malloc(s->decoder_buffer_size);
+ if (!s->decoder_buffer)
+ return AVERROR(ENOMEM);
+
return 0;
-fail:
- fdk_aac_decode_close(avctx);
- return ret;
}
static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
@@ -319,8 +318,6 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
int ret;
AAC_DECODER_ERROR err;
UINT valid = avpkt->size;
- uint8_t *buf, *tmpptr = NULL;
- int buf_size;
err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);
if (err != AAC_DEC_OK) {
@@ -328,31 +325,7 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
- if (s->initialized) {
- frame->nb_samples = avctx->frame_size;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- return ret;
-
- if (s->anc_buffer) {
- buf_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
- buf = s->decoder_buffer;
- } else {
- buf = frame->extended_data[0];
- buf_size = avctx->channels * frame->nb_samples *
- av_get_bytes_per_sample(avctx->sample_fmt);
- }
- } else {
- buf_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
-
- if (!s->decoder_buffer)
- s->decoder_buffer = av_malloc(buf_size);
- if (!s->decoder_buffer)
- return AVERROR(ENOMEM);
-
- buf = tmpptr = s->decoder_buffer;
- }
-
- err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) buf, buf_size, 0);
+ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0);
if (err == AAC_DEC_NOT_ENOUGH_BITS) {
ret = avpkt->size - valid;
goto end;
@@ -364,26 +337,16 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
goto end;
}
- if (!s->initialized) {
- if ((ret = get_stream_info(avctx)) < 0)
- goto end;
- s->initialized = 1;
- frame->nb_samples = avctx->frame_size;
- }
+ if ((ret = get_stream_info(avctx)) < 0)
+ goto end;
+ frame->nb_samples = avctx->frame_size;
- if (tmpptr) {
- frame->nb_samples = avctx->frame_size;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
- goto end;
- }
- if (s->decoder_buffer) {
- memcpy(frame->extended_data[0], buf,
- avctx->channels * avctx->frame_size *
- av_get_bytes_per_sample(avctx->sample_fmt));
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ goto end;
- if (!s->anc_buffer)
- av_freep(&s->decoder_buffer);
- }
+ memcpy(frame->extended_data[0], s->decoder_buffer,
+ avctx->channels * avctx->frame_size *
+ av_get_bytes_per_sample(avctx->sample_fmt));
*got_frame_ptr = 1;
ret = avpkt->size - valid;
@@ -415,6 +378,8 @@ AVCodec ff_libfdk_aac_decoder = {
.decode = fdk_aac_decode_frame,
.close = fdk_aac_decode_close,
.flush = fdk_aac_decode_flush,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_CHANNEL_CONF,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.priv_class = &fdk_aac_dec_class,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
index 3eadb36b837..5df0c909474 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c
@@ -184,7 +184,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto error;
}
- if (avctx->flags & CODEC_FLAG_QSCALE || s->vbr) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE || s->vbr) {
int mode = s->vbr ? s->vbr : avctx->global_quality;
if (mode < 1 || mode > 5) {
av_log(avctx, AV_LOG_WARNING,
@@ -224,7 +224,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
/* Choose bitstream format - if global header is requested, use
* raw access units, otherwise use ADTS. */
if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX,
- avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
+ avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n",
aac_get_error(err));
goto error;
@@ -243,7 +243,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
* if using mp4 mode (raw access units, with global header) and
* implicit signaling if using ADTS. */
if (s->signaling < 0)
- s->signaling = avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 2 : 0;
+ s->signaling = avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER ? 2 : 0;
if ((err = aacEncoder_SetParam(s->handle, AACENC_SIGNALING_MODE,
s->signaling)) != AACENC_OK) {
@@ -289,10 +289,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
avctx->initial_padding = info.encoderDelay;
ff_af_queue_init(avctx, &s->afq);
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
avctx->extradata_size = info.confSize;
avctx->extradata = av_mallocz(avctx->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
ret = AVERROR(ENOMEM);
goto error;
@@ -342,7 +342,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
/* The maximum packet size is 6144 bits aka 768 bytes per channel. */
- if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels), 0)) < 0)
return ret;
out_ptr = avpkt->data;
@@ -417,7 +417,7 @@ AVCodec ff_libfdk_aac_encoder = {
.init = aac_encode_init,
.encode2 = aac_encode_frame,
.close = aac_encode_close,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.priv_class = &aac_enc_class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libgsmdec.c b/chromium/third_party/ffmpeg/libavcodec/libgsmdec.c
index 8740108d783..a503215f679 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libgsmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libgsmdec.c
@@ -134,7 +134,7 @@ AVCodec ff_libgsm_decoder = {
.close = libgsm_decode_close,
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_LIBGSM_MS_DECODER
@@ -148,6 +148,6 @@ AVCodec ff_libgsm_ms_decoder = {
.close = libgsm_decode_close,
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/libgsmenc.c b/chromium/third_party/ffmpeg/libavcodec/libgsmenc.c
index b06ec6498b4..45fdb8edd6b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libgsmenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libgsmenc.c
@@ -98,7 +98,7 @@ static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
gsm_signal *samples = (gsm_signal *)frame->data[0];
struct gsm_state *state = avctx->priv_data;
- if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, 0)) < 0)
return ret;
switch(avctx->codec_id) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/libilbc.c b/chromium/third_party/ffmpeg/libavcodec/libilbc.c
index 9fdd3c83f5b..c4c054fa5d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libilbc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libilbc.c
@@ -111,7 +111,7 @@ AVCodec ff_libilbc_decoder = {
.priv_data_size = sizeof(ILBCDecContext),
.init = ilbc_decode_init,
.decode = ilbc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &ilbc_dec_class,
};
@@ -166,7 +166,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ILBCEncContext *s = avctx->priv_data;
int ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 50, 0)) < 0)
return ret;
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
diff --git a/chromium/third_party/ffmpeg/libavcodec/libkvazaar.c b/chromium/third_party/ffmpeg/libavcodec/libkvazaar.c
new file mode 100644
index 00000000000..9fb5be7c79e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/libkvazaar.c
@@ -0,0 +1,248 @@
+/*
+ * libkvazaar encoder
+ *
+ * Copyright (c) 2015 Tampere University of Technology
+ *
+ * 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 <kvazaar.h>
+#include <string.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/dict.h"
+#include "libavutil/opt.h"
+#include "avcodec.h"
+#include "internal.h"
+
+typedef struct LibkvazaarContext {
+ const AVClass *class;
+
+ const kvz_api *api;
+ kvz_encoder *encoder;
+ kvz_config *config;
+
+ char *kvz_params;
+} LibkvazaarContext;
+
+static av_cold int libkvazaar_init(AVCodecContext *avctx)
+{
+ int retval = 0;
+ kvz_config *cfg = NULL;
+ kvz_encoder *enc = NULL;
+ const kvz_api *const api = kvz_api_get(8);
+
+ LibkvazaarContext *const ctx = avctx->priv_data;
+
+ // Kvazaar requires width and height to be multiples of eight.
+ if (avctx->width % 8 || avctx->height % 8) {
+ av_log(avctx, AV_LOG_ERROR, "Video dimensions are not a multiple of 8.\n");
+ retval = AVERROR_INVALIDDATA;
+ goto done;
+ }
+
+ cfg = api->config_alloc();
+ if (!cfg) {
+ av_log(avctx, AV_LOG_ERROR, "Could not allocate kvazaar config structure.\n");
+ retval = AVERROR(ENOMEM);
+ goto done;
+ }
+
+ if (!api->config_init(cfg)) {
+ av_log(avctx, AV_LOG_ERROR, "Could not initialize kvazaar config structure.\n");
+ retval = AVERROR_EXTERNAL;
+ goto done;
+ }
+
+ cfg->width = avctx->width;
+ cfg->height = avctx->height;
+ cfg->framerate =
+ (double)(avctx->time_base.num * avctx->ticks_per_frame) / avctx->time_base.den;
+ cfg->threads = avctx->thread_count;
+ cfg->target_bitrate = avctx->bit_rate;
+ cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
+ cfg->vui.sar_height = avctx->sample_aspect_ratio.den;
+
+ if (ctx->kvz_params) {
+ AVDictionary *dict = NULL;
+ if (!av_dict_parse_string(&dict, ctx->kvz_params, "=", ",", 0)) {
+ AVDictionaryEntry *entry = NULL;
+ while ((entry = av_dict_get(dict, "", entry, AV_DICT_IGNORE_SUFFIX))) {
+ if (!api->config_parse(cfg, entry->key, entry->value)) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Invalid option: %s=%s.\n",
+ entry->key, entry->value);
+ }
+ }
+ av_dict_free(&dict);
+ }
+ }
+
+ enc = api->encoder_open(cfg);
+ if (!enc) {
+ av_log(avctx, AV_LOG_ERROR, "Could not open kvazaar encoder.\n");
+ retval = AVERROR_EXTERNAL;
+ goto done;
+ }
+
+ ctx->api = api;
+ ctx->encoder = enc;
+ ctx->config = cfg;
+ enc = NULL;
+ cfg = NULL;
+
+done:
+ if (cfg) api->config_destroy(cfg);
+ if (enc) api->encoder_close(enc);
+
+ return retval;
+}
+
+static av_cold int libkvazaar_close(AVCodecContext *avctx)
+{
+ LibkvazaarContext *ctx = avctx->priv_data;
+ if (!ctx->api) return 0;
+
+ if (ctx->encoder) {
+ ctx->api->encoder_close(ctx->encoder);
+ ctx->encoder = NULL;
+ }
+
+ if (ctx->config) {
+ ctx->api->config_destroy(ctx->config);
+ ctx->config = NULL;
+ }
+
+ return 0;
+}
+
+static int libkvazaar_encode(AVCodecContext *avctx,
+ AVPacket *avpkt,
+ const AVFrame *frame,
+ int *got_packet_ptr)
+{
+ int retval = 0;
+ kvz_picture *img_in = NULL;
+ kvz_data_chunk *data_out = NULL;
+ uint32_t len_out = 0;
+ LibkvazaarContext *ctx = avctx->priv_data;
+
+ *got_packet_ptr = 0;
+
+ if (frame) {
+ int i = 0;
+
+ av_assert0(frame->width == ctx->config->width);
+ av_assert0(frame->height == ctx->config->height);
+ av_assert0(frame->format == avctx->pix_fmt);
+
+ // Allocate input picture for kvazaar.
+ img_in = ctx->api->picture_alloc(frame->width, frame->height);
+ if (!img_in) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to allocate picture.\n");
+ retval = AVERROR(ENOMEM);
+ goto done;
+ }
+
+ // Copy pixels from frame to img_in.
+ for (i = 0; i < 3; ++i) {
+ uint8_t *dst = img_in->data[i];
+ uint8_t *src = frame->data[i];
+ int width = (i == 0) ? frame->width : (frame->width / 2);
+ int height = (i == 0) ? frame->height : (frame->height / 2);
+ int y = 0;
+ for (y = 0; y < height; ++y) {
+ memcpy(dst, src, width);
+ src += frame->linesize[i];
+ dst += width;
+ }
+ }
+ }
+
+ if (!ctx->api->encoder_encode(ctx->encoder, img_in, &data_out, &len_out, NULL)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to encode frame.\n");
+ retval = AVERROR_EXTERNAL;
+ goto done;
+ }
+
+ if (data_out) {
+ kvz_data_chunk *chunk = NULL;
+ uint64_t written = 0;
+
+ retval = ff_alloc_packet(avpkt, len_out);
+ if (retval < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to allocate output packet.\n");
+ goto done;
+ }
+
+ for (chunk = data_out; chunk != NULL; chunk = chunk->next) {
+ av_assert0(written + chunk->len <= len_out);
+ memcpy(avpkt->data + written, chunk->data, chunk->len);
+ written += chunk->len;
+ }
+ *got_packet_ptr = 1;
+
+ ctx->api->chunk_free(data_out);
+ data_out = NULL;
+ }
+
+done:
+ if (img_in) ctx->api->picture_free(img_in);
+ if (data_out) ctx->api->chunk_free(data_out);
+ return retval;
+}
+
+static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+};
+
+static const AVOption options[] = {
+ { "kvazaar-params", "Set kvazaar parameters as a comma-separated list of name=value pairs.",
+ offsetof(LibkvazaarContext, kvz_params), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0,
+ AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "libkvazaar",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVCodecDefault defaults[] = {
+ { "b", "0" },
+ { NULL },
+};
+
+AVCodec ff_libkvazaar_encoder = {
+ .name = "libkvazaar",
+ .long_name = NULL_IF_CONFIG_SMALL("libkvazaar H.265 / HEVC"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .pix_fmts = pix_fmts,
+
+ .priv_class = &class,
+ .priv_data_size = sizeof(LibkvazaarContext),
+ .defaults = defaults,
+
+ .init = libkvazaar_init,
+ .encode2 = libkvazaar_encode,
+ .close = libkvazaar_close,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libmp3lame.c b/chromium/third_party/ffmpeg/libavcodec/libmp3lame.c
index b5d50048aac..873b390c0c4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libmp3lame.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libmp3lame.c
@@ -111,7 +111,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
lame_set_quality(s->gfp, avctx->compression_level);
/* rate control */
- if (avctx->flags & CODEC_FLAG_QSCALE) { // VBR
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE) { // VBR
lame_set_VBR(s->gfp, vbr_default);
lame_set_VBR_quality(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA);
} else {
@@ -159,7 +159,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
if (ret < 0)
goto error;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp) {
ret = AVERROR(ENOMEM);
goto error;
@@ -258,7 +258,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ff_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len,
s->buffer_index);
if (len <= s->buffer_index) {
- if ((ret = ff_alloc_packet2(avctx, avpkt, len)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0)) < 0)
return ret;
memcpy(avpkt->data, s->buffer, len);
s->buffer_index -= len;
@@ -277,9 +277,9 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
#define OFFSET(x) offsetof(LAMEContext, x)
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "reservoir", "use bit reservoir", OFFSET(reservoir), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
- { "joint_stereo", "use joint stereo", OFFSET(joint_stereo), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
- { "abr", "use ABR", OFFSET(abr), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE },
+ { "reservoir", "use bit reservoir", OFFSET(reservoir), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AE },
+ { "joint_stereo", "use joint stereo", OFFSET(joint_stereo), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AE },
+ { "abr", "use ABR", OFFSET(abr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, AE },
{ NULL },
};
@@ -308,7 +308,7 @@ AVCodec ff_libmp3lame_encoder = {
.init = mp3lame_encode_init,
.encode2 = mp3lame_encode_frame,
.close = mp3lame_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_S16P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c b/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
index 556792ad775..f0e34268f7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopencore-amr.c
@@ -135,7 +135,7 @@ AVCodec ff_libopencore_amrnb_decoder = {
.init = amr_nb_decode_init,
.close = amr_nb_decode_close,
.decode = amr_nb_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif /* CONFIG_LIBOPENCORE_AMRNB_DECODER */
@@ -236,7 +236,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s->enc_bitrate = avctx->bit_rate;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 32)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 32, 0)) < 0)
return ret;
if (frame) {
@@ -287,7 +287,7 @@ AVCodec ff_libopencore_amrnb_encoder = {
.init = amr_nb_encode_init,
.encode2 = amr_nb_encode_frame,
.close = amr_nb_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.priv_class = &amrnb_class,
@@ -372,7 +372,7 @@ AVCodec ff_libopencore_amrwb_decoder = {
.init = amr_wb_decode_init,
.close = amr_wb_decode_close,
.decode = amr_wb_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopenh264enc.c b/chromium/third_party/ffmpeg/libavcodec/libopenh264enc.c
index 2b7bad3a08b..33b7f6c7a87 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopenh264enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopenh264enc.c
@@ -46,12 +46,12 @@ typedef struct SVCContext {
#define OFFSET(x) offsetof(SVCContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "slice_mode", "Slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
- { "fixed", "A fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
- { "rowmb", "One slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
- { "auto", "Automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
- { "loopfilter", "Enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
- { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
+ { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
+ { "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
+ { "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
+ { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+ { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ NULL }
};
@@ -59,6 +59,56 @@ static const AVClass class = {
"libopenh264enc", av_default_item_name, options, LIBAVUTIL_VERSION_INT
};
+// Convert ffmpeg log level to equivalent libopenh264 log level. Given the
+// conversions below, you must set the ffmpeg log level to something greater
+// than AV_LOG_DEBUG if you want to see WELS_LOG_DETAIL messages.
+static int ffmpeg_to_libopenh264_log_level (
+ int ffmpeg_log_level
+ )
+{
+ if (ffmpeg_log_level > AV_LOG_DEBUG) return WELS_LOG_DETAIL;
+ else if (ffmpeg_log_level >= AV_LOG_DEBUG) return WELS_LOG_DEBUG;
+ else if (ffmpeg_log_level >= AV_LOG_INFO) return WELS_LOG_INFO;
+ else if (ffmpeg_log_level >= AV_LOG_WARNING) return WELS_LOG_WARNING;
+ else if (ffmpeg_log_level >= AV_LOG_ERROR) return WELS_LOG_ERROR;
+ else return WELS_LOG_QUIET;
+}
+
+// Convert libopenh264 log level to equivalent ffmpeg log level.
+static int libopenh264_to_ffmpeg_log_level (
+ int libopenh264_log_level
+ )
+{
+ if (libopenh264_log_level >= WELS_LOG_DETAIL) return AV_LOG_TRACE;
+ else if (libopenh264_log_level >= WELS_LOG_DEBUG) return AV_LOG_DEBUG;
+ else if (libopenh264_log_level >= WELS_LOG_INFO) return AV_LOG_INFO;
+ else if (libopenh264_log_level >= WELS_LOG_WARNING) return AV_LOG_WARNING;
+ else if (libopenh264_log_level >= WELS_LOG_ERROR) return AV_LOG_ERROR;
+ else return AV_LOG_QUIET;
+}
+
+// This function will be provided to the libopenh264 library. The function will be called
+// when libopenh264 wants to log a message (error, warning, info, etc.). The signature for
+// this function (defined in .../codec/api/svc/codec_api.h) is:
+//
+// typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
+
+static void libopenh264_trace_callback (
+ void * ctx,
+ int level,
+ char const * msg
+ )
+{
+ // The message will be logged only if the requested EQUIVALENT ffmpeg log level is
+ // less than or equal to the current ffmpeg log level. Note, however, that before
+ // this function is called, welsCodecTrace::CodecTrace() will have already discarded
+ // the message (and this function will not be called) if the requested libopenh264
+ // log level "level" is greater than the current libopenh264 log level.
+ int equiv_ffmpeg_log_level = libopenh264_to_ffmpeg_log_level(level);
+ if (equiv_ffmpeg_log_level <= av_log_get_level())
+ av_log(ctx, equiv_ffmpeg_log_level, "%s\n", msg);
+}
+
static av_cold int svc_encode_close(AVCodecContext *avctx)
{
SVCContext *s = avctx->priv_data;
@@ -73,6 +123,8 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
SVCContext *s = avctx->priv_data;
SEncParamExt param = { 0 };
int err = AVERROR_UNKNOWN;
+ int equiv_libopenh264_log_level;
+ WelsTraceCallback callback_function;
// Mingw GCC < 4.7 on x86_32 uses an incorrect/buggy ABI for the WelsGetCodecVersion
// function (for functions returning larger structs), thus skip the check in those
@@ -90,9 +142,31 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
return AVERROR_UNKNOWN;
}
+ // Set libopenh264 message logging level for this instance of the encoder using
+ // the current ffmpeg log level converted to the equivalent libopenh264 level.
+ //
+ // The client should have the ffmpeg level set to the desired value before creating
+ // the libopenh264 encoder. Once the encoder has been created, the libopenh264
+ // log level is fixed for that encoder. Changing the ffmpeg log level to a LOWER
+ // value, in the expectation that higher level libopenh264 messages will no longer
+ // be logged, WILL have the expected effect. However, changing the ffmpeg log level
+ // to a HIGHER value, in the expectation that higher level libopenh264 messages will
+ // now be logged, WILL NOT have the expected effect. This is because the higher
+ // level messages will be discarded by the libopenh264 logging system before our
+ // message logging callback function can be invoked.
+ equiv_libopenh264_log_level = ffmpeg_to_libopenh264_log_level(av_log_get_level());
+ (*s->encoder)->SetOption(s->encoder,ENCODER_OPTION_TRACE_LEVEL,&equiv_libopenh264_log_level);
+
+ // Set the logging callback function to one that uses av_log() (see implementation above).
+ callback_function = (WelsTraceCallback) libopenh264_trace_callback;
+ (*s->encoder)->SetOption(s->encoder,ENCODER_OPTION_TRACE_CALLBACK,(void *)&callback_function);
+
+ // Set the AVCodecContext as the libopenh264 callback context so that it can be passed to av_log().
+ (*s->encoder)->SetOption(s->encoder,ENCODER_OPTION_TRACE_CALLBACK_CONTEXT,(void *)&avctx);
+
(*s->encoder)->GetDefaultParams(s->encoder, &param);
- param.fMaxFrameRate = avctx->time_base.den / avctx->time_base.num;
+ param.fMaxFrameRate = 1/av_q2d(avctx->time_base);
param.iPicWidth = avctx->width;
param.iPicHeight = avctx->height;
param.iTargetBitrate = avctx->bit_rate;
@@ -137,13 +211,13 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
goto fail;
}
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
SFrameBSInfo fbi = { 0 };
int i, size = 0;
(*s->encoder)->EncodeParameterSets(s->encoder, &fbi);
for (i = 0; i < fbi.sLayerInfo[0].iNalCount; i++)
size += fbi.sLayerInfo[0].pNalLengthInByte[i];
- avctx->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
err = AVERROR(ENOMEM);
goto fail;
@@ -192,7 +266,7 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
// frames have two layers, where the first layer contains the SPS/PPS.
// If using global headers, don't include the SPS/PPS in the returned
// packet - thus, only return one layer.
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)
first_layer = fbi.iLayerNum - 1;
for (layer = first_layer; layer < fbi.iLayerNum; layer++) {
@@ -202,7 +276,7 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
av_log(avctx, AV_LOG_DEBUG, "%d slices\n", fbi.sLayerInfo[fbi.iLayerNum - 1].iNalCount);
- if ((ret = ff_alloc_packet(avpkt, size))) {
+ if ((ret = ff_alloc_packet2(avctx, avpkt, size, size))) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
return ret;
}
@@ -227,7 +301,7 @@ AVCodec ff_libopenh264_encoder = {
.init = svc_encode_init,
.encode2 = svc_encode_frame,
.close = svc_encode_close,
- .capabilities = CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_AUTO_THREADS,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
.priv_class = &class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
index 7f28e87d7f6..8539e2c9bdd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopenjpegdec.c
@@ -114,22 +114,22 @@ static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum AVP
switch (desc->nb_components) {
case 4:
match = match &&
- desc->comp[3].depth_minus1 + 1 >= image->comps[3].prec &&
+ desc->comp[3].depth >= image->comps[3].prec &&
1 == image->comps[3].dx &&
1 == image->comps[3].dy;
case 3:
match = match &&
- desc->comp[2].depth_minus1 + 1 >= image->comps[2].prec &&
+ desc->comp[2].depth >= image->comps[2].prec &&
1 << desc->log2_chroma_w == image->comps[2].dx &&
1 << desc->log2_chroma_h == image->comps[2].dy;
case 2:
match = match &&
- desc->comp[1].depth_minus1 + 1 >= image->comps[1].prec &&
+ desc->comp[1].depth >= image->comps[1].prec &&
1 << desc->log2_chroma_w == image->comps[1].dx &&
1 << desc->log2_chroma_h == image->comps[1].dy;
case 1:
match = match &&
- desc->comp[0].depth_minus1 + 1 >= image->comps[0].prec &&
+ desc->comp[0].depth >= image->comps[0].prec &&
1 == image->comps[0].dx &&
1 == image->comps[0].dy;
default:
@@ -204,7 +204,7 @@ static inline void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *i
int index, x, y, c;
int adjust[4];
for (x = 0; x < image->numcomps; x++)
- adjust[x] = FFMAX(FFMIN(desc->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0) + desc->comp[x].shift;
+ adjust[x] = FFMAX(FFMIN(desc->comp[x].depth - image->comps[x].prec, 8), 0) + desc->comp[x].shift;
for (y = 0; y < picture->height; y++) {
index = y * picture->width;
@@ -241,7 +241,7 @@ static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {
int index, x, y;
int adjust[4];
for (x = 0; x < image->numcomps; x++)
- adjust[x] = FFMAX(FFMIN(desc->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0) + desc->comp[x].shift;
+ adjust[x] = FFMAX(FFMIN(desc->comp[x].depth - image->comps[x].prec, 8), 0) + desc->comp[x].shift;
for (index = 0; index < image->numcomps; index++) {
comp_data = image->comps[index].data;
@@ -388,7 +388,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
}
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- pixel_size = desc->comp[0].step_minus1 + 1;
+ pixel_size = desc->comp[0].step;
ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
switch (pixel_size) {
@@ -439,7 +439,7 @@ static av_cold void libopenjpeg_static_init(AVCodec *codec)
int major, minor;
if (sscanf(version, "%d.%d", &major, &minor) == 2 && 1000*major + minor <= 1003)
- codec->capabilities |= CODEC_CAP_EXPERIMENTAL;
+ codec->capabilities |= AV_CODEC_CAP_EXPERIMENTAL;
}
#define OFFSET(x) offsetof(LibOpenJPEGContext, x)
@@ -466,7 +466,7 @@ AVCodec ff_libopenjpeg_decoder = {
.priv_data_size = sizeof(LibOpenJPEGContext),
.init = libopenjpeg_decode_init,
.decode = libopenjpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.max_lowres = 31,
.priv_class = &openjpeg_class,
.init_static_data = libopenjpeg_static_init,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c b/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
index 014c2f9d28b..0debd24d805 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopenjpegenc.c
@@ -189,8 +189,8 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p
}
for (i = 0; i < numcomps; i++) {
- cmptparm[i].prec = desc->comp[i].depth_minus1 + 1;
- cmptparm[i].bpp = desc->comp[i].depth_minus1 + 1;
+ cmptparm[i].prec = desc->comp[i].depth;
+ cmptparm[i].bpp = desc->comp[i].depth;
cmptparm[i].sgnd = 0;
cmptparm[i].dx = sub_dx[i];
cmptparm[i].dy = sub_dy[i];
@@ -242,18 +242,11 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
goto fail;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
- goto fail;
- }
-
return 0;
fail:
opj_image_destroy(ctx->image);
ctx->image = NULL;
- av_frame_free(&avctx->coded_frame);
return err;
}
@@ -586,7 +579,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
len = cio_tell(stream);
- if ((ret = ff_alloc_packet2(avctx, pkt, len)) < 0) {
+ if ((ret = ff_alloc_packet2(avctx, pkt, len, 0)) < 0) {
return ret;
}
@@ -608,7 +601,6 @@ static av_cold int libopenjpeg_encode_close(AVCodecContext *avctx)
opj_image_destroy(ctx->image);
ctx->image = NULL;
- av_frame_free(&avctx->coded_frame);
return 0;
}
@@ -657,7 +649,7 @@ AVCodec ff_libopenjpeg_encoder = {
.init = libopenjpeg_encode_init,
.encode2 = libopenjpeg_encode_frame,
.close = libopenjpeg_encode_close,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBR24P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopusdec.c b/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
index 8436302a9bd..4cbd14a38a8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopusdec.c
@@ -191,7 +191,7 @@ AVCodec ff_libopus_decoder = {
.close = libopus_decode_close,
.decode = libopus_decode,
.flush = libopus_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/libopusenc.c b/chromium/third_party/ffmpeg/libavcodec/libopusenc.c
index 785460972d0..a170b711c6f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libopusenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libopusenc.c
@@ -269,7 +269,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx)
}
header_size = 19 + (avctx->channels > 2 ? 2 + avctx->channels : 0);
- avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(header_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
av_log(avctx, AV_LOG_ERROR, "Failed to allocate extradata.\n");
ret = AVERROR(ENOMEM);
@@ -326,7 +326,7 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
} else
audio = frame->data[0];
} else {
- if (!opus->afq.remaining_samples)
+ if (!opus->afq.remaining_samples || (!opus->afq.frame_alloc && !opus->afq.frame_count))
return 0;
audio = opus->samples;
memset(audio, 0, opus->opts.packet_size * sample_size);
@@ -335,7 +335,7 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
/* Maximum packet size taken from opusenc in opus-tools. 60ms packets
* consist of 3 frames in one packet. The maximum frame size is 1275
* bytes along with the largest possible packet header of 7 bytes. */
- if ((ret = ff_alloc_packet2(avctx, avpkt, (1275 * 3 + 7) * opus->stream_count)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, (1275 * 3 + 7) * opus->stream_count, 0)) < 0)
return ret;
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
@@ -438,7 +438,7 @@ AVCodec ff_libopus_encoder = {
.init = libopus_encode_init,
.encode2 = libopus_encode,
.close = libopus_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/libschroedingerdec.c b/chromium/third_party/ffmpeg/libavcodec/libschroedingerdec.c
index 8778869af8c..6ddb811813d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libschroedingerdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libschroedingerdec.c
@@ -383,6 +383,6 @@ AVCodec ff_libschroedinger_decoder = {
.init = libschroedinger_decode_init,
.close = libschroedinger_decode_close,
.decode = libschroedinger_decode_frame,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.flush = libschroedinger_flush,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libschroedingerenc.c b/chromium/third_party/ffmpeg/libavcodec/libschroedingerenc.c
index f7a32353e24..d70552ed567 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libschroedingerenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libschroedingerenc.c
@@ -159,10 +159,6 @@ static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
avctx->width,
avctx->height);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
if (!avctx->gop_size) {
schro_encoder_setting_set_double(p_schro_params->encoder,
"gop_structure",
@@ -179,7 +175,7 @@ static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
}
/* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */
- if (avctx->flags & CODEC_FLAG_QSCALE) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
if (!avctx->global_quality) {
/* lossless coding */
schro_encoder_setting_set_double(p_schro_params->encoder,
@@ -206,14 +202,14 @@ static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
"bitrate", avctx->bit_rate);
}
- if (avctx->flags & CODEC_FLAG_INTERLACED_ME)
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
/* All material can be coded as interlaced or progressive
irrespective of the type of source material. */
schro_encoder_setting_set_double(p_schro_params->encoder,
"interlaced_coding", 1);
schro_encoder_setting_set_double(p_schro_params->encoder, "open_gop",
- !(avctx->flags & CODEC_FLAG_CLOSED_GOP));
+ !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP));
/* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
* and libdirac support other bit-depth data. */
@@ -383,16 +379,20 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pkt_size = p_frame_output->size;
if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0)
pkt_size += p_schro_params->enc_buf_size;
- if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0)
goto error;
memcpy(pkt->data, p_frame_output->p_encbuf, p_frame_output->size);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = p_frame_output->key_frame;
+ avctx->coded_frame->pts = p_frame_output->frame_num;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
/* Use the frame number of the encoded frame as the pts. It is OK to
* do so since Dirac is a constant frame rate codec. It expects input
* to be of constant frame rate. */
- pkt->pts =
- avctx->coded_frame->pts = p_frame_output->frame_num;
+ pkt->pts = p_frame_output->frame_num;
pkt->dts = p_schro_params->dts++;
enc_size = p_frame_output->size;
@@ -436,8 +436,6 @@ static int libschroedinger_encode_close(AVCodecContext *avctx)
/* Free the video format structure. */
av_freep(&p_schro_params->format);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -451,7 +449,7 @@ AVCodec ff_libschroedinger_encoder = {
.init = libschroedinger_encode_init,
.encode2 = libschroedinger_encode_frame,
.close = libschroedinger_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
},
diff --git a/chromium/third_party/ffmpeg/libavcodec/libshine.c b/chromium/third_party/ffmpeg/libavcodec/libshine.c
index 27c1a5f43f5..f4cf5981bcb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libshine.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libshine.c
@@ -102,7 +102,7 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
len = hdr.frame_size;
if (len <= s->buffer_index) {
- if ((ret = ff_alloc_packet2(avctx, avpkt, len)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0)))
return ret;
memcpy(avpkt->data, s->buffer, len);
s->buffer_index -= len;
@@ -139,7 +139,7 @@ AVCodec ff_libshine_encoder = {
.init = libshine_encode_init,
.encode2 = libshine_encode_frame,
.close = libshine_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = libshine_sample_rates,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c b/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
index 6ca592aec8e..044883af738 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libspeexdec.c
@@ -199,5 +199,5 @@ AVCodec ff_libspeex_decoder = {
.close = libspeex_decode_close,
.decode = libspeex_decode_frame,
.flush = libspeex_decode_flush,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libspeexenc.c b/chromium/third_party/ffmpeg/libavcodec/libspeexenc.c
index fac8e725ac6..fbc17388a17 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libspeexenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libspeexenc.c
@@ -40,7 +40,7 @@
* used to set the encoding mode.
*
* Rate Control
- * VBR mode is turned on by setting CODEC_FLAG_QSCALE in avctx->flags.
+ * VBR mode is turned on by setting AV_CODEC_FLAG_QSCALE in avctx->flags.
* avctx->global_quality is used to set the encoding quality.
* For CBR mode, avctx->bit_rate can be used to set the constant bitrate.
* Alternatively, the 'cbr_quality' option can be set from 0 to 10 to set
@@ -177,7 +177,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
speex_init_header(&s->header, avctx->sample_rate, avctx->channels, mode);
/* rate control method and parameters */
- if (avctx->flags & CODEC_FLAG_QSCALE) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
/* VBR */
s->header.vbr = 1;
s->vad = 1; /* VAD is always implicitly activated for VBR */
@@ -244,8 +244,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
below with speex_header_free() */
header_data = speex_header_to_packet(&s->header, &header_size);
- /* allocate extradata and coded_frame */
- avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ /* allocate extradata */
+ avctx->extradata = av_malloc(header_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
speex_header_free(header_data);
speex_encoder_destroy(s->enc_state);
@@ -294,7 +294,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
/* write output if all frames for the packet have been encoded */
if (s->pkt_frame_count == s->frames_per_packet) {
s->pkt_frame_count = 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, speex_bits_nbytes(&s->bits))) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, speex_bits_nbytes(&s->bits), 0)) < 0)
return ret;
ret = speex_bits_write(&s->bits, avpkt->data, avpkt->size);
speex_bits_reset(&s->bits);
@@ -356,7 +356,7 @@ AVCodec ff_libspeex_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp b/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
index 11d60387759..f4b38e60705 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libstagefright.cpp
@@ -272,7 +272,7 @@ static av_cold int Stagefright_init(AVCodecContext *avctx)
s->orig_extradata_size = avctx->extradata_size;
s->orig_extradata = (uint8_t*) av_mallocz(avctx->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->orig_extradata) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -568,7 +568,7 @@ AVCodec ff_libstagefright_h264_decoder = {
NULL_IF_CONFIG_SMALL("libstagefright H.264"),
AVMEDIA_TYPE_VIDEO,
AV_CODEC_ID_H264,
- CODEC_CAP_DELAY,
+ AV_CODEC_CAP_DELAY,
NULL, //supported_framerates
NULL, //pix_fmts
NULL, //supported_samplerates
diff --git a/chromium/third_party/ffmpeg/libavcodec/libtheoraenc.c b/chromium/third_party/ffmpeg/libavcodec/libtheoraenc.c
index e6b1cbd2ed1..c581b34e3ba 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libtheoraenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libtheoraenc.c
@@ -210,7 +210,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
}
avcodec_get_chroma_sub_sample(avc_context->pix_fmt, &h->uv_hshift, &h->uv_vshift);
- if (avc_context->flags & CODEC_FLAG_QSCALE) {
+ if (avc_context->flags & AV_CODEC_FLAG_QSCALE) {
/* Clip global_quality in QP units to the [0 - 10] range
to be consistent with the libvorbis implementation.
Theora accepts a quality parameter which is an int value in
@@ -241,10 +241,10 @@ static av_cold int encode_init(AVCodecContext* avc_context)
}
// need to enable 2 pass (via TH_ENCCTL_2PASS_) before encoding headers
- if (avc_context->flags & CODEC_FLAG_PASS1) {
+ if (avc_context->flags & AV_CODEC_FLAG_PASS1) {
if ((ret = get_stats(avc_context, 0)) < 0)
return ret;
- } else if (avc_context->flags & CODEC_FLAG_PASS2) {
+ } else if (avc_context->flags & AV_CODEC_FLAG_PASS2) {
if ((ret = submit_stats(avc_context)) < 0)
return ret;
}
@@ -267,11 +267,6 @@ static av_cold int encode_init(AVCodecContext* avc_context)
th_comment_clear(&t_comment);
- /* Set up the output AVFrame */
- avc_context->coded_frame = av_frame_alloc();
- if (!avc_context->coded_frame)
- return AVERROR(ENOMEM);
-
return 0;
}
@@ -286,7 +281,7 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
// EOS, finish and get 1st pass stats if applicable
if (!frame) {
th_encode_packetout(h->t_state, 1, &o_packet);
- if (avc_context->flags & CODEC_FLAG_PASS1)
+ if (avc_context->flags & AV_CODEC_FLAG_PASS1)
if ((ret = get_stats(avc_context, 1)) < 0)
return ret;
return 0;
@@ -300,7 +295,7 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
t_yuv_buffer[i].data = frame->data[i];
}
- if (avc_context->flags & CODEC_FLAG_PASS2)
+ if (avc_context->flags & AV_CODEC_FLAG_PASS2)
if ((ret = submit_stats(avc_context)) < 0)
return ret;
@@ -323,7 +318,7 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
return AVERROR_EXTERNAL;
}
- if (avc_context->flags & CODEC_FLAG_PASS1)
+ if (avc_context->flags & AV_CODEC_FLAG_PASS1)
if ((ret = get_stats(avc_context, 0)) < 0)
return ret;
@@ -342,15 +337,19 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
}
/* Copy ogg_packet content out to buffer */
- if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes)) < 0)
+ if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes, 0)) < 0)
return ret;
memcpy(pkt->data, o_packet.packet, o_packet.bytes);
// HACK: assumes no encoder delay, this is true until libtheora becomes
// multithreaded (which will be disabled unless explicitly requested)
pkt->pts = pkt->dts = frame->pts;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
- if (avc_context->coded_frame->key_frame)
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ if (!(o_packet.granulepos & h->keyframe_mask))
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
@@ -363,7 +362,6 @@ static av_cold int encode_close(AVCodecContext* avc_context)
th_encode_free(h->t_state);
av_freep(&h->stats);
- av_frame_free(&avc_context->coded_frame);
av_freep(&avc_context->stats_out);
av_freep(&avc_context->extradata);
avc_context->extradata_size = 0;
@@ -381,7 +379,7 @@ AVCodec ff_libtheora_encoder = {
.init = encode_init,
.close = encode_close,
.encode2 = encode_frame,
- .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary
+ .capabilities = AV_CODEC_CAP_DELAY, // needed to get the statsfile summary
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
},
diff --git a/chromium/third_party/ffmpeg/libavcodec/libtwolame.c b/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
index dc188575b56..12d71e7acbb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libtwolame.c
@@ -81,7 +81,7 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx)
if (!avctx->bit_rate)
avctx->bit_rate = avctx->sample_rate < 28000 ? 160000 : 384000;
- if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE || !avctx->bit_rate) {
twolame_set_VBR(s->glopts, TRUE);
twolame_set_VBR_level(s->glopts,
avctx->global_quality / (float) FF_QP2LAMBDA);
@@ -106,7 +106,7 @@ static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
TWOLAMEContext *s = avctx->priv_data;
int ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE, 0)) < 0)
return ret;
if (frame) {
@@ -211,7 +211,7 @@ AVCodec ff_libtwolame_encoder = {
.init = twolame_encode_init,
.encode2 = twolame_encode_frame,
.close = twolame_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.defaults = twolame_defaults,
.priv_class = &twolame_class,
.sample_fmts = (const enum AVSampleFormat[]) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp b/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
index e4b87a8bbca..47261a6c7fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libutvideodec.cpp
@@ -145,7 +145,6 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
int w = avctx->width, h = avctx->height;
/* Set flags */
- pic->reference = 0;
pic->pict_type = AV_PICTURE_TYPE_I;
pic->key_frame = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp b/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
index cf669d28a04..87462470e21 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
+++ b/chromium/third_party/ffmpeg/libavcodec/libutvideoenc.cpp
@@ -81,7 +81,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
flags = ((avctx->prediction_method + 1) << 8) | (avctx->thread_count - 1);
avctx->priv_data = utv;
- avctx->coded_frame = av_frame_alloc();
/* Alloc extradata buffer */
info = (UtVideoExtra *)av_malloc(sizeof(*info));
@@ -144,7 +143,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *dst;
/* Alloc buffer */
- if ((ret = ff_alloc_packet2(avctx, pkt, utv->buf_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, utv->buf_size, 0)) < 0)
return ret;
dst = pkt->data;
@@ -199,8 +198,6 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
* assert that this is true.
*/
av_assert2(keyframe == true);
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
@@ -211,7 +208,6 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx)
{
UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
av_freep(&avctx->extradata);
av_freep(&utv->buffer);
@@ -226,7 +222,7 @@ AVCodec ff_libutvideo_encoder = {
NULL_IF_CONFIG_SMALL("Ut Video"),
AVMEDIA_TYPE_VIDEO,
AV_CODEC_ID_UTVIDEO,
- CODEC_CAP_AUTO_THREADS | CODEC_CAP_LOSSLESS,
+ AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_LOSSLESS | AV_CODEC_CAP_INTRA_ONLY,
NULL, /* supported_framerates */
(const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUYV422, AV_PIX_FMT_BGR24,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvo-aacenc.c b/chromium/third_party/ffmpeg/libavcodec/libvo-aacenc.c
index 2c4a424252e..7f21ad2e0d0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvo-aacenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvo-aacenc.c
@@ -85,7 +85,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
params.sampleRate = avctx->sample_rate;
params.bitRate = avctx->bit_rate;
params.nChannels = avctx->channels;
- params.adtsUsed = !(avctx->flags & CODEC_FLAG_GLOBAL_HEADER);
+ params.adtsUsed = !(avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER);
if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, &params)
!= VO_ERR_NONE) {
av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n");
@@ -102,10 +102,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
ret = AVERROR(ENOSYS);
goto error;
}
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
avctx->extradata_size = 2;
avctx->extradata = av_mallocz(avctx->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
ret = AVERROR(ENOMEM);
goto error;
@@ -153,7 +153,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return ret;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels), 0)) < 0)
return ret;
input.Buffer = samples;
@@ -194,7 +194,7 @@ AVCodec ff_libvo_aacenc_encoder = {
.encode2 = aac_encode_frame,
.close = aac_encode_close,
.supported_samplerates = mpeg4audio_sample_rates,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvo-amrwbenc.c b/chromium/third_party/ffmpeg/libavcodec/libvo-amrwbenc.c
index fe19e71156d..92fa185081f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvo-amrwbenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvo-amrwbenc.c
@@ -115,7 +115,7 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const int16_t *samples = (const int16_t *)frame->data[0];
int size, ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE, 0)) < 0)
return ret;
if (s->last_bitrate != avctx->bit_rate) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c b/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
index db005725fc7..ecf690a5530 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
@@ -32,6 +32,8 @@ typedef struct OggVorbisDecContext {
ogg_packet op; /**< ogg packet */
} OggVorbisDecContext;
+static int oggvorbis_decode_close(AVCodecContext *avccontext);
+
static int oggvorbis_decode_init(AVCodecContext *avccontext) {
OggVorbisDecContext *context = avccontext->priv_data ;
uint8_t *p= avccontext->extradata;
@@ -110,8 +112,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
return 0 ;
error:
- vorbis_info_clear(&context->vi);
- vorbis_comment_clear(&context->vc) ;
+ oggvorbis_decode_close(avccontext);
return ret;
}
@@ -187,6 +188,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
static int oggvorbis_decode_close(AVCodecContext *avccontext) {
OggVorbisDecContext *context = avccontext->priv_data ;
+ vorbis_block_clear(&context->vb);
+ vorbis_dsp_clear(&context->vd);
vorbis_info_clear(&context->vi) ;
vorbis_comment_clear(&context->vc) ;
@@ -203,5 +206,5 @@ AVCodec ff_libvorbis_decoder = {
.init = oggvorbis_decode_init,
.decode = oggvorbis_decode_frame,
.close = oggvorbis_decode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c b/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
index 231d1be2523..3ca5b55e8e6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvorbisenc.c
@@ -86,14 +86,14 @@ static av_cold int libvorbis_setup(vorbis_info *vi, AVCodecContext *avctx)
double cfreq;
int ret;
- if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE || !avctx->bit_rate) {
/* variable bitrate
* NOTE: we use the oggenc range of -1 to 10 for global_quality for
* user convenience, but libvorbis uses -0.1 to 1.0.
*/
float q = avctx->global_quality / (float)FF_QP2LAMBDA;
/* default to 3 if the user did not set quality or bitrate */
- if (!(avctx->flags & CODEC_FLAG_QSCALE))
+ if (!(avctx->flags & AV_CODEC_FLAG_QSCALE))
q = 3.0;
if ((ret = vorbis_encode_setup_vbr(vi, avctx->channels,
avctx->sample_rate,
@@ -218,7 +218,7 @@ static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
}
vorbis_comment_init(&s->vc);
- if (!(avctx->flags & CODEC_FLAG_BITEXACT))
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
vorbis_comment_add_tag(&s->vc, "encoder", LIBAVCODEC_IDENT);
if ((ret = vorbis_analysis_headerout(&s->vd, &s->vc, &header, &header_comm,
@@ -231,7 +231,7 @@ static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
xiph_len(header_comm.bytes) +
header_code.bytes;
p = avctx->extradata = av_malloc(avctx->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!p) {
ret = AVERROR(ENOMEM);
goto error;
@@ -338,7 +338,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
av_fifo_generic_read(s->pkt_fifo, &op, sizeof(ogg_packet), NULL);
- if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes, 0)) < 0)
return ret;
av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL);
@@ -372,7 +372,7 @@ AVCodec ff_libvorbis_encoder = {
.init = libvorbis_encode_init,
.encode2 = libvorbis_encode_frame,
.close = libvorbis_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &vorbis_class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpx.c b/chromium/third_party/ffmpeg/libavcodec/libvpx.c
index e0f9df3caa4..a60d186f1f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpx.c
@@ -62,7 +62,7 @@ av_cold void ff_vp9_init_static(AVCodec *codec)
{
if ( vpx_codec_version_major() < 1
|| (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3))
- codec->capabilities |= CODEC_CAP_EXPERIMENTAL;
+ codec->capabilities |= AV_CODEC_CAP_EXPERIMENTAL;
codec->pix_fmts = vp9_pix_fmts_def;
#if CONFIG_LIBVPX_VP9_ENCODER
if ( vpx_codec_version_major() > 1
@@ -77,3 +77,60 @@ av_cold void ff_vp9_init_static(AVCodec *codec)
}
#endif
}
+#if 0
+enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img)
+{
+ switch (img) {
+ case VPX_IMG_FMT_RGB24: return AV_PIX_FMT_RGB24;
+ case VPX_IMG_FMT_RGB565: return AV_PIX_FMT_RGB565BE;
+ case VPX_IMG_FMT_RGB555: return AV_PIX_FMT_RGB555BE;
+ case VPX_IMG_FMT_UYVY: return AV_PIX_FMT_UYVY422;
+ case VPX_IMG_FMT_YUY2: return AV_PIX_FMT_YUYV422;
+ case VPX_IMG_FMT_YVYU: return AV_PIX_FMT_YVYU422;
+ case VPX_IMG_FMT_BGR24: return AV_PIX_FMT_BGR24;
+ case VPX_IMG_FMT_ARGB: return AV_PIX_FMT_ARGB;
+ case VPX_IMG_FMT_ARGB_LE: return AV_PIX_FMT_BGRA;
+ case VPX_IMG_FMT_RGB565_LE: return AV_PIX_FMT_RGB565LE;
+ case VPX_IMG_FMT_RGB555_LE: return AV_PIX_FMT_RGB555LE;
+ case VPX_IMG_FMT_I420: return AV_PIX_FMT_YUV420P;
+ case VPX_IMG_FMT_I422: return AV_PIX_FMT_YUV422P;
+ case VPX_IMG_FMT_I444: return AV_PIX_FMT_YUV444P;
+ case VPX_IMG_FMT_444A: return AV_PIX_FMT_YUVA444P;
+#if VPX_IMAGE_ABI_VERSION >= 3
+ case VPX_IMG_FMT_I440: return AV_PIX_FMT_YUV440P;
+ case VPX_IMG_FMT_I42016: return AV_PIX_FMT_YUV420P16BE;
+ case VPX_IMG_FMT_I42216: return AV_PIX_FMT_YUV422P16BE;
+ case VPX_IMG_FMT_I44416: return AV_PIX_FMT_YUV444P16BE;
+#endif
+ default: return AV_PIX_FMT_NONE;
+ }
+}
+
+vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix)
+{
+ switch (pix) {
+ case AV_PIX_FMT_RGB24: return VPX_IMG_FMT_RGB24;
+ case AV_PIX_FMT_RGB565BE: return VPX_IMG_FMT_RGB565;
+ case AV_PIX_FMT_RGB555BE: return VPX_IMG_FMT_RGB555;
+ case AV_PIX_FMT_UYVY422: return VPX_IMG_FMT_UYVY;
+ case AV_PIX_FMT_YUYV422: return VPX_IMG_FMT_YUY2;
+ case AV_PIX_FMT_YVYU422: return VPX_IMG_FMT_YVYU;
+ case AV_PIX_FMT_BGR24: return VPX_IMG_FMT_BGR24;
+ case AV_PIX_FMT_ARGB: return VPX_IMG_FMT_ARGB;
+ case AV_PIX_FMT_BGRA: return VPX_IMG_FMT_ARGB_LE;
+ case AV_PIX_FMT_RGB565LE: return VPX_IMG_FMT_RGB565_LE;
+ case AV_PIX_FMT_RGB555LE: return VPX_IMG_FMT_RGB555_LE;
+ case AV_PIX_FMT_YUV420P: return VPX_IMG_FMT_I420;
+ case AV_PIX_FMT_YUV422P: return VPX_IMG_FMT_I422;
+ case AV_PIX_FMT_YUV444P: return VPX_IMG_FMT_I444;
+ case AV_PIX_FMT_YUVA444P: return VPX_IMG_FMT_444A;
+#if VPX_IMAGE_ABI_VERSION >= 3
+ case AV_PIX_FMT_YUV440P: return VPX_IMG_FMT_I440;
+ case AV_PIX_FMT_YUV420P16BE: return VPX_IMG_FMT_I42016;
+ case AV_PIX_FMT_YUV422P16BE: return VPX_IMG_FMT_I42216;
+ case AV_PIX_FMT_YUV444P16BE: return VPX_IMG_FMT_I44416;
+#endif
+ default: return VPX_IMG_FMT_NONE;
+ }
+}
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpx.h b/chromium/third_party/ffmpeg/libavcodec/libvpx.h
index 36a275c5d22..22b697fa015 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpx.h
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpx.h
@@ -21,8 +21,14 @@
#ifndef AVCODEC_LIBVPX_H
#define AVCODEC_LIBVPX_H
+#include <vpx/vpx_codec.h>
+
#include "avcodec.h"
void ff_vp9_init_static(AVCodec *codec);
+#if 0
+enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img);
+vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix);
+#endif
#endif /* AVCODEC_LIBVPX_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c b/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
index c69e88899e8..7267590e018 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpxdec.c
@@ -62,26 +62,44 @@ static av_cold int vpx_init(AVCodecContext *avctx,
// returns 0 on success, AVERROR_INVALIDDATA otherwise
static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
{
+#if VPX_IMAGE_ABI_VERSION >= 3
+ static const enum AVColorSpace colorspaces[8] = {
+ AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, AVCOL_SPC_BT709, AVCOL_SPC_SMPTE170M,
+ AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, AVCOL_SPC_RGB,
+ };
+ avctx->colorspace = colorspaces[img->cs];
+#endif
if (avctx->codec_id == AV_CODEC_ID_VP8 && img->fmt != VPX_IMG_FMT_I420)
return AVERROR_INVALIDDATA;
switch (img->fmt) {
case VPX_IMG_FMT_I420:
+ if (avctx->codec_id == AV_CODEC_ID_VP9)
+ avctx->profile = FF_PROFILE_VP9_0;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
return 0;
#if CONFIG_LIBVPX_VP9_DECODER
case VPX_IMG_FMT_I422:
+ avctx->profile = FF_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
return 0;
#if VPX_IMAGE_ABI_VERSION >= 3
case VPX_IMG_FMT_I440:
+ avctx->profile = FF_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV440P;
return 0;
#endif
case VPX_IMG_FMT_I444:
+ avctx->profile = FF_PROFILE_VP9_1;
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+#endif
return 0;
#ifdef VPX_IMG_FMT_HIGHBITDEPTH
case VPX_IMG_FMT_I42016:
+ avctx->profile = FF_PROFILE_VP9_2;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P10LE;
return 0;
@@ -92,6 +110,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
return AVERROR_INVALIDDATA;
}
case VPX_IMG_FMT_I42216:
+ avctx->profile = FF_PROFILE_VP9_3;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10LE;
return 0;
@@ -103,6 +122,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
}
#if VPX_IMAGE_ABI_VERSION >= 3
case VPX_IMG_FMT_I44016:
+ avctx->profile = FF_PROFILE_VP9_3;
if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV440P10LE;
return 0;
@@ -114,11 +134,22 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
}
#endif
case VPX_IMG_FMT_I44416:
+ avctx->profile = FF_PROFILE_VP9_3;
if (img->bit_depth == 10) {
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP10LE : AV_PIX_FMT_YUV444P10LE;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV444P10LE;
+#endif
return 0;
} else if (img->bit_depth == 12) {
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP12LE : AV_PIX_FMT_YUV444P12LE;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV444P12LE;
+#endif
return 0;
} else {
return AVERROR_INVALIDDATA;
@@ -201,7 +232,7 @@ AVCodec ff_libvpx_vp8_decoder = {
.init = vp8_init,
.close = vp8_free,
.decode = vp8_decode,
- .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
};
#endif /* CONFIG_LIBVPX_VP8_DECODER */
@@ -211,6 +242,14 @@ static av_cold int vp9_init(AVCodecContext *avctx)
return vpx_init(avctx, &vpx_codec_vp9_dx_algo);
}
+static const AVProfile profiles[] = {
+ { FF_PROFILE_VP9_0, "Profile 0" },
+ { FF_PROFILE_VP9_1, "Profile 1" },
+ { FF_PROFILE_VP9_2, "Profile 2" },
+ { FF_PROFILE_VP9_3, "Profile 3" },
+ { FF_PROFILE_UNKNOWN },
+};
+
AVCodec ff_libvpx_vp9_decoder = {
.name = "libvpx-vp9",
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"),
@@ -220,7 +259,8 @@ AVCodec ff_libvpx_vp9_decoder = {
.init = vp9_init,
.close = vp8_free,
.decode = vp8_decode,
- .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
.init_static_data = ff_vp9_init_static,
+ .profiles = NULL_IF_CONFIG_SMALL(profiles),
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
index 28a0e14ea8a..5f397830871 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
@@ -128,6 +128,9 @@ static const char *const ctlidstr[] = {
[VP9E_SET_TILE_ROWS] = "VP9E_SET_TILE_ROWS",
[VP9E_SET_FRAME_PARALLEL_DECODING] = "VP9E_SET_FRAME_PARALLEL_DECODING",
[VP9E_SET_AQ_MODE] = "VP9E_SET_AQ_MODE",
+#if VPX_ENCODER_ABI_VERSION > 8
+ [VP9E_SET_COLOR_SPACE] = "VP9E_SET_COLOR_SPACE",
+#endif
#endif
};
@@ -262,7 +265,6 @@ static av_cold int vp8_free(AVCodecContext *avctx)
if (ctx->is_alpha)
vpx_codec_destroy(&ctx->encoder_alpha);
av_freep(&ctx->twopass_stats.buf);
- av_frame_free(&avctx->coded_frame);
av_freep(&avctx->stats_out);
free_frame_list(ctx->coded_frame_list);
return 0;
@@ -349,15 +351,38 @@ static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps,
av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format.\n");
return AVERROR_INVALIDDATA;
}
+
+#if VPX_ENCODER_ABI_VERSION > 8
+static void set_colorspace(AVCodecContext *avctx)
+{
+ enum vpx_color_space vpx_cs;
+
+ switch (avctx->colorspace) {
+ case AVCOL_SPC_RGB: vpx_cs = VPX_CS_SRGB; break;
+ case AVCOL_SPC_BT709: vpx_cs = VPX_CS_BT_709; break;
+ case AVCOL_SPC_UNSPECIFIED: vpx_cs = VPX_CS_UNKNOWN; break;
+ case AVCOL_SPC_RESERVED: vpx_cs = VPX_CS_RESERVED; break;
+ case AVCOL_SPC_BT470BG: vpx_cs = VPX_CS_BT_601; break;
+ case AVCOL_SPC_SMPTE170M: vpx_cs = VPX_CS_SMPTE_170; break;
+ case AVCOL_SPC_SMPTE240M: vpx_cs = VPX_CS_SMPTE_240; break;
+ case AVCOL_SPC_BT2020_NCL: vpx_cs = VPX_CS_BT_2020; break;
+ default:
+ av_log(avctx, AV_LOG_WARNING, "Unsupported colorspace (%d)\n",
+ avctx->colorspace);
+ return;
+ }
+ codecctl_int(avctx, VP9E_SET_COLOR_SPACE, vpx_cs);
+}
+#endif
#endif
static av_cold int vpx_init(AVCodecContext *avctx,
const struct vpx_codec_iface *iface)
{
VP8Context *ctx = avctx->priv_data;
- struct vpx_codec_enc_cfg enccfg;
+ struct vpx_codec_enc_cfg enccfg = { 0 };
struct vpx_codec_enc_cfg enccfg_alpha;
- vpx_codec_flags_t flags = (avctx->flags & CODEC_FLAG_PSNR) ? VPX_CODEC_USE_PSNR : 0;
+ vpx_codec_flags_t flags = (avctx->flags & AV_CODEC_FLAG_PSNR) ? VPX_CODEC_USE_PSNR : 0;
int res;
vpx_img_fmt_t img_fmt = VPX_IMG_FMT_I420;
#if CONFIG_LIBVPX_VP9_ENCODER
@@ -398,9 +423,9 @@ static av_cold int vpx_init(AVCodecContext *avctx,
enccfg.g_threads = avctx->thread_count;
enccfg.g_lag_in_frames= ctx->lag_in_frames;
- if (avctx->flags & CODEC_FLAG_PASS1)
+ if (avctx->flags & AV_CODEC_FLAG_PASS1)
enccfg.g_pass = VPX_RC_FIRST_PASS;
- else if (avctx->flags & CODEC_FLAG_PASS2)
+ else if (avctx->flags & AV_CODEC_FLAG_PASS2)
enccfg.g_pass = VPX_RC_LAST_PASS;
else
enccfg.g_pass = VPX_RC_ONE_PASS;
@@ -562,7 +587,8 @@ static av_cold int vpx_init(AVCodecContext *avctx,
codecctl_int(avctx, VP8E_SET_ARNR_STRENGTH, ctx->arnr_strength);
if (ctx->arnr_type >= 0)
codecctl_int(avctx, VP8E_SET_ARNR_TYPE, ctx->arnr_type);
- if (avctx->codec_id == AV_CODEC_ID_VP8) {
+
+ if (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8) {
codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS, av_log2(avctx->slices));
}
@@ -593,6 +619,9 @@ static av_cold int vpx_init(AVCodecContext *avctx,
codecctl_int(avctx, VP9E_SET_FRAME_PARALLEL_DECODING, ctx->frame_parallel);
if (ctx->aq_mode >= 0)
codecctl_int(avctx, VP9E_SET_AQ_MODE, ctx->aq_mode);
+#if VPX_ENCODER_ABI_VERSION > 8
+ set_colorspace(avctx);
+#endif
}
#endif
@@ -610,12 +639,6 @@ static av_cold int vpx_init(AVCodecContext *avctx,
vpx_img_wrap(&ctx->rawimg_alpha, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
(unsigned char*)1);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
- vp8_free(avctx);
- return AVERROR(ENOMEM);
- }
return 0;
}
@@ -662,31 +685,54 @@ static inline void cx_pktcpy(struct FrameListData *dst,
* @return a negative AVERROR on error
*/
static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
- AVPacket *pkt, AVFrame *coded_frame)
+ AVPacket *pkt)
{
- int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz);
+ int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0);
uint8_t *side_data;
if (ret >= 0) {
+ int pict_type;
memcpy(pkt->data, cx_frame->buf, pkt->size);
- pkt->pts = pkt->dts = cx_frame->pts;
- coded_frame->pts = cx_frame->pts;
- coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
+ pkt->pts = pkt->dts = cx_frame->pts;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pts = cx_frame->pts;
+ avctx->coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
- if (coded_frame->key_frame) {
- coded_frame->pict_type = AV_PICTURE_TYPE_I;
- pkt->flags |= AV_PKT_FLAG_KEY;
- } else
- coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {
+ pict_type = AV_PICTURE_TYPE_I;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ } else {
+ pict_type = AV_PICTURE_TYPE_P;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
+
+ ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
+ cx_frame->have_sse ? 3 : 0, pict_type);
if (cx_frame->have_sse) {
int i;
/* Beware of the Y/U/V/all order! */
- coded_frame->error[0] = cx_frame->sse[1];
- coded_frame->error[1] = cx_frame->sse[2];
- coded_frame->error[2] = cx_frame->sse[3];
- coded_frame->error[3] = 0; // alpha
- for (i = 0; i < 4; ++i) {
- avctx->error[i] += coded_frame->error[i];
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->error[0] = cx_frame->sse[1];
+ avctx->coded_frame->error[1] = cx_frame->sse[2];
+ avctx->coded_frame->error[2] = cx_frame->sse[3];
+ avctx->coded_frame->error[3] = 0; // alpha
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ for (i = 0; i < 3; ++i) {
+ avctx->error[i] += cx_frame->sse[i + 1];
}
cx_frame->have_sse = 0;
}
@@ -716,8 +762,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
* @return AVERROR(EINVAL) on output size error
* @return AVERROR(ENOMEM) on coded frame queue data allocation error
*/
-static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
- AVFrame *coded_frame)
+static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out)
{
VP8Context *ctx = avctx->priv_data;
const struct vpx_codec_cx_pkt *pkt;
@@ -729,7 +774,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
if (ctx->coded_frame_list) {
struct FrameListData *cx_frame = ctx->coded_frame_list;
/* return the leading frame if we've already begun queueing */
- size = storeframe(avctx, cx_frame, pkt_out, coded_frame);
+ size = storeframe(avctx, cx_frame, pkt_out);
if (size < 0)
return size;
ctx->coded_frame_list = cx_frame->next;
@@ -750,7 +795,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
provided a frame for output */
av_assert0(!ctx->coded_frame_list);
cx_pktcpy(&cx_frame, pkt, pkt_alpha, ctx);
- size = storeframe(avctx, &cx_frame, pkt_out, coded_frame);
+ size = storeframe(avctx, &cx_frame, pkt_out);
if (size < 0)
return size;
} else {
@@ -877,9 +922,9 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
}
}
- coded_size = queue_frames(avctx, pkt, avctx->coded_frame);
+ coded_size = queue_frames(avctx, pkt);
- if (!frame && avctx->flags & CODEC_FLAG_PASS1) {
+ if (!frame && avctx->flags & AV_CODEC_FLAG_PASS1) {
unsigned int b64_size = AV_BASE64_SIZE(ctx->twopass_stats.sz);
avctx->stats_out = av_malloc(b64_size);
@@ -940,9 +985,9 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
#define LEGACY_OPTIONS \
{"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE}, \
{"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
- {"vp8flags", "", offsetof(VP8Context, flags), FF_OPT_TYPE_FLAGS, {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
- {"error_resilient", "enable error resilience", 0, FF_OPT_TYPE_CONST, {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
- {"altref", "enable use of alternate reference frames (VP8/2-pass only)", 0, FF_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, "flags"}, \
+ {"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
+ {"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, {.i64 = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
+ {"altref", "enable use of alternate reference frames (VP8/2-pass only)", 0, AV_OPT_TYPE_CONST, {.i64 = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, "flags"}, \
{"arnr_max_frames", "altref noise reduction max frame count", offsetof(VP8Context, arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 15, VE}, \
{"arnr_strength", "altref noise reduction filter strength", offsetof(VP8Context, arnr_strength), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 6, VE}, \
{"arnr_type", "altref noise reduction filter type", offsetof(VP8Context, arnr_type), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 3, VE}, \
@@ -1006,7 +1051,7 @@ AVCodec ff_libvpx_vp8_encoder = {
.init = vp8_init,
.encode2 = vp8_encode,
.close = vp8_free,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE },
.priv_class = &class_vp8,
.defaults = defaults,
@@ -1026,6 +1071,14 @@ static const AVClass class_vp9 = {
.version = LIBAVUTIL_VERSION_INT,
};
+static const AVProfile profiles[] = {
+ { FF_PROFILE_VP9_0, "Profile 0" },
+ { FF_PROFILE_VP9_1, "Profile 1" },
+ { FF_PROFILE_VP9_2, "Profile 2" },
+ { FF_PROFILE_VP9_3, "Profile 3" },
+ { FF_PROFILE_UNKNOWN },
+};
+
AVCodec ff_libvpx_vp9_encoder = {
.name = "libvpx-vp9",
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"),
@@ -1035,7 +1088,8 @@ AVCodec ff_libvpx_vp9_encoder = {
.init = vp9_init,
.encode2 = vp8_encode,
.close = vp8_free,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
+ .profiles = NULL_IF_CONFIG_SMALL(profiles),
.priv_class = &class_vp9,
.defaults = defaults,
.init_static_data = ff_vp9_init_static,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libwavpackenc.c b/chromium/third_party/ffmpeg/libavcodec/libwavpackenc.c
index 77d98a214fd..6d5708985af 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libwavpackenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libwavpackenc.c
@@ -188,7 +188,7 @@ AVCodec ff_libwavpack_encoder = {
.init = wavpack_encode_init,
.encode2 = wavpack_encode_frame,
.close = wavpack_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c b/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c
index db96e1637b6..0bcf628e580 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libwebpenc.c
@@ -57,7 +57,7 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
goto end;
}
- ret = ff_alloc_packet(pkt, mw.size);
+ ret = ff_alloc_packet2(avctx, pkt, mw.size, mw.size);
if (ret < 0)
goto end;
memcpy(pkt->data, mw.mem, mw.size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/libwebpenc_animencoder.c b/chromium/third_party/ffmpeg/libavcodec/libwebpenc_animencoder.c
index e9582016d38..d7437a9a573 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libwebpenc_animencoder.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libwebpenc_animencoder.c
@@ -66,7 +66,7 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
WebPData assembled_data = { 0 };
ret = WebPAnimEncoderAssemble(s->enc, &assembled_data);
if (ret) {
- ret = ff_alloc_packet(pkt, assembled_data.size);
+ ret = ff_alloc_packet2(avctx, pkt, assembled_data.size, assembled_data.size);
if (ret < 0)
return ret;
memcpy(pkt->data, assembled_data.bytes, assembled_data.size);
@@ -139,7 +139,7 @@ AVCodec ff_libwebp_anim_encoder = {
.init = libwebp_anim_encode_init,
.encode2 = libwebp_anim_encode_frame,
.close = libwebp_anim_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB32,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx264.c b/chromium/third_party/ffmpeg/libavcodec/libx264.c
index 220d43e1d85..58fcfb0eed0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libx264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libx264.c
@@ -81,6 +81,8 @@ typedef struct X264Context {
char *stats;
int nal_hrd;
int avcintra_class;
+ int motion_est;
+ int forced_idr;
char *x264_params;
} X264Context;
@@ -113,7 +115,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
for (i = 0; i < nnal; i++)
size += nals[i].i_payload;
- if ((ret = ff_alloc_packet2(ctx, pkt, size)) < 0)
+ if ((ret = ff_alloc_packet2(ctx, pkt, size, 0)) < 0)
return ret;
p = pkt->data;
@@ -170,8 +172,7 @@ static void reconfig_encoder(AVCodecContext *ctx, const AVFrame *frame)
x4->params.b_tff = frame->top_field_first;
x264_encoder_reconfig(x4->enc, &x4->params);
}
- if (x4->params.vui.i_sar_height != ctx->sample_aspect_ratio.den ||
- x4->params.vui.i_sar_width != ctx->sample_aspect_ratio.num) {
+ if (x4->params.vui.i_sar_height*ctx->sample_aspect_ratio.num != ctx->sample_aspect_ratio.den * x4->params.vui.i_sar_width) {
x4->params.vui.i_sar_height = ctx->sample_aspect_ratio.den;
x4->params.vui.i_sar_width = ctx->sample_aspect_ratio.num;
x264_encoder_reconfig(x4->enc, &x4->params);
@@ -254,6 +255,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_nal_t *nal;
int nnal, i, ret;
x264_picture_t pic_out = {0};
+ int pict_type;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
@@ -269,7 +271,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x4->pic.i_pts = frame->pts;
x4->pic.i_type =
- frame->pict_type == AV_PICTURE_TYPE_I ? X264_TYPE_KEYFRAME :
+ frame->pict_type == AV_PICTURE_TYPE_I ?
+ (x4->forced_idr >= 0 ? X264_TYPE_IDR : X264_TYPE_KEYFRAME) :
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
X264_TYPE_AUTO;
@@ -288,23 +291,38 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
pkt->pts = pic_out.i_pts;
pkt->dts = pic_out.i_dts;
+
switch (pic_out.i_type) {
case X264_TYPE_IDR:
case X264_TYPE_I:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ pict_type = AV_PICTURE_TYPE_I;
break;
case X264_TYPE_P:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ pict_type = AV_PICTURE_TYPE_P;
break;
case X264_TYPE_B:
case X264_TYPE_BREF:
- ctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+ pict_type = AV_PICTURE_TYPE_B;
break;
+ default:
+ pict_type = AV_PICTURE_TYPE_NONE;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ ctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
- if (ret)
+ if (ret) {
+ ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
+
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
*got_packet = ret;
return 0;
@@ -322,8 +340,6 @@ static av_cold int X264_close(AVCodecContext *avctx)
x4->enc = NULL;
}
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -367,6 +383,9 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
case AV_PIX_FMT_NV12: return X264_CSP_NV12;
case AV_PIX_FMT_NV16:
case AV_PIX_FMT_NV20: return X264_CSP_NV16;
+#ifdef X264_CSP_NV21
+ case AV_PIX_FMT_NV21: return X264_CSP_NV21;
+#endif
};
return 0;
}
@@ -385,9 +404,15 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->global_quality > 0)
av_log(avctx, AV_LOG_WARNING, "-qscale is ignored, -crf is recommended.\n");
+#if CONFIG_LIBX262_ENCODER
+ if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+ x4->params.b_mpeg2 = 1;
+ x264_param_default_mpeg2(&x4->params);
+ } else
+#endif
x264_param_default(&x4->params);
- x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
+ x4->params.b_deblocking_filter = avctx->flags & AV_CODEC_FLAG_LOOP_FILTER;
if (x4->preset || x4->tune)
if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0) {
@@ -420,8 +445,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
}
x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
- x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
- if (avctx->flags & CODEC_FLAG_PASS2) {
+ x4->params.rc.b_stat_write = avctx->flags & AV_CODEC_FLAG_PASS1;
+ if (avctx->flags & AV_CODEC_FLAG_PASS2) {
x4->params.rc.b_stat_read = 1;
} else {
if (x4->crf >= 0) {
@@ -451,17 +476,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->chromaoffset)
x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
- if (avctx->me_method == ME_EPZS)
- x4->params.analyse.i_me_method = X264_ME_DIA;
- else if (avctx->me_method == ME_HEX)
- x4->params.analyse.i_me_method = X264_ME_HEX;
- else if (avctx->me_method == ME_UMH)
- x4->params.analyse.i_me_method = X264_ME_UMH;
- else if (avctx->me_method == ME_FULL)
- x4->params.analyse.i_me_method = X264_ME_ESA;
- else if (avctx->me_method == ME_TESA)
- x4->params.analyse.i_me_method = X264_ME_TESA;
-
if (avctx->gop_size >= 0)
x4->params.i_keyint_max = avctx->gop_size;
if (avctx->max_b_frames >= 0)
@@ -614,6 +628,25 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (x4->nal_hrd >= 0)
x4->params.i_nal_hrd = x4->nal_hrd;
+ if (x4->motion_est >= 0) {
+ x4->params.analyse.i_me_method = x4->motion_est;
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
+ } else {
+ if (avctx->me_method == ME_EPZS)
+ x4->params.analyse.i_me_method = X264_ME_DIA;
+ else if (avctx->me_method == ME_HEX)
+ x4->params.analyse.i_me_method = X264_ME_HEX;
+ else if (avctx->me_method == ME_UMH)
+ x4->params.analyse.i_me_method = X264_ME_UMH;
+ else if (avctx->me_method == ME_FULL)
+ x4->params.analyse.i_me_method = X264_ME_ESA;
+ else if (avctx->me_method == ME_TESA)
+ x4->params.analyse.i_me_method = X264_ME_TESA;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
+
if (x4->profile)
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
int i;
@@ -635,15 +668,15 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_fps_num = avctx->time_base.den;
x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
- x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
+ x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
x4->params.i_threads = avctx->thread_count;
if (avctx->thread_type)
x4->params.b_sliced_threads = avctx->thread_type == FF_THREAD_SLICE;
- x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
+ x4->params.b_interlaced = avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT;
- x4->params.b_open_gop = !(avctx->flags & CODEC_FLAG_CLOSED_GOP);
+ x4->params.b_open_gop = !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP);
x4->params.i_slice_count = avctx->slices;
@@ -659,7 +692,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->color_trc != AVCOL_TRC_UNSPECIFIED)
x4->params.vui.i_transfer = avctx->color_trc;
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;
if(x4->x264opts){
@@ -703,11 +736,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (!x4->enc)
return AVERROR_EXTERNAL;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
x264_nal_t *nal;
uint8_t *p;
int nnal, s, i;
@@ -746,6 +775,9 @@ static const enum AVPixelFormat pix_fmts_8bit[] = {
AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NV12,
AV_PIX_FMT_NV16,
+#ifdef X264_CSP_NV21
+ AV_PIX_FMT_NV21,
+#endif
AV_PIX_FMT_NONE
};
static const enum AVPixelFormat pix_fmts_9bit[] = {
@@ -785,7 +817,7 @@ static const AVOption options[] = {
{ "preset", "Set the encoding preset (cf. x264 --fullhelp)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE},
{ "tune", "Tune the encoding params (cf. x264 --fullhelp)", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
- { "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE},
+ { "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE},
{"level", "Specify level (as defined by Annex A)", OFFSET(level), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{"passlogfile", "Filename for 2 pass stats", OFFSET(stats), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{"wpredp", "Weighted prediction for P-frames", OFFSET(wpredp), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
@@ -839,24 +871,17 @@ static const AVOption options[] = {
{ "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
{ "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
{ "avcintra-class","AVC-Intra class 50/100/200", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , VE},
+ { "motion-est", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"},
+ { "dia", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "hex", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_HEX }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "umh", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_UMH }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "esa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_ESA }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "tesa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_TESA }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "forced-idr", "If forcing keyframes, force them as IDR frames.", OFFSET(forced_idr), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE },
{ "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ NULL },
};
-static const AVClass x264_class = {
- .class_name = "libx264",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVClass rgbclass = {
- .class_name = "libx264rgb",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
static const AVCodecDefault x264_defaults[] = {
{ "b", "0" },
{ "bf", "-1" },
@@ -875,7 +900,9 @@ static const AVCodecDefault x264_defaults[] = {
{ "trellis", "-1" },
{ "nr", "-1" },
{ "me_range", "-1" },
+#if FF_API_MOTION_EST
{ "me_method", "-1" },
+#endif
{ "subq", "-1" },
{ "b_strategy", "-1" },
{ "keyint_min", "-1" },
@@ -888,6 +915,21 @@ static const AVCodecDefault x264_defaults[] = {
{ NULL },
};
+#if CONFIG_LIBX264_ENCODER
+static const AVClass x264_class = {
+ .class_name = "libx264",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVClass rgbclass = {
+ .class_name = "libx264rgb",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_libx264_encoder = {
.name = "libx264",
.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
@@ -897,7 +939,7 @@ AVCodec ff_libx264_encoder = {
.init = X264_init,
.encode2 = X264_frame,
.close = X264_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.priv_class = &x264_class,
.defaults = x264_defaults,
.init_static_data = X264_init_static,
@@ -914,8 +956,35 @@ AVCodec ff_libx264rgb_encoder = {
.init = X264_init,
.encode2 = X264_frame,
.close = X264_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.priv_class = &rgbclass,
.defaults = x264_defaults,
.pix_fmts = pix_fmts_8bit_rgb,
};
+#endif
+
+#if CONFIG_LIBX262_ENCODER
+static const AVClass X262_class = {
+ .class_name = "libx262",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_libx262_encoder = {
+ .name = "libx262",
+ .long_name = NULL_IF_CONFIG_SMALL("libx262 MPEG2VIDEO"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .priv_data_size = sizeof(X264Context),
+ .init = X264_init,
+ .encode2 = X264_frame,
+ .close = X264_close,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
+ .priv_class = &X262_class,
+ .defaults = x264_defaults,
+ .pix_fmts = pix_fmts_8bit,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
+};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx265.c b/chromium/third_party/ffmpeg/libavcodec/libx265.c
index e9240f94910..a1770facb12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libx265.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libx265.c
@@ -66,8 +66,6 @@ static av_cold int libx265_encode_close(AVCodecContext *avctx)
{
libx265Context *ctx = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
-
ctx->api->param_free(ctx->params);
if (ctx->encoder)
@@ -80,7 +78,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
{
libx265Context *ctx = avctx->priv_data;
- ctx->api = x265_api_get(av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1);
+ ctx->api = x265_api_get(av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth);
if (!ctx->api)
ctx->api = x265_api_get(0);
@@ -92,12 +90,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR(ENOSYS);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
ctx->params = ctx->api->param_alloc();
if (!ctx->params) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate x265 param structure.\n");
@@ -127,7 +119,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
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 & CODEC_FLAG_PSNR);
+ ctx->params->bEnablePsnr = !!(avctx->flags & AV_CODEC_FLAG_PSNR);
if ((avctx->color_primaries <= AVCOL_PRI_BT2020 &&
avctx->color_primaries != AVCOL_PRI_UNSPECIFIED) ||
@@ -187,7 +179,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
ctx->params->rc.rateControlMode = X265_RC_ABR;
}
- if (!(avctx->flags & CODEC_FLAG_GLOBAL_HEADER))
+ if (!(avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER))
ctx->params->bRepeatHeaders = 1;
if (ctx->x265_opts) {
@@ -222,7 +214,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
x265_nal *nal;
int nnal;
@@ -233,7 +225,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->extradata = av_malloc(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
av_log(avctx, AV_LOG_ERROR,
"Cannot allocate HEVC header of size %d.\n", avctx->extradata_size);
@@ -269,7 +261,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
x265pic.pts = pic->pts;
- x265pic.bitDepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
+ x265pic.bitDepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
x265pic.sliceType = pic->pict_type == AV_PICTURE_TYPE_I ? X265_TYPE_I :
pic->pict_type == AV_PICTURE_TYPE_P ? X265_TYPE_P :
@@ -306,6 +298,8 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pkt->pts = x265pic_out.pts;
pkt->dts = x265pic_out.dts;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
switch (x265pic_out.sliceType) {
case X265_TYPE_IDR:
case X265_TYPE_I:
@@ -318,6 +312,8 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
break;
}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
*got_packet = 1;
return 0;
@@ -382,5 +378,5 @@ AVCodec ff_libx265_encoder = {
.priv_data_size = sizeof(libx265Context),
.priv_class = &class,
.defaults = x265_defaults,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libxavs.c b/chromium/third_party/ffmpeg/libavcodec/libxavs.c
index 30d1479836b..45b4dcb76fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libxavs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libxavs.c
@@ -53,6 +53,7 @@ typedef struct XavsContext {
int direct_pred;
int aud;
int fast_pskip;
+ int motion_est;
int mbtree;
int mixed_refs;
@@ -80,7 +81,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
{
XavsContext *x4 = ctx->priv_data;
uint8_t *p;
- int i, s, ret, size = x4->sei_size + FF_MIN_BUFFER_SIZE;
+ int i, s, ret, size = x4->sei_size + AV_INPUT_BUFFER_MIN_SIZE;
if (!nnal)
return 0;
@@ -88,7 +89,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
for (i = 0; i < nnal; i++)
size += nals[i].i_payload;
- if ((ret = ff_alloc_packet2(ctx, pkt, size)) < 0)
+ if ((ret = ff_alloc_packet2(ctx, pkt, size, 0)) < 0)
return ret;
p = pkt->data;
@@ -117,6 +118,7 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
xavs_nal_t *nal;
int nnal, i, ret;
xavs_picture_t pic_out;
+ int pict_type;
x4->pic.img.i_csp = XAVS_CSP_I420;
x4->pic.img.i_plane = 3;
@@ -143,7 +145,7 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
if (!ret) {
if (!frame && !(x4->end_of_stream)) {
- if ((ret = ff_alloc_packet2(avctx, pkt, 4)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, 4, 0)) < 0)
return ret;
pkt->data[0] = 0x0;
@@ -158,7 +160,11 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pts = pic_out.i_pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->pts = pic_out.i_pts;
if (avctx->has_b_frames) {
if (!x4->out_frame_count)
@@ -171,25 +177,42 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
switch (pic_out.i_type) {
case XAVS_TYPE_IDR:
case XAVS_TYPE_I:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ pict_type = AV_PICTURE_TYPE_I;
break;
case XAVS_TYPE_P:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ pict_type = AV_PICTURE_TYPE_P;
break;
case XAVS_TYPE_B:
case XAVS_TYPE_BREF:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+ pict_type = AV_PICTURE_TYPE_B;
break;
+ default:
+ pict_type = AV_PICTURE_TYPE_NONE;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
/* There is no IDR frame in AVS JiZhun */
/* Sequence header is used as a flag */
if (pic_out.i_type == XAVS_TYPE_I) {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->flags |= AV_PKT_FLAG_KEY;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
x4->out_frame_count++;
*got_packet = ret;
@@ -207,8 +230,6 @@ static av_cold int XAVS_close(AVCodecContext *avctx)
if (x4->enc)
xavs_encoder_close(x4->enc);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -228,8 +249,8 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
}
x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
- x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
- if (avctx->flags & CODEC_FLAG_PASS2) {
+ x4->params.rc.b_stat_write = avctx->flags & AV_CODEC_FLAG_PASS1;
+ if (avctx->flags & AV_CODEC_FLAG_PASS2) {
x4->params.rc.b_stat_read = 1;
} else {
if (x4->crf >= 0) {
@@ -249,6 +270,8 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
x4->params.analyse.i_direct_mv_pred = x4->direct_pred;
if (x4->fast_pskip >= 0)
x4->params.analyse.b_fast_pskip = x4->fast_pskip;
+ if (x4->motion_est >= 0)
+ x4->params.analyse.i_me_method = x4->motion_est;
if (x4->mixed_refs >= 0)
x4->params.analyse.b_mixed_references = x4->mixed_refs;
if (x4->b_bias != INT_MIN)
@@ -256,6 +279,32 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
if (x4->cplxblur >= 0)
x4->params.rc.f_complexity_blur = x4->cplxblur;
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (x4->motion_est < 0) {
+ switch (avctx->me_method) {
+ case ME_EPZS:
+ x4->params.analyse.i_me_method = XAVS_ME_DIA;
+ break;
+ case ME_HEX:
+ x4->params.analyse.i_me_method = XAVS_ME_HEX;
+ break;
+ case ME_UMH:
+ x4->params.analyse.i_me_method = XAVS_ME_UMH;
+ break;
+ case ME_FULL:
+ x4->params.analyse.i_me_method = XAVS_ME_ESA;
+ break;
+ case ME_TESA:
+ x4->params.analyse.i_me_method = XAVS_ME_TESA;
+ break;
+ default:
+ x4->params.analyse.i_me_method = XAVS_ME_HEX;
+ }
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
x4->params.i_bframe = avctx->max_b_frames;
/* cabac is not included in AVS JiZhun Profile */
x4->params.b_cabac = 0;
@@ -272,7 +321,7 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
x4->params.i_scenecut_threshold = avctx->scenechange_threshold;
- // x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER;
+ // x4->params.b_deblocking_filter = avctx->flags & AV_CODEC_FLAG_LOOP_FILTER;
x4->params.rc.i_qp_min = avctx->qmin;
x4->params.rc.i_qp_max = avctx->qmax;
@@ -292,32 +341,12 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
x4->params.i_fps_den = avctx->time_base.num;
x4->params.analyse.inter = XAVS_ANALYSE_I8x8 |XAVS_ANALYSE_PSUB16x16| XAVS_ANALYSE_BSUB16x16;
- switch (avctx->me_method) {
- case ME_EPZS:
- x4->params.analyse.i_me_method = XAVS_ME_DIA;
- break;
- case ME_HEX:
- x4->params.analyse.i_me_method = XAVS_ME_HEX;
- break;
- case ME_UMH:
- x4->params.analyse.i_me_method = XAVS_ME_UMH;
- break;
- case ME_FULL:
- x4->params.analyse.i_me_method = XAVS_ME_ESA;
- break;
- case ME_TESA:
- x4->params.analyse.i_me_method = XAVS_ME_TESA;
- break;
- default:
- x4->params.analyse.i_me_method = XAVS_ME_HEX;
- }
-
x4->params.analyse.i_me_range = avctx->me_range;
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
/* AVS P2 only enables 8x8 transform */
- x4->params.analyse.b_transform_8x8 = 1; //avctx->flags2 & CODEC_FLAG2_8X8DCT;
+ x4->params.analyse.b_transform_8x8 = 1; //avctx->flags2 & AV_CODEC_FLAG2_8X8DCT;
x4->params.analyse.i_trellis = avctx->trellis;
x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
@@ -327,7 +356,7 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
if (avctx->bit_rate > 0)
x4->params.rc.f_rate_tolerance =
- (float)avctx->bit_rate_tolerance/avctx->bit_rate;
+ (float)avctx->bit_rate_tolerance / avctx->bit_rate;
if ((avctx->rc_buffer_size) &&
(avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
@@ -342,12 +371,12 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
x4->params.rc.f_pb_factor = avctx->b_quant_factor;
x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
- x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
+ x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
x4->params.i_log_level = XAVS_LOG_DEBUG;
x4->params.i_threads = avctx->thread_count;
- x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
+ x4->params.b_interlaced = avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT;
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;
x4->enc = xavs_encoder_open(&x4->params);
@@ -357,13 +386,9 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
if (!(x4->pts_buffer = av_mallocz_array((avctx->max_b_frames+1), sizeof(*x4->pts_buffer))))
return AVERROR(ENOMEM);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
/* TAG: Do we have GLOBAL HEADER in AVS */
/* We Have PPS and SPS in AVS */
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER && 0) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER && 0) {
xavs_nal_t *nal;
int nnal, s, i, size;
uint8_t *p;
@@ -406,6 +431,13 @@ static const AVOption options[] = {
{ "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, VE},
{ "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE },
{ "fast-pskip", NULL, OFFSET(fast_pskip), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, VE},
+ { "motion-est", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, XAVS_ME_TESA, VE, "motion-est"},
+ { "dia", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_DIA }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "hex", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_HEX }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "umh", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_UMH }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "esa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_ESA }, INT_MIN, INT_MAX, VE, "motion-est" },
+ { "tesa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_TESA }, INT_MIN, INT_MAX, VE, "motion-est" },
+
{ NULL },
};
@@ -430,7 +462,7 @@ AVCodec ff_libxavs_encoder = {
.init = XAVS_init,
.encode2 = XAVS_frame,
.close = XAVS_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &xavs_class,
.defaults = xavs_defaults,
diff --git a/chromium/third_party/ffmpeg/libavcodec/libxvid.c b/chromium/third_party/ffmpeg/libavcodec/libxvid.c
index bd88326c06d..8cbeef2b396 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libxvid.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libxvid.c
@@ -77,6 +77,7 @@ struct xvid_context {
int ssim; /**< SSIM information display mode */
int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */
int gmc;
+ int me_quality; /**< Motion estimation quality. 0: fast 6: best. */
};
/**
@@ -381,37 +382,56 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
/* Bring in VOP flags from ffmpeg command-line */
x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */
- if (xvid_flags & CODEC_FLAG_4MV)
+ if (xvid_flags & AV_CODEC_FLAG_4MV)
x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */
if (avctx->trellis)
x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */
- if (xvid_flags & CODEC_FLAG_AC_PRED)
+ if (xvid_flags & AV_CODEC_FLAG_AC_PRED)
x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */
- if (xvid_flags & CODEC_FLAG_GRAY)
+ if (xvid_flags & AV_CODEC_FLAG_GRAY)
x->vop_flags |= XVID_VOP_GREYSCALE;
/* Decide which ME quality setting to use */
x->me_flags = 0;
- switch (avctx->me_method) {
- case ME_FULL: /* Quality 6 */
+ switch (x->me_quality) {
+ case 6:
+ case 5:
x->me_flags |= XVID_ME_EXTSEARCH16 |
XVID_ME_EXTSEARCH8;
-
- case ME_EPZS: /* Quality 4 */
+ case 4:
+ case 3:
x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 |
XVID_ME_HALFPELREFINE8 |
XVID_ME_CHROMA_PVOP |
XVID_ME_CHROMA_BVOP;
-
- case ME_LOG: /* Quality 2 */
- case ME_PHODS:
- case ME_X1:
+ case 2:
+ case 1:
x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 |
XVID_ME_HALFPELREFINE16;
-
- case ME_ZERO: /* Quality 0 */
- default:
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
break;
+ default:
+ switch (avctx->me_method) {
+ case ME_FULL: /* Quality 6 */
+ x->me_flags |= XVID_ME_EXTSEARCH16 |
+ XVID_ME_EXTSEARCH8;
+ case ME_EPZS: /* Quality 4 */
+ x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 |
+ XVID_ME_HALFPELREFINE8 |
+ XVID_ME_CHROMA_PVOP |
+ XVID_ME_CHROMA_BVOP;
+ case ME_LOG: /* Quality 2 */
+ case ME_PHODS:
+ case ME_X1:
+ x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 |
+ XVID_ME_HALFPELREFINE16;
+ case ME_ZERO: /* Quality 0 */
+ default:
+ break;
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
/* Decide how we should decide blocks */
@@ -442,7 +462,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
x->vol_flags |= XVID_VOL_GMC;
x->me_flags |= XVID_ME_GME_REFINE;
}
- if (xvid_flags & CODEC_FLAG_QPEL) {
+ if (xvid_flags & AV_CODEC_FLAG_QPEL) {
x->vol_flags |= XVID_VOL_QUARTERPEL;
x->me_flags |= XVID_ME_QUARTERPELREFINE16;
if (x->vop_flags & XVID_VOP_INTER4V)
@@ -494,7 +514,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
x->old_twopassbuffer = NULL;
x->twopassfile = NULL;
- if (xvid_flags & CODEC_FLAG_PASS1) {
+ if (xvid_flags & AV_CODEC_FLAG_PASS1) {
rc2pass1.version = XVID_VERSION;
rc2pass1.context = x;
x->twopassbuffer = av_malloc(BUFFER_SIZE);
@@ -510,7 +530,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
plugins[xvid_enc_create.num_plugins].func = xvid_ff_2pass;
plugins[xvid_enc_create.num_plugins].param = &rc2pass1;
xvid_enc_create.num_plugins++;
- } else if (xvid_flags & CODEC_FLAG_PASS2) {
+ } else if (xvid_flags & AV_CODEC_FLAG_PASS2) {
rc2pass2.version = XVID_VERSION;
rc2pass2.bitrate = avctx->bit_rate;
@@ -541,7 +561,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2;
plugins[xvid_enc_create.num_plugins].param = &rc2pass2;
xvid_enc_create.num_plugins++;
- } else if (!(xvid_flags & CODEC_FLAG_QSCALE)) {
+ } else if (!(xvid_flags & AV_CODEC_FLAG_QSCALE)) {
/* Single Pass Bitrate Control! */
single.version = XVID_VERSION;
single.bitrate = avctx->bit_rate;
@@ -600,7 +620,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
xvid_enc_create.max_key_interval = 240; /* Xvid's best default */
/* Quants */
- if (xvid_flags & CODEC_FLAG_QSCALE)
+ if (xvid_flags & AV_CODEC_FLAG_QSCALE)
x->qscale = 1;
else
x->qscale = 0;
@@ -646,13 +666,13 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
/* Misc Settings */
xvid_enc_create.frame_drop_ratio = 0;
xvid_enc_create.global = 0;
- if (xvid_flags & CODEC_FLAG_CLOSED_GOP)
+ if (xvid_flags & AV_CODEC_FLAG_CLOSED_GOP)
xvid_enc_create.global |= XVID_GLOBAL_CLOSED_GOP;
/* Determines which codec mode we are operating in */
avctx->extradata = NULL;
avctx->extradata_size = 0;
- if (xvid_flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (xvid_flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
/* In this case, we are claiming to be MPEG4 */
x->quicktime_format = 1;
avctx->codec_id = AV_CODEC_ID_MPEG4;
@@ -680,9 +700,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
}
x->encoder_handle = xvid_enc_create.handle;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
return 0;
}
@@ -692,7 +709,6 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
{
int xerr, i, ret, user_packet = !!pkt->data;
struct xvid_context *x = avctx->priv_data;
- AVFrame *p = avctx->coded_frame;
int mb_width = (avctx->width + 15) / 16;
int mb_height = (avctx->height + 15) / 16;
char *tmp;
@@ -700,7 +716,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
xvid_enc_frame_t xvid_enc_frame = { 0 };
xvid_enc_stats_t xvid_enc_stats = { 0 };
- if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*(int64_t)mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*(int64_t)mb_height*MAX_MB_BYTES + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
/* Start setting up the frame */
@@ -775,25 +791,45 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
if (xerr > 0) {
+ int pict_type;
+
*got_packet = 1;
- p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
if (xvid_enc_stats.type == XVID_TYPE_PVOP)
- p->pict_type = AV_PICTURE_TYPE_P;
+ pict_type = AV_PICTURE_TYPE_P;
else if (xvid_enc_stats.type == XVID_TYPE_BVOP)
- p->pict_type = AV_PICTURE_TYPE_B;
+ pict_type = AV_PICTURE_TYPE_B;
else if (xvid_enc_stats.type == XVID_TYPE_SVOP)
- p->pict_type = AV_PICTURE_TYPE_S;
+ pict_type = AV_PICTURE_TYPE_S;
else
- p->pict_type = AV_PICTURE_TYPE_I;
+ pict_type = AV_PICTURE_TYPE_I;
+
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = pict_type;
+ avctx->coded_frame->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ ff_side_data_set_encoder_stats(pkt, xvid_enc_stats.quant * FF_QP2LAMBDA, NULL, 0, pict_type);
+
if (xvid_enc_frame.out_flags & XVID_KEYFRAME) {
- p->key_frame = 1;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->flags |= AV_PKT_FLAG_KEY;
if (x->quicktime_format)
return xvid_strip_vol_header(avctx, pkt,
xvid_enc_stats.hlength, xerr);
- } else
- p->key_frame = 0;
+ } else {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->key_frame = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
pkt->size = xerr;
@@ -818,7 +854,6 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx)
x->encoder_handle = NULL;
}
- av_frame_free(&avctx->coded_frame);
av_freep(&avctx->extradata);
if (x->twopassbuffer) {
av_freep(&x->twopassbuffer);
@@ -848,6 +883,7 @@ static const AVOption options[] = {
{ "frame", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "ssim" },
{ "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE },
{ "gmc", "use GMC", OFFSET(gmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "me_quality", "Motion estimation quality", OFFSET(me_quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 6, VE },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c b/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
index 15c1a5de7ba..3733d885d63 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libzvbi-teletextdec.c
@@ -22,6 +22,7 @@
#include "libavcodec/ass.h"
#include "libavutil/opt.h"
#include "libavutil/bprint.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
@@ -274,7 +275,7 @@ static int gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_pa
b = VBI_B(page->color_map[ci]);
a = VBI_A(page->color_map[ci]);
((uint32_t *)sub_rect->pict.data[1])[ci] = RGBA(r, g, b, a);
- av_dlog(ctx, "palette %0x\n", ((uint32_t *)sub_rect->pict.data[1])[ci]);
+ ff_dlog(ctx, "palette %0x\n", ((uint32_t *)sub_rect->pict.data[1])[ci]);
}
((uint32_t *)sub_rect->pict.data[1])[cmax] = RGBA(0, 0, 0, 0);
sub_rect->type = SUBTITLE_BITMAP;
@@ -427,7 +428,7 @@ static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_si
if (data_identifier_is_teletext(*pkt->data)) {
if ((lines = slice_to_vbi_lines(ctx, pkt->data + 1, pkt->size - 1)) < 0)
return lines;
- av_dlog(avctx, "ctx=%p buf_size=%d lines=%u pkt_pts=%7.3f\n",
+ ff_dlog(avctx, "ctx=%p buf_size=%d lines=%u pkt_pts=%7.3f\n",
ctx, pkt->size, lines, (double)pkt->pts/90000.0);
if (lines > 0) {
#ifdef DEBUG
@@ -517,7 +518,7 @@ static int teletext_close_decoder(AVCodecContext *avctx)
{
TeletextContext *ctx = avctx->priv_data;
- av_dlog(avctx, "lines_total=%u\n", ctx->lines_processed);
+ ff_dlog(avctx, "lines_total=%u\n", ctx->lines_processed);
while (ctx->nb_pages)
subtitle_rect_free(&ctx->pages[--ctx->nb_pages].sub_rect);
av_freep(&ctx->pages);
@@ -565,7 +566,7 @@ AVCodec ff_libzvbi_teletext_decoder = {
.init = teletext_init_decoder,
.close = teletext_close_decoder,
.decode = teletext_decode_frame,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.flush = teletext_flush,
.priv_class= &teletext_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c b/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
index 8c0ebf5e085..5e478a31ec9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ljpegenc.c
@@ -48,8 +48,8 @@ typedef struct LJpegEncContext {
ScanTable scantable;
uint16_t matrix[64];
- int vsample[3];
- int hsample[3];
+ int vsample[4];
+ int hsample[4];
uint16_t huff_code_dc_luminance[12];
uint16_t huff_code_dc_chrominance[12];
@@ -68,22 +68,22 @@ static int ljpeg_encode_bgr(AVCodecContext *avctx, PutBitContext *pb,
const int linesize = frame->linesize[0];
uint16_t (*buffer)[4] = s->scratch;
const int predictor = avctx->prediction_method+1;
- int left[3], top[3], topleft[3];
+ int left[4], top[4], topleft[4];
int x, y, i;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 4; i++)
buffer[0][i] = 1 << (9 - 1);
for (y = 0; y < height; y++) {
const int modified_predictor = y ? predictor : 1;
uint8_t *ptr = frame->data[0] + (linesize * y);
- if (pb->buf_end - pb->buf - (put_bits_count(pb) >> 3) < width * 3 * 4) {
+ if (pb->buf_end - pb->buf - (put_bits_count(pb) >> 3) < width * 4 * 4) {
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 4; i++)
top[i]= left[i]= topleft[i]= buffer[0][i];
for (x = 0; x < width; x++) {
@@ -95,9 +95,11 @@ static int ljpeg_encode_bgr(AVCodecContext *avctx, PutBitContext *pb,
buffer[x][1] = ptr[4 * x + 0] - ptr[4 * x + 1] + 0x100;
buffer[x][2] = ptr[4 * x + 2] - ptr[4 * x + 1] + 0x100;
buffer[x][0] = (ptr[4 * x + 0] + 2 * ptr[4 * x + 1] + ptr[4 * x + 2]) >> 2;
+ if (avctx->pix_fmt == AV_PIX_FMT_BGRA)
+ buffer[x][3] = ptr[4 * x + 3];
}
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 3 + (avctx->pix_fmt == AV_PIX_FMT_BGRA); i++) {
int pred, diff;
PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
@@ -109,7 +111,7 @@ static int ljpeg_encode_bgr(AVCodecContext *avctx, PutBitContext *pb,
diff = ((left[i] - pred + 0x100) & 0x1FF) - 0x100;
- if (i == 0)
+ if (i == 0 || i == 3)
ff_mjpeg_encode_dc(pb, diff, s->huff_size_dc_luminance, s->huff_code_dc_luminance); //FIXME ugly
else
ff_mjpeg_encode_dc(pb, diff, s->huff_size_dc_chrominance, s->huff_code_dc_chrominance);
@@ -217,19 +219,20 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const int height = avctx->height;
const int mb_width = (width + s->hsample[0] - 1) / s->hsample[0];
const int mb_height = (height + s->vsample[0] - 1) / s->vsample[0];
- int max_pkt_size = FF_MIN_BUFFER_SIZE;
+ int max_pkt_size = AV_INPUT_BUFFER_MIN_SIZE;
int ret, header_bits;
if( avctx->pix_fmt == AV_PIX_FMT_BGR0
- || avctx->pix_fmt == AV_PIX_FMT_BGRA
|| avctx->pix_fmt == AV_PIX_FMT_BGR24)
max_pkt_size += width * height * 3 * 4;
+ else if(avctx->pix_fmt == AV_PIX_FMT_BGRA)
+ max_pkt_size += width * height * 4 * 4;
else {
max_pkt_size += mb_width * mb_height * 3 * 4
* s->hsample[0] * s->vsample[0];
}
- if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size, 0)) < 0)
return ret;
init_put_bits(&pb, pkt->data, pkt->size);
@@ -265,7 +268,6 @@ static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
{
LJpegEncContext *s = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
av_freep(&s->scratch);
return 0;
@@ -286,12 +288,12 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
if (!s->scratch)
@@ -327,7 +329,7 @@ AVCodec ff_ljpeg_encoder = {
.init = ljpeg_encode_init,
.encode2 = ljpeg_encode_frame,
.close = ljpeg_encode_close,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0,
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/loco.c b/chromium/third_party/ffmpeg/libavcodec/loco.c
index aea478d5631..9d0f144451f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/loco.c
+++ b/chromium/third_party/ffmpeg/libavcodec/loco.c
@@ -330,5 +330,5 @@ AVCodec ff_loco_decoder = {
.priv_data_size = sizeof(LOCOContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/lpc.c b/chromium/third_party/ffmpeg/libavcodec/lpc.c
index deb02e7f582..5cda7797e42 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lpc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/lpc.c
@@ -37,13 +37,19 @@ static void lpc_apply_welch_window_c(const int32_t *data, int len,
double w;
double c;
- /* The optimization in commit fa4ed8c does not support odd len.
- * If someone wants odd len extend that change. */
- av_assert2(!(len & 1));
-
n2 = (len >> 1);
c = 2.0 / (len - 1.0);
+ if (len & 1) {
+ for(i=0; i<n2; i++) {
+ w = c - i - 1.0;
+ w = 1.0 - (w * w);
+ w_data[i] = data[i] * w;
+ w_data[len-1-i] = data[len-1-i] * w;
+ }
+ return;
+ }
+
w_data+=n2;
data+=n2;
for(i=0; i<n2; i++) {
@@ -161,6 +167,26 @@ int ff_lpc_calc_ref_coefs(LPCContext *s,
return order;
}
+double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len,
+ int order, double *ref)
+{
+ int i;
+ double signal = 0.0f, avg_err = 0.0f;
+ double autoc[MAX_LPC_ORDER+1] = {0}, error[MAX_LPC_ORDER+1] = {0};
+ const double c = (len - 1)/2.0f;
+
+ /* Welch window */
+ for (i = 0; i < len; i++)
+ s->windowed_samples[i] = 1.0f - ((samples[i]-c)/c)*((samples[i]-c)/c);
+
+ s->lpc_compute_autocorr(s->windowed_samples, len, order, autoc);
+ signal = autoc[0];
+ compute_ref_coefs(autoc, order, ref, error);
+ for (i = 0; i < order; i++)
+ avg_err = (avg_err + error[i])/2.0f;
+ return signal/avg_err;
+}
+
/**
* Calculate LPC coefficients for multiple orders
*
diff --git a/chromium/third_party/ffmpeg/libavcodec/lpc.h b/chromium/third_party/ffmpeg/libavcodec/lpc.h
index 96acb371467..7e0ee3e1721 100644
--- a/chromium/third_party/ffmpeg/libavcodec/lpc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/lpc.h
@@ -25,6 +25,7 @@
#include <stdint.h>
#include "libavutil/avassert.h"
#include "libavutil/lls.h"
+#include "aac_defines.h"
#define ORDER_METHOD_EST 0
#define ORDER_METHOD_2LEVEL 1
@@ -99,6 +100,9 @@ int ff_lpc_calc_coefs(LPCContext *s,
int ff_lpc_calc_ref_coefs(LPCContext *s,
const int32_t *samples, int order, double *ref);
+double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len,
+ int order, double *ref);
+
/**
* Initialize LPCContext.
*/
@@ -111,11 +115,15 @@ void ff_lpc_init_x86(LPCContext *s);
*/
void ff_lpc_end(LPCContext *s);
+#if USE_FIXED
+#define LPC_TYPE int
+#else
#ifdef LPC_USE_DOUBLE
#define LPC_TYPE double
#else
#define LPC_TYPE float
#endif
+#endif // USE_FIXED
/**
* Schur recursion.
@@ -152,7 +160,7 @@ static inline void compute_ref_coefs(const LPC_TYPE *autoc, int max_order,
* Levinson-Durbin recursion.
* Produce LPC coefficients from autocorrelation data.
*/
-static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
+static inline int AAC_RENAME(compute_lpc_coefs)(const LPC_TYPE *autoc, int max_order,
LPC_TYPE *lpc, int lpc_stride, int fail,
int normalize)
{
@@ -169,14 +177,14 @@ static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
return -1;
for(i=0; i<max_order; i++) {
- LPC_TYPE r = -autoc[i];
+ LPC_TYPE r = AAC_SRA_R(-autoc[i], 5);
if (normalize) {
for(j=0; j<i; j++)
r -= lpc_last[j] * autoc[i-j-1];
r /= err;
- err *= 1.0 - (r * r);
+ err *= FIXR(1.0) - (r * r);
}
lpc[i] = r;
@@ -184,8 +192,8 @@ static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
for(j=0; j < (i+1)>>1; j++) {
LPC_TYPE f = lpc_last[ j];
LPC_TYPE b = lpc_last[i-1-j];
- lpc[ j] = f + r * b;
- lpc[i-1-j] = b + r * f;
+ lpc[ j] = f + AAC_MUL26(r, b);
+ lpc[i-1-j] = b + AAC_MUL26(r, f);
}
if (fail && err < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/lzf.c b/chromium/third_party/ffmpeg/libavcodec/lzf.c
new file mode 100644
index 00000000000..409a7ffdd39
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/lzf.c
@@ -0,0 +1,90 @@
+/*
+ * lzf decompression algorithm
+ * Copyright (c) 2015 Luca Barbato
+ *
+ * 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
+ * lzf decompression
+ *
+ * LZF is a fast compression/decompression algorithm that takes very little
+ * code space and working memory, ideal for real-time and block compression.
+ *
+ * https://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#LZF
+ */
+
+#include "libavutil/mem.h"
+
+#include "bytestream.h"
+#include "lzf.h"
+
+#define LZF_LITERAL_MAX (1 << 5)
+#define LZF_LONG_BACKREF 7 + 2
+
+int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
+{
+ int ret = 0;
+ uint8_t *p = *buf;
+ int64_t len = 0;
+
+ while (bytestream2_get_bytes_left(gb) > 2) {
+ uint8_t s = bytestream2_get_byte(gb);
+
+ if (s < LZF_LITERAL_MAX) {
+ s++;
+ if (s > *size - len) {
+ *size += *size /2;
+ ret = av_reallocp(buf, *size);
+ if (ret < 0)
+ return ret;
+ }
+
+ bytestream2_get_buffer(gb, p, s);
+ p += s;
+ len += s;
+ } else {
+ int l = 2 + (s >> 5);
+ int off = ((s & 0x1f) << 8) + 1;
+
+ if (l == LZF_LONG_BACKREF)
+ l += bytestream2_get_byte(gb);
+
+ off += bytestream2_get_byte(gb);
+
+ if (off > len)
+ return AVERROR_INVALIDDATA;
+
+ if (l > *size - len) {
+ *size += *size / 2;
+ ret = av_reallocp(buf, *size);
+ if (ret < 0)
+ return ret;
+ }
+
+ av_memcpy_backptr(p, off, l);
+
+ p += l;
+ len += l;
+ }
+ }
+
+ *size = len;
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/lzf.h b/chromium/third_party/ffmpeg/libavcodec/lzf.h
new file mode 100644
index 00000000000..0ad73d9f796
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/lzf.h
@@ -0,0 +1,29 @@
+/*
+ * lzf decompression algorithm
+ * Copyright (c) 2015 Luca Barbato
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_LZF_H
+#define AVCODEC_LZF_H
+
+#include "bytestream.h"
+
+int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size);
+
+#endif /* AVCODEC_LZF_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mace.c b/chromium/third_party/ffmpeg/libavcodec/mace.c
index 6eaa2966880..e332a72d6de 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mace.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mace.c
@@ -292,7 +292,7 @@ AVCodec ff_mace3_decoder = {
.priv_data_size = sizeof(MACEContext),
.init = mace_decode_init,
.decode = mace_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
@@ -305,7 +305,7 @@ AVCodec ff_mace6_decoder = {
.priv_data_size = sizeof(MACEContext),
.init = mace_decode_init,
.decode = mace_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mathops.h b/chromium/third_party/ffmpeg/libavcodec/mathops.h
index 46283ca444a..c065018f560 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mathops.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mathops.h
@@ -30,7 +30,6 @@
#define MAX_NEG_CROP 1024
extern const uint32_t ff_inverse[257];
-extern const uint8_t ff_reverse[256];
extern const uint8_t ff_sqrt_tab[256];
extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
extern const uint8_t ff_zigzag_direct[64];
diff --git a/chromium/third_party/ffmpeg/libavcodec/mathtables.c b/chromium/third_party/ffmpeg/libavcodec/mathtables.c
index a07ac50c08b..7b5efb88a65 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mathtables.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mathtables.c
@@ -71,25 +71,6 @@ const uint8_t ff_sqrt_tab[256]={
240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,255
};
-const uint8_t ff_reverse[256] = {
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-
#define times4(x) x, x, x, x
#define times256(x) times4(times4(times4(times4(times4(x)))))
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdct_template.c b/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
index 7fa8bcce569..e7e5f622f16 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdct_template.c
@@ -81,8 +81,13 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
scale = sqrt(fabs(scale));
for(i=0;i<n4;i++) {
alpha = 2 * M_PI * (i + theta) / n;
+#if FFT_FIXED_32
+ s->tcos[i*tstep] = (FFTSample)floor(-cos(alpha) * 2147483648.0 + 0.5);
+ s->tsin[i*tstep] = (FFTSample)floor(-sin(alpha) * 2147483648.0 + 0.5);
+#else
s->tcos[i*tstep] = FIX15(-cos(alpha) * scale);
s->tsin[i*tstep] = FIX15(-sin(alpha) * scale);
+#endif
}
return 0;
fail:
diff --git a/chromium/third_party/ffmpeg/libavcodec/mdec.c b/chromium/third_party/ffmpeg/libavcodec/mdec.c
index 5fd06f4aa60..ee966147720 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mdec.c
@@ -160,7 +160,7 @@ static inline void idct_put(MDECContext *a, AVFrame *frame, int mb_x, int mb_y)
a->idsp.idct_put(dest_y + 8 * linesize, linesize, block[2]);
a->idsp.idct_put(dest_y + 8 * linesize + 8, linesize, block[3]);
- if (!(a->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(a->avctx->flags & AV_CODEC_FLAG_GRAY)) {
a->idsp.idct_put(dest_cb, frame->linesize[1], block[4]);
a->idsp.idct_put(dest_cr, frame->linesize[2], block[5]);
}
@@ -262,6 +262,6 @@ AVCodec ff_mdec_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/me_cmp.c b/chromium/third_party/ffmpeg/libavcodec/me_cmp.c
index d4213d2759e..dc76b07ba29 100644
--- a/chromium/third_party/ffmpeg/libavcodec/me_cmp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/me_cmp.c
@@ -991,4 +991,6 @@ av_cold void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx)
ff_me_cmp_init_ppc(c, avctx);
if (ARCH_X86)
ff_me_cmp_init_x86(c, avctx);
+ if (ARCH_MIPS)
+ ff_me_cmp_init_mips(c, avctx);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/me_cmp.h b/chromium/third_party/ffmpeg/libavcodec/me_cmp.h
index 98ee53ce2ac..a3603ec2c1d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/me_cmp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/me_cmp.h
@@ -87,6 +87,7 @@ void ff_me_cmp_init_alpha(MECmpContext *c, AVCodecContext *avctx);
void ff_me_cmp_init_arm(MECmpContext *c, AVCodecContext *avctx);
void ff_me_cmp_init_ppc(MECmpContext *c, AVCodecContext *avctx);
void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx);
+void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx);
void ff_set_cmp(MECmpContext *c, me_cmp_func *cmp, int type);
diff --git a/chromium/third_party/ffmpeg/libavcodec/metasound.c b/chromium/third_party/ffmpeg/libavcodec/metasound.c
index 2dab135bdaa..5a7f4c3fa16 100644
--- a/chromium/third_party/ffmpeg/libavcodec/metasound.c
+++ b/chromium/third_party/ffmpeg/libavcodec/metasound.c
@@ -383,7 +383,7 @@ AVCodec ff_metasound_decoder = {
.init = metasound_decode_init,
.close = ff_twinvq_decode_close,
.decode = ff_twinvq_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/metasound_data.c b/chromium/third_party/ffmpeg/libavcodec/metasound_data.c
index e439b3d8376..6d87117406b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/metasound_data.c
+++ b/chromium/third_party/ffmpeg/libavcodec/metasound_data.c
@@ -14946,9 +14946,10 @@ static const uint16_t bark_tab_s16_128[] = {
2, 2, 2, 3, 3, 5, 7, 12, 25, 67
};
+/* unused
static const uint16_t bark_tab_s16_64[] = {
1, 1, 2, 2, 3, 6, 11, 38
-};
+}; */
static const uint16_t bark_tab_l16s_1024[] = {
9, 9, 8, 9, 10, 9, 10, 10,
diff --git a/chromium/third_party/ffmpeg/libavcodec/mimic.c b/chromium/third_party/ffmpeg/libavcodec/mimic.c
index 73f2a13de81..f5853b5c48f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mimic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mimic.c
@@ -479,7 +479,7 @@ AVCodec ff_mimic_decoder = {
.init = mimic_decode_init,
.close = mimic_decode_end,
.decode = mimic_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(mimic_init_thread_copy),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/Makefile b/chromium/third_party/ffmpeg/libavcodec/mips/Makefile
index 63c72981226..2e8b1ee4799 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/Makefile
@@ -20,11 +20,22 @@ MIPSDSPR1-OBJS-$(CONFIG_AAC_ENCODER) += mips/aaccoder_mips.o
MIPSFPU-OBJS-$(CONFIG_AAC_ENCODER) += mips/iirfilter_mips.o
OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o \
mips/hevcpred_init_mips.o
+OBJS-$(CONFIG_VP9_DECODER) += mips/vp9dsp_init_mips.o
+OBJS-$(CONFIG_VP8_DECODER) += mips/vp8dsp_init_mips.o
OBJS-$(CONFIG_H264DSP) += mips/h264dsp_init_mips.o
OBJS-$(CONFIG_H264QPEL) += mips/h264qpel_init_mips.o
OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_init_mips.o
OBJS-$(CONFIG_H264PRED) += mips/h264pred_init_mips.o
OBJS-$(CONFIG_H263DSP) += mips/h263dsp_init_mips.o
+OBJS-$(CONFIG_QPELDSP) += mips/qpeldsp_init_mips.o
+OBJS-$(CONFIG_HPELDSP) += mips/hpeldsp_init_mips.o
+OBJS-$(CONFIG_BLOCKDSP) += mips/blockdsp_init_mips.o
+OBJS-$(CONFIG_PIXBLOCKDSP) += mips/pixblockdsp_init_mips.o
+OBJS-$(CONFIG_IDCTDSP) += mips/idctdsp_init_mips.o
+OBJS-$(CONFIG_MPEGVIDEO) += mips/mpegvideo_init_mips.o
+OBJS-$(CONFIG_MPEGVIDEOENC) += mips/mpegvideoencdsp_init_mips.o
+OBJS-$(CONFIG_ME_CMP) += mips/me_cmp_init_mips.o
+OBJS-$(CONFIG_MPEG4_DECODER) += mips/xvididct_init_mips.o
MSA-OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_msa.o \
mips/hevc_mc_uni_msa.o \
mips/hevc_mc_uniw_msa.o \
@@ -33,11 +44,36 @@ MSA-OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_msa.o \
mips/hevc_idct_msa.o \
mips/hevc_lpf_sao_msa.o \
mips/hevcpred_msa.o
+MSA-OBJS-$(CONFIG_VP9_DECODER) += mips/vp9_mc_msa.o \
+ mips/vp9_lpf_msa.o \
+ mips/vp9_idct_msa.o \
+ mips/vp9_intra_msa.o
+MSA-OBJS-$(CONFIG_VP8_DECODER) += mips/vp8_mc_msa.o \
+ mips/vp8_idct_msa.o \
+ mips/vp8_lpf_msa.o
MSA-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_msa.o \
mips/h264idct_msa.o
MSA-OBJS-$(CONFIG_H264QPEL) += mips/h264qpel_msa.o
MSA-OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_msa.o
MSA-OBJS-$(CONFIG_H264PRED) += mips/h264pred_msa.o
MSA-OBJS-$(CONFIG_H263DSP) += mips/h263dsp_msa.o
-LOONGSON3-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o
-LOONGSON3-OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_mmi.o
+MSA-OBJS-$(CONFIG_QPELDSP) += mips/qpeldsp_msa.o
+MSA-OBJS-$(CONFIG_HPELDSP) += mips/hpeldsp_msa.o
+MSA-OBJS-$(CONFIG_BLOCKDSP) += mips/blockdsp_msa.o
+MSA-OBJS-$(CONFIG_PIXBLOCKDSP) += mips/pixblockdsp_msa.o
+MSA-OBJS-$(CONFIG_IDCTDSP) += mips/idctdsp_msa.o \
+ mips/simple_idct_msa.o
+MSA-OBJS-$(CONFIG_MPEGVIDEO) += mips/mpegvideo_msa.o
+MSA-OBJS-$(CONFIG_MPEGVIDEOENC) += mips/mpegvideoencdsp_msa.o
+MSA-OBJS-$(CONFIG_ME_CMP) += mips/me_cmp_msa.o
+MMI-OBJS += mips/constants.o
+MMI-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o
+MMI-OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_mmi.o
+MMI-OBJS-$(CONFIG_H264PRED) += mips/h264pred_mmi.o
+MMI-OBJS-$(CONFIG_MPEGVIDEO) += mips/mpegvideo_mmi.o
+MMI-OBJS-$(CONFIG_IDCTDSP) += mips/idctdsp_mmi.o \
+ mips/simple_idct_mmi.o
+MMI-OBJS-$(CONFIG_MPEG4_DECODER) += mips/xvid_idct_mmi.o
+MMI-OBJS-$(CONFIG_BLOCKDSP) += mips/blockdsp_mmi.o
+MMI-OBJS-$(CONFIG_PIXBLOCKDSP) += mips/pixblockdsp_mmi.o
+MMI-OBJS-$(CONFIG_H264QPEL) += mips/h264qpel_mmi.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/aaccoder_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/aaccoder_mips.c
index ea0bf3159ba..0f1216811bc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/aaccoder_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/aaccoder_mips.c
@@ -61,6 +61,7 @@
#include "libavcodec/put_bits.h"
#include "libavcodec/aac.h"
#include "libavcodec/aacenc.h"
+#include "libavcodec/aacenctab.h"
#include "libavcodec/aactab.h"
#if HAVE_INLINE_ASM
@@ -70,21 +71,6 @@ typedef struct BandCodingPath {
int run;
} BandCodingPath;
-static const uint8_t run_value_bits_long[64] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
-};
-
-static const uint8_t run_value_bits_short[16] = {
- 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
-};
-
-static const uint8_t * const run_value_bits[2] = {
- run_value_bits_long, run_value_bits_short
-};
-
static const uint8_t uquad_sign_bits[81] = {
0, 1, 1, 1, 2, 2, 1, 2, 2,
1, 2, 2, 2, 3, 3, 2, 3, 3,
@@ -144,6 +130,9 @@ static const uint8_t esc_sign_bits[289] = {
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
};
+#define ROUND_STANDARD 0.4054f
+#define ROUND_TO_ZERO 0.1054f
+
static void abs_pow34_v(float *out, const float *in, const int size) {
#ifndef USE_REALLY_FULL_SEARCH
int i;
@@ -204,10 +193,10 @@ static int find_min_book(float maxval, int sf) {
* Functions developed from template function and optimized for quantizing and encoding band
*/
static void quantize_and_encode_band_cost_SQUAD_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -223,10 +212,10 @@ static void quantize_and_encode_band_cost_SQUAD_mips(struct AACEncContext *s,
int *in_int = (int *)&in[i];
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -277,10 +266,10 @@ static void quantize_and_encode_band_cost_SQUAD_mips(struct AACEncContext *s,
}
static void quantize_and_encode_band_cost_UQUAD_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -298,10 +287,10 @@ static void quantize_and_encode_band_cost_UQUAD_mips(struct AACEncContext *s,
unsigned int v_codes;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -369,10 +358,10 @@ static void quantize_and_encode_band_cost_UQUAD_mips(struct AACEncContext *s,
}
static void quantize_and_encode_band_cost_SPAIR_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -390,10 +379,10 @@ static void quantize_and_encode_band_cost_SPAIR_mips(struct AACEncContext *s,
unsigned int v_codes;
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -448,10 +437,10 @@ static void quantize_and_encode_band_cost_SPAIR_mips(struct AACEncContext *s,
}
static void quantize_and_encode_band_cost_UPAIR7_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -469,10 +458,10 @@ static void quantize_and_encode_band_cost_UPAIR7_mips(struct AACEncContext *s,
unsigned int v_codes;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -542,10 +531,10 @@ static void quantize_and_encode_band_cost_UPAIR7_mips(struct AACEncContext *s,
}
static void quantize_and_encode_band_cost_UPAIR12_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -563,10 +552,10 @@ static void quantize_and_encode_band_cost_UPAIR12_mips(struct AACEncContext *s,
unsigned int v_codes;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -635,10 +624,10 @@ static void quantize_and_encode_band_cost_UPAIR12_mips(struct AACEncContext *s,
}
static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits)
+ int *bits, const float ROUNDING)
{
const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
int i;
@@ -659,10 +648,10 @@ static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
unsigned int v_codes;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUNDING;
+ qc2 = scaled[i+1] * Q34 + ROUNDING;
+ qc3 = scaled[i+2] * Q34 + ROUNDING;
+ qc4 = scaled[i+3] * Q34 + ROUNDING;
__asm__ volatile (
".set push \n\t"
@@ -736,10 +725,10 @@ static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
int c1, c2, c3, c4;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUNDING;
+ qc2 = scaled[i+1] * Q34 + ROUNDING;
+ qc3 = scaled[i+2] * Q34 + ROUNDING;
+ qc4 = scaled[i+3] * Q34 + ROUNDING;
__asm__ volatile (
".set push \n\t"
@@ -840,12 +829,38 @@ static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
}
}
+static void quantize_and_encode_band_cost_NONE_mips(struct AACEncContext *s,
+ PutBitContext *pb, const float *in, float *out,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits, const float ROUNDING) {
+ av_assert0(0);
+}
+
+static void quantize_and_encode_band_cost_ZERO_mips(struct AACEncContext *s,
+ PutBitContext *pb, const float *in, float *out,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits, const float ROUNDING) {
+ int i;
+ if (bits)
+ *bits = 0;
+ if (out) {
+ for (i = 0; i < size; i += 4) {
+ out[i ] = 0.0f;
+ out[i+1] = 0.0f;
+ out[i+2] = 0.0f;
+ out[i+3] = 0.0f;
+ }
+ }
+}
+
static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s,
- PutBitContext *pb, const float *in,
+ PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
- int *bits) = {
- NULL,
+ int *bits, const float ROUNDING) = {
+ quantize_and_encode_band_cost_ZERO_mips,
quantize_and_encode_band_cost_SQUAD_mips,
quantize_and_encode_band_cost_SQUAD_mips,
quantize_and_encode_band_cost_UQUAD_mips,
@@ -857,21 +872,25 @@ static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s
quantize_and_encode_band_cost_UPAIR12_mips,
quantize_and_encode_band_cost_UPAIR12_mips,
quantize_and_encode_band_cost_ESC_mips,
+ quantize_and_encode_band_cost_NONE_mips, /* cb 12 doesn't exist */
+ quantize_and_encode_band_cost_ZERO_mips,
+ quantize_and_encode_band_cost_ZERO_mips,
+ quantize_and_encode_band_cost_ZERO_mips,
};
-#define quantize_and_encode_band_cost( \
- s, pb, in, scaled, size, scale_idx, cb, \
- lambda, uplim, bits) \
- quantize_and_encode_band_cost_arr[cb]( \
- s, pb, in, scaled, size, scale_idx, cb, \
- lambda, uplim, bits)
+#define quantize_and_encode_band_cost( \
+ s, pb, in, out, scaled, size, scale_idx, cb, \
+ lambda, uplim, bits, ROUNDING) \
+ quantize_and_encode_band_cost_arr[cb]( \
+ s, pb, in, out, scaled, size, scale_idx, cb, \
+ lambda, uplim, bits, ROUNDING)
static void quantize_and_encode_band_mips(struct AACEncContext *s, PutBitContext *pb,
- const float *in, int size, int scale_idx,
- int cb, const float lambda)
+ const float *in, float *out, int size, int scale_idx,
+ int cb, const float lambda, int rtz)
{
- quantize_and_encode_band_cost(s, pb, in, NULL, size, scale_idx, cb, lambda,
- INFINITY, NULL);
+ quantize_and_encode_band_cost(s, pb, in, out, NULL, size, scale_idx, cb, lambda,
+ INFINITY, NULL, (rtz) ? ROUND_TO_ZERO : ROUND_STANDARD);
}
/**
@@ -886,6 +905,16 @@ static float get_band_numbits_ZERO_mips(struct AACEncContext *s,
return 0;
}
+static float get_band_numbits_NONE_mips(struct AACEncContext *s,
+ PutBitContext *pb, const float *in,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits)
+{
+ av_assert0(0);
+ return 0;
+}
+
static float get_band_numbits_SQUAD_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
@@ -904,10 +933,10 @@ static float get_band_numbits_SQUAD_mips(struct AACEncContext *s,
int *in_int = (int *)&in[i];
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -975,10 +1004,10 @@ static float get_band_numbits_UQUAD_mips(struct AACEncContext *s,
int curidx;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1034,10 +1063,10 @@ static float get_band_numbits_SPAIR_mips(struct AACEncContext *s,
int *in_int = (int *)&in[i];
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1107,10 +1136,10 @@ static float get_band_numbits_UPAIR7_mips(struct AACEncContext *s,
int curidx, curidx2;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1165,10 +1194,10 @@ static float get_band_numbits_UPAIR12_mips(struct AACEncContext *s,
int curidx, curidx2;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1225,10 +1254,10 @@ static float get_band_numbits_ESC_mips(struct AACEncContext *s,
int c1, c2, c3, c4;
int t4, t5;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1325,6 +1354,10 @@ static float (*const get_band_numbits_arr[])(struct AACEncContext *s,
get_band_numbits_UPAIR12_mips,
get_band_numbits_UPAIR12_mips,
get_band_numbits_ESC_mips,
+ get_band_numbits_NONE_mips, /* cb 12 doesn't exist */
+ get_band_numbits_ZERO_mips,
+ get_band_numbits_ZERO_mips,
+ get_band_numbits_ZERO_mips,
};
#define get_band_numbits( \
@@ -1366,6 +1399,16 @@ static float get_band_cost_ZERO_mips(struct AACEncContext *s,
return cost * lambda;
}
+static float get_band_cost_NONE_mips(struct AACEncContext *s,
+ PutBitContext *pb, const float *in,
+ const float *scaled, int size, int scale_idx,
+ int cb, const float lambda, const float uplim,
+ int *bits)
+{
+ av_assert0(0);
+ return 0;
+}
+
static float get_band_cost_SQUAD_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
@@ -1390,10 +1433,10 @@ static float get_band_cost_SQUAD_mips(struct AACEncContext *s,
float di0, di1, di2, di3;
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1502,10 +1545,10 @@ static float get_band_cost_UQUAD_mips(struct AACEncContext *s,
float di0, di1, di2, di3;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1605,10 +1648,10 @@ static float get_band_cost_SPAIR_mips(struct AACEncContext *s,
float di0, di1, di2, di3;
int t0, t1, t2, t3, t4, t5, t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1723,10 +1766,10 @@ static float get_band_cost_UPAIR7_mips(struct AACEncContext *s,
float di0, di1, di2, di3;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1857,10 +1900,10 @@ static float get_band_cost_UPAIR12_mips(struct AACEncContext *s,
float di0, di1, di2, di3;
int t0, t1, t2, t3, t4;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -1991,10 +2034,10 @@ static float get_band_cost_ESC_mips(struct AACEncContext *s,
int c1, c2, c3, c4;
int t6, t7;
- qc1 = scaled[i ] * Q34 + 0.4054f;
- qc2 = scaled[i+1] * Q34 + 0.4054f;
- qc3 = scaled[i+2] * Q34 + 0.4054f;
- qc4 = scaled[i+3] * Q34 + 0.4054f;
+ qc1 = scaled[i ] * Q34 + ROUND_STANDARD;
+ qc2 = scaled[i+1] * Q34 + ROUND_STANDARD;
+ qc3 = scaled[i+2] * Q34 + ROUND_STANDARD;
+ qc4 = scaled[i+3] * Q34 + ROUND_STANDARD;
__asm__ volatile (
".set push \n\t"
@@ -2116,6 +2159,10 @@ static float (*const get_band_cost_arr[])(struct AACEncContext *s,
get_band_cost_UPAIR12_mips,
get_band_cost_UPAIR12_mips,
get_band_cost_ESC_mips,
+ get_band_cost_NONE_mips, /* cb 12 doesn't exist */
+ get_band_cost_ZERO_mips,
+ get_band_cost_ZERO_mips,
+ get_band_cost_ZERO_mips,
};
#define get_band_cost( \
@@ -2139,22 +2186,27 @@ static void search_for_quantizers_twoloop_mips(AVCodecContext *avctx,
const float lambda)
{
int start = 0, i, w, w2, g;
- int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
- float dists[128] = { 0 }, uplims[128];
+ int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
+ float dists[128] = { 0 }, uplims[128] = { 0 };
float maxvals[128];
int fflag, minscaler;
int its = 0;
int allz = 0;
float minthr = INFINITY;
+ // for values above this the decoder might end up in an endless loop
+ // due to always having more bits than what can be encoded.
destbits = FFMIN(destbits, 5800);
+ //XXX: some heuristic to determine initial quantizers will reduce search time
+ //determine zero bands and upper limits
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
int nz = 0;
- float uplim = 0.0f;
+ float uplim = 0.0f, energy = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
- uplim += band->threshold;
+ uplim += band->threshold;
+ energy += band->energy;
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;
@@ -2191,9 +2243,12 @@ static void search_for_quantizers_twoloop_mips(AVCodecContext *avctx,
}
}
+ //perform two-loop search
+ //outer loop - improve quality
do {
int tbits, qstep;
minscaler = sce->sf_idx[0];
+ //inner loop - quantize spectrum to fit into given number of bits
qstep = its ? 1 : 32;
do {
int prev = -1;
@@ -2289,13 +2344,14 @@ static void search_for_quantizers_twoloop_mips(AVCodecContext *avctx,
fflag = 0;
minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF);
+
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
int prevsc = sce->sf_idx[w*16+g];
if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) {
if (find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1))
sce->sf_idx[w*16+g]--;
- else
+ else //Try to make sure there is some energy in every band
sce->sf_idx[w*16+g]-=2;
}
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF);
@@ -2309,17 +2365,18 @@ static void search_for_quantizers_twoloop_mips(AVCodecContext *avctx,
} while (fflag && its < 10);
}
-static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe,
- const float lambda)
+static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe)
{
int start = 0, i, w, w2, g;
float M[128], S[128];
float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
+ const float lambda = s->lambda;
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
if (!cpe->common_window)
return;
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
+ start = 0;
for (g = 0; g < sce0->ics.num_swb; g++) {
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
float dist1 = 0.0f, dist2 = 0.0f;
@@ -2347,17 +2404,17 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe,
S[i+3] = M[i+3]
- sce1->coeffs[start+w2*128+i+3];
}
- abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
- abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
+ abs_pow34_v(L34, sce0->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
+ abs_pow34_v(R34, sce1->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
abs_pow34_v(M34, M, sce0->ics.swb_sizes[g]);
abs_pow34_v(S34, S, sce0->ics.swb_sizes[g]);
- dist1 += quantize_band_cost(s, sce0->coeffs + start + w2*128,
+ dist1 += quantize_band_cost(s, &sce0->coeffs[start + (w+w2)*128],
L34,
sce0->ics.swb_sizes[g],
sce0->sf_idx[(w+w2)*16+g],
sce0->band_type[(w+w2)*16+g],
lambda / band0->threshold, INFINITY, NULL);
- dist1 += quantize_band_cost(s, sce1->coeffs + start + w2*128,
+ dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128],
R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[(w+w2)*16+g],
@@ -2387,7 +2444,7 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe,
static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
- BandCodingPath path[120][12];
+ BandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
@@ -2400,7 +2457,7 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
abs_pow34_v(s->scoefs, sce->coeffs, 1024);
start = win*128;
- for (cb = 0; cb < 12; cb++) {
+ for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[0][cb].cost = run_bits+4;
path[0][cb].prev_idx = -1;
path[0][cb].run = 0;
@@ -2424,7 +2481,7 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
}
next_minbits = path[swb+1][0].cost;
next_mincb = 0;
- for (cb = 1; cb < 12; cb++) {
+ for (cb = 1; cb < CB_TOT_ALL; cb++) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
@@ -2433,6 +2490,7 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
float minbits = next_minbits;
int mincb = next_mincb;
int startcb = sce->band_type[win*16+swb];
+ startcb = aac_cb_in_map[startcb];
next_minbits = INFINITY;
next_mincb = 0;
for (cb = 0; cb < startcb; cb++) {
@@ -2440,13 +2498,20 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
}
- for (cb = startcb; cb < 12; cb++) {
+ for (cb = startcb; cb < CB_TOT_ALL; cb++) {
float cost_stay_here, cost_get_here;
float bits = 0.0f;
+ if (cb >= 12 && sce->band_type[win*16+swb] != aac_cb_out_map[cb]) {
+ path[swb+1][cb].cost = 61450;
+ path[swb+1][cb].prev_idx = -1;
+ path[swb+1][cb].run = 0;
+ continue;
+ }
for (w = 0; w < group_len; w++) {
bits += quantize_band_cost_bits(s, sce->coeffs + start + w*128,
s->scoefs + start + w*128, size,
- sce->sf_idx[(win+w)*16+swb], cb,
+ sce->sf_idx[(win+w)*16+swb],
+ aac_cb_out_map[cb],
0, INFINITY, NULL);
}
cost_stay_here = path[swb][cb].cost + bits;
@@ -2472,9 +2537,10 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
start += sce->ics.swb_sizes[swb];
}
+ //convert resulting path from backward-linked list
stack_len = 0;
idx = 0;
- for (cb = 1; cb < 12; cb++)
+ for (cb = 1; cb < CB_TOT_ALL; cb++)
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
idx = cb;
ppos = max_sfb;
@@ -2487,14 +2553,16 @@ static void codebook_trellis_rate_mips(AACEncContext *s, SingleChannelElement *s
ppos -= path[ppos][cb].run;
stack_len++;
}
-
+ //perform actual band info encoding
start = 0;
for (i = stack_len - 1; i >= 0; i--) {
- put_bits(&s->pb, 4, stackcb[i]);
+ cb = aac_cb_out_map[stackcb[i]];
+ put_bits(&s->pb, 4, cb);
count = stackrun[i];
- memset(sce->zeroes + win*16 + start, !stackcb[i], count);
+ memset(sce->zeroes + win*16 + start, !cb, count);
+ //XXX: memset when band_type is also uint8_t
for (j = 0; j < count; j++) {
- sce->band_type[win*16 + start] = stackcb[i];
+ sce->band_type[win*16 + start] = cb;
start++;
}
while (count >= run_esc) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/aacsbr_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/aacsbr_mips.h
index e525197a401..da8389f484a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/aacsbr_mips.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/aacsbr_mips.h
@@ -149,7 +149,7 @@ static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, FFTContext *mdct,
}
}
-#if (HAVE_MIPSFPU && !HAVE_LOONGSON3)
+#if HAVE_MIPSFPU
static void sbr_qmf_synthesis_mips(FFTContext *mdct,
SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
float *out, float X[2][38][64],
@@ -488,7 +488,7 @@ static void sbr_qmf_synthesis_mips(FFTContext *mdct,
#define sbr_qmf_analysis sbr_qmf_analysis_mips
#define sbr_qmf_synthesis sbr_qmf_synthesis_mips
-#endif /* (HAVE_MIPSFPU && !HAVE_LOONGSON3) */
+#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
#endif /* AVCODEC_MIPS_AACSBR_FLOAT_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_init_mips.c
new file mode 100644
index 00000000000..22786130095
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_init_mips.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (parag.salasakar@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "blockdsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void blockdsp_init_msa(BlockDSPContext *c,
+ unsigned high_bit_depth)
+{
+ c->clear_block = ff_clear_block_msa;
+ c->clear_blocks = ff_clear_blocks_msa;
+
+ c->fill_block_tab[0] = ff_fill_block16_msa;
+ c->fill_block_tab[1] = ff_fill_block8_msa;
+}
+#endif // #if HAVE_MSA
+
+#if HAVE_MMI
+static av_cold void blockdsp_init_mmi(BlockDSPContext *c,
+ unsigned high_bit_depth)
+{
+ c->clear_block = ff_clear_block_mmi;
+ c->clear_blocks = ff_clear_blocks_mmi;
+
+ c->fill_block_tab[0] = ff_fill_block16_mmi;
+ c->fill_block_tab[1] = ff_fill_block8_mmi;
+}
+#endif /* HAVE_MMI */
+
+void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth)
+{
+#if HAVE_MSA
+ blockdsp_init_msa(c, high_bit_depth);
+#endif // #if HAVE_MSA
+#if HAVE_MMI
+ blockdsp_init_mmi(c, high_bit_depth);
+#endif /* HAVE_MMI */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mips.h
new file mode 100644
index 00000000000..9559d40eaa3
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mips.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (parag.salasakar@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_BLOCKDSP_MIPS_H
+#define AVCODEC_MIPS_BLOCKDSP_MIPS_H
+
+#include "../mpegvideo.h"
+
+void ff_fill_block16_msa(uint8_t *src, uint8_t val, int stride, int height);
+void ff_fill_block8_msa(uint8_t *src, uint8_t val, int stride, int height);
+void ff_clear_block_msa(int16_t *block);
+void ff_clear_blocks_msa(int16_t *block);
+
+void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int line_size, int h);
+void ff_fill_block8_mmi(uint8_t *block, uint8_t value, int line_size, int h);
+void ff_clear_block_mmi(int16_t *block);
+void ff_clear_blocks_mmi(int16_t *block);
+
+#endif // #ifndef AVCODEC_MIPS_BLOCKDSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mmi.c
new file mode 100644
index 00000000000..63eaf69a893
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_mmi.c
@@ -0,0 +1,147 @@
+/*
+ * Loongson SIMD optimized blockdsp
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "blockdsp_mips.h"
+
+void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int line_size, int h)
+{
+ __asm__ volatile (
+ "move $8, %3 \r\n"
+ "move $9, %0 \r\n"
+ "dmtc1 %1, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "1: \r\n"
+ "gssdlc1 $f2, 7($9) \r\n"
+ "gssdrc1 $f2, 0($9) \r\n"
+ "gssdlc1 $f2, 15($9) \r\n"
+ "gssdrc1 $f2, 8($9) \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "daddu $9, $9, %2 \r\n"
+ "bnez $8, 1b \r\n"
+ ::"r"(block),"r"(value),"r"(line_size),"r"(h)
+ : "$8","$9"
+ );
+}
+
+void ff_fill_block8_mmi(uint8_t *block, uint8_t value, int line_size, int h)
+{
+ __asm__ volatile (
+ "move $8, %3 \r\n"
+ "move $9, %0 \r\n"
+ "dmtc1 %1, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "punpcklbh $f2, $f2, $f2 \r\n"
+ "1: \r\n"
+ "gssdlc1 $f2, 7($9) \r\n"
+ "gssdrc1 $f2, 0($9) \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "daddu $9, $9, %2 \r\n"
+ "bnez $8, 1b \r\n"
+ ::"r"(block),"r"(value),"r"(line_size),"r"(h)
+ : "$8","$9"
+ );
+}
+
+void ff_clear_block_mmi(int16_t *block)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "gssqc1 $f0, $f2, 0(%0) \r\n"
+ "gssqc1 $f0, $f2, 16(%0) \r\n"
+ "gssqc1 $f0, $f2, 32(%0) \r\n"
+ "gssqc1 $f0, $f2, 48(%0) \r\n"
+ "gssqc1 $f0, $f2, 64(%0) \r\n"
+ "gssqc1 $f0, $f2, 80(%0) \r\n"
+ "gssqc1 $f0, $f2, 96(%0) \r\n"
+ "gssqc1 $f0, $f2, 112(%0) \r\n"
+ ::"r"(block)
+ : "memory"
+ );
+}
+
+void ff_clear_blocks_mmi(int16_t *block)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "gssqc1 $f0, $f2, 0(%0) \r\n"
+ "gssqc1 $f0, $f2, 16(%0) \r\n"
+ "gssqc1 $f0, $f2, 32(%0) \r\n"
+ "gssqc1 $f0, $f2, 48(%0) \r\n"
+ "gssqc1 $f0, $f2, 64(%0) \r\n"
+ "gssqc1 $f0, $f2, 80(%0) \r\n"
+ "gssqc1 $f0, $f2, 96(%0) \r\n"
+ "gssqc1 $f0, $f2, 112(%0) \r\n"
+
+ "gssqc1 $f0, $f2, 128(%0) \r\n"
+ "gssqc1 $f0, $f2, 144(%0) \r\n"
+ "gssqc1 $f0, $f2, 160(%0) \r\n"
+ "gssqc1 $f0, $f2, 176(%0) \r\n"
+ "gssqc1 $f0, $f2, 192(%0) \r\n"
+ "gssqc1 $f0, $f2, 208(%0) \r\n"
+ "gssqc1 $f0, $f2, 224(%0) \r\n"
+ "gssqc1 $f0, $f2, 240(%0) \r\n"
+
+ "gssqc1 $f0, $f2, 256(%0) \r\n"
+ "gssqc1 $f0, $f2, 272(%0) \r\n"
+ "gssqc1 $f0, $f2, 288(%0) \r\n"
+ "gssqc1 $f0, $f2, 304(%0) \r\n"
+ "gssqc1 $f0, $f2, 320(%0) \r\n"
+ "gssqc1 $f0, $f2, 336(%0) \r\n"
+ "gssqc1 $f0, $f2, 352(%0) \r\n"
+ "gssqc1 $f0, $f2, 368(%0) \r\n"
+
+ "gssqc1 $f0, $f2, 384(%0) \r\n"
+ "gssqc1 $f0, $f2, 400(%0) \r\n"
+ "gssqc1 $f0, $f2, 416(%0) \r\n"
+ "gssqc1 $f0, $f2, 432(%0) \r\n"
+ "gssqc1 $f0, $f2, 448(%0) \r\n"
+ "gssqc1 $f0, $f2, 464(%0) \r\n"
+ "gssqc1 $f0, $f2, 480(%0) \r\n"
+ "gssqc1 $f0, $f2, 496(%0) \r\n"
+
+ "gssqc1 $f0, $f2, 512(%0) \r\n"
+ "gssqc1 $f0, $f2, 528(%0) \r\n"
+ "gssqc1 $f0, $f2, 544(%0) \r\n"
+ "gssqc1 $f0, $f2, 560(%0) \r\n"
+ "gssqc1 $f0, $f2, 576(%0) \r\n"
+ "gssqc1 $f0, $f2, 592(%0) \r\n"
+ "gssqc1 $f0, $f2, 608(%0) \r\n"
+ "gssqc1 $f0, $f2, 624(%0) \r\n"
+
+ "gssqc1 $f0, $f2, 640(%0) \r\n"
+ "gssqc1 $f0, $f2, 656(%0) \r\n"
+ "gssqc1 $f0, $f2, 672(%0) \r\n"
+ "gssqc1 $f0, $f2, 688(%0) \r\n"
+ "gssqc1 $f0, $f2, 704(%0) \r\n"
+ "gssqc1 $f0, $f2, 720(%0) \r\n"
+ "gssqc1 $f0, $f2, 736(%0) \r\n"
+ "gssqc1 $f0, $f2, 752(%0) \r\n"
+ ::"r"(block)
+ : "memory"
+ );
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_msa.c
new file mode 100644
index 00000000000..32ac858e1dc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/blockdsp_msa.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (parag.salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "blockdsp_mips.h"
+
+static void copy_8bit_value_width8_msa(uint8_t *src, uint8_t val,
+ int32_t src_stride, int32_t height)
+{
+ int32_t cnt;
+ uint64_t dst0;
+ v16u8 val0;
+
+ val0 = (v16u8) __msa_fill_b(val);
+ dst0 = __msa_copy_u_d((v2i64) val0, 0);
+
+ for (cnt = (height >> 2); cnt--;) {
+ SD4(dst0, dst0, dst0, dst0, src, src_stride);
+ src += (4 * src_stride);
+ }
+}
+
+static void copy_8bit_value_width16_msa(uint8_t *src, uint8_t val,
+ int32_t src_stride, int32_t height)
+{
+ int32_t cnt;
+ v16u8 val0;
+
+ val0 = (v16u8) __msa_fill_b(val);
+
+ for (cnt = (height >> 3); cnt--;) {
+ ST_UB8(val0, val0, val0, val0, val0, val0, val0, val0, src, src_stride);
+ src += (8 * src_stride);
+ }
+}
+
+static void memset_zero_16width_msa(uint8_t *src, int32_t stride,
+ int32_t height)
+{
+ int8_t cnt;
+ v16u8 zero = { 0 };
+
+ for (cnt = (height / 2); cnt--;) {
+ ST_UB(zero, src);
+ src += stride;
+ ST_UB(zero, src);
+ src += stride;
+ }
+}
+
+void ff_fill_block16_msa(uint8_t *src, uint8_t val, int stride, int height)
+{
+ copy_8bit_value_width16_msa(src, val, stride, height);
+}
+
+void ff_fill_block8_msa(uint8_t *src, uint8_t val, int stride, int height)
+{
+ copy_8bit_value_width8_msa(src, val, stride, height);
+}
+
+void ff_clear_block_msa(int16_t *block)
+{
+ memset_zero_16width_msa((uint8_t *) block, 16, 8);
+}
+
+void ff_clear_blocks_msa(int16_t *block)
+{
+ memset_zero_16width_msa((uint8_t *) block, 16, 8 * 6);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/constants.c b/chromium/third_party/ffmpeg/libavcodec/mips/constants.c
new file mode 100644
index 00000000000..f8130d9ee15
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/constants.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/mem.h"
+#include "constants.h"
+
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_1) = {0x0001000100010001ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_3) = {0x0003000300030003ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_4) = {0x0004000400040004ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_5) = {0x0005000500050005ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_8) = {0x0008000800080008ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_9) = {0x0009000900090009ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_10) = {0x000A000A000A000AULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_16) = {0x0010001000100010ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_18) = {0x0012001200120012ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_20) = {0x0014001400140014ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_28) = {0x001C001C001C001CULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_32) = {0x0020002000200020ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_53) = {0x0035003500350035ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_64) = {0x0040004000400040ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_128) = {0x0080008000800080ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_512) = {0x0200020002000200ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_m8tom5) = {0xFFFBFFFAFFF9FFF8ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_m4tom1) = {0xFFFFFFFEFFFDFFFCULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_1to4) = {0x0004000300020001ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_5to8) = {0x0008000700060005ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_0to3) = {0x0003000200010000ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_4to7) = {0x0007000600050004ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_8tob) = {0x000b000a00090008ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pw_ctof) = {0x000f000e000d000cULL};
+
+DECLARE_ALIGNED(8, const uint64_t, ff_pb_1) = {0x0101010101010101ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pb_3) = {0x0303030303030303ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pb_80) = {0x8080808080808080ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pb_A1) = {0xA1A1A1A1A1A1A1A1ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_pb_FE) = {0xFEFEFEFEFEFEFEFEULL};
+
+DECLARE_ALIGNED(8, const uint64_t, ff_rnd) = {0x0004000400040004ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_rnd2) = {0x0040004000400040ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_rnd3) = {0x0020002000200020ULL};
+
+DECLARE_ALIGNED(8, const uint64_t, ff_wm1010) = {0xFFFF0000FFFF0000ULL};
+DECLARE_ALIGNED(8, const uint64_t, ff_d40000) = {0x0000000000040000ULL};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/constants.h b/chromium/third_party/ffmpeg/libavcodec/mips/constants.h
new file mode 100644
index 00000000000..0a4effdaa95
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/constants.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_CONSTANTS_H
+#define AVCODEC_MIPS_CONSTANTS_H
+
+#include <stdint.h>
+
+extern const uint64_t ff_pw_1;
+extern const uint64_t ff_pw_3;
+extern const uint64_t ff_pw_4;
+extern const uint64_t ff_pw_5;
+extern const uint64_t ff_pw_8;
+extern const uint64_t ff_pw_9;
+extern const uint64_t ff_pw_10;
+extern const uint64_t ff_pw_16;
+extern const uint64_t ff_pw_18;
+extern const uint64_t ff_pw_20;
+extern const uint64_t ff_pw_28;
+extern const uint64_t ff_pw_32;
+extern const uint64_t ff_pw_53;
+extern const uint64_t ff_pw_64;
+extern const uint64_t ff_pw_128;
+extern const uint64_t ff_pw_512;
+extern const uint64_t ff_pw_m8tom5;
+extern const uint64_t ff_pw_m4tom1;
+extern const uint64_t ff_pw_1to4;
+extern const uint64_t ff_pw_5to8;
+extern const uint64_t ff_pw_0to3;
+extern const uint64_t ff_pw_4to7;
+extern const uint64_t ff_pw_8tob;
+extern const uint64_t ff_pw_ctof;
+
+extern const uint64_t ff_pb_1;
+extern const uint64_t ff_pb_3;
+extern const uint64_t ff_pb_80;
+extern const uint64_t ff_pb_A1;
+extern const uint64_t ff_pb_FE;
+
+extern const uint64_t ff_rnd;
+extern const uint64_t ff_rnd2;
+extern const uint64_t ff_rnd3;
+
+extern const uint64_t ff_wm1010;
+extern const uint64_t ff_d40000;
+
+#endif /* AVCODEC_MIPS_CONSTANTS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264chroma_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264chroma_init_mips.c
index 1cc57674b3d..122148dc78c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264chroma_init_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264chroma_init_mips.c
@@ -38,7 +38,7 @@ static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth)
}
#endif // #if HAVE_MSA
-#if HAVE_LOONGSON3
+#if HAVE_MMI
static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
{
int high_bit_depth = bit_depth > 8;
@@ -50,14 +50,14 @@ static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmi;
}
}
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth)
{
#if HAVE_MSA
h264chroma_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
-#if HAVE_LOONGSON3
+#if HAVE_MMI
h264chroma_init_mmi(c, bit_depth);
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_init_mips.c
index 7f74adf5917..1fe7f8468c5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_init_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_init_mips.c
@@ -81,12 +81,34 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c,
}
#endif // #if HAVE_MSA
-#if HAVE_LOONGSON3
-static av_cold void h264dsp_init_mmi(H264DSPContext * c,
- const int bit_depth,
- const int chroma_format_idc)
+#if HAVE_MMI
+static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
+ const int chroma_format_idc)
{
if (bit_depth == 8) {
+ c->h264_add_pixels4_clear = ff_h264_add_pixels4_8_mmi;
+ c->h264_idct_add = ff_h264_idct_add_8_mmi;
+ c->h264_idct8_add = ff_h264_idct8_add_8_mmi;
+ c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmi;
+ c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmi;
+ c->h264_idct_add16 = ff_h264_idct_add16_8_mmi;
+ c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmi;
+ c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmi;
+
+ if (chroma_format_idc <= 1)
+ c->h264_idct_add8 = ff_h264_idct_add8_8_mmi;
+ else
+ c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmi;
+
+ c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_8_mmi;
+
+ if (chroma_format_idc <= 1)
+ c->h264_chroma_dc_dequant_idct =
+ ff_h264_chroma_dc_dequant_idct_8_mmi;
+ else
+ c->h264_chroma_dc_dequant_idct =
+ ff_h264_chroma422_dc_dequant_idct_8_mmi;
+
c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi;
c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi;
c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi;
@@ -94,9 +116,24 @@ static av_cold void h264dsp_init_mmi(H264DSPContext * c,
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi;
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
+
+ c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmi;
+ c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmi;
+
+ if (chroma_format_idc <= 1) {
+ c->h264_h_loop_filter_chroma =
+ ff_deblock_h_chroma_8_mmi;
+ c->h264_h_loop_filter_chroma_intra =
+ ff_deblock_h_chroma_intra_8_mmi;
+ }
+
+ c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmi;
+ c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmi;
+ c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmi;
+ c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmi;
}
}
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
@@ -104,7 +141,7 @@ av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
#if HAVE_MSA
h264dsp_init_msa(c, bit_depth, chroma_format_idc);
#endif // #if HAVE_MSA
-#if HAVE_LOONGSON3
+#if HAVE_MMI
h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
-#endif /* HAVE_LOONGSON3 */
+#endif /* HAVE_MMI */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mips.h
index 0bc5dde6964..3fdbf4fb5e0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mips.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mips.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
*
* This file is part of FFmpeg.
*
@@ -22,6 +23,7 @@
#define H264_DSP_MIPS_H
#include "libavcodec/h264.h"
+#include "constants.h"
void ff_h264_h_lpf_luma_inter_msa(uint8_t *src, int stride,
int alpha, int beta, int8_t *tc0);
@@ -317,6 +319,26 @@ void ff_vp8_pred8x8_129_dc_8_msa(uint8_t *src, ptrdiff_t stride);
void ff_vp8_pred16x16_127_dc_8_msa(uint8_t *src, ptrdiff_t stride);
void ff_vp8_pred16x16_129_dc_8_msa(uint8_t *src, ptrdiff_t stride);
+void ff_h264_add_pixels4_8_mmi(uint8_t *_dst, int16_t *_src, int stride);
+void ff_h264_idct_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct8_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
+void ff_h264_idct_add16_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8]);
+void ff_h264_idct_add16intra_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8]);
+void ff_h264_idct8_add4_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8]);
+void ff_h264_idct_add8_8_mmi(uint8_t **dest, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8]);
+void ff_h264_idct_add8_422_8_mmi(uint8_t **dest, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8]);
+void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
+ int qmul);
+void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
+void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
+
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset);
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src,
@@ -333,4 +355,223 @@ void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
int stride, int height, int log2_denom, int weightd, int weights,
int offset);
+void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0);
+void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta);
+void ff_deblock_h_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0);
+void ff_deblock_h_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta);
+void ff_deblock_v_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0);
+void ff_deblock_v_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta);
+void ff_deblock_h_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0);
+void ff_deblock_h_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta);
+void ff_deblock_v8_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0);
+void ff_deblock_v8_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta);
+
+void ff_put_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel16_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
+void ff_put_h264_qpel8_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel8_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
+void ff_put_h264_qpel4_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_put_h264_qpel4_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
+void ff_avg_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel16_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
+void ff_avg_h264_qpel8_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel8_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
+void ff_avg_h264_qpel4_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+void ff_avg_h264_qpel4_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t dst_stride);
+
#endif // #ifndef H264_DSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mmi.c
index 641cd2f4834..14c4a4320e9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mmi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264dsp_mmi.c
@@ -4,6 +4,7 @@
* Copyright (c) 2015 Loongson Technology Corporation Limited
* Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
* Zhang Shuangshuang <zhangshuangshuang@ict.ac.cn>
+ * Heiher <r@hev.cc>
*
* This file is part of FFmpeg.
*
@@ -25,6 +26,1011 @@
#include "libavcodec/bit_depth_template.c"
#include "h264dsp_mips.h"
+void ff_h264_add_pixels4_8_mmi(uint8_t *dst, int16_t *src, int stride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "ldc1 $f2, 0(%[src]) \r\n"
+ "ldc1 $f4, 8(%[src]) \r\n"
+ "ldc1 $f6, 16(%[src]) \r\n"
+ "ldc1 $f8, 24(%[src]) \r\n"
+ "lwc1 $f10, 0(%[dst0]) \r\n"
+ "lwc1 $f12, 0(%[dst1]) \r\n"
+ "lwc1 $f14, 0(%[dst2]) \r\n"
+ "lwc1 $f16, 0(%[dst3]) \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "punpcklbh $f16, $f16, $f0 \r\n"
+ "paddh $f2, $f2, $f10 \r\n"
+ "paddh $f4, $f4, $f12 \r\n"
+ "paddh $f6, $f6, $f14 \r\n"
+ "paddh $f8, $f8, $f16 \r\n"
+ "packushb $f2, $f2, $f0 \r\n"
+ "packushb $f4, $f4, $f0 \r\n"
+ "packushb $f6, $f6, $f0 \r\n"
+ "packushb $f8, $f8, $f0 \r\n"
+ "swc1 $f2, 0(%[dst0]) \r\n"
+ "swc1 $f4, 0(%[dst1]) \r\n"
+ "swc1 $f6, 0(%[dst2]) \r\n"
+ "swc1 $f8, 0(%[dst3]) \r\n"
+ ::[dst0]"r"(dst),[dst1]"r"(dst+stride),[dst2]"r"(dst+2*stride),
+ [dst3]"r"(dst+3*stride),[src]"r"(src)
+ : "$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16"
+ );
+
+ memset(src, 0, 32);
+}
+
+void ff_h264_idct_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
+{
+ __asm__ volatile (
+ "dli $8, 1 \r\n"
+ "ldc1 $f0, 0(%[block]) \r\n"
+ "dmtc1 $8, $f16 \r\n"
+ "ldc1 $f2, 8(%[block]) \r\n"
+ "dli $8, 6 \r\n"
+ "ldc1 $f4, 16(%[block]) \r\n"
+ "dmtc1 $8, $f18 \r\n"
+ "psrah $f8, $f2, $f16 \r\n"
+ "ldc1 $f6, 24(%[block]) \r\n"
+ "psrah $f10, $f6, $f16 \r\n"
+ "psubh $f8, $f8, $f6 \r\n"
+ "paddh $f10, $f10, $f2 \r\n"
+ "paddh $f20, $f4, $f0 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "paddh $f22, $f10, $f20 \r\n"
+ "psubh $f4, $f20, $f10 \r\n"
+ "paddh $f20, $f8, $f0 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "punpckhhw $f2, $f22, $f20 \r\n"
+ "punpcklhw $f10, $f22, $f20 \r\n"
+ "punpckhhw $f8, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhwd $f4, $f10, $f0 \r\n"
+ "punpcklwd $f10, $f10, $f0 \r\n"
+ "punpcklwd $f20, $f2, $f8 \r\n"
+ "punpckhwd $f0, $f2, $f8 \r\n"
+ "paddh $f10, $f10, %[ff_pw_32] \r\n"
+ "psrah $f8, $f4, $f16 \r\n"
+ "psrah $f6, $f0, $f16 \r\n"
+ "psubh $f8, $f8, $f0 \r\n"
+ "paddh $f6, $f6, $f4 \r\n"
+ "paddh $f2, $f20, $f10 \r\n"
+ "psubh $f10, $f10, $f20 \r\n"
+ "paddh $f20, $f6, $f2 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "paddh $f22, $f8, $f10 \r\n"
+ "xor $f14, $f14, $f14 \r\n"
+ "psubh $f10, $f10, $f8 \r\n"
+ "sdc1 $f14, 0(%[block]) \r\n"
+ "sdc1 $f14, 8(%[block]) \r\n"
+ "sdc1 $f14, 16(%[block]) \r\n"
+ "sdc1 $f14, 24(%[block]) \r\n"
+ "lwc1 $f4, 0(%[dst]) \r\n"
+ "psrah $f6, $f20, $f18 \r\n"
+ "gslwxc1 $f0, 0(%[dst], %[stride]) \r\n"
+ "psrah $f8, $f22, $f18 \r\n"
+ "punpcklbh $f4, $f4, $f14 \r\n"
+ "punpcklbh $f0, $f0, $f14 \r\n"
+ "paddh $f4, $f4, $f6 \r\n"
+ "paddh $f0, $f0, $f8 \r\n"
+ "packushb $f4, $f4, $f14 \r\n"
+ "packushb $f0, $f0, $f14 \r\n"
+ "swc1 $f4, 0(%[dst]) \r\n"
+ "gsswxc1 $f0, 0(%[dst], %[stride]) \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "lwc1 $f4, 0(%[dst]) \r\n"
+ "psrah $f10, $f10, $f18 \r\n"
+ "gslwxc1 $f0, 0(%[dst], %[stride]) \r\n"
+ "psrah $f2, $f2, $f18 \r\n"
+ "punpcklbh $f4, $f4, $f14 \r\n"
+ "punpcklbh $f0, $f0, $f14 \r\n"
+ "paddh $f4, $f4, $f10 \r\n"
+ "paddh $f0, $f0, $f2 \r\n"
+ "packushb $f4, $f4, $f14 \r\n"
+ "swc1 $f4, 0(%[dst]) \r\n"
+ "packushb $f0, $f0, $f14 \r\n"
+ "gsswxc1 $f0, 0(%[dst], %[stride]) \r\n"
+ ::[dst]"r"(dst),[block]"r"(block),[stride]"r"((uint64_t)stride),
+ [ff_pw_32]"f"(ff_pw_32)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20","$f22"
+ );
+
+ memset(block, 0, 32);
+}
+
+void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
+{
+ __asm__ volatile (
+ "lhu $10, 0x0(%[block]) \r\n"
+ "daddiu $29, $29, -0x20 \r\n"
+ "daddiu $10, $10, 0x20 \r\n"
+ "ldc1 $f2, 0x10(%[block]) \r\n"
+ "sh $10, 0x0(%[block]) \r\n"
+ "ldc1 $f4, 0x20(%[block]) \r\n"
+ "dli $10, 0x1 \r\n"
+ "ldc1 $f6, 0x30(%[block]) \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "ldc1 $f10, 0x50(%[block]) \r\n"
+ "ldc1 $f12, 0x60(%[block]) \r\n"
+ "ldc1 $f14, 0x70(%[block]) \r\n"
+ "mov.d $f0, $f2 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "psrah $f8, $f10, $f16 \r\n"
+ "paddh $f2, $f2, $f0 \r\n"
+ "paddh $f8, $f8, $f10 \r\n"
+ "paddh $f2, $f2, $f10 \r\n"
+ "paddh $f8, $f8, $f14 \r\n"
+ "paddh $f2, $f2, $f6 \r\n"
+ "psubh $f8, $f8, $f0 \r\n"
+ "psubh $f0, $f0, $f6 \r\n"
+ "psubh $f10, $f10, $f6 \r\n"
+ "psrah $f6, $f6, $f16 \r\n"
+ "paddh $f0, $f0, $f14 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "psrah $f14, $f14, $f16 \r\n"
+ "psubh $f0, $f0, $f6 \r\n"
+ "dli $10, 0x2 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "dmtc1 $10, $f18 \r\n"
+ "mov.d $f14, $f2 \r\n"
+ "psrah $f2, $f2, $f18 \r\n"
+ "psrah $f6, $f8, $f18 \r\n"
+ "paddh $f6, $f6, $f0 \r\n"
+ "psrah $f0, $f0, $f18 \r\n"
+ "paddh $f2, $f2, $f10 \r\n"
+ "psrah $f10, $f10, $f18 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "mov.d $f10, $f12 \r\n"
+ "psrah $f12, $f12, $f16 \r\n"
+ "psrah $f8, $f4, $f16 \r\n"
+ "paddh $f12, $f12, $f4 \r\n"
+ "psubh $f8, $f8, $f10 \r\n"
+ "ldc1 $f4, 0x0(%[block]) \r\n"
+ "ldc1 $f10, 0x40(%[block]) \r\n"
+ "paddh $f10, $f10, $f4 \r\n"
+ "paddh $f4, $f4, $f4 \r\n"
+ "paddh $f12, $f12, $f10 \r\n"
+ "psubh $f4, $f4, $f10 \r\n"
+ "paddh $f10, $f10, $f10 \r\n"
+ "paddh $f8, $f8, $f4 \r\n"
+ "psubh $f10, $f10, $f12 \r\n"
+ "paddh $f4, $f4, $f4 \r\n"
+ "paddh $f14, $f14, $f12 \r\n"
+ "psubh $f4, $f4, $f8 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f0, $f0, $f8 \r\n"
+ "psubh $f12, $f12, $f14 \r\n"
+ "paddh $f8, $f8, $f8 \r\n"
+ "paddh $f6, $f6, $f4 \r\n"
+ "psubh $f8, $f8, $f0 \r\n"
+ "paddh $f4, $f4, $f4 \r\n"
+ "paddh $f2, $f2, $f10 \r\n"
+ "psubh $f4, $f4, $f6 \r\n"
+ "paddh $f10, $f10, $f10 \r\n"
+ "sdc1 $f12, 0x0(%[block]) \r\n"
+ "psubh $f10, $f10, $f2 \r\n"
+ "punpckhhw $f12, $f14, $f0 \r\n"
+ "punpcklhw $f14, $f14, $f0 \r\n"
+ "punpckhhw $f0, $f6, $f2 \r\n"
+ "punpcklhw $f6, $f6, $f2 \r\n"
+ "punpckhwd $f2, $f14, $f6 \r\n"
+ "punpcklwd $f14, $f14, $f6 \r\n"
+ "punpckhwd $f6, $f12, $f0 \r\n"
+ "punpcklwd $f12, $f12, $f0 \r\n"
+ "ldc1 $f0, 0x0(%[block]) \r\n"
+ "sdc1 $f14, 0x0($29) \r\n"
+ "sdc1 $f2, 0x10($29) \r\n"
+ "dmfc1 $8, $f12 \r\n"
+ "dmfc1 $11, $f6 \r\n"
+ "punpckhhw $f6, $f10, $f4 \r\n"
+ "punpcklhw $f10, $f10, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f0 \r\n"
+ "punpcklhw $f8, $f8, $f0 \r\n"
+ "punpckhwd $f0, $f10, $f8 \r\n"
+ "punpcklwd $f10, $f10, $f8 \r\n"
+ "punpckhwd $f8, $f6, $f4 \r\n"
+ "punpcklwd $f6, $f6, $f4 \r\n"
+ "sdc1 $f10, 0x8($29) \r\n"
+ "sdc1 $f0, 0x18($29) \r\n"
+ "dmfc1 $9, $f6 \r\n"
+ "dmfc1 $12, $f8 \r\n"
+ "ldc1 $f2, 0x18(%[block]) \r\n"
+ "ldc1 $f12, 0x28(%[block]) \r\n"
+ "ldc1 $f4, 0x38(%[block]) \r\n"
+ "ldc1 $f0, 0x58(%[block]) \r\n"
+ "ldc1 $f6, 0x68(%[block]) \r\n"
+ "ldc1 $f8, 0x78(%[block]) \r\n"
+ "mov.d $f14, $f2 \r\n"
+ "psrah $f10, $f0, $f16 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "paddh $f10, $f10, $f0 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "paddh $f10, $f10, $f8 \r\n"
+ "paddh $f2, $f2, $f0 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "paddh $f2, $f2, $f4 \r\n"
+ "psubh $f14, $f14, $f4 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psrah $f4, $f4, $f16 \r\n"
+ "paddh $f14, $f14, $f8 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "psrah $f8, $f8, $f16 \r\n"
+ "psubh $f14, $f14, $f4 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "mov.d $f8, $f2 \r\n"
+ "psrah $f4, $f10, $f18 \r\n"
+ "psrah $f2, $f2, $f18 \r\n"
+ "paddh $f4, $f4, $f14 \r\n"
+ "psrah $f14, $f14, $f18 \r\n"
+ "paddh $f2, $f2, $f0 \r\n"
+ "psrah $f0, $f0, $f18 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "psubh $f8, $f8, $f0 \r\n"
+ "mov.d $f0, $f6 \r\n"
+ "psrah $f6, $f6, $f16 \r\n"
+ "psrah $f10, $f12, $f16 \r\n"
+ "paddh $f6, $f6, $f12 \r\n"
+ "psubh $f10, $f10, $f0 \r\n"
+ "ldc1 $f12, 0x8(%[block]) \r\n"
+ "ldc1 $f0, 0x48(%[block]) \r\n"
+ "paddh $f0, $f0, $f12 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f6, $f6, $f0 \r\n"
+ "psubh $f12, $f12, $f0 \r\n"
+ "paddh $f0, $f0, $f0 \r\n"
+ "paddh $f10, $f10, $f12 \r\n"
+ "psubh $f0, $f0, $f6 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f8, $f8, $f6 \r\n"
+ "psubh $f12, $f12, $f10 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "paddh $f14, $f14, $f10 \r\n"
+ "psubh $f6, $f6, $f8 \r\n"
+ "paddh $f10, $f10, $f10 \r\n"
+ "paddh $f4, $f4, $f12 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f2, $f2, $f0 \r\n"
+ "psubh $f12, $f12, $f4 \r\n"
+ "paddh $f0, $f0, $f0 \r\n"
+ "sdc1 $f6, 0x8(%[block]) \r\n"
+ "psubh $f0, $f0, $f2 \r\n"
+ "punpckhhw $f6, $f8, $f14 \r\n"
+ "punpcklhw $f8, $f8, $f14 \r\n"
+ "punpckhhw $f14, $f4, $f2 \r\n"
+ "punpcklhw $f4, $f4, $f2 \r\n"
+ "punpckhwd $f2, $f8, $f4 \r\n"
+ "punpcklwd $f8, $f8, $f4 \r\n"
+ "punpckhwd $f4, $f6, $f14 \r\n"
+ "punpcklwd $f6, $f6, $f14 \r\n"
+ "ldc1 $f14, 0x8(%[block]) \r\n"
+ "dmfc1 $13, $f8 \r\n"
+ "dmfc1 $15, $f2 \r\n"
+ "mov.d $f24, $f6 \r\n"
+ "mov.d $f28, $f4 \r\n"
+ "punpckhhw $f4, $f0, $f12 \r\n"
+ "punpcklhw $f0, $f0, $f12 \r\n"
+ "punpckhhw $f12, $f10, $f14 \r\n"
+ "punpcklhw $f10, $f10, $f14 \r\n"
+ "punpckhwd $f14, $f0, $f10 \r\n"
+ "punpcklwd $f0, $f0, $f10 \r\n"
+ "punpckhwd $f10, $f4, $f12 \r\n"
+ "punpcklwd $f4, $f4, $f12 \r\n"
+ "dmfc1 $14, $f0 \r\n"
+ "mov.d $f22, $f14 \r\n"
+ "mov.d $f26, $f4 \r\n"
+ "mov.d $f30, $f10 \r\n"
+ "daddiu $10, %[dst], 0x4 \r\n"
+ "dmtc1 $15, $f14 \r\n"
+ "dmtc1 $11, $f12 \r\n"
+ "ldc1 $f2, 0x10($29) \r\n"
+ "dmtc1 $8, $f6 \r\n"
+ "mov.d $f8, $f2 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "psrah $f0, $f14, $f16 \r\n"
+ "paddh $f2, $f2, $f8 \r\n"
+ "paddh $f0, $f0, $f14 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "paddh $f0, $f0, $f28 \r\n"
+ "paddh $f2, $f2, $f12 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "psubh $f8, $f8, $f12 \r\n"
+ "psubh $f14, $f14, $f12 \r\n"
+ "psrah $f12, $f12, $f16 \r\n"
+ "paddh $f8, $f8, $f28 \r\n"
+ "psubh $f14, $f14, $f28 \r\n"
+ "psrah $f10, $f28, $f16 \r\n"
+ "psubh $f8, $f8, $f12 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "mov.d $f10, $f2 \r\n"
+ "psrah $f2, $f2, $f18 \r\n"
+ "psrah $f12, $f0, $f18 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "paddh $f12, $f12, $f8 \r\n"
+ "psrah $f8, $f8, $f18 \r\n"
+ "psrah $f14, $f14, $f18 \r\n"
+ "psubh $f8, $f8, $f0 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "mov.d $f14, $f24 \r\n"
+ "psrah $f4, $f24, $f16 \r\n"
+ "psrah $f0, $f6, $f16 \r\n"
+ "paddh $f4, $f4, $f6 \r\n"
+ "psubh $f0, $f0, $f14 \r\n"
+ "ldc1 $f6, 0x0($29) \r\n"
+ "dmtc1 $13, $f14 \r\n"
+ "paddh $f14, $f14, $f6 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "paddh $f4, $f4, $f14 \r\n"
+ "psubh $f6, $f6, $f14 \r\n"
+ "paddh $f14, $f14, $f14 \r\n"
+ "paddh $f0, $f0, $f6 \r\n"
+ "psubh $f14, $f14, $f4 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "paddh $f10, $f10, $f4 \r\n"
+ "psubh $f6, $f6, $f0 \r\n"
+ "paddh $f4, $f4, $f4 \r\n"
+ "paddh $f8, $f8, $f0 \r\n"
+ "psubh $f4, $f4, $f10 \r\n"
+ "paddh $f0, $f0, $f0 \r\n"
+ "paddh $f12, $f12, $f6 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "psubh $f6, $f6, $f12 \r\n"
+ "paddh $f14, $f14, $f14 \r\n"
+ "sdc1 $f6, 0x0($29) \r\n"
+ "psubh $f14, $f14, $f2 \r\n"
+ "sdc1 $f0, 0x10($29) \r\n"
+ "dmfc1 $8, $f4 \r\n"
+ "xor $f4, $f4, $f4 \r\n"
+ "sdc1 $f4, 0x0(%[block]) \r\n"
+ "sdc1 $f4, 0x8(%[block]) \r\n"
+ "sdc1 $f4, 0x10(%[block]) \r\n"
+ "sdc1 $f4, 0x18(%[block]) \r\n"
+ "sdc1 $f4, 0x20(%[block]) \r\n"
+ "sdc1 $f4, 0x28(%[block]) \r\n"
+ "sdc1 $f4, 0x30(%[block]) \r\n"
+ "sdc1 $f4, 0x38(%[block]) \r\n"
+ "sdc1 $f4, 0x40(%[block]) \r\n"
+ "sdc1 $f4, 0x48(%[block]) \r\n"
+ "sdc1 $f4, 0x50(%[block]) \r\n"
+ "sdc1 $f4, 0x58(%[block]) \r\n"
+ "sdc1 $f4, 0x60(%[block]) \r\n"
+ "sdc1 $f4, 0x68(%[block]) \r\n"
+ "sdc1 $f4, 0x70(%[block]) \r\n"
+ "sdc1 $f4, 0x78(%[block]) \r\n"
+ "dli $11, 0x6 \r\n"
+ "lwc1 $f6, 0x0(%[dst]) \r\n"
+ "dmtc1 $11, $f20 \r\n"
+ "gslwxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "punpcklbh $f6, $f6, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "paddh $f6, $f6, $f10 \r\n"
+ "paddh $f0, $f0, $f8 \r\n"
+ "packushb $f6, $f6, $f4 \r\n"
+ "packushb $f0, $f0, $f4 \r\n"
+ "swc1 $f6, 0x0(%[dst]) \r\n"
+ "gsswxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "lwc1 $f6, 0x0(%[dst]) \r\n"
+ "gslwxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "psrah $f12, $f12, $f20 \r\n"
+ "psrah $f2, $f2, $f20 \r\n"
+ "punpcklbh $f6, $f6, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "paddh $f6, $f6, $f12 \r\n"
+ "paddh $f0, $f0, $f2 \r\n"
+ "packushb $f6, $f6, $f4 \r\n"
+ "packushb $f0, $f0, $f4 \r\n"
+ "swc1 $f6, 0x0(%[dst]) \r\n"
+ "gsswxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "ldc1 $f10, 0x0($29) \r\n"
+ "ldc1 $f8, 0x10($29) \r\n"
+ "dmtc1 $8, $f12 \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "lwc1 $f6, 0x0(%[dst]) \r\n"
+ "gslwxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "psrah $f14, $f14, $f20 \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "punpcklbh $f6, $f6, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "paddh $f6, $f6, $f14 \r\n"
+ "paddh $f0, $f0, $f10 \r\n"
+ "packushb $f6, $f6, $f4 \r\n"
+ "packushb $f0, $f0, $f4 \r\n"
+ "swc1 $f6, 0x0(%[dst]) \r\n"
+ "gsswxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "daddu %[dst], %[dst], %[stride] \r\n"
+ "lwc1 $f6, 0x0(%[dst]) \r\n"
+ "gslwxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "psrah $f12, $f12, $f20 \r\n"
+ "punpcklbh $f6, $f6, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "paddh $f6, $f6, $f8 \r\n"
+ "paddh $f0, $f0, $f12 \r\n"
+ "packushb $f6, $f6, $f4 \r\n"
+ "packushb $f0, $f0, $f4 \r\n"
+ "swc1 $f6, 0x0(%[dst]) \r\n"
+ "gsswxc1 $f0, 0x0(%[dst], %[stride]) \r\n"
+ "dmtc1 $12, $f2 \r\n"
+ "dmtc1 $9, $f12 \r\n"
+ "ldc1 $f8, 0x18($29) \r\n"
+ "mov.d $f10, $f8 \r\n"
+ "psrah $f8, $f8, $f16 \r\n"
+ "psrah $f14, $f22, $f16 \r\n"
+ "paddh $f14, $f14, $f22 \r\n"
+ "paddh $f8, $f8, $f10 \r\n"
+ "paddh $f14, $f14, $f30 \r\n"
+ "paddh $f8, $f8, $f22 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "paddh $f8, $f8, $f2 \r\n"
+ "psubh $f10, $f10, $f2 \r\n"
+ "psubh $f6, $f22, $f2 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "paddh $f10, $f10, $f30 \r\n"
+ "psubh $f6, $f6, $f30 \r\n"
+ "psrah $f4, $f30, $f16 \r\n"
+ "psubh $f10, $f10, $f2 \r\n"
+ "psubh $f6, $f6, $f4 \r\n"
+ "mov.d $f4, $f8 \r\n"
+ "psrah $f8, $f8, $f18 \r\n"
+ "psrah $f2, $f14, $f18 \r\n"
+ "paddh $f8, $f8, $f6 \r\n"
+ "paddh $f2, $f2, $f10 \r\n"
+ "psrah $f10, $f10, $f18 \r\n"
+ "psrah $f6, $f6, $f18 \r\n"
+ "psubh $f10, $f10, $f14 \r\n"
+ "psubh $f4, $f4, $f6 \r\n"
+ "mov.d $f6, $f26 \r\n"
+ "psrah $f0, $f26, $f16 \r\n"
+ "psrah $f14, $f12, $f16 \r\n"
+ "paddh $f0, $f0, $f12 \r\n"
+ "psubh $f14, $f14, $f6 \r\n"
+ "ldc1 $f12, 0x8($29) \r\n"
+ "dmtc1 $14, $f6 \r\n"
+ "paddh $f6, $f6, $f12 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f0, $f0, $f6 \r\n"
+ "psubh $f12, $f12, $f6 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "paddh $f14, $f14, $f12 \r\n"
+ "psubh $f6, $f6, $f0 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f4, $f4, $f0 \r\n"
+ "psubh $f12, $f12, $f14 \r\n"
+ "paddh $f0, $f0, $f0 \r\n"
+ "paddh $f10, $f10, $f14 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "paddh $f14, $f14, $f14 \r\n"
+ "paddh $f2, $f2, $f12 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "paddh $f12, $f12, $f12 \r\n"
+ "paddh $f8, $f8, $f6 \r\n"
+ "psubh $f12, $f12, $f2 \r\n"
+ "paddh $f6, $f6, $f6 \r\n"
+ "sdc1 $f12, 0x8($29) \r\n"
+ "psubh $f6, $f6, $f8 \r\n"
+ "sdc1 $f14, 0x18($29) \r\n"
+ "dmfc1 $9, $f0 \r\n"
+ "xor $f0, $f0, $f0 \r\n"
+ "lwc1 $f12, 0x0($10) \r\n"
+ "gslwxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "psrah $f4, $f4, $f20 \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "paddh $f12, $f12, $f4 \r\n"
+ "paddh $f14, $f14, $f10 \r\n"
+ "packushb $f12, $f12, $f0 \r\n"
+ "packushb $f14, $f14, $f0 \r\n"
+ "swc1 $f12, 0x0($10) \r\n"
+ "gsswxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "lwc1 $f12, 0x0($10) \r\n"
+ "gslwxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "psrah $f2, $f2, $f20 \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "paddh $f12, $f12, $f2 \r\n"
+ "paddh $f14, $f14, $f8 \r\n"
+ "packushb $f12, $f12, $f0 \r\n"
+ "packushb $f14, $f14, $f0 \r\n"
+ "swc1 $f12, 0x0($10) \r\n"
+ "gsswxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "ldc1 $f4, 0x8($29) \r\n"
+ "ldc1 $f10, 0x18($29) \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "dmtc1 $9, $f2 \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "lwc1 $f12, 0x0($10) \r\n"
+ "gslwxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "psrah $f6, $f6, $f20 \r\n"
+ "psrah $f4, $f4, $f20 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "paddh $f12, $f12, $f6 \r\n"
+ "paddh $f14, $f14, $f4 \r\n"
+ "packushb $f12, $f12, $f0 \r\n"
+ "packushb $f14, $f14, $f0 \r\n"
+ "swc1 $f12, 0x0($10) \r\n"
+ "gsswxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "daddu $10, $10, %[stride] \r\n"
+ "lwc1 $f12, 0x0($10) \r\n"
+ "gslwxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "psrah $f2, $f2, $f20 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "paddh $f12, $f12, $f10 \r\n"
+ "paddh $f14, $f14, $f2 \r\n"
+ "packushb $f12, $f12, $f0 \r\n"
+ "packushb $f14, $f14, $f0 \r\n"
+ "swc1 $f12, 0x0($10) \r\n"
+ "gsswxc1 $f14, 0x0($10, %[stride]) \r\n"
+ "daddiu $29, $29, 0x20 \r\n"
+ ::[dst]"r"(dst),[block]"r"(block),[stride]"r"((uint64_t)stride)
+ :"$8","$9","$10","$11","$12","$13","$14","$15","$29","$f0","$f2","$f4",
+ "$f8","$f10","$f12","$f14","$f16","$f18","$f20","$f22","$f24","$f26",
+ "$f28","$f30"
+ );
+
+ memset(block, 0, 128);
+}
+
+void ff_h264_idct_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
+{
+ __asm__ volatile (
+ "lh $8, 0x0(%[block]) \r\n"
+ "sd $0, 0x0(%[block]) \r\n"
+ "daddiu $8, $8, 0x20 \r\n"
+ "daddu $10, %[stride], %[stride] \r\n"
+ "dsra $8, $8, 0x6 \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "mtc1 $8, $f0 \r\n"
+ "pshufh $f0, $f0, $f2 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "psubh $f2, $f2, $f0 \r\n"
+ "packushb $f0, $f0, $f0 \r\n"
+ "packushb $f2, $f2, $f2 \r\n"
+ "lwc1 $f4, 0x0(%[dst]) \r\n"
+ "gslwxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gslwxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "gslwxc1 $f10, 0x0(%[dst], $8) \r\n"
+ "paddusb $f4, $f4, $f0 \r\n"
+ "paddusb $f6, $f6, $f0 \r\n"
+ "paddusb $f8, $f8, $f0 \r\n"
+ "paddusb $f10, $f10, $f0 \r\n"
+ "psubusb $f4, $f4, $f2 \r\n"
+ "psubusb $f6, $f6, $f2 \r\n"
+ "psubusb $f8, $f8, $f2 \r\n"
+ "psubusb $f10, $f10, $f2 \r\n"
+ "swc1 $f4, 0x0(%[dst]) \r\n"
+ "gsswxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gsswxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "gsswxc1 $f10, 0x0(%[dst], $8) \r\n"
+ ::[dst]"r"(dst),[block]"r"(block),[stride]"r"((uint64_t)stride)
+ : "$8","$10","$f0","$f2","$f4","$f6","$f8","$f10"
+ );
+}
+
+void ff_h264_idct8_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
+{
+ __asm__ volatile (
+ "lh $8, 0x0(%[block]) \r\n"
+ "sd $0, 0x0(%[block]) \r\n"
+ "daddiu $8, $8, 0x20 \r\n"
+ "daddu $10, %[stride], %[stride] \r\n"
+ "dsra $8, $8, 0x6 \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "mtc1 $8, $f0 \r\n"
+ "pshufh $f0, $f0, $f2 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "psubh $f2, $f2, $f0 \r\n"
+ "packushb $f0, $f0, $f0 \r\n"
+ "packushb $f2, $f2, $f2 \r\n"
+ "ldc1 $f4, 0x0(%[dst]) \r\n"
+ "gsldxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gsldxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "gsldxc1 $f10, 0x0(%[dst], $8) \r\n"
+ "paddusb $f4, $f4, $f0 \r\n"
+ "paddusb $f6, $f6, $f0 \r\n"
+ "paddusb $f8, $f8, $f0 \r\n"
+ "paddusb $f10, $f10, $f0 \r\n"
+ "psubusb $f4, $f4, $f2 \r\n"
+ "psubusb $f6, $f6, $f2 \r\n"
+ "psubusb $f8, $f8, $f2 \r\n"
+ "psubusb $f10, $f10, $f2 \r\n"
+ "sdc1 $f4, 0x0(%[dst]) \r\n"
+ "gssdxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gssdxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "daddu $9, $10, $10 \r\n"
+ "gssdxc1 $f10, 0x0(%[dst], $8) \r\n"
+ "daddu %[dst], %[dst], $9 \r\n"
+ "ldc1 $f4, 0x0(%[dst]) \r\n"
+ "gsldxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gsldxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "gsldxc1 $f10, 0x0(%[dst], $8) \r\n"
+ "paddusb $f4, $f4, $f0 \r\n"
+ "paddusb $f6, $f6, $f0 \r\n"
+ "paddusb $f8, $f8, $f0 \r\n"
+ "paddusb $f10, $f10, $f0 \r\n"
+ "psubusb $f4, $f4, $f2 \r\n"
+ "psubusb $f6, $f6, $f2 \r\n"
+ "psubusb $f8, $f8, $f2 \r\n"
+ "psubusb $f10, $f10, $f2 \r\n"
+ "sdc1 $f4, 0x0(%[dst]) \r\n"
+ "gssdxc1 $f6, 0x0(%[dst], %[stride]) \r\n"
+ "gssdxc1 $f8, 0x0(%[dst], $10) \r\n"
+ "gssdxc1 $f10, 0x0(%[dst], $8) \r\n"
+ ::[dst]"r"(dst),[block]"r"(block),[stride]"r"((uint64_t)stride)
+ : "$8","$9","$10","$f0","$f2","$f4","$f6","$f8","$f10"
+ );
+}
+
+void ff_h264_idct_add16_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8])
+{
+ int i;
+ for(i=0; i<16; i++){
+ int nnz = nnzc[ scan8[i] ];
+ if(nnz){
+ if(nnz==1 && ((int16_t*)block)[i*16])
+ ff_h264_idct_dc_add_8_mmi(dst + block_offset[i], block + i*16,
+ stride);
+ else
+ ff_h264_idct_add_8_mmi(dst + block_offset[i], block + i*16,
+ stride);
+ }
+ }
+}
+
+void ff_h264_idct_add16intra_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8])
+{
+ int i;
+ for(i=0; i<16; i++){
+ if(nnzc[ scan8[i] ])
+ ff_h264_idct_add_8_mmi(dst + block_offset[i], block + i*16, stride);
+ else if(((int16_t*)block)[i*16])
+ ff_h264_idct_dc_add_8_mmi(dst + block_offset[i], block + i*16,
+ stride);
+ }
+}
+
+void ff_h264_idct8_add4_8_mmi(uint8_t *dst, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8])
+{
+ int i;
+ for(i=0; i<16; i+=4){
+ int nnz = nnzc[ scan8[i] ];
+ if(nnz){
+ if(nnz==1 && ((int16_t*)block)[i*16])
+ ff_h264_idct8_dc_add_8_mmi(dst + block_offset[i],
+ block + i*16, stride);
+ else
+ ff_h264_idct8_add_8_mmi(dst + block_offset[i], block + i*16,
+ stride);
+ }
+ }
+}
+
+void ff_h264_idct_add8_8_mmi(uint8_t **dest, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8])
+{
+ int i, j;
+ for(j=1; j<3; j++){
+ for(i=j*16; i<j*16+4; i++){
+ if(nnzc[ scan8[i] ])
+ ff_h264_idct_add_8_mmi(dest[j-1] + block_offset[i],
+ block + i*16, stride);
+ else if(((int16_t*)block)[i*16])
+ ff_h264_idct_dc_add_8_mmi(dest[j-1] + block_offset[i],
+ block + i*16, stride);
+ }
+ }
+}
+
+void ff_h264_idct_add8_422_8_mmi(uint8_t **dest, const int *block_offset,
+ int16_t *block, int stride, const uint8_t nnzc[15*8])
+{
+ int i, j;
+
+ for(j=1; j<3; j++){
+ for(i=j*16; i<j*16+4; i++){
+ if(nnzc[ scan8[i] ])
+ ff_h264_idct_add_8_mmi(dest[j-1] + block_offset[i],
+ block + i*16, stride);
+ else if(((int16_t*)block)[i*16])
+ ff_h264_idct_dc_add_8_mmi(dest[j-1] + block_offset[i],
+ block + i*16, stride);
+ }
+ }
+
+ for(j=1; j<3; j++){
+ for(i=j*16+4; i<j*16+8; i++){
+ if(nnzc[ scan8[i+4] ])
+ ff_h264_idct_add_8_mmi(dest[j-1] + block_offset[i+4],
+ block + i*16, stride);
+ else if(((int16_t*)block)[i*16])
+ ff_h264_idct_dc_add_8_mmi(dest[j-1] + block_offset[i+4],
+ block + i*16, stride);
+ }
+ }
+}
+
+void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
+ int qmul)
+{
+ __asm__ volatile (
+ ".set noreorder \r\n"
+ "dli $10, 0x8 \r\n"
+ "ldc1 $f6, 0x18(%[input]) \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "ldc1 $f4, 0x10(%[input]) \r\n"
+ "dli $10, 0x20 \r\n"
+ "ldc1 $f2, 0x8(%[input]) \r\n"
+ "dmtc1 $10, $f18 \r\n"
+ "ldc1 $f0, 0x0(%[input]) \r\n"
+ "mov.d $f8, $f6 \r\n"
+ "paddh $f6, $f6, $f4 \r\n"
+ "psubh $f4, $f4, $f8 \r\n"
+ "mov.d $f8, $f2 \r\n"
+ "paddh $f2, $f2, $f0 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "mov.d $f8, $f6 \r\n"
+ "paddh $f6, $f6, $f2 \r\n"
+ "psubh $f2, $f2, $f8 \r\n"
+ "mov.d $f8, $f4 \r\n"
+ "paddh $f4, $f4, $f0 \r\n"
+ "psubh $f0, $f0, $f8 \r\n"
+ "mov.d $f8, $f6 \r\n"
+ "punpcklhw $f6, $f6, $f2 \r\n"
+ "punpckhhw $f8, $f8, $f2 \r\n"
+ "punpckhhw $f2, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhwd $f4, $f6, $f0 \r\n"
+ "punpcklwd $f6, $f6, $f0 \r\n"
+ "mov.d $f0, $f8 \r\n"
+ "punpcklwd $f8, $f8, $f2 \r\n"
+ "punpckhwd $f0, $f0, $f2 \r\n"
+ "mov.d $f2, $f0 \r\n"
+ "paddh $f0, $f0, $f8 \r\n"
+ "psubh $f8, $f8, $f2 \r\n"
+ "mov.d $f2, $f4 \r\n"
+ "paddh $f4, $f4, $f6 \r\n"
+ "psubh $f6, $f6, $f2 \r\n"
+ "mov.d $f2, $f0 \r\n"
+ "paddh $f0, $f0, $f4 \r\n"
+ "psubh $f4, $f4, $f2 \r\n"
+ "mov.d $f2, $f8 \r\n"
+ "daddiu $10, %[qmul], -0x7fff \r\n"
+ "paddh $f8, $f8, $f6 \r\n"
+ "bgtz $10, 1f \r\n"
+ "psubh $f6, $f6, $f2 \r\n"
+ "ori $10, $0, 0x80 \r\n"
+ "dsll $10, $10, 0x10 \r\n"
+ "punpckhhw $f2, $f0, %[ff_pw_1] \r\n"
+ "daddu %[qmul], %[qmul], $10 \r\n"
+ "punpcklhw $f0, $f0, %[ff_pw_1] \r\n"
+ "punpckhhw $f10, $f4, %[ff_pw_1] \r\n"
+ "punpcklhw $f4, $f4, %[ff_pw_1] \r\n"
+ "mtc1 %[qmul], $f14 \r\n"
+ "punpcklwd $f14, $f14, $f14 \r\n"
+ "pmaddhw $f0, $f0, $f14 \r\n"
+ "pmaddhw $f4, $f4, $f14 \r\n"
+ "pmaddhw $f2, $f2, $f14 \r\n"
+ "pmaddhw $f10, $f10, $f14 \r\n"
+ "psraw $f0, $f0, $f16 \r\n"
+ "psraw $f4, $f4, $f16 \r\n"
+ "psraw $f2, $f2, $f16 \r\n"
+ "psraw $f10, $f10, $f16 \r\n"
+ "packsswh $f0, $f0, $f2 \r\n"
+ "packsswh $f4, $f4, $f10 \r\n"
+ "mfc1 $9, $f0 \r\n"
+ "dsrl $f0, $f0, $f18 \r\n"
+ "mfc1 %[input], $f0 \r\n"
+ "sh $9, 0x0(%[output]) \r\n"
+ "sh %[input], 0x80(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x20(%[output]) \r\n"
+ "sh %[input], 0xa0(%[output]) \r\n"
+ "mfc1 $9, $f4 \r\n"
+ "dsrl $f4, $f4, $f18 \r\n"
+ "mfc1 %[input], $f4 \r\n"
+ "sh $9, 0x40(%[output]) \r\n"
+ "sh %[input], 0xc0(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x60(%[output]) \r\n"
+ "sh %[input], 0xe0(%[output]) \r\n"
+ "punpckhhw $f2, $f6, %[ff_pw_1] \r\n"
+ "punpcklhw $f6, $f6, %[ff_pw_1] \r\n"
+ "punpckhhw $f10, $f8, %[ff_pw_1] \r\n"
+ "punpcklhw $f8, $f8, %[ff_pw_1] \r\n"
+ "mtc1 %[qmul], $f14 \r\n"
+ "punpcklwd $f14, $f14, $f14 \r\n"
+ "pmaddhw $f6, $f6, $f14 \r\n"
+ "pmaddhw $f8, $f8, $f14 \r\n"
+ "pmaddhw $f2, $f2, $f14 \r\n"
+ "pmaddhw $f10, $f10, $f14 \r\n"
+ "psraw $f6, $f6, $f16 \r\n"
+ "psraw $f8, $f8, $f16 \r\n"
+ "psraw $f2, $f2, $f16 \r\n"
+ "psraw $f10, $f10, $f16 \r\n"
+ "packsswh $f6, $f6, $f2 \r\n"
+ "packsswh $f8, $f8, $f10 \r\n"
+ "mfc1 $9, $f6 \r\n"
+ "dsrl $f6, $f6, $f18 \r\n"
+ "mfc1 %[input], $f6 \r\n"
+ "sh $9, 0x100(%[output]) \r\n"
+ "sh %[input], 0x180(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x120(%[output]) \r\n"
+ "sh %[input], 0x1a0(%[output]) \r\n"
+ "mfc1 $9, $f8 \r\n"
+ "dsrl $f8, $f8, $f18 \r\n"
+ "mfc1 %[input], $f8 \r\n"
+ "sh $9, 0x140(%[output]) \r\n"
+ "sh %[input], 0x1c0(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x160(%[output]) \r\n"
+ "jr $31 \r\n"
+ "sh %[input], 0x1e0(%[output]) \r\n"
+ "1: \r\n"
+ "ori $10, $0, 0x1f \r\n"
+ "clz $9, %[qmul] \r\n"
+ "ori %[input], $0, 0x7 \r\n"
+ "dsubu $9, $10, $9 \r\n"
+ "ori $10, $0, 0x80 \r\n"
+ "dsll $10, $10, 0x10 \r\n"
+ "daddu %[qmul], %[qmul], $10 \r\n"
+ "dsubu $10, $9, %[input] \r\n"
+ "movn $9, %[input], $10 \r\n"
+ "daddiu %[input], %[input], 0x1 \r\n"
+ "andi $10, $9, 0xff \r\n"
+ "dsrlv %[qmul], %[qmul], $10 \r\n"
+ "dsubu %[input], %[input], $9 \r\n"
+ "mtc1 %[input], $f12 \r\n"
+ "punpckhhw $f2, $f0, %[ff_pw_1] \r\n"
+ "punpcklhw $f0, $f0, %[ff_pw_1] \r\n"
+ "punpckhhw $f10, $f4, %[ff_pw_1] \r\n"
+ "punpcklhw $f4, $f4, %[ff_pw_1] \r\n"
+ "mtc1 %[qmul], $f14 \r\n"
+ "punpcklwd $f14, $f14, $f14 \r\n"
+ "pmaddhw $f0, $f0, $f14 \r\n"
+ "pmaddhw $f4, $f4, $f14 \r\n"
+ "pmaddhw $f2, $f2, $f14 \r\n"
+ "pmaddhw $f10, $f10, $f14 \r\n"
+ "psraw $f0, $f0, $f12 \r\n"
+ "psraw $f4, $f4, $f12 \r\n"
+ "psraw $f2, $f2, $f12 \r\n"
+ "psraw $f10, $f10, $f12 \r\n"
+ "packsswh $f0, $f0, $f2 \r\n"
+ "packsswh $f4, $f4, $f10 \r\n"
+ "mfc1 $9, $f0 \r\n"
+ "dsrl $f0, $f0, $f18 \r\n"
+ "sh $9, 0x0(%[output]) \r\n"
+ "mfc1 %[input], $f0 \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "sh %[input], 0x80(%[output]) \r\n"
+ "sh $9, 0x20(%[output]) \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "mfc1 $9, $f4 \r\n"
+ "sh %[input], 0xa0(%[output]) \r\n"
+ "dsrl $f4, $f4, $f18 \r\n"
+ "sh $9, 0x40(%[output]) \r\n"
+ "mfc1 %[input], $f4 \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "sh %[input], 0xc0(%[output]) \r\n"
+ "sh $9, 0x60(%[output]) \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh %[input], 0xe0(%[output]) \r\n"
+ "punpckhhw $f2, $f6, %[ff_pw_1] \r\n"
+ "punpcklhw $f6, $f6, %[ff_pw_1] \r\n"
+ "punpckhhw $f10, $f8, %[ff_pw_1] \r\n"
+ "punpcklhw $f8, $f8, %[ff_pw_1] \r\n"
+ "mtc1 %[qmul], $f14 \r\n"
+ "punpcklwd $f14, $f14, $f14 \r\n"
+ "pmaddhw $f6, $f6, $f14 \r\n"
+ "pmaddhw $f8, $f8, $f14 \r\n"
+ "pmaddhw $f2, $f2, $f14 \r\n"
+ "pmaddhw $f10, $f10, $f14 \r\n"
+ "psraw $f6, $f6, $f12 \r\n"
+ "psraw $f8, $f8, $f12 \r\n"
+ "psraw $f2, $f2, $f12 \r\n"
+ "psraw $f10, $f10, $f12 \r\n"
+ "packsswh $f6, $f6, $f2 \r\n"
+ "packsswh $f8, $f8, $f10 \r\n"
+ "mfc1 $9, $f6 \r\n"
+ "dsrl $f6, $f6, $f18 \r\n"
+ "mfc1 %[input], $f6 \r\n"
+ "sh $9, 0x100(%[output]) \r\n"
+ "sh %[input], 0x180(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x120(%[output]) \r\n"
+ "sh %[input], 0x1a0(%[output]) \r\n"
+ "mfc1 $9, $f8 \r\n"
+ "dsrl $f8, $f8, $f18 \r\n"
+ "mfc1 %[input], $f8 \r\n"
+ "sh $9, 0x140(%[output]) \r\n"
+ "sh %[input], 0x1c0(%[output]) \r\n"
+ "dsrl $9, $9, 0x10 \r\n"
+ "dsrl %[input], %[input], 0x10 \r\n"
+ "sh $9, 0x160(%[output]) \r\n"
+ "sh %[input], 0x1e0(%[output]) \r\n"
+ ".set reorder \r\n"
+ ::[output]"r"(output),[input]"r"(input),[qmul]"r"((uint64_t)qmul),
+ [ff_pw_1]"f"(ff_pw_1)
+ : "$9","$10","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18"
+ );
+}
+
+void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul)
+{
+ int temp[8];
+ int t[8];
+
+ temp[0] = block[0] + block[16];
+ temp[1] = block[0] - block[16];
+ temp[2] = block[32] + block[48];
+ temp[3] = block[32] - block[48];
+ temp[4] = block[64] + block[80];
+ temp[5] = block[64] - block[80];
+ temp[6] = block[96] + block[112];
+ temp[7] = block[96] - block[112];
+
+ t[0] = temp[0] + temp[4] + temp[2] + temp[6];
+ t[1] = temp[0] - temp[4] + temp[2] - temp[6];
+ t[2] = temp[0] - temp[4] - temp[2] + temp[6];
+ t[3] = temp[0] + temp[4] - temp[2] - temp[6];
+ t[4] = temp[1] + temp[5] + temp[3] + temp[7];
+ t[5] = temp[1] - temp[5] + temp[3] - temp[7];
+ t[6] = temp[1] - temp[5] - temp[3] + temp[7];
+ t[7] = temp[1] + temp[5] - temp[3] - temp[7];
+
+ block[ 0]= (t[0]*qmul + 128) >> 8;
+ block[ 32]= (t[1]*qmul + 128) >> 8;
+ block[ 64]= (t[2]*qmul + 128) >> 8;
+ block[ 96]= (t[3]*qmul + 128) >> 8;
+ block[ 16]= (t[4]*qmul + 128) >> 8;
+ block[ 48]= (t[5]*qmul + 128) >> 8;
+ block[ 80]= (t[6]*qmul + 128) >> 8;
+ block[112]= (t[7]*qmul + 128) >> 8;
+}
+
+void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul)
+{
+ int a,b,c,d;
+
+ d = block[0] - block[16];
+ a = block[0] + block[16];
+ b = block[32] - block[48];
+ c = block[32] + block[48];
+ block[0] = ((a+c)*qmul) >> 7;
+ block[16]= ((d+b)*qmul) >> 7;
+ block[32]= ((a-c)*qmul) >> 7;
+ block[48]= ((d-b)*qmul) >> 7;
+}
+
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride,
int height, int log2_denom, int weight, int offset)
{
@@ -276,3 +1282,1219 @@ void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
);
}
}
+
+static void inline chroma_inter_body_mmi(uint8_t *pix, int stride,
+ int alpha, int beta, int8_t *tc0)
+{
+ __asm__ volatile (
+ "xor $f16, $f16, $f16 \r\n"
+ "mtc1 %[alpha], $f8 \r\n"
+ "mtc1 %[beta], $f10 \r\n"
+ "pshufh $f8, $f8, $f16 \r\n"
+ "pshufh $f10, $f10, $f16 \r\n"
+ "packushb $f8, $f8, $f8 \r\n"
+ "packushb $f10, $f10, $f10 \r\n"
+ "psubusb $f12, $f4, $f2 \r\n"
+ "psubusb $f14, $f2, $f4 \r\n"
+ "or $f14, $f14, $f12 \r\n"
+ "psubusb $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f2, $f0 \r\n"
+ "psubusb $f8, $f0, $f2 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f4, $f6 \r\n"
+ "psubusb $f8, $f6, $f4 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "pcmpeqb $f14, $f14, $f12 \r\n"
+ "lwc1 $f12, 0x0(%[tc0]) \r\n"
+ "punpcklbh $f12, $f12, $f12 \r\n"
+ "and $f14, $f14, $f12 \r\n"
+ "pcmpeqb $f8, $f8, $f8 \r\n"
+ "xor $f10, $f2, $f4 \r\n"
+ "xor $f6, $f6, $f8 \r\n"
+ "and $f10, $f10, %[ff_pb_1] \r\n"
+ "pavgb $f6, $f6, $f0 \r\n"
+ "xor $f8, $f8, $f2 \r\n"
+ "pavgb $f6, $f6, %[ff_pb_3] \r\n"
+ "pavgb $f8, $f8, $f4 \r\n"
+ "pavgb $f6, $f6, $f10 \r\n"
+ "paddusb $f6, $f6, $f8 \r\n"
+ "psubusb $f12, %[ff_pb_A1], $f6 \r\n"
+ "psubusb $f6, $f6, %[ff_pb_A1] \r\n"
+ "pminub $f12, $f12, $f14 \r\n"
+ "pminub $f6, $f6, $f14 \r\n"
+ "psubusb $f2, $f2, $f12 \r\n"
+ "psubusb $f4, $f4, $f6 \r\n"
+ "paddusb $f2, $f2, $f6 \r\n"
+ "paddusb $f4, $f4, $f12 \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),
+ [alpha]"r"((int64_t)alpha),[beta]"r"((int64_t)beta),[tc0]"r"(tc0),
+ [ff_pb_1]"f"(ff_pb_1),[ff_pb_3]"f"(ff_pb_3),[ff_pb_A1]"f"(ff_pb_A1)
+ : "$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16"
+ );
+}
+
+static void inline chroma_intra_body_mmi(uint8_t *pix, int stride,
+ int alpha, int beta)
+{
+ __asm__ volatile (
+ "xor $f16, $f16, $f16 \r\n"
+ "mtc1 %[alpha], $f8 \r\n"
+ "mtc1 %[beta], $f10 \r\n"
+ "pshufh $f8, $f8, $f16 \r\n"
+ "pshufh $f10, $f10, $f16 \r\n"
+ "packushb $f8, $f8, $f8 \r\n"
+ "packushb $f10, $f10, $f10 \r\n"
+ "psubusb $f12, $f4, $f2 \r\n"
+ "psubusb $f14, $f2, $f4 \r\n"
+ "or $f14, $f14, $f12 \r\n"
+ "psubusb $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f2, $f0 \r\n"
+ "psubusb $f8, $f0, $f2 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f4, $f6 \r\n"
+ "psubusb $f8, $f6, $f4 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "pcmpeqb $f14, $f14, $f12 \r\n"
+ "mov.d $f10, $f2 \r\n"
+ "mov.d $f12, $f4 \r\n"
+ "xor $f8, $f2, $f6 \r\n"
+ "and $f8, $f8, %[ff_pb_1] \r\n"
+ "pavgb $f2, $f2, $f6 \r\n"
+ "psubusb $f2, $f2, $f8 \r\n"
+ "pavgb $f2, $f2, $f0 \r\n"
+ "xor $f8, $f4, $f0 \r\n"
+ "and $f8, $f8, %[ff_pb_1] \r\n"
+ "pavgb $f4, $f4, $f0 \r\n"
+ "psubusb $f4, $f4, $f8 \r\n"
+ "pavgb $f4, $f4, $f6 \r\n"
+ "psubb $f2, $f2, $f10 \r\n"
+ "psubb $f4, $f4, $f12 \r\n"
+ "and $f2, $f2, $f14 \r\n"
+ "and $f4, $f4, $f14 \r\n"
+ "paddb $f2, $f2, $f10 \r\n"
+ "paddb $f4, $f4, $f12 \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),
+ [alpha]"r"((int64_t)alpha),[beta]"r"((int64_t)beta),
+ [ff_pb_1]"f"(ff_pb_1)
+ : "$f0","$f2","$f4","$f8","$f10","$f12","$f14","$f16"
+ );
+}
+
+void ff_deblock_v8_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0)
+{
+ __asm__ volatile (
+ "daddu $8, %[stride], %[stride] \r\n"
+ "xor $f16, $f16, $f16 \r\n"
+ "daddu $9, %[stride], $8 \r\n"
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "dsubu $9, $0, $9 \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "daddu $9, $9, %[pix] \r\n"
+ "ldc1 $f4, 0x0(%[pix]) \r\n"
+ "gsldxc1 $f0, 0x0($9, %[stride]) \r\n"
+ "gsldxc1 $f2, 0x0($9, $8) \r\n"
+ "gsldxc1 $f6, 0x0(%[pix], %[stride]) \r\n"
+ "mtc1 %[alpha], $f8 \r\n"
+ "mtc1 %[beta], $f10 \r\n"
+ "pshufh $f8, $f8, $f16 \r\n"
+ "pshufh $f10, $f10, $f16 \r\n"
+ "packushb $f8, $f8, $f8 \r\n"
+ "packushb $f10, $f10, $f10 \r\n"
+ "psubusb $f12, $f4, $f2 \r\n"
+ "psubusb $f14, $f2, $f4 \r\n"
+ "or $f14, $f14, $f12 \r\n"
+ "psubusb $f12, $f2, $f0 \r\n"
+ "psubusb $f14, $f14, $f8 \r\n"
+ "psubusb $f8, $f0, $f2 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f12, $f4, $f6 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "psubusb $f8, $f6, $f4 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "pcmpeqb $f14, $f14, $f16 \r\n"
+ "pcmpeqb $f6, $f6, $f6 \r\n"
+ "gslwlc1 $f8, 0x3(%[tc0]) \r\n"
+ "gslwrc1 $f8, 0x0(%[tc0]) \r\n"
+ "punpcklbh $f8, $f8, $f8 \r\n"
+ "punpcklbh $f18, $f8, $f8 \r\n"
+ "pcmpgtb $f8, $f18, $f6 \r\n"
+ "ldc1 $f6, 0x0($9) \r\n"
+ "and $f20, $f8, $f14 \r\n"
+ "psubusb $f14, $f6, $f2 \r\n"
+ "psubusb $f12, $f2, $f6 \r\n"
+ "psubusb $f14, $f14, $f10 \r\n"
+ "psubusb $f12, $f12, $f10 \r\n"
+ "pcmpeqb $f12, $f12, $f14 \r\n"
+ "and $f12, $f12, $f20 \r\n"
+ "and $f8, $f20, $f18 \r\n"
+ "psubb $f14, $f8, $f12 \r\n"
+ "and $f12, $f12, $f8 \r\n"
+ "pavgb $f8, $f2, $f4 \r\n"
+ "ldc1 $f22, 0x0($9) \r\n"
+ "pavgb $f6, $f6, $f8 \r\n"
+ "xor $f8, $f8, $f22 \r\n"
+ "and $f8, $f8, %[ff_pb_1] \r\n"
+ "psubusb $f6, $f6, $f8 \r\n"
+ "psubusb $f8, $f0, $f12 \r\n"
+ "paddusb $f12, $f12, $f0 \r\n"
+ "pmaxub $f6, $f6, $f8 \r\n"
+ "pminub $f6, $f6, $f12 \r\n"
+ "gssdxc1 $f6, 0x0($9, %[stride]) \r\n"
+ "gsldxc1 $f8, 0x0(%[pix], $8) \r\n"
+ "psubusb $f6, $f8, $f4 \r\n"
+ "psubusb $f12, $f4, $f8 \r\n"
+ "psubusb $f6, $f6, $f10 \r\n"
+ "psubusb $f12, $f12, $f10 \r\n"
+ "pcmpeqb $f12, $f12, $f6 \r\n"
+ "and $f12, $f12, $f20 \r\n"
+ "psubb $f14, $f14, $f12 \r\n"
+ "and $f10, $f18, $f12 \r\n"
+ "gsldxc1 $f6, 0x0(%[pix], %[stride]) \r\n"
+ "pavgb $f12, $f2, $f4 \r\n"
+ "gsldxc1 $f22, 0x0(%[pix], $8) \r\n"
+ "pavgb $f8, $f8, $f12 \r\n"
+ "xor $f12, $f12, $f22 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "psubusb $f8, $f8, $f12 \r\n"
+ "psubusb $f12, $f6, $f10 \r\n"
+ "paddusb $f10, $f10, $f6 \r\n"
+ "pmaxub $f8, $f8, $f12 \r\n"
+ "pminub $f8, $f8, $f10 \r\n"
+ "gssdxc1 $f8, 0x0(%[pix], %[stride]) \r\n"
+ "xor $f10, $f2, $f4 \r\n"
+ "pcmpeqb $f8, $f8, $f8 \r\n"
+ "and $f10, $f10, %[ff_pb_1] \r\n"
+ "xor $f6, $f6, $f8 \r\n"
+ "xor $f8, $f8, $f2 \r\n"
+ "pavgb $f6, $f6, $f0 \r\n"
+ "pavgb $f6, $f6, %[ff_pb_3] \r\n"
+ "pavgb $f8, $f8, $f4 \r\n"
+ "pavgb $f6, $f6, $f10 \r\n"
+ "paddusb $f6, $f6, $f8 \r\n"
+ "psubusb $f12, %[ff_pb_A1], $f6 \r\n"
+ "psubusb $f6, $f6, %[ff_pb_A1] \r\n"
+ "pminub $f12, $f12, $f14 \r\n"
+ "pminub $f6, $f6, $f14 \r\n"
+ "psubusb $f2, $f2, $f12 \r\n"
+ "psubusb $f4, $f4, $f6 \r\n"
+ "paddusb $f2, $f2, $f6 \r\n"
+ "paddusb $f4, $f4, $f12 \r\n"
+ "gssdxc1 $f2, 0x0($9, $8) \r\n"
+ "sdc1 $f4, 0x0(%[pix]) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),
+ [alpha]"r"((int64_t)alpha),[beta]"r"((int64_t)beta),[tc0]"r"(tc0),
+ [ff_pb_1]"f"(ff_pb_1),[ff_pb_3]"f"(ff_pb_3),[ff_pb_A1]"f"(ff_pb_A1)
+ : "$8","$9","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20","$f22"
+ );
+}
+
+void ff_deblock_v8_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta)
+{
+ uint64_t stack[0xa];
+
+ __asm__ volatile (
+ "ori $8, $0, 0x1 \r\n"
+ "xor $f30, $f30, $f30 \r\n"
+ "dmtc1 $8, $f16 \r\n"
+ "dsll $8, %[stride], 2 \r\n"
+ "daddu $10, %[stride], %[stride] \r\n"
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "dsll $f20, $f16, $f16 \r\n"
+ "bltz %[alpha], 1f \r\n"
+ "daddu $9, $10, %[stride] \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "bltz %[beta], 1f \r\n"
+ "dsubu $8, $0, $8 \r\n"
+ "daddu $8, $8, %[pix] \r\n"
+ "ldc1 $f4, 0x0(%[pix]) \r\n"
+ "gsldxc1 $f0, 0x0($8, $10) \r\n"
+ "gsldxc1 $f2, 0x0($8, $9) \r\n"
+ "gsldxc1 $f6, 0x0(%[pix], %[stride]) \r\n"
+ "mtc1 %[alpha], $f8 \r\n"
+ "mtc1 %[beta], $f10 \r\n"
+ "pshufh $f8, $f8, $f30 \r\n"
+ "pshufh $f10, $f10, $f30 \r\n"
+ "packushb $f8, $f8, $f8 \r\n"
+ "psubusb $f12, $f4, $f2 \r\n"
+ "psubusb $f14, $f2, $f4 \r\n"
+ "packushb $f10, $f10, $f10 \r\n"
+ "or $f14, $f14, $f12 \r\n"
+ "sdc1 $f8, 0x10+%[stack] \r\n"
+ "psubusb $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f2, $f0 \r\n"
+ "psubusb $f8, $f0, $f2 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f4, $f6 \r\n"
+ "psubusb $f8, $f6, $f4 \r\n"
+ "or $f8, $f8, $f12 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "or $f14, $f14, $f8 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "ldc1 $f8, 0x10+%[stack] \r\n"
+ "pcmpeqb $f14, $f14, $f12 \r\n"
+ "sdc1 $f14, 0x20+%[stack] \r\n"
+ "pavgb $f8, $f8, $f30 \r\n"
+ "psubusb $f14, $f4, $f2 \r\n"
+ "pavgb $f8, $f8, %[ff_pb_1] \r\n"
+ "psubusb $f12, $f2, $f4 \r\n"
+ "psubusb $f14, $f14, $f8 \r\n"
+ "psubusb $f12, $f12, $f8 \r\n"
+ "ldc1 $f28, 0x20+%[stack] \r\n"
+ "pcmpeqb $f12, $f12, $f14 \r\n"
+ "and $f12, $f12, $f28 \r\n"
+ "gsldxc1 $f28, 0x0($8, %[stride]) \r\n"
+ "psubusb $f14, $f28, $f2 \r\n"
+ "psubusb $f8, $f2, $f28 \r\n"
+ "psubusb $f14, $f14, $f10 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "pcmpeqb $f8, $f8, $f14 \r\n"
+ "and $f8, $f8, $f12 \r\n"
+ "gsldxc1 $f26, 0x0(%[pix], $10) \r\n"
+ "sdc1 $f8, 0x30+%[stack] \r\n"
+ "psubusb $f14, $f26, $f4 \r\n"
+ "psubusb $f8, $f4, $f26 \r\n"
+ "psubusb $f14, $f14, $f10 \r\n"
+ "psubusb $f8, $f8, $f10 \r\n"
+ "pcmpeqb $f8, $f8, $f14 \r\n"
+ "and $f8, $f8, $f12 \r\n"
+ "sdc1 $f8, 0x40+%[stack] \r\n"
+ "pavgb $f8, $f28, $f0 \r\n"
+ "pavgb $f10, $f2, $f4 \r\n"
+ "pavgb $f8, $f8, $f10 \r\n"
+ "sdc1 $f10, 0x10+%[stack] \r\n"
+ "paddb $f12, $f28, $f0 \r\n"
+ "paddb $f14, $f2, $f4 \r\n"
+ "paddb $f12, $f12, $f14 \r\n"
+ "mov.d $f14, $f12 \r\n"
+ "sdc1 $f12, 0x0+%[stack] \r\n"
+ "psrlh $f12, $f12, $f16 \r\n"
+ "pavgb $f12, $f12, $f30 \r\n"
+ "xor $f12, $f12, $f8 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "psubb $f8, $f8, $f12 \r\n"
+ "pavgb $f10, $f28, $f6 \r\n"
+ "psubb $f12, $f28, $f6 \r\n"
+ "paddb $f14, $f14, $f14 \r\n"
+ "psubb $f14, $f14, $f12 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "psubb $f10, $f10, $f12 \r\n"
+ "ldc1 $f24, 0x10+%[stack] \r\n"
+ "pavgb $f10, $f10, $f0 \r\n"
+ "psrlh $f14, $f14, $f20 \r\n"
+ "pavgb $f10, $f10, $f24 \r\n"
+ "pavgb $f14, $f14, $f30 \r\n"
+ "xor $f14, $f14, $f10 \r\n"
+ "and $f14, $f14, %[ff_pb_1] \r\n"
+ "psubb $f10, $f10, $f14 \r\n"
+ "xor $f14, $f2, $f6 \r\n"
+ "pavgb $f12, $f2, $f6 \r\n"
+ "and $f14, $f14, %[ff_pb_1] \r\n"
+ "psubb $f12, $f12, $f14 \r\n"
+ "ldc1 $f24, 0x30+%[stack] \r\n"
+ "pavgb $f12, $f12, $f0 \r\n"
+ "ldc1 $f22, 0x20+%[stack] \r\n"
+ "xor $f10, $f10, $f12 \r\n"
+ "xor $f12, $f12, $f2 \r\n"
+ "and $f10, $f10, $f24 \r\n"
+ "and $f12, $f12, $f22 \r\n"
+ "xor $f10, $f10, $f12 \r\n"
+ "xor $f10, $f10, $f2 \r\n"
+ "gssdxc1 $f10, 0x0($8, $9) \r\n"
+ "ldc1 $f10, 0x0($8) \r\n"
+ "paddb $f12, $f28, $f10 \r\n"
+ "pavgb $f10, $f10, $f28 \r\n"
+ "ldc1 $f22, 0x0+%[stack] \r\n"
+ "pavgb $f10, $f10, $f8 \r\n"
+ "paddb $f12, $f12, $f12 \r\n"
+ "paddb $f12, $f12, $f22 \r\n"
+ "psrlh $f12, $f12, $f20 \r\n"
+ "pavgb $f12, $f12, $f30 \r\n"
+ "xor $f12, $f12, $f10 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "ldc1 $f22, 0x30+%[stack] \r\n"
+ "psubb $f10, $f10, $f12 \r\n"
+ "xor $f8, $f8, $f0 \r\n"
+ "xor $f10, $f10, $f28 \r\n"
+ "and $f8, $f8, $f22 \r\n"
+ "and $f10, $f10, $f22 \r\n"
+ "xor $f8, $f8, $f0 \r\n"
+ "xor $f10, $f10, $f28 \r\n"
+ "gssdxc1 $f8, 0x0($8, $10) \r\n"
+ "gssdxc1 $f10, 0x0($8, %[stride]) \r\n"
+ "pavgb $f8, $f26, $f6 \r\n"
+ "pavgb $f10, $f4, $f2 \r\n"
+ "pavgb $f8, $f8, $f10 \r\n"
+ "sdc1 $f10, 0x10+%[stack] \r\n"
+ "paddb $f12, $f26, $f6 \r\n"
+ "paddb $f14, $f4, $f2 \r\n"
+ "paddb $f12, $f12, $f14 \r\n"
+ "mov.d $f14, $f12 \r\n"
+ "sdc1 $f12, 0x0+%[stack] \r\n"
+ "psrlh $f12, $f12, $f16 \r\n"
+ "pavgb $f12, $f12, $f30 \r\n"
+ "xor $f12, $f12, $f8 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "psubb $f8, $f8, $f12 \r\n"
+ "pavgb $f10, $f26, $f0 \r\n"
+ "paddb $f14, $f14, $f14 \r\n"
+ "psubb $f12, $f26, $f0 \r\n"
+ "psubb $f14, $f14, $f12 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "psubb $f10, $f10, $f12 \r\n"
+ "ldc1 $f22, 0x10+%[stack] \r\n"
+ "pavgb $f10, $f10, $f6 \r\n"
+ "pavgb $f10, $f10, $f22 \r\n"
+ "psrlh $f14, $f14, $f20 \r\n"
+ "pavgb $f14, $f14, $f30 \r\n"
+ "xor $f14, $f14, $f10 \r\n"
+ "and $f14, $f14, %[ff_pb_1] \r\n"
+ "psubb $f10, $f10, $f14 \r\n"
+ "xor $f14, $f4, $f0 \r\n"
+ "pavgb $f12, $f4, $f0 \r\n"
+ "and $f14, $f14, %[ff_pb_1] \r\n"
+ "ldc1 $f22, 0x40+%[stack] \r\n"
+ "psubb $f12, $f12, $f14 \r\n"
+ "ldc1 $f24, 0x20+%[stack] \r\n"
+ "pavgb $f12, $f12, $f6 \r\n"
+ "xor $f10, $f10, $f12 \r\n"
+ "xor $f12, $f12, $f4 \r\n"
+ "and $f10, $f10, $f22 \r\n"
+ "and $f12, $f12, $f24 \r\n"
+ "xor $f10, $f10, $f12 \r\n"
+ "xor $f10, $f10, $f4 \r\n"
+ "sdc1 $f10, 0x0(%[pix]) \r\n"
+ "gsldxc1 $f10, 0x0(%[pix], $9) \r\n"
+ "paddb $f12, $f26, $f10 \r\n"
+ "pavgb $f10, $f10, $f26 \r\n"
+ "ldc1 $f22, 0x0+%[stack] \r\n"
+ "pavgb $f10, $f10, $f8 \r\n"
+ "paddb $f12, $f12, $f12 \r\n"
+ "paddb $f12, $f12, $f22 \r\n"
+ "psrlh $f12, $f12, $f20 \r\n"
+ "pavgb $f12, $f12, $f30 \r\n"
+ "xor $f12, $f12, $f10 \r\n"
+ "and $f12, $f12, %[ff_pb_1] \r\n"
+ "ldc1 $f22, 0x40+%[stack] \r\n"
+ "psubb $f10, $f10, $f12 \r\n"
+ "xor $f8, $f8, $f6 \r\n"
+ "xor $f10, $f10, $f26 \r\n"
+ "and $f8, $f8, $f22 \r\n"
+ "and $f10, $f10, $f22 \r\n"
+ "xor $f8, $f8, $f6 \r\n"
+ "xor $f10, $f10, $f26 \r\n"
+ "gssdxc1 $f8, 0x0(%[pix], %[stride]) \r\n"
+ "gssdxc1 $f10, 0x0(%[pix], $10) \r\n"
+ "1: \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),
+ [alpha]"r"((int64_t)alpha),[beta]"r"((int64_t)beta),
+ [stack]"m"(stack[0]),[ff_pb_1]"f"(ff_pb_1)
+ : "$8","$9","$10","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14",
+ "$f16","$f18","$f20","$f22","$f24","$f26","$f28","$f30"
+ );
+}
+
+void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0)
+{
+ __asm__ volatile (
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "or $16, $0, %[pix] \r\n"
+ "dsubu $16, $16, %[stride] \r\n"
+ "dsubu $16, $16, %[stride] \r\n"
+ "ldc1 $f0, 0x0($16) \r\n"
+ "gsldxc1 $f2, 0x0($16, %[stride]) \r\n"
+ "ldc1 $f4, 0x0(%[pix]) \r\n"
+ "gsldxc1 $f6, 0x0(%[pix], %[stride]) \r\n"
+ : [pix]"+r"(pix),[stride]"+r"(stride),[alpha]"+r"(alpha),
+ [beta]"+r"(beta)
+ : [tc0]"r"(tc0)
+ : "$16","$f2","$f4"
+ );
+
+ chroma_inter_body_mmi(pix, stride, alpha, beta, tc0);
+
+ __asm__ volatile (
+ "gssdxc1 $f2, 0x0($16, %[stride]) \r\n"
+ "sdc1 $f4, 0x0(%[pix]) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride)
+ : "$16","$f2","$f4"
+ );
+}
+
+void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta)
+{
+ __asm__ volatile (
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "or $16, $0, %[pix] \r\n"
+ "dsubu $16, $16, %[stride] \r\n"
+ "dsubu $16, $16, %[stride] \r\n"
+ "ldc1 $f0, 0x0($16) \r\n"
+ "gsldxc1 $f2, 0x0($16, %[stride]) \r\n"
+ "ldc1 $f4, 0x0(%[pix]) \r\n"
+ "gsldxc1 $f6, 0x0(%[pix], %[stride]) \r\n"
+ : [pix]"+r"(pix),[stride]"+r"(stride),[alpha]"+r"(alpha),
+ [beta]"+r"(beta)
+ ::"$16","$f0","$f2","$f4","$f6"
+ );
+
+ chroma_intra_body_mmi(pix, stride, alpha, beta);
+
+ __asm__ volatile (
+ "gssdxc1 $f2, 0x0($16, %[stride]) \r\n"
+ "sdc1 $f4, 0x0(%[pix]) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride)
+ : "$16","$f2","$f4"
+ );
+}
+
+void ff_deblock_h_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0)
+{
+ __asm__ volatile (
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "daddu $16, %[stride], %[stride] \r\n"
+ "daddiu %[pix], %[pix], -0x2 \r\n"
+ "daddu $17, $16, %[stride] \r\n"
+ "daddu $19, $16, $16 \r\n"
+ "or $18, $0, %[pix] \r\n"
+ "daddu %[pix], %[pix], $17 \r\n"
+ "gslwlc1 $f0, 0x3($18) \r\n"
+ "daddu $12, $18, %[stride] \r\n"
+ "gslwrc1 $f0, 0x0($18) \r\n"
+ "gslwlc1 $f4, 0x3($12) \r\n"
+ "daddu $13, $18, $16 \r\n"
+ "gslwrc1 $f4, 0x0($12) \r\n"
+ "gslwlc1 $f2, 0x3($13) \r\n"
+ "gslwrc1 $f2, 0x0($13) \r\n"
+ "gslwlc1 $f6, 0x3(%[pix]) \r\n"
+ "gslwrc1 $f6, 0x0(%[pix]) \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "punpcklbh $f2, $f2, $f6 \r\n"
+ "daddu $12, %[pix], %[stride] \r\n"
+ "punpckhhw $f4, $f0, $f2 \r\n"
+ "punpcklhw $f0, $f0, $f2 \r\n"
+ "gslwlc1 $f8, 0x3($12) \r\n"
+ "daddu $13, %[pix], $16 \r\n"
+ "gslwrc1 $f8, 0x0($12) \r\n"
+ "gslwlc1 $f12, 0x3($13) \r\n"
+ "daddu $12, %[pix], $17 \r\n"
+ "gslwrc1 $f12, 0x0($13) \r\n"
+ "gslwlc1 $f10, 0x3($12) \r\n"
+ "daddu $13, %[pix], $19 \r\n"
+ "gslwrc1 $f10, 0x0($12) \r\n"
+ "gslwlc1 $f14, 0x3($13) \r\n"
+ "gslwrc1 $f14, 0x0($13) \r\n"
+ "punpcklbh $f8, $f8, $f12 \r\n"
+ "punpcklbh $f10, $f10, $f14 \r\n"
+ "mov.d $f12, $f8 \r\n"
+ "punpcklhw $f8, $f8, $f10 \r\n"
+ "punpckhhw $f12, $f12, $f10 \r\n"
+ "punpckhwd $f2, $f0, $f8 \r\n"
+ "punpckhwd $f6, $f4, $f12 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpcklwd $f4, $f4, $f12 \r\n"
+ "mov.d $f20, $f0 \r\n"
+ "mov.d $f22, $f6 \r\n"
+ : [pix]"+r"(pix),[stride]"+r"(stride),[alpha]"+r"(alpha),
+ [beta]"+r"(beta)
+ ::"$12","$13","$16","$17","$18","$19","$f0","$f2","$f4","$f6","$f8",
+ "$f10","$f12","$f14","$f20","$f22"
+ );
+
+ chroma_inter_body_mmi(pix, stride, alpha, beta, tc0);
+
+ __asm__ volatile (
+ "punpckhwd $f8, $f20, $f20 \r\n"
+ "punpckhwd $f10, $f2, $f2 \r\n"
+ "punpckhwd $f12, $f4, $f4 \r\n"
+ "punpcklbh $f0, $f20, $f2 \r\n"
+ "punpcklbh $f4, $f4, $f22 \r\n"
+ "punpcklhw $f2, $f0, $f4 \r\n"
+ "punpckhhw $f0, $f0, $f4 \r\n"
+ "gsswlc1 $f2, 0x3($18) \r\n"
+ "gsswrc1 $f2, 0x0($18) \r\n"
+ "daddu $12, $18, %[stride] \r\n"
+ "punpckhwd $f2, $f2, $f2 \r\n"
+ "gsswlc1 $f2, 0x3($12) \r\n"
+ "daddu $13, $18, $16 \r\n"
+ "gsswrc1 $f2, 0x0($12) \r\n"
+ "gsswlc1 $f0, 0x3($13) \r\n"
+ "gsswrc1 $f0, 0x0($13) \r\n"
+ "punpckhwd $f0, $f0, $f0 \r\n"
+ "punpckhwd $f6, $f22, $f22 \r\n"
+ "gsswlc1 $f0, 0x3(%[pix]) \r\n"
+ "gsswrc1 $f0, 0x0(%[pix]) \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "punpcklbh $f12, $f12, $f6 \r\n"
+ "daddu $12, %[pix], %[stride] \r\n"
+ "punpcklhw $f10, $f8, $f12 \r\n"
+ "punpckhhw $f8, $f8, $f12 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "punpckhwd $f10, $f10, $f10 \r\n"
+ "daddu $12, %[pix], $16 \r\n"
+ "daddu $13, %[pix], $17 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "gsswlc1 $f8, 0x3($13) \r\n"
+ "daddu $12, %[pix], $19 \r\n"
+ "punpckhwd $f20, $f8, $f8 \r\n"
+ "gsswrc1 $f8, 0x0($13) \r\n"
+ "gsswlc1 $f20, 0x3($12) \r\n"
+ "gsswrc1 $f20, 0x0($12) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride)
+ : "$12","$13","$16","$17","$18","$19","$f0","$f2","$f4","$f6","$f8",
+ "$f10","$f12","$f20"
+ );
+}
+
+void ff_deblock_h_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta)
+{
+ __asm__ volatile (
+ "daddiu %[alpha], %[alpha], -0x1 \r\n"
+ "daddiu %[beta], %[beta], -0x1 \r\n"
+ "daddu $16, %[stride], %[stride] \r\n"
+ "daddiu %[pix], %[pix], -0x2 \r\n"
+ "daddu $17, $16, %[stride] \r\n"
+ "daddu $19, $16, $16 \r\n"
+ "or $18, $0, %[pix] \r\n"
+ "daddu %[pix], %[pix], $17 \r\n"
+ "gslwlc1 $f0, 0x3($18) \r\n"
+ "daddu $12, $18, %[stride] \r\n"
+ "gslwrc1 $f0, 0x0($18) \r\n"
+ "gslwlc1 $f4, 0x3($12) \r\n"
+ "daddu $13, $18, $16 \r\n"
+ "gslwrc1 $f4, 0x0($12) \r\n"
+ "gslwlc1 $f2, 0x3($13) \r\n"
+ "gslwrc1 $f2, 0x0($13) \r\n"
+ "gslwlc1 $f6, 0x3(%[pix]) \r\n"
+ "gslwrc1 $f6, 0x0(%[pix]) \r\n"
+ "punpcklbh $f0, $f0, $f4 \r\n"
+ "punpcklbh $f2, $f2, $f6 \r\n"
+ "daddu $12, %[pix], %[stride] \r\n"
+ "punpckhhw $f4, $f0, $f2 \r\n"
+ "punpcklhw $f0, $f0, $f2 \r\n"
+ "gslwlc1 $f8, 0x3($12) \r\n"
+ "daddu $13, %[pix], $16 \r\n"
+ "gslwrc1 $f8, 0x0($12) \r\n"
+ "gslwlc1 $f12, 0x3($13) \r\n"
+ "daddu $12, %[pix], $17 \r\n"
+ "gslwrc1 $f12, 0x0($13) \r\n"
+ "gslwlc1 $f10, 0x3($12) \r\n"
+ "daddu $13, %[pix], $19 \r\n"
+ "gslwrc1 $f10, 0x0($12) \r\n"
+ "gslwlc1 $f14, 0x3($13) \r\n"
+ "gslwrc1 $f14, 0x0($13) \r\n"
+ "punpcklbh $f8, $f8, $f12 \r\n"
+ "punpcklbh $f10, $f10, $f14 \r\n"
+ "mov.d $f12, $f8 \r\n"
+ "punpcklhw $f8, $f8, $f10 \r\n"
+ "punpckhhw $f12, $f12, $f10 \r\n"
+ "punpckhwd $f2, $f0, $f8 \r\n"
+ "punpckhwd $f6, $f4, $f12 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpcklwd $f4, $f4, $f12 \r\n"
+ : [pix]"+r"(pix),[stride]"+r"(stride),[alpha]"+r"(alpha),
+ [beta]"+r"(beta)
+ ::"$12","$13","$16","$17","$18","$19","$f0","$f2","$f4","$f6","$f8",
+ "$f10","$f12","$f14","$f20","$f22"
+ );
+
+ chroma_intra_body_mmi(pix, stride, alpha, beta);
+
+ __asm__ volatile (
+ "punpckhwd $f8, $f0, $f0 \r\n"
+ "punpckhwd $f10, $f2, $f2 \r\n"
+ "punpckhwd $f12, $f4, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpcklhw $f2, $f0, $f4 \r\n"
+ "punpckhhw $f0, $f0, $f4 \r\n"
+ "gsswlc1 $f2, 0x3($18) \r\n"
+ "gsswrc1 $f2, 0x0($18) \r\n"
+ "daddu $12, $18, %[stride] \r\n"
+ "punpckhwd $f2, $f2, $f2 \r\n"
+ "gsswlc1 $f2, 0x3($12) \r\n"
+ "daddu $13, $18, $16 \r\n"
+ "gsswrc1 $f2, 0x0($12) \r\n"
+ "gsswlc1 $f0, 0x3($13) \r\n"
+ "gsswrc1 $f0, 0x0($13) \r\n"
+ "punpckhwd $f0, $f0, $f0 \r\n"
+ "punpckhwd $f6, $f6, $f6 \r\n"
+ "gsswlc1 $f0, 0x3(%[pix]) \r\n"
+ "gsswrc1 $f0, 0x0(%[pix]) \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "punpcklbh $f12, $f12, $f6 \r\n"
+ "daddu $12, %[pix], %[stride] \r\n"
+ "punpcklhw $f10, $f8, $f12 \r\n"
+ "punpckhhw $f8, $f8, $f12 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "punpckhwd $f10, $f10, $f10 \r\n"
+ "daddu $12, %[pix], $16 \r\n"
+ "daddu $13, %[pix], $17 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "gsswlc1 $f8, 0x3($13) \r\n"
+ "daddu $12, %[pix], $19 \r\n"
+ "punpckhwd $f20, $f8, $f8 \r\n"
+ "gsswrc1 $f8, 0x0($13) \r\n"
+ "gsswlc1 $f20, 0x3($12) \r\n"
+ "gsswrc1 $f20, 0x0($12) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride)
+ : "$12","$13","$16","$17","$18","$19","$f0","$f2","$f4","$f6","$f8",
+ "$f10","$f12","$f20"
+ );
+}
+
+void ff_deblock_v_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0)
+{
+ if ((tc0[0] & tc0[1]) >= 0)
+ ff_deblock_v8_luma_8_mmi(pix + 0, stride, alpha, beta, tc0);
+ if ((tc0[2] & tc0[3]) >= 0)
+ ff_deblock_v8_luma_8_mmi(pix + 8, stride, alpha, beta, tc0 + 2);
+}
+
+void ff_deblock_v_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta)
+{
+ ff_deblock_v8_luma_intra_8_mmi(pix + 0, stride, alpha, beta);
+ ff_deblock_v8_luma_intra_8_mmi(pix + 8, stride, alpha, beta);
+}
+
+void ff_deblock_h_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
+ int8_t *tc0)
+{
+ uint64_t stack[0xd];
+
+ __asm__ volatile (
+ "daddu $15, %[stride], %[stride] \r\n"
+ "daddiu $8, %[pix], -0x4 \r\n"
+ "daddu $9, %[stride], $15 \r\n"
+ "gsldlc1 $f0, 0x7($8) \r\n"
+ "gsldrc1 $f0, 0x0($8) \r\n"
+ "daddu $12, $8, %[stride] \r\n"
+ "daddu $10, $8, $9 \r\n"
+ "gsldlc1 $f2, 0x7($12) \r\n"
+ "daddu $11, $8, $15 \r\n"
+ "gsldrc1 $f2, 0x0($12) \r\n"
+ "gsldlc1 $f4, 0x7($11) \r\n"
+ "gsldrc1 $f4, 0x0($11) \r\n"
+ "gsldlc1 $f6, 0x7($10) \r\n"
+ "daddu $12, $10, %[stride] \r\n"
+ "gsldrc1 $f6, 0x0($10) \r\n"
+ "gsldlc1 $f8, 0x7($12) \r\n"
+ "daddu $11, $10, $15 \r\n"
+ "gsldrc1 $f8, 0x0($12) \r\n"
+ "gsldlc1 $f10, 0x7($11) \r\n"
+ "daddu $12, $10, $9 \r\n"
+ "gsldrc1 $f10, 0x0($11) \r\n"
+ "gsldlc1 $f12, 0x7($12) \r\n"
+ "gsldrc1 $f12, 0x0($12) \r\n"
+ "daddu $14, $15, $15 \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "daddu $12, $10, $14 \r\n"
+ "sdc1 $f2, 0x10+%[stack] \r\n"
+ "gsldlc1 $f16, 0x7($12) \r\n"
+ "gsldrc1 $f16, 0x0($12) \r\n"
+ "daddu $13, $14, $14 \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "punpckhhw $f2, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "ldc1 $f16, 0x10+%[stack] \r\n"
+ "punpckhwd $f0, $f0, $f8 \r\n"
+ "sdc1 $f0, 0x0+%[stack] \r\n"
+ "punpckhhw $f12, $f14, $f16 \r\n"
+ "punpcklhw $f14, $f14, $f16 \r\n"
+ "punpckhhw $f0, $f6, $f10 \r\n"
+ "punpcklhw $f6, $f6, $f10 \r\n"
+ "punpcklwd $f12, $f12, $f0 \r\n"
+ "punpckhwd $f10, $f14, $f6 \r\n"
+ "punpcklwd $f14, $f14, $f6 \r\n"
+ "punpckhwd $f6, $f2, $f4 \r\n"
+ "punpcklwd $f2, $f2, $f4 \r\n"
+ "sdc1 $f2, 0x10+%[stack] \r\n"
+ "sdc1 $f6, 0x20+%[stack] \r\n"
+ "sdc1 $f14, 0x30+%[stack] \r\n"
+ "sdc1 $f10, 0x40+%[stack] \r\n"
+ "sdc1 $f12, 0x50+%[stack] \r\n"
+ "daddu $8, $8, $13 \r\n"
+ "daddu $10, $10, $13 \r\n"
+ "gsldlc1 $f0, 0x7($8) \r\n"
+ "daddu $12, $8, %[stride] \r\n"
+ "gsldrc1 $f0, 0x0($8) \r\n"
+ "gsldlc1 $f2, 0x7($12) \r\n"
+ "daddu $11, $8, $15 \r\n"
+ "gsldrc1 $f2, 0x0($12) \r\n"
+ "gsldlc1 $f4, 0x7($11) \r\n"
+ "gsldrc1 $f4, 0x0($11) \r\n"
+ "gsldlc1 $f6, 0x7($10) \r\n"
+ "daddu $12, $10, %[stride] \r\n"
+ "gsldrc1 $f6, 0x0($10) \r\n"
+ "gsldlc1 $f8, 0x7($12) \r\n"
+ "daddu $11, $10, $15 \r\n"
+ "gsldrc1 $f8, 0x0($12) \r\n"
+ "gsldlc1 $f10, 0x7($11) \r\n"
+ "daddu $12, $10, $9 \r\n"
+ "gsldrc1 $f10, 0x0($11) \r\n"
+ "gsldlc1 $f12, 0x7($12) \r\n"
+ "gsldrc1 $f12, 0x0($12) \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "daddu $12, $10, $14 \r\n"
+ "sdc1 $f2, 0x18+%[stack] \r\n"
+ "gsldlc1 $f16, 0x7($12) \r\n"
+ "gsldrc1 $f16, 0x0($12) \r\n"
+ "punpckhhw $f2, $f0, $f4 \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "punpckhwd $f0, $f0, $f8 \r\n"
+ "ldc1 $f16, 0x18+%[stack] \r\n"
+ "sdc1 $f0, 0x8+%[stack] \r\n"
+ "punpckhhw $f12, $f14, $f16 \r\n"
+ "punpcklhw $f14, $f14, $f16 \r\n"
+ "punpckhhw $f0, $f6, $f10 \r\n"
+ "punpcklhw $f6, $f6, $f10 \r\n"
+ "punpckhwd $f10, $f14, $f6 \r\n"
+ "punpcklwd $f14, $f14, $f6 \r\n"
+ "punpckhwd $f6, $f2, $f4 \r\n"
+ "punpcklwd $f2, $f2, $f4 \r\n"
+ "punpcklwd $f12, $f12, $f0 \r\n"
+ "sdc1 $f2, 0x18+%[stack] \r\n"
+ "sdc1 $f6, 0x28+%[stack] \r\n"
+ "sdc1 $f14, 0x38+%[stack] \r\n"
+ "sdc1 $f10, 0x48+%[stack] \r\n"
+ "sdc1 $f12, 0x58+%[stack] \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),[stack]"m"(stack[0])
+ : "$8","$9","$10","$11","$12","$13","$14","$15","$f0","$f2","$f4",
+ "$f6","$f8","$f10","$f12","$f14","$f16"
+ );
+
+ ff_deblock_v_luma_8_mmi((uint8_t *) &stack[6], 0x10, alpha, beta, tc0);
+
+ __asm__ volatile (
+ "daddu $15, %[stride], %[stride] \r\n"
+ "daddiu $8, %[pix], -0x2 \r\n"
+ "daddu $14, $15, $15 \r\n"
+ "daddu $9, $15, %[stride] \r\n"
+ "daddu $13, $14, $14 \r\n"
+ "daddu $10, $8, $9 \r\n"
+ "ldc1 $f0, 0x10+%[stack] \r\n"
+ "ldc1 $f2, 0x20+%[stack] \r\n"
+ "ldc1 $f4, 0x30+%[stack] \r\n"
+ "ldc1 $f6, 0x40+%[stack] \r\n"
+ "punpckhwd $f8, $f0, $f0 \r\n"
+ "punpckhwd $f10, $f2, $f2 \r\n"
+ "punpckhwd $f12, $f4, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpcklhw $f2, $f0, $f4 \r\n"
+ "punpckhhw $f0, $f0, $f4 \r\n"
+ "gsswlc1 $f2, 0x3($8) \r\n"
+ "gsswrc1 $f2, 0x0($8) \r\n"
+ "daddu $12, $8, %[stride] \r\n"
+ "punpckhwd $f2, $f2, $f2 \r\n"
+ "daddu $11, $8, $15 \r\n"
+ "gsswlc1 $f2, 0x3($12) \r\n"
+ "gsswrc1 $f2, 0x0($12) \r\n"
+ "gsswlc1 $f0, 0x3($11) \r\n"
+ "gsswrc1 $f0, 0x0($11) \r\n"
+ "punpckhwd $f0, $f0, $f0 \r\n"
+ "punpckhwd $f6, $f6, $f6 \r\n"
+ "gsswlc1 $f0, 0x3($10) \r\n"
+ "gsswrc1 $f0, 0x0($10) \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "punpcklbh $f12, $f12, $f6 \r\n"
+ "punpcklhw $f10, $f8, $f12 \r\n"
+ "daddu $12, $10, %[stride] \r\n"
+ "punpckhhw $f8, $f8, $f12 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "daddu $12, $10, $15 \r\n"
+ "punpckhwd $f10, $f10, $f10 \r\n"
+ "daddu $11, $10, $9 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "gsswlc1 $f8, 0x3($11) \r\n"
+ "gsswrc1 $f8, 0x0($11) \r\n"
+ "daddu $12, $10, $14 \r\n"
+ "punpckhwd $f8, $f8, $f8 \r\n"
+ "daddu $8, $8, $13 \r\n"
+ "gsswlc1 $f8, 0x3($12) \r\n"
+ "gsswrc1 $f8, 0x0($12) \r\n"
+ "daddu $10, $10, $13 \r\n"
+ "ldc1 $f0, 0x18+%[stack] \r\n"
+ "ldc1 $f2, 0x28+%[stack] \r\n"
+ "ldc1 $f4, 0x38+%[stack] \r\n"
+ "ldc1 $f6, 0x48+%[stack] \r\n"
+ "daddu $15, %[stride], %[stride] \r\n"
+ "punpckhwd $f8, $f0, $f0 \r\n"
+ "daddu $14, $15, $15 \r\n"
+ "punpckhwd $f10, $f2, $f2 \r\n"
+ "punpckhwd $f12, $f4, $f4 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "daddu $12, $8, %[stride] \r\n"
+ "punpcklhw $f2, $f0, $f4 \r\n"
+ "punpckhhw $f0, $f0, $f4 \r\n"
+ "gsswlc1 $f2, 0x3($8) \r\n"
+ "gsswrc1 $f2, 0x0($8) \r\n"
+ "punpckhwd $f2, $f2, $f2 \r\n"
+ "daddu $11, $8, $15 \r\n"
+ "gsswlc1 $f2, 0x3($12) \r\n"
+ "gsswrc1 $f2, 0x0($12) \r\n"
+ "gsswlc1 $f0, 0x3($11) \r\n"
+ "gsswrc1 $f0, 0x0($11) \r\n"
+ "punpckhwd $f0, $f0, $f0 \r\n"
+ "punpckhwd $f6, $f6, $f6 \r\n"
+ "gsswlc1 $f0, 0x3($10) \r\n"
+ "gsswrc1 $f0, 0x0($10) \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "punpcklbh $f12, $f12, $f6 \r\n"
+ "daddu $12, $10, %[stride] \r\n"
+ "punpcklhw $f10, $f8, $f12 \r\n"
+ "punpckhhw $f8, $f8, $f12 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "daddu $12, $10, $15 \r\n"
+ "punpckhwd $f10, $f10, $f10 \r\n"
+ "daddu $11, $10, $9 \r\n"
+ "gsswlc1 $f10, 0x3($12) \r\n"
+ "gsswrc1 $f10, 0x0($12) \r\n"
+ "gsswlc1 $f8, 0x3($11) \r\n"
+ "gsswrc1 $f8, 0x0($11) \r\n"
+ "daddu $12, $10, $14 \r\n"
+ "punpckhwd $f8, $f8, $f8 \r\n"
+ "gsswlc1 $f8, 0x3($12) \r\n"
+ "gsswrc1 $f8, 0x0($12) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((int64_t)stride),[stack]"m"(stack[0])
+ : "$8","$9","$10","$11","$12","$13","$14","$15","$f0","$f2","$f4",
+ "$f6","$f8","$f10","$f12","$f14","$f16"
+ );
+}
+
+void ff_deblock_h_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
+ int beta)
+{
+ uint64_t ptmp[0x11];
+ uint64_t pdat[4];
+
+ __asm__ volatile (
+ "daddu $12, %[stride], %[stride] \r\n"
+ "daddiu $10, %[pix], -0x4 \r\n"
+ "daddu $11, $12, %[stride] \r\n"
+ "daddu $13, $12, $12 \r\n"
+ "daddu $9, $10, $11 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "gsldlc1 $f0, 0x7($10) \r\n"
+ "gsldrc1 $f0, 0x0($10) \r\n"
+ "daddu $14, $10, $12 \r\n"
+ "gsldlc1 $f2, 0x7($8) \r\n"
+ "gsldrc1 $f2, 0x0($8) \r\n"
+ "gsldlc1 $f4, 0x7($14) \r\n"
+ "gsldrc1 $f4, 0x0($14) \r\n"
+ "daddu $8, $9, %[stride] \r\n"
+ "gsldlc1 $f6, 0x7($9) \r\n"
+ "gsldrc1 $f6, 0x0($9) \r\n"
+ "daddu $14, $9, $12 \r\n"
+ "gsldlc1 $f8, 0x7($8) \r\n"
+ "gsldrc1 $f8, 0x0($8) \r\n"
+ "daddu $8, $9, $11 \r\n"
+ "gsldlc1 $f10, 0x7($14) \r\n"
+ "gsldrc1 $f10, 0x0($14) \r\n"
+ "gsldlc1 $f12, 0x7($8) \r\n"
+ "gsldrc1 $f12, 0x0($8) \r\n"
+ "daddu $8, $9, $13 \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "gsldlc1 $f16, 0x7($8) \r\n"
+ "gsldrc1 $f16, 0x0($8) \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "sdc1 $f6, 0x0+%[ptmp] \r\n"
+ "punpckhhw $f6, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "punpckhhw $f12, $f14, $f2 \r\n"
+ "punpcklhw $f14, $f14, $f2 \r\n"
+ "sdc1 $f4, 0x20+%[ptmp] \r\n"
+ "ldc1 $f4, 0x0+%[ptmp] \r\n"
+ "punpckhhw $f2, $f4, $f10 \r\n"
+ "punpcklhw $f4, $f4, $f10 \r\n"
+ "punpckhwd $f10, $f0, $f8 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpckhwd $f8, $f14, $f4 \r\n"
+ "punpcklwd $f14, $f14, $f4 \r\n"
+ "sdc1 $f0, 0x0+%[ptmp] \r\n"
+ "sdc1 $f10, 0x10+%[ptmp] \r\n"
+ "sdc1 $f14, 0x40+%[ptmp] \r\n"
+ "sdc1 $f8, 0x50+%[ptmp] \r\n"
+ "ldc1 $f16, 0x20+%[ptmp] \r\n"
+ "punpckhwd $f0, $f6, $f16 \r\n"
+ "punpcklwd $f6, $f6, $f16 \r\n"
+ "punpckhwd $f10, $f12, $f2 \r\n"
+ "punpcklwd $f12, $f12, $f2 \r\n"
+ "daddu $8, $13, $13 \r\n"
+ "sdc1 $f6, 0x20+%[ptmp] \r\n"
+ "sdc1 $f0, 0x30+%[ptmp] \r\n"
+ "sdc1 $f12, 0x60+%[ptmp] \r\n"
+ "sdc1 $f10, 0x70+%[ptmp] \r\n"
+ "daddu $10, $10, $8 \r\n"
+ "daddu $9, $9, $8 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "gsldlc1 $f0, 0x7($10) \r\n"
+ "gsldrc1 $f0, 0x0($10) \r\n"
+ "daddu $14, $10, $12 \r\n"
+ "gsldlc1 $f2, 0x7($8) \r\n"
+ "gsldrc1 $f2, 0x0($8) \r\n"
+ "gsldlc1 $f4, 0x7($14) \r\n"
+ "gsldrc1 $f4, 0x0($14) \r\n"
+ "daddu $8, $9, %[stride] \r\n"
+ "gsldlc1 $f6, 0x7($9) \r\n"
+ "gsldrc1 $f6, 0x0($9) \r\n"
+ "daddu $14, $9, $12 \r\n"
+ "gsldlc1 $f8, 0x7($8) \r\n"
+ "gsldrc1 $f8, 0x0($8) \r\n"
+ "daddu $8, $9, $11 \r\n"
+ "gsldlc1 $f10, 0x7($14) \r\n"
+ "gsldrc1 $f10, 0x0($14) \r\n"
+ "gsldlc1 $f12, 0x7($8) \r\n"
+ "gsldrc1 $f12, 0x0($8) \r\n"
+ "daddu $8, $9, $13 \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "gsldlc1 $f16, 0x7($8) \r\n"
+ "gsldrc1 $f16, 0x0($8) \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "sdc1 $f6, 0x8+%[ptmp] \r\n"
+ "punpckhhw $f6, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "punpckhhw $f12, $f14, $f2 \r\n"
+ "punpcklhw $f14, $f14, $f2 \r\n"
+ "sdc1 $f4, 0x28+%[ptmp] \r\n"
+ "ldc1 $f4, 0x8+%[ptmp] \r\n"
+ "punpckhhw $f2, $f4, $f10 \r\n"
+ "punpcklhw $f4, $f4, $f10 \r\n"
+ "punpckhwd $f10, $f0, $f8 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpckhwd $f8, $f14, $f4 \r\n"
+ "punpcklwd $f14, $f14, $f4 \r\n"
+ "sdc1 $f0, 0x8+%[ptmp] \r\n"
+ "sdc1 $f10, 0x18+%[ptmp] \r\n"
+ "sdc1 $f14, 0x48+%[ptmp] \r\n"
+ "sdc1 $f8, 0x58+%[ptmp] \r\n"
+ "ldc1 $f16, 0x28+%[ptmp] \r\n"
+ "punpckhwd $f0, $f6, $f16 \r\n"
+ "punpcklwd $f6, $f6, $f16 \r\n"
+ "punpckhwd $f10, $f12, $f2 \r\n"
+ "punpcklwd $f12, $f12, $f2 \r\n"
+ "sdc1 $f6, 0x28+%[ptmp] \r\n"
+ "sdc1 $f0, 0x38+%[ptmp] \r\n"
+ "sdc1 $f12, 0x68+%[ptmp] \r\n"
+ "sdc1 $f10, 0x78+%[ptmp] \r\n"
+ "sd $10, 0x00+%[pdat] \r\n"
+ "sd $11, 0x08+%[pdat] \r\n"
+ "sd $12, 0x10+%[pdat] \r\n"
+ "sd $13, 0x18+%[pdat] \r\n"
+ ::[pix]"r"(pix),[stride]"r"((uint64_t)stride),[ptmp]"m"(ptmp[0]),
+ [pdat]"m"(pdat[0])
+ : "$8","$9","$10","$11","$12","$13","$14","$f0","$f2","$f4","$f6",
+ "$f8","$f10","$f12","$f14","$f16"
+ );
+
+ ff_deblock_v_luma_intra_8_mmi((uint8_t *) &ptmp[8], 0x10, alpha, beta);
+
+ __asm__ volatile (
+ "ld $10, 0x00+%[pdat] \r\n"
+ "ld $11, 0x08+%[pdat] \r\n"
+ "ld $12, 0x10+%[pdat] \r\n"
+ "ld $13, 0x18+%[pdat] \r\n"
+ "daddu $9, $10, $11 \r\n"
+ "ldc1 $f0, 0x8+%[ptmp] \r\n"
+ "ldc1 $f2, 0x18+%[ptmp] \r\n"
+ "ldc1 $f4, 0x28+%[ptmp] \r\n"
+ "ldc1 $f6, 0x38+%[ptmp] \r\n"
+ "ldc1 $f8, 0x48+%[ptmp] \r\n"
+ "ldc1 $f10, 0x58+%[ptmp] \r\n"
+ "ldc1 $f12, 0x68+%[ptmp] \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "ldc1 $f16, 0x78+%[ptmp] \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "gssdlc1 $f6, 0x7($10) \r\n"
+ "gssdrc1 $f6, 0x0($10) \r\n"
+ "daddu $8, $10, $12 \r\n"
+ "punpckhhw $f6, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "punpckhhw $f12, $f14, $f2 \r\n"
+ "punpcklhw $f14, $f14, $f2 \r\n"
+ "gssdlc1 $f4, 0x7($8) \r\n"
+ "gssdrc1 $f4, 0x0($8) \r\n"
+ "gsldlc1 $f4, 0x7($10) \r\n"
+ "gsldrc1 $f4, 0x0($10) \r\n"
+ "punpckhhw $f2, $f4, $f10 \r\n"
+ "punpcklhw $f4, $f4, $f10 \r\n"
+ "punpckhwd $f10, $f0, $f8 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpckhwd $f8, $f14, $f4 \r\n"
+ "punpcklwd $f14, $f14, $f4 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "gssdlc1 $f0, 0x7($10) \r\n"
+ "gssdrc1 $f0, 0x0($10) \r\n"
+ "daddu $14, $9, %[stride] \r\n"
+ "gssdlc1 $f10, 0x7($8) \r\n"
+ "gssdrc1 $f10, 0x0($8) \r\n"
+ "daddu $8, $9, $12 \r\n"
+ "gssdlc1 $f14, 0x7($14) \r\n"
+ "gssdrc1 $f14, 0x0($14) \r\n"
+ "daddu $14, $10, $12 \r\n"
+ "gssdlc1 $f8, 0x7($8) \r\n"
+ "gssdrc1 $f8, 0x0($8) \r\n"
+ "gsldlc1 $f16, 0x7($14) \r\n"
+ "gsldrc1 $f16, 0x0($14) \r\n"
+ "daddu $8, $10, $12 \r\n"
+ "punpckhwd $f0, $f6, $f16 \r\n"
+ "punpcklwd $f6, $f6, $f16 \r\n"
+ "punpckhwd $f10, $f12, $f2 \r\n"
+ "punpcklwd $f12, $f12, $f2 \r\n"
+ "gssdlc1 $f6, 0x7($8) \r\n"
+ "gssdrc1 $f6, 0x0($8) \r\n"
+ "daddu $8, $9, $11 \r\n"
+ "gssdlc1 $f0, 0x7($9) \r\n"
+ "gssdrc1 $f0, 0x0($9) \r\n"
+ "daddu $14, $9, $13 \r\n"
+ "gssdlc1 $f12, 0x7($8) \r\n"
+ "gssdrc1 $f12, 0x0($8) \r\n"
+ "daddu $8, $13, $13 \r\n"
+ "gssdlc1 $f10, 0x7($14) \r\n"
+ "gssdrc1 $f10, 0x0($14) \r\n"
+ "dsubu $10, $10, $8 \r\n"
+ "dsubu $9, $9, $8 \r\n"
+ "ldc1 $f0, 0x0+%[ptmp] \r\n"
+ "ldc1 $f2, 0x10+%[ptmp] \r\n"
+ "ldc1 $f4, 0x20+%[ptmp] \r\n"
+ "ldc1 $f6, 0x30+%[ptmp] \r\n"
+ "ldc1 $f8, 0x40+%[ptmp] \r\n"
+ "ldc1 $f10, 0x50+%[ptmp] \r\n"
+ "ldc1 $f12, 0x60+%[ptmp] \r\n"
+ "punpckhbh $f14, $f0, $f2 \r\n"
+ "punpcklbh $f0, $f0, $f2 \r\n"
+ "punpckhbh $f2, $f4, $f6 \r\n"
+ "punpcklbh $f4, $f4, $f6 \r\n"
+ "punpckhbh $f6, $f8, $f10 \r\n"
+ "punpcklbh $f8, $f8, $f10 \r\n"
+ "ldc1 $f16, 0x70+%[ptmp] \r\n"
+ "punpckhbh $f10, $f12, $f16 \r\n"
+ "punpcklbh $f12, $f12, $f16 \r\n"
+ "gssdlc1 $f6, 0x7($10) \r\n"
+ "gssdrc1 $f6, 0x0($10) \r\n"
+ "daddu $8, $10, $12 \r\n"
+ "punpckhhw $f6, $f0, $f4 \r\n"
+ "punpcklhw $f0, $f0, $f4 \r\n"
+ "punpckhhw $f4, $f8, $f12 \r\n"
+ "punpcklhw $f8, $f8, $f12 \r\n"
+ "punpckhhw $f12, $f14, $f2 \r\n"
+ "punpcklhw $f14, $f14, $f2 \r\n"
+ "gssdlc1 $f4, 0x7($8) \r\n"
+ "gssdrc1 $f4, 0x0($8) \r\n"
+ "gsldlc1 $f4, 0x7($10) \r\n"
+ "gsldrc1 $f4, 0x0($10) \r\n"
+ "punpckhhw $f2, $f4, $f10 \r\n"
+ "punpcklhw $f4, $f4, $f10 \r\n"
+ "punpckhwd $f10, $f0, $f8 \r\n"
+ "punpcklwd $f0, $f0, $f8 \r\n"
+ "punpckhwd $f8, $f14, $f4 \r\n"
+ "punpcklwd $f14, $f14, $f4 \r\n"
+ "daddu $8, $10, %[stride] \r\n"
+ "gssdlc1 $f0, 0x7($10) \r\n"
+ "gssdrc1 $f0, 0x0($10) \r\n"
+ "daddu $14, $9, %[stride] \r\n"
+ "gssdlc1 $f10, 0x7($8) \r\n"
+ "gssdrc1 $f10, 0x0($8) \r\n"
+ "daddu $8, $9, $12 \r\n"
+ "gssdlc1 $f14, 0x7($14) \r\n"
+ "gssdrc1 $f14, 0x0($14) \r\n"
+ "daddu $14, $10, $12 \r\n"
+ "gssdlc1 $f8, 0x7($8) \r\n"
+ "gssdrc1 $f8, 0x0($8) \r\n"
+ "gsldlc1 $f16, 0x7($14) \r\n"
+ "gsldrc1 $f16, 0x0($14) \r\n"
+ "daddu $8, $10, $12 \r\n"
+ "punpckhwd $f0, $f6, $f16 \r\n"
+ "punpcklwd $f6, $f6, $f16 \r\n"
+ "punpckhwd $f10, $f12, $f2 \r\n"
+ "punpcklwd $f12, $f12, $f2 \r\n"
+ "gssdlc1 $f6, 0x7($8) \r\n"
+ "gssdrc1 $f6, 0x0($8) \r\n"
+ "daddu $8, $9, $11 \r\n"
+ "gssdlc1 $f0, 0x7($9) \r\n"
+ "gssdrc1 $f0, 0x0($9) \r\n"
+ "daddu $14, $9, $13 \r\n"
+ "gssdlc1 $f12, 0x7($8) \r\n"
+ "gssdrc1 $f12, 0x0($8) \r\n"
+ "gssdlc1 $f10, 0x7($14) \r\n"
+ "gssdrc1 $f10, 0x0($14) \r\n"
+ ::[pix]"r"(pix),[stride]"r"((uint64_t)stride),[ptmp]"m"(ptmp[0]),
+ [pdat]"m"(pdat[0])
+ : "$8","$9","$10","$11","$12","$13","$14","$f0","$f2","$f4","$f6",
+ "$f8","$f10","$f12","$f14","$f16"
+ );
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_init_mips.c
index 27ff10f50d8..93a2409a0fd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_init_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_init_mips.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
*
* This file is part of FFmpeg.
*
@@ -20,6 +21,7 @@
#include "config.h"
#include "h264dsp_mips.h"
+#include "h264pred_mips.h"
#if HAVE_MSA
static av_cold void h264_pred_init_msa(H264PredContext *h, int codec_id,
@@ -94,6 +96,53 @@ static av_cold void h264_pred_init_msa(H264PredContext *h, int codec_id,
}
#endif // #if HAVE_MSA
+#if HAVE_MMI
+static av_cold void h264_pred_init_mmi(H264PredContext *h, int codec_id,
+ const int bit_depth, const int chroma_format_idc)
+{
+ if (bit_depth == 8) {
+ if (chroma_format_idc == 1) {
+ h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_8_mmi;
+ h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmi;
+ } else {
+ h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x16_vertical_8_mmi;
+ h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x16_horizontal_8_mmi;
+ }
+
+ h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmi;
+ h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_8_mmi;
+ h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmi;
+ h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmi;
+ h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmi;
+
+ switch (codec_id) {
+ case AV_CODEC_ID_SVQ3:
+ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_8_mmi;
+ ;
+ break;
+ case AV_CODEC_ID_RV40:
+ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_8_mmi;
+ ;
+ break;
+ case AV_CODEC_ID_VP7:
+ case AV_CODEC_ID_VP8:
+ ;
+ break;
+ default:
+ h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_8_mmi;
+ break;
+ }
+
+ if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
+ if (chroma_format_idc == 1) {
+ h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_8_mmi;
+ h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmi;
+ }
+ }
+ }
+}
+#endif /* HAVE_MMI */
+
av_cold void ff_h264_pred_init_mips(H264PredContext *h, int codec_id,
int bit_depth,
const int chroma_format_idc)
@@ -101,4 +150,7 @@ av_cold void ff_h264_pred_init_mips(H264PredContext *h, int codec_id,
#if HAVE_MSA
h264_pred_init_msa(h, codec_id, bit_depth, chroma_format_idc);
#endif // #if HAVE_MSA
+#if HAVE_MMI
+ h264_pred_init_mmi(h, codec_id, bit_depth, chroma_format_idc);
+#endif /* HAVE_MMI */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mips.h
new file mode 100644
index 00000000000..d7d12c5a20b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mips.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 H264_PRED_MIPS_H
+#define H264_PRED_MIPS_H
+
+#include "constants.h"
+#include "libavcodec/h264pred.h"
+
+void ff_pred16x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_dc_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8l_top_dc_8_mmi(uint8_t *src, int has_topleft, int has_topright,
+ ptrdiff_t stride);
+void ff_pred8x8l_dc_8_mmi(uint8_t *src, int has_topleft, int has_topright,
+ ptrdiff_t stride);
+void ff_pred8x8l_vertical_8_mmi(uint8_t *src, int has_topleft,
+ int has_topright, ptrdiff_t stride);
+void ff_pred4x4_dc_8_mmi(uint8_t *src, const uint8_t *topright,
+ ptrdiff_t stride);
+void ff_pred8x8_vertical_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_plane_svq3_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_plane_rv40_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred16x16_plane_h264_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_top_dc_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x8_dc_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride);
+void ff_pred8x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride);
+
+#endif /* H264_PRED_MIPS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mmi.c
new file mode 100644
index 00000000000..e949d1116ac
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264pred_mmi.c
@@ -0,0 +1,780 @@
+/*
+ * Loongson SIMD optimized h264pred
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ * Zhang Shuangshuang <zhangshuangshuang@ict.ac.cn>
+ *
+ * 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 "h264pred_mips.h"
+
+void ff_pred16x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "dli $8, 16 \r\n"
+ "gsldlc1 $f2, 7(%[srcA]) \r\n"
+ "gsldrc1 $f2, 0(%[srcA]) \r\n"
+ "gsldlc1 $f4, 15(%[srcA]) \r\n"
+ "gsldrc1 $f4, 8(%[srcA]) \r\n"
+ "1: \r\n"
+ "gssdlc1 $f2, 7(%[src]) \r\n"
+ "gssdrc1 $f2, 0(%[src]) \r\n"
+ "gssdlc1 $f4, 15(%[src]) \r\n"
+ "gssdrc1 $f4, 8(%[src]) \r\n"
+ "daddu %[src], %[src], %[stride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [src]"+&r"(src)
+ : [stride]"r"(stride),[srcA]"r"(src-stride)
+ : "$8","$f2","$f4"
+ );
+}
+
+void ff_pred16x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "daddiu $2, %[src], -1 \r\n"
+ "daddu $3, %[src], $0 \r\n"
+ "dli $6, 0x10 \r\n"
+ "1: \r\n"
+ "lbu $4, 0($2) \r\n"
+ "dmul $5, $4, %[ff_pb_1] \r\n"
+ "sdl $5, 7($3) \r\n"
+ "sdr $5, 0($3) \r\n"
+ "sdl $5, 15($3) \r\n"
+ "sdr $5, 8($3) \r\n"
+ "daddu $2, %[stride] \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddiu $6, -1 \r\n"
+ "bnez $6, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[ff_pb_1]"r"(ff_pb_1)
+ : "$2","$3","$4","$5","$6"
+ );
+}
+
+void ff_pred16x16_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "daddiu $2, %[src], -1 \r\n"
+ "dli $6, 0x10 \r\n"
+ "xor $8, $8, $8 \r\n"
+ "1: \r\n"
+ "lbu $4, 0($2) \r\n"
+ "daddu $8, $8, $4 \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "daddiu $6, $6, -1 \r\n"
+ "bnez $6, 1b \r\n"
+ "dli $6, 0x10 \r\n"
+ "negu $3, %[stride] \r\n"
+ "daddu $2, %[src], $3 \r\n"
+ "2: \r\n"
+ "lbu $4, 0($2) \r\n"
+ "daddu $8, $8, $4 \r\n"
+ "daddiu $2, $2, 1 \r\n"
+ "daddiu $6, $6, -1 \r\n"
+ "bnez $6, 2b \r\n"
+ "daddiu $8, $8, 0x10 \r\n"
+ "dsra $8, 5 \r\n"
+ "dmul $5, $8, %[ff_pb_1] \r\n"
+ "daddu $2, %[src], $0 \r\n"
+ "dli $6, 0x10 \r\n"
+ "3: \r\n"
+ "sdl $5, 7($2) \r\n"
+ "sdr $5, 0($2) \r\n"
+ "sdl $5, 15($2) \r\n"
+ "sdr $5, 8($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "daddiu $6, $6, -1 \r\n"
+ "bnez $6, 3b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[ff_pb_1]"r"(ff_pb_1)
+ : "$2","$3","$4","$5","$6","$8"
+ );
+}
+
+void ff_pred8x8l_top_dc_8_mmi(uint8_t *src, int has_topleft,
+ int has_topright, ptrdiff_t stride)
+{
+ uint32_t dc;
+
+ __asm__ volatile (
+ "ldl $8, 7(%[srcA]) \r\n"
+ "ldr $8, 0(%[srcA]) \r\n"
+ "ldl $9, 7(%[src0]) \r\n"
+ "ldr $9, 0(%[src0]) \r\n"
+ "ldl $10, 7(%[src1]) \r\n"
+ "ldr $10, 0(%[src1]) \r\n"
+ "dmtc1 $8, $f2 \r\n"
+ "dmtc1 $9, $f4 \r\n"
+ "dmtc1 $10, $f6 \r\n"
+ "dmtc1 $0, $f0 \r\n"
+ "punpcklbh $f8, $f2, $f0 \r\n"
+ "punpckhbh $f10, $f2, $f0 \r\n"
+ "punpcklbh $f12, $f4, $f0 \r\n"
+ "punpckhbh $f14, $f4, $f0 \r\n"
+ "punpcklbh $f16, $f6, $f0 \r\n"
+ "punpckhbh $f18, $f6, $f0 \r\n"
+ "bnez %[has_topleft], 1f \r\n"
+ "pinsrh_0 $f8, $f8, $f12 \r\n"
+ "1: \r\n"
+ "bnez %[has_topright], 2f \r\n"
+ "pinsrh_3 $f18, $f18, $f14 \r\n"
+ "2: \r\n"
+ "daddiu $8, $0, 2 \r\n"
+ "dmtc1 $8, $f20 \r\n"
+ "pshufh $f22, $f20, $f0 \r\n"
+ "pmullh $f12, $f12, $f22 \r\n"
+ "pmullh $f14, $f14, $f22 \r\n"
+ "paddh $f8, $f8, $f12 \r\n"
+ "paddh $f10, $f10, $f14 \r\n"
+ "paddh $f8, $f8, $f16 \r\n"
+ "paddh $f10, $f10, $f18 \r\n"
+ "paddh $f8, $f8, $f22 \r\n"
+ "paddh $f10, $f10, $f22 \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "packushb $f4, $f8, $f10 \r\n"
+ "biadd $f2, $f4 \r\n"
+ "mfc1 $9, $f2 \r\n"
+ "addiu $9, $9, 4 \r\n"
+ "dsrl $9, $9, 3 \r\n"
+ "mul %[dc], $9, %[ff_pb_1] \r\n"
+ : [dc]"=r"(dc)
+ : [srcA]"r"(src-stride-1),[src0]"r"(src-stride),
+ [src1]"r"(src-stride+1),[has_topleft]"r"(has_topleft),
+ [has_topright]"r"(has_topright),[ff_pb_1]"r"(ff_pb_1)
+ : "$8","$9","$10","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20","$f22"
+ );
+
+ __asm__ volatile (
+ "dli $8, 8 \r\n"
+ "1: \r\n"
+ "punpcklwd $f2, %[dc], %[dc] \r\n"
+ "gssdlc1 $f2, 7(%[src]) \r\n"
+ "gssdrc1 $f2, 0(%[src]) \r\n"
+ "daddu %[src], %[src], %[stride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [src]"+&r"(src)
+ : [dc]"f"(dc),[stride]"r"(stride)
+ : "$8","$f2"
+ );
+}
+
+void ff_pred8x8l_dc_8_mmi(uint8_t *src, int has_topleft,
+ int has_topright, ptrdiff_t stride)
+{
+ uint32_t dc, dc1, dc2;
+
+ const int l0 = ((has_topleft ? src[-1+-1*stride] : src[-1+0*stride]) + 2*src[-1+0*stride] + src[-1+1*stride] + 2) >> 2;
+ const int l1 = (src[-1+0*stride] + 2*src[-1+1*stride] + src[-1+2*stride] + 2) >> 2;
+ const int l2 = (src[-1+1*stride] + 2*src[-1+2*stride] + src[-1+3*stride] + 2) >> 2;
+ const int l3 = (src[-1+2*stride] + 2*src[-1+3*stride] + src[-1+4*stride] + 2) >> 2;
+ const int l4 = (src[-1+3*stride] + 2*src[-1+4*stride] + src[-1+5*stride] + 2) >> 2;
+ const int l5 = (src[-1+4*stride] + 2*src[-1+5*stride] + src[-1+6*stride] + 2) >> 2;
+ const int l6 = (src[-1+5*stride] + 2*src[-1+6*stride] + src[-1+7*stride] + 2) >> 2;
+ const int l7 = (src[-1+6*stride] + 2*src[-1+7*stride] + src[-1+7*stride] + 2) >> 2;
+
+ __asm__ volatile (
+ "ldl $8, 7(%[srcA]) \r\n"
+ "ldr $8, 0(%[srcA]) \r\n"
+ "ldl $9, 7(%[src0]) \r\n"
+ "ldr $9, 0(%[src0]) \r\n"
+ "ldl $10, 7(%[src1]) \r\n"
+ "ldr $10, 0(%[src1]) \r\n"
+ "dmtc1 $8, $f2 \r\n"
+ "dmtc1 $9, $f4 \r\n"
+ "dmtc1 $10, $f6 \r\n"
+ "dmtc1 $0, $f0 \r\n"
+ "punpcklbh $f8, $f2, $f0 \r\n"
+ "punpckhbh $f10, $f2, $f0 \r\n"
+ "punpcklbh $f12, $f4, $f0 \r\n"
+ "punpckhbh $f14, $f4, $f0 \r\n"
+ "punpcklbh $f16, $f6, $f0 \r\n"
+ "punpckhbh $f18, $f6, $f0 \r\n"
+ "daddiu $8, $0, 3 \r\n"
+ "dmtc1 $8, $f20 \r\n"
+ "pshufh $f28, $f10, $f20 \r\n"
+ "pshufh $f30, $f18, $f20 \r\n"
+ "pinsrh_3 $f10, $f10, $f30 \r\n"
+ "pinsrh_3 $f18, $f18, $f28 \r\n"
+ "bnez %[has_topleft], 1f \r\n"
+ "pinsrh_0 $f8, $f8, $f12 \r\n"
+ "1: \r\n"
+ "bnez %[has_topright], 2f \r\n"
+ "pshufh $f30, $f14, $f20 \r\n"
+ "pinsrh_3 $f10, $f10, $f30 \r\n"
+ "2: \r\n"
+ "daddiu $8, $0, 2 \r\n"
+ "dmtc1 $8, $f20 \r\n"
+ "pshufh $f22, $f20, $f0 \r\n"
+ "pmullh $f12, $f12, $f22 \r\n"
+ "pmullh $f14, $f14, $f22 \r\n"
+ "paddh $f8, $f8, $f12 \r\n"
+ "paddh $f10, $f10, $f14 \r\n"
+ "paddh $f8, $f8, $f16 \r\n"
+ "paddh $f10, $f10, $f18 \r\n"
+ "paddh $f8, $f8, $f22 \r\n"
+ "paddh $f10, $f10, $f22 \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "packushb $f4, $f8, $f10 \r\n"
+ "biadd $f2, $f4 \r\n"
+ "mfc1 %[dc2], $f2 \r\n"
+ : [dc2]"=r"(dc2)
+ : [srcA]"r"(src-stride-1),[src0]"r"(src-stride),
+ [src1]"r"(src-stride+1),[has_topleft]"r"(has_topleft),
+ [has_topright]"r"(has_topright)
+ : "$8","$9","$10","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20","$f22"
+ );
+
+ dc1 = l0+l1+l2+l3+l4+l5+l6+l7;
+ dc = ((dc1+dc2+8)>>4)*0x01010101U;
+
+ __asm__ volatile (
+ "dli $8, 8 \r\n"
+ "1: \r\n"
+ "punpcklwd $f2, %[dc], %[dc] \r\n"
+ "gssdlc1 $f2, 7(%[src]) \r\n"
+ "gssdrc1 $f2, 0(%[src]) \r\n"
+ "daddu %[src], %[src], %[stride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [src]"+&r"(src)
+ : [dc]"f"(dc),[stride]"r"(stride)
+ : "$8","$f2"
+ );
+}
+
+void ff_pred8x8l_vertical_8_mmi(uint8_t *src, int has_topleft,
+ int has_topright, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "ldl $8, 7(%[srcA]) \r\n"
+ "ldr $8, 0(%[srcA]) \r\n"
+ "ldl $9, 7(%[src0]) \r\n"
+ "ldr $9, 0(%[src0]) \r\n"
+ "ldl $10, 7(%[src1]) \r\n"
+ "ldr $10, 0(%[src1]) \r\n"
+ "dmtc1 $8, $f2 \r\n"
+ "dmtc1 $9, $f4 \r\n"
+ "dmtc1 $10, $f6 \r\n"
+ "dmtc1 $0, $f0 \r\n"
+ "punpcklbh $f8, $f2, $f0 \r\n"
+ "punpckhbh $f10, $f2, $f0 \r\n"
+ "punpcklbh $f12, $f4, $f0 \r\n"
+ "punpckhbh $f14, $f4, $f0 \r\n"
+ "punpcklbh $f16, $f6, $f0 \r\n"
+ "punpckhbh $f18, $f6, $f0 \r\n"
+ "bnez %[has_topleft], 1f \r\n"
+ "pinsrh_0 $f8, $f8, $f12 \r\n"
+ "1: \r\n"
+ "bnez %[has_topright], 2f \r\n"
+ "pinsrh_3 $f18, $f18, $f14 \r\n"
+ "2: \r\n"
+ "daddiu $8, $0, 2 \r\n"
+ "dmtc1 $8, $f20 \r\n"
+ "pshufh $f22, $f20, $f0 \r\n"
+ "pmullh $f12, $f12, $f22 \r\n"
+ "pmullh $f14, $f14, $f22 \r\n"
+ "paddh $f8, $f8, $f12 \r\n"
+ "paddh $f10, $f10, $f14 \r\n"
+ "paddh $f8, $f8, $f16 \r\n"
+ "paddh $f10, $f10, $f18 \r\n"
+ "paddh $f8, $f8, $f22 \r\n"
+ "paddh $f10, $f10, $f22 \r\n"
+ "psrah $f8, $f8, $f20 \r\n"
+ "psrah $f10, $f10, $f20 \r\n"
+ "packushb $f4, $f8, $f10 \r\n"
+ "sdc1 $f4, 0(%[src]) \r\n"
+ : [src]"=r"(src)
+ : [srcA]"r"(src-stride-1),[src0]"r"(src-stride),
+ [src1]"r"(src-stride+1),[has_topleft]"r"(has_topleft),
+ [has_topright]"r"(has_topright)
+ : "$8","$9","$10","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20","$f22"
+ );
+
+ __asm__ volatile (
+ "dli $8, 7 \r\n"
+ "gsldlc1 $f2, 7(%[src]) \r\n"
+ "gsldrc1 $f2, 0(%[src]) \r\n"
+ "dadd %[src], %[src], %[stride] \r\n"
+ "1: \r\n"
+ "gssdlc1 $f2, 7(%[src]) \r\n"
+ "gssdrc1 $f2, 0(%[src]) \r\n"
+ "daddu %[src], %[src], %[stride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [src]"+&r"(src)
+ : [stride]"r"(stride)
+ : "$8","$f2"
+ );
+}
+
+void ff_pred4x4_dc_8_mmi(uint8_t *src, const uint8_t *topright,
+ ptrdiff_t stride)
+{
+ const int dc = (src[-stride] + src[1-stride] + src[2-stride]
+ + src[3-stride] + src[-1+0*stride] + src[-1+1*stride]
+ + src[-1+2*stride] + src[-1+3*stride] + 4) >>3;
+
+ __asm__ volatile (
+ "daddu $2, %[dc], $0 \r\n"
+ "dmul $3, $2, %[ff_pb_1] \r\n"
+ "xor $4, $4, $4 \r\n"
+ "gsswx $3, 0(%[src],$4) \r\n"
+ "daddu $4, %[stride] \r\n"
+ "gsswx $3, 0(%[src],$4) \r\n"
+ "daddu $4, %[stride] \r\n"
+ "gsswx $3, 0(%[src],$4) \r\n"
+ "daddu $4, %[stride] \r\n"
+ "gsswx $3, 0(%[src],$4) \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[dc]"r"(dc),[ff_pb_1]"r"(ff_pb_1)
+ : "$2","$3","$4"
+ );
+}
+
+void ff_pred8x8_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "dsubu $2, %[src], %[stride] \r\n"
+ "daddu $3, %[src], $0 \r\n"
+ "ldl $4, 7($2) \r\n"
+ "ldr $4, 0($2) \r\n"
+ "dli $5, 0x8 \r\n"
+ "1: \r\n"
+ "sdl $4, 7($3) \r\n"
+ "sdr $4, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddiu $5, -1 \r\n"
+ "bnez $5, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride)
+ : "$2","$3","$4","$5"
+ );
+}
+
+void ff_pred8x8_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "daddiu $2, %[src], -1 \r\n"
+ "daddu $3, %[src], $0 \r\n"
+ "dli $6, 0x8 \r\n"
+ "1: \r\n"
+ "lbu $4, 0($2) \r\n"
+ "dmul $5, $4, %[ff_pb_1] \r\n"
+ "sdl $5, 7($3) \r\n"
+ "sdr $5, 0($3) \r\n"
+ "daddu $2, %[stride] \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddiu $6, -1 \r\n"
+ "bnez $6, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[ff_pb_1]"r"(ff_pb_1)
+ : "$2","$3","$4","$5","$6"
+ );
+}
+
+static void ff_pred16x16_plane_compat_8_mmi(uint8_t *src, ptrdiff_t stride,
+ const int svq3, const int rv40)
+{
+ __asm__ volatile (
+ "negu $2, %[stride] \r\n"
+ "daddu $3, %[src], $2 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ "gslwlc1 $f0, 2($3) \r\n"
+ "gslwrc1 $f0, -1($3) \r\n"
+ "gslwlc1 $f2, 6($3) \r\n"
+ "gslwrc1 $f2, 3($3) \r\n"
+ "gslwlc1 $f4, 11($3) \r\n"
+ "gslwrc1 $f4, 8($3) \r\n"
+ "gslwlc1 $f6, 15($3) \r\n"
+ "gslwrc1 $f6, 12($3) \r\n"
+ "punpcklbh $f0, $f0, $f8 \r\n"
+ "punpcklbh $f2, $f2, $f8 \r\n"
+ "punpcklbh $f4, $f4, $f8 \r\n"
+ "punpcklbh $f6, $f6, $f8 \r\n"
+ "dmtc1 %[ff_pw_m8tom5], $f20 \r\n"
+ "dmtc1 %[ff_pw_m4tom1], $f22 \r\n"
+ "dmtc1 %[ff_pw_1to4], $f24 \r\n"
+ "dmtc1 %[ff_pw_5to8], $f26 \r\n"
+ "pmullh $f0, $f0, $f20 \r\n"
+ "pmullh $f2, $f2, $f22 \r\n"
+ "pmullh $f4, $f4, $f24 \r\n"
+ "pmullh $f6, $f6, $f26 \r\n"
+ "paddsh $f0, $f0, $f4 \r\n"
+ "paddsh $f2, $f2, $f6 \r\n"
+ "paddsh $f0, $f0, $f2 \r\n"
+ "dli $4, 0xE \r\n"
+ "dmtc1 $4, $f28 \r\n"
+ "pshufh $f2, $f0, $f28 \r\n"
+ "paddsh $f0, $f0, $f2 \r\n"
+ "dli $4, 0x1 \r\n"
+ "dmtc1 $4, $f30 \r\n"
+ "pshufh $f2, $f0, $f30 \r\n"
+ "paddsh $f10, $f0, $f2 \r\n"
+ "daddiu $3, %[src], -1 \r\n"
+ "daddu $3, $2 \r\n"
+ "lbu $4, 0($3) \r\n"
+ "lbu $8, 16($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $5, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $6, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $7, 0($3) \r\n"
+ "dsll $5, 16 \r\n"
+ "dsll $6, 32 \r\n"
+ "dsll $7, 48 \r\n"
+ "or $6, $7 \r\n"
+ "or $4, $5 \r\n"
+ "or $4, $6 \r\n"
+ "dmtc1 $4, $f0 \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $4, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $5, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $6, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $7, 0($3) \r\n"
+ "dsll $5, 16 \r\n"
+ "dsll $6, 32 \r\n"
+ "dsll $7, 48 \r\n"
+ "or $6, $7 \r\n"
+ "or $4, $5 \r\n"
+ "or $4, $6 \r\n"
+ "dmtc1 $4, $f2 \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $4, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $5, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $6, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $7, 0($3) \r\n"
+ "dsll $5, 16 \r\n"
+ "dsll $6, 32 \r\n"
+ "dsll $7, 48 \r\n"
+ "or $6, $7 \r\n"
+ "or $4, $5 \r\n"
+ "or $4, $6 \r\n"
+ "dmtc1 $4, $f4 \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $4, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $5, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $6, 0($3) \r\n"
+ "daddu $3, %[stride] \r\n"
+ "lbu $7, 0($3) \r\n"
+ "daddu $8, $7 \r\n"
+ "daddiu $8, 1 \r\n"
+ "dsll $8, 4 \r\n"
+ "dsll $5, 16 \r\n"
+ "dsll $6, 32 \r\n"
+ "dsll $7, 48 \r\n"
+ "or $6, $7 \r\n"
+ "or $4, $5 \r\n"
+ "or $4, $6 \r\n"
+ "dmtc1 $4, $f6 \r\n"
+ "pmullh $f0, $f0, $f20 \r\n"
+ "pmullh $f2, $f2, $f22 \r\n"
+ "pmullh $f4, $f4, $f24 \r\n"
+ "pmullh $f6, $f6, $f26 \r\n"
+ "paddsh $f0, $f0, $f4 \r\n"
+ "paddsh $f2, $f2, $f6 \r\n"
+ "paddsh $f0, $f0, $f2 \r\n"
+ "pshufh $f2, $f0, $f28 \r\n"
+ "paddsh $f0, $f0, $f2 \r\n"
+ "pshufh $f2, $f0, $f30 \r\n"
+ "paddsh $f12, $f0, $f2 \r\n"
+ "dmfc1 $2, $f10 \r\n"
+ "dsll $2, 48 \r\n"
+ "dsra $2, 48 \r\n"
+ "dmfc1 $3, $f12 \r\n"
+ "dsll $3, 48 \r\n"
+ "dsra $3, 48 \r\n"
+ "beqz %[svq3], 1f \r\n"
+ "dli $4, 4 \r\n"
+ "ddiv $2, $4 \r\n"
+ "ddiv $3, $4 \r\n"
+ "dli $4, 5 \r\n"
+ "dmul $2, $4 \r\n"
+ "dmul $3, $4 \r\n"
+ "dli $4, 16 \r\n"
+ "ddiv $2, $4 \r\n"
+ "ddiv $3, $4 \r\n"
+ "daddu $4, $2, $0 \r\n"
+ "daddu $2, $3, $0 \r\n"
+ "daddu $3, $4, $0 \r\n"
+ "b 2f \r\n"
+ "1: \r\n"
+ "beqz %[rv40], 1f \r\n"
+ "dsra $4, $2, 2 \r\n"
+ "daddu $2, $4 \r\n"
+ "dsra $4, $3, 2 \r\n"
+ "daddu $3, $4 \r\n"
+ "dsra $2, 4 \r\n"
+ "dsra $3, 4 \r\n"
+ "b 2f \r\n"
+ "1: \r\n"
+ "dli $4, 5 \r\n"
+ "dmul $2, $4 \r\n"
+ "dmul $3, $4 \r\n"
+ "daddiu $2, 32 \r\n"
+ "daddiu $3, 32 \r\n"
+ "dsra $2, 6 \r\n"
+ "dsra $3, 6 \r\n"
+ "2: \r\n"
+ "daddu $5, $2, $3 \r\n"
+ "dli $4, 7 \r\n"
+ "dmul $5, $4 \r\n"
+ "dsubu $8, $5 \r\n"
+ "dmtc1 $0, $f8 \r\n"
+ "dmtc1 $2, $f0 \r\n"
+ "pshufh $f0, $f0, $f8 \r\n"
+ "dmtc1 $3, $f10 \r\n"
+ "pshufh $f10, $f10, $f8 \r\n"
+ "dmtc1 $8, $f12 \r\n"
+ "pshufh $f12, $f12, $f8 \r\n"
+ "dli $4, 5 \r\n"
+ "dmtc1 $4, $f14 \r\n"
+ "pmullh $f2, %[ff_pw_0to3], $f0 \r\n"
+ "pmullh $f4, %[ff_pw_4to7], $f0 \r\n"
+ "pmullh $f6, %[ff_pw_8tob], $f0 \r\n"
+ "pmullh $f8, %[ff_pw_ctof], $f0 \r\n"
+ "daddu $3, %[src], $0 \r\n"
+ "dli $2, 16 \r\n"
+ "1: \r\n"
+ "paddsh $f16, $f2, $f12 \r\n"
+ "psrah $f16, $f16, $f14 \r\n"
+ "paddsh $f18, $f4, $f12 \r\n"
+ "psrah $f18, $f18, $f14 \r\n"
+ "packushb $f20, $f16, $f18 \r\n"
+ "gssdlc1 $f20, 7($3) \r\n"
+ "gssdrc1 $f20, 0($3) \r\n"
+ "paddsh $f16, $f6, $f12 \r\n"
+ "psrah $f16, $f16, $f14 \r\n"
+ "paddsh $f18, $f8, $f12 \r\n"
+ "psrah $f18, $f18, $f14 \r\n"
+ "packushb $f20, $f16, $f18 \r\n"
+ "gssdlc1 $f20, 15($3) \r\n"
+ "gssdrc1 $f20, 8($3) \r\n"
+ "paddsh $f12, $f12, $f10 \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddiu $2, -1 \r\n"
+ "bnez $2, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[svq3]"r"(svq3),[rv40]"r"(rv40),
+ [ff_pw_m8tom5]"r"(ff_pw_m8tom5),[ff_pw_m4tom1]"r"(ff_pw_m4tom1),
+ [ff_pw_1to4]"r"(ff_pw_1to4),[ff_pw_5to8]"r"(ff_pw_5to8),
+ [ff_pw_0to3]"f"(ff_pw_0to3),[ff_pw_4to7]"f"(ff_pw_4to7),
+ [ff_pw_8tob]"f"(ff_pw_8tob),[ff_pw_ctof]"f"(ff_pw_ctof)
+ : "$2","$3","$4","$5","$6","$7","$8","$f0","$f2","$f4","$f6","$f8",
+ "$f10","$f12","$f14","$f16","$f18","$f20","$f22","$f24","$f26",
+ "$f28","$f30"
+ );
+}
+
+void ff_pred16x16_plane_svq3_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ ff_pred16x16_plane_compat_8_mmi(src, stride, 1, 0);
+}
+
+void ff_pred16x16_plane_rv40_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ ff_pred16x16_plane_compat_8_mmi(src, stride, 0, 1);
+}
+
+void ff_pred16x16_plane_h264_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ ff_pred16x16_plane_compat_8_mmi(src, stride, 0, 0);
+}
+
+void ff_pred8x8_top_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "dli $2, 2 \r\n"
+ "xor $f0, $f0, $f0 \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "xor $f30, $f30, $f30 \r\n"
+ "negu $3, %[stride] \r\n"
+ "daddu $3, $3, %[src] \r\n"
+ "gsldlc1 $f4, 7($3) \r\n"
+ "gsldrc1 $f4, 0($3) \r\n"
+ "punpcklbh $f0, $f4, $f30 \r\n"
+ "punpckhbh $f2, $f4, $f30 \r\n"
+ "biadd $f0, $f0 \r\n"
+ "biadd $f2, $f2 \r\n"
+ "pshufh $f0, $f0, $f30 \r\n"
+ "pshufh $f2, $f2, $f30 \r\n"
+ "dmtc1 $2, $f4 \r\n"
+ "pshufh $f4, $f4, $f30 \r\n"
+ "paddush $f0, $f0, $f4 \r\n"
+ "paddush $f2, $f2, $f4 \r\n"
+ "dmtc1 $2, $f4 \r\n"
+ "psrlh $f0, $f0, $f4 \r\n"
+ "psrlh $f2, $f2, $f4 \r\n"
+ "packushb $f4, $f0, $f2 \r\n"
+ "dli $2, 8 \r\n"
+ "1: \r\n"
+ "gssdlc1 $f4, 7(%[src]) \r\n"
+ "gssdrc1 $f4, 0(%[src]) \r\n"
+ "daddu %[src], %0, %[stride] \r\n"
+ "daddiu $2, $2, -1 \r\n"
+ "bnez $2, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride)
+ : "$2","$3","$f0","$f2","$f4","$f30"
+ );
+}
+
+void ff_pred8x8_dc_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "negu $2, %[stride] \r\n"
+ "daddu $2, $2, %[src] \r\n"
+ "daddiu $5, $2, 4 \r\n"
+ "lbu $6, 0($2) \r\n"
+ "daddu $3, $0, $6 \r\n"
+ "daddiu $2, 1 \r\n"
+ "lbu $6, 0($5) \r\n"
+ "daddu $4, $0, $6 \r\n"
+ "daddiu $5, 1 \r\n"
+ "lbu $6, 0($2) \r\n"
+ "daddu $3, $3, $6 \r\n"
+ "daddiu $2, 1 \r\n"
+ "lbu $6, 0($5) \r\n"
+ "daddu $4, $4, $6 \r\n"
+ "daddiu $5, 1 \r\n"
+ "lbu $6, 0($2) \r\n"
+ "daddu $3, $3, $6 \r\n"
+ "daddiu $2, 1 \r\n"
+ "lbu $6, 0($5) \r\n"
+ "daddu $4, $4, $6 \r\n"
+ "daddiu $5, 1 \r\n"
+ "lbu $6, 0($2) \r\n"
+ "daddu $3, $3, $6 \r\n"
+ "daddiu $2, 1 \r\n"
+ "lbu $6, 0($5) \r\n"
+ "daddu $4, $4, $6 \r\n"
+ "daddiu $5, 1 \r\n"
+ "dli $6, -1 \r\n"
+ "daddu $6, $6, %[src] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $7, $0, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $7, $7, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $7, $7, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $7, $7, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $8, $0, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $8, $8, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $8, $8, $5 \r\n"
+ "daddu $6, $6, %[stride] \r\n"
+ "lbu $5, 0($6) \r\n"
+ "daddu $8, $8, $5 \r\n"
+ "daddu $3, $3, $7 \r\n"
+ "daddiu $3, $3, 4 \r\n"
+ "daddiu $4, $4, 2 \r\n"
+ "daddiu $5, $8, 2 \r\n"
+ "daddu $6, $4, $5 \r\n"
+ "dsrl $3, 3 \r\n"
+ "dsrl $4, 2 \r\n"
+ "dsrl $5, 2 \r\n"
+ "dsrl $6, 3 \r\n"
+ "xor $f30, $f30, $f30 \r\n"
+ "dmtc1 $3, $f0 \r\n"
+ "pshufh $f0, $f0, $f30 \r\n"
+ "dmtc1 $4, $f2 \r\n"
+ "pshufh $f2, $f2, $f30 \r\n"
+ "dmtc1 $5, $f4 \r\n"
+ "pshufh $f4, $f4, $f30 \r\n"
+ "dmtc1 $6, $f6 \r\n"
+ "pshufh $f6, $f6, $f30 \r\n"
+ "packushb $f0, $f0, $f2 \r\n"
+ "packushb $f2, $f4, $f6 \r\n"
+ "daddu $2, $0, %[src] \r\n"
+ "sdc1 $f0, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f0, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f0, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f0, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f2, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f2, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f2, 0($2) \r\n"
+ "daddu $2, $2, %[stride] \r\n"
+ "sdc1 $f2, 0($2) \r\n"
+ ::[src]"r"(src),[stride]"r"(stride)
+ : "$2","$3","$4","$5","$6","$7","$8","$f0","$f2","$f4","$f6","$f30"
+ );
+}
+
+void ff_pred8x16_vertical_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "gsldlc1 $f2, 7(%[srcA]) \r\n"
+ "gsldrc1 $f2, 0(%[srcA]) \r\n"
+ "dli $8, 16 \r\n"
+ "1: \r\n"
+ "gssdlc1 $f2, 7(%[src]) \r\n"
+ "gssdrc1 $f2, 0(%[src]) \r\n"
+ "daddu %[src], %[src], %[stride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [src]"+&r"(src)
+ : [stride]"r"(stride),[srcA]"r"(src-stride)
+ : "$8","$f2"
+ );
+}
+
+void ff_pred8x16_horizontal_8_mmi(uint8_t *src, ptrdiff_t stride)
+{
+ __asm__ volatile (
+ "daddiu $2, %[src], -1 \r\n"
+ "daddu $3, %[src], $0 \r\n"
+ "dli $6, 0x10 \r\n"
+ "1: \r\n"
+ "lbu $4, 0($2) \r\n"
+ "dmul $5, $4, %[ff_pb_1] \r\n"
+ "sdl $5, 7($3) \r\n"
+ "sdr $5, 0($3) \r\n"
+ "daddu $2, %[stride] \r\n"
+ "daddu $3, %[stride] \r\n"
+ "daddiu $6, -1 \r\n"
+ "bnez $6, 1b \r\n"
+ ::[src]"r"(src),[stride]"r"(stride),[ff_pb_1]"r"(ff_pb_1)
+ : "$2","$3","$4","$5","$6"
+ );
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_init_mips.c
index a2023043461..92219f8877f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_init_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_init_mips.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
*
* This file is part of FFmpeg.
*
@@ -128,9 +129,121 @@ static av_cold void h264qpel_init_msa(H264QpelContext *c, int bit_depth)
}
#endif // #if HAVE_MSA
+#if HAVE_MMI
+static av_cold void h264qpel_init_mmi(H264QpelContext *c, int bit_depth)
+{
+ if (8 == bit_depth) {
+ c->put_h264_qpel_pixels_tab[0][0] = ff_put_h264_qpel16_mc00_mmi;
+ c->put_h264_qpel_pixels_tab[0][1] = ff_put_h264_qpel16_mc10_mmi;
+ c->put_h264_qpel_pixels_tab[0][2] = ff_put_h264_qpel16_mc20_mmi;
+ c->put_h264_qpel_pixels_tab[0][3] = ff_put_h264_qpel16_mc30_mmi;
+ c->put_h264_qpel_pixels_tab[0][4] = ff_put_h264_qpel16_mc01_mmi;
+ c->put_h264_qpel_pixels_tab[0][5] = ff_put_h264_qpel16_mc11_mmi;
+ c->put_h264_qpel_pixels_tab[0][6] = ff_put_h264_qpel16_mc21_mmi;
+ c->put_h264_qpel_pixels_tab[0][7] = ff_put_h264_qpel16_mc31_mmi;
+ c->put_h264_qpel_pixels_tab[0][8] = ff_put_h264_qpel16_mc02_mmi;
+ c->put_h264_qpel_pixels_tab[0][9] = ff_put_h264_qpel16_mc12_mmi;
+ c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_mmi;
+ c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_mmi;
+ c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_mmi;
+ c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_mmi;
+ c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_mmi;
+ c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_mmi;
+
+ c->put_h264_qpel_pixels_tab[1][0] = ff_put_h264_qpel8_mc00_mmi;
+ c->put_h264_qpel_pixels_tab[1][1] = ff_put_h264_qpel8_mc10_mmi;
+ c->put_h264_qpel_pixels_tab[1][2] = ff_put_h264_qpel8_mc20_mmi;
+ c->put_h264_qpel_pixels_tab[1][3] = ff_put_h264_qpel8_mc30_mmi;
+ c->put_h264_qpel_pixels_tab[1][4] = ff_put_h264_qpel8_mc01_mmi;
+ c->put_h264_qpel_pixels_tab[1][5] = ff_put_h264_qpel8_mc11_mmi;
+ c->put_h264_qpel_pixels_tab[1][6] = ff_put_h264_qpel8_mc21_mmi;
+ c->put_h264_qpel_pixels_tab[1][7] = ff_put_h264_qpel8_mc31_mmi;
+ c->put_h264_qpel_pixels_tab[1][8] = ff_put_h264_qpel8_mc02_mmi;
+ c->put_h264_qpel_pixels_tab[1][9] = ff_put_h264_qpel8_mc12_mmi;
+ c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_mmi;
+ c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_mmi;
+ c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_mmi;
+ c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_mmi;
+ c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_mmi;
+ c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_mmi;
+
+ c->put_h264_qpel_pixels_tab[2][0] = ff_put_h264_qpel4_mc00_mmi;
+ c->put_h264_qpel_pixels_tab[2][1] = ff_put_h264_qpel4_mc10_mmi;
+ c->put_h264_qpel_pixels_tab[2][2] = ff_put_h264_qpel4_mc20_mmi;
+ c->put_h264_qpel_pixels_tab[2][3] = ff_put_h264_qpel4_mc30_mmi;
+ c->put_h264_qpel_pixels_tab[2][4] = ff_put_h264_qpel4_mc01_mmi;
+ c->put_h264_qpel_pixels_tab[2][5] = ff_put_h264_qpel4_mc11_mmi;
+ c->put_h264_qpel_pixels_tab[2][6] = ff_put_h264_qpel4_mc21_mmi;
+ c->put_h264_qpel_pixels_tab[2][7] = ff_put_h264_qpel4_mc31_mmi;
+ c->put_h264_qpel_pixels_tab[2][8] = ff_put_h264_qpel4_mc02_mmi;
+ c->put_h264_qpel_pixels_tab[2][9] = ff_put_h264_qpel4_mc12_mmi;
+ c->put_h264_qpel_pixels_tab[2][10] = ff_put_h264_qpel4_mc22_mmi;
+ c->put_h264_qpel_pixels_tab[2][11] = ff_put_h264_qpel4_mc32_mmi;
+ c->put_h264_qpel_pixels_tab[2][12] = ff_put_h264_qpel4_mc03_mmi;
+ c->put_h264_qpel_pixels_tab[2][13] = ff_put_h264_qpel4_mc13_mmi;
+ c->put_h264_qpel_pixels_tab[2][14] = ff_put_h264_qpel4_mc23_mmi;
+ c->put_h264_qpel_pixels_tab[2][15] = ff_put_h264_qpel4_mc33_mmi;
+
+ c->avg_h264_qpel_pixels_tab[0][0] = ff_avg_h264_qpel16_mc00_mmi;
+ c->avg_h264_qpel_pixels_tab[0][1] = ff_avg_h264_qpel16_mc10_mmi;
+ c->avg_h264_qpel_pixels_tab[0][2] = ff_avg_h264_qpel16_mc20_mmi;
+ c->avg_h264_qpel_pixels_tab[0][3] = ff_avg_h264_qpel16_mc30_mmi;
+ c->avg_h264_qpel_pixels_tab[0][4] = ff_avg_h264_qpel16_mc01_mmi;
+ c->avg_h264_qpel_pixels_tab[0][5] = ff_avg_h264_qpel16_mc11_mmi;
+ c->avg_h264_qpel_pixels_tab[0][6] = ff_avg_h264_qpel16_mc21_mmi;
+ c->avg_h264_qpel_pixels_tab[0][7] = ff_avg_h264_qpel16_mc31_mmi;
+ c->avg_h264_qpel_pixels_tab[0][8] = ff_avg_h264_qpel16_mc02_mmi;
+ c->avg_h264_qpel_pixels_tab[0][9] = ff_avg_h264_qpel16_mc12_mmi;
+ c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_mmi;
+ c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_mmi;
+ c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_mmi;
+ c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_mmi;
+ c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_mmi;
+ c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_mmi;
+
+ c->avg_h264_qpel_pixels_tab[1][0] = ff_avg_h264_qpel8_mc00_mmi;
+ c->avg_h264_qpel_pixels_tab[1][1] = ff_avg_h264_qpel8_mc10_mmi;
+ c->avg_h264_qpel_pixels_tab[1][2] = ff_avg_h264_qpel8_mc20_mmi;
+ c->avg_h264_qpel_pixels_tab[1][3] = ff_avg_h264_qpel8_mc30_mmi;
+ c->avg_h264_qpel_pixels_tab[1][4] = ff_avg_h264_qpel8_mc01_mmi;
+ c->avg_h264_qpel_pixels_tab[1][5] = ff_avg_h264_qpel8_mc11_mmi;
+ c->avg_h264_qpel_pixels_tab[1][6] = ff_avg_h264_qpel8_mc21_mmi;
+ c->avg_h264_qpel_pixels_tab[1][7] = ff_avg_h264_qpel8_mc31_mmi;
+ c->avg_h264_qpel_pixels_tab[1][8] = ff_avg_h264_qpel8_mc02_mmi;
+ c->avg_h264_qpel_pixels_tab[1][9] = ff_avg_h264_qpel8_mc12_mmi;
+ c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_mmi;
+ c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_mmi;
+ c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_mmi;
+ c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_mmi;
+ c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_mmi;
+ c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_mmi;
+
+ c->avg_h264_qpel_pixels_tab[2][0] = ff_avg_h264_qpel4_mc00_mmi;
+ c->avg_h264_qpel_pixels_tab[2][1] = ff_avg_h264_qpel4_mc10_mmi;
+ c->avg_h264_qpel_pixels_tab[2][2] = ff_avg_h264_qpel4_mc20_mmi;
+ c->avg_h264_qpel_pixels_tab[2][3] = ff_avg_h264_qpel4_mc30_mmi;
+ c->avg_h264_qpel_pixels_tab[2][4] = ff_avg_h264_qpel4_mc01_mmi;
+ c->avg_h264_qpel_pixels_tab[2][5] = ff_avg_h264_qpel4_mc11_mmi;
+ c->avg_h264_qpel_pixels_tab[2][6] = ff_avg_h264_qpel4_mc21_mmi;
+ c->avg_h264_qpel_pixels_tab[2][7] = ff_avg_h264_qpel4_mc31_mmi;
+ c->avg_h264_qpel_pixels_tab[2][8] = ff_avg_h264_qpel4_mc02_mmi;
+ c->avg_h264_qpel_pixels_tab[2][9] = ff_avg_h264_qpel4_mc12_mmi;
+ c->avg_h264_qpel_pixels_tab[2][10] = ff_avg_h264_qpel4_mc22_mmi;
+ c->avg_h264_qpel_pixels_tab[2][11] = ff_avg_h264_qpel4_mc32_mmi;
+ c->avg_h264_qpel_pixels_tab[2][12] = ff_avg_h264_qpel4_mc03_mmi;
+ c->avg_h264_qpel_pixels_tab[2][13] = ff_avg_h264_qpel4_mc13_mmi;
+ c->avg_h264_qpel_pixels_tab[2][14] = ff_avg_h264_qpel4_mc23_mmi;
+ c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_mmi;
+ }
+}
+#endif /* HAVE_MMI */
+
av_cold void ff_h264qpel_init_mips(H264QpelContext *c, int bit_depth)
{
#if HAVE_MSA
h264qpel_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
+#if HAVE_MMI
+ h264qpel_init_mmi(c, bit_depth);
+#endif /* HAVE_MMI */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_mmi.c
new file mode 100644
index 00000000000..e04a2d59366
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/h264qpel_mmi.c
@@ -0,0 +1,2637 @@
+/*
+ * Loongson SIMD optimized h264qpel
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "h264dsp_mips.h"
+#include "libavcodec/bit_depth_template.c"
+
+static inline void copy_block4_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gslwlc1 $f2, 3(%[src]) \r\n"
+ "gslwrc1 $f2, 0(%[src]) \r\n"
+ "gsswlc1 $f2, 3(%[dst]) \r\n"
+ "gsswrc1 $f2, 0(%[dst]) \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),[h]"r"(h)
+ : "$f2"
+ );
+}
+
+static inline void copy_block8_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[src]) \r\n"
+ "gsldrc1 $f2, 0(%[src]) \r\n"
+ "gssdlc1 $f2, 7(%[dst]) \r\n"
+ "gssdrc1 $f2, 0(%[dst]) \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),[h]"r"(h)
+ : "$f2"
+ );
+}
+
+static inline void copy_block16_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[src]) \r\n"
+ "gsldrc1 $f2, 0(%[src]) \r\n"
+ "gsldlc1 $f4, 15(%[src]) \r\n"
+ "gsldrc1 $f4, 8(%[src]) \r\n"
+ "gssdlc1 $f2, 7(%[dst]) \r\n"
+ "gssdrc1 $f2, 0(%[dst]) \r\n"
+ "gssdlc1 $f4, 15(%[dst]) \r\n"
+ "gssdrc1 $f4, 8(%[dst]) \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),[h]"r"(h)
+ : "$f2","$f4"
+ );
+}
+
+#define op_put(a, b) a = b
+#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
+static inline void put_pixels4_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gslwlc1 $f2, 3(%[pixels]) \r\n"
+ "gslwrc1 $f2, 0(%[pixels]) \r\n"
+ "gsswlc1 $f2, 3(%[block]) \r\n"
+ "gsswrc1 $f2, 0(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2"
+ );
+}
+
+static inline void put_pixels8_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[pixels]) \r\n"
+ "gsldrc1 $f2, 0(%[pixels]) \r\n"
+ "gssdlc1 $f2, 7(%[block]) \r\n"
+ "gssdrc1 $f2, 0(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2"
+ );
+}
+
+static inline void put_pixels16_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[pixels]) \r\n"
+ "gsldrc1 $f2, 0(%[pixels]) \r\n"
+ "gsldlc1 $f4, 15(%[pixels]) \r\n"
+ "gsldrc1 $f4, 8(%[pixels]) \r\n"
+ "gssdlc1 $f2, 7(%[block]) \r\n"
+ "gssdrc1 $f2, 0(%[block]) \r\n"
+ "gssdlc1 $f4, 15(%[block]) \r\n"
+ "gssdrc1 $f4, 8(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2","$f4"
+ );
+}
+
+static inline void avg_pixels4_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gslwlc1 $f2, 3(%[pixels]) \r\n"
+ "gslwrc1 $f2, 0(%[pixels]) \r\n"
+ "gslwlc1 $f4, 3(%[block]) \r\n"
+ "gslwrc1 $f4, 0(%[block]) \r\n"
+ "pavgb $f2, $f2, $f4 \r\n"
+ "gsswlc1 $f2, 3(%[block]) \r\n"
+ "gsswrc1 $f2, 0(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2","$f4"
+ );
+}
+
+static inline void avg_pixels8_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[block]) \r\n"
+ "gsldrc1 $f2, 0(%[block]) \r\n"
+ "gsldlc1 $f4, 7(%[pixels]) \r\n"
+ "gsldrc1 $f4, 0(%[pixels]) \r\n"
+ "pavgb $f2, $f2, $f4 \r\n"
+ "gssdlc1 $f2, 7(%[block]) \r\n"
+ "gssdrc1 $f2, 0(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2","$f4"
+ );
+}
+
+static inline void avg_pixels16_mmi(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ __asm__ volatile (
+ "1: \r\n"
+ "gsldlc1 $f2, 7(%[block]) \r\n"
+ "gsldrc1 $f2, 0(%[block]) \r\n"
+ "gsldlc1 $f4, 15(%[block]) \r\n"
+ "gsldrc1 $f4, 8(%[block]) \r\n"
+ "gsldlc1 $f6, 7(%[pixels]) \r\n"
+ "gsldrc1 $f6, 0(%[pixels]) \r\n"
+ "gsldlc1 $f8, 15(%[pixels]) \r\n"
+ "gsldrc1 $f8, 8(%[pixels]) \r\n"
+ "pavgb $f2, $f2, $f6 \r\n"
+ "pavgb $f4, $f4, $f8 \r\n"
+ "gssdlc1 $f2, 7(%[block]) \r\n"
+ "gssdrc1 $f2, 0(%[block]) \r\n"
+ "gssdlc1 $f4, 15(%[block]) \r\n"
+ "gssdrc1 $f4, 8(%[block]) \r\n"
+ "dadd %[pixels], %[pixels], %[line_size]\r\n"
+ "dadd %[block], %[block], %[line_size] \r\n"
+ "daddi %[h], %[h], -1 \r\n"
+ "bnez %[h], 1b \r\n"
+ : [block]"+&r"(block),[pixels]"+&r"(pixels)
+ : [line_size]"r"(line_size),[h]"r"(h)
+ : "$f2","$f4","$f6","$f8"
+ );
+}
+
+static inline void put_pixels4_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_put(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ }
+}
+
+static inline void put_pixels8_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_put(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 4]);
+ b = AV_RN4P(&src2[i * src_stride2 + 4]);
+ op_put(*((pixel4 *) &dst[i * dst_stride + 4]), rnd_avg_pixel4(a, b));
+ }
+}
+
+static inline void put_pixels16_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_put(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 4]);
+ b = AV_RN4P(&src2[i * src_stride2 + 4]);
+ op_put(*((pixel4 *) &dst[i * dst_stride + 4]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 8]);
+ b = AV_RN4P(&src2[i * src_stride2 + 8]);
+ op_put(*((pixel4 *) &dst[i * dst_stride + 8]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 12]);
+ b = AV_RN4P(&src2[i * src_stride2 + 12]);
+ op_put(*((pixel4 *) &dst[i * dst_stride + 12]), rnd_avg_pixel4(a, b));
+ }
+}
+
+static inline void avg_pixels4_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ }
+}
+
+static inline void avg_pixels8_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 4]);
+ b = AV_RN4P(&src2[i * src_stride2 + 4]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride + 4]), rnd_avg_pixel4(a, b));
+ }
+}
+
+static inline void avg_pixels16_l2_mmi(uint8_t *dst, const uint8_t *src1,
+ const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2,
+ int h)
+{
+ int i;
+ for (i = 0; i < h; i++) {
+ pixel4 a, b;
+ a = AV_RN4P(&src1[i * src_stride1]);
+ b = AV_RN4P(&src2[i * src_stride2]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 4]);
+ b = AV_RN4P(&src2[i * src_stride2 + 4]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride + 4]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 8]);
+ b = AV_RN4P(&src2[i * src_stride2 + 8]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride + 8]), rnd_avg_pixel4(a, b));
+ a = AV_RN4P(&src1[i * src_stride1 + 12]);
+ b = AV_RN4P(&src2[i * src_stride2 + 12]);
+ op_avg(*((pixel4 *) &dst[i * dst_stride + 12]), rnd_avg_pixel4(a, b));
+
+ }
+}
+#undef op_put
+#undef op_avg
+
+#define op2_avg(a, b) a = (((a)+CLIP(((b) + 512)>>10)+1)>>1)
+#define op2_put(a, b) a = CLIP(((b) + 512)>>10)
+static void put_h264_qpel4_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 4 \r\n"
+ "1: \r\n"
+ "gslwlc1 $f2, 1(%[src]) \r\n"
+ "gslwrc1 $f2, -2(%[src]) \r\n"
+ "gslwlc1 $f4, 2(%[src]) \r\n"
+ "gslwrc1 $f4, -1(%[src]) \r\n"
+ "gslwlc1 $f6, 3(%[src]) \r\n"
+ "gslwrc1 $f6, 0(%[src]) \r\n"
+ "gslwlc1 $f8, 4(%[src]) \r\n"
+ "gslwrc1 $f8, 1(%[src]) \r\n"
+ "gslwlc1 $f10, 5(%[src]) \r\n"
+ "gslwrc1 $f10, 2(%[src]) \r\n"
+ "gslwlc1 $f12, 6(%[src]) \r\n"
+ "gslwrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+ "paddsh $f18, $f18, %[ff_pw_16] \r\n"
+ "psrah $f18, $f18, %[ff_pw_5] \r\n"
+ "packushb $f18, $f18, $f0 \r\n"
+ "gsswlc1 $f18, 3(%[dst]) \r\n"
+ "gsswrc1 $f18, 0(%[dst]) \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5),[ff_pw_16]"f"(ff_pw_16)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18"
+ );
+}
+
+static void put_h264_qpel8_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 8 \r\n"
+ "1: \r\n"
+ "gsldlc1 $f2, 5(%[src]) \r\n"
+ "gsldrc1 $f2, -2(%[src]) \r\n"
+ "gsldlc1 $f4, 6(%[src]) \r\n"
+ "gsldrc1 $f4, -1(%[src]) \r\n"
+ "gsldlc1 $f6, 7(%[src]) \r\n"
+ "gsldrc1 $f6, 0(%[src]) \r\n"
+ "gsldlc1 $f8, 8(%[src]) \r\n"
+ "gsldrc1 $f8, 1(%[src]) \r\n"
+ "gsldlc1 $f10, 9(%[src]) \r\n"
+ "gsldrc1 $f10, 2(%[src]) \r\n"
+ "gsldlc1 $f12, 10(%[src]) \r\n"
+ "gsldrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f14, $f6, $f0 \r\n"
+ "punpckhbh $f16, $f6, $f0 \r\n"
+ "punpcklbh $f18, $f8, $f0 \r\n"
+ "punpckhbh $f20, $f8, $f0 \r\n"
+ "paddsh $f6, $f14, $f18 \r\n"
+ "paddsh $f8, $f16, $f20 \r\n"
+ "pmullh $f6, $f6, %[ff_pw_20] \r\n"
+ "pmullh $f8, $f8, %[ff_pw_20] \r\n"
+ "punpcklbh $f14, $f4, $f0 \r\n"
+ "punpckhbh $f16, $f4, $f0 \r\n"
+ "punpcklbh $f18, $f10, $f0 \r\n"
+ "punpckhbh $f20, $f10, $f0 \r\n"
+ "paddsh $f4, $f14, $f18 \r\n"
+ "paddsh $f10, $f16, $f20 \r\n"
+ "pmullh $f4, $f4, %[ff_pw_5] \r\n"
+ "pmullh $f10, $f10, %[ff_pw_5] \r\n"
+ "punpcklbh $f14, $f2, $f0 \r\n"
+ "punpckhbh $f16, $f2, $f0 \r\n"
+ "punpcklbh $f18, $f12, $f0 \r\n"
+ "punpckhbh $f20, $f12, $f0 \r\n"
+ "paddsh $f2, $f14, $f18 \r\n"
+ "paddsh $f12, $f16, $f20 \r\n"
+ "psubsh $f6, $f6, $f4 \r\n"
+ "psubsh $f8, $f8, $f10 \r\n"
+ "paddsh $f6, $f6, $f2 \r\n"
+ "paddsh $f8, $f8, $f12 \r\n"
+ "paddsh $f6, $f6, %[ff_pw_16] \r\n"
+ "paddsh $f8, $f8, %[ff_pw_16] \r\n"
+ "psrah $f6, $f6, %[ff_pw_5] \r\n"
+ "psrah $f8, $f8, %[ff_pw_5] \r\n"
+ "packushb $f18, $f6, $f8 \r\n"
+ "sdc1 $f18, 0(%[dst]) \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5),[ff_pw_16]"f"(ff_pw_16)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20"
+ );
+}
+
+static void put_h264_qpel16_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ put_h264_qpel8_h_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_h_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ put_h264_qpel8_h_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_h_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+static void avg_h264_qpel4_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 4 \r\n"
+ "1: \r\n"
+ "gslwlc1 $f2, 1(%[src]) \r\n"
+ "gslwrc1 $f2, -2(%[src]) \r\n"
+ "gslwlc1 $f4, 2(%[src]) \r\n"
+ "gslwrc1 $f4, -1(%[src]) \r\n"
+ "gslwlc1 $f6, 3(%[src]) \r\n"
+ "gslwrc1 $f6, 0(%[src]) \r\n"
+ "gslwlc1 $f8, 4(%[src]) \r\n"
+ "gslwrc1 $f8, 1(%[src]) \r\n"
+ "gslwlc1 $f10, 5(%[src]) \r\n"
+ "gslwrc1 $f10, 2(%[src]) \r\n"
+ "gslwlc1 $f12, 6(%[src]) \r\n"
+ "gslwrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+ "paddsh $f18, $f18, %[ff_pw_16] \r\n"
+ "psrah $f18, $f18, %[ff_pw_5] \r\n"
+ "packushb $f18, $f18, $f0 \r\n"
+ "lwc1 $f20, 0(%[dst]) \r\n"
+ "pavgb $f18, $f18, $f20 \r\n"
+ "gsswlc1 $f18, 3(%[dst]) \r\n"
+ "gsswrc1 $f18, 0(%[dst]) \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5),[ff_pw_16]"f"(ff_pw_16)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20"
+ );
+}
+
+static void avg_h264_qpel8_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 8 \r\n"
+ "1: \r\n"
+ "gsldlc1 $f2, 5(%[src]) \r\n"
+ "gsldrc1 $f2, -2(%[src]) \r\n"
+ "gsldlc1 $f4, 6(%[src]) \r\n"
+ "gsldrc1 $f4, -1(%[src]) \r\n"
+ "gsldlc1 $f6, 7(%[src]) \r\n"
+ "gsldrc1 $f6, 0(%[src]) \r\n"
+ "gsldlc1 $f8, 8(%[src]) \r\n"
+ "gsldrc1 $f8, 1(%[src]) \r\n"
+ "gsldlc1 $f10, 9(%[src]) \r\n"
+ "gsldrc1 $f10, 2(%[src]) \r\n"
+ "gsldlc1 $f12, 10(%[src]) \r\n"
+ "gsldrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f14, $f6, $f0 \r\n"
+ "punpckhbh $f16, $f6, $f0 \r\n"
+ "punpcklbh $f18, $f8, $f0 \r\n"
+ "punpckhbh $f20, $f8, $f0 \r\n"
+ "paddsh $f6, $f14, $f18 \r\n"
+ "paddsh $f8, $f16, $f20 \r\n"
+ "pmullh $f6, $f6, %[ff_pw_20] \r\n"
+ "pmullh $f8, $f8, %[ff_pw_20] \r\n"
+ "punpcklbh $f14, $f4, $f0 \r\n"
+ "punpckhbh $f16, $f4, $f0 \r\n"
+ "punpcklbh $f18, $f10, $f0 \r\n"
+ "punpckhbh $f20, $f10, $f0 \r\n"
+ "paddsh $f4, $f14, $f18 \r\n"
+ "paddsh $f10, $f16, $f20 \r\n"
+ "pmullh $f4, $f4, %[ff_pw_5] \r\n"
+ "pmullh $f10, $f10, %[ff_pw_5] \r\n"
+ "punpcklbh $f14, $f2, $f0 \r\n"
+ "punpckhbh $f16, $f2, $f0 \r\n"
+ "punpcklbh $f18, $f12, $f0 \r\n"
+ "punpckhbh $f20, $f12, $f0 \r\n"
+ "paddsh $f2, $f14, $f18 \r\n"
+ "paddsh $f12, $f16, $f20 \r\n"
+ "psubsh $f6, $f6, $f4 \r\n"
+ "psubsh $f8, $f8, $f10 \r\n"
+ "paddsh $f6, $f6, $f2 \r\n"
+ "paddsh $f8, $f8, $f12 \r\n"
+ "paddsh $f6, $f6, %[ff_pw_16] \r\n"
+ "paddsh $f8, $f8, %[ff_pw_16] \r\n"
+ "psrah $f6, $f6, %[ff_pw_5] \r\n"
+ "psrah $f8, $f8, %[ff_pw_5] \r\n"
+ "packushb $f18, $f6, $f8 \r\n"
+ "ldc1 $f20, 0(%[dst]) \r\n"
+ "pavgb $f18, $f18, $f20 \r\n"
+ "sdc1 $f18, 0(%[dst]) \r\n"
+ "dadd %[dst], %[dst], %[dstStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [dst]"+&r"(dst),[src]"+&r"(src)
+ : [dstStride]"r"(dstStride),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5),[ff_pw_16]"f"(ff_pw_16)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18","$f20"
+ );
+}
+
+static void avg_h264_qpel16_h_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ avg_h264_qpel8_h_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_h_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ avg_h264_qpel8_h_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_h_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+static void put_h264_qpel4_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "gslwlc1 $f2, 3(%[srcB]) \r\n"
+ "gslwrc1 $f2, 0(%[srcB]) \r\n"
+ "gslwlc1 $f4, 3(%[srcA]) \r\n"
+ "gslwrc1 $f4, 0(%[srcA]) \r\n"
+ "gslwlc1 $f6, 3(%[src0]) \r\n"
+ "gslwrc1 $f6, 0(%[src0]) \r\n"
+ "gslwlc1 $f8, 3(%[src1]) \r\n"
+ "gslwrc1 $f8, 0(%[src1]) \r\n"
+ "gslwlc1 $f10, 3(%[src2]) \r\n"
+ "gslwrc1 $f10, 0(%[src2]) \r\n"
+ "gslwlc1 $f12, 3(%[src3]) \r\n"
+ "gslwrc1 $f12, 0(%[src3]) \r\n"
+ "gslwlc1 $f14, 3(%[src4]) \r\n"
+ "gslwrc1 $f14, 0(%[src4]) \r\n"
+ "gslwlc1 $f16, 3(%[src5]) \r\n"
+ "gslwrc1 $f16, 0(%[src5]) \r\n"
+ "gslwlc1 $f18, 3(%[src6]) \r\n"
+ "gslwrc1 $f18, 0(%[src6]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "punpcklbh $f16, $f16, $f0 \r\n"
+ "punpcklbh $f18, $f18, $f0 \r\n"
+ "paddsh $f20, $f6, $f8 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f4, $f10 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f24, $f20, $f22 \r\n"
+ "paddsh $f24, $f24, $f2 \r\n"
+ "paddsh $f24, $f24, $f12 \r\n"
+ "paddsh $f20, $f8, $f10 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f6, $f12 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f26, $f20, $f22 \r\n"
+ "paddsh $f26, $f26, $f4 \r\n"
+ "paddsh $f26, $f26, $f14 \r\n"
+ "paddsh $f20, $f10, $f12 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f8, $f14 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f28, $f20, $f22 \r\n"
+ "paddsh $f28, $f28, $f6 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f20, $f12, $f14 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f10, $f16 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f30, $f20, $f22 \r\n"
+ "paddsh $f30, $f30, $f8 \r\n"
+ "paddsh $f30, $f30, $f18 \r\n"
+ "paddsh $f24, $f24, %[ff_pw_16] \r\n"
+ "paddsh $f26, $f26, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "paddsh $f30, $f30, %[ff_pw_16] \r\n"
+ "psrah $f24, $f24, %[ff_pw_5] \r\n"
+ "psrah $f26, $f26, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "psrah $f30, $f30, %[ff_pw_5] \r\n"
+ "packushb $f24, $f24, $f0 \r\n"
+ "packushb $f26, $f26, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "packushb $f30, $f30, $f0 \r\n"
+ "swc1 $f24, 0(%[dst0]) \r\n"
+ "swc1 $f26, 0(%[dst1]) \r\n"
+ "swc1 $f28, 0(%[dst2]) \r\n"
+ "swc1 $f30, 0(%[dst3]) \r\n"
+ ::[dst0]"r"(dst), [dst1]"r"(dst+dstStride),
+ [dst2]"r"(dst+2*dstStride), [dst3]"r"(dst+3*dstStride),
+ [srcB]"r"(src-2*srcStride), [srcA]"r"(src-srcStride),
+ [src0]"r"(src), [src1]"r"(src+srcStride),
+ [src2]"r"(src+2*srcStride), [src3]"r"(src+3*srcStride),
+ [src4]"r"(src+4*srcStride), [src5]"r"(src+5*srcStride),
+ [src6]"r"(src+6*srcStride), [ff_pw_20]"f"(ff_pw_20),
+ [ff_pw_5]"f"(ff_pw_5), [ff_pw_16]"f"(ff_pw_16)
+ : "$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16","$f18",
+ "$f20","$f22","$f24","$f26","$f28","$f30"
+ );
+}
+
+static void put_h264_qpel8_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "gsldlc1 $f2, 7(%[srcB]) \r\n"
+ "gsldrc1 $f2, 0(%[srcB]) \r\n"
+ "gsldlc1 $f4, 7(%[srcA]) \r\n"
+ "gsldrc1 $f4, 0(%[srcA]) \r\n"
+ "gsldlc1 $f6, 7(%[src0]) \r\n"
+ "gsldrc1 $f6, 0(%[src0]) \r\n"
+ "gsldlc1 $f8, 7(%[src1]) \r\n"
+ "gsldrc1 $f8, 0(%[src1]) \r\n"
+ "gsldlc1 $f10, 7(%[src2]) \r\n"
+ "gsldrc1 $f10, 0(%[src2]) \r\n"
+ "gsldlc1 $f12, 7(%[src3]) \r\n"
+ "gsldrc1 $f12, 0(%[src3]) \r\n"
+ "gsldlc1 $f14, 7(%[src4]) \r\n"
+ "gsldrc1 $f14, 0(%[src4]) \r\n"
+ "gsldlc1 $f16, 7(%[src5]) \r\n"
+ "gsldrc1 $f16, 0(%[src5]) \r\n"
+ "gsldlc1 $f18, 7(%[src6]) \r\n"
+ "gsldrc1 $f18, 0(%[src6]) \r\n"
+ "gsldlc1 $f20, 7(%[src7]) \r\n"
+ "gsldrc1 $f20, 0(%[src7]) \r\n"
+ "gsldlc1 $f22, 7(%[src8]) \r\n"
+ "gsldrc1 $f22, 0(%[src8]) \r\n"
+ "gsldlc1 $f24, 7(%[src9]) \r\n"
+ "gsldrc1 $f24, 0(%[src9]) \r\n"
+ "gsldlc1 $f26, 7(%[src10]) \r\n"
+ "gsldrc1 $f26, 0(%[src10]) \r\n"
+ "punpcklbh $f1, $f2, $f0 \r\n"
+ "punpckhbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f3, $f4, $f0 \r\n"
+ "punpckhbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f5, $f6, $f0 \r\n"
+ "punpckhbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f7, $f8, $f0 \r\n"
+ "punpckhbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f9, $f10, $f0 \r\n"
+ "punpckhbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f11, $f12, $f0 \r\n"
+ "punpckhbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f13, $f14, $f0 \r\n"
+ "punpckhbh $f14, $f14, $f0 \r\n"
+ "punpcklbh $f15, $f16, $f0 \r\n"
+ "punpckhbh $f16, $f16, $f0 \r\n"
+ "punpcklbh $f17, $f18, $f0 \r\n"
+ "punpckhbh $f18, $f18, $f0 \r\n"
+ "punpcklbh $f19, $f20, $f0 \r\n"
+ "punpckhbh $f20, $f20, $f0 \r\n"
+ "punpcklbh $f21, $f22, $f0 \r\n"
+ "punpckhbh $f22, $f22, $f0 \r\n"
+ "punpcklbh $f23, $f24, $f0 \r\n"
+ "punpckhbh $f24, $f24, $f0 \r\n"
+ "punpcklbh $f25, $f26, $f0 \r\n"
+ "punpckhbh $f26, $f26, $f0 \r\n"
+ "paddsh $f27, $f5, $f7 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f6, $f8 \r\n"//src0+src1
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f3 \r\n"
+ "psubsh $f28, $f28, $f4 \r\n"
+ "psubsh $f27, $f27, $f9 \r\n"
+ "psubsh $f28, $f28, $f10 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f1 \r\n"
+ "paddsh $f28, $f28, $f2 \r\n"
+ "paddsh $f27, $f27, $f11 \r\n"
+ "paddsh $f28, $f28, $f12 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f2, $f27, $f28 \r\n"
+ "sdc1 $f2, 0(%[dst0]) \r\n"
+ "paddsh $f27, $f7, $f9 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f8, $f10 \r\n"//src1+src2
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f5 \r\n"
+ "psubsh $f28, $f28, $f6 \r\n"
+ "psubsh $f27, $f27, $f11 \r\n"
+ "psubsh $f28, $f28, $f12 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f3 \r\n"
+ "paddsh $f28, $f28, $f4 \r\n"
+ "paddsh $f27, $f27, $f13 \r\n"
+ "paddsh $f28, $f28, $f14 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f4, $f27, $f28 \r\n"
+ "sdc1 $f4, 0(%[dst1]) \r\n"
+ "paddsh $f27, $f9, $f11 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f10, $f12 \r\n"//src2+src3
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f7 \r\n"
+ "psubsh $f28, $f28, $f8 \r\n"
+ "psubsh $f27, $f27, $f13 \r\n"
+ "psubsh $f28, $f28, $f14 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f5 \r\n"
+ "paddsh $f28, $f28, $f6 \r\n"
+ "paddsh $f27, $f27, $f15 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f6, $f27, $f28 \r\n"
+ "sdc1 $f6, 0(%[dst2]) \r\n"
+ "paddsh $f27, $f11, $f13 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f12, $f14 \r\n"//src3+src4
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f9 \r\n"
+ "psubsh $f28, $f28, $f10 \r\n"
+ "psubsh $f27, $f27, $f15 \r\n"
+ "psubsh $f28, $f28, $f16 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f7 \r\n"
+ "paddsh $f28, $f28, $f8 \r\n"
+ "paddsh $f27, $f27, $f17 \r\n"
+ "paddsh $f28, $f28, $f18 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f8, $f27, $f28 \r\n"
+ "sdc1 $f8, 0(%[dst3]) \r\n"
+ "paddsh $f27, $f13, $f15 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f14, $f16 \r\n"//src4+src5
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f11 \r\n"
+ "psubsh $f28, $f28, $f12 \r\n"
+ "psubsh $f27, $f27, $f17 \r\n"
+ "psubsh $f28, $f28, $f18 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f9 \r\n"
+ "paddsh $f28, $f28, $f10 \r\n"
+ "paddsh $f27, $f27, $f19 \r\n"
+ "paddsh $f28, $f28, $f20 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f10, $f27, $f28 \r\n"
+ "sdc1 $f10, 0(%[dst4]) \r\n"
+
+ "paddsh $f27, $f15, $f17 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f16, $f18 \r\n"//src5+src6
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f13 \r\n"
+ "psubsh $f28, $f28, $f14 \r\n"
+ "psubsh $f27, $f27, $f19 \r\n"
+ "psubsh $f28, $f28, $f20 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f11 \r\n"
+ "paddsh $f28, $f28, $f12 \r\n"
+ "paddsh $f27, $f27, $f21 \r\n"
+ "paddsh $f28, $f28, $f22 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f12, $f27, $f28 \r\n"
+ "sdc1 $f12, 0(%[dst5]) \r\n"
+ "paddsh $f27, $f17, $f19 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f18, $f20 \r\n"//src6+src7
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f15 \r\n"
+ "psubsh $f28, $f28, $f16 \r\n"
+ "psubsh $f27, $f27, $f21 \r\n"
+ "psubsh $f28, $f28, $f22 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f13 \r\n"
+ "paddsh $f28, $f28, $f14 \r\n"
+ "paddsh $f27, $f27, $f23 \r\n"
+ "paddsh $f28, $f28, $f24 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f14, $f27, $f28 \r\n"
+ "sdc1 $f14, 0(%[dst6]) \r\n"
+ "paddsh $f27, $f19, $f21 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f20, $f22 \r\n"//src7+src8
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f17 \r\n"
+ "psubsh $f28, $f28, $f18 \r\n"
+ "psubsh $f27, $f27, $f23 \r\n"
+ "psubsh $f28, $f28, $f24 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f15 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f27, $f27, $f25 \r\n"
+ "paddsh $f28, $f28, $f26 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f16, $f27, $f28 \r\n"
+ "sdc1 $f16, 0(%[dst7]) \r\n"
+ ::[dst0]"r"(dst), [dst1]"r"(dst+dstStride),
+ [dst2]"r"(dst+2*dstStride), [dst3]"r"(dst+3*dstStride),
+ [dst4]"r"(dst+4*dstStride), [dst5]"r"(dst+5*dstStride),
+ [dst6]"r"(dst+6*dstStride), [dst7]"r"(dst+7*dstStride),
+ [srcB]"r"(src-2*srcStride), [srcA]"r"(src-srcStride),
+ [src0]"r"(src), [src1]"r"(src+srcStride),
+ [src2]"r"(src+2*srcStride), [src3]"r"(src+3*srcStride),
+ [src4]"r"(src+4*srcStride), [src5]"r"(src+5*srcStride),
+ [src6]"r"(src+6*srcStride), [src7]"r"(src+7*srcStride),
+ [src8]"r"(src+8*srcStride), [src9]"r"(src+9*srcStride),
+ [src10]"r"(src+10*srcStride), [ff_pw_4]"f"(ff_pw_4),
+ [ff_pw_5]"f"(ff_pw_5), [ff_pw_16]"f"(ff_pw_16)
+ : "$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7","$f8","$f9","$f10",
+ "$f11","$f12","$f13","$f14","$f15","$f16","$f17","$f18","$f19",
+ "$f20","$f21","$f22","$f23","$f24","$f25","$f26","$f27","$f28"
+ );
+}
+
+static void put_h264_qpel16_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ put_h264_qpel8_v_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_v_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ put_h264_qpel8_v_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_v_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+static void avg_h264_qpel4_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "gslwlc1 $f2, 3(%[srcB]) \r\n"
+ "gslwrc1 $f2, 0(%[srcB]) \r\n"
+ "gslwlc1 $f4, 3(%[srcA]) \r\n"
+ "gslwrc1 $f4, 0(%[srcA]) \r\n"
+ "gslwlc1 $f6, 3(%[src0]) \r\n"
+ "gslwrc1 $f6, 0(%[src0]) \r\n"
+ "gslwlc1 $f8, 3(%[src1]) \r\n"
+ "gslwrc1 $f8, 0(%[src1]) \r\n"
+ "gslwlc1 $f10, 3(%[src2]) \r\n"
+ "gslwrc1 $f10, 0(%[src2]) \r\n"
+ "gslwlc1 $f12, 3(%[src3]) \r\n"
+ "gslwrc1 $f12, 0(%[src3]) \r\n"
+ "gslwlc1 $f14, 3(%[src4]) \r\n"
+ "gslwrc1 $f14, 0(%[src4]) \r\n"
+ "gslwlc1 $f16, 3(%[src5]) \r\n"
+ "gslwrc1 $f16, 0(%[src5]) \r\n"
+ "gslwlc1 $f18, 3(%[src6]) \r\n"
+ "gslwrc1 $f18, 0(%[src6]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f14, $f14, $f0 \r\n"
+ "punpcklbh $f16, $f16, $f0 \r\n"
+ "punpcklbh $f18, $f18, $f0 \r\n"
+ "paddsh $f20, $f6, $f8 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f4, $f10 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f24, $f20, $f22 \r\n"
+ "paddsh $f24, $f24, $f2 \r\n"
+ "paddsh $f24, $f24, $f12 \r\n"
+ "paddsh $f20, $f8, $f10 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f6, $f12 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f26, $f20, $f22 \r\n"
+ "paddsh $f26, $f26, $f4 \r\n"
+ "paddsh $f26, $f26, $f14 \r\n"
+ "paddsh $f20, $f10, $f12 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f8, $f14 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f28, $f20, $f22 \r\n"
+ "paddsh $f28, $f28, $f6 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f20, $f12, $f14 \r\n"
+ "pmullh $f20, $f20, %[ff_pw_20] \r\n"
+ "paddsh $f22, $f10, $f16 \r\n"
+ "pmullh $f22, $f22, %[ff_pw_5] \r\n"
+ "psubsh $f30, $f20, $f22 \r\n"
+ "paddsh $f30, $f30, $f8 \r\n"
+ "paddsh $f30, $f30, $f18 \r\n"
+ "paddsh $f24, $f24, %[ff_pw_16] \r\n"
+ "paddsh $f26, $f26, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "paddsh $f30, $f30, %[ff_pw_16] \r\n"
+ "psrah $f24, $f24, %[ff_pw_5] \r\n"
+ "psrah $f26, $f26, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "psrah $f30, $f30, %[ff_pw_5] \r\n"
+ "packushb $f24, $f24, $f0 \r\n"
+ "packushb $f26, $f26, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "packushb $f30, $f30, $f0 \r\n"
+ "lwc1 $f2, 0(%[dst0]) \r\n"
+ "lwc1 $f4, 0(%[dst1]) \r\n"
+ "lwc1 $f6, 0(%[dst2]) \r\n"
+ "lwc1 $f8, 0(%[dst3]) \r\n"
+ "pavgb $f24, $f2, $f24 \r\n"
+ "pavgb $f26, $f4, $f26 \r\n"
+ "pavgb $f28, $f6, $f28 \r\n"
+ "pavgb $f30, $f8, $f30 \r\n"
+ "swc1 $f24, 0(%[dst0]) \r\n"
+ "swc1 $f26, 0(%[dst1]) \r\n"
+ "swc1 $f28, 0(%[dst2]) \r\n"
+ "swc1 $f30, 0(%[dst3]) \r\n"
+ ::[dst0]"r"(dst), [dst1]"r"(dst+dstStride),
+ [dst2]"r"(dst+2*dstStride), [dst3]"r"(dst+3*dstStride),
+ [srcB]"r"(src-2*srcStride), [srcA]"r"(src-srcStride),
+ [src0]"r"(src), [src1]"r"(src+srcStride),
+ [src2]"r"(src+2*srcStride), [src3]"r"(src+3*srcStride),
+ [src4]"r"(src+4*srcStride), [src5]"r"(src+5*srcStride),
+ [src6]"r"(src+6*srcStride), [ff_pw_20]"f"(ff_pw_20),
+ [ff_pw_5]"f"(ff_pw_5), [ff_pw_16]"f"(ff_pw_16)
+ : "$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16","$f18",
+ "$f20","$f22","$f24","$f26","$f28","$f30"
+ );
+}
+
+static void avg_h264_qpel8_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "gsldlc1 $f2, 7(%[srcB]) \r\n"
+ "gsldrc1 $f2, 0(%[srcB]) \r\n"
+ "gsldlc1 $f4, 7(%[srcA]) \r\n"
+ "gsldrc1 $f4, 0(%[srcA]) \r\n"
+ "gsldlc1 $f6, 7(%[src0]) \r\n"
+ "gsldrc1 $f6, 0(%[src0]) \r\n"
+ "gsldlc1 $f8, 7(%[src1]) \r\n"
+ "gsldrc1 $f8, 0(%[src1]) \r\n"
+ "gsldlc1 $f10, 7(%[src2]) \r\n"
+ "gsldrc1 $f10, 0(%[src2]) \r\n"
+ "gsldlc1 $f12, 7(%[src3]) \r\n"
+ "gsldrc1 $f12, 0(%[src3]) \r\n"
+ "gsldlc1 $f14, 7(%[src4]) \r\n"
+ "gsldrc1 $f14, 0(%[src4]) \r\n"
+ "gsldlc1 $f16, 7(%[src5]) \r\n"
+ "gsldrc1 $f16, 0(%[src5]) \r\n"
+ "gsldlc1 $f18, 7(%[src6]) \r\n"
+ "gsldrc1 $f18, 0(%[src6]) \r\n"
+ "gsldlc1 $f20, 7(%[src7]) \r\n"
+ "gsldrc1 $f20, 0(%[src7]) \r\n"
+ "gsldlc1 $f22, 7(%[src8]) \r\n"
+ "gsldrc1 $f22, 0(%[src8]) \r\n"
+ "gsldlc1 $f24, 7(%[src9]) \r\n"
+ "gsldrc1 $f24, 0(%[src9]) \r\n"
+ "gsldlc1 $f26, 7(%[src10]) \r\n"
+ "gsldrc1 $f26, 0(%[src10]) \r\n"
+ "punpcklbh $f1, $f2, $f0 \r\n"
+ "punpckhbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f3, $f4, $f0 \r\n"
+ "punpckhbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f5, $f6, $f0 \r\n"
+ "punpckhbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f7, $f8, $f0 \r\n"
+ "punpckhbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f9, $f10, $f0 \r\n"
+ "punpckhbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f11, $f12, $f0 \r\n"
+ "punpckhbh $f12, $f12, $f0 \r\n"
+ "punpcklbh $f13, $f14, $f0 \r\n"
+ "punpckhbh $f14, $f14, $f0 \r\n"
+ "punpcklbh $f15, $f16, $f0 \r\n"
+ "punpckhbh $f16, $f16, $f0 \r\n"
+ "punpcklbh $f17, $f18, $f0 \r\n"
+ "punpckhbh $f18, $f18, $f0 \r\n"
+ "punpcklbh $f19, $f20, $f0 \r\n"
+ "punpckhbh $f20, $f20, $f0 \r\n"
+ "punpcklbh $f21, $f22, $f0 \r\n"
+ "punpckhbh $f22, $f22, $f0 \r\n"
+ "punpcklbh $f23, $f24, $f0 \r\n"
+ "punpckhbh $f24, $f24, $f0 \r\n"
+ "punpcklbh $f25, $f26, $f0 \r\n"
+ "punpckhbh $f26, $f26, $f0 \r\n"
+ "paddsh $f27, $f5, $f7 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f6, $f8 \r\n"//src0+src1
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f3 \r\n"
+ "psubsh $f28, $f28, $f4 \r\n"
+ "psubsh $f27, $f27, $f9 \r\n"
+ "psubsh $f28, $f28, $f10 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f1 \r\n"
+ "paddsh $f28, $f28, $f2 \r\n"
+ "paddsh $f27, $f27, $f11 \r\n"
+ "paddsh $f28, $f28, $f12 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f2, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst0]) \r\n"
+ "pavgb $f2, $f2, $f28 \r\n"
+ "sdc1 $f2, 0(%[dst0]) \r\n"
+ "paddsh $f27, $f7, $f9 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f8, $f10 \r\n"//src1+src2
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f5 \r\n"
+ "psubsh $f28, $f28, $f6 \r\n"
+ "psubsh $f27, $f27, $f11 \r\n"
+ "psubsh $f28, $f28, $f12 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f3 \r\n"
+ "paddsh $f28, $f28, $f4 \r\n"
+ "paddsh $f27, $f27, $f13 \r\n"
+ "paddsh $f28, $f28, $f14 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f4, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst1]) \r\n"
+ "pavgb $f4, $f4, $f28 \r\n"
+ "sdc1 $f4, 0(%[dst1]) \r\n"
+ "paddsh $f27, $f9, $f11 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f10, $f12 \r\n"//src2+src3
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f7 \r\n"
+ "psubsh $f28, $f28, $f8 \r\n"
+ "psubsh $f27, $f27, $f13 \r\n"
+ "psubsh $f28, $f28, $f14 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f5 \r\n"
+ "paddsh $f28, $f28, $f6 \r\n"
+ "paddsh $f27, $f27, $f15 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f6, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst2]) \r\n"
+ "pavgb $f6, $f6, $f28 \r\n"
+ "sdc1 $f6, 0(%[dst2]) \r\n"
+ "paddsh $f27, $f11, $f13 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f12, $f14 \r\n"//src3+src4
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f9 \r\n"
+ "psubsh $f28, $f28, $f10 \r\n"
+ "psubsh $f27, $f27, $f15 \r\n"
+ "psubsh $f28, $f28, $f16 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f7 \r\n"
+ "paddsh $f28, $f28, $f8 \r\n"
+ "paddsh $f27, $f27, $f17 \r\n"
+ "paddsh $f28, $f28, $f18 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f8, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst3]) \r\n"
+ "pavgb $f8, $f8, $f28 \r\n"
+ "sdc1 $f8, 0(%[dst3]) \r\n"
+ "paddsh $f27, $f13, $f15 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f14, $f16 \r\n"//src4+src5
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f11 \r\n"
+ "psubsh $f28, $f28, $f12 \r\n"
+ "psubsh $f27, $f27, $f17 \r\n"
+ "psubsh $f28, $f28, $f18 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f9 \r\n"
+ "paddsh $f28, $f28, $f10 \r\n"
+ "paddsh $f27, $f27, $f19 \r\n"
+ "paddsh $f28, $f28, $f20 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f10, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst4]) \r\n"
+ "pavgb $f10, $f10, $f28 \r\n"
+ "sdc1 $f10, 0(%[dst4]) \r\n"
+ "paddsh $f27, $f15, $f17 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f16, $f18 \r\n"//src5+src6
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f13 \r\n"
+ "psubsh $f28, $f28, $f14 \r\n"
+ "psubsh $f27, $f27, $f19 \r\n"
+ "psubsh $f28, $f28, $f20 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f11 \r\n"
+ "paddsh $f28, $f28, $f12 \r\n"
+ "paddsh $f27, $f27, $f21 \r\n"
+ "paddsh $f28, $f28, $f22 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f12, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst5]) \r\n"
+ "pavgb $f12, $f12, $f28 \r\n"
+ "sdc1 $f12, 0(%[dst5]) \r\n"
+ "paddsh $f27, $f17, $f19 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f18, $f20 \r\n"//src6+src7
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f15 \r\n"
+ "psubsh $f28, $f28, $f16 \r\n"
+ "psubsh $f27, $f27, $f21 \r\n"
+ "psubsh $f28, $f28, $f22 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f13 \r\n"
+ "paddsh $f28, $f28, $f14 \r\n"
+ "paddsh $f27, $f27, $f23 \r\n"
+ "paddsh $f28, $f28, $f24 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f14, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst6]) \r\n"
+ "pavgb $f14, $f14, $f28 \r\n"
+ "sdc1 $f14, 0(%[dst6]) \r\n"
+ "paddsh $f27, $f19, $f21 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_4] \r\n"
+ "paddsh $f28, $f20, $f22 \r\n"//src7+src8
+ "pmullh $f28, $f28, %[ff_pw_4] \r\n"
+ "psubsh $f27, $f27, $f17 \r\n"
+ "psubsh $f28, $f28, $f18 \r\n"
+ "psubsh $f27, $f27, $f23 \r\n"
+ "psubsh $f28, $f28, $f24 \r\n"
+ "pmullh $f27, $f27, %[ff_pw_5] \r\n"
+ "pmullh $f28, $f28, %[ff_pw_5] \r\n"
+ "paddsh $f27, $f27, $f15 \r\n"
+ "paddsh $f28, $f28, $f16 \r\n"
+ "paddsh $f27, $f27, $f25 \r\n"
+ "paddsh $f28, $f28, $f26 \r\n"
+ "paddsh $f27, $f27, %[ff_pw_16] \r\n"
+ "paddsh $f28, $f28, %[ff_pw_16] \r\n"
+ "psrah $f27, $f27, %[ff_pw_5] \r\n"
+ "psrah $f28, $f28, %[ff_pw_5] \r\n"
+ "packushb $f27, $f27, $f0 \r\n"
+ "packushb $f28, $f28, $f0 \r\n"
+ "punpcklwd $f16, $f27, $f28 \r\n"
+ "ldc1 $f28, 0(%[dst7]) \r\n"
+ "pavgb $f16, $f16, $f28 \r\n"
+ "sdc1 $f16, 0(%[dst7]) \r\n"
+ ::[dst0]"r"(dst), [dst1]"r"(dst+dstStride),
+ [dst2]"r"(dst+2*dstStride), [dst3]"r"(dst+3*dstStride),
+ [dst4]"r"(dst+4*dstStride), [dst5]"r"(dst+5*dstStride),
+ [dst6]"r"(dst+6*dstStride), [dst7]"r"(dst+7*dstStride),
+ [srcB]"r"(src-2*srcStride), [srcA]"r"(src-srcStride),
+ [src0]"r"(src), [src1]"r"(src+srcStride),
+ [src2]"r"(src+2*srcStride), [src3]"r"(src+3*srcStride),
+ [src4]"r"(src+4*srcStride), [src5]"r"(src+5*srcStride),
+ [src6]"r"(src+6*srcStride), [src7]"r"(src+7*srcStride),
+ [src8]"r"(src+8*srcStride), [src9]"r"(src+9*srcStride),
+ [src10]"r"(src+10*srcStride), [ff_pw_4]"f"(ff_pw_4),
+ [ff_pw_5]"f"(ff_pw_5), [ff_pw_16]"f"(ff_pw_16)
+ : "$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7","$f8","$f9","$f10",
+ "$f11","$f12","$f13","$f14","$f15","$f16","$f17","$f18","$f19",
+ "$f20","$f21","$f22","$f23","$f24","$f25","$f26","$f27","$f28"
+ );
+}
+
+static void avg_h264_qpel16_v_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ avg_h264_qpel8_v_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_v_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ avg_h264_qpel8_v_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_v_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+static void put_h264_qpel4_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ int i;
+ int16_t _tmp[36];
+ int16_t *tmp = _tmp;
+ src -= 2*srcStride;
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 9 \r\n"
+ "1: \r\n"
+ "gslwlc1 $f2, 1(%[src]) \r\n"
+ "gslwrc1 $f2, -2(%[src]) \r\n"
+ "gslwlc1 $f4, 2(%[src]) \r\n"
+ "gslwrc1 $f4, -1(%[src]) \r\n"
+ "gslwlc1 $f6, 3(%[src]) \r\n"
+ "gslwrc1 $f6, 0(%[src]) \r\n"
+ "gslwlc1 $f8, 4(%[src]) \r\n"
+ "gslwrc1 $f8, 1(%[src]) \r\n"
+ "gslwlc1 $f10, 5(%[src]) \r\n"
+ "gslwrc1 $f10, 2(%[src]) \r\n"
+ "gslwlc1 $f12, 6(%[src]) \r\n"
+ "gslwrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+ "sdc1 $f18, 0(%[tmp]) \r\n"
+ "dadd %[tmp], %[tmp], %[tmpStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [tmp]"+&r"(tmp),[src]"+&r"(src)
+ : [tmpStride]"r"(8),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16","$f18"
+ );
+
+ tmp -= 28;
+
+ for(i=0; i<4; i++) {
+ const int16_t tmpB= tmp[-8];
+ const int16_t tmpA= tmp[-4];
+ const int16_t tmp0= tmp[ 0];
+ const int16_t tmp1= tmp[ 4];
+ const int16_t tmp2= tmp[ 8];
+ const int16_t tmp3= tmp[12];
+ const int16_t tmp4= tmp[16];
+ const int16_t tmp5= tmp[20];
+ const int16_t tmp6= tmp[24];
+ op2_put(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));
+ op2_put(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));
+ op2_put(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));
+ op2_put(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));
+ dst++;
+ tmp++;
+ }
+}
+
+static void put_h264_qpel8_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ int16_t _tmp[104];
+ int16_t *tmp = _tmp;
+ int i;
+ src -= 2*srcStride;
+
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 13 \r\n"
+ "1: \r\n"
+ "gsldlc1 $f2, 5(%[src]) \r\n"
+ "gsldrc1 $f2, -2(%[src]) \r\n"
+ "gsldlc1 $f4, 6(%[src]) \r\n"
+ "gsldrc1 $f4, -1(%[src]) \r\n"
+ "gsldlc1 $f6, 7(%[src]) \r\n"
+ "gsldrc1 $f6, 0(%[src]) \r\n"
+ "gsldlc1 $f8, 8(%[src]) \r\n"
+ "gsldrc1 $f8, 1(%[src]) \r\n"
+ "gsldlc1 $f10, 9(%[src]) \r\n"
+ "gsldrc1 $f10, 2(%[src]) \r\n"
+ "gsldlc1 $f12, 10(%[src]) \r\n"
+ "gsldrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f1, $f2, $f0 \r\n"
+ "punpcklbh $f3, $f4, $f0 \r\n"
+ "punpcklbh $f5, $f6, $f0 \r\n"
+ "punpcklbh $f7, $f8, $f0 \r\n"
+ "punpcklbh $f9, $f10, $f0 \r\n"
+ "punpcklbh $f11, $f12, $f0 \r\n"
+ "punpckhbh $f2, $f2, $f0 \r\n"
+ "punpckhbh $f4, $f4, $f0 \r\n"
+ "punpckhbh $f6, $f6, $f0 \r\n"
+ "punpckhbh $f8, $f8, $f0 \r\n"
+ "punpckhbh $f10, $f10, $f0 \r\n"
+ "punpckhbh $f12, $f12, $f0 \r\n"
+ "paddsh $f13, $f5, $f7 \r\n"
+ "paddsh $f15, $f3, $f9 \r\n"
+ "paddsh $f17, $f1, $f11 \r\n"
+ "pmullh $f13, $f13, %[ff_pw_20] \r\n"
+ "pmullh $f15, $f15, %[ff_pw_5] \r\n"
+ "psubsh $f13, $f13, $f15 \r\n"
+ "paddsh $f17, $f13, $f17 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+ "sdc1 $f17, 0(%[tmp]) \r\n"
+ "sdc1 $f18, 8(%[tmp]) \r\n"
+ "dadd %[tmp], %[tmp], %[tmpStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [tmp]"+&r"(tmp),[src]"+&r"(src)
+ : [tmpStride]"r"(16),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5)
+ : "$8","$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7","$f8","$f9",
+ "$f10","$f11","$f12","$f13","$f14","$f15","$f16","$f17","$f18"
+ );
+
+ tmp -= 88;
+
+ for(i=0; i<8; i++) {
+ const int tmpB= tmp[-16];
+ const int tmpA= tmp[ -8];
+ const int tmp0= tmp[ 0];
+ const int tmp1= tmp[ 8];
+ const int tmp2= tmp[ 16];
+ const int tmp3= tmp[ 24];
+ const int tmp4= tmp[ 32];
+ const int tmp5= tmp[ 40];
+ const int tmp6= tmp[ 48];
+ const int tmp7= tmp[ 56];
+ const int tmp8= tmp[ 64];
+ const int tmp9= tmp[ 72];
+ const int tmp10=tmp[ 80];
+ op2_put(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));
+ op2_put(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));
+ op2_put(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));
+ op2_put(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));
+ op2_put(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));
+ op2_put(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));
+ op2_put(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));
+ op2_put(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));
+ dst++;
+ tmp++;
+ }
+}
+
+static void put_h264_qpel16_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ put_h264_qpel8_hv_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_hv_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ put_h264_qpel8_hv_lowpass_mmi(dst, src, dstStride, srcStride);
+ put_h264_qpel8_hv_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+static void avg_h264_qpel4_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ int i;
+ int16_t _tmp[36];
+ int16_t *tmp = _tmp;
+ src -= 2*srcStride;
+
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 9 \r\n"
+ "1: \r\n"
+ "gslwlc1 $f2, 1(%[src]) \r\n"
+ "gslwrc1 $f2, -2(%[src]) \r\n"
+ "gslwlc1 $f4, 2(%[src]) \r\n"
+ "gslwrc1 $f4, -1(%[src]) \r\n"
+ "gslwlc1 $f6, 3(%[src]) \r\n"
+ "gslwrc1 $f6, 0(%[src]) \r\n"
+ "gslwlc1 $f8, 4(%[src]) \r\n"
+ "gslwrc1 $f8, 1(%[src]) \r\n"
+ "gslwlc1 $f10, 5(%[src]) \r\n"
+ "gslwrc1 $f10, 2(%[src]) \r\n"
+ "gslwlc1 $f12, 6(%[src]) \r\n"
+ "gslwrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f2, $f2, $f0 \r\n"
+ "punpcklbh $f4, $f4, $f0 \r\n"
+ "punpcklbh $f6, $f6, $f0 \r\n"
+ "punpcklbh $f8, $f8, $f0 \r\n"
+ "punpcklbh $f10, $f10, $f0 \r\n"
+ "punpcklbh $f12, $f12, $f0 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+ "sdc1 $f18, 0(%[tmp]) \r\n"
+ "dadd %[tmp], %[tmp], %[tmpStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [tmp]"+&r"(tmp),[src]"+&r"(src)
+ : [tmpStride]"r"(8),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16","$f18"
+ );
+
+ tmp -= 28;
+
+ for(i=0; i<4; i++)
+ {
+ const int16_t tmpB= tmp[-8];
+ const int16_t tmpA= tmp[-4];
+ const int16_t tmp0= tmp[ 0];
+ const int16_t tmp1= tmp[ 4];
+ const int16_t tmp2= tmp[ 8];
+ const int16_t tmp3= tmp[12];
+ const int16_t tmp4= tmp[16];
+ const int16_t tmp5= tmp[20];
+ const int16_t tmp6= tmp[24];
+ op2_avg(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));
+ op2_avg(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));
+ op2_avg(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));
+ op2_avg(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));
+ dst++;
+ tmp++;
+ }
+}
+
+static void avg_h264_qpel8_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride)
+{
+ int16_t _tmp[104];
+ int16_t *tmp = _tmp;
+ int i;
+ src -= 2*srcStride;
+
+ __asm__ volatile (
+ "xor $f0, $f0, $f0 \r\n"
+ "dli $8, 13 \r\n"
+ "1: \r\n"
+ "gsldlc1 $f2, 5(%[src]) \r\n"
+ "gsldrc1 $f2, -2(%[src]) \r\n"
+ "gsldlc1 $f4, 6(%[src]) \r\n"
+ "gsldrc1 $f4, -1(%[src]) \r\n"
+ "gsldlc1 $f6, 7(%[src]) \r\n"
+ "gsldrc1 $f6, 0(%[src]) \r\n"
+ "gsldlc1 $f8, 8(%[src]) \r\n"
+ "gsldrc1 $f8, 1(%[src]) \r\n"
+ "gsldlc1 $f10, 9(%[src]) \r\n"
+ "gsldrc1 $f10, 2(%[src]) \r\n"
+ "gsldlc1 $f12, 10(%[src]) \r\n"
+ "gsldrc1 $f12, 3(%[src]) \r\n"
+ "punpcklbh $f1, $f2, $f0 \r\n"
+ "punpcklbh $f3, $f4, $f0 \r\n"
+ "punpcklbh $f5, $f6, $f0 \r\n"
+ "punpcklbh $f7, $f8, $f0 \r\n"
+ "punpcklbh $f9, $f10, $f0 \r\n"
+ "punpcklbh $f11, $f12, $f0 \r\n"
+ "punpckhbh $f2, $f2, $f0 \r\n"
+ "punpckhbh $f4, $f4, $f0 \r\n"
+ "punpckhbh $f6, $f6, $f0 \r\n"
+ "punpckhbh $f8, $f8, $f0 \r\n"
+ "punpckhbh $f10, $f10, $f0 \r\n"
+ "punpckhbh $f12, $f12, $f0 \r\n"
+ "paddsh $f13, $f5, $f7 \r\n"
+ "paddsh $f15, $f3, $f9 \r\n"
+ "paddsh $f17, $f1, $f11 \r\n"
+ "pmullh $f13, $f13, %[ff_pw_20] \r\n"
+ "pmullh $f15, $f15, %[ff_pw_5] \r\n"
+ "psubsh $f13, $f13, $f15 \r\n"
+ "paddsh $f17, $f13, $f17 \r\n"
+ "paddsh $f14, $f6, $f8 \r\n"
+ "paddsh $f16, $f4, $f10 \r\n"
+ "paddsh $f18, $f2, $f12 \r\n"
+ "pmullh $f14, $f14, %[ff_pw_20] \r\n"
+ "pmullh $f16, $f16, %[ff_pw_5] \r\n"
+ "psubsh $f14, $f14, $f16 \r\n"
+ "paddsh $f18, $f14, $f18 \r\n"
+
+ "sdc1 $f17, 0(%[tmp]) \r\n"
+ "sdc1 $f18, 8(%[tmp]) \r\n"
+ "dadd %[tmp], %[tmp], %[tmpStride] \r\n"
+ "dadd %[src], %[src], %[srcStride] \r\n"
+ "daddi $8, $8, -1 \r\n"
+ "bnez $8, 1b \r\n"
+ : [tmp]"+&r"(tmp),[src]"+&r"(src)
+ : [tmpStride]"r"(16),[srcStride]"r"(srcStride),
+ [ff_pw_20]"f"(ff_pw_20),[ff_pw_5]"f"(ff_pw_5)
+ : "$8","$f0","$f1","$f2","$f3","$f4","$f5","$f6","$f7","$f8","$f9",
+ "$f10","$f11","$f12","$f13","$f14","$f15","$f16","$f17","$f18"
+ );
+
+ tmp -= 88;
+
+ for(i=0; i<8; i++) {
+ const int tmpB= tmp[-16];
+ const int tmpA= tmp[ -8];
+ const int tmp0= tmp[ 0];
+ const int tmp1= tmp[ 8];
+ const int tmp2= tmp[ 16];
+ const int tmp3= tmp[ 24];
+ const int tmp4= tmp[ 32];
+ const int tmp5= tmp[ 40];
+ const int tmp6= tmp[ 48];
+ const int tmp7= tmp[ 56];
+ const int tmp8= tmp[ 64];
+ const int tmp9= tmp[ 72];
+ const int tmp10=tmp[ 80];
+ op2_avg(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));
+ op2_avg(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));
+ op2_avg(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));
+ op2_avg(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));
+ op2_avg(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));
+ op2_avg(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));
+ op2_avg(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));
+ op2_avg(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));
+ dst++;
+ tmp++;
+ }
+}
+
+static void avg_h264_qpel16_hv_lowpass_mmi(uint8_t *dst, const uint8_t *src,
+ int dstStride, int srcStride){
+ avg_h264_qpel8_hv_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_hv_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+ src += 8*srcStride;
+ dst += 8*dstStride;
+ avg_h264_qpel8_hv_lowpass_mmi(dst, src, dstStride, srcStride);
+ avg_h264_qpel8_hv_lowpass_mmi(dst+8, src+8, dstStride, srcStride);
+}
+
+//DEF_H264_MC_MMI(put_, 4)
+void ff_put_h264_qpel4_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_pixels4_mmi(dst, src, stride, 4);
+}
+
+void ff_put_h264_qpel4_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[16];
+ put_h264_qpel4_h_lowpass_mmi(half, src, 4, stride);
+ put_pixels4_l2_mmi(dst, src, half, stride, stride, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel4_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel4_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[16];
+ put_h264_qpel4_h_lowpass_mmi(half, src, 4, stride);
+ put_pixels4_l2_mmi(dst, src+1, half, stride, stride, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t half[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(half, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, full_mid, half, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(dst, full_mid, stride, 4);
+}
+
+void ff_put_h264_qpel4_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t half[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(half, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, full_mid+4, half, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel4_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel4_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[16];
+ uint8_t halfHV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ put_pixels4_l2_mmi(dst, halfH, halfHV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[16];
+ uint8_t halfHV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ put_pixels4_l2_mmi(dst, halfH, halfHV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfV[16];
+ uint8_t halfHV[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ put_pixels4_l2_mmi(dst, halfV, halfHV, stride, 4, 4, 4);
+}
+
+void ff_put_h264_qpel4_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfV[16];
+ uint8_t halfHV[16];
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ put_pixels4_l2_mmi(dst, halfV, halfHV, stride, 4, 4, 4);
+}
+
+//DEF_H264_MC_MMI(avg_, 4)
+void ff_avg_h264_qpel4_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_pixels4_mmi(dst, src, stride, 4);
+}
+
+void ff_avg_h264_qpel4_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[16];
+ put_h264_qpel4_h_lowpass_mmi(half, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, src, half, stride, stride, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel4_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel4_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[16];
+ put_h264_qpel4_h_lowpass_mmi(half, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, src+1, half, stride, stride, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t half[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(half, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, full_mid, half, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ avg_h264_qpel4_v_lowpass_mmi(dst, full_mid, stride, 4);
+}
+
+void ff_avg_h264_qpel4_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t half[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(half, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, full_mid+4, half, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfH[16];
+ uint8_t halfV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ avg_pixels4_l2_mmi(dst, halfH, halfV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel4_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel4_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[16];
+ uint8_t halfHV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src, 4, stride);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, halfH, halfHV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[16];
+ uint8_t halfHV[16];
+ put_h264_qpel4_h_lowpass_mmi(halfH, src + stride, 4, stride);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, halfH, halfHV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfV[16];
+ uint8_t halfHV[16];
+ copy_block4_mmi(full, src - stride*2, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, halfV, halfHV, stride, 4, 4, 4);
+}
+
+void ff_avg_h264_qpel4_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[36];
+ uint8_t * const full_mid= full + 8;
+ uint8_t halfV[16];
+ uint8_t halfHV[16];
+ copy_block4_mmi(full, src - stride*2 + 1, 4, stride, 9);
+ put_h264_qpel4_v_lowpass_mmi(halfV, full_mid, 4, 4);
+ put_h264_qpel4_hv_lowpass_mmi(halfHV, src, 4, stride);
+ avg_pixels4_l2_mmi(dst, halfV, halfHV, stride, 4, 4, 4);
+}
+
+//DEF_H264_MC_MMI(put_, 8)
+void ff_put_h264_qpel8_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_pixels8_mmi(dst, src, stride, 8);
+}
+
+void ff_put_h264_qpel8_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[64];
+ put_h264_qpel8_h_lowpass_mmi(half, src, 8, stride);
+ put_pixels8_l2_mmi(dst, src, half, stride, stride, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel8_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel8_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[64];
+ put_h264_qpel8_h_lowpass_mmi(half, src, 8, stride);
+ put_pixels8_l2_mmi(dst, src+1, half, stride, stride, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t half[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(half, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, full_mid, half, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(dst, full_mid, stride, 8);
+}
+
+void ff_put_h264_qpel8_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t half[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(half, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, full_mid+8, half, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel8_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel8_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[64];
+ uint8_t halfHV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ put_pixels8_l2_mmi(dst, halfH, halfHV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[64];
+ uint8_t halfHV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ put_pixels8_l2_mmi(dst, halfH, halfHV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfV[64];
+ uint8_t halfHV[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ put_pixels8_l2_mmi(dst, halfV, halfHV, stride, 8, 8, 8);
+}
+
+void ff_put_h264_qpel8_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfV[64];
+ uint8_t halfHV[64];
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ put_pixels8_l2_mmi(dst, halfV, halfHV, stride, 8, 8, 8);
+}
+
+//DEF_H264_MC_MMI(avg_, 8)
+void ff_avg_h264_qpel8_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_pixels8_mmi(dst, src, stride, 8);
+}
+
+void ff_avg_h264_qpel8_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[64];
+ put_h264_qpel8_h_lowpass_mmi(half, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, src, half, stride, stride, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel8_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel8_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[64];
+ put_h264_qpel8_h_lowpass_mmi(half, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, src+1, half, stride, stride, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t half[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(half, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, full_mid, half, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ avg_h264_qpel8_v_lowpass_mmi(dst, full_mid, stride, 8);
+}
+
+void ff_avg_h264_qpel8_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t half[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(half, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, full_mid+8, half, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfH[64];
+ uint8_t halfV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ avg_pixels8_l2_mmi(dst, halfH, halfV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel8_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel8_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[64];
+ uint8_t halfHV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src, 8, stride);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, halfH, halfHV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[64];
+ uint8_t halfHV[64];
+ put_h264_qpel8_h_lowpass_mmi(halfH, src + stride, 8, stride);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, halfH, halfHV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfV[64];
+ uint8_t halfHV[64];
+ copy_block8_mmi(full, src - stride*2, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, halfV, halfHV, stride, 8, 8, 8);
+}
+
+void ff_avg_h264_qpel8_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[104];
+ uint8_t * const full_mid= full + 16;
+ uint8_t halfV[64];
+ uint8_t halfHV[64];
+ copy_block8_mmi(full, src - stride*2 + 1, 8, stride, 13);
+ put_h264_qpel8_v_lowpass_mmi(halfV, full_mid, 8, 8);
+ put_h264_qpel8_hv_lowpass_mmi(halfHV, src, 8, stride);
+ avg_pixels8_l2_mmi(dst, halfV, halfHV, stride, 8, 8, 8);
+}
+
+//DEF_H264_MC_MMI(put_, 16)
+void ff_put_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_pixels16_mmi(dst, src, stride, 16);
+}
+
+void ff_put_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[256];
+ put_h264_qpel16_h_lowpass_mmi(half, src, 16, stride);
+ put_pixels16_l2_mmi(dst, src, half, stride, stride, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel16_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel16_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[256];
+ put_h264_qpel16_h_lowpass_mmi(half, src, 16, stride);
+ put_pixels16_l2_mmi(dst, src+1, half, stride, stride, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t half[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(half, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, full_mid, half, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(dst, full_mid, stride, 16);
+}
+
+void ff_put_h264_qpel16_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t half[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(half, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, full_mid+16, half, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ put_h264_qpel16_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_put_h264_qpel16_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[256];
+ uint8_t halfHV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ put_pixels16_l2_mmi(dst, halfH, halfHV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[256];
+ uint8_t halfHV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ put_pixels16_l2_mmi(dst, halfH, halfHV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfV[256];
+ uint8_t halfHV[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ put_pixels16_l2_mmi(dst, halfV, halfHV, stride, 16, 16, 16);
+}
+
+void ff_put_h264_qpel16_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfV[256];
+ uint8_t halfHV[256];
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ put_pixels16_l2_mmi(dst, halfV, halfHV, stride, 16, 16, 16);
+}
+
+//DEF_H264_MC_MMI(avg_, 16)
+void ff_avg_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_pixels16_mmi(dst, src, stride, 16);
+}
+
+void ff_avg_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[256];
+ put_h264_qpel16_h_lowpass_mmi(half, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, src, half, stride, stride, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc20_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel16_h_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel16_mc30_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t half[256];
+ put_h264_qpel16_h_lowpass_mmi(half, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, src+1, half, stride, stride, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc01_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t half[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(half, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, full_mid, half, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc02_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ avg_h264_qpel16_v_lowpass_mmi(dst, full_mid, stride, 16);
+}
+
+void ff_avg_h264_qpel16_mc03_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t half[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(half, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, full_mid+16, half, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc11_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc31_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc13_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc33_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfH[256];
+ uint8_t halfV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ avg_pixels16_l2_mmi(dst, halfH, halfV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc22_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ avg_h264_qpel16_hv_lowpass_mmi(dst, src, stride, stride);
+}
+
+void ff_avg_h264_qpel16_mc21_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[256];
+ uint8_t halfHV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src, 16, stride);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, halfH, halfHV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc23_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t halfH[256];
+ uint8_t halfHV[256];
+ put_h264_qpel16_h_lowpass_mmi(halfH, src + stride, 16, stride);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, halfH, halfHV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc12_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfV[256];
+ uint8_t halfHV[256];
+ copy_block16_mmi(full, src - stride*2, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, halfV, halfHV, stride, 16, 16, 16);
+}
+
+void ff_avg_h264_qpel16_mc32_mmi(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ uint8_t full[336];
+ uint8_t * const full_mid= full + 32;
+ uint8_t halfV[256];
+ uint8_t halfHV[256];
+ copy_block16_mmi(full, src - stride*2 + 1, 16, stride, 21);
+ put_h264_qpel16_v_lowpass_mmi(halfV, full_mid, 16, 16);
+ put_h264_qpel16_hv_lowpass_mmi(halfHV, src, 16, stride);
+ avg_pixels16_l2_mmi(dst, halfV, halfHV, stride, 16, 16, 16);
+}
+
+#undef op2_avg
+#undef op2_put
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c
index 0709b40ccf3..8208be327da 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c
@@ -4369,7 +4369,7 @@ BI_MC_COPY(64);
#undef BI_MC_COPY
#define BI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
-void ff_hevc_put_hevc_bi_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t dst_stride, \
uint8_t *src, \
ptrdiff_t src_stride, \
@@ -4423,7 +4423,7 @@ BI_MC(epel, v, 32, 4, vt, my);
#undef BI_MC
#define BI_MC_HV(PEL, DIR, WIDTH, TAP, DIR1) \
-void ff_hevc_put_hevc_bi_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t dst_stride, \
uint8_t *src, \
ptrdiff_t src_stride, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c
index a1deb0ec4ef..05a28ece44f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c
@@ -5454,7 +5454,7 @@ BI_W_MC_COPY(64);
#undef BI_W_MC_COPY
#define BI_W_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
-void ff_hevc_put_hevc_bi_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
@@ -5521,7 +5521,7 @@ BI_W_MC(epel, v, 32, 4, vt, my);
#undef BI_W_MC
#define BI_W_MC_HV(PEL, DIR, WIDTH, TAP, DIR1) \
-void ff_hevc_put_hevc_bi_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c
index 61a67c9ffab..754fbdbb413 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c
@@ -3871,7 +3871,7 @@ UNI_MC_COPY(64);
#undef UNI_MC_COPY
#define UNI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
-void ff_hevc_put_hevc_uni_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
@@ -3925,7 +3925,7 @@ UNI_MC(epel, v, 32, 4, vt, my);
#undef UNI_MC
#define UNI_MC_HV(PEL, DIR, WIDTH, TAP, DIR1) \
-void ff_hevc_put_hevc_uni_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c
index 90796300d4f..ce10f413ed9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c
@@ -4687,7 +4687,7 @@ UNIWGT_MC_COPY(64);
#undef UNIWGT_MC_COPY
#define UNI_W_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
-void ff_hevc_put_hevc_uni_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
@@ -4746,7 +4746,7 @@ UNI_W_MC(epel, v, 32, 4, vt, my);
#undef UNI_W_MC
#define UNI_W_MC_HV(PEL, DIR, WIDTH, TAP, DIR1) \
-void ff_hevc_put_hevc_uni_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_mips.h
index f26d7d9a0b4..1573d1cc9d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_mips.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_mips.h
@@ -24,7 +24,7 @@
#include "libavcodec/hevcdsp.h"
#define MC(PEL, DIR, WIDTH) \
-void ff_hevc_put_hevc_##PEL##_##DIR####WIDTH##_8_msa(int16_t *dst, \
+void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \
uint8_t *src, \
ptrdiff_t src_stride, \
int height, \
@@ -102,7 +102,7 @@ MC(epel, hv, 64);
#undef MC
#define UNI_MC(PEL, DIR, WIDTH) \
-void ff_hevc_put_hevc_uni_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t dst_stride, \
uint8_t *src, \
ptrdiff_t src_stride, \
@@ -181,7 +181,7 @@ UNI_MC(epel, hv, 64);
#undef UNI_MC
#define UNI_W_MC(PEL, DIR, WIDTH) \
-void ff_hevc_put_hevc_uni_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
@@ -265,7 +265,7 @@ UNI_W_MC(epel, hv, 64);
#undef UNI_W_MC
#define BI_MC(PEL, DIR, WIDTH) \
-void ff_hevc_put_hevc_bi_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t dst_stride, \
uint8_t *src, \
ptrdiff_t src_stride, \
@@ -345,7 +345,7 @@ BI_MC(epel, hv, 64);
#undef BI_MC
#define BI_W_MC(PEL, DIR, WIDTH) \
-void ff_hevc_put_hevc_bi_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst, \
+void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \
ptrdiff_t \
dst_stride, \
uint8_t *src, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_msa.c
index ed3acbb8f13..f2bc748e378 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_msa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hevcdsp_msa.c
@@ -3792,7 +3792,7 @@ MC_COPY(64);
#undef MC_COPY
#define MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
-void ff_hevc_put_hevc_##PEL##_##DIR####WIDTH##_8_msa(int16_t *dst, \
+void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \
uint8_t *src, \
ptrdiff_t src_stride, \
int height, \
@@ -3843,7 +3843,7 @@ MC(epel, v, 32, 4, vt, my);
#undef MC
#define MC_HV(PEL, DIR, WIDTH, TAP, DIR1) \
-void ff_hevc_put_hevc_##PEL##_##DIR####WIDTH##_8_msa(int16_t *dst, \
+void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \
uint8_t *src, \
ptrdiff_t src_stride, \
int height, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_init_mips.c
new file mode 100644
index 00000000000..82f2310985b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_init_mips.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "../hpeldsp.h"
+#include "libavcodec/mips/hpeldsp_mips.h"
+
+#if HAVE_MSA
+static void ff_hpeldsp_init_msa(HpelDSPContext *c, int flags)
+{
+ c->put_pixels_tab[0][0] = ff_put_pixels16_msa;
+ c->put_pixels_tab[0][1] = ff_put_pixels16_x2_msa;
+ c->put_pixels_tab[0][2] = ff_put_pixels16_y2_msa;
+ c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_msa;
+
+ c->put_pixels_tab[1][0] = ff_put_pixels8_msa;
+ c->put_pixels_tab[1][1] = ff_put_pixels8_x2_msa;
+ c->put_pixels_tab[1][2] = ff_put_pixels8_y2_msa;
+ c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_msa;
+
+ c->put_pixels_tab[2][1] = ff_put_pixels4_x2_msa;
+ c->put_pixels_tab[2][2] = ff_put_pixels4_y2_msa;
+ c->put_pixels_tab[2][3] = ff_put_pixels4_xy2_msa;
+
+ c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_msa;
+ c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_msa;
+ c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_msa;
+ c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_msa;
+
+ c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_msa;
+ c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_msa;
+ c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_msa;
+ c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_msa;
+
+ c->avg_pixels_tab[0][0] = ff_avg_pixels16_msa;
+ c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_msa;
+ c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_msa;
+ c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_msa;
+
+ c->avg_pixels_tab[1][0] = ff_avg_pixels8_msa;
+ c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_msa;
+ c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_msa;
+ c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_msa;
+
+ c->avg_pixels_tab[2][0] = ff_avg_pixels4_msa;
+ c->avg_pixels_tab[2][1] = ff_avg_pixels4_x2_msa;
+ c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_msa;
+ c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_msa;
+}
+#endif // #if HAVE_MSA
+
+void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags)
+{
+#if HAVE_MSA
+ ff_hpeldsp_init_msa(c, flags);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_mips.h
new file mode 100644
index 00000000000..f4ab53eb293
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_mips.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_HPELDSP_MIPS_H
+#define AVCODEC_MIPS_HPELDSP_MIPS_H
+
+#include "libavcodec/bit_depth_template.c"
+
+void ff_put_pixels16_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels16_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels8_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels4_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels4_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels4_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_pixels4_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels16_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_put_no_rnd_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels16_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels16_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels8_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels4_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels4_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels4_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+void ff_avg_pixels4_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int32_t h);
+
+#endif // #ifndef AVCODEC_MIPS_HPELDSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_msa.c
new file mode 100644
index 00000000000..40a0dca0fea
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/hpeldsp_msa.c
@@ -0,0 +1,1498 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "libavcodec/mips/hpeldsp_mips.h"
+
+#define PCKEV_AVG_ST_UB(in0, in1, dst, pdst) \
+{ \
+ v16u8 tmp_m; \
+ \
+ tmp_m = (v16u8) __msa_pckev_b((v16i8) in0, (v16i8) in1); \
+ tmp_m = __msa_aver_u_b(tmp_m, (v16u8) dst); \
+ ST_UB(tmp_m, (pdst)); \
+}
+
+#define PCKEV_ST_SB4(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
+{ \
+ v16i8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ uint8_t *pdst_m = (uint8_t *) (pdst); \
+ \
+ PCKEV_B4_SB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ ST_SB4(tmp0_m, tmp1_m, tmp2_m, tmp3_m, pdst_m, stride); \
+}
+
+#define PCKEV_AVG_ST8x4_UB(in1, dst0, in2, dst1, in3, dst2, in4, dst3, \
+ pdst, stride) \
+{ \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ uint8_t *pdst_m = (uint8_t *) (pdst); \
+ \
+ PCKEV_B2_UB(in2, in1, in4, in3, tmp0_m, tmp1_m); \
+ PCKEV_D2_UB(dst1, dst0, dst3, dst2, tmp2_m, tmp3_m); \
+ AVER_UB2_UB(tmp0_m, tmp2_m, tmp1_m, tmp3_m, tmp0_m, tmp1_m); \
+ ST8x4_UB(tmp0_m, tmp1_m, pdst_m, stride); \
+}
+
+static void common_hz_bil_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t out0, out1;
+ v16u8 src0, src1, src0_sld1, src1_sld1, res0, res1;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+
+ SLDI_B2_0_UB(src0, src1, src0_sld1, src1_sld1, 1);
+ AVER_UB2_UB(src0_sld1, src0, src1_sld1, src1, res0, res1);
+
+ out0 = __msa_copy_u_w((v4i32) res0, 0);
+ out1 = __msa_copy_u_w((v4i32) res1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_bil_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src0_sld1, src1_sld1, src2_sld1, src3_sld1;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ SLDI_B4_0_SB(src0, src1, src2, src3,
+ src0_sld1, src1_sld1, src2_sld1, src3_sld1, 1);
+ AVER_ST8x4_UB(src0, src0_sld1, src1, src1_sld1,
+ src2, src2_sld1, src3, src3_sld1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hz_bil_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+ src += (8 * src_stride);
+
+ AVER_ST16x4_UB(src0, src8, src1, src9, src2, src10, src3, src11,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ AVER_ST16x4_UB(src4, src12, src5, src13, src6, src14, src7, src15,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hz_bil_no_rnd_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16i8 src0_sld1, src1_sld1, src2_sld1, src3_sld1;
+ v16i8 src4_sld1, src5_sld1, src6_sld1, src7_sld1;
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ SLDI_B4_0_SB(src0, src1, src2, src3,
+ src0_sld1, src1_sld1, src2_sld1, src3_sld1, 1);
+ SLDI_B4_0_SB(src4, src5, src6, src7,
+ src4_sld1, src5_sld1, src6_sld1, src7_sld1, 1);
+
+ AVE_ST8x4_UB(src0, src0_sld1, src1, src1_sld1,
+ src2, src2_sld1, src3, src3_sld1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST8x4_UB(src4, src4_sld1, src5, src5_sld1,
+ src6, src6_sld1, src7, src7_sld1, dst, dst_stride);
+}
+
+static void common_hz_bil_no_rnd_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16i8 src0, src1, src2, src3, src0_sld1, src1_sld1, src2_sld1, src3_sld1;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ SLDI_B4_0_SB(src0, src1, src2, src3,
+ src0_sld1, src1_sld1, src2_sld1, src3_sld1, 1);
+ AVE_ST8x4_UB(src0, src0_sld1, src1, src1_sld1,
+ src2, src2_sld1, src3, src3_sld1, dst, dst_stride);
+}
+
+static void common_hz_bil_no_rnd_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 src9, src10, src11, src12, src13, src14, src15;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+ src += (8 * src_stride);
+
+ AVE_ST16x4_UB(src0, src8, src1, src9, src2, src10, src3, src11,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4((src + 1), src_stride, src8, src9, src10, src11);
+ src += (4 * src_stride);
+
+ AVE_ST16x4_UB(src4, src12, src5, src13, src6, src14, src7, src15,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src4, src5, src6, src7);
+ LD_UB4((src + 1), src_stride, src12, src13, src14, src15);
+ src += (4 * src_stride);
+
+ AVE_ST16x4_UB(src0, src8, src1, src9, src2, src10, src3, src11,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src4, src12, src5, src13, src6, src14, src7, src15,
+ dst, dst_stride);
+}
+
+static void common_hz_bil_no_rnd_8x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 src9, src10, src11, src12, src13, src14, src15;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+
+ AVE_ST16x4_UB(src0, src8, src1, src9, src2, src10, src3, src11,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src4, src12, src5, src13, src6, src14, src7, src15,
+ dst, dst_stride);
+}
+
+static void common_hz_bil_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t dst0, dst1, out0, out1;
+ v16u8 src0, src1, src0_sld1, src1_sld1, res0, res1;
+ v16u8 tmp0 = { 0 };
+ v16u8 tmp1 = { 0 };
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+
+ SLDI_B2_0_UB(src0, src1, src0_sld1, src1_sld1, 1);
+
+ dst0 = LW(dst);
+ dst1 = LW(dst + dst_stride);
+ tmp0 = (v16u8) __msa_insert_w((v4i32) tmp0, 0, dst0);
+ tmp1 = (v16u8) __msa_insert_w((v4i32) tmp1, 0, dst1);
+
+ AVER_UB2_UB(src0_sld1, src0, src1_sld1, src1, res0, res1);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+
+ out0 = __msa_copy_u_w((v4i32) res0, 0);
+ out1 = __msa_copy_u_w((v4i32) res1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_bil_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src0_sld1, src1_sld1, src2_sld1, src3_sld1;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ SLDI_B4_0_SB(src0, src1, src2, src3,
+ src0_sld1, src1_sld1, src2_sld1, src3_sld1, 1);
+
+ AVER_DST_ST8x4_UB(src0, src0_sld1, src1, src1_sld1, src2, src2_sld1,
+ src3, src3_sld1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hz_bil_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 src9, src10, src11, src12, src13, src14, src15;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+ src += (8 * src_stride);
+
+ AVER_DST_ST16x4_UB(src0, src8, src1, src9, src2, src10, src3, src11,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVER_DST_ST16x4_UB(src4, src12, src5, src13, src6, src14, src7, src15,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_vt_bil_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t out0, out1;
+ v16u8 src0, src1, src2, res0, res1;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src1, src2);
+ src += (2 * src_stride);
+
+ AVER_UB2_UB(src0, src1, src1, src2, res0, res1);
+
+ out0 = __msa_copy_u_w((v4i32) res0, 0);
+ out1 = __msa_copy_u_w((v4i32) res1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+
+ src0 = src2;
+ }
+}
+
+static void common_vt_bil_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ AVER_ST8x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src4;
+ }
+}
+
+static void common_vt_bil_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src1, src2, src3, src4, src5, src6, src7, src8);
+ src += (8 * src_stride);
+
+ AVER_ST16x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVER_ST16x4_UB(src4, src5, src5, src6, src6, src7, src7, src8,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src8;
+ }
+}
+
+static void common_vt_bil_no_rnd_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+
+ AVE_ST8x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ AVE_ST8x4_UB(src4, src5, src5, src6, src6, src7, src7, src8,
+ dst, dst_stride);
+}
+
+static void common_vt_bil_no_rnd_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4;
+
+ LD_UB5(src, src_stride, src0, src1, src2, src3, src4);
+ AVE_ST8x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+}
+
+static void common_vt_bil_no_rnd_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 src9, src10, src11, src12, src13, src14, src15, src16;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ LD_UB8(src, src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+ src += (8 * src_stride);
+ src16 = LD_UB(src);
+
+ AVE_ST16x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src4, src5, src5, src6, src6, src7, src7, src8,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src8, src9, src9, src10, src10, src11, src11, src12,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src12, src13, src13, src14,
+ src14, src15, src15, src16, dst, dst_stride);
+}
+
+static void common_vt_bil_no_rnd_8x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+
+ AVE_ST16x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ AVE_ST16x4_UB(src4, src5, src5, src6, src6, src7, src7, src8,
+ dst, dst_stride);
+}
+
+static void common_vt_bil_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t out0, out1, dst0, dst1;
+ v16u8 src0, src1, src2;
+ v16u8 tmp0 = { 0 };
+ v16u8 tmp1 = { 0 };
+ v16u8 res0, res1;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src1, src2);
+ src += (2 * src_stride);
+ dst0 = LW(dst);
+ dst1 = LW(dst + dst_stride);
+ tmp0 = (v16u8) __msa_insert_w((v4i32) tmp0, 0, dst0);
+ tmp1 = (v16u8) __msa_insert_w((v4i32) tmp1, 0, dst1);
+ AVER_UB2_UB(src0, src1, src1, src2, res0, res1);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ out0 = __msa_copy_u_w((v4i32) res0, 0);
+ out1 = __msa_copy_u_w((v4i32) res1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+ src0 = src2;
+ }
+}
+
+static void common_vt_bil_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ AVER_DST_ST8x4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ src0 = src4;
+ }
+}
+
+static void common_vt_bil_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 res0, res1, res2, res3, res4, res5, res6, res7;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src1, src2, src3, src4, src5, src6, src7, src8);
+ src += (8 * src_stride);
+ AVER_UB4_UB(src0, src1, src1, src2, src2, src3, src3, src4,
+ res0, res1, res2, res3);
+ AVER_UB4_UB(src4, src5, src5, src6, src6, src7, src7, src8,
+ res4, res5, res6, res7);
+
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ AVER_UB4_UB(dst0, res0, dst1, res1, dst2, res2, dst3, res3,
+ res0, res1, res2, res3);
+ AVER_UB4_UB(dst4, res4, dst5, res5, dst6, res6, dst7, res7,
+ res4, res5, res6, res7);
+ ST_UB8(res0, res1, res2, res3, res4, res5, res6, res7, dst, dst_stride);
+ dst += (8 * dst_stride);
+
+ src0 = src8;
+ }
+}
+
+static void common_hv_bil_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t res0, res1;
+ v16i8 src0, src1, src2, src0_sld1, src1_sld1, src2_sld1;
+ v16u8 src0_r, src1_r, src2_r, res;
+ v8u16 add0, add1, add2, sum0, sum1;
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_SB2(src, src_stride, src1, src2);
+ src += (2 * src_stride);
+
+ SLDI_B3_0_SB(src0, src1, src2, src0_sld1, src1_sld1, src2_sld1, 1);
+ ILVR_B3_UB(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2,
+ src0_r, src1_r, src2_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ ADD2(add0, add1, add1, add2, sum0, sum1);
+ SRARI_H2_UH(sum0, sum1, 2);
+ res = (v16u8) __msa_pckev_b((v16i8) sum1, (v16i8) sum0);
+ res0 = __msa_copy_u_w((v4i32) res, 0);
+ res1 = __msa_copy_u_w((v4i32) res, 2);
+ SW(res0, dst);
+ dst += dst_stride;
+ SW(res1, dst);
+ dst += dst_stride;
+
+ src0 = src2;
+ }
+}
+
+static void common_hv_bil_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4;
+ v16i8 src0_sld1, src1_sld1, src2_sld1, src3_sld1, src4_sld1;
+ v16u8 src0_r, src1_r, src2_r, src3_r, src4_r;
+ v8u16 add0, add1, add2, add3, add4;
+ v8u16 sum0, sum1, sum2, sum3;
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ SLDI_B3_0_SB(src0, src1, src2, src0_sld1, src1_sld1, src2_sld1, 1);
+ SLDI_B2_0_SB(src3, src4, src3_sld1, src4_sld1, 1);
+ ILVR_B3_UB(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2, src0_r,
+ src1_r, src2_r);
+ ILVR_B2_UB(src3_sld1, src3, src4_sld1, src4, src3_r, src4_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ HADD_UB2_UH(src3_r, src4_r, add3, add4);
+ ADD4(add0, add1, add1, add2, add2, add3, add3, add4,
+ sum0, sum1, sum2, sum3);
+ SRARI_H4_UH(sum0, sum1, sum2, sum3, 2);
+ PCKEV_B2_SB(sum1, sum0, sum3, sum2, src0, src1);
+ ST8x4_UB(src0, src1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ src0 = src4;
+ }
+}
+
+static void common_hv_bil_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
+ v16u8 src10, src11, src12, src13, src14, src15, src16, src17;
+ v8u16 src0_r, src1_r, src2_r, src3_r, src4_r, src5_r, src6_r, src7_r;
+ v8u16 src8_r, src0_l, src1_l, src2_l, src3_l, src4_l, src5_l, src6_l;
+ v8u16 src7_l, src8_l;
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r, sum4_r, sum5_r, sum6_r, sum7_r;
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l, sum4_l, sum5_l, sum6_l, sum7_l;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src9, src10, src11, src12, src13, src14, src15, src16);
+ src += (8 * src_stride);
+
+ src8 = LD_UB(src);
+ src17 = LD_UB(src + 1);
+
+ ILVRL_B2_UH(src9, src0, src0_r, src0_l);
+ ILVRL_B2_UH(src10, src1, src1_r, src1_l);
+ ILVRL_B2_UH(src11, src2, src2_r, src2_l);
+ ILVRL_B2_UH(src12, src3, src3_r, src3_l);
+ ILVRL_B2_UH(src13, src4, src4_r, src4_l);
+ ILVRL_B2_UH(src14, src5, src5_r, src5_l);
+ ILVRL_B2_UH(src15, src6, src6_r, src6_l);
+ ILVRL_B2_UH(src16, src7, src7_r, src7_l);
+ ILVRL_B2_UH(src17, src8, src8_r, src8_l);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, src0_r, src1_r, src2_r);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, src3_r, src4_r, src5_r);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, src6_r, src7_r, src8_r);
+ HADD_UB3_UH(src0_l, src1_l, src2_l, src0_l, src1_l, src2_l);
+ HADD_UB3_UH(src3_l, src4_l, src5_l, src3_l, src4_l, src5_l);
+ HADD_UB3_UH(src6_l, src7_l, src8_l, src6_l, src7_l, src8_l);
+ ADD4(src0_r, src1_r, src1_r, src2_r, src2_r, src3_r, src3_r, src4_r,
+ sum0_r, sum1_r, sum2_r, sum3_r);
+ ADD4(src4_r, src5_r, src5_r, src6_r, src6_r, src7_r, src7_r, src8_r,
+ sum4_r, sum5_r, sum6_r, sum7_r);
+ ADD4(src0_l, src1_l, src1_l, src2_l, src2_l, src3_l, src3_l, src4_l,
+ sum0_l, sum1_l, sum2_l, sum3_l);
+ ADD4(src4_l, src5_l, src5_l, src6_l, src6_l, src7_l, src7_l, src8_l,
+ sum4_l, sum5_l, sum6_l, sum7_l);
+ SRARI_H4_UH(sum0_r, sum1_r, sum2_r, sum3_r, 2);
+ SRARI_H4_UH(sum4_r, sum5_r, sum6_r, sum7_r, 2);
+ SRARI_H4_UH(sum0_l, sum1_l, sum2_l, sum3_l, 2);
+ SRARI_H4_UH(sum4_l, sum5_l, sum6_l, sum7_l, 2);
+ PCKEV_ST_SB4(sum0_l, sum0_r, sum1_l, sum1_r, sum2_l, sum2_r,
+ sum3_l, sum3_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+ PCKEV_ST_SB4(sum4_l, sum4_r, sum5_l, sum5_r, sum6_l, sum6_r,
+ sum7_l, sum7_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hv_bil_no_rnd_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 src0_sld1, src1_sld1, src2_sld1, src3_sld1;
+ v16u8 src4_sld1, src5_sld1, src6_sld1, src7_sld1, src8_sld1;
+ v8u16 src0_r, src1_r, src2_r, src3_r;
+ v8u16 src4_r, src5_r, src6_r, src7_r, src8_r;
+ v8u16 add0, add1, add2, add3, add4, add5, add6, add7, add8;
+ v8u16 sum0, sum1, sum2, sum3, sum4, sum5, sum6, sum7;
+ v16i8 out0, out1;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+
+ SLDI_B4_0_UB(src0, src1, src2, src3, src0_sld1, src1_sld1, src2_sld1,
+ src3_sld1, 1);
+ SLDI_B3_0_UB(src4, src5, src6, src4_sld1, src5_sld1, src6_sld1, 1);
+ SLDI_B2_0_UB(src7, src8, src7_sld1, src8_sld1, 1);
+ ILVR_B4_UH(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2, src3_sld1,
+ src3, src0_r, src1_r, src2_r, src3_r);
+ ILVR_B3_UH(src4_sld1, src4, src5_sld1, src5, src6_sld1, src6, src4_r,
+ src5_r, src6_r);
+ ILVR_B2_UH(src7_sld1, src7, src8_sld1, src8, src7_r, src8_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, add3, add4, add5);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, add6, add7, add8);
+
+ sum0 = add0 + add1 + 1;
+ sum1 = add1 + add2 + 1;
+ sum2 = add2 + add3 + 1;
+ sum3 = add3 + add4 + 1;
+ sum4 = add4 + add5 + 1;
+ sum5 = add5 + add6 + 1;
+ sum6 = add6 + add7 + 1;
+ sum7 = add7 + add8 + 1;
+
+ SRA_4V(sum0, sum1, sum2, sum3, 2);
+ SRA_4V(sum4, sum5, sum6, sum7, 2);
+ PCKEV_B2_SB(sum1, sum0, sum3, sum2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ PCKEV_B2_SB(sum5, sum4, sum7, sum6, out0, out1);
+ ST8x4_UB(out0, out1, dst + 4 * dst_stride, dst_stride);
+}
+
+static void common_hv_bil_no_rnd_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16i8 src0, src1, src2, src3, src4;
+ v16i8 src0_sld1, src1_sld1, src2_sld1, src3_sld1, src4_sld1;
+ v8u16 src0_r, src1_r, src2_r, src3_r, src4_r;
+ v8u16 add0, add1, add2, add3, add4;
+ v8u16 sum0, sum1, sum2, sum3;
+ v16i8 out0, out1;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ src4 = LD_SB(src);
+
+ SLDI_B3_0_SB(src0, src1, src2, src0_sld1, src1_sld1, src2_sld1, 1);
+ SLDI_B2_0_SB(src3, src4, src3_sld1, src4_sld1, 1);
+ ILVR_B3_UH(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2, src0_r,
+ src1_r, src2_r);
+ ILVR_B2_UH(src3_sld1, src3, src4_sld1, src4, src3_r, src4_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ HADD_UB2_UH(src3_r, src4_r, add3, add4);
+
+ sum0 = add0 + add1 + 1;
+ sum1 = add1 + add2 + 1;
+ sum2 = add2 + add3 + 1;
+ sum3 = add3 + add4 + 1;
+
+ SRA_4V(sum0, sum1, sum2, sum3, 2);
+ PCKEV_B2_SB(sum1, sum0, sum3, sum2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+}
+
+static void common_hv_bil_no_rnd_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
+ v16u8 src10, src11, src12, src13, src14, src15, src16, src17;
+ v8u16 src0_r, src1_r, src2_r, src3_r, src4_r, src5_r, src6_r, src7_r;
+ v8u16 src8_r, src0_l, src1_l, src2_l, src3_l, src4_l, src5_l, src6_l;
+ v8u16 src7_l, src8_l;
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r, sum4_r, sum5_r, sum6_r, sum7_r;
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l, sum4_l, sum5_l, sum6_l, sum7_l;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src9, src10, src11, src12, src13, src14, src15, src16);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+ src17 = LD_UB(src + 1);
+
+ ILVRL_B2_UH(src9, src0, src0_r, src0_l);
+ ILVRL_B2_UH(src10, src1, src1_r, src1_l);
+ ILVRL_B2_UH(src11, src2, src2_r, src2_l);
+ ILVRL_B2_UH(src12, src3, src3_r, src3_l);
+ ILVRL_B2_UH(src13, src4, src4_r, src4_l);
+ ILVRL_B2_UH(src14, src5, src5_r, src5_l);
+ ILVRL_B2_UH(src15, src6, src6_r, src6_l);
+ ILVRL_B2_UH(src16, src7, src7_r, src7_l);
+ ILVRL_B2_UH(src17, src8, src8_r, src8_l);
+
+ HADD_UB3_UH(src0_r, src1_r, src2_r, src0_r, src1_r, src2_r);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, src3_r, src4_r, src5_r);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, src6_r, src7_r, src8_r);
+ HADD_UB3_UH(src0_l, src1_l, src2_l, src0_l, src1_l, src2_l);
+ HADD_UB3_UH(src3_l, src4_l, src5_l, src3_l, src4_l, src5_l);
+ HADD_UB3_UH(src6_l, src7_l, src8_l, src6_l, src7_l, src8_l);
+
+ sum0_r = src0_r + src1_r + 1;
+ sum1_r = src1_r + src2_r + 1;
+ sum2_r = src2_r + src3_r + 1;
+ sum3_r = src3_r + src4_r + 1;
+ sum4_r = src4_r + src5_r + 1;
+ sum5_r = src5_r + src6_r + 1;
+ sum6_r = src6_r + src7_r + 1;
+ sum7_r = src7_r + src8_r + 1;
+ sum0_l = src0_l + src1_l + 1;
+ sum1_l = src1_l + src2_l + 1;
+ sum2_l = src2_l + src3_l + 1;
+ sum3_l = src3_l + src4_l + 1;
+ sum4_l = src4_l + src5_l + 1;
+ sum5_l = src5_l + src6_l + 1;
+ sum6_l = src6_l + src7_l + 1;
+ sum7_l = src7_l + src8_l + 1;
+
+ SRA_4V(sum0_r, sum1_r, sum2_r, sum3_r, 2);
+ SRA_4V(sum4_r, sum5_r, sum6_r, sum7_r, 2);
+ SRA_4V(sum0_l, sum1_l, sum2_l, sum3_l, 2);
+ SRA_4V(sum4_l, sum5_l, sum6_l, sum7_l, 2);
+ PCKEV_ST_SB4(sum0_l, sum0_r, sum1_l, sum1_r,
+ sum2_l, sum2_r, sum3_l, sum3_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src9, src10, src11, src12, src13, src14, src15, src16);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+ src17 = LD_UB(src + 1);
+
+ PCKEV_ST_SB4(sum4_l, sum4_r, sum5_l, sum5_r,
+ sum6_l, sum6_r, sum7_l, sum7_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ ILVRL_B2_UH(src9, src0, src0_r, src0_l);
+ ILVRL_B2_UH(src10, src1, src1_r, src1_l);
+ ILVRL_B2_UH(src11, src2, src2_r, src2_l);
+ ILVRL_B2_UH(src12, src3, src3_r, src3_l);
+ ILVRL_B2_UH(src13, src4, src4_r, src4_l);
+ ILVRL_B2_UH(src14, src5, src5_r, src5_l);
+ ILVRL_B2_UH(src15, src6, src6_r, src6_l);
+ ILVRL_B2_UH(src16, src7, src7_r, src7_l);
+ ILVRL_B2_UH(src17, src8, src8_r, src8_l);
+
+ HADD_UB3_UH(src0_r, src1_r, src2_r, src0_r, src1_r, src2_r);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, src3_r, src4_r, src5_r);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, src6_r, src7_r, src8_r);
+ HADD_UB3_UH(src0_l, src1_l, src2_l, src0_l, src1_l, src2_l);
+ HADD_UB3_UH(src3_l, src4_l, src5_l, src3_l, src4_l, src5_l);
+ HADD_UB3_UH(src6_l, src7_l, src8_l, src6_l, src7_l, src8_l);
+
+ sum0_r = src0_r + src1_r + 1;
+ sum1_r = src1_r + src2_r + 1;
+ sum2_r = src2_r + src3_r + 1;
+ sum3_r = src3_r + src4_r + 1;
+ sum4_r = src4_r + src5_r + 1;
+ sum5_r = src5_r + src6_r + 1;
+ sum6_r = src6_r + src7_r + 1;
+ sum7_r = src7_r + src8_r + 1;
+ sum0_l = src0_l + src1_l + 1;
+ sum1_l = src1_l + src2_l + 1;
+ sum2_l = src2_l + src3_l + 1;
+ sum3_l = src3_l + src4_l + 1;
+ sum4_l = src4_l + src5_l + 1;
+ sum5_l = src5_l + src6_l + 1;
+ sum6_l = src6_l + src7_l + 1;
+ sum7_l = src7_l + src8_l + 1;
+
+ SRA_4V(sum0_r, sum1_r, sum2_r, sum3_r, 2);
+ SRA_4V(sum4_r, sum5_r, sum6_r, sum7_r, 2);
+ SRA_4V(sum0_l, sum1_l, sum2_l, sum3_l, 2);
+ SRA_4V(sum4_l, sum5_l, sum6_l, sum7_l, 2);
+ PCKEV_ST_SB4(sum0_l, sum0_r, sum1_l, sum1_r,
+ sum2_l, sum2_r, sum3_l, sum3_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+ PCKEV_ST_SB4(sum4_l, sum4_r, sum5_l, sum5_r,
+ sum6_l, sum6_r, sum7_l, sum7_r, dst, dst_stride);
+}
+
+static void common_hv_bil_no_rnd_8x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
+ v16u8 src10, src11, src12, src13, src14, src15, src16, src17;
+ v8u16 src0_r, src1_r, src2_r, src3_r, src4_r, src5_r, src6_r, src7_r;
+ v8u16 src8_r, src0_l, src1_l, src2_l, src3_l, src4_l, src5_l, src6_l;
+ v8u16 src7_l, src8_l;
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r, sum4_r, sum5_r, sum6_r, sum7_r;
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l, sum4_l, sum5_l, sum6_l, sum7_l;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src9, src10, src11, src12, src13, src14, src15, src16);
+ src += (8 * src_stride);
+ src8 = LD_UB(src);
+ src17 = LD_UB(src + 1);
+
+ ILVRL_B2_UH(src9, src0, src0_r, src0_l);
+ ILVRL_B2_UH(src10, src1, src1_r, src1_l);
+ ILVRL_B2_UH(src11, src2, src2_r, src2_l);
+ ILVRL_B2_UH(src12, src3, src3_r, src3_l);
+ ILVRL_B2_UH(src13, src4, src4_r, src4_l);
+ ILVRL_B2_UH(src14, src5, src5_r, src5_l);
+ ILVRL_B2_UH(src15, src6, src6_r, src6_l);
+ ILVRL_B2_UH(src16, src7, src7_r, src7_l);
+ ILVRL_B2_UH(src17, src8, src8_r, src8_l);
+
+ HADD_UB3_UH(src0_r, src1_r, src2_r, src0_r, src1_r, src2_r);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, src3_r, src4_r, src5_r);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, src6_r, src7_r, src8_r);
+ HADD_UB3_UH(src0_l, src1_l, src2_l, src0_l, src1_l, src2_l);
+ HADD_UB3_UH(src3_l, src4_l, src5_l, src3_l, src4_l, src5_l);
+ HADD_UB3_UH(src6_l, src7_l, src8_l, src6_l, src7_l, src8_l);
+
+ sum0_r = src0_r + src1_r + 1;
+ sum1_r = src1_r + src2_r + 1;
+ sum2_r = src2_r + src3_r + 1;
+ sum3_r = src3_r + src4_r + 1;
+ sum4_r = src4_r + src5_r + 1;
+ sum5_r = src5_r + src6_r + 1;
+ sum6_r = src6_r + src7_r + 1;
+ sum7_r = src7_r + src8_r + 1;
+ sum0_l = src0_l + src1_l + 1;
+ sum1_l = src1_l + src2_l + 1;
+ sum2_l = src2_l + src3_l + 1;
+ sum3_l = src3_l + src4_l + 1;
+ sum4_l = src4_l + src5_l + 1;
+ sum5_l = src5_l + src6_l + 1;
+ sum6_l = src6_l + src7_l + 1;
+ sum7_l = src7_l + src8_l + 1;
+
+ SRA_4V(sum0_r, sum1_r, sum2_r, sum3_r, 2);
+ SRA_4V(sum4_r, sum5_r, sum6_r, sum7_r, 2);
+ SRA_4V(sum0_l, sum1_l, sum2_l, sum3_l, 2);
+ SRA_4V(sum4_l, sum5_l, sum6_l, sum7_l, 2);
+ PCKEV_ST_SB4(sum0_l, sum0_r, sum1_l, sum1_r,
+ sum2_l, sum2_r, sum3_l, sum3_r, dst, dst_stride);
+ dst += (4 * dst_stride);
+ PCKEV_ST_SB4(sum4_l, sum4_r, sum5_l, sum5_r,
+ sum6_l, sum6_r, sum7_l, sum7_r, dst, dst_stride);
+}
+
+static void common_hv_bil_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ uint32_t out0, out1;
+ v16i8 src0, src1, src2, src0_sld1, src1_sld1, src2_sld1;
+ v16u8 src0_r, src1_r, src2_r;
+ v8u16 add0, add1, add2, sum0, sum1;
+ v16u8 dst0, dst1, res0, res1;
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_SB2(src, src_stride, src1, src2);
+ src += (2 * src_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ SLDI_B3_0_SB(src0, src1, src2, src0_sld1, src1_sld1, src2_sld1, 1);
+ ILVR_B3_UB(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2, src0_r,
+ src1_r, src2_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ ADD2(add0, add1, add1, add2, sum0, sum1);
+ SRARI_H2_UH(sum0, sum1, 2);
+ PCKEV_B2_UB(sum0, sum0, sum1, sum1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+
+ out0 = __msa_copy_u_w((v4i32) res0, 0);
+ out1 = __msa_copy_u_w((v4i32) res1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+
+ src0 = src2;
+ }
+}
+
+static void common_hv_bil_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4;
+ v16i8 src0_sld1, src1_sld1, src2_sld1, src3_sld1, src4_sld1;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 src0_r, src1_r, src2_r, src3_r, src4_r;
+ v8u16 add0, add1, add2, add3, add4;
+ v8u16 sum0, sum1, sum2, sum3;
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ SLDI_B3_0_SB(src0, src1, src2, src0_sld1, src1_sld1, src2_sld1, 1);
+ SLDI_B2_0_SB(src3, src4, src3_sld1, src4_sld1, 1);
+ ILVR_B3_UB(src0_sld1, src0, src1_sld1, src1, src2_sld1, src2, src0_r,
+ src1_r, src2_r);
+ ILVR_B2_UB(src3_sld1, src3, src4_sld1, src4, src3_r, src4_r);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ HADD_UB2_UH(src3_r, src4_r, add3, add4);
+ ADD4(add0, add1, add1, add2, add2, add3, add3, add4,
+ sum0, sum1, sum2, sum3);
+ SRARI_H4_UH(sum0, sum1, sum2, sum3, 2);
+ PCKEV_AVG_ST8x4_UB(sum0, dst0, sum1, dst1,
+ sum2, dst2, sum3, dst3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ src0 = src4;
+ }
+}
+
+static void common_hv_bil_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ uint8_t height)
+{
+ uint8_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16u8 src11, src12, src13, src14, src15, src16, src17;
+ v16u8 src0_r, src1_r, src2_r, src3_r, src4_r, src5_r, src6_r, src7_r;
+ v16u8 src8_r, src0_l, src1_l, src2_l, src3_l, src4_l, src5_l, src6_l;
+ v16u8 src7_l, src8_l;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r, sum4_r, sum5_r, sum6_r, sum7_r;
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l, sum4_l, sum5_l, sum6_l, sum7_l;
+ v8u16 add0, add1, add2, add3, add4, add5, add6, add7, add8;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8((src + 1), src_stride,
+ src9, src10, src11, src12, src13, src14, src15, src16);
+ src += (8 * src_stride);
+
+ src8 = LD_UB(src);
+ src17 = LD_UB(src + 1);
+
+ ILVRL_B2_UB(src9, src0, src0_r, src0_l);
+ ILVRL_B2_UB(src10, src1, src1_r, src1_l);
+ ILVRL_B2_UB(src11, src2, src2_r, src2_l);
+ ILVRL_B2_UB(src12, src3, src3_r, src3_l);
+ ILVRL_B2_UB(src13, src4, src4_r, src4_l);
+ ILVRL_B2_UB(src14, src5, src5_r, src5_l);
+ ILVRL_B2_UB(src15, src6, src6_r, src6_l);
+ ILVRL_B2_UB(src16, src7, src7_r, src7_l);
+ ILVRL_B2_UB(src17, src8, src8_r, src8_l);
+ HADD_UB3_UH(src0_r, src1_r, src2_r, add0, add1, add2);
+ HADD_UB3_UH(src3_r, src4_r, src5_r, add3, add4, add5);
+ HADD_UB3_UH(src6_r, src7_r, src8_r, add6, add7, add8);
+ ADD4(add0, add1, add1, add2, add2, add3, add3, add4, sum0_r, sum1_r,
+ sum2_r, sum3_r);
+ ADD4(add4, add5, add5, add6, add6, add7, add7, add8, sum4_r, sum5_r,
+ sum6_r, sum7_r);
+ HADD_UB3_UH(src0_l, src1_l, src2_l, add0, add1, add2);
+ HADD_UB3_UH(src3_l, src4_l, src5_l, add3, add4, add5);
+ HADD_UB3_UH(src6_l, src7_l, src8_l, add6, add7, add8);
+ ADD4(add0, add1, add1, add2, add2, add3, add3, add4, sum0_l, sum1_l,
+ sum2_l, sum3_l);
+ ADD4(add4, add5, add5, add6, add6, add7, add7, add8, sum4_l, sum5_l,
+ sum6_l, sum7_l);
+ SRARI_H4_UH(sum0_r, sum1_r, sum2_r, sum3_r, 2);
+ SRARI_H4_UH(sum4_r, sum5_r, sum6_r, sum7_r, 2);
+ SRARI_H4_UH(sum0_l, sum1_l, sum2_l, sum3_l, 2);
+ SRARI_H4_UH(sum4_l, sum5_l, sum6_l, sum7_l, 2);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ PCKEV_AVG_ST_UB(sum0_l, sum0_r, dst0, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum1_l, sum1_r, dst1, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum2_l, sum2_r, dst2, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum3_l, sum3_r, dst3, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum4_l, sum4_r, dst4, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum5_l, sum5_r, dst5, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum6_l, sum6_r, dst6, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(sum7_l, sum7_r, dst7, dst);
+ dst += dst_stride;
+ }
+}
+
+static void copy_width8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3, out4, out5, out6, out7;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+ out4 = __msa_copy_u_d((v2i64) src4, 0);
+ out5 = __msa_copy_u_d((v2i64) src5, 0);
+ out6 = __msa_copy_u_d((v2i64) src6, 0);
+ out7 = __msa_copy_u_d((v2i64) src7, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(out4, out5, out6, out7, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ for (cnt = height >> 3; cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+ out4 = __msa_copy_u_d((v2i64) src4, 0);
+ out5 = __msa_copy_u_d((v2i64) src5, 0);
+ out6 = __msa_copy_u_d((v2i64) src6, 0);
+ out7 = __msa_copy_u_d((v2i64) src7, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(out4, out5, out6, out7, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 4) {
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 2) {
+ for (cnt = (height / 2); cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+
+ SD(out0, dst);
+ dst += dst_stride;
+ SD(out1, dst);
+ dst += dst_stride;
+ }
+ }
+}
+
+static void copy_16multx8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height, int32_t width)
+{
+ int32_t cnt, loop_cnt;
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src_tmp, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src_tmp += (8 * src_stride);
+
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst_tmp, dst_stride);
+ dst_tmp += (8 * dst_stride);
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void copy_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst, dst_stride);
+ dst += (8 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 16);
+ } else if (0 == height % 4) {
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
+
+static void avg_width4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint32_t out0, out1, out2, out3;
+ v16u8 src0, src1, src2, src3;
+ v16u8 dst0, dst1, dst2, dst3;
+
+ if (0 == (height % 4)) {
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+
+ out0 = __msa_copy_u_w((v4i32) dst0, 0);
+ out1 = __msa_copy_u_w((v4i32) dst1, 0);
+ out2 = __msa_copy_u_w((v4i32) dst2, 0);
+ out3 = __msa_copy_u_w((v4i32) dst3, 0);
+ SW4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == (height % 2)) {
+ for (cnt = (height / 2); cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+
+ AVER_UB2_UB(src0, dst0, src1, dst1, dst0, dst1);
+
+ out0 = __msa_copy_u_w((v4i32) dst0, 0);
+ out1 = __msa_copy_u_w((v4i32) dst1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+ }
+ }
+}
+
+static void avg_width8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3;
+ v16u8 src0, src1, src2, src3;
+ v16u8 dst0, dst1, dst2, dst3;
+
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+
+ out0 = __msa_copy_u_d((v2i64) dst0, 0);
+ out1 = __msa_copy_u_d((v2i64) dst1, 0);
+ out2 = __msa_copy_u_d((v2i64) dst2, 0);
+ out3 = __msa_copy_u_d((v2i64) dst3, 0);
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void avg_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+
+ for (cnt = (height / 8); cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+ AVER_UB4_UB(src4, dst4, src5, dst5, src6, dst6, src7, dst7,
+ dst4, dst5, dst6, dst7);
+ ST_UB8(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst, dst_stride);
+ dst += (8 * dst_stride);
+ }
+}
+
+void ff_put_pixels16_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ copy_width16_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels16_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels8_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ copy_width8_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels4_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_4w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels4_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_4w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_pixels4_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_4w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_put_no_rnd_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 16) {
+ common_hz_bil_no_rnd_16x16_msa(pixels, line_size, block, line_size);
+ } else if (h == 8) {
+ common_hz_bil_no_rnd_8x16_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_put_no_rnd_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 16) {
+ common_vt_bil_no_rnd_16x16_msa(pixels, line_size, block, line_size);
+ } else if (h == 8) {
+ common_vt_bil_no_rnd_8x16_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_put_no_rnd_pixels16_xy2_msa(uint8_t *block,
+ const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 16) {
+ common_hv_bil_no_rnd_16x16_msa(pixels, line_size, block, line_size);
+ } else if (h == 8) {
+ common_hv_bil_no_rnd_8x16_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_put_no_rnd_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 8) {
+ common_hz_bil_no_rnd_8x8_msa(pixels, line_size, block, line_size);
+ } else if (h == 4) {
+ common_hz_bil_no_rnd_4x8_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_put_no_rnd_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 8) {
+ common_vt_bil_no_rnd_8x8_msa(pixels, line_size, block, line_size);
+ } else if (h == 4) {
+ common_vt_bil_no_rnd_4x8_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_put_no_rnd_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ if (h == 8) {
+ common_hv_bil_no_rnd_8x8_msa(pixels, line_size, block, line_size);
+ } else if (h == 4) {
+ common_hv_bil_no_rnd_4x8_msa(pixels, line_size, block, line_size);
+ }
+}
+
+void ff_avg_pixels16_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ avg_width16_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels16_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_and_aver_dst_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels16_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_and_aver_dst_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels16_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_and_aver_dst_16w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels8_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ avg_width8_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels8_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_and_aver_dst_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels8_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_and_aver_dst_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels8_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_and_aver_dst_8w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels4_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ avg_width4_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels4_x2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hz_bil_and_aver_dst_4w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels4_y2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_vt_bil_and_aver_dst_4w_msa(pixels, line_size, block, line_size, h);
+}
+
+void ff_avg_pixels4_xy2_msa(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ common_hv_bil_and_aver_dst_4w_msa(pixels, line_size, block, line_size, h);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_init_mips.c
new file mode 100644
index 00000000000..8c26bca5384
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_init_mips.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "idctdsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void idctdsp_init_msa(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
+ (avctx->bits_per_raw_sample != 10) &&
+ (avctx->bits_per_raw_sample != 12) &&
+ (avctx->idct_algo == FF_IDCT_AUTO)) {
+ c->idct_put = ff_simple_idct_put_msa;
+ c->idct_add = ff_simple_idct_add_msa;
+ c->idct = ff_simple_idct_msa;
+ c->perm_type = FF_IDCT_PERM_NONE;
+ }
+
+ c->put_pixels_clamped = ff_put_pixels_clamped_msa;
+ c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_msa;
+ c->add_pixels_clamped = ff_add_pixels_clamped_msa;
+}
+#endif // #if HAVE_MSA
+
+#if HAVE_MMI
+static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
+ (avctx->bits_per_raw_sample != 10) &&
+ (avctx->bits_per_raw_sample != 12) &&
+ (avctx->idct_algo == FF_IDCT_AUTO)) {
+ c->idct = ff_simple_idct_mmi;
+ c->perm_type = FF_IDCT_PERM_NONE;
+ }
+
+ c->put_pixels_clamped = ff_put_pixels_clamped_mmi;
+ c->add_pixels_clamped = ff_add_pixels_clamped_mmi;
+ c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmi;
+}
+#endif /* HAVE_MMI */
+
+av_cold void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+#if HAVE_MSA
+ idctdsp_init_msa(c, avctx, high_bit_depth);
+#endif // #if HAVE_MSA
+#if HAVE_MMI
+ idctdsp_init_mmi(c, avctx, high_bit_depth);
+#endif /* HAVE_MMI */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mips.h
new file mode 100644
index 00000000000..19267e67059
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mips.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_IDCTDSP_MIPS_H
+#define AVCODEC_MIPS_IDCTDSP_MIPS_H
+
+#include "../mpegvideo.h"
+
+void ff_put_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size);
+void ff_put_signed_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size);
+void ff_add_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size);
+void ff_j_rev_dct_msa(int16_t *data);
+void ff_jref_idct_put_msa(uint8_t *dest, int32_t stride, int16_t *block);
+void ff_jref_idct_add_msa(uint8_t *dest, int32_t stride, int16_t *block);
+void ff_simple_idct_msa(int16_t *block);
+void ff_simple_idct_put_msa(uint8_t *dest, int32_t stride_dst, int16_t *block);
+void ff_simple_idct_add_msa(uint8_t *dest, int32_t stride_dst, int16_t *block);
+
+void ff_put_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size);
+void ff_put_signed_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size);
+void ff_add_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size);
+void ff_simple_idct_mmi(int16_t *block);
+void ff_simple_idct_put_mmi(uint8_t *dest, int32_t line_size, int16_t *block);
+void ff_simple_idct_add_mmi(uint8_t *dest, int32_t line_size, int16_t *block);
+
+#endif // #ifndef AVCODEC_MIPS_IDCTDSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mmi.c
new file mode 100644
index 00000000000..25476f3c405
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_mmi.c
@@ -0,0 +1,190 @@
+/*
+ * Loongson SIMD optimized idctdsp
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "idctdsp_mips.h"
+#include "constants.h"
+
+void ff_put_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size)
+{
+ const int16_t *p;
+ uint8_t *pix;
+
+ p = block;
+ pix = pixels;
+
+ __asm__ volatile (
+ "ldc1 $f0, 0+%3 \r\n"
+ "ldc1 $f2, 8+%3 \r\n"
+ "ldc1 $f4, 16+%3 \r\n"
+ "ldc1 $f6, 24+%3 \r\n"
+ "ldc1 $f8, 32+%3 \r\n"
+ "ldc1 $f10, 40+%3 \r\n"
+ "ldc1 $f12, 48+%3 \r\n"
+ "ldc1 $f14, 56+%3 \r\n"
+ "dadd $10, %0, %1 \r\n"
+ "packushb $f0, $f0, $f2 \r\n"
+ "packushb $f4, $f4, $f6 \r\n"
+ "packushb $f8, $f8, $f10 \r\n"
+ "packushb $f12, $f12, $f14 \r\n"
+ "sdc1 $f0, 0(%0) \r\n"
+ "sdc1 $f4, 0($10) \r\n"
+ "gssdxc1 $f8, 0($10, %1) \r\n"
+ "gssdxc1 $f12, 0(%0, %2) \r\n"
+ ::"r"(pix),"r"((int)line_size),
+ "r"((int)line_size*3),"m"(*p)
+ : "$10","memory"
+ );
+
+ pix += line_size*4;
+ p += 32;
+
+ __asm__ volatile (
+ "ldc1 $f0, 0+%3 \r\n"
+ "ldc1 $f2, 8+%3 \r\n"
+ "ldc1 $f4, 16+%3 \r\n"
+ "ldc1 $f6, 24+%3 \r\n"
+ "ldc1 $f8, 32+%3 \r\n"
+ "ldc1 $f10, 40+%3 \r\n"
+ "ldc1 $f12, 48+%3 \r\n"
+ "ldc1 $f14, 56+%3 \r\n"
+ "dadd $10, %0, %1 \r\n"
+ "packushb $f0, $f0, $f2 \r\n"
+ "packushb $f4, $f4, $f6 \r\n"
+ "packushb $f8, $f8, $f10 \r\n"
+ "packushb $f12, $f12, $f14 \r\n"
+ "sdc1 $f0, 0(%0) \r\n"
+ "sdc1 $f4, 0($10) \r\n"
+ "gssdxc1 $f8, 0($10, %1) \r\n"
+ "gssdxc1 $f12, 0(%0, %2) \r\n"
+ ::"r"(pix),"r"((int)line_size),
+ "r"((int)line_size*3),"m"(*p)
+ : "$10","memory"
+ );
+}
+
+void ff_put_signed_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size)
+{
+ int64_t line_skip = line_size;
+ int64_t line_skip3;
+
+ __asm__ volatile (
+ "dmtc1 %4, $f0 \n\t"
+ "daddu %1, %3, %3 \n\t"
+ "ldc1 $f2, 0(%2) \n\t"
+ "ldc1 $f10, 8(%2) \n\t"
+ "packsshb $f2, $f2, $f10 \n\t"
+ "ldc1 $f4, 16(%2) \n\t"
+ "ldc1 $f10, 24(%2) \n\t"
+ "packsshb $f4, $f4, $f10 \n\t"
+ "ldc1 $f6, 32(%2) \n\t"
+ "ldc1 $f10, 40(%2) \n\t"
+ "packsshb $f6, $f6, $f10 \n\t"
+ "ldc1 $f8, 48(%2) \n\t"
+ "ldc1 $f10, 56(%2) \n\t"
+ "packsshb $f8, $f8, $f10 \n\t"
+ "paddb $f2, $f2, $f0 \n\t"
+ "paddb $f4, $f4, $f0 \n\t"
+ "paddb $f6, $f6, $f0 \n\t"
+ "paddb $f8, $f8, $f0 \n\t"
+ "sdc1 $f2, 0(%0) \n\t"
+ "gssdxc1 $f4, 0(%0, %3) \n\t"
+ "gssdxc1 $f6, 0(%0, %1) \n\t"
+ "daddu %1, %1, %3 \n\t"
+ "gssdxc1 $f8, 0(%0, %1) \n\t"
+ "daddu $10, %1, %3 \n\t"
+ "daddu %0, %0, $10 \n\t"
+ "ldc1 $f2, 64(%2) \n\t"
+ "ldc1 $f10, 8+64(%2) \n\t"
+ "packsshb $f2, $f2, $f10 \n\t"
+ "ldc1 $f4, 16+64(%2) \n\t"
+ "ldc1 $f10, 24+64(%2) \n\t"
+ "packsshb $f4, $f4, $f10 \n\t"
+ "ldc1 $f6, 32+64(%2) \n\t"
+ "ldc1 $f10, 40+64(%2) \n\t"
+ "packsshb $f6, $f6, $f10 \n\t"
+ "ldc1 $f8, 48+64(%2) \n\t"
+ "ldc1 $f10, 56+64(%2) \n\t"
+ "packsshb $f8, $f8, $f10 \n\t"
+ "paddb $f2, $f2, $f0 \n\t"
+ "paddb $f4, $f4, $f0 \n\t"
+ "paddb $f6, $f6, $f0 \n\t"
+ "paddb $f8, $f8, $f0 \n\t"
+ "sdc1 $f2, 0(%0) \n\t"
+ "gssdxc1 $f4, 0(%0, %3) \n\t"
+ "daddu $10, %3, %3 \n\t"
+ "gssdxc1 $f6, 0(%0, $10) \n\t"
+ "gssdxc1 $f8, 0(%0, %1) \n\t"
+ : "+&r"(pixels),"=&r"(line_skip3)
+ : "r"(block),"r"(line_skip),"r"(ff_pb_80)
+ : "$10","memory"
+ );
+}
+
+void ff_add_pixels_clamped_mmi(const int16_t *block,
+ uint8_t *av_restrict pixels, ptrdiff_t line_size)
+{
+ const int16_t *p;
+ uint8_t *pix;
+ int i = 4;
+
+ p = block;
+ pix = pixels;
+
+ __asm__ volatile (
+ "xor $f14, $f14, $f14 \r\n"
+ ::
+ );
+
+ do {
+ __asm__ volatile (
+ "ldc1 $f0, 0+%2 \r\n"
+ "ldc1 $f2, 8+%2 \r\n"
+ "ldc1 $f4, 16+%2 \r\n"
+ "ldc1 $f6, 24+%2 \r\n"
+ "ldc1 $f8, %0 \r\n"
+ "ldc1 $f12, %1 \r\n"
+ "mov.d $f10, $f8 \r\n"
+ "punpcklbh $f8, $f8, $f14 \r\n"
+ "punpckhbh $f10, $f10, $f14 \r\n"
+ "paddsh $f0, $f0, $f8 \r\n"
+ "paddsh $f2, $f2, $f10 \r\n"
+ "mov.d $f10, $f12 \r\n"
+ "punpcklbh $f12, $f12, $f14 \r\n"
+ "punpckhbh $f10, $f10, $f14 \r\n"
+ "paddsh $f4, $f4, $f12 \r\n"
+ "paddsh $f6, $f6, $f10 \r\n"
+ "packushb $f0, $f0, $f2 \r\n"
+ "packushb $f4, $f4, $f6 \r\n"
+ "sdc1 $f0, %0 \r\n"
+ "sdc1 $f4, %1 \r\n"
+ : "+m"(*pix),"+m"(*(pix+line_size))
+ : "m"(*p)
+ : "memory"
+ );
+
+ pix += line_size*2;
+ p += 16;
+ } while (--i);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_msa.c
new file mode 100644
index 00000000000..b29e4205564
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/idctdsp_msa.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "idctdsp_mips.h"
+
+static void put_pixels_clamped_msa(const int16_t *block, uint8_t *pixels,
+ int32_t stride)
+{
+ uint64_t in0_d, in1_d, in2_d, in3_d, in4_d, in5_d, in6_d, in7_d;
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ CLIP_SH4_0_255(in0, in1, in2, in3);
+ CLIP_SH4_0_255(in4, in5, in6, in7);
+ PCKEV_B4_SH(in0, in0, in1, in1, in2, in2, in3, in3, in0, in1, in2, in3);
+ PCKEV_B4_SH(in4, in4, in5, in5, in6, in6, in7, in7, in4, in5, in6, in7);
+
+ in0_d = __msa_copy_u_d((v2i64) in0, 0);
+ in1_d = __msa_copy_u_d((v2i64) in1, 0);
+ in2_d = __msa_copy_u_d((v2i64) in2, 0);
+ in3_d = __msa_copy_u_d((v2i64) in3, 0);
+ in4_d = __msa_copy_u_d((v2i64) in4, 0);
+ in5_d = __msa_copy_u_d((v2i64) in5, 0);
+ in6_d = __msa_copy_u_d((v2i64) in6, 0);
+ in7_d = __msa_copy_u_d((v2i64) in7, 0);
+ SD4(in0_d, in1_d, in2_d, in3_d, pixels, stride);
+ pixels += 4 * stride;
+ SD4(in4_d, in5_d, in6_d, in7_d, pixels, stride);
+}
+
+static void put_signed_pixels_clamped_msa(const int16_t *block, uint8_t *pixels,
+ int32_t stride)
+{
+ uint64_t in0_d, in1_d, in2_d, in3_d, in4_d, in5_d, in6_d, in7_d;
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+
+ in0 += 128;
+ in1 += 128;
+ in2 += 128;
+ in3 += 128;
+ in4 += 128;
+ in5 += 128;
+ in6 += 128;
+ in7 += 128;
+
+ CLIP_SH4_0_255(in0, in1, in2, in3);
+ CLIP_SH4_0_255(in4, in5, in6, in7);
+ PCKEV_B4_SH(in0, in0, in1, in1, in2, in2, in3, in3, in0, in1, in2, in3);
+ PCKEV_B4_SH(in4, in4, in5, in5, in6, in6, in7, in7, in4, in5, in6, in7);
+
+ in0_d = __msa_copy_u_d((v2i64) in0, 0);
+ in1_d = __msa_copy_u_d((v2i64) in1, 0);
+ in2_d = __msa_copy_u_d((v2i64) in2, 0);
+ in3_d = __msa_copy_u_d((v2i64) in3, 0);
+ in4_d = __msa_copy_u_d((v2i64) in4, 0);
+ in5_d = __msa_copy_u_d((v2i64) in5, 0);
+ in6_d = __msa_copy_u_d((v2i64) in6, 0);
+ in7_d = __msa_copy_u_d((v2i64) in7, 0);
+ SD4(in0_d, in1_d, in2_d, in3_d, pixels, stride);
+ pixels += 4 * stride;
+ SD4(in4_d, in5_d, in6_d, in7_d, pixels, stride);
+}
+
+static void add_pixels_clamped_msa(const int16_t *block, uint8_t *pixels,
+ int32_t stride)
+{
+ uint64_t in0_d, in1_d, in2_d, in3_d, in4_d, in5_d, in6_d, in7_d;
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v16u8 pix_in0, pix_in1, pix_in2, pix_in3;
+ v16u8 pix_in4, pix_in5, pix_in6, pix_in7;
+ v8u16 pix0, pix1, pix2, pix3, pix4, pix5, pix6, pix7;
+ v8i16 zero = { 0 };
+
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ LD_UB8(pixels, stride, pix_in0, pix_in1, pix_in2,
+ pix_in3, pix_in4, pix_in5, pix_in6, pix_in7);
+
+ ILVR_B4_UH(zero, pix_in0, zero, pix_in1, zero, pix_in2, zero, pix_in3,
+ pix0, pix1, pix2, pix3);
+ ILVR_B4_UH(zero, pix_in4, zero, pix_in5, zero, pix_in6, zero, pix_in7,
+ pix4, pix5, pix6, pix7);
+
+ in0 += (v8i16) pix0;
+ in1 += (v8i16) pix1;
+ in2 += (v8i16) pix2;
+ in3 += (v8i16) pix3;
+ in4 += (v8i16) pix4;
+ in5 += (v8i16) pix5;
+ in6 += (v8i16) pix6;
+ in7 += (v8i16) pix7;
+
+ CLIP_SH4_0_255(in0, in1, in2, in3);
+ CLIP_SH4_0_255(in4, in5, in6, in7);
+ PCKEV_B4_SH(in0, in0, in1, in1, in2, in2, in3, in3, in0, in1, in2, in3);
+ PCKEV_B4_SH(in4, in4, in5, in5, in6, in6, in7, in7, in4, in5, in6, in7);
+
+ in0_d = __msa_copy_u_d((v2i64) in0, 0);
+ in1_d = __msa_copy_u_d((v2i64) in1, 0);
+ in2_d = __msa_copy_u_d((v2i64) in2, 0);
+ in3_d = __msa_copy_u_d((v2i64) in3, 0);
+ in4_d = __msa_copy_u_d((v2i64) in4, 0);
+ in5_d = __msa_copy_u_d((v2i64) in5, 0);
+ in6_d = __msa_copy_u_d((v2i64) in6, 0);
+ in7_d = __msa_copy_u_d((v2i64) in7, 0);
+ SD4(in0_d, in1_d, in2_d, in3_d, pixels, stride);
+ pixels += 4 * stride;
+ SD4(in4_d, in5_d, in6_d, in7_d, pixels, stride);
+}
+
+void ff_put_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size)
+{
+ put_pixels_clamped_msa(block, pixels, line_size);
+}
+
+void ff_put_signed_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size)
+{
+ put_signed_pixels_clamped_msa(block, pixels, line_size);
+}
+
+void ff_add_pixels_clamped_msa(const int16_t *block,
+ uint8_t *av_restrict pixels,
+ ptrdiff_t line_size)
+{
+ add_pixels_clamped_msa(block, pixels, line_size);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/iirfilter_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/iirfilter_mips.c
index 5a145cff587..a5646cde8b3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/iirfilter_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/iirfilter_mips.c
@@ -55,7 +55,6 @@
#include "libavcodec/iirfilter.h"
#if HAVE_INLINE_ASM
-#if !HAVE_LOONGSON3
typedef struct FFIIRFilterCoeffs {
int order;
float gain;
@@ -196,13 +195,10 @@ static void ff_iir_filter_flt_mips(const struct FFIIRFilterCoeffs *c,
}
}
}
-#endif /* !HAVE_LOONGSON3 */
#endif /* HAVE_INLINE_ASM */
void ff_iir_filter_init_mips(FFIIRFilterContext *f) {
#if HAVE_INLINE_ASM
-#if !HAVE_LOONGSON3
f->filter_flt = ff_iir_filter_flt_mips;
-#endif /* !HAVE_LOONGSON3 */
#endif /* HAVE_INLINE_ASM */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_init_mips.c
new file mode 100644
index 00000000000..219a0dc00cc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_init_mips.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "me_cmp_mips.h"
+
+#if HAVE_MSA
+static av_cold void me_cmp_msa(MECmpContext *c, AVCodecContext *avctx)
+{
+#if BIT_DEPTH == 8
+ c->pix_abs[0][0] = ff_pix_abs16_msa;
+ c->pix_abs[0][1] = ff_pix_abs16_x2_msa;
+ c->pix_abs[0][2] = ff_pix_abs16_y2_msa;
+ c->pix_abs[0][3] = ff_pix_abs16_xy2_msa;
+ c->pix_abs[1][0] = ff_pix_abs8_msa;
+ c->pix_abs[1][1] = ff_pix_abs8_x2_msa;
+ c->pix_abs[1][2] = ff_pix_abs8_y2_msa;
+ c->pix_abs[1][3] = ff_pix_abs8_xy2_msa;
+
+ c->hadamard8_diff[0] = ff_hadamard8_diff16_msa;
+ c->hadamard8_diff[1] = ff_hadamard8_diff8x8_msa;
+
+ c->hadamard8_diff[4] = ff_hadamard8_intra16_msa;
+ c->hadamard8_diff[5] = ff_hadamard8_intra8x8_msa;
+
+ c->sad[0] = ff_pix_abs16_msa;
+ c->sad[1] = ff_pix_abs8_msa;
+ c->sse[0] = ff_sse16_msa;
+ c->sse[1] = ff_sse8_msa;
+ c->sse[2] = ff_sse4_msa;
+#endif
+}
+#endif // #if HAVE_MSA
+
+av_cold void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx)
+{
+#if HAVE_MSA
+ me_cmp_msa(c, avctx);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_mips.h
new file mode 100644
index 00000000000..e0d0f51af8e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_mips.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_ME_CMP_MIPS_H
+#define AVCODEC_MIPS_ME_CMP_MIPS_H
+
+#include "../mpegvideo.h"
+#include "libavcodec/bit_depth_template.c"
+
+int ff_hadamard8_diff8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h);
+int ff_hadamard8_intra8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h);
+int ff_hadamard8_diff16_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h);
+int ff_hadamard8_intra16_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h);
+int ff_pix_abs16_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs16_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs16_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs16_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs8_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs8_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs8_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_pix_abs8_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h);
+int ff_sse16_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref,
+ ptrdiff_t stride, int i32Height);
+int ff_sse8_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref,
+ ptrdiff_t stride, int i32Height);
+int ff_sse4_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref,
+ ptrdiff_t stride, int i32Height);
+void ff_add_pixels8_msa(uint8_t *av_restrict pixels, int16_t *block,
+ ptrdiff_t stride);
+
+#endif // #ifndef AVCODEC_MIPS_ME_CMP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_msa.c
new file mode 100644
index 00000000000..0e3165cd8f6
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/me_cmp_msa.c
@@ -0,0 +1,686 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "me_cmp_mips.h"
+
+static uint32_t sad_8width_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *ref, int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, ref0, ref1, ref2, ref3;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3);
+ ref += (4 * ref_stride);
+
+ PCKEV_D4_UB(src1, src0, src3, src2, ref1, ref0, ref3, ref2,
+ src0, src1, ref0, ref1);
+ sad += SAD_UB2_UH(src0, src1, ref0, ref1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_16width_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *ref, int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, ref0, ref1;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+ LD_UB2(ref, ref_stride, ref0, ref1);
+ ref += (2 * ref_stride);
+ sad += SAD_UB2_UH(src0, src1, ref0, ref1);
+
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+ LD_UB2(ref, ref_stride, ref0, ref1);
+ ref += (2 * ref_stride);
+ sad += SAD_UB2_UH(src0, src1, ref0, ref1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_horiz_bilinear_filter_8width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, comp0, comp1;
+ v16u8 ref0, ref1, ref2, ref3, ref4, ref5;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 3); ht_cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3);
+ ref += (4 * ref_stride);
+
+ PCKEV_D2_UB(src1, src0, src3, src2, src0, src1);
+ PCKEV_D2_UB(ref1, ref0, ref3, ref2, ref4, ref5);
+ SLDI_B2_UB(ref0, ref1, ref0, ref1, ref0, ref1, 1);
+ SLDI_B2_UB(ref2, ref3, ref2, ref3, ref2, ref3, 1);
+ PCKEV_D2_UB(ref1, ref0, ref3, ref2, ref0, ref1);
+ AVER_UB2_UB(ref4, ref0, ref5, ref1, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3);
+ ref += (4 * ref_stride);
+
+ PCKEV_D2_UB(src1, src0, src3, src2, src0, src1);
+ PCKEV_D2_UB(ref1, ref0, ref3, ref2, ref4, ref5);
+ SLDI_B2_UB(ref0, ref1, ref0, ref1, ref0, ref1, 1);
+ SLDI_B2_UB(ref2, ref3, ref2, ref3, ref2, ref3, 1);
+ PCKEV_D2_UB(ref1, ref0, ref3, ref2, ref0, ref1);
+ AVER_UB2_UB(ref4, ref0, ref5, ref1, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_horiz_bilinear_filter_16width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, comp0, comp1;
+ v16u8 ref00, ref10, ref20, ref30, ref01, ref11, ref21, ref31;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 3); ht_cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref00, ref10, ref20, ref30);
+ LD_UB4(ref + 1, ref_stride, ref01, ref11, ref21, ref31);
+ ref += (4 * ref_stride);
+
+ AVER_UB2_UB(ref01, ref00, ref11, ref10, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ AVER_UB2_UB(ref21, ref20, ref31, ref30, comp0, comp1);
+ sad += SAD_UB2_UH(src2, src3, comp0, comp1);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref00, ref10, ref20, ref30);
+ LD_UB4(ref + 1, ref_stride, ref01, ref11, ref21, ref31);
+ ref += (4 * ref_stride);
+
+ AVER_UB2_UB(ref01, ref00, ref11, ref10, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ AVER_UB2_UB(ref21, ref20, ref31, ref30, comp0, comp1);
+ sad += SAD_UB2_UH(src2, src3, comp0, comp1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_vert_bilinear_filter_8width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, comp0, comp1;
+ v16u8 ref0, ref1, ref2, ref3, ref4;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 3); ht_cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB5(ref, ref_stride, ref0, ref1, ref2, ref3, ref4);
+ ref += (4 * ref_stride);
+
+ PCKEV_D2_UB(src1, src0, src3, src2, src0, src1);
+ PCKEV_D2_UB(ref1, ref0, ref2, ref1, ref0, ref1);
+ PCKEV_D2_UB(ref3, ref2, ref4, ref3, ref2, ref3);
+ AVER_UB2_UB(ref1, ref0, ref3, ref2, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB5(ref, ref_stride, ref0, ref1, ref2, ref3, ref4);
+ ref += (4 * ref_stride);
+
+ PCKEV_D2_UB(src1, src0, src3, src2, src0, src1);
+ PCKEV_D2_UB(ref1, ref0, ref2, ref1, ref0, ref1);
+ PCKEV_D2_UB(ref3, ref2, ref4, ref3, ref2, ref3);
+ AVER_UB2_UB(ref1, ref0, ref3, ref2, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_vert_bilinear_filter_16width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, comp0, comp1;
+ v16u8 ref0, ref1, ref2, ref3, ref4;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 3); ht_cnt--;) {
+ LD_UB5(ref, ref_stride, ref4, ref0, ref1, ref2, ref3);
+ ref += (5 * ref_stride);
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ AVER_UB2_UB(ref0, ref4, ref1, ref0, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ AVER_UB2_UB(ref2, ref1, ref3, ref2, comp0, comp1);
+ sad += SAD_UB2_UH(src2, src3, comp0, comp1);
+
+ ref4 = ref3;
+
+ LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3);
+ ref += (3 * ref_stride);
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ AVER_UB2_UB(ref0, ref4, ref1, ref0, comp0, comp1);
+ sad += SAD_UB2_UH(src0, src1, comp0, comp1);
+ AVER_UB2_UB(ref2, ref1, ref3, ref2, comp0, comp1);
+ sad += SAD_UB2_UH(src2, src3, comp0, comp1);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_hv_bilinear_filter_8width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, temp0, temp1, diff;
+ v16u8 ref0, ref1, ref2, ref3, ref4;
+ v16i8 mask = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v8u16 comp0, comp1, comp2, comp3;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ LD_UB5(ref, ref_stride, ref4, ref0, ref1, ref2, ref3);
+ ref += (4 * ref_stride);
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ PCKEV_D2_UB(src1, src0, src3, src2, src0, src1);
+
+ VSHF_B2_UB(ref4, ref4, ref0, ref0, mask, mask, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ comp0 += comp1;
+ comp0 = (v8u16) __msa_srari_h((v8i16) comp0, 2);
+ comp0 = (v8u16) __msa_pckev_b((v16i8) comp0, (v16i8) comp0);
+
+ temp0 = (v16u8) __msa_vshf_b(mask, (v16i8) ref1, (v16i8) ref1);
+ comp2 = __msa_hadd_u_h(temp0, temp0);
+ comp1 += comp2;
+ comp1 = (v8u16) __msa_srari_h((v8i16) comp1, 2);
+ comp1 = (v8u16) __msa_pckev_b((v16i8) comp1, (v16i8) comp1);
+ comp1 = (v8u16) __msa_pckev_d((v2i64) comp1, (v2i64) comp0);
+ diff = (v16u8) __msa_asub_u_b(src0, (v16u8) comp1);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ temp1 = (v16u8) __msa_vshf_b(mask, (v16i8) ref2, (v16i8) ref2);
+ comp3 = __msa_hadd_u_h(temp1, temp1);
+ comp2 += comp3;
+ comp2 = (v8u16) __msa_srari_h((v8i16) comp2, 2);
+ comp2 = (v8u16) __msa_pckev_b((v16i8) comp2, (v16i8) comp2);
+
+ temp0 = (v16u8) __msa_vshf_b(mask, (v16i8) ref3, (v16i8) ref3);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp3 += comp0;
+ comp3 = (v8u16) __msa_srari_h((v8i16) comp3, 2);
+ comp3 = (v8u16) __msa_pckev_b((v16i8) comp3, (v16i8) comp3);
+ comp3 = (v8u16) __msa_pckev_d((v2i64) comp3, (v2i64) comp2);
+ diff = (v16u8) __msa_asub_u_b(src1, (v16u8) comp3);
+ sad += __msa_hadd_u_h(diff, diff);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+static uint32_t sad_hv_bilinear_filter_16width_msa(uint8_t *src,
+ int32_t src_stride,
+ uint8_t *ref,
+ int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ v16u8 src0, src1, src2, src3, comp, diff;
+ v16u8 temp0, temp1, temp2, temp3;
+ v16u8 ref00, ref01, ref02, ref03, ref04, ref10, ref11, ref12, ref13, ref14;
+ v8u16 comp0, comp1, comp2, comp3;
+ v8u16 sad = { 0 };
+
+ for (ht_cnt = (height >> 3); ht_cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB5(ref, ref_stride, ref04, ref00, ref01, ref02, ref03);
+ LD_UB5(ref + 1, ref_stride, ref14, ref10, ref11, ref12, ref13);
+ ref += (5 * ref_stride);
+
+ ILVRL_B2_UB(ref14, ref04, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ ILVRL_B2_UB(ref10, ref00, temp2, temp3);
+ comp2 = __msa_hadd_u_h(temp2, temp2);
+ comp3 = __msa_hadd_u_h(temp3, temp3);
+ comp0 += comp2;
+ comp1 += comp3;
+ SRARI_H2_UH(comp0, comp1, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp1, (v16i8) comp0);
+ diff = __msa_asub_u_b(src0, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref11, ref01, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ comp2 += comp0;
+ comp3 += comp1;
+ SRARI_H2_UH(comp2, comp3, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp3, (v16i8) comp2);
+ diff = __msa_asub_u_b(src1, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref12, ref02, temp2, temp3);
+ comp2 = __msa_hadd_u_h(temp2, temp2);
+ comp3 = __msa_hadd_u_h(temp3, temp3);
+ comp0 += comp2;
+ comp1 += comp3;
+ SRARI_H2_UH(comp0, comp1, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp1, (v16i8) comp0);
+ diff = __msa_asub_u_b(src2, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref13, ref03, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ comp2 += comp0;
+ comp3 += comp1;
+ SRARI_H2_UH(comp2, comp3, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp3, (v16i8) comp2);
+ diff = __msa_asub_u_b(src3, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(ref, ref_stride, ref00, ref01, ref02, ref03);
+ LD_UB4(ref + 1, ref_stride, ref10, ref11, ref12, ref13);
+ ref += (3 * ref_stride);
+
+ ILVRL_B2_UB(ref10, ref00, temp2, temp3);
+ comp2 = __msa_hadd_u_h(temp2, temp2);
+ comp3 = __msa_hadd_u_h(temp3, temp3);
+ comp0 += comp2;
+ comp1 += comp3;
+ SRARI_H2_UH(comp0, comp1, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp1, (v16i8) comp0);
+ diff = __msa_asub_u_b(src0, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref11, ref01, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ comp2 += comp0;
+ comp3 += comp1;
+ SRARI_H2_UH(comp2, comp3, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp3, (v16i8) comp2);
+ diff = __msa_asub_u_b(src1, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref12, ref02, temp2, temp3);
+ comp2 = __msa_hadd_u_h(temp2, temp2);
+ comp3 = __msa_hadd_u_h(temp3, temp3);
+ comp0 += comp2;
+ comp1 += comp3;
+ SRARI_H2_UH(comp0, comp1, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp1, (v16i8) comp0);
+ diff = __msa_asub_u_b(src2, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+
+ ILVRL_B2_UB(ref13, ref03, temp0, temp1);
+ comp0 = __msa_hadd_u_h(temp0, temp0);
+ comp1 = __msa_hadd_u_h(temp1, temp1);
+ comp2 += comp0;
+ comp3 += comp1;
+ SRARI_H2_UH(comp2, comp3, 2);
+ comp = (v16u8) __msa_pckev_b((v16i8) comp3, (v16i8) comp2);
+ diff = __msa_asub_u_b(src3, comp);
+ sad += __msa_hadd_u_h(diff, diff);
+ }
+
+ return (HADD_UH_U32(sad));
+}
+
+#define CALC_MSE_B(src, ref, var) \
+{ \
+ v16u8 src_l0_m, src_l1_m; \
+ v8i16 res_l0_m, res_l1_m; \
+ \
+ ILVRL_B2_UB(src, ref, src_l0_m, src_l1_m); \
+ HSUB_UB2_SH(src_l0_m, src_l1_m, res_l0_m, res_l1_m); \
+ DPADD_SH2_SW(res_l0_m, res_l1_m, res_l0_m, res_l1_m, var, var); \
+}
+
+static uint32_t sse_4width_msa(uint8_t *src_ptr, int32_t src_stride,
+ uint8_t *ref_ptr, int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ uint32_t sse;
+ uint32_t src0, src1, src2, src3;
+ uint32_t ref0, ref1, ref2, ref3;
+ v16u8 src = { 0 };
+ v16u8 ref = { 0 };
+ v4i32 var = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ LW4(src_ptr, src_stride, src0, src1, src2, src3);
+ src_ptr += (4 * src_stride);
+ LW4(ref_ptr, ref_stride, ref0, ref1, ref2, ref3);
+ ref_ptr += (4 * ref_stride);
+
+ INSERT_W4_UB(src0, src1, src2, src3, src);
+ INSERT_W4_UB(ref0, ref1, ref2, ref3, ref);
+ CALC_MSE_B(src, ref, var);
+ }
+
+ sse = HADD_SW_S32(var);
+
+ return sse;
+}
+
+static uint32_t sse_8width_msa(uint8_t *src_ptr, int32_t src_stride,
+ uint8_t *ref_ptr, int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ uint32_t sse;
+ v16u8 src0, src1, src2, src3;
+ v16u8 ref0, ref1, ref2, ref3;
+ v4i32 var = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ LD_UB4(src_ptr, src_stride, src0, src1, src2, src3);
+ src_ptr += (4 * src_stride);
+ LD_UB4(ref_ptr, ref_stride, ref0, ref1, ref2, ref3);
+ ref_ptr += (4 * ref_stride);
+
+ PCKEV_D4_UB(src1, src0, src3, src2, ref1, ref0, ref3, ref2,
+ src0, src1, ref0, ref1);
+ CALC_MSE_B(src0, ref0, var);
+ CALC_MSE_B(src1, ref1, var);
+ }
+
+ sse = HADD_SW_S32(var);
+
+ return sse;
+}
+
+static uint32_t sse_16width_msa(uint8_t *src_ptr, int32_t src_stride,
+ uint8_t *ref_ptr, int32_t ref_stride,
+ int32_t height)
+{
+ int32_t ht_cnt;
+ uint32_t sse;
+ v16u8 src, ref;
+ v4i32 var = { 0 };
+
+ for (ht_cnt = (height >> 2); ht_cnt--;) {
+ src = LD_UB(src_ptr);
+ src_ptr += src_stride;
+ ref = LD_UB(ref_ptr);
+ ref_ptr += ref_stride;
+ CALC_MSE_B(src, ref, var);
+
+ src = LD_UB(src_ptr);
+ src_ptr += src_stride;
+ ref = LD_UB(ref_ptr);
+ ref_ptr += ref_stride;
+ CALC_MSE_B(src, ref, var);
+
+ src = LD_UB(src_ptr);
+ src_ptr += src_stride;
+ ref = LD_UB(ref_ptr);
+ ref_ptr += ref_stride;
+ CALC_MSE_B(src, ref, var);
+
+ src = LD_UB(src_ptr);
+ src_ptr += src_stride;
+ ref = LD_UB(ref_ptr);
+ ref_ptr += ref_stride;
+ CALC_MSE_B(src, ref, var);
+ }
+
+ sse = HADD_SW_S32(var);
+
+ return sse;
+}
+
+static int32_t hadamard_diff_8x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *ref, int32_t ref_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7;
+ v8u16 diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7;
+ v8u16 temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
+ v8i16 sum = { 0 };
+ v8i16 zero = { 0 };
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8(ref, ref_stride, ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7);
+ ILVR_B8_UH(src0, ref0, src1, ref1, src2, ref2, src3, ref3,
+ src4, ref4, src5, ref5, src6, ref6, src7, ref7,
+ diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7);
+ HSUB_UB4_UH(diff0, diff1, diff2, diff3, diff0, diff1, diff2, diff3);
+ HSUB_UB4_UH(diff4, diff5, diff6, diff7, diff4, diff5, diff6, diff7);
+ TRANSPOSE8x8_UH_UH(diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7,
+ diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7);
+ BUTTERFLY_8(diff0, diff2, diff4, diff6, diff7, diff5, diff3, diff1,
+ temp0, temp2, temp4, temp6, temp7, temp5, temp3, temp1);
+ BUTTERFLY_8(temp0, temp1, temp4, temp5, temp7, temp6, temp3, temp2,
+ diff0, diff1, diff4, diff5, diff7, diff6, diff3, diff2);
+ BUTTERFLY_8(diff0, diff1, diff2, diff3, diff7, diff6, diff5, diff4,
+ temp0, temp1, temp2, temp3, temp7, temp6, temp5, temp4);
+ TRANSPOSE8x8_UH_UH(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7,
+ temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7);
+ BUTTERFLY_8(temp0, temp2, temp4, temp6, temp7, temp5, temp3, temp1,
+ diff0, diff2, diff4, diff6, diff7, diff5, diff3, diff1);
+ BUTTERFLY_8(diff0, diff1, diff4, diff5, diff7, diff6, diff3, diff2,
+ temp0, temp1, temp4, temp5, temp7, temp6, temp3, temp2);
+ ADD4(temp0, temp4, temp1, temp5, temp2, temp6, temp3, temp7,
+ diff0, diff1, diff2, diff3);
+ sum = __msa_asub_s_h((v8i16) temp3, (v8i16) temp7);
+ sum += __msa_asub_s_h((v8i16) temp2, (v8i16) temp6);
+ sum += __msa_asub_s_h((v8i16) temp1, (v8i16) temp5);
+ sum += __msa_asub_s_h((v8i16) temp0, (v8i16) temp4);
+ sum += __msa_add_a_h((v8i16) diff0, zero);
+ sum += __msa_add_a_h((v8i16) diff1, zero);
+ sum += __msa_add_a_h((v8i16) diff2, zero);
+ sum += __msa_add_a_h((v8i16) diff3, zero);
+
+ return (HADD_UH_U32(sum));
+}
+
+static int32_t hadamard_intra_8x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *ref, int32_t ref_stride)
+{
+ int32_t sum_res = 0;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v8u16 diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7;
+ v8u16 temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
+ v8i16 sum = { 0 };
+ v16i8 zero = { 0 };
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ TRANSPOSE8x8_UB_UB(src0, src1, src2, src3, src4, src5, src6, src7,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ ILVR_B8_UH(zero, src0, zero, src1, zero, src2, zero, src3,
+ zero, src4, zero, src5, zero, src6, zero, src7,
+ diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7);
+ BUTTERFLY_8(diff0, diff2, diff4, diff6, diff7, diff5, diff3, diff1,
+ temp0, temp2, temp4, temp6, temp7, temp5, temp3, temp1);
+ BUTTERFLY_8(temp0, temp1, temp4, temp5, temp7, temp6, temp3, temp2,
+ diff0, diff1, diff4, diff5, diff7, diff6, diff3, diff2);
+ BUTTERFLY_8(diff0, diff1, diff2, diff3, diff7, diff6, diff5, diff4,
+ temp0, temp1, temp2, temp3, temp7, temp6, temp5, temp4);
+ TRANSPOSE8x8_UH_UH(temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7,
+ temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7);
+ BUTTERFLY_8(temp0, temp2, temp4, temp6, temp7, temp5, temp3, temp1,
+ diff0, diff2, diff4, diff6, diff7, diff5, diff3, diff1);
+ BUTTERFLY_8(diff0, diff1, diff4, diff5, diff7, diff6, diff3, diff2,
+ temp0, temp1, temp4, temp5, temp7, temp6, temp3, temp2);
+ ADD4(temp0, temp4, temp1, temp5, temp2, temp6, temp3, temp7,
+ diff0, diff1, diff2, diff3);
+ sum = __msa_asub_s_h((v8i16) temp3, (v8i16) temp7);
+ sum += __msa_asub_s_h((v8i16) temp2, (v8i16) temp6);
+ sum += __msa_asub_s_h((v8i16) temp1, (v8i16) temp5);
+ sum += __msa_asub_s_h((v8i16) temp0, (v8i16) temp4);
+ sum += __msa_add_a_h((v8i16) diff0, (v8i16) zero);
+ sum += __msa_add_a_h((v8i16) diff1, (v8i16) zero);
+ sum += __msa_add_a_h((v8i16) diff2, (v8i16) zero);
+ sum += __msa_add_a_h((v8i16) diff3, (v8i16) zero);
+ sum_res = (HADD_UH_U32(sum));
+ sum_res -= abs(temp0[0] + temp4[0]);
+
+ return sum_res;
+}
+
+int ff_pix_abs16_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref,
+ ptrdiff_t stride, int height)
+{
+ return sad_16width_msa(src, stride, ref, stride, height);
+}
+
+int ff_pix_abs8_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref,
+ ptrdiff_t stride, int height)
+{
+ return sad_8width_msa(src, stride, ref, stride, height);
+}
+
+int ff_pix_abs16_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_horiz_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_pix_abs16_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_vert_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_pix_abs16_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_hv_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_pix_abs8_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_horiz_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_pix_abs8_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_vert_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_pix_abs8_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
+ ptrdiff_t stride, int h)
+{
+ return sad_hv_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h);
+}
+
+int ff_sse16_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref,
+ ptrdiff_t stride, int height)
+{
+ return sse_16width_msa(src, stride, ref, stride, height);
+}
+
+int ff_sse8_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref,
+ ptrdiff_t stride, int height)
+{
+ return sse_8width_msa(src, stride, ref, stride, height);
+}
+
+int ff_sse4_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref,
+ ptrdiff_t stride, int height)
+{
+ return sse_4width_msa(src, stride, ref, stride, height);
+}
+
+int ff_hadamard8_diff8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h)
+{
+ return hadamard_diff_8x8_msa(src, stride, dst, stride);
+}
+
+int ff_hadamard8_intra8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src,
+ ptrdiff_t stride, int h)
+{
+ return hadamard_intra_8x8_msa(src, stride, dst, stride);
+}
+
+/* Hadamard Transform functions */
+#define WRAPPER8_16_SQ(name8, name16) \
+int name16(MpegEncContext *s, uint8_t *dst, uint8_t *src, \
+ ptrdiff_t stride, int h) \
+{ \
+ int score = 0; \
+ score += name8(s, dst, src, stride, 8); \
+ score += name8(s, dst + 8, src + 8, stride, 8); \
+ if(h == 16) { \
+ dst += 8 * stride; \
+ src += 8 * stride; \
+ score +=name8(s, dst, src, stride, 8); \
+ score +=name8(s, dst + 8, src + 8, stride, 8); \
+ } \
+ return score; \
+}
+
+WRAPPER8_16_SQ(ff_hadamard8_diff8x8_msa, ff_hadamard8_diff16_msa);
+WRAPPER8_16_SQ(ff_hadamard8_intra8x8_msa, ff_hadamard8_intra16_msa);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c
index beebace5441..bd36894d31f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegaudiodsp_mips_float.c
@@ -278,7 +278,6 @@ static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
);
}
-#if !HAVE_LOONGSON3
static void ff_dct32_mips_float(float *out, const float *tab)
{
float val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7,
@@ -787,7 +786,6 @@ static void ff_dct32_mips_float(float *out, const float *tab)
out[15] = val30 + val17;
out[31] = val31;
}
-#endif /* !HAVE_LOONGSON3 */
static void imdct36_mips_float(float *out, float *buf, float *in, float *win)
{
@@ -1226,7 +1224,6 @@ static void imdct36_mips_float(float *out, float *buf, float *in, float *win)
);
}
-#if !HAVE_LOONGSON3
static void ff_imdct36_blocks_mips_float(float *out, float *buf, float *in,
int count, int switch_point, int block_type)
{
@@ -1245,13 +1242,10 @@ static void ff_imdct36_blocks_mips_float(float *out, float *buf, float *in,
out++;
}
}
-#endif /* !HAVE_LOONGSON3 */
void ff_mpadsp_init_mipsfpu(MPADSPContext *s)
{
s->apply_window_float = ff_mpadsp_apply_window_mips_float;
-#if !HAVE_LOONGSON3
s->imdct36_blocks_float = ff_imdct36_blocks_mips_float;
s->dct32_float = ff_dct32_mips_float;
-#endif /* !HAVE_LOONGSON3 */
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_init_mips.c
new file mode 100644
index 00000000000..e83aec5365b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_init_mips.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "h263dsp_mips.h"
+#include "mpegvideo_mips.h"
+
+#if HAVE_MSA
+static av_cold void dct_unquantize_init_msa(MpegEncContext *s)
+{
+ s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_msa;
+ s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_msa;
+ s->dct_unquantize_mpeg2_inter = ff_dct_unquantize_mpeg2_inter_msa;
+}
+#endif // #if HAVE_MSA
+
+#if HAVE_MMI
+static av_cold void dct_unquantize_init_mmi(MpegEncContext *s)
+{
+ s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_mmi;
+ s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_mmi;
+ s->dct_unquantize_mpeg1_intra = ff_dct_unquantize_mpeg1_intra_mmi;
+ s->dct_unquantize_mpeg1_inter = ff_dct_unquantize_mpeg1_inter_mmi;
+
+ if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT))
+ s->dct_unquantize_mpeg2_intra = ff_dct_unquantize_mpeg2_intra_mmi;
+
+ s->denoise_dct= ff_denoise_dct_mmi;
+}
+#endif /* HAVE_MMI */
+
+av_cold void ff_mpv_common_init_mips(MpegEncContext *s)
+{
+#if HAVE_MSA
+ dct_unquantize_init_msa(s);
+#endif // #if HAVE_MSA
+#if HAVE_MMI
+ dct_unquantize_init_mmi(s);
+#endif /* HAVE_MMI */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mips.h
new file mode 100644
index 00000000000..decacd4c623
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mips.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 MPEGVIDEO_MIPS_H
+#define MPEGVIDEO_MIPS_H
+
+#include "libavcodec/mpegvideo.h"
+
+void ff_dct_unquantize_h263_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale);
+void ff_dct_unquantize_h263_inter_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale);
+void ff_dct_unquantize_mpeg1_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale);
+void ff_dct_unquantize_mpeg1_inter_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale);
+void ff_dct_unquantize_mpeg2_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale);
+void ff_denoise_dct_mmi(MpegEncContext *s, int16_t *block);
+
+#endif /* MPEGVIDEO_MIPS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c
new file mode 100644
index 00000000000..94781e6e5c2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c
@@ -0,0 +1,443 @@
+/*
+ * Loongson SIMD optimized mpegvideo
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ * Zhang Shuangshuang <zhangshuangshuang@ict.ac.cn>
+ *
+ * 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 "mpegvideo_mips.h"
+
+void ff_dct_unquantize_h263_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale)
+{
+ int64_t level, qmul, qadd, nCoeffs;
+
+ qmul = qscale << 1;
+ av_assert2(s->block_last_index[n]>=0 || s->h263_aic);
+
+ if (!s->h263_aic) {
+ if (n<4)
+ level = block[0] * s->y_dc_scale;
+ else
+ level = block[0] * s->c_dc_scale;
+ qadd = (qscale-1) | 1;
+ } else {
+ qadd = 0;
+ level = block[0];
+ }
+
+ if(s->ac_pred)
+ nCoeffs = 63;
+ else
+ nCoeffs = s->inter_scantable.raster_end[s->block_last_index[n]];
+
+ __asm__ volatile (
+ "xor $f12, $f12, $f12 \r\n"
+ "lwc1 $f12, %1 \n\r"
+ "xor $f10, $f10, $f10 \r\n"
+ "lwc1 $f10, %2 \r\n"
+ "xor $f14, $f14, $f14 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f10, $f10, $f10 \r\n"
+ "packsswh $f10, $f10, $f10 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ ".p2align 4 \r\n"
+ "1: \r\n"
+ "daddu $8, %0, %3 \r\n"
+ "gsldlc1 $f0, 7($8) \r\n"
+ "gsldrc1 $f0, 0($8) \r\n"
+ "gsldlc1 $f2, 15($8) \r\n"
+ "gsldrc1 $f2, 8($8) \r\n"
+ "mov.d $f4, $f0 \r\n"
+ "mov.d $f6, $f2 \r\n"
+ "pmullh $f0, $f0, $f12 \r\n"
+ "pmullh $f2, $f2, $f12 \r\n"
+ "pcmpgth $f4, $f4, $f8 \r\n"
+ "pcmpgth $f6, $f6, $f8 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "paddh $f0, $f0, $f14 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "xor $f4, $f4, $f0 \r\n"
+ "xor $f6, $f6, $f2 \r\n"
+ "pcmpeqh $f0, $f0, $f14 \r\n"
+ "pcmpeqh $f2, $f2, $f14 \r\n"
+ "pandn $f0, $f0, $f4 \r\n"
+ "pandn $f2, $f2, $f6 \r\n"
+ "gssdlc1 $f0, 7($8) \r\n"
+ "gssdrc1 $f0, 0($8) \r\n"
+ "gssdlc1 $f2, 15($8) \r\n"
+ "gssdrc1 $f2, 8($8) \r\n"
+ "addi %3, %3, 16 \r\n"
+ "blez %3, 1b \r\n"
+ ::"r"(block+nCoeffs),"m"(qmul),"m"(qadd),"r"(2*(-nCoeffs))
+ :"$8","memory"
+ );
+
+ block[0] = level;
+}
+
+void ff_dct_unquantize_h263_inter_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale)
+{
+ int64_t qmul, qadd, nCoeffs;
+
+ qmul = qscale << 1;
+ qadd = (qscale - 1) | 1;
+ av_assert2(s->block_last_index[n]>=0 || s->h263_aic);
+ nCoeffs = s->inter_scantable.raster_end[s->block_last_index[n]];
+
+ __asm__ volatile (
+ "xor $f12, $f12, $f12 \r\n"
+ "lwc1 $f12, %1 \r\n"
+ "xor $f10, $f10, $f10 \r\n"
+ "lwc1 $f10, %2 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "xor $f14, $f14, $f14 \r\n"
+ "packsswh $f10, $f10, $f10 \r\n"
+ "packsswh $f10, $f10, $f10 \r\n"
+ "psubh $f14, $f14, $f10 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ ".p2align 4 \r\n"
+ "1: \r\n"
+ "daddu $8, %0, %3 \r\n"
+ "gsldlc1 $f0, 7($8) \r\n"
+ "gsldrc1 $f0, 0($8) \r\n"
+ "gsldlc1 $f2, 15($8) \r\n"
+ "gsldrc1 $f2, 8($8) \r\n"
+ "mov.d $f4, $f0 \r\n"
+ "mov.d $f6, $f2 \r\n"
+ "pmullh $f0, $f0, $f12 \r\n"
+ "pmullh $f2, $f2, $f12 \r\n"
+ "pcmpgth $f4, $f4, $f8 \r\n"
+ "pcmpgth $f6, $f6, $f8 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "paddh $f0, $f0, $f14 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "xor $f4, $f4, $f0 \r\n"
+ "xor $f6, $f6, $f2 \r\n"
+ "pcmpeqh $f0, $f0, $f14 \r\n"
+ "pcmpeqh $f2, $f2, $f14 \r\n"
+ "pandn $f0, $f0, $f4 \r\n"
+ "pandn $f2, $f2, $f6 \r\n"
+ "gssdlc1 $f0, 7($8) \r\n"
+ "gssdrc1 $f0, 0($8) \r\n"
+ "gssdlc1 $f2, 15($8) \r\n"
+ "gssdrc1 $f2, 8($8) \r\n"
+ "addi %3, %3, 16 \r\n"
+ "blez %3, 1b \r\n"
+ ::"r"(block+nCoeffs),"m"(qmul),"m"(qadd),"r"(2*(-nCoeffs))
+ : "$8","memory"
+ );
+}
+
+void ff_dct_unquantize_mpeg1_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale)
+{
+ int64_t nCoeffs;
+ const uint16_t *quant_matrix;
+ int block0;
+
+ av_assert2(s->block_last_index[n]>=0);
+ nCoeffs = s->intra_scantable.raster_end[s->block_last_index[n]] + 1;
+
+ if (n<4)
+ block0 = block[0] * s->y_dc_scale;
+ else
+ block0 = block[0] * s->c_dc_scale;
+
+ /* XXX: only mpeg1 */
+ quant_matrix = s->intra_matrix;
+
+ __asm__ volatile (
+ "pcmpeqh $f14, $f14, $f14 \r\n"
+ "dli $10, 15 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "lwc1 $f12, %2 \r\n"
+ "psrlh $f14, $f14, $f16 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "or $8, %3, $0 \r\n"
+ ".p2align 4 \r\n"
+ "1: \r\n"
+ "gsldxc1 $f0, 0($8, %0) \r\n"
+ "gsldxc1 $f2, 8($8, %0) \r\n"
+ "mov.d $f16, $f0 \r\n"
+ "mov.d $f18, $f2 \r\n"
+ "gsldxc1 $f8, 0($8, %1) \r\n"
+ "gsldxc1 $f10, 8($8, %1) \r\n"
+ "pmullh $f8, $f8, $f12 \r\n"
+ "pmullh $f10, $f10, $f12 \r\n"
+ "xor $f4, $f4, $f4 \r\n"
+ "xor $f6, $f6, $f6 \r\n"
+ "pcmpgth $f4, $f4, $f0 \r\n"
+ "pcmpgth $f6, $f6, $f2 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "pmullh $f0, $f0, $f8 \r\n"
+ "pmullh $f2, $f2, $f10 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ "xor $f10, $f10, $f10 \r\n"
+ "pcmpeqh $f8, $f8, $f16 \r\n"
+ "pcmpeqh $f10, $f10, $f18 \r\n"
+ "dli $10, 3 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "psrah $f0, $f0, $f16 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "psubh $f0, $f0, $f14 \r\n"
+ "psubh $f2, $f2, $f14 \r\n"
+ "or $f0, $f0, $f14 \r\n"
+ "or $f2, $f2, $f14 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "pandn $f8, $f8, $f0 \r\n"
+ "pandn $f10, $f10, $f2 \r\n"
+ "gssdxc1 $f8, 0($8, %0) \r\n"
+ "gssdxc1 $f10, 8($8, %0) \r\n"
+ "addi $8, $8, 16 \r\n"
+ "bltz $8, 1b \r\n"
+ ::"r"(block+nCoeffs),"r"(quant_matrix+nCoeffs),"m"(qscale),
+ "g"(-2*nCoeffs)
+ : "$8","$10","memory"
+ );
+
+ block[0] = block0;
+}
+
+void ff_dct_unquantize_mpeg1_inter_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale)
+{
+ int64_t nCoeffs;
+ const uint16_t *quant_matrix;
+
+ av_assert2(s->block_last_index[n] >= 0);
+ nCoeffs = s->intra_scantable.raster_end[s->block_last_index[n]] + 1;
+ quant_matrix = s->inter_matrix;
+
+ __asm__ volatile (
+ "pcmpeqh $f14, $f14, $f14 \r\n"
+ "dli $10, 15 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "lwc1 $f12, %2 \r\n"
+ "psrlh $f14, $f14, $f16 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "or $8, %3, $0 \r\n"
+ ".p2align 4 \r\n"
+ "1: \r\n"
+ "gsldxc1 $f0, 0($8, %0) \r\n"
+ "gsldxc1 $f2, 8($8, %0) \r\n"
+ "mov.d $f16, $f0 \r\n"
+ "mov.d $f18, $f2 \r\n"
+ "gsldxc1 $f8, 0($8, %1) \r\n"
+ "gsldxc1 $f10, 8($8, %1) \r\n"
+ "pmullh $f8, $f8, $f12 \r\n"
+ "pmullh $f10, $f10, $f12 \r\n"
+ "xor $f4, $f4, $f4 \r\n"
+ "xor $f6, $f6, $f6 \r\n"
+ "pcmpgth $f4, $f4, $f0 \r\n"
+ "pcmpgth $f6, $f6, $f2 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "paddh $f0, $f0, $f0 \r\n"
+ "paddh $f2, $f2, $f2 \r\n"
+ "paddh $f0, $f0, $f14 \r\n"
+ "paddh $f2, $f2, $f14 \r\n"
+ "pmullh $f0, $f0, $f8 \r\n"
+ "pmullh $f2, $f2, $f10 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ "xor $f10, $f10, $f10 \r\n"
+ "pcmpeqh $f8, $f8, $f16 \r\n"
+ "pcmpeqh $f10, $f10, $f18 \r\n"
+ "dli $10, 4 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "psrah $f0, $f0, $f16 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "psubh $f0, $f0, $f14 \r\n"
+ "psubh $f2, $f2, $f14 \r\n"
+ "or $f0, $f0, $f14 \r\n"
+ "or $f2, $f2, $f14 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "pandn $f8, $f8, $f0 \r\n"
+ "pandn $f10, $f10, $f2 \r\n"
+ "gssdxc1 $f8, 0($8, %0) \r\n"
+ "gssdxc1 $f10, 8($8, %0) \r\n"
+ "addi $8, $8, 16 \r\n"
+ "bltz $8, 1b \r\n"
+ ::"r"(block+nCoeffs),"r"(quant_matrix+nCoeffs),"m"(qscale),
+ "g"(-2*nCoeffs)
+ :"$8","$10","memory"
+ );
+}
+
+void ff_denoise_dct_mmi(MpegEncContext *s, int16_t *block)
+{
+ const int intra = s->mb_intra;
+ int *sum = s->dct_error_sum[intra];
+ uint16_t *offset = s->dct_offset[intra];
+
+ s->dct_count[intra]++;
+
+ __asm__ volatile(
+ "xor $f14, $f14, $f14 \r\n"
+ "1: \r\n"
+ "ldc1 $f4, 0(%[block]) \r\n"
+ "xor $f0, $f0, $f0 \r\n"
+ "ldc1 $f6, 8(%[block]) \r\n"
+ "xor $f2, $f2, $f2 \r\n"
+ "pcmpgth $f0, $f0, $f4 \r\n"
+ "pcmpgth $f2, $f2, $f6 \r\n"
+ "xor $f4, $f4, $f0 \r\n"
+ "xor $f6, $f6, $f2 \r\n"
+ "psubh $f4, $f4, $f0 \r\n"
+ "psubh $f6, $f6, $f2 \r\n"
+ "ldc1 $f12, 0(%[offset]) \r\n"
+ "mov.d $f8, $f4 \r\n"
+ "psubush $f4, $f4, $f12 \r\n"
+ "ldc1 $f12, 8(%[offset]) \r\n"
+ "mov.d $f10, $f6 \r\n"
+ "psubush $f6, $f6, $f12 \r\n"
+ "xor $f4, $f4, $f0 \r\n"
+ "xor $f6, $f6, $f2 \r\n"
+ "psubh $f4, $f4, $f0 \r\n"
+ "psubh $f6, $f6, $f2 \r\n"
+ "sdc1 $f4, 0(%[block]) \r\n"
+ "sdc1 $f6, 8(%[block]) \r\n"
+ "mov.d $f4, $f8 \r\n"
+ "mov.d $f6, $f10 \r\n"
+ "punpcklhw $f8, $f8, $f14 \r\n"
+ "punpckhhw $f4, $f4, $f14 \r\n"
+ "punpcklhw $f10, $f10, $f14 \r\n"
+ "punpckhhw $f6, $f6, $f14 \r\n"
+ "ldc1 $f0, 0(%[sum]) \r\n"
+ "paddw $f8, $f8, $f0 \r\n"
+ "ldc1 $f0, 8(%[sum]) \r\n"
+ "paddw $f4, $f4, $f0 \r\n"
+ "ldc1 $f0, 16(%[sum]) \r\n"
+ "paddw $f10, $f10, $f0 \r\n"
+ "ldc1 $f0, 24(%[sum]) \r\n"
+ "paddw $f6, $f6, $f0 \r\n"
+ "sdc1 $f8, 0(%[sum]) \r\n"
+ "sdc1 $f4, 8(%[sum]) \r\n"
+ "sdc1 $f10, 16(%[sum]) \r\n"
+ "sdc1 $f6, 24(%[sum]) \r\n"
+ "daddiu %[block], %[block], 16 \r\n"
+ "daddiu %[sum], %[sum], 32 \r\n"
+ "daddiu %[offset], %[offset], 16 \r\n"
+ "dsubu $8, %[block1], %[block] \r\n"
+ "bgtz $8, 1b \r\n"
+ : [block]"+r"(block),[sum]"+r"(sum),[offset]"+r"(offset)
+ : [block1]"r"(block+64)
+ : "$8","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14"
+ );
+}
+
+void ff_dct_unquantize_mpeg2_intra_mmi(MpegEncContext *s, int16_t *block,
+ int n, int qscale)
+{
+ uint64_t nCoeffs;
+ const uint16_t *quant_matrix;
+ int block0;
+
+ assert(s->block_last_index[n]>=0);
+
+ if (s->alternate_scan)
+ nCoeffs = 63;
+ else
+ nCoeffs = s->intra_scantable.raster_end[s->block_last_index[n]];
+
+ if (n < 4)
+ block0 = block[0] * s->y_dc_scale;
+ else
+ block0 = block[0] * s->c_dc_scale;
+
+ quant_matrix = s->intra_matrix;
+
+ __asm__ volatile (
+ "pcmpeqh $f14, $f14, $f14 \r\n"
+ "dli $10, 15 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "xor $f12, $f12, $f12 \r\n"
+ "lwc1 $f12, %[qscale] \r\n"
+ "psrlh $f14, $f14, $f16 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "packsswh $f12, $f12, $f12 \r\n"
+ "or $8, %[ncoeffs], $0 \r\n"
+ ".p2align 4 \r\n"
+ "1: \r\n"
+ "gsldxc1 $f0, 0($8, %[block]) \r\n"
+ "gsldxc1 $f2, 8($8, %[block]) \r\n"
+ "mov.d $f16, $f0 \r\n"
+ "mov.d $f18, $f2 \r\n"
+ "gsldxc1 $f8, 0($8, %[quant]) \r\n"
+ "gsldxc1 $f10, 0($8, %[quant]) \r\n"
+ "pmullh $f8, $f8, $f12 \r\n"
+ "pmullh $f10, $f10, $f12 \r\n"
+ "xor $f4, $f4, $f4 \r\n"
+ "xor $f6, $f6, $f6 \r\n"
+ "pcmpgth $f4, $f4, $f0 \r\n"
+ "pcmpgth $f6, $f6, $f2 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "pmullh $f0, $f0, $f8 \r\n"
+ "pmullh $f2, $f2, $f10 \r\n"
+ "xor $f8, $f8, $f8 \r\n"
+ "xor $f10, $f10, $f10 \r\n"
+ "pcmpeqh $f8, $f8, $f16 \r\n"
+ "pcmpeqh $f10 ,$f10, $f18 \r\n"
+ "dli $10, 3 \r\n"
+ "dmtc1 $10, $f16 \r\n"
+ "psrah $f0, $f0, $f16 \r\n"
+ "psrah $f2, $f2, $f16 \r\n"
+ "xor $f0, $f0, $f4 \r\n"
+ "xor $f2, $f2, $f6 \r\n"
+ "psubh $f0, $f0, $f4 \r\n"
+ "psubh $f2, $f2, $f6 \r\n"
+ "pandn $f8, $f8, $f0 \r\n"
+ "pandn $f10, $f10, $f2 \r\n"
+ "gssdxc1 $f8, 0($8, %[block]) \r\n"
+ "gssdxc1 $f10, 8($8, %[block]) \r\n"
+ "daddiu $8, $8, 16 \r\n"
+ "blez $8, 1b \r\n"
+ ::[block]"r"(block+nCoeffs),[quant]"r"(quant_matrix+nCoeffs),
+ [qscale]"m"(qscale),[ncoeffs]"g"(-2*nCoeffs)
+ : "$8","$10","$f0","$f2","$f4","$f6","$f8","$f10","$f12","$f14","$f16",
+ "$f18"
+ );
+
+ block[0]= block0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_msa.c
new file mode 100644
index 00000000000..aa9ef770ebd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_msa.c
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "h263dsp_mips.h"
+
+static void h263_dct_unquantize_msa(int16_t *block, int16_t qmul,
+ int16_t qadd, int8_t n_coeffs,
+ uint8_t loop_start)
+{
+ int16_t *block_dup = block;
+ int32_t level, cnt;
+ v8i16 block_vec, qmul_vec, qadd_vec, sub;
+ v8i16 add, mask, mul, zero_mask;
+
+ qmul_vec = __msa_fill_h(qmul);
+ qadd_vec = __msa_fill_h(qadd);
+ for (cnt = 0; cnt < (n_coeffs >> 3); cnt++) {
+ block_vec = LD_SH(block_dup + loop_start);
+ mask = __msa_clti_s_h(block_vec, 0);
+ zero_mask = __msa_ceqi_h(block_vec, 0);
+ mul = block_vec * qmul_vec;
+ sub = mul - qadd_vec;
+ add = mul + qadd_vec;
+ add = (v8i16) __msa_bmnz_v((v16u8) add, (v16u8) sub, (v16u8) mask);
+ block_vec = (v8i16) __msa_bmnz_v((v16u8) add, (v16u8) block_vec,
+ (v16u8) zero_mask);
+ ST_SH(block_vec, block_dup + loop_start);
+ block_dup += 8;
+ }
+
+ cnt = ((n_coeffs >> 3) * 8) + loop_start;
+
+ for (; cnt <= n_coeffs; cnt++) {
+ level = block[cnt];
+ if (level) {
+ if (level < 0) {
+ level = level * qmul - qadd;
+ } else {
+ level = level * qmul + qadd;
+ }
+ block[cnt] = level;
+ }
+ }
+}
+
+static int32_t mpeg2_dct_unquantize_inter_msa(int16_t *block,
+ int32_t qscale,
+ const int16_t *quant_matrix)
+{
+ int32_t cnt, sum_res = -1;
+ v8i16 block_vec, block_neg, qscale_vec, mask;
+ v8i16 block_org0, block_org1, block_org2, block_org3;
+ v8i16 quant_m0, quant_m1, quant_m2, quant_m3;
+ v8i16 sum, mul, zero_mask;
+ v4i32 mul_vec, qscale_l, qscale_r, quant_m_r, quant_m_l;
+ v4i32 block_l, block_r, sad;
+
+ qscale_vec = __msa_fill_h(qscale);
+ for (cnt = 0; cnt < 2; cnt++) {
+ LD_SH4(block, 8, block_org0, block_org1, block_org2, block_org3);
+ LD_SH4(quant_matrix, 8, quant_m0, quant_m1, quant_m2, quant_m3);
+ mask = __msa_clti_s_h(block_org0, 0);
+ zero_mask = __msa_ceqi_h(block_org0, 0);
+ block_neg = -block_org0;
+ block_vec = (v8i16) __msa_bmnz_v((v16u8) block_org0, (v16u8) block_neg,
+ (v16u8) mask);
+ block_vec <<= 1;
+ block_vec += 1;
+ UNPCK_SH_SW(block_vec, block_r, block_l);
+ UNPCK_SH_SW(qscale_vec, qscale_r, qscale_l);
+ UNPCK_SH_SW(quant_m0, quant_m_r, quant_m_l);
+ mul_vec = block_l * qscale_l;
+ mul_vec *= quant_m_l;
+ block_l = mul_vec >> 4;
+ mul_vec = block_r * qscale_r;
+ mul_vec *= quant_m_r;
+ block_r = mul_vec >> 4;
+ mul = (v8i16) __msa_pckev_h((v8i16) block_l, (v8i16) block_r);
+ block_neg = - mul;
+ sum = (v8i16) __msa_bmnz_v((v16u8) mul, (v16u8) block_neg,
+ (v16u8) mask);
+ sum = (v8i16) __msa_bmnz_v((v16u8) sum, (v16u8) block_org0,
+ (v16u8) zero_mask);
+ ST_SH(sum, block);
+ block += 8;
+ quant_matrix += 8;
+ sad = __msa_hadd_s_w(sum, sum);
+ sum_res += HADD_SW_S32(sad);
+ mask = __msa_clti_s_h(block_org1, 0);
+ zero_mask = __msa_ceqi_h(block_org1, 0);
+ block_neg = - block_org1;
+ block_vec = (v8i16) __msa_bmnz_v((v16u8) block_org1, (v16u8) block_neg,
+ (v16u8) mask);
+ block_vec <<= 1;
+ block_vec += 1;
+ UNPCK_SH_SW(block_vec, block_r, block_l);
+ UNPCK_SH_SW(qscale_vec, qscale_r, qscale_l);
+ UNPCK_SH_SW(quant_m1, quant_m_r, quant_m_l);
+ mul_vec = block_l * qscale_l;
+ mul_vec *= quant_m_l;
+ block_l = mul_vec >> 4;
+ mul_vec = block_r * qscale_r;
+ mul_vec *= quant_m_r;
+ block_r = mul_vec >> 4;
+ mul = __msa_pckev_h((v8i16) block_l, (v8i16) block_r);
+ block_neg = - mul;
+ sum = (v8i16) __msa_bmnz_v((v16u8) mul, (v16u8) block_neg,
+ (v16u8) mask);
+ sum = (v8i16) __msa_bmnz_v((v16u8) sum, (v16u8) block_org1,
+ (v16u8) zero_mask);
+ ST_SH(sum, block);
+
+ block += 8;
+ quant_matrix += 8;
+ sad = __msa_hadd_s_w(sum, sum);
+ sum_res += HADD_SW_S32(sad);
+ mask = __msa_clti_s_h(block_org2, 0);
+ zero_mask = __msa_ceqi_h(block_org2, 0);
+ block_neg = - block_org2;
+ block_vec = (v8i16) __msa_bmnz_v((v16u8) block_org2, (v16u8) block_neg,
+ (v16u8) mask);
+ block_vec <<= 1;
+ block_vec += 1;
+ UNPCK_SH_SW(block_vec, block_r, block_l);
+ UNPCK_SH_SW(qscale_vec, qscale_r, qscale_l);
+ UNPCK_SH_SW(quant_m2, quant_m_r, quant_m_l);
+ mul_vec = block_l * qscale_l;
+ mul_vec *= quant_m_l;
+ block_l = mul_vec >> 4;
+ mul_vec = block_r * qscale_r;
+ mul_vec *= quant_m_r;
+ block_r = mul_vec >> 4;
+ mul = __msa_pckev_h((v8i16) block_l, (v8i16) block_r);
+ block_neg = - mul;
+ sum = (v8i16) __msa_bmnz_v((v16u8) mul, (v16u8) block_neg,
+ (v16u8) mask);
+ sum = (v8i16) __msa_bmnz_v((v16u8) sum, (v16u8) block_org2,
+ (v16u8) zero_mask);
+ ST_SH(sum, block);
+
+ block += 8;
+ quant_matrix += 8;
+ sad = __msa_hadd_s_w(sum, sum);
+ sum_res += HADD_SW_S32(sad);
+ mask = __msa_clti_s_h(block_org3, 0);
+ zero_mask = __msa_ceqi_h(block_org3, 0);
+ block_neg = - block_org3;
+ block_vec = (v8i16) __msa_bmnz_v((v16u8) block_org3, (v16u8) block_neg,
+ (v16u8) mask);
+ block_vec <<= 1;
+ block_vec += 1;
+ UNPCK_SH_SW(block_vec, block_r, block_l);
+ UNPCK_SH_SW(qscale_vec, qscale_r, qscale_l);
+ UNPCK_SH_SW(quant_m3, quant_m_r, quant_m_l);
+ mul_vec = block_l * qscale_l;
+ mul_vec *= quant_m_l;
+ block_l = mul_vec >> 4;
+ mul_vec = block_r * qscale_r;
+ mul_vec *= quant_m_r;
+ block_r = mul_vec >> 4;
+ mul = __msa_pckev_h((v8i16) block_l, (v8i16) block_r);
+ block_neg = - mul;
+ sum = (v8i16) __msa_bmnz_v((v16u8) mul, (v16u8) block_neg,
+ (v16u8) mask);
+ sum = (v8i16) __msa_bmnz_v((v16u8) sum, (v16u8) block_org3,
+ (v16u8) zero_mask);
+ ST_SH(sum, block);
+
+ block += 8;
+ quant_matrix += 8;
+ sad = __msa_hadd_s_w(sum, sum);
+ sum_res += HADD_SW_S32(sad);
+ }
+
+ return sum_res;
+}
+
+void ff_dct_unquantize_h263_intra_msa(MpegEncContext *s,
+ int16_t *block, int32_t index,
+ int32_t qscale)
+{
+ int32_t qmul, qadd;
+ int32_t nCoeffs;
+
+ av_assert2(s->block_last_index[index] >= 0 || s->h263_aic);
+
+ qmul = qscale << 1;
+
+ if (!s->h263_aic) {
+ block[0] *= index < 4 ? s->y_dc_scale : s->c_dc_scale;
+ qadd = (qscale - 1) | 1;
+ } else {
+ qadd = 0;
+ }
+ if (s->ac_pred)
+ nCoeffs = 63;
+ else
+ nCoeffs = s->inter_scantable.raster_end[s->block_last_index[index]];
+
+ h263_dct_unquantize_msa(block, qmul, qadd, nCoeffs, 1);
+}
+
+void ff_dct_unquantize_h263_inter_msa(MpegEncContext *s,
+ int16_t *block, int32_t index,
+ int32_t qscale)
+{
+ int32_t qmul, qadd;
+ int32_t nCoeffs;
+
+ av_assert2(s->block_last_index[index] >= 0);
+
+ qadd = (qscale - 1) | 1;
+ qmul = qscale << 1;
+
+ nCoeffs = s->inter_scantable.raster_end[s->block_last_index[index]];
+
+ h263_dct_unquantize_msa(block, qmul, qadd, nCoeffs, 0);
+}
+
+void ff_dct_unquantize_mpeg2_inter_msa(MpegEncContext *s,
+ int16_t *block, int32_t index,
+ int32_t qscale)
+{
+ const uint16_t *quant_matrix;
+ int32_t sum = -1;
+
+ quant_matrix = s->inter_matrix;
+
+ sum = mpeg2_dct_unquantize_inter_msa(block, qscale, quant_matrix);
+
+ block[63] ^= sum & 1;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_init_mips.c
new file mode 100644
index 00000000000..9bfe94e4cdc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_init_mips.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/bit_depth_template.c"
+#include "h263dsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void mpegvideoencdsp_init_msa(MpegvideoEncDSPContext *c,
+ AVCodecContext *avctx)
+{
+#if BIT_DEPTH == 8
+ c->pix_sum = ff_pix_sum_msa;
+#endif
+}
+#endif // #if HAVE_MSA
+
+av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c,
+ AVCodecContext *avctx)
+{
+#if HAVE_MSA
+ mpegvideoencdsp_init_msa(c, avctx);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c
new file mode 100644
index 00000000000..46473dafe5e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "h263dsp_mips.h"
+#include "libavutil/mips/generic_macros_msa.h"
+
+static int32_t sum_u8src_16width_msa(uint8_t *src, int32_t stride)
+{
+ uint32_t sum = 0;
+ v16u8 in0, in1, in2, in3, in4, in5, in6, in7;
+ v16u8 in8, in9, in10, in11, in12, in13, in14, in15;
+
+ LD_UB8(src, stride, in0, in1, in2, in3, in4, in5, in6, in7);
+ src += (8 * stride);
+ LD_UB8(src, stride, in8, in9, in10, in11, in12, in13, in14, in15);
+
+ HADD_UB4_UB(in0, in1, in2, in3, in0, in1, in2, in3);
+ HADD_UB4_UB(in4, in5, in6, in7, in4, in5, in6, in7);
+ HADD_UB4_UB(in8, in9, in10, in11, in8, in9, in10, in11);
+ HADD_UB4_UB(in12, in13, in14, in15, in12, in13, in14, in15);
+
+ sum = HADD_UH_U32(in0);
+ sum += HADD_UH_U32(in1);
+ sum += HADD_UH_U32(in2);
+ sum += HADD_UH_U32(in3);
+ sum += HADD_UH_U32(in4);
+ sum += HADD_UH_U32(in5);
+ sum += HADD_UH_U32(in6);
+ sum += HADD_UH_U32(in7);
+ sum += HADD_UH_U32(in8);
+ sum += HADD_UH_U32(in9);
+ sum += HADD_UH_U32(in10);
+ sum += HADD_UH_U32(in11);
+ sum += HADD_UH_U32(in12);
+ sum += HADD_UH_U32(in13);
+ sum += HADD_UH_U32(in14);
+ sum += HADD_UH_U32(in15);
+
+ return sum;
+}
+
+int ff_pix_sum_msa(uint8_t *pix, int line_size)
+{
+ return sum_u8src_16width_msa(pix, line_size);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_init_mips.c
new file mode 100644
index 00000000000..1b3741ea768
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_init_mips.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "pixblockdsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
+ AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ c->diff_pixels = ff_diff_pixels_msa;
+
+ switch (avctx->bits_per_raw_sample) {
+ case 9:
+ case 10:
+ case 12:
+ case 14:
+ c->get_pixels = ff_get_pixels_16_msa;
+ break;
+ default:
+ if (avctx->bits_per_raw_sample <= 8 || avctx->codec_type !=
+ AVMEDIA_TYPE_VIDEO) {
+ c->get_pixels = ff_get_pixels_8_msa;
+ }
+ break;
+ }
+}
+#endif // #if HAVE_MSA
+
+#if HAVE_MMI
+static av_cold void pixblockdsp_init_mmi(PixblockDSPContext *c,
+ AVCodecContext *avctx, unsigned high_bit_depth)
+{
+ c->diff_pixels = ff_diff_pixels_mmi;
+
+ if (!high_bit_depth || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
+ c->get_pixels = ff_get_pixels_8_mmi;
+ }
+}
+#endif /* HAVE_MMI */
+
+void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+#if HAVE_MSA
+ pixblockdsp_init_msa(c, avctx, high_bit_depth);
+#endif // #if HAVE_MSA
+#if HAVE_MMI
+ pixblockdsp_init_mmi(c, avctx, high_bit_depth);
+#endif /* HAVE_MMI */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mips.h
new file mode 100644
index 00000000000..7f8cc96683d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mips.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ * Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_PIXBLOCKDSP_MIPS_H
+#define AVCODEC_MIPS_PIXBLOCKDSP_MIPS_H
+
+#include "../mpegvideo.h"
+
+void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1,
+ const uint8_t *src2, int stride);
+void ff_get_pixels_16_msa(int16_t *restrict dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_get_pixels_8_msa(int16_t *restrict dst, const uint8_t *src,
+ ptrdiff_t stride);
+
+void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
+ ptrdiff_t line_size);
+void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1,
+ const uint8_t *src2, int stride);
+
+#endif // #ifndef AVCODEC_MIPS_PIXBLOCKDSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mmi.c
new file mode 100644
index 00000000000..30631d8035c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_mmi.c
@@ -0,0 +1,79 @@
+/*
+ * Loongson SIMD optimized pixblockdsp
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "pixblockdsp_mips.h"
+
+void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
+ ptrdiff_t line_size)
+{
+ __asm__ volatile (
+ "move $8, $0 \n\t"
+ "xor $f0, $f0, $f0 \n\t"
+ "1: \n\t"
+ "gsldlc1 $f2, 7(%1) \n\t"
+ "gsldrc1 $f2, 0(%1) \n\t"
+ "punpcklbh $f4, $f2, $f0 \n\t"
+ "punpckhbh $f6, $f2, $f0 \n\t"
+ "gssdxc1 $f4, 0(%0, $8) \n\t"
+ "gssdxc1 $f6, 8(%0, $8) \n\t"
+ "daddiu $8, $8, 16 \n\t"
+ "daddu %1, %1, %2 \n\t"
+ "daddi %3, %3, -1 \n\t"
+ "bnez %3, 1b \n\t"
+ ::"r"((uint8_t *)block),"r"(pixels),"r"(line_size),"r"(8)
+ : "$8","memory"
+ );
+}
+
+void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1,
+ const uint8_t *src2, int stride)
+{
+ __asm__ volatile (
+ "dli $2, 8 \n\t"
+ "xor $f14, $f14, $f14 \n\t"
+ "1: \n\t"
+ "gsldlc1 $f0, 7(%1) \n\t"
+ "gsldrc1 $f0, 0(%1) \n\t"
+ "or $f2, $f0, $f0 \n\t"
+ "gsldlc1 $f4, 7(%2) \n\t"
+ "gsldrc1 $f4, 0(%2) \n\t"
+ "or $f6, $f4, $f4 \n\t"
+ "punpcklbh $f0, $f0, $f14 \n\t"
+ "punpckhbh $f2, $f2, $f14 \n\t"
+ "punpcklbh $f4, $f4, $f14 \n\t"
+ "punpckhbh $f6, $f6, $f14 \n\t"
+ "psubh $f0, $f0, $f4 \n\t"
+ "psubh $f2, $f2, $f6 \n\t"
+ "gssdlc1 $f0, 7(%0) \n\t"
+ "gssdrc1 $f0, 0(%0) \n\t"
+ "gssdlc1 $f2, 15(%0) \n\t"
+ "gssdrc1 $f2, 8(%0) \n\t"
+ "daddi %0, %0, 16 \n\t"
+ "daddu %1, %1, %3 \n\t"
+ "daddu %2, %2, %3 \n\t"
+ "daddi $2, $2, -1 \n\t"
+ "bgtz $2, 1b \n\t"
+ ::"r"(block),"r"(src1),"r"(src2),"r"(stride)
+ : "$2","memory"
+ );
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_msa.c
new file mode 100644
index 00000000000..966e11a7f58
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/pixblockdsp_msa.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "pixblockdsp_mips.h"
+
+static void diff_pixels_msa(int16_t *block, const uint8_t *src1,
+ const uint8_t *src2, int32_t stride)
+{
+ v16u8 in10, in11, in12, in13, in14, in15, in16, in17;
+ v16u8 in20, in21, in22, in23, in24, in25, in26, in27;
+ v8i16 out0, out1, out2, out3, out4, out5, out6, out7;
+
+ LD_UB8(src1, stride, in10, in11, in12, in13, in14, in15, in16, in17);
+ LD_UB8(src2, stride, in20, in21, in22, in23, in24, in25, in26, in27);
+ ILVR_B4_SH(in10, in20, in11, in21, in12, in22, in13, in23,
+ out0, out1, out2, out3);
+ ILVR_B4_SH(in14, in24, in15, in25, in16, in26, in17, in27,
+ out4, out5, out6, out7);
+ HSUB_UB4_SH(out0, out1, out2, out3, out0, out1, out2, out3);
+ HSUB_UB4_SH(out4, out5, out6, out7, out4, out5, out6, out7);
+ ST_SH8(out0, out1, out2, out3, out4, out5, out6, out7, block, 8);
+}
+
+static void copy_8bit_to_16bit_width8_msa(const uint8_t *src, int32_t src_stride,
+ int16_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t *dst_ptr;
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3;
+ v16i8 zero = { 0 };
+
+ dst_ptr = (uint8_t *) dst;
+
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ ILVR_B4_UB(zero, src0, zero, src1, zero, src2, zero, src3,
+ src0, src1, src2, src3);
+
+ ST_UB4(src0, src1, src2, src3, dst_ptr, (dst_stride * 2));
+ dst_ptr += (4 * 2 * dst_stride);
+ }
+}
+
+static void copy_16multx8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height, int32_t width)
+{
+ int32_t cnt, loop_cnt;
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src_tmp, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src_tmp += (8 * src_stride);
+
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst_tmp, dst_stride);
+ dst_tmp += (8 * dst_stride);
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void copy_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst, dst_stride);
+ dst += (8 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 16);
+ } else if (0 == height % 4) {
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
+
+void ff_get_pixels_16_msa(int16_t *av_restrict dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ copy_width16_msa(src, stride, (uint8_t *) dest, 16, 8);
+}
+
+void ff_get_pixels_8_msa(int16_t *av_restrict dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ copy_8bit_to_16bit_width8_msa(src, stride, dest, 8, 8);
+}
+
+void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1,
+ const uint8_t *src2, int stride)
+{
+ diff_pixels_msa(block, src1, src2, stride);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_init_mips.c
new file mode 100644
index 00000000000..140e8f89c9c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_init_mips.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "qpeldsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void qpeldsp_init_msa(QpelDSPContext *c)
+{
+ c->put_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
+ c->put_qpel_pixels_tab[0][1] = ff_horiz_mc_qpel_aver_src0_16width_msa;
+ c->put_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_16width_msa;
+ c->put_qpel_pixels_tab[0][3] = ff_horiz_mc_qpel_aver_src1_16width_msa;
+ c->put_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_aver_src0_16x16_msa;
+ c->put_qpel_pixels_tab[0][5] = ff_hv_mc_qpel_aver_hv_src00_16x16_msa;
+ c->put_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_aver_v_src0_16x16_msa;
+ c->put_qpel_pixels_tab[0][7] = ff_hv_mc_qpel_aver_hv_src10_16x16_msa;
+ c->put_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_16x16_msa;
+ c->put_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_aver_h_src0_16x16_msa;
+ c->put_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_16x16_msa;
+ c->put_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_aver_h_src1_16x16_msa;
+ c->put_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_aver_src1_16x16_msa;
+ c->put_qpel_pixels_tab[0][13] = ff_hv_mc_qpel_aver_hv_src01_16x16_msa;
+ c->put_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_aver_v_src1_16x16_msa;
+ c->put_qpel_pixels_tab[0][15] = ff_hv_mc_qpel_aver_hv_src11_16x16_msa;
+
+ c->put_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
+ c->put_qpel_pixels_tab[1][1] = ff_horiz_mc_qpel_aver_src0_8width_msa;
+ c->put_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_8width_msa;
+ c->put_qpel_pixels_tab[1][3] = ff_horiz_mc_qpel_aver_src1_8width_msa;
+ c->put_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_aver_src0_8x8_msa;
+ c->put_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_aver_hv_src00_8x8_msa;
+ c->put_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_aver_v_src0_8x8_msa;
+ c->put_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_aver_hv_src10_8x8_msa;
+ c->put_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_8x8_msa;
+ c->put_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_aver_h_src0_8x8_msa;
+ c->put_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_8x8_msa;
+ c->put_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_aver_h_src1_8x8_msa;
+ c->put_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_aver_src1_8x8_msa;
+ c->put_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_aver_hv_src01_8x8_msa;
+ c->put_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_aver_v_src1_8x8_msa;
+ c->put_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_aver_hv_src11_8x8_msa;
+
+ c->put_no_rnd_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][1] =
+ ff_horiz_mc_qpel_no_rnd_aver_src0_16width_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_no_rnd_16width_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][3] =
+ ff_horiz_mc_qpel_no_rnd_aver_src1_16width_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][4] =
+ ff_vert_mc_qpel_no_rnd_aver_src0_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][5] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][6] =
+ ff_hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][7] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_no_rnd_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][9] =
+ ff_hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_no_rnd_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][11] =
+ ff_hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][12] =
+ ff_vert_mc_qpel_no_rnd_aver_src1_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][13] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][14] =
+ ff_hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa;
+ c->put_no_rnd_qpel_pixels_tab[0][15] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa;
+
+ c->put_no_rnd_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][1] =
+ ff_horiz_mc_qpel_no_rnd_aver_src0_8width_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_no_rnd_8width_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][3] =
+ ff_horiz_mc_qpel_no_rnd_aver_src1_8width_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][4] =
+ ff_vert_mc_qpel_no_rnd_aver_src0_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][5] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][6] =
+ ff_hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][7] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_no_rnd_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][9] =
+ ff_hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_no_rnd_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][11] =
+ ff_hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][12] =
+ ff_vert_mc_qpel_no_rnd_aver_src1_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][13] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][14] =
+ ff_hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa;
+ c->put_no_rnd_qpel_pixels_tab[1][15] =
+ ff_hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa;
+
+ c->avg_qpel_pixels_tab[0][0] = ff_avg_width16_msa;
+ c->avg_qpel_pixels_tab[0][1] =
+ ff_horiz_mc_qpel_avg_dst_aver_src0_16width_msa;
+ c->avg_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_avg_dst_16width_msa;
+ c->avg_qpel_pixels_tab[0][3] =
+ ff_horiz_mc_qpel_avg_dst_aver_src1_16width_msa;
+ c->avg_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_avg_dst_aver_src0_16x16_msa;
+ c->avg_qpel_pixels_tab[0][5] =
+ ff_hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa;
+ c->avg_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa;
+ c->avg_qpel_pixels_tab[0][7] =
+ ff_hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa;
+ c->avg_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_avg_dst_16x16_msa;
+ c->avg_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa;
+ c->avg_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_avg_dst_16x16_msa;
+ c->avg_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa;
+ c->avg_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_avg_dst_aver_src1_16x16_msa;
+ c->avg_qpel_pixels_tab[0][13] =
+ ff_hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa;
+ c->avg_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa;
+ c->avg_qpel_pixels_tab[0][15] =
+ ff_hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa;
+
+ c->avg_qpel_pixels_tab[1][0] = ff_avg_width8_msa;
+ c->avg_qpel_pixels_tab[1][1] =
+ ff_horiz_mc_qpel_avg_dst_aver_src0_8width_msa;
+ c->avg_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_avg_dst_8width_msa;
+ c->avg_qpel_pixels_tab[1][3] =
+ ff_horiz_mc_qpel_avg_dst_aver_src1_8width_msa;
+ c->avg_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_avg_dst_aver_src0_8x8_msa;
+ c->avg_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa;
+ c->avg_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa;
+ c->avg_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa;
+ c->avg_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_avg_dst_8x8_msa;
+ c->avg_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa;
+ c->avg_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_avg_dst_8x8_msa;
+ c->avg_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa;
+ c->avg_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_avg_dst_aver_src1_8x8_msa;
+ c->avg_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa;
+ c->avg_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa;
+ c->avg_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa;
+}
+#endif // #if HAVE_MSA
+
+void ff_qpeldsp_init_mips(QpelDSPContext *c)
+{
+#if HAVE_MSA
+ qpeldsp_init_msa(c);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_mips.h
new file mode 100644
index 00000000000..704d221331f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_mips.h
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_QPELDSP_MIPS_H
+#define AVCODEC_MIPS_QPELDSP_MIPS_H
+
+#include "../mpegvideo.h"
+
+void ff_copy_8x8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
+void ff_copy_16x16_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
+void ff_avg_width8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
+void ff_avg_width16_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
+
+void ff_horiz_mc_qpel_aver_src0_8width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_aver_src0_16width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_8width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_16width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_aver_src1_8width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_aver_src1_16width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_aver_src0_8width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_aver_src0_16width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_8width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_16width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_aver_src1_8width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_no_rnd_aver_src1_16width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_aver_src0_8width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_aver_src0_16width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_8width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_16width_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_aver_src1_8width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_horiz_mc_qpel_avg_dst_aver_src1_16width_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+
+void ff_vert_mc_qpel_aver_src0_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_aver_src0_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_aver_src1_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_aver_src1_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_aver_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_aver_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_aver_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_no_rnd_aver_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_aver_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_aver_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_aver_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_vert_mc_qpel_avg_dst_aver_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+
+void ff_hv_mc_qpel_aver_hv_src00_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src00_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_v_src0_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_v_src0_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src10_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src10_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_h_src0_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_h_src0_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_8x8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_h_src1_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_h_src1_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src01_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src01_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_v_src1_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_v_src1_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src11_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_aver_hv_src11_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_16x16_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_8x8_msa(uint8_t *dst, const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+void ff_hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa(uint8_t *dst,
+ const uint8_t *src,
+ ptrdiff_t stride);
+
+#endif // #ifndef AVCODEC_MIPS_QPELDSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_msa.c
new file mode 100644
index 00000000000..4710b3f7329
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/qpeldsp_msa.c
@@ -0,0 +1,6518 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "qpeldsp_mips.h"
+
+#define APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask, coef0, coef1, coef2) \
+( { \
+ v16u8 out, tmp0, tmp1; \
+ v16u8 data0, data1, data2, data3, data4, data5; \
+ v8i16 res_r, res_l; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l; \
+ \
+ VSHF_B2_UB(inp0, inp0, inp1, inp1, mask, mask, tmp0, tmp1); \
+ ILVRL_B2_UH(inp1, inp0, sum0_r, sum0_l); \
+ data0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 15); \
+ data3 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 1); \
+ HADD_UB2_UH(sum0_r, sum0_l, sum0_r, sum0_l); \
+ ILVRL_B2_UH(data3, data0, sum1_r, sum1_l); \
+ data1 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 14); \
+ data4 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 2); \
+ sum0_r *= (v8u16) (coef0); \
+ sum0_l *= (v8u16) (coef0); \
+ ILVRL_B2_UH(data4, data1, sum2_r, sum2_l); \
+ data2 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 13); \
+ data5 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 3); \
+ DPADD_UB2_UH(sum2_r, sum2_l, coef2, coef2, sum0_r, sum0_l); \
+ ILVRL_B2_UH(data5, data2, sum3_r, sum3_l); \
+ HADD_UB2_UH(sum3_r, sum3_l, sum3_r, sum3_l); \
+ DPADD_UB2_UH(sum1_r, sum1_l, coef1, coef1, sum3_r, sum3_l); \
+ res_r = (v8i16) (sum0_r - sum3_r); \
+ res_l = (v8i16) (sum0_l - sum3_l); \
+ SRARI_H2_SH(res_r, res_l, 5); \
+ CLIP_SH2_0_255(res_r, res_l); \
+ out = (v16u8) __msa_pckev_b((v16i8) res_l, (v16i8) res_r); \
+ \
+ out; \
+} )
+
+#define APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, \
+ mask0, mask1, mask2, mask3, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 out; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum4_r, sum5_r, sum6_r, sum7_r; \
+ v8i16 res0_r, res1_r; \
+ \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask0, mask0, sum0_r, sum4_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask3, mask3, sum3_r, sum7_r); \
+ HADD_UB2_UH(sum3_r, sum7_r, sum3_r, sum7_r); \
+ DOTP_UB2_UH(sum0_r, sum4_r, coef0, coef0, sum0_r, sum4_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask2, mask2, sum2_r, sum6_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask1, mask1, sum1_r, sum5_r); \
+ DPADD_UB2_UH(sum2_r, sum6_r, coef2, coef2, sum0_r, sum4_r); \
+ DPADD_UB2_UH(sum1_r, sum5_r, coef1, coef1, sum3_r, sum7_r); \
+ res0_r = (v8i16) (sum0_r - sum3_r); \
+ res1_r = (v8i16) (sum4_r - sum7_r); \
+ SRARI_H2_SH(res0_r, res1_r, 5); \
+ CLIP_SH2_0_255(res0_r, res1_r); \
+ out = (v16u8) __msa_pckev_b((v16i8) res1_r, (v16i8) res0_r); \
+ \
+ out; \
+} )
+
+#define APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, \
+ mask0, mask1, mask2, mask3, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 out; \
+ v8i16 res0_r; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ \
+ VSHF_B2_UH(inp0, inp0, inp0, inp0, mask0, mask3, sum0_r, sum3_r); \
+ sum3_r = __msa_hadd_u_h((v16u8) sum3_r, (v16u8) sum3_r); \
+ sum0_r = __msa_dotp_u_h((v16u8) sum0_r, (v16u8) coef0); \
+ VSHF_B2_UH(inp0, inp0, inp0, inp0, mask2, mask1, sum2_r, sum1_r); \
+ DPADD_UB2_UH(sum2_r, sum1_r, coef2, coef1, sum0_r, sum3_r); \
+ res0_r = (v8i16) (sum0_r - sum3_r); \
+ res0_r = __msa_srari_h(res0_r, 5); \
+ res0_r = CLIP_SH_0_255(res0_r); \
+ out = (v16u8) __msa_pckev_b((v16i8) res0_r, (v16i8) res0_r); \
+ \
+ out; \
+} )
+
+#define APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1, \
+ mask2, mask3, coef0, \
+ coef1, coef2) \
+( { \
+ v16u8 out; \
+ v8i16 res0_r; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ \
+ VSHF_B2_UH(inp0, inp0, inp0, inp0, mask0, mask3, sum0_r, sum3_r); \
+ sum3_r = __msa_hadd_u_h((v16u8) sum3_r, (v16u8) sum3_r); \
+ sum0_r = __msa_dotp_u_h((v16u8) sum0_r, (v16u8) coef0); \
+ VSHF_B2_UH(inp0, inp0, inp0, inp0, mask2, mask1, sum2_r, sum1_r); \
+ DPADD_UB2_UH(sum2_r, sum1_r, coef2, coef1, sum0_r, sum3_r); \
+ res0_r = (v8i16) (sum0_r - sum3_r); \
+ res0_r += 15; \
+ res0_r >>= 5; \
+ res0_r = CLIP_SH_0_255(res0_r); \
+ out = (v16u8) __msa_pckev_b((v16i8) res0_r, (v16i8) res0_r); \
+ \
+ out; \
+} )
+
+#define APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 out, tmp0, tmp1; \
+ v16u8 data0, data1, data2, data3, data4, data5; \
+ v8i16 res_r, res_l; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l; \
+ \
+ VSHF_B2_UB(inp0, inp0, inp1, inp1, mask, mask, tmp0, tmp1); \
+ ILVRL_B2_UH(inp1, inp0, sum0_r, sum0_l); \
+ data0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 15); \
+ data3 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 1); \
+ HADD_UB2_UH(sum0_r, sum0_l, sum0_r, sum0_l); \
+ ILVRL_B2_UH(data3, data0, sum1_r, sum1_l); \
+ data1 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 14); \
+ data4 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 2); \
+ sum0_r *= (v8u16) (coef0); \
+ sum0_l *= (v8u16) (coef0); \
+ ILVRL_B2_UH(data4, data1, sum2_r, sum2_l); \
+ data2 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) tmp0, 13); \
+ data5 = (v16u8) __msa_sldi_b((v16i8) tmp1, (v16i8) inp1, 3); \
+ DPADD_UB2_UH(sum2_r, sum2_l, coef2, coef2, sum0_r, sum0_l); \
+ ILVRL_B2_UH(data5, data2, sum3_r, sum3_l); \
+ HADD_UB2_UH(sum3_r, sum3_l, sum3_r, sum3_l); \
+ DPADD_UB2_UH(sum1_r, sum1_l, coef1, coef1, sum3_r, sum3_l); \
+ res_r = (v8i16) (sum0_r - sum3_r); \
+ res_l = (v8i16) (sum0_l - sum3_l); \
+ res_r += 15; \
+ res_l += 15; \
+ res_r >>= 5; \
+ res_l >>= 5; \
+ CLIP_SH2_0_255(res_r, res_l); \
+ out = (v16u8) __msa_pckev_b((v16i8) res_l, (v16i8) res_r); \
+ \
+ out; \
+} )
+
+#define APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, \
+ mask0, mask1, mask2, mask3, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 out; \
+ v8i16 res0_r, res1_r; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum4_r, sum5_r, sum6_r, sum7_r; \
+ \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask0, mask0, sum0_r, sum4_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask3, mask3, sum3_r, sum7_r); \
+ HADD_UB2_UH(sum3_r, sum7_r, sum3_r, sum7_r); \
+ DOTP_UB2_UH(sum0_r, sum4_r, coef0, coef0, sum0_r, sum4_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask2, mask2, sum2_r, sum6_r); \
+ VSHF_B2_UH(inp0, inp0, inp1, inp1, mask1, mask1, sum1_r, sum5_r); \
+ DPADD_UB2_UH(sum2_r, sum6_r, coef2, coef2, sum0_r, sum4_r); \
+ DPADD_UB2_UH(sum1_r, sum5_r, coef1, coef1, sum3_r, sum7_r); \
+ res0_r = (v8i16) (sum0_r - sum3_r); \
+ res1_r = (v8i16) (sum4_r - sum7_r); \
+ res0_r += 15; \
+ res1_r += 15; \
+ res0_r >>= 5; \
+ res1_r >>= 5; \
+ CLIP_SH2_0_255(res0_r, res1_r); \
+ out = (v16u8) __msa_pckev_b((v16i8) res1_r, (v16i8) res0_r); \
+ \
+ out; \
+} )
+
+#define APPLY_VERT_QPEL_FILTER(inp0, inp1, inp2, inp3, \
+ inp4, inp5, inp6, inp7, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 res; \
+ v8i16 res_r, res_l; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l; \
+ \
+ ILVRL_B2_UH(inp4, inp0, sum0_r, sum0_l); \
+ ILVRL_B2_UH(inp7, inp3, sum3_r, sum3_l); \
+ DOTP_UB2_UH(sum0_r, sum0_l, coef0, coef0, sum0_r, sum0_l); \
+ HADD_UB2_UH(sum3_r, sum3_l, sum3_r, sum3_l); \
+ ILVRL_B2_UH(inp6, inp2, sum2_r, sum2_l); \
+ ILVRL_B2_UH(inp5, inp1, sum1_r, sum1_l); \
+ DPADD_UB2_UH(sum2_r, sum2_l, coef2, coef2, sum0_r, sum0_l); \
+ DPADD_UB2_UH(sum1_r, sum1_l, coef1, coef1, sum3_r, sum3_l); \
+ res_r = (v8i16) (sum0_r - sum3_r); \
+ res_l = (v8i16) (sum0_l - sum3_l); \
+ SRARI_H2_SH(res_r, res_l, 5); \
+ CLIP_SH2_0_255(res_r, res_l); \
+ res = (v16u8) __msa_pckev_b((v16i8) res_l, (v16i8) res_r); \
+ \
+ res; \
+} )
+
+#define APPLY_VERT_QPEL_FILTER_8BYTE(inp00, inp01, inp02, inp03, \
+ inp04, inp05, inp06, inp07, \
+ inp10, inp11, inp12, inp13, \
+ inp14, inp15, inp16, inp17, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 res; \
+ v8i16 val0, val1; \
+ v8u16 sum00, sum01, sum02, sum03; \
+ v8u16 sum10, sum11, sum12, sum13; \
+ \
+ ILVR_B4_UH(inp04, inp00, inp14, inp10, inp07, inp03, inp17, inp13, \
+ sum00, sum10, sum03, sum13); \
+ DOTP_UB2_UH(sum00, sum10, coef0, coef0, sum00, sum10); \
+ HADD_UB2_UH(sum03, sum13, sum03, sum13); \
+ ILVR_B4_UH(inp06, inp02, inp16, inp12, inp05, inp01, inp15, inp11, \
+ sum02, sum12, sum01, sum11); \
+ DPADD_UB2_UH(sum02, sum12, coef2, coef2, sum00, sum10); \
+ DPADD_UB2_UH(sum01, sum11, coef1, coef1, sum03, sum13); \
+ val0 = (v8i16) (sum00 - sum03); \
+ val1 = (v8i16) (sum10 - sum13); \
+ SRARI_H2_SH(val0, val1, 5); \
+ CLIP_SH2_0_255(val0, val1); \
+ res = (v16u8) __msa_pckev_b((v16i8) val1, (v16i8) val0); \
+ \
+ res; \
+} )
+
+#define APPLY_VERT_QPEL_NO_ROUND_FILTER(inp0, inp1, inp2, inp3, \
+ inp4, inp5, inp6, inp7, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 res; \
+ v8i16 res_r, res_l; \
+ v8u16 sum0_r, sum1_r, sum2_r, sum3_r; \
+ v8u16 sum0_l, sum1_l, sum2_l, sum3_l; \
+ \
+ ILVRL_B2_UH(inp4, inp0, sum0_r, sum0_l); \
+ ILVRL_B2_UH(inp7, inp3, sum3_r, sum3_l); \
+ DOTP_UB2_UH(sum0_r, sum0_l, coef0, coef0, sum0_r, sum0_l); \
+ HADD_UB2_UH(sum3_r, sum3_l, sum3_r, sum3_l); \
+ ILVRL_B2_UH(inp6, inp2, sum2_r, sum2_l); \
+ ILVRL_B2_UH(inp5, inp1, sum1_r, sum1_l); \
+ DPADD_UB2_UH(sum2_r, sum2_l, coef2, coef2, sum0_r, sum0_l); \
+ DPADD_UB2_UH(sum1_r, sum1_l, coef1, coef1, sum3_r, sum3_l); \
+ res_r = (v8i16) (sum0_r - sum3_r); \
+ res_l = (v8i16) (sum0_l - sum3_l); \
+ res_r += 15; \
+ res_l += 15; \
+ res_r >>= 5; \
+ res_l >>= 5; \
+ CLIP_SH2_0_255(res_r, res_l); \
+ res = (v16u8) __msa_pckev_b((v16i8) res_l, (v16i8) res_r); \
+ \
+ res; \
+} )
+
+#define APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp00, inp01, inp02, inp03, \
+ inp04, inp05, inp06, inp07, \
+ inp10, inp11, inp12, inp13, \
+ inp14, inp15, inp16, inp17, \
+ coef0, coef1, coef2) \
+( { \
+ v16u8 res; \
+ v8i16 val0, val1; \
+ v8u16 sum00, sum01, sum02, sum03; \
+ v8u16 sum10, sum11, sum12, sum13; \
+ \
+ ILVR_B4_UH(inp04, inp00, inp14, inp10, inp07, inp03, inp17, inp13, \
+ sum00, sum10, sum03, sum13); \
+ DOTP_UB2_UH(sum00, sum10, coef0, coef0, sum00, sum10); \
+ HADD_UB2_UH(sum03, sum13, sum03, sum13); \
+ ILVR_B4_UH(inp06, inp02, inp16, inp12, inp05, inp01, inp15, inp11, \
+ sum02, sum12, sum01, sum11); \
+ DPADD_UB2_UH(sum02, sum12, coef2, coef2, sum00, sum10); \
+ DPADD_UB2_UH(sum01, sum11, coef1, coef1, sum03, sum13); \
+ val0 = (v8i16) (sum00 - sum03); \
+ val1 = (v8i16) (sum10 - sum13); \
+ val0 += 15; \
+ val1 += 15; \
+ val0 >>= 5; \
+ val1 >>= 5; \
+ CLIP_SH2_0_255(val0, val1); \
+ res = (v16u8) __msa_pckev_b((v16i8) val1, (v16i8) val0); \
+ \
+ res; \
+} )
+
+static void horiz_mc_qpel_aver_src0_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ AVER_UB2_UB(inp0, res0, inp2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_aver_src0_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp0, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp2, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp4, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp6, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_aver_src1_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ AVER_UB2_UB(inp0, res0, inp2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_aver_src1_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp1);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp5);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp7);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_aver_src0_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ res0 = __msa_ave_u_b(inp0, res0);
+ res1 = __msa_ave_u_b(inp2, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_aver_src0_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp0, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp2, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp4, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp6, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_aver_src1_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ res0 = __msa_ave_u_b(inp0, res0);
+ res1 = __msa_ave_u_b(inp2, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_no_rnd_aver_src1_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp1);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp5);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp7);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_aver_src0_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(inp0, res0, inp2, res1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_aver_src0_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res0, res1;
+ v16u8 dst0, dst1;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(inp0, res0, inp2, res1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(inp4, res0, inp6, res1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res0, res1;
+ v16u8 dst0, dst1;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_aver_src1_8width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 res0, res1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(inp0, res0, inp2, res1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void horiz_mc_qpel_avg_dst_aver_src1_16width_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res0, res1, dst0, dst1;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp1, res1, inp3, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp5, res1, inp7, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst1, res1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+ }
+}
+
+
+static void vert_mc_qpel_aver_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp4, 1, (v2i64) inp5);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp6, 1, (v2i64) inp7);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+}
+
+static void vert_mc_qpel_aver_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp0);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp1);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp2);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ LD_UB2(src, src_stride, inp8, inp9);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp4);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp5);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ LD_UB2(src, src_stride, inp10, inp11);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp6);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp7);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ LD_UB2(src, src_stride, inp12, inp13);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp8);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp9);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ LD_UB2(src, src_stride, inp14, inp15);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp10);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp11);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp12);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp13);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp14);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp15);
+ ST_UB(res0, dst);
+}
+
+static void vert_mc_qpel_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+}
+
+static void vert_mc_qpel_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ inp4 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+}
+
+static void vert_mc_qpel_aver_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp1, 1, (v2i64) inp2);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp3, 1, (v2i64) inp4);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp5, 1, (v2i64) inp6);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp7, 1, (v2i64) inp8);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_aver_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ inp4 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp1);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp2);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp4);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp5);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp6);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp7);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp8);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp9);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp10);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp11);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp12);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp13);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp14);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp15);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(res0, inp16);
+ ST_UB(res0, dst);
+}
+
+static void vert_mc_qpel_no_rnd_aver_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ res0 = __msa_ave_u_b(res0, tmp0);
+ res1 = __msa_ave_u_b(res1, tmp1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp4, 1, (v2i64) inp5);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp6, 1, (v2i64) inp7);
+ res0 = __msa_ave_u_b(res0, tmp0);
+ res1 = __msa_ave_u_b(res1, tmp1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+}
+
+static void vert_mc_qpel_no_rnd_aver_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp0);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp1);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp2);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp4);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp5);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp6);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp7);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp8);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp9);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp10);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp11);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp12);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp13);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp14);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp15);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+}
+
+static void vert_mc_qpel_no_rnd_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+}
+
+static void vert_mc_qpel_no_rnd_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ ST_UB(res0, dst);
+}
+
+static void vert_mc_qpel_no_rnd_aver_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp1, 1, (v2i64) inp2);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp3, 1, (v2i64) inp4);
+ res0 = __msa_ave_u_b(res0, tmp0);
+ res1 = __msa_ave_u_b(res1, tmp1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp5, 1, (v2i64) inp6);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp7, 1, (v2i64) inp8);
+ res0 = __msa_ave_u_b(res0, tmp0);
+ res1 = __msa_ave_u_b(res1, tmp1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_no_rnd_aver_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp1);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp2);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp3);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp4);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp5);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp6);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp7);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp8);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp9);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp10);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp11);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp12);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp13);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp14);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp15);
+ ST_UB(res0, dst);
+ dst += dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ res0 = __msa_ave_u_b(res0, inp16);
+ ST_UB(res0, dst);
+}
+
+static void vert_mc_qpel_avg_dst_aver_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp4, 1, (v2i64) inp5);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp6, 1, (v2i64) inp7);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_avg_dst_aver_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0, res1, dst0, dst1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp0, res1, inp1, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp2, res1, inp3, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp8, inp9);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp4, res1, inp5, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp10, inp11);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp6, res1, inp7, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp12, inp13);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp8, res1, inp9, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp14, inp15);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp10, res1, inp11, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp12, res1, inp13, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp14, res1, inp15, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_avg_dst_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+}
+
+static void vert_mc_qpel_avg_dst_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0, res1, dst0, dst1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_avg_dst_aver_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16u8 tmp0, tmp1, res0, res1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ LD_UB2(src, src_stride, inp4, inp5);
+ src += (2 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp6, inp7);
+ src += (2 * src_stride);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp1, 1, (v2i64) inp2);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp3, 1, (v2i64) inp4);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ inp8 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp8, inp7,
+ inp7, inp6, inp5, inp4,
+ inp8, inp8, inp7, inp6,
+ const20, const6, const3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ tmp0 = (v16u8) __msa_insve_d((v2i64) inp5, 1, (v2i64) inp6);
+ tmp1 = (v16u8) __msa_insve_d((v2i64) inp7, 1, (v2i64) inp8);
+ dst0 = (v16u8) __msa_insve_d((v2i64) dst0, 1, (v2i64) dst1);
+ dst2 = (v16u8) __msa_insve_d((v2i64) dst2, 1, (v2i64) dst3);
+ AVER_UB2_UB(res0, tmp0, res1, tmp1, res0, res1);
+ AVER_UB2_UB(dst0, res0, dst2, res1, res0, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+}
+
+static void vert_mc_qpel_avg_dst_aver_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7, inp8;
+ v16u8 inp9, inp10, inp11, inp12, inp13, inp14, inp15, inp16;
+ v16u8 res0, res1, dst0, dst1;
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB5(src, src_stride, inp0, inp1, inp2, inp3, inp4);
+ src += (5 * src_stride);
+ res0 = APPLY_VERT_QPEL_FILTER(inp0, inp0, inp1, inp2,
+ inp1, inp2, inp3, inp4,
+ const20, const6, const3);
+ inp5 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp1, inp0, inp0, inp1,
+ inp2, inp3, inp4, inp5,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp1, res1, inp2, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp6 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp2, inp1, inp0, inp0,
+ inp3, inp4, inp5, inp6,
+ const20, const6, const3);
+ inp7 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp3, inp2, inp1, inp0,
+ inp4, inp5, inp6, inp7,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp3, res1, inp4, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp8 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp4, inp3, inp2, inp1,
+ inp5, inp6, inp7, inp8,
+ const20, const6, const3);
+ inp9 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp5, inp4, inp3, inp2,
+ inp6, inp7, inp8, inp9,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp5, res1, inp6, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp10 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp6, inp5, inp4, inp3,
+ inp7, inp8, inp9, inp10,
+ const20, const6, const3);
+ inp11 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp7, inp6, inp5, inp4,
+ inp8, inp9, inp10, inp11,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp7, res1, inp8, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp12 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp8, inp7, inp6, inp5,
+ inp9, inp10, inp11, inp12,
+ const20, const6, const3);
+ inp13 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp9, inp8, inp7, inp6,
+ inp10, inp11, inp12, inp13,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp9, res1, inp10, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp14 = LD_UB(src);
+ src += src_stride;
+ res0 = APPLY_VERT_QPEL_FILTER(inp10, inp9, inp8, inp7,
+ inp11, inp12, inp13, inp14,
+ const20, const6, const3);
+ inp15 = LD_UB(src);
+ src += src_stride;
+ res1 = APPLY_VERT_QPEL_FILTER(inp11, inp10, inp9, inp8,
+ inp12, inp13, inp14, inp15,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp11, res1, inp12, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp16 = LD_UB(src);
+ res0 = APPLY_VERT_QPEL_FILTER(inp12, inp11, inp10, inp9,
+ inp13, inp14, inp15, inp16,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp13, inp12, inp11, inp10,
+ inp14, inp15, inp16, inp16,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp13, res1, inp14, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_FILTER(inp14, inp13, inp12, inp11,
+ inp15, inp16, inp16, inp15,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER(inp15, inp14, inp13, inp12,
+ inp16, inp16, inp15, inp14,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ AVER_UB2_UB(res0, inp15, res1, inp16, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst1, res0, res1);
+ ST_UB2(res0, res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_horiz_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp0, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp2, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp4, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp6, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp0, res);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_ave_u_b(avg1, res1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_ave_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_horiz_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_ave_u_b(avg1, res1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_horiz_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp1);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp5);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(res, inp7);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_NO_ROUND_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_ave_u_b(inp1, res);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ horiz6 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_ave_u_b(avg1, res1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_ave_u_b(avg0, res0);
+
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_ave_u_b(avg0, res0);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ horiz6 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_ave_u_b(avg1, res1);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_ave_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_no_rnd_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_no_rnd_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_ave_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_ave_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp0, inp1, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_ave_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_ave_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE(inp2, inp3, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_ave_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_NO_ROUND_FILTER_8BYTE_1ROW(inp0, mask0, mask1,
+ mask2, mask3, const20,
+ const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_ave_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_NO_ROUND_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_ave_u_b(avg0, res0);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_ave_u_b(avg1, res1);
+ ST8x4_UB(res0, res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_horiz_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp0, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp2, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp4, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(inp6, res);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask, const20, const6, const3);
+ res = __msa_aver_u_b(inp0, res);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_aver_hv_src00_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src00_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_aver_u_b(avg1, res1);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_horiz_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask, const20, const6, const3);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_aver_v_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_v_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_aver_u_b(avg1, res1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_horiz_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ int32_t height)
+{
+ uint8_t loop_count;
+ v16u8 inp0, inp1, inp2, inp3, inp4, inp5, inp6, inp7;
+ v16u8 res;
+ v16u8 mask = { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+ v8u16 const20 = (v8u16) __msa_ldi_h(20);
+
+ for (loop_count = (height >> 2); loop_count--;) {
+ LD_UB4(src, src_stride, inp0, inp2, inp4, inp6);
+ LD_UB4((src + 1), src_stride, inp1, inp3, inp5, inp7);
+ src += (4 * src_stride);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp1);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp2, inp3, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp3);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp4, inp5, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp5);
+ ST_UB(res, dst);
+ dst += dst_stride;
+
+ res = APPLY_HORIZ_QPEL_FILTER(inp6, inp7, mask,
+ const20, const6, const3);
+ res = __msa_aver_u_b(res, inp7);
+ ST_UB(res, dst);
+ dst += dst_stride;
+ }
+
+ LD_UB2(src, 1, inp0, inp1);
+ res = APPLY_HORIZ_QPEL_FILTER(inp0, inp1, mask, const20, const6, const3);
+ res = __msa_aver_u_b(inp1, res);
+ ST_UB(res, dst);
+}
+
+static void hv_mc_qpel_aver_hv_src10_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src10_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = __msa_aver_u_b(avg1, res1);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_h_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_h_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_h_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_h_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src01_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src01_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_insve_d((v2i64) horiz1, 1, (v2i64) horiz2);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_insve_d((v2i64) horiz3, 1, (v2i64) horiz4);
+ res1 = __msa_aver_u_b(avg1, res1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_insve_d((v2i64) horiz5, 1, (v2i64) horiz6);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_insve_d((v2i64) horiz7, 1, (v2i64) horiz8);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+}
+
+static void hv_mc_qpel_aver_v_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_v_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_insve_d((v2i64) horiz1, 1, (v2i64) horiz2);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_insve_d((v2i64) horiz3, 1, (v2i64) horiz4);
+ res1 = __msa_aver_u_b(avg1, res1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+ avg0 = (v16u8) __msa_insve_d((v2i64) horiz5, 1, (v2i64) horiz6);
+ res0 = __msa_aver_u_b(avg0, res0);
+
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+ avg1 = (v16u8) __msa_insve_d((v2i64) horiz7, 1, (v2i64) horiz8);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src11_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_aver_hv_src11_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB4(src, src_stride, inp0, inp1, inp2, inp3);
+ src += (4 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_insve_d((v2i64) inp0, 1, (v2i64) inp1);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_aver_u_b(avg0, res0);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_insve_d((v2i64) inp2, 1, (v2i64) inp3);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_aver_u_b(avg0, res0);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += 2 * dst_stride;
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src0_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz1, (v2i64) horiz0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz3, (v2i64) horiz2);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz5, (v2i64) horiz4);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz7, (v2i64) horiz6);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_16x16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_16x16_msa(buff, 16, dst, dst_stride);
+
+}
+
+static void hv_mc_qpel_avg_dst_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src0_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1,
+ horiz5, horiz6, horiz7, horiz8,
+ horiz5, horiz4, horiz3, horiz2,
+ horiz6, horiz7, horiz8, horiz8,
+ const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3,
+ horiz7, horiz8, horiz8, horiz7,
+ horiz7, horiz6, horiz5, horiz4,
+ horiz8, horiz8, horiz7, horiz6,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_aver_u_b(avg0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_aver_u_b(avg1, res1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz2 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ horiz4 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2,
+ horiz1, horiz2, horiz3, horiz4,
+ horiz1, horiz0, horiz0, horiz1,
+ horiz2, horiz3, horiz4, horiz5,
+ const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ horiz6 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0,
+ horiz3, horiz4, horiz5, horiz6,
+ horiz3, horiz2, horiz1, horiz0,
+ horiz4, horiz5, horiz6, horiz7,
+ const20, const6, const3);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ horiz8 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0,
+ mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1, horiz5,
+ horiz6, horiz7, horiz8, horiz5, horiz4,
+ horiz3, horiz2, horiz6, horiz7, horiz8,
+ horiz8, const20, const6, const3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3, horiz7,
+ horiz8, horiz8, horiz7, horiz7, horiz6,
+ horiz5, horiz4, horiz8, horiz8, horiz7,
+ horiz6, const20, const6, const3);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = __msa_aver_u_b(avg0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = __msa_aver_u_b(avg1, res1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t buff[272];
+
+ hv_mc_qpel_aver_horiz_src1_16x16_msa(src, src_stride, buff, 16, 16);
+ vert_mc_qpel_avg_dst_aver_src1_16x16_msa(buff, 16, dst, dst_stride);
+}
+
+static void hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v16u8 inp0, inp1, inp2, inp3;
+ v16u8 res0, res1, avg0, avg1;
+ v16u8 horiz0, horiz1, horiz2, horiz3;
+ v16u8 horiz4, horiz5, horiz6, horiz7, horiz8;
+ v16u8 dst0, dst1;
+ v16u8 mask0 = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
+ v16u8 mask1 = { 0, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 8 };
+ v16u8 mask2 = { 1, 3, 0, 4, 0, 5, 1, 6, 2, 7, 3, 8, 4, 8, 5, 7 };
+ v16u8 mask3 = { 2, 4, 1, 5, 0, 6, 0, 7, 1, 8, 2, 8, 3, 7, 4, 6 };
+ v16u8 const20 = (v16u8) __msa_ldi_b(20);
+ v16u8 const6 = (v16u8) __msa_ldi_b(6);
+ v16u8 const3 = (v16u8) __msa_ldi_b(3);
+
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz0 = __msa_aver_u_b(inp0, res0);
+ horiz1 = (v16u8) __msa_splati_d((v2i64) horiz0, 1);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ LD_UB2(src, src_stride, inp0, inp1);
+ src += (2 * src_stride);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz2 = __msa_aver_u_b(inp2, res1);
+ horiz3 = (v16u8) __msa_splati_d((v2i64) horiz2, 1);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp0, inp1, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp0, inp1, inp0, inp1, inp0, inp1, 1);
+
+ inp0 = (v16u8) __msa_ilvr_d((v2i64) inp1, (v2i64) inp0);
+ horiz4 = __msa_aver_u_b(inp0, res0);
+ horiz5 = (v16u8) __msa_splati_d((v2i64) horiz4, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz2, (v2i64) horiz1);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz0, horiz0, horiz1, horiz2, horiz1,
+ horiz2, horiz3, horiz4, horiz1, horiz0,
+ horiz0, horiz1, horiz2, horiz3, horiz4,
+ horiz5, const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(src, src_stride, inp2, inp3);
+ src += (2 * src_stride);
+ res1 = APPLY_HORIZ_QPEL_FILTER_8BYTE(inp2, inp3, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ SLDI_B2_UB(inp2, inp3, inp2, inp3, inp2, inp3, 1);
+
+ inp2 = (v16u8) __msa_ilvr_d((v2i64) inp3, (v2i64) inp2);
+ horiz6 = __msa_aver_u_b(inp2, res1);
+ horiz7 = (v16u8) __msa_splati_d((v2i64) horiz6, 1);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz4, (v2i64) horiz3);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz2, horiz1, horiz0, horiz0, horiz3,
+ horiz4, horiz5, horiz6, horiz3, horiz2,
+ horiz1, horiz0, horiz4, horiz5, horiz6,
+ horiz7, const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ inp0 = LD_UB(src);
+ res0 = APPLY_HORIZ_QPEL_FILTER_8BYTE_1ROW(inp0, mask0, mask1, mask2, mask3,
+ const20, const6, const3);
+ inp0 = (v16u8) __msa_sldi_b((v16i8) inp0, (v16i8) inp0, 1);
+ horiz8 = __msa_aver_u_b(inp0, res0);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) horiz6, (v2i64) horiz5);
+ res0 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz4, horiz3, horiz2, horiz1, horiz5,
+ horiz6, horiz7, horiz8, horiz5, horiz4,
+ horiz3, horiz2, horiz6, horiz7, horiz8,
+ horiz8, const20, const6, const3);
+ res0 = __msa_aver_u_b(avg0, res0);
+ avg0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res0 = __msa_aver_u_b(avg0, res0);
+ ST8x2_UB(res0, dst, dst_stride);
+ dst += (2 * dst_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) horiz8, (v2i64) horiz7);
+ res1 = APPLY_VERT_QPEL_FILTER_8BYTE(horiz6, horiz5, horiz4, horiz3, horiz7,
+ horiz8, horiz8, horiz7, horiz7, horiz6,
+ horiz5, horiz4, horiz8, horiz8, horiz7,
+ horiz6, const20, const6, const3);
+ res1 = __msa_aver_u_b(avg1, res1);
+ avg1 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ res1 = __msa_aver_u_b(avg1, res1);
+ ST8x2_UB(res1, dst, dst_stride);
+}
+
+static void copy_8x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ uint64_t src0, src1;
+ int32_t loop_cnt;
+
+ for (loop_cnt = 4; loop_cnt--;) {
+ src0 = LD(src);
+ src += src_stride;
+ src1 = LD(src);
+ src += src_stride;
+
+ SD(src0, dst);
+ dst += dst_stride;
+ SD(src1, dst);
+ dst += dst_stride;
+ }
+}
+
+static void copy_16x16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride)
+{
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
+
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ LD_UB8(src, src_stride,
+ src8, src9, src10, src11, src12, src13, src14, src15);
+
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride);
+ dst += (8 * dst_stride);
+ ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15,
+ dst, dst_stride);
+}
+
+static void avg_width8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3;
+ v16u8 src0, src1, src2, src3;
+ v16u8 dst0, dst1, dst2, dst3;
+
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+
+ out0 = __msa_copy_u_d((v2i64) dst0, 0);
+ out1 = __msa_copy_u_d((v2i64) dst1, 0);
+ out2 = __msa_copy_u_d((v2i64) dst2, 0);
+ out3 = __msa_copy_u_d((v2i64) dst3, 0);
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void avg_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+
+ for (cnt = (height / 8); cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+ AVER_UB4_UB(src4, dst4, src5, dst5, src6, dst6, src7, dst7,
+ dst4, dst5, dst6, dst7);
+ ST_UB8(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst, dst_stride);
+ dst += (8 * dst_stride);
+ }
+}
+
+void ff_copy_16x16_msa(uint8_t *dest, const uint8_t *src, ptrdiff_t stride)
+{
+ copy_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_copy_8x8_msa(uint8_t *dest, const uint8_t *src, ptrdiff_t stride)
+{
+ copy_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_horiz_mc_qpel_aver_src0_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_aver_src0_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_aver_src0_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_aver_src0_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_8width_msa(uint8_t *dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_16width_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ horiz_mc_qpel_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_aver_src1_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_aver_src1_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_aver_src1_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_aver_src1_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_no_rnd_aver_src0_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_aver_src0_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_no_rnd_aver_src0_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_aver_src0_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_no_rnd_8width_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_no_rnd_16width_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_no_rnd_aver_src1_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_aver_src1_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_no_rnd_aver_src1_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_no_rnd_aver_src1_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_avg_width8_msa(uint8_t *dest, const uint8_t *src, ptrdiff_t stride)
+{
+ avg_width8_msa(src, stride, dest, stride, 8);
+}
+
+void ff_avg_width16_msa(uint8_t *dest, const uint8_t *src, ptrdiff_t stride)
+{
+ avg_width16_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_avg_dst_aver_src0_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_aver_src0_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_avg_dst_aver_src0_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_aver_src0_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_avg_dst_8width_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_avg_dst_16width_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_16width_msa(src, stride, dest, stride, 16);
+}
+
+void ff_horiz_mc_qpel_avg_dst_aver_src1_8width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_aver_src1_8width_msa(src, stride, dest, stride, 8);
+}
+
+void ff_horiz_mc_qpel_avg_dst_aver_src1_16width_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ horiz_mc_qpel_avg_dst_aver_src1_16width_msa(src, stride, dest, stride, 16);
+}
+
+
+void ff_vert_mc_qpel_aver_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_aver_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_aver_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_aver_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_8x8_msa(uint8_t *dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_16x16_msa(uint8_t *dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_aver_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_aver_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_aver_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_aver_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_aver_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_aver_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_aver_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_aver_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_aver_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_aver_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_no_rnd_aver_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_no_rnd_aver_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_aver_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_aver_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_aver_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_aver_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_aver_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_aver_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_vert_mc_qpel_avg_dst_aver_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ vert_mc_qpel_avg_dst_aver_src1_16x16_msa(src, stride, dest, stride);
+}
+
+/* HV cases */
+void ff_hv_mc_qpel_aver_hv_src00_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src00_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src00_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src00_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_v_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_v_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_v_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_v_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src10_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src10_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src10_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src10_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_h_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_h_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_h_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_h_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_16x16_msa(uint8_t *dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_8x8_msa(uint8_t *dest, const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_h_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_h_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_h_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_h_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src01_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src01_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src01_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src01_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_v_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_v_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_v_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_v_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src11_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src11_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_aver_hv_src11_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_aver_hv_src11_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_16x16_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_8x8_msa(uint8_t *dest,
+ const uint8_t *src, ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa(src, stride, dest, stride);
+}
+
+void ff_hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa(uint8_t *dest,
+ const uint8_t *src,
+ ptrdiff_t stride)
+{
+ hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa(src, stride, dest, stride);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/sbrdsp_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/sbrdsp_mips.c
index 63361e4e1be..c2030955480 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/sbrdsp_mips.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/sbrdsp_mips.c
@@ -438,7 +438,6 @@ static void sbr_qmf_deint_bfly_mips(float *v, const float *src0, const float *sr
}
}
-#if !HAVE_LOONGSON3
static void sbr_autocorrelate_mips(const float x[40][2], float phi[3][2][2])
{
int i;
@@ -607,7 +606,6 @@ static void sbr_autocorrelate_mips(const float x[40][2], float phi[3][2][2])
: "memory"
);
}
-#endif /* !HAVE_LOONGSON3 */
static void sbr_hf_gen_mips(float (*X_high)[2], const float (*X_low)[2],
const float alpha0[2], const float alpha1[2],
@@ -896,9 +894,7 @@ void ff_sbrdsp_init_mips(SBRDSPContext *s)
s->sum64x5 = sbr_sum64x5_mips;
s->sum_square = sbr_sum_square_mips;
s->qmf_deint_bfly = sbr_qmf_deint_bfly_mips;
-#if !HAVE_LOONGSON3
s->autocorrelate = sbr_autocorrelate_mips;
-#endif /* !HAVE_LOONGSON3 */
s->hf_gen = sbr_hf_gen_mips;
s->hf_g_filt = sbr_hf_g_filt_mips;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_mmi.c
new file mode 100644
index 00000000000..628e13f7d21
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_mmi.c
@@ -0,0 +1,816 @@
+/*
+ * Loongson SIMD optimized simple idct
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ * Zhang Shuangshuang <zhangshuangshuang@ict.ac.cn>
+ *
+ * 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 "idctdsp_mips.h"
+#include "constants.h"
+
+#define C0 23170 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C2 21407 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C3 19266 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C4 16383 //cos(i*M_PI/16)*sqrt(2)*(1<<14) - 0.5
+#define C5 12873 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C6 8867 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+#define C7 4520 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
+
+#define ROW_SHIFT 11
+#define COL_SHIFT 20
+
+DECLARE_ALIGNED(8, static const int16_t, coeffs)[]= {
+ 1<<(ROW_SHIFT-1), 0, 1<<(ROW_SHIFT-1), 0,
+ 1<<(ROW_SHIFT-1), 1, 1<<(ROW_SHIFT-1), 0,
+ C4, C4, C4, C4,
+ C4, -C4, C4, -C4,
+ C2, C6, C2, C6,
+ C6, -C2, C6, -C2,
+ C1, C3, C1, C3,
+ C5, C7, C5, C7,
+ C3, -C7, C3, -C7,
+ -C1, -C5, -C1, -C5,
+ C5, -C1, C5, -C1,
+ C7, C3, C7, C3,
+ C7, -C5, C7, -C5,
+ C3, -C1, C3, -C1
+};
+
+void ff_simple_idct_mmi(int16_t *block)
+{
+ DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
+ int16_t * const temp= (int16_t*)align_tmp;
+
+ __asm__ volatile (
+#undef DC_COND_IDCT
+#define DC_COND_IDCT(src0, src4, src1, src5, dst, rounder, rarg, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "ldc1 $f8, %3 \n\t" \
+ "and $f8, $f8, $f0 \n\t" \
+ "or $f8, $f8, $f2 \n\t" \
+ "or $f8, $f8, $f4 \n\t" \
+ "or $f8, $f8, $f6 \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" \
+ "li $11, " #shift " \n\t" \
+ "mfc1 $10, $f8 \n\t" \
+ "mtc1 $11, $f18 \n\t" \
+ "beqz $10, 1f \n\t" \
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "ldc1 $f16, " #rarg " \n\t" \
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ #rounder " $f8, $f8, $f16 \n\t" \
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "ldc1 $f10, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "ldc1 $f16, " #rarg " \n\t" \
+ "pmaddhw $f10, $f10, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ #rounder " $f0, $f0, $f16 \n\t" \
+ "paddw $f2, $f2, $f0 \n\t" /* A1 a1 */\
+ "ldc1 $f16, 64(%2) \n\t" \
+ "paddw $f0, $f0, $f0 \n\t" \
+ "psubw $f0, $f0, $f2 \n\t" /* A2 a2 */\
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "paddw $f14, $f14, $f10 \n\t" /* B0 b0 */\
+ "ldc1 $f10, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "pmaddhw $f10, $f10, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "paddw $f10, $f10, $f4 \n\t" /* B1 b1 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f2 \n\t" /* A1 a1 */\
+ "paddw $f2, $f2, $f10 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f10 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f14, $f14, $f2 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
+ "packsswh $f4, $f4, $f8 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
+ "sdc1 $f14, " #dst " \n\t" \
+ "ldc1 $f2, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "sdc1 $f4, 24+" #dst " \n\t" \
+ "pmaddhw $f8, $f8, $f2 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "ldc1 $f14, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "pmaddhw $f2, $f2, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "pmaddhw $f14, $f14, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A2 a2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f8, $f8, $f14 \n\t" /* B2 b2 */\
+ "paddw $f4, $f4, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f0, $f0, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f0, $f0, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f6, $f6, $f2 \n\t" /* B3 b3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "packsswh $f4, $f4, $f12 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
+ "sdc1 $f4, 8+" #dst " \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f8, $f8, $f0 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
+ "sdc1 $f8, 16+" #dst " \n\t" \
+ "b 2f \n\t" \
+ "1: \n\t" \
+ "li $10, 16 \n\t" \
+ "mtc1 $10, $f16 \n\t" \
+ "psllw $f0, $f0, $f16 \n\t" \
+ "ldc1 $f16, %4 \n\t" \
+ "paddw $f0, $f0, $f16 \n\t" \
+ "li $10, 13 \n\t" \
+ "mtc1 $10, $f16 \n\t" \
+ "psraw $f0, $f0, $f16 \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" \
+ "sdc1 $f0, " #dst " \n\t" \
+ "sdc1 $f0, 8+" #dst " \n\t" \
+ "sdc1 $f0, 16+" #dst " \n\t" \
+ "sdc1 $f0, 24+" #dst " \n\t" \
+ "2: \n\t"
+
+#undef Z_COND_IDCT
+#define Z_COND_IDCT(src0, src4, src1, src5, dst, rounder, rarg, shift, bt) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "mov.d $f8, $f0 \n\t" \
+ "or $f8, $f8, $f2 \n\t" \
+ "or $f8, $f8, $f4 \n\t" \
+ "or $f8, $f8, $f6 \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" \
+ "mfc1 $10, $f8 \n\t" \
+ "beqz $10, " #bt " \n\t" \
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "ldc1 $f16, " #rarg " \n\t" \
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ #rounder " $f8, $f8, $f16 \n\t" \
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "ldc1 $f10, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "ldc1 $f16, " #rarg " \n\t" \
+ "pmaddhw $f10, $f10, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ #rounder " $f0, $f0, $f16 \n\t" \
+ "paddw $f2, $f2, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f0 \n\t" \
+ "ldc1 $f16, 64(%2) \n\t" \
+ "psubw $f0, $f0, $f2 \n\t" /* A2 a2 */\
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "paddw $f14, $f14, $f10 \n\t" /* B0 b0 */\
+ "ldc1 $f10, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "pmaddhw $f10, $f10, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "li $10, " #shift " \n\t" \
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "mtc1 $10, $f18 \n\t" \
+ "paddw $f10, $f10, $f4 \n\t" /* B1 b1 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f2 \n\t" /* A1 a1 */\
+ "paddw $f2, $f2, $f10 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f10 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f14, $f14, $f2 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
+ "packsswh $f4, $f4, $f8 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
+ "sdc1 $f14, " #dst " \n\t" \
+ "ldc1 $f2, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "sdc1 $f4, 24+" #dst " \n\t" \
+ "pmaddhw $f8, $f8, $f2 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "ldc1 $f14, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "pmaddhw $f2, $f2, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "pmaddhw $f14, $f14, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A2 a2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f8, $f8, $f14 \n\t" /* B2 b2 */\
+ "paddw $f4, $f4, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f0, $f0, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f0, $f0, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f6, $f6, $f2 \n\t" /* B3 b3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "packsswh $f4, $f4, $f12 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
+ "sdc1 $f4, 8+" #dst " \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f8, $f8, $f0 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
+ "sdc1 $f8, 16+" #dst " \n\t" \
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+ DC_COND_IDCT(0(%0), 8(%0), 16(%0), 24(%0), 0(%1), paddw,8(%2), 11)
+ Z_COND_IDCT(32(%0), 40(%0), 48(%0), 56(%0), 32(%1), paddw,(%2), 11, 4f)
+ Z_COND_IDCT(64(%0), 72(%0), 80(%0), 88(%0), 64(%1), paddw,(%2), 11, 2f)
+ Z_COND_IDCT(96(%0),104(%0),112(%0),120(%0), 96(%1), paddw,(%2), 11, 1f)
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1 a1 */\
+ "psubw $f10, $f10, $f2 \n\t" /* A2 a2 */\
+ "ldc1 $f2, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "ldc1 $f16, 64(%2) \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "li $10, " #shift " \n\t" \
+ "paddw $f14, $f14, $f2 \n\t" /* B0 b0 */\
+ "ldc1 $f2, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "mtc1 $10, $f18 \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "paddw $f2, $f2, $f4 \n\t" /* B1 b1 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f2 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f14, $f14, $f14 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f14, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f4, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f0, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "ldc1 $f14, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "pmaddhw $f0, $f0, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "pmaddhw $f14, $f14, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "mov.d $f4, $f10 \n\t" /* A2 a2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f8, $f8, $f14 \n\t" /* B2 b2 */\
+ "paddw $f4, $f4, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f6, $f6, $f0 \n\t" /* B3 b3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A2+B2 a2+b2 */\
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f4, 32+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "swc1 $f8, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "4: \n\t"
+ Z_COND_IDCT(64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddw,(%2), 11, 6f)
+ Z_COND_IDCT(96(%0),104(%0),112(%0),120(%0), 96(%1),paddw,(%2), 11, 5f)
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1 a1 */\
+ "psubw $f10, $f10, $f2 \n\t" /* A2 a2 */\
+ "ldc1 $f2, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "li $10, " #shift " \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ "ldc1 $f14, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "mtc1 $10, $f18 \n\t" \
+ "pmaddhw $f14, $f14, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f2, $f2, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f2 \n\t" /* A0-B0 a0-b0 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f14 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f14 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f2, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f4, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f2, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "mov.d $f4, $f10 \n\t" /* A2 a2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f4, $f4, $f2 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f2 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f2, $f12 \n\t" /* A3 a3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f2, $f2, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f2, $f2, $f18 \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A2+B2 a2+b2 */\
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f4, 32+" #dst " \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "swc1 $f2, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "6: \n\t"
+ Z_COND_IDCT(96(%0),104(%0),112(%0),120(%0), 96(%1),paddw,(%2), 11, 7f)
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f2, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ "ldc1 $f14, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "li $10, " #shift " \n\t" \
+ "pmaddhw $f14, $f14, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f2, $f2, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "mtc1 $10, $f18 \n\t" \
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f2 \n\t" /* A0-B0 a0-b0 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f14 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f14 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f2, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f4, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f2, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "mov.d $f4, $f10 \n\t" /* A2 a2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f4, $f4, $f2 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f2 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f2, $f12 \n\t" /* A3 a3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f2, $f2, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f2, $f2, $f18 \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A2+B2 a2+b2 */\
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f4, 32+" #dst " \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "swc1 $f2, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "2: \n\t"
+ Z_COND_IDCT(96(%0),104(%0),112(%0),120(%0), 96(%1),paddw,(%2), 11, 3f)
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f6, " #src5 " \n\t" /* R7 R5 r7 r5 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f2, 56(%2) \n\t" /* C7 C5 C7 C5 */\
+ "pmaddhw $f2, $f2, $f6 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
+ "ldc1 $f16, 64(%2) \n\t" \
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "paddw $f14, $f14, $f2 \n\t" /* B0 b0 */\
+ "ldc1 $f2, 72(%2) \n\t" /* -C5 -C1 -C5 -C1 */\
+ "li $10, " #shift " \n\t" \
+ "pmaddhw $f2, $f2, $f6 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "mtc1 $10, $f18 \n\t" \
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "paddw $f2, $f2, $f4 \n\t" /* B1 b1 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f4, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f4, $f4, $f2 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f14, $f14, $f14 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f14, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f4, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f0, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "ldc1 $f14, 88(%2) \n\t" /* C3 C7 C3 C7 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "pmaddhw $f0, $f0, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "pmaddhw $f14, $f14, $f6 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
+ "mov.d $f4, $f10 \n\t" /* A2 a2 */\
+ "ldc1 $f16, 104(%2) \n\t" \
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
+ "paddw $f8, $f8, $f14 \n\t" /* B2 b2 */\
+ "paddw $f4, $f4, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f4, $f4, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f6, $f6, $f0 \n\t" /* B3 b3 */\
+ "paddw $f12, $f12, $f6 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f6 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f4, $f4, $f4 \n\t" /* A2+B2 a2+b2 */\
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f4, 32+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "swc1 $f8, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "3: \n\t"
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f6, 64(%2) \n\t" \
+ "pmaddhw $f6, $f6, $f4 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "li $10, " #shift " \n\t" \
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "mtc1 $10, $f18 \n\t" \
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f2, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f6 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f2, $f2, $f6 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f2, $f2, $f18 \n\t" \
+ "packsswh $f14, $f14, $f14 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f14, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f2, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "pmaddhw $f8, $f8, $f4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "mov.d $f2, $f10 \n\t" /* A2 a2 */\
+ "paddw $f2, $f2, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f12, $f12, $f4 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f4 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f2, $f2, $f2 \n\t" /* A2+B2 a2+b2 */\
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f2, 32+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "swc1 $f8, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "5: \n\t"
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1 a1 */\
+ "psubw $f10, $f10, $f2 \n\t" /* A2 a2 */\
+ "ldc1 $f4, 8+" #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f6, 8+" #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f2, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f2, $f2, $f4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f4, $f4, $f14 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f14, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "ldc1 $f16, 40(%2) \n\t" \
+ "pmaddhw $f14, $f14, $f6 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "pmaddhw $f6, $f6, $f16 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "paddw $f14, $f14, $f2 \n\t" /* A0 a0 */\
+ "paddw $f2, $f2, $f2 \n\t" /* 2C0 2c0 */\
+ "psubw $f2, $f2, $f14 \n\t" /* A3 a3 */\
+ "li $10, " #shift " \n\t" \
+ "paddw $f6, $f6, $f4 \n\t" /* A1 a1 */\
+ "mtc1 $10, $f18 \n\t" \
+ "paddw $f4, $f4, $f4 \n\t" /* 2C1 2c1 */\
+ "psubw $f4, $f4, $f6 \n\t" /* A2 a2 */\
+ "psraw $f8, $f8, $f18 \n\t" \
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f6, $f6, $f18 \n\t" \
+ "packsswh $f8, $f8, $f14 \n\t" /* A0 a0 */\
+ "sdc1 $f8, " #dst " \n\t" \
+ "psraw $f0, $f0, $f18 \n\t" \
+ "packsswh $f0, $f0, $f6 \n\t" /* A1 a1 */\
+ "sdc1 $f0, 16+" #dst " \n\t" \
+ "sdc1 $f0, 96+" #dst " \n\t" \
+ "sdc1 $f8, 112+" #dst " \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "psraw $f12, $f12, $f18 \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f10, $f10, $f4 \n\t" /* A2-B2 a2-b2 */\
+ "sdc1 $f10, 32+" #dst " \n\t" \
+ "psraw $f2, $f2, $f18 \n\t" \
+ "packsswh $f12, $f12, $f2 \n\t" /* A3+B3 a3+b3 */\
+ "sdc1 $f12, 48+" #dst " \n\t" \
+ "sdc1 $f12, 64+" #dst " \n\t" \
+ "sdc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "1: \n\t"
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, " #src4 " \n\t" /* R6 R2 r6 r2 */\
+ "ldc1 $f4, " #src1 " \n\t" /* R3 R1 r3 r1 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "li $10, " #shift " \n\t" \
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "mtc1 $10, $f18 \n\t" \
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f10, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "pmaddhw $f10, $f10, $f2 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
+ "ldc1 $f12, 40(%2) \n\t" /* -C2 C6 -C2 C6 */\
+ "pmaddhw $f2, $f2, $f12 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
+ "mov.d $f12, $f8 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 48(%2) \n\t" /* C3 C1 C3 C1 */\
+ "pmaddhw $f14, $f14, $f4 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
+ "paddw $f8, $f8, $f10 \n\t" /* A0 a0 */\
+ "psubw $f12, $f12, $f10 \n\t" /* A3 a3 */\
+ "mov.d $f10, $f0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1 a1 */\
+ "psubw $f10, $f10, $f2 \n\t" /* A2 a2 */\
+ "ldc1 $f2, 64(%2) \n\t" \
+ "pmaddhw $f2, $f2, $f4 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
+ "paddw $f14, $f14, $f8 \n\t" /* A0+B0 a0+b0 */\
+ "paddw $f8, $f8, $f8 \n\t" /* 2A0 2a0 */\
+ "psubw $f8, $f8, $f14 \n\t" /* A0-B0 a0-b0 */\
+ "psraw $f14, $f14, $f18 \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "mov.d $f6, $f0 \n\t" /* A1 a1 */\
+ "paddw $f0, $f0, $f2 \n\t" /* A1+B1 a1+b1 */\
+ "psubw $f6, $f6, $f2 \n\t" /* A1-B1 a1-b1 */\
+ "psraw $f0, $f0, $f18 \n\t" \
+ "psraw $f6, $f6, $f18 \n\t" \
+ "packsswh $f14, $f14, $f14 \n\t" /* A0+B0 a0+b0 */\
+ "swc1 $f14, " #dst " \n\t" \
+ "packsswh $f0, $f0, $f0 \n\t" /* A1+B1 a1+b1 */\
+ "swc1 $f0, 16+" #dst " \n\t" \
+ "packsswh $f6, $f6, $f6 \n\t" /* A1-B1 a1-b1 */\
+ "swc1 $f6, 96+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A0-B0 a0-b0 */\
+ "swc1 $f8, 112+" #dst " \n\t" \
+ "ldc1 $f8, 80(%2) \n\t" /* -C1 C5 -C1 C5 */\
+ "ldc1 $f16, 96(%2) \n\t" \
+ "pmaddhw $f8, $f8, $f4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
+ "pmaddhw $f4, $f4, $f16 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
+ "mov.d $f6, $f10 \n\t" /* A2 a2 */\
+ "paddw $f6, $f6, $f8 \n\t" /* A2+B2 a2+b2 */\
+ "psubw $f10, $f10, $f8 \n\t" /* a2-B2 a2-b2 */\
+ "psraw $f6, $f6, $f18 \n\t" \
+ "psraw $f10, $f10, $f18 \n\t" \
+ "mov.d $f8, $f12 \n\t" /* A3 a3 */\
+ "paddw $f12, $f12, $f4 \n\t" /* A3+B3 a3+b3 */\
+ "psubw $f8, $f8, $f4 \n\t" /* a3-B3 a3-b3 */\
+ "psraw $f12, $f12, $f18 \n\t" \
+ "packsswh $f6, $f6, $f6 \n\t" /* A2+B2 a2+b2 */\
+ "swc1 $f6, 32+" #dst " \n\t" \
+ "psraw $f8, $f8, $f18 \n\t" \
+ "packsswh $f12, $f12, $f12 \n\t" /* A3+B3 a3+b3 */\
+ "swc1 $f12, 48+" #dst " \n\t" \
+ "packsswh $f8, $f8, $f8 \n\t" /* A3-B3 a3-b3 */\
+ "packsswh $f10, $f10, $f10 \n\t" /* A2-B2 a2-b2 */\
+ "swc1 $f8, 64+" #dst " \n\t" \
+ "swc1 $f10, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+ IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
+ "b 9f \n\t"
+
+ "# .p2align 4 \n\t"
+ "7: \n\t"
+
+#undef IDCT
+#define IDCT(src0, src4, src1, src5, dst, shift) \
+ "ldc1 $f0, " #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f8, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "li $10, " #shift " \n\t" \
+ "pmaddhw $f8, $f8, $f0 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "mtc1 $10, $f18 \n\t" \
+ "ldc1 $f10, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f0, $f0, $f10 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "psraw $f8, $f8, $f18 \n\t" \
+ "psraw $f0, $f0, $f18 \n\t" \
+ "ldc1 $f4, 8+" #src0 " \n\t" /* R4 R0 r4 r0 */\
+ "ldc1 $f2, 16(%2) \n\t" /* C4 C4 C4 C4 */\
+ "pmaddhw $f2, $f2, $f4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
+ "ldc1 $f14, 24(%2) \n\t" /* -C4 C4 -C4 C4 */\
+ "pmaddhw $f4, $f4, $f14 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
+ "ldc1 $f14, 32(%2) \n\t" /* C6 C2 C6 C2 */\
+ "psraw $f2, $f2, $f18 \n\t" \
+ "packsswh $f8, $f8, $f2 \n\t" /* A0 a0 */\
+ "sdc1 $f8, " #dst " \n\t" \
+ "psraw $f4, $f4, $f18 \n\t" \
+ "packsswh $f0, $f0, $f4 \n\t" /* A1 a1 */\
+ "sdc1 $f0, 16+" #dst " \n\t" \
+ "sdc1 $f0, 96+" #dst " \n\t" \
+ "sdc1 $f8, 112+" #dst " \n\t" \
+ "sdc1 $f0, 32+" #dst " \n\t" \
+ "sdc1 $f8, 48+" #dst " \n\t" \
+ "sdc1 $f8, 64+" #dst " \n\t" \
+ "sdc1 $f0, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, shift)
+ IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
+ IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
+
+ "9: \n\t"
+ ::"r"(block),"r"(temp),"r"(coeffs),"m"(ff_wm1010),"m"(ff_d40000)
+ : "$10","$11"
+ );
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_msa.c
new file mode 100644
index 00000000000..bd8b31012f7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/simple_idct_msa.c
@@ -0,0 +1,573 @@
+/*
+ * Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/mips/generic_macros_msa.h"
+#include "idctdsp_mips.h"
+
+static void simple_idct_msa(int16_t *block)
+{
+ int32_t const_val;
+ v8i16 weights = { 0, 22725, 21407, 19266, 16383, 12873, 8867, 4520 };
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v8i16 w1, w3, w5, w7;
+ v8i16 const0, const1, const2, const3, const4, const5, const6, const7;
+ v4i32 temp0_r, temp1_r, temp2_r, temp3_r;
+ v4i32 temp0_l, temp1_l, temp2_l, temp3_l;
+ v4i32 a0_r, a1_r, a2_r, a3_r, a0_l, a1_l, a2_l, a3_l;
+ v4i32 b0_r, b1_r, b2_r, b3_r, b0_l, b1_l, b2_l, b3_l;
+ v4i32 w2, w4, w6;
+ v8i16 select_vec, temp;
+ v8i16 zero = { 0 };
+ v4i32 const_val0 = __msa_ldi_w(1);
+ v4i32 const_val1 = __msa_ldi_w(1);
+
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ const_val0 <<= 10;
+ const_val = 16383 * ((1 << 19) / 16383);
+ const_val1 = __msa_insert_w(const_val0, 0, const_val);
+ const_val1 = __msa_splati_w(const_val1, 0);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ select_vec = in1 | in2 | in3 | in4 | in5 | in6 | in7;
+ select_vec = __msa_clti_u_h((v8u16) select_vec, 1);
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ temp = in0 << 3;
+ w2 = (v4i32) __msa_splati_h(weights, 2);
+ w2 = (v4i32) __msa_ilvr_h(zero, (v8i16) w2);
+ w4 = (v4i32) __msa_splati_h(weights, 4);
+ w4 = (v4i32) __msa_ilvr_h(zero, (v8i16) w4);
+ w6 = (v4i32) __msa_splati_h(weights, 6);
+ w6 = (v4i32) __msa_ilvr_h(zero, (v8i16) w6);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val0, a0_l, const_val0, temp0_r, temp0_l);
+ MUL4(w2, temp3_r, w2, temp3_l, w6, temp3_r, w6, temp3_l,
+ temp1_r, temp1_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ UNPCK_SH_SW(in4, temp0_r, temp0_l);
+ UNPCK_SH_SW(in6, temp3_r, temp3_l);
+ MUL2(temp0_r, w4, temp0_l, w4, temp0_r, temp0_l);
+ MUL4(w2, temp3_r, w2, temp3_l, w6, temp3_r, w6, temp3_l,
+ temp2_r, temp2_l, temp1_r, temp1_l);
+ ADD2(a0_r, temp0_r, a0_l, temp0_l, a0_r, a0_l);
+ SUB4(a1_r, temp0_r, a1_l, temp0_l, a2_r, temp0_r, a2_l, temp0_l,
+ a1_r, a1_l, a2_r, a2_l);
+ ADD4(a3_r, temp0_r, a3_l, temp0_l, a0_r, temp1_r, a0_l, temp1_l,
+ a3_r, a3_l, a0_r, a0_l);
+ SUB2(a1_r, temp2_r, a1_l, temp2_l, a1_r, a1_l);
+ ADD2(a2_r, temp2_r, a2_l, temp2_l, a2_r, a2_l);
+ SUB2(a3_r, temp1_r, a3_l, temp1_l, a3_r, a3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ SPLATI_H4_SH(weights, 1, 3, 5, 7, w1, w3, w5, w7);
+ ILVRL_H2_SW(in5, in7, temp0_r, temp0_l);
+ ILVR_H4_SH(w1, w3, w3, -w7, w5, -w1, w7, -w5,
+ const0, const1, const2, const3);
+ ILVR_H2_SH(w5, w7, w7, w3, const4, const6);
+ const5 = __msa_ilvod_h(-w1, -w5);
+ const7 = __msa_ilvod_h(w3, -w1);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp0_r, temp0_r, temp0_r, temp0_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ DPADD_SH4_SW(temp0_l, temp0_l, temp0_l, temp0_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 11);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 11);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r,
+ temp2_l, temp2_r, temp3_l, temp3_r,
+ temp0_r, temp1_r, temp2_r, temp3_r);
+ in0 = (v8i16) __msa_bmnz_v((v16u8) temp0_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in1 = (v8i16) __msa_bmnz_v((v16u8) temp1_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in2 = (v8i16) __msa_bmnz_v((v16u8) temp2_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in3 = (v8i16) __msa_bmnz_v((v16u8) temp3_r, (v16u8) temp,
+ (v16u8) select_vec);
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 11);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 11);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ in4 = (v8i16) __msa_bmnz_v((v16u8) a3_r, (v16u8) temp, (v16u8) select_vec);
+ in5 = (v8i16) __msa_bmnz_v((v16u8) a2_r, (v16u8) temp, (v16u8) select_vec);
+ in6 = (v8i16) __msa_bmnz_v((v16u8) a1_r, (v16u8) temp, (v16u8) select_vec);
+ in7 = (v8i16) __msa_bmnz_v((v16u8) a0_r, (v16u8) temp, (v16u8) select_vec);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ w2 = (v4i32) __msa_splati_h(weights, 2);
+ w2 = (v4i32) __msa_ilvr_h(zero, (v8i16) w2);
+ w4 = (v4i32) __msa_splati_h(weights, 4);
+ w4 = (v4i32) __msa_ilvr_h(zero, (v8i16) w4);
+ w6 = (v4i32) __msa_splati_h(weights, 6);
+ w6 = (v4i32) __msa_ilvr_h(zero, (v8i16) w6);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val1, a0_l, const_val1, temp0_r, temp0_l);
+ MUL4(w2, temp3_r, w2, temp3_l, w6, temp3_r, w6, temp3_l,
+ temp1_r, temp1_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ UNPCK_SH_SW(in4, temp0_r, temp0_l);
+ UNPCK_SH_SW(in6, temp3_r, temp3_l);
+ MUL2(temp0_r, w4, temp0_l, w4, temp0_r, temp0_l);
+ MUL4(w2, temp3_r, w2, temp3_l, w6, temp3_r, w6, temp3_l,
+ temp2_r, temp2_l, temp1_r, temp1_l);
+ ADD2(a0_r, temp0_r, a0_l, temp0_l, a0_r, a0_l);
+ SUB4(a1_r, temp0_r, a1_l, temp0_l, a2_r, temp0_r, a2_l, temp0_l,
+ a1_r, a1_l, a2_r, a2_l);
+ ADD4(a3_r, temp0_r, a3_l, temp0_l, a0_r, temp1_r, a0_l, temp1_l,
+ a3_r, a3_l, a0_r, a0_l);
+ SUB2(a1_r, temp2_r, a1_l, temp2_l, a1_r, a1_l);
+ ADD2(a2_r, temp2_r, a2_l, temp2_l, a2_r, a2_l);
+ SUB2(a3_r, temp1_r, a3_l, temp1_l, a3_r, a3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ SPLATI_H4_SH(weights, 1, 3, 5, 7, w1, w3, w5, w7);
+ ILVR_H4_SH(w1, w3, w3, -w7, w5, -w1, w7, -w5,
+ const0, const1, const2, const3);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ ILVRL_H2_SW(in5, in7, temp0_r, temp0_l);
+ ILVR_H2_SH(w5, w7, w7, w3, const4, const6);
+ const5 = __msa_ilvod_h(-w1, -w5);
+ const7 = __msa_ilvod_h(w3, -w1);
+ DPADD_SH4_SW(temp0_r, temp0_r, temp0_r, temp0_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp0_l, temp0_l, temp0_l, temp0_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 20);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 20);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r, temp2_l, temp2_r,
+ temp3_l, temp3_r, temp0_r, temp1_r, temp2_r, temp3_r);
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 20);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 20);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ ST_SW8(temp0_r, temp1_r, temp2_r, temp3_r, a3_r, a2_r, a1_r, a0_r,
+ block, 8);
+}
+
+static void simple_idct_put_msa(uint8_t *dst, int32_t dst_stride,
+ int16_t *block)
+{
+ int32_t const_val;
+ uint64_t tmp0, tmp1, tmp2, tmp3;
+ v8i16 weights = { 0, 22725, 21407, 19266, 16383, 12873, 8867, 4520 };
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v8i16 w1, w3, w5, w7;
+ v8i16 const0, const1, const2, const3, const4, const5, const6, const7;
+ v4i32 temp0_r, temp1_r, temp2_r, temp3_r;
+ v4i32 temp0_l, temp1_l, temp2_l, temp3_l;
+ v4i32 a0_r, a1_r, a2_r, a3_r, a0_l, a1_l, a2_l, a3_l;
+ v4i32 b0_r, b1_r, b2_r, b3_r, b0_l, b1_l, b2_l, b3_l;
+ v4i32 w2, w4, w6;
+ v8i16 select_vec, temp;
+ v8i16 zero = { 0 };
+ v4i32 const_val0 = __msa_ldi_w(1);
+ v4i32 const_val1 = __msa_ldi_w(1);
+
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ const_val0 <<= 10;
+ const_val = 16383 * ((1 << 19) / 16383);
+ const_val1 = __msa_insert_w(const_val0, 0, const_val);
+ const_val1 = __msa_splati_w(const_val1, 0);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ select_vec = in1 | in2 | in3 | in4 | in5 | in6 | in7;
+ select_vec = __msa_clti_u_h((v8u16) select_vec, 1);
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ temp = in0 << 3;
+ w2 = (v4i32) __msa_splati_h(weights, 2);
+ w2 = (v4i32) __msa_ilvr_h(zero, (v8i16) w2);
+ w4 = (v4i32) __msa_splati_h(weights, 4);
+ w4 = (v4i32) __msa_ilvr_h(zero, (v8i16) w4);
+ w6 = (v4i32) __msa_splati_h(weights, 6);
+ w6 = (v4i32) __msa_ilvr_h(zero, (v8i16) w6);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val0, a0_l, const_val0, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp1_r, temp1_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ UNPCK_SH_SW(in4, temp0_r, temp0_l);
+ UNPCK_SH_SW(in6, temp3_r, temp3_l);
+ MUL2(temp0_r, w4, temp0_l, w4, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp2_r, temp2_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp1_r, temp1_l);
+ ADD2(a0_r, temp0_r, a0_l, temp0_l, a0_r, a0_l);
+ SUB2(a1_r, temp0_r, a1_l, temp0_l, a1_r, a1_l);
+ SUB2(a2_r, temp0_r, a2_l, temp0_l, a2_r, a2_l);
+ ADD2(a3_r, temp0_r, a3_l, temp0_l, a3_r, a3_l);
+ ADD2(a0_r, temp1_r, a0_l, temp1_l, a0_r, a0_l);
+ SUB2(a1_r, temp2_r, a1_l, temp2_l, a1_r, a1_l);
+ ADD2(a2_r, temp2_r, a2_l, temp2_l, a2_r, a2_l);
+ SUB2(a3_r, temp1_r, a3_l, temp1_l, a3_r, a3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ SPLATI_H4_SH(weights, 1, 3, 5, 7, w1, w3, w5, w7);
+ ILVRL_H2_SW(in5, in7, temp0_r, temp0_l);
+ ILVR_H4_SH(w1, w3, w3, -w7, w5, -w1, w7, -w5,
+ const0, const1, const2, const3);
+ ILVR_H2_SH(w5, w7, w7, w3, const4, const6);
+ const5 = __msa_ilvod_h(-w1, -w5);
+ const7 = __msa_ilvod_h(w3, -w1);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp0_r, temp0_r, temp0_r, temp0_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ DPADD_SH4_SW(temp0_l, temp0_l, temp0_l, temp0_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 11);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 11);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r,
+ temp2_l, temp2_r, temp3_l, temp3_r,
+ temp0_r, temp1_r, temp2_r, temp3_r);
+ in0 = (v8i16) __msa_bmnz_v((v16u8) temp0_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in1 = (v8i16) __msa_bmnz_v((v16u8) temp1_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in2 = (v8i16) __msa_bmnz_v((v16u8) temp2_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in3 = (v8i16) __msa_bmnz_v((v16u8) temp3_r, (v16u8) temp,
+ (v16u8) select_vec);
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 11);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 11);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ in4 = (v8i16) __msa_bmnz_v((v16u8) a3_r, (v16u8) temp, (v16u8) select_vec);
+ in5 = (v8i16) __msa_bmnz_v((v16u8) a2_r, (v16u8) temp, (v16u8) select_vec);
+ in6 = (v8i16) __msa_bmnz_v((v16u8) a1_r, (v16u8) temp, (v16u8) select_vec);
+ in7 = (v8i16) __msa_bmnz_v((v16u8) a0_r, (v16u8) temp, (v16u8) select_vec);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ w2 = (v4i32) __msa_splati_h(weights, 2);
+ w2 = (v4i32) __msa_ilvr_h(zero, (v8i16) w2);
+ w4 = (v4i32) __msa_splati_h(weights, 4);
+ w4 = (v4i32) __msa_ilvr_h(zero, (v8i16) w4);
+ w6 = (v4i32) __msa_splati_h(weights, 6);
+ w6 = (v4i32) __msa_ilvr_h(zero, (v8i16) w6);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val1, a0_l, const_val1, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp1_r, temp1_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ UNPCK_SH_SW(in4, temp0_r, temp0_l);
+ UNPCK_SH_SW(in6, temp3_r, temp3_l);
+ MUL2(temp0_r, w4, temp0_l, w4, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp2_r, temp2_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp1_r, temp1_l);
+ ADD2(a0_r, temp0_r, a0_l, temp0_l, a0_r, a0_l);
+ SUB2(a1_r, temp0_r, a1_l, temp0_l, a1_r, a1_l);
+ SUB2(a2_r, temp0_r, a2_l, temp0_l, a2_r, a2_l);
+ ADD2(a3_r, temp0_r, a3_l, temp0_l, a3_r, a3_l);
+ ADD2(a0_r, temp1_r, a0_l, temp1_l, a0_r, a0_l);
+ SUB2(a1_r, temp2_r, a1_l, temp2_l, a1_r, a1_l);
+ ADD2(a2_r, temp2_r, a2_l, temp2_l, a2_r, a2_l);
+ SUB2(a3_r, temp1_r, a3_l, temp1_l, a3_r, a3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ SPLATI_H4_SH(weights, 1, 3, 5, 7, w1, w3, w5, w7);
+ ILVR_H4_SH(w1, w3, w3, -w7, w5, -w1, w7, -w5,
+ const0, const1, const2, const3);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ ILVRL_H2_SW(in5, in7, temp0_r, temp0_l);
+ ILVR_H2_SH(w5, w7, w7, w3, const4, const6);
+ const5 = __msa_ilvod_h(-w1, -w5);
+ const7 = __msa_ilvod_h(w3, -w1);
+ DPADD_SH4_SW(temp0_r, temp0_r, temp0_r, temp0_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp0_l, temp0_l, temp0_l, temp0_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 20);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 20);
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 20);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 20);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r, temp2_l, temp2_r,
+ temp3_l, temp3_r, temp0_r, temp1_r, temp2_r, temp3_r);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ temp0_r = (v4i32) CLIP_SH_0_255(temp0_r);
+ temp1_r = (v4i32) CLIP_SH_0_255(temp1_r);
+ temp2_r = (v4i32) CLIP_SH_0_255(temp2_r);
+ temp3_r = (v4i32) CLIP_SH_0_255(temp3_r);
+ PCKEV_B4_SW(temp0_r, temp0_r, temp1_r, temp1_r,
+ temp2_r, temp2_r, temp3_r, temp3_r,
+ temp0_r, temp1_r, temp2_r, temp3_r);
+ tmp0 = __msa_copy_u_d((v2i64) temp0_r, 1);
+ tmp1 = __msa_copy_u_d((v2i64) temp1_r, 1);
+ tmp2 = __msa_copy_u_d((v2i64) temp2_r, 1);
+ tmp3 = __msa_copy_u_d((v2i64) temp3_r, 1);
+ SD4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += 4 * dst_stride;
+ a0_r = (v4i32) CLIP_SH_0_255(a0_r);
+ a1_r = (v4i32) CLIP_SH_0_255(a1_r);
+ a2_r = (v4i32) CLIP_SH_0_255(a2_r);
+ a3_r = (v4i32) CLIP_SH_0_255(a3_r);
+ PCKEV_B4_SW(a0_r, a0_r, a1_r, a1_r,
+ a2_r, a2_r, a3_r, a3_r, a0_r, a1_r, a2_r, a3_r);
+ tmp3 = __msa_copy_u_d((v2i64) a0_r, 1);
+ tmp2 = __msa_copy_u_d((v2i64) a1_r, 1);
+ tmp1 = __msa_copy_u_d((v2i64) a2_r, 1);
+ tmp0 = __msa_copy_u_d((v2i64) a3_r, 1);
+ SD4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += 4 * dst_stride;
+}
+
+static void simple_idct_add_msa(uint8_t *dst, int32_t dst_stride,
+ int16_t *block)
+{
+ int32_t const_val;
+ uint64_t tmp0, tmp1, tmp2, tmp3;
+ v8i16 weights = { 0, 22725, 21407, 19266, 16383, 12873, 8867, 4520 };
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v8i16 w1, w3, w5, w7;
+ v8i16 const0, const1, const2, const3, const4, const5, const6, const7;
+ v4i32 temp0_r, temp1_r, temp2_r, temp3_r;
+ v4i32 temp4_r, temp5_r, temp6_r, temp7_r, temp8_r;
+ v4i32 temp0_l, temp1_l, temp2_l, temp3_l;
+ v4i32 temp4_l, temp5_l, temp6_l, temp7_l, temp8_l;
+ v4i32 a0_r, a1_r, a2_r, a3_r, a0_l, a1_l, a2_l, a3_l;
+ v4i32 b0_r, b1_r, b2_r, b3_r, b0_l, b1_l, b2_l, b3_l;
+ v4i32 w2, w4, w6;
+ v8i16 select_vec, temp;
+ v8i16 zero = { 0 };
+ v4i32 const_val0 = __msa_ldi_w(1);
+ v4i32 const_val1 = __msa_ldi_w(1);
+
+ const_val0 <<= 10;
+ const_val = 16383 * ((1 << 19) / 16383);
+ const_val1 = __msa_insert_w(const_val0, 0, const_val);
+ const_val1 = __msa_splati_w(const_val1, 0);
+ LD_SH8(block, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ select_vec = in1 | in2 | in3 | in4 | in5 | in6 | in7;
+ select_vec = __msa_clti_u_h((v8u16) select_vec, 1);
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ UNPCK_SH_SW(in4, temp4_r, temp4_l);
+ UNPCK_SH_SW(in6, temp7_r, temp7_l);
+ ILVRL_H2_SW(in5, in7, temp8_r, temp8_l);
+ temp = in0 << 3;
+ SPLATI_H4_SH(weights, 1, 3, 5, 7, w1, w3, w5, w7);
+ ILVR_H4_SH(w1, w3, w3, -w7, w5, -w1, w7, -w5,
+ const0, const1, const2, const3);
+ ILVR_H2_SH(w5, w7, w7, w3, const4, const6);
+ const5 = __msa_ilvod_h(-w1, -w5);
+ const7 = __msa_ilvod_h(w3, -w1);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp8_r, temp8_r, temp8_r, temp8_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ DPADD_SH4_SW(temp8_l, temp8_l, temp8_l, temp8_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ w2 = (v4i32) __msa_splati_h(weights, 2);
+ w2 = (v4i32) __msa_ilvr_h(zero, (v8i16) w2);
+ w4 = (v4i32) __msa_splati_h(weights, 4);
+ w4 = (v4i32) __msa_ilvr_h(zero, (v8i16) w4);
+ w6 = (v4i32) __msa_splati_h(weights, 6);
+ w6 = (v4i32) __msa_ilvr_h(zero, (v8i16) w6);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val0, a0_l, const_val0, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp1_r, temp1_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ MUL2(temp4_r, w4, temp4_l, w4, temp4_r, temp4_l);
+ MUL2(temp7_r, w2, temp7_l, w2, temp6_r, temp6_l);
+ MUL2(temp7_r, w6, temp7_l, w6, temp5_r, temp5_l);
+ ADD2(a0_r, temp4_r, a0_l, temp4_l, a0_r, a0_l);
+ SUB2(a1_r, temp4_r, a1_l, temp4_l, a1_r, a1_l);
+ SUB2(a2_r, temp4_r, a2_l, temp4_l, a2_r, a2_l);
+ ADD2(a3_r, temp4_r, a3_l, temp4_l, a3_r, a3_l);
+ ADD2(a0_r, temp5_r, a0_l, temp5_l, a0_r, a0_l);
+ SUB2(a1_r, temp6_r, a1_l, temp6_l, a1_r, a1_l);
+ ADD2(a2_r, temp6_r, a2_l, temp6_l, a2_r, a2_l);
+ SUB2(a3_r, temp5_r, a3_l, temp5_l, a3_r, a3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 11);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 11);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r,
+ temp2_l, temp2_r, temp3_l, temp3_r,
+ temp0_r, temp1_r, temp2_r, temp3_r);
+ in0 = (v8i16) __msa_bmnz_v((v16u8) temp0_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in1 = (v8i16) __msa_bmnz_v((v16u8) temp1_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in2 = (v8i16) __msa_bmnz_v((v16u8) temp2_r, (v16u8) temp,
+ (v16u8) select_vec);
+ in3 = (v8i16) __msa_bmnz_v((v16u8) temp3_r, (v16u8) temp,
+ (v16u8) select_vec);
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 11);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 11);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ in4 = (v8i16) __msa_bmnz_v((v16u8) a3_r, (v16u8) temp, (v16u8) select_vec);
+ in5 = (v8i16) __msa_bmnz_v((v16u8) a2_r, (v16u8) temp, (v16u8) select_vec);
+ in6 = (v8i16) __msa_bmnz_v((v16u8) a1_r, (v16u8) temp, (v16u8) select_vec);
+ in7 = (v8i16) __msa_bmnz_v((v16u8) a0_r, (v16u8) temp, (v16u8) select_vec);
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ UNPCK_SH_SW(in0, a0_r, a0_l);
+ UNPCK_SH_SW(in2, temp3_r, temp3_l);
+ MUL2(a0_r, w4, a0_l, w4, a0_r, a0_l);
+ ADD2(a0_r, const_val1, a0_l, const_val1, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp1_r, temp1_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp2_r, temp2_l);
+ BUTTERFLY_8(temp0_r, temp0_l, temp0_r, temp0_l,
+ temp2_l, temp2_r, temp1_l, temp1_r,
+ a0_r, a0_l, a1_r, a1_l, a2_l, a2_r, a3_l, a3_r);
+ UNPCK_SH_SW(in4, temp0_r, temp0_l);
+ UNPCK_SH_SW(in6, temp3_r, temp3_l);
+ MUL2(temp0_r, w4, temp0_l, w4, temp0_r, temp0_l);
+ MUL2(w2, temp3_r, w2, temp3_l, temp2_r, temp2_l);
+ MUL2(w6, temp3_r, w6, temp3_l, temp1_r, temp1_l);
+ ADD2(a0_r, temp0_r, a0_l, temp0_l, a0_r, a0_l);
+ SUB2(a1_r, temp0_r, a1_l, temp0_l, a1_r, a1_l);
+ SUB2(a2_r, temp0_r, a2_l, temp0_l, a2_r, a2_l);
+ ADD2(a3_r, temp0_r, a3_l, temp0_l, a3_r, a3_l);
+ ADD2(a0_r, temp1_r, a0_l, temp1_l, a0_r, a0_l);
+ SUB2(a1_r, temp2_r, a1_l, temp2_l, a1_r, a1_l);
+ ADD2(a2_r, temp2_r, a2_l, temp2_l, a2_r, a2_l);
+ SUB2(a3_r, temp1_r, a3_l, temp1_l, a3_r, a3_l);
+ ILVRL_H2_SW(in1, in3, b3_r, b3_l);
+ ILVRL_H2_SW(in5, in7, temp0_r, temp0_l);
+ DOTP_SH4_SW(b3_r, b3_r, b3_r, b3_r, const0, const1, const2, const3,
+ b0_r, b1_r, b2_r, b3_r);
+ DOTP_SH4_SW(b3_l, b3_l, b3_l, b3_l, const0, const1, const2, const3,
+ b0_l, b1_l, b2_l, b3_l);
+ DPADD_SH4_SW(temp0_r, temp0_r, temp0_r, temp0_r,
+ const4, const5, const6, const7, b0_r, b1_r, b2_r, b3_r);
+ DPADD_SH4_SW(temp0_l, temp0_l, temp0_l, temp0_l,
+ const4, const5, const6, const7, b0_l, b1_l, b2_l, b3_l);
+ BUTTERFLY_16(a0_r, a0_l, a1_r, a1_l, a2_r, a2_l, a3_r, a3_l,
+ b3_l, b3_r, b2_l, b2_r, b1_l, b1_r, b0_l, b0_r,
+ temp0_r, temp0_l, temp1_r, temp1_l,
+ temp2_r, temp2_l, temp3_r, temp3_l,
+ a3_l, a3_r, a2_l, a2_r, a1_l, a1_r, a0_l, a0_r);
+ SRA_4V(temp0_r, temp0_l, temp1_r, temp1_l, 20);
+ SRA_4V(temp2_r, temp2_l, temp3_r, temp3_l, 20);
+ LD_SH4(dst, dst_stride, in0, in1, in2, in3);
+ PCKEV_H4_SW(temp0_l, temp0_r, temp1_l, temp1_r, temp2_l, temp2_r,
+ temp3_l, temp3_r, temp0_r, temp1_r, temp2_r, temp3_r);
+ ILVR_B4_SW(zero, in0, zero, in1, zero, in2, zero, in3,
+ temp0_l, temp1_l, temp2_l, temp3_l);
+ temp0_r = (v4i32) ((v8i16) (temp0_r) + (v8i16) (temp0_l));
+ temp1_r = (v4i32) ((v8i16) (temp1_r) + (v8i16) (temp1_l));
+ temp2_r = (v4i32) ((v8i16) (temp2_r) + (v8i16) (temp2_l));
+ temp3_r = (v4i32) ((v8i16) (temp3_r) + (v8i16) (temp3_l));
+ temp0_r = (v4i32) CLIP_SH_0_255(temp0_r);
+ temp1_r = (v4i32) CLIP_SH_0_255(temp1_r);
+ temp2_r = (v4i32) CLIP_SH_0_255(temp2_r);
+ temp3_r = (v4i32) CLIP_SH_0_255(temp3_r);
+ PCKEV_B4_SW(temp0_r, temp0_r, temp1_r, temp1_r,
+ temp2_r, temp2_r, temp3_r, temp3_r,
+ temp0_r, temp1_r, temp2_r, temp3_r);
+ tmp0 = __msa_copy_u_d((v2i64) temp0_r, 1);
+ tmp1 = __msa_copy_u_d((v2i64) temp1_r, 1);
+ tmp2 = __msa_copy_u_d((v2i64) temp2_r, 1);
+ tmp3 = __msa_copy_u_d((v2i64) temp3_r, 1);
+ SD4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+
+ SRA_4V(a3_r, a3_l, a2_r, a2_l, 20);
+ SRA_4V(a1_r, a1_l, a0_r, a0_l, 20);
+ LD_SH4(dst + 4 * dst_stride, dst_stride, in4, in5, in6, in7);
+ PCKEV_H4_SW(a0_l, a0_r, a1_l, a1_r, a2_l, a2_r, a3_l, a3_r,
+ a0_r, a1_r, a2_r, a3_r);
+ ILVR_B4_SW(zero, in4, zero, in5, zero, in6, zero, in7,
+ a3_l, a2_l, a1_l, a0_l);
+ a3_r = (v4i32) ((v8i16) (a3_r) + (v8i16) (a3_l));
+ a2_r = (v4i32) ((v8i16) (a2_r) + (v8i16) (a2_l));
+ a1_r = (v4i32) ((v8i16) (a1_r) + (v8i16) (a1_l));
+ a0_r = (v4i32) ((v8i16) (a0_r) + (v8i16) (a0_l));
+ a3_r = (v4i32) CLIP_SH_0_255(a3_r);
+ a2_r = (v4i32) CLIP_SH_0_255(a2_r);
+ a1_r = (v4i32) CLIP_SH_0_255(a1_r);
+ a0_r = (v4i32) CLIP_SH_0_255(a0_r);
+ PCKEV_B4_SW(a0_r, a0_r, a1_r, a1_r,
+ a2_r, a2_r, a3_r, a3_r, a0_r, a1_r, a2_r, a3_r);
+ tmp0 = __msa_copy_u_d((v2i64) a3_r, 1);
+ tmp1 = __msa_copy_u_d((v2i64) a2_r, 1);
+ tmp2 = __msa_copy_u_d((v2i64) a1_r, 1);
+ tmp3 = __msa_copy_u_d((v2i64) a0_r, 1);
+ SD4(tmp0, tmp1, tmp2, tmp3, dst + 4 * dst_stride, dst_stride);
+}
+
+void ff_simple_idct_msa(int16_t *block)
+{
+ simple_idct_msa(block);
+}
+
+void ff_simple_idct_put_msa(uint8_t *dst, int32_t dst_stride, int16_t *block)
+{
+ simple_idct_put_msa(dst, dst_stride, block);
+}
+
+void ff_simple_idct_add_msa(uint8_t *dst, int32_t dst_stride, int16_t *block)
+{
+ simple_idct_add_msa(dst, dst_stride, block);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp8_idct_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_idct_msa.c
new file mode 100644
index 00000000000..11ac9ff83e9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_idct_msa.c
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+#include "libavcodec/vp8dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp8dsp_mips.h"
+
+static const int cospi8sqrt2minus1 = 20091;
+static const int sinpi8sqrt2 = 35468;
+
+#define VP8_IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) \
+{ \
+ v4i32 a1_m, b1_m, c1_m, d1_m; \
+ v4i32 c_tmp1_m, c_tmp2_m, d_tmp1_m, d_tmp2_m; \
+ v4i32 const_cospi8sqrt2minus1_m, sinpi8_sqrt2_m; \
+ \
+ const_cospi8sqrt2minus1_m = __msa_fill_w(cospi8sqrt2minus1); \
+ sinpi8_sqrt2_m = __msa_fill_w(sinpi8sqrt2); \
+ a1_m = in0 + in2; \
+ b1_m = in0 - in2; \
+ c_tmp1_m = ((in1) * sinpi8_sqrt2_m) >> 16; \
+ c_tmp2_m = in3 + (((in3) * const_cospi8sqrt2minus1_m) >> 16); \
+ c1_m = c_tmp1_m - c_tmp2_m; \
+ d_tmp1_m = (in1) + (((in1) * const_cospi8sqrt2minus1_m) >> 16); \
+ d_tmp2_m = ((in3) * sinpi8_sqrt2_m) >> 16; \
+ d1_m = d_tmp1_m + d_tmp2_m; \
+ BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \
+}
+
+void ff_vp8_idct_add_msa(uint8_t *dst, int16_t input[16], ptrdiff_t stride)
+{
+ v8i16 input0, input1;
+ v4i32 in0, in1, in2, in3, hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3;
+ v4i32 res0, res1, res2, res3;
+ v16i8 zero = { 0 };
+ v16i8 pred0, pred1, pred2, pred3, dest0, dest1;
+ v16i8 mask = { 0, 4, 8, 12, 16, 20, 24, 28, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ /* load short vector elements of 4x4 block */
+ LD_SH2(input, 8, input0, input1);
+ UNPCK_SH_SW(input0, in0, in1);
+ UNPCK_SH_SW(input1, in2, in3);
+ VP8_IDCT_1D_W(in0, in1, in2, in3, hz0, hz1, hz2, hz3);
+ /* transpose the block */
+ TRANSPOSE4x4_SW_SW(hz0, hz1, hz2, hz3, hz0, hz1, hz2, hz3);
+ VP8_IDCT_1D_W(hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3);
+ SRARI_W4_SW(vt0, vt1, vt2, vt3, 3);
+ /* transpose the block */
+ TRANSPOSE4x4_SW_SW(vt0, vt1, vt2, vt3, vt0, vt1, vt2, vt3);
+ LD_SB4(dst, stride, pred0, pred1, pred2, pred3);
+ ILVR_B4_SW(zero, pred0, zero, pred1, zero, pred2, zero, pred3,
+ res0, res1, res2, res3);
+ ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3,
+ res0, res1, res2, res3);
+ ADD4(res0, vt0, res1, vt1, res2, vt2, res3, vt3, res0, res1, res2, res3);
+ res0 = CLIP_SW_0_255(res0);
+ res1 = CLIP_SW_0_255(res1);
+ res2 = CLIP_SW_0_255(res2);
+ res3 = CLIP_SW_0_255(res3);
+ VSHF_B2_SB(res0, res1, res2, res3, mask, mask, dest0, dest1);
+ ST4x4_UB(dest0, dest1, 0, 1, 0, 1, dst, stride);
+
+ memset(input, 0, 4 * 4 * sizeof(*input));
+}
+
+void ff_vp8_idct_dc_add_msa(uint8_t *dst, int16_t in_dc[16], ptrdiff_t stride)
+{
+ v8i16 vec;
+ v8i16 res0, res1, res2, res3;
+ v16i8 zero = { 0 };
+ v16i8 pred0, pred1, pred2, pred3, dest0, dest1;
+ v16i8 mask = { 0, 2, 4, 6, 16, 18, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ vec = __msa_fill_h(in_dc[0]);
+ vec = __msa_srari_h(vec, 3);
+ LD_SB4(dst, stride, pred0, pred1, pred2, pred3);
+ ILVR_B4_SH(zero, pred0, zero, pred1, zero, pred2, zero, pred3,
+ res0, res1, res2, res3);
+ ADD4(res0, vec, res1, vec, res2, vec, res3, vec, res0, res1, res2, res3);
+ CLIP_SH4_0_255(res0, res1, res2, res3);
+ VSHF_B2_SB(res0, res1, res2, res3, mask, mask, dest0, dest1);
+ ST4x4_UB(dest0, dest1, 0, 1, 0, 1, dst, stride);
+
+ in_dc[0] = 0;
+}
+
+void ff_vp8_luma_dc_wht_msa(int16_t block[4][4][16], int16_t input[16])
+{
+ int16_t *mb_dq_coeff = &block[0][0][0];
+ v8i16 input0, input1;
+ v4i32 in0, in1, in2, in3, a1, b1, c1, d1;
+ v4i32 hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3;
+
+ /* load short vector elements of 4x4 block */
+ LD_SH2(input, 8, input0, input1);
+ UNPCK_SH_SW(input0, in0, in1);
+ UNPCK_SH_SW(input1, in2, in3);
+ BUTTERFLY_4(in0, in1, in2, in3, a1, b1, c1, d1);
+ BUTTERFLY_4(a1, d1, c1, b1, hz0, hz1, hz3, hz2);
+ /* transpose the block */
+ TRANSPOSE4x4_SW_SW(hz0, hz1, hz2, hz3, hz0, hz1, hz2, hz3);
+ BUTTERFLY_4(hz0, hz1, hz2, hz3, a1, b1, c1, d1);
+ BUTTERFLY_4(a1, d1, c1, b1, vt0, vt1, vt3, vt2);
+ ADD4(vt0, 3, vt1, 3, vt2, 3, vt3, 3, vt0, vt1, vt2, vt3);
+ SRA_4V(vt0, vt1, vt2, vt3, 3);
+ mb_dq_coeff[0] = __msa_copy_s_h((v8i16) vt0, 0);
+ mb_dq_coeff[16] = __msa_copy_s_h((v8i16) vt1, 0);
+ mb_dq_coeff[32] = __msa_copy_s_h((v8i16) vt2, 0);
+ mb_dq_coeff[48] = __msa_copy_s_h((v8i16) vt3, 0);
+ mb_dq_coeff[64] = __msa_copy_s_h((v8i16) vt0, 2);
+ mb_dq_coeff[80] = __msa_copy_s_h((v8i16) vt1, 2);
+ mb_dq_coeff[96] = __msa_copy_s_h((v8i16) vt2, 2);
+ mb_dq_coeff[112] = __msa_copy_s_h((v8i16) vt3, 2);
+ mb_dq_coeff[128] = __msa_copy_s_h((v8i16) vt0, 4);
+ mb_dq_coeff[144] = __msa_copy_s_h((v8i16) vt1, 4);
+ mb_dq_coeff[160] = __msa_copy_s_h((v8i16) vt2, 4);
+ mb_dq_coeff[176] = __msa_copy_s_h((v8i16) vt3, 4);
+ mb_dq_coeff[192] = __msa_copy_s_h((v8i16) vt0, 6);
+ mb_dq_coeff[208] = __msa_copy_s_h((v8i16) vt1, 6);
+ mb_dq_coeff[224] = __msa_copy_s_h((v8i16) vt2, 6);
+ mb_dq_coeff[240] = __msa_copy_s_h((v8i16) vt3, 6);
+
+ memset(input, 0, 4 * 4 * sizeof(int16_t));
+}
+
+void ff_vp8_idct_dc_add4y_msa(uint8_t *dst, int16_t block[4][16],
+ ptrdiff_t stride)
+{
+ ff_vp8_idct_dc_add_msa(dst, &block[0][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + 4, &block[1][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + 8, &block[2][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + 12, &block[3][0], stride);
+}
+
+void ff_vp8_idct_dc_add4uv_msa(uint8_t *dst, int16_t block[4][16],
+ ptrdiff_t stride)
+{
+ ff_vp8_idct_dc_add_msa(dst, &block[0][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + 4, &block[1][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + stride * 4, &block[2][0], stride);
+ ff_vp8_idct_dc_add_msa(dst + stride * 4 + 4, &block[3][0], stride);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp8_lpf_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_lpf_msa.c
new file mode 100644
index 00000000000..359096174a2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_lpf_msa.c
@@ -0,0 +1,690 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/vp8dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp8dsp_mips.h"
+
+#define VP8_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask) \
+{ \
+ v16u8 p1_a_sub_q1, p0_a_sub_q0; \
+ \
+ p0_a_sub_q0 = __msa_asub_u_b(p0, q0); \
+ p1_a_sub_q1 = __msa_asub_u_b(p1, q1); \
+ p1_a_sub_q1 = (v16u8) __msa_srli_b((v16i8) p1_a_sub_q1, 1); \
+ p0_a_sub_q0 = __msa_adds_u_b(p0_a_sub_q0, p0_a_sub_q0); \
+ mask = __msa_adds_u_b(p0_a_sub_q0, p1_a_sub_q1); \
+ mask = ((v16u8) mask <= b_limit); \
+}
+
+#define VP8_LPF_FILTER4_4W(p1_in_out, p0_in_out, q0_in_out, q1_in_out, \
+ mask_in, hev_in) \
+{ \
+ v16i8 p1_m, p0_m, q0_m, q1_m, q0_sub_p0, filt_sign; \
+ v16i8 filt, filt1, filt2, cnst4b, cnst3b; \
+ v8i16 q0_sub_p0_r, q0_sub_p0_l, filt_l, filt_r, cnst3h; \
+ \
+ p1_m = (v16i8) __msa_xori_b(p1_in_out, 0x80); \
+ p0_m = (v16i8) __msa_xori_b(p0_in_out, 0x80); \
+ q0_m = (v16i8) __msa_xori_b(q0_in_out, 0x80); \
+ q1_m = (v16i8) __msa_xori_b(q1_in_out, 0x80); \
+ \
+ filt = __msa_subs_s_b(p1_m, q1_m); \
+ \
+ filt = filt & (v16i8) hev_in; \
+ \
+ q0_sub_p0 = q0_m - p0_m; \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ \
+ cnst3h = __msa_ldi_h(3); \
+ q0_sub_p0_r = (v8i16) __msa_ilvr_b(q0_sub_p0, q0_sub_p0); \
+ q0_sub_p0_r = __msa_dotp_s_h((v16i8) q0_sub_p0_r, (v16i8) cnst3h); \
+ filt_r = (v8i16) __msa_ilvr_b(filt_sign, filt); \
+ filt_r += q0_sub_p0_r; \
+ filt_r = __msa_sat_s_h(filt_r, 7); \
+ \
+ q0_sub_p0_l = (v8i16) __msa_ilvl_b(q0_sub_p0, q0_sub_p0); \
+ q0_sub_p0_l = __msa_dotp_s_h((v16i8) q0_sub_p0_l, (v16i8) cnst3h); \
+ filt_l = (v8i16) __msa_ilvl_b(filt_sign, filt); \
+ filt_l += q0_sub_p0_l; \
+ filt_l = __msa_sat_s_h(filt_l, 7); \
+ \
+ filt = __msa_pckev_b((v16i8) filt_l, (v16i8) filt_r); \
+ filt = filt & (v16i8) mask_in; \
+ \
+ cnst4b = __msa_ldi_b(4); \
+ filt1 = __msa_adds_s_b(filt, cnst4b); \
+ filt1 >>= 3; \
+ \
+ cnst3b = __msa_ldi_b(3); \
+ filt2 = __msa_adds_s_b(filt, cnst3b); \
+ filt2 >>= 3; \
+ \
+ q0_m = __msa_subs_s_b(q0_m, filt1); \
+ q0_in_out = __msa_xori_b((v16u8) q0_m, 0x80); \
+ p0_m = __msa_adds_s_b(p0_m, filt2); \
+ p0_in_out = __msa_xori_b((v16u8) p0_m, 0x80); \
+ \
+ filt = __msa_srari_b(filt1, 1); \
+ hev_in = __msa_xori_b((v16u8) hev_in, 0xff); \
+ filt = filt & (v16i8) hev_in; \
+ \
+ q1_m = __msa_subs_s_b(q1_m, filt); \
+ q1_in_out = __msa_xori_b((v16u8) q1_m, 0x80); \
+ p1_m = __msa_adds_s_b(p1_m, filt); \
+ p1_in_out = __msa_xori_b((v16u8) p1_m, 0x80); \
+}
+
+#define VP8_SIMPLE_FILT(p1_in, p0_in, q0_in, q1_in, mask) \
+{ \
+ v16i8 p1_m, p0_m, q0_m, q1_m, q0_sub_p0, q0_sub_p0_sign; \
+ v16i8 filt, filt1, filt2, cnst4b, cnst3b, filt_sign; \
+ v8i16 q0_sub_p0_r, q0_sub_p0_l, filt_l, filt_r, cnst3h; \
+ \
+ p1_m = (v16i8) __msa_xori_b(p1_in, 0x80); \
+ p0_m = (v16i8) __msa_xori_b(p0_in, 0x80); \
+ q0_m = (v16i8) __msa_xori_b(q0_in, 0x80); \
+ q1_m = (v16i8) __msa_xori_b(q1_in, 0x80); \
+ \
+ filt = __msa_subs_s_b(p1_m, q1_m); \
+ \
+ q0_sub_p0 = q0_m - p0_m; \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ \
+ cnst3h = __msa_ldi_h(3); \
+ q0_sub_p0_sign = __msa_clti_s_b(q0_sub_p0, 0); \
+ q0_sub_p0_r = (v8i16) __msa_ilvr_b(q0_sub_p0_sign, q0_sub_p0); \
+ q0_sub_p0_r *= cnst3h; \
+ filt_r = (v8i16) __msa_ilvr_b(filt_sign, filt); \
+ filt_r += q0_sub_p0_r; \
+ filt_r = __msa_sat_s_h(filt_r, 7); \
+ \
+ q0_sub_p0_l = (v8i16) __msa_ilvl_b(q0_sub_p0_sign, q0_sub_p0); \
+ q0_sub_p0_l *= cnst3h; \
+ filt_l = (v8i16) __msa_ilvl_b(filt_sign, filt); \
+ filt_l += q0_sub_p0_l; \
+ filt_l = __msa_sat_s_h(filt_l, 7); \
+ \
+ filt = __msa_pckev_b((v16i8) filt_l, (v16i8) filt_r); \
+ filt = filt & (v16i8) (mask); \
+ \
+ cnst4b = __msa_ldi_b(4); \
+ filt1 = __msa_adds_s_b(filt, cnst4b); \
+ filt1 >>= 3; \
+ \
+ cnst3b = __msa_ldi_b(3); \
+ filt2 = __msa_adds_s_b(filt, cnst3b); \
+ filt2 >>= 3; \
+ \
+ q0_m = __msa_subs_s_b(q0_m, filt1); \
+ p0_m = __msa_adds_s_b(p0_m, filt2); \
+ q0_in = __msa_xori_b((v16u8) q0_m, 0x80); \
+ p0_in = __msa_xori_b((v16u8) p0_m, 0x80); \
+}
+
+#define VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev) \
+{ \
+ v16i8 p2_m, p1_m, p0_m, q2_m, q1_m, q0_m; \
+ v16i8 filt, q0_sub_p0, cnst4b, cnst3b; \
+ v16i8 u, filt1, filt2, filt_sign, q0_sub_p0_sign; \
+ v8i16 q0_sub_p0_r, q0_sub_p0_l, filt_r, u_r, u_l, filt_l; \
+ v8i16 cnst3h, cnst27h, cnst18h, cnst63h; \
+ \
+ cnst3h = __msa_ldi_h(3); \
+ \
+ p2_m = (v16i8) __msa_xori_b(p2, 0x80); \
+ p1_m = (v16i8) __msa_xori_b(p1, 0x80); \
+ p0_m = (v16i8) __msa_xori_b(p0, 0x80); \
+ q0_m = (v16i8) __msa_xori_b(q0, 0x80); \
+ q1_m = (v16i8) __msa_xori_b(q1, 0x80); \
+ q2_m = (v16i8) __msa_xori_b(q2, 0x80); \
+ \
+ filt = __msa_subs_s_b(p1_m, q1_m); \
+ q0_sub_p0 = q0_m - p0_m; \
+ q0_sub_p0_sign = __msa_clti_s_b(q0_sub_p0, 0); \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ \
+ /* right part */ \
+ q0_sub_p0_r = (v8i16) __msa_ilvr_b(q0_sub_p0_sign, q0_sub_p0); \
+ q0_sub_p0_r *= cnst3h; \
+ filt_r = (v8i16) __msa_ilvr_b(filt_sign, filt); \
+ filt_r = filt_r + q0_sub_p0_r; \
+ filt_r = __msa_sat_s_h(filt_r, 7); \
+ \
+ /* left part */ \
+ q0_sub_p0_l = (v8i16) __msa_ilvl_b(q0_sub_p0_sign, q0_sub_p0); \
+ q0_sub_p0_l *= cnst3h; \
+ filt_l = (v8i16) __msa_ilvl_b(filt_sign, filt); \
+ filt_l = filt_l + q0_sub_p0_l; \
+ filt_l = __msa_sat_s_h(filt_l, 7); \
+ \
+ /* combine left and right part */ \
+ filt = __msa_pckev_b((v16i8) filt_l, (v16i8) filt_r); \
+ filt = filt & (v16i8) mask; \
+ filt2 = filt & (v16i8) hev; \
+ \
+ /* filt_val &= ~hev */ \
+ hev = __msa_xori_b(hev, 0xff); \
+ filt = filt & (v16i8) hev; \
+ cnst4b = __msa_ldi_b(4); \
+ filt1 = __msa_adds_s_b(filt2, cnst4b); \
+ filt1 >>= 3; \
+ cnst3b = __msa_ldi_b(3); \
+ filt2 = __msa_adds_s_b(filt2, cnst3b); \
+ filt2 >>= 3; \
+ q0_m = __msa_subs_s_b(q0_m, filt1); \
+ p0_m = __msa_adds_s_b(p0_m, filt2); \
+ \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ ILVRL_B2_SH(filt_sign, filt, filt_r, filt_l); \
+ \
+ cnst27h = __msa_ldi_h(27); \
+ cnst63h = __msa_ldi_h(63); \
+ \
+ /* right part */ \
+ u_r = filt_r * cnst27h; \
+ u_r += cnst63h; \
+ u_r >>= 7; \
+ u_r = __msa_sat_s_h(u_r, 7); \
+ /* left part */ \
+ u_l = filt_l * cnst27h; \
+ u_l += cnst63h; \
+ u_l >>= 7; \
+ u_l = __msa_sat_s_h(u_l, 7); \
+ /* combine left and right part */ \
+ u = __msa_pckev_b((v16i8) u_l, (v16i8) u_r); \
+ q0_m = __msa_subs_s_b(q0_m, u); \
+ q0 = __msa_xori_b((v16u8) q0_m, 0x80); \
+ p0_m = __msa_adds_s_b(p0_m, u); \
+ p0 = __msa_xori_b((v16u8) p0_m, 0x80); \
+ cnst18h = __msa_ldi_h(18); \
+ u_r = filt_r * cnst18h; \
+ u_r += cnst63h; \
+ u_r >>= 7; \
+ u_r = __msa_sat_s_h(u_r, 7); \
+ \
+ /* left part */ \
+ u_l = filt_l * cnst18h; \
+ u_l += cnst63h; \
+ u_l >>= 7; \
+ u_l = __msa_sat_s_h(u_l, 7); \
+ /* combine left and right part */ \
+ u = __msa_pckev_b((v16i8) u_l, (v16i8) u_r); \
+ q1_m = __msa_subs_s_b(q1_m, u); \
+ q1 = __msa_xori_b((v16u8) q1_m, 0x80); \
+ p1_m = __msa_adds_s_b(p1_m, u); \
+ p1 = __msa_xori_b((v16u8) p1_m, 0x80); \
+ u_r = filt_r << 3; \
+ u_r += filt_r + cnst63h; \
+ u_r >>= 7; \
+ u_r = __msa_sat_s_h(u_r, 7); \
+ \
+ /* left part */ \
+ u_l = filt_l << 3; \
+ u_l += filt_l + cnst63h; \
+ u_l >>= 7; \
+ u_l = __msa_sat_s_h(u_l, 7); \
+ /* combine left and right part */ \
+ u = __msa_pckev_b((v16i8) u_l, (v16i8) u_r); \
+ q2_m = __msa_subs_s_b(q2_m, u); \
+ q2 = __msa_xori_b((v16u8) q2_m, 0x80); \
+ p2_m = __msa_adds_s_b(p2_m, u); \
+ p2 = __msa_xori_b((v16u8) p2_m, 0x80); \
+}
+
+#define LPF_MASK_HEV(p3_in, p2_in, p1_in, p0_in, \
+ q0_in, q1_in, q2_in, q3_in, \
+ limit_in, b_limit_in, thresh_in, \
+ hev_out, mask_out, flat_out) \
+{ \
+ v16u8 p3_asub_p2_m, p2_asub_p1_m, p1_asub_p0_m, q1_asub_q0_m; \
+ v16u8 p1_asub_q1_m, p0_asub_q0_m, q3_asub_q2_m, q2_asub_q1_m; \
+ \
+ /* absolute subtraction of pixel values */ \
+ p3_asub_p2_m = __msa_asub_u_b((p3_in), (p2_in)); \
+ p2_asub_p1_m = __msa_asub_u_b((p2_in), (p1_in)); \
+ p1_asub_p0_m = __msa_asub_u_b((p1_in), (p0_in)); \
+ q1_asub_q0_m = __msa_asub_u_b((q1_in), (q0_in)); \
+ q2_asub_q1_m = __msa_asub_u_b((q2_in), (q1_in)); \
+ q3_asub_q2_m = __msa_asub_u_b((q3_in), (q2_in)); \
+ p0_asub_q0_m = __msa_asub_u_b((p0_in), (q0_in)); \
+ p1_asub_q1_m = __msa_asub_u_b((p1_in), (q1_in)); \
+ /* calculation of hev */ \
+ flat_out = __msa_max_u_b(p1_asub_p0_m, q1_asub_q0_m); \
+ hev_out = (thresh_in) < (v16u8) flat_out; \
+ /* calculation of mask */ \
+ p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p0_asub_q0_m); \
+ p1_asub_q1_m >>= 1; \
+ p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p1_asub_q1_m); \
+ mask_out = (b_limit_in) < p0_asub_q0_m; \
+ mask_out = __msa_max_u_b(flat_out, mask_out); \
+ p3_asub_p2_m = __msa_max_u_b(p3_asub_p2_m, p2_asub_p1_m); \
+ mask_out = __msa_max_u_b(p3_asub_p2_m, mask_out); \
+ q2_asub_q1_m = __msa_max_u_b(q2_asub_q1_m, q3_asub_q2_m); \
+ mask_out = __msa_max_u_b(q2_asub_q1_m, mask_out); \
+ mask_out = (limit_in) < (v16u8) mask_out; \
+ mask_out = __msa_xori_b(mask_out, 0xff); \
+}
+
+#define VP8_ST6x1_UB(in0, in0_idx, in1, in1_idx, pdst, stride) \
+{ \
+ uint16_t tmp0_h; \
+ uint32_t tmp0_w; \
+ \
+ tmp0_w = __msa_copy_u_w((v4i32) in0, in0_idx); \
+ tmp0_h = __msa_copy_u_h((v8i16) in1, in1_idx); \
+ SW(tmp0_w, pdst); \
+ SH(tmp0_h, pdst + stride); \
+}
+
+void ff_vp8_v_loop_filter16_msa(uint8_t *src, ptrdiff_t pitch, int b_limit_in,
+ int limit_in, int thresh_in)
+{
+ uint8_t *temp_src;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+ /* load vector elements */
+ temp_src = src - (pitch << 2);
+ LD_UB8(temp_src, pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev);
+ /* store vector elements */
+ temp_src = src - 3 * pitch;
+ ST_UB4(p2, p1, p0, q0, temp_src, pitch);
+ temp_src += (4 * pitch);
+ ST_UB2(q1, q2, temp_src, pitch);
+}
+
+void ff_vp8_v_loop_filter8uv_msa(uint8_t *src_u, uint8_t *src_v,
+ ptrdiff_t pitch, int b_limit_in, int limit_in,
+ int thresh_in)
+{
+ uint8_t *temp_src;
+ uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+ v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u;
+ v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+
+ temp_src = src_u - (pitch << 2);
+ LD_UB8(temp_src, pitch, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u);
+ temp_src = src_v - (pitch << 2);
+ LD_UB8(temp_src, pitch, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v);
+
+ /* rht 8 element of p3 are u pixel and left 8 element of p3 are v pixel */
+ ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0);
+ ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3);
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev);
+
+ p2_d = __msa_copy_u_d((v2i64) p2, 0);
+ p1_d = __msa_copy_u_d((v2i64) p1, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1, 0);
+ q2_d = __msa_copy_u_d((v2i64) q2, 0);
+ src_u -= (pitch * 3);
+ SD4(p2_d, p1_d, p0_d, q0_d, src_u, pitch);
+ src_u += 4 * pitch;
+ SD(q1_d, src_u);
+ src_u += pitch;
+ SD(q2_d, src_u);
+
+ p2_d = __msa_copy_u_d((v2i64) p2, 1);
+ p1_d = __msa_copy_u_d((v2i64) p1, 1);
+ p0_d = __msa_copy_u_d((v2i64) p0, 1);
+ q0_d = __msa_copy_u_d((v2i64) q0, 1);
+ q1_d = __msa_copy_u_d((v2i64) q1, 1);
+ q2_d = __msa_copy_u_d((v2i64) q2, 1);
+ src_v -= (pitch * 3);
+ SD4(p2_d, p1_d, p0_d, q0_d, src_v, pitch);
+ src_v += 4 * pitch;
+ SD(q1_d, src_v);
+ src_v += pitch;
+ SD(q2_d, src_v);
+}
+
+void ff_vp8_h_loop_filter16_msa(uint8_t *src, ptrdiff_t pitch, int b_limit_in,
+ int limit_in, int thresh_in)
+{
+ uint8_t *temp_src;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8;
+ v16u8 row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+ temp_src = src - 4;
+ LD_UB8(temp_src, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ temp_src += (8 * pitch);
+ LD_UB8(temp_src, pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev);
+ ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4);
+ ILVL_B2_SH(p1, p2, q0, p0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp6, tmp7);
+ ILVRL_B2_SH(q2, q1, tmp2, tmp5);
+
+ temp_src = src - 3;
+ VP8_ST6x1_UB(tmp3, 0, tmp2, 0, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp3, 1, tmp2, 1, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp3, 2, tmp2, 2, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp3, 3, tmp2, 3, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp4, 0, tmp2, 4, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp4, 1, tmp2, 5, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp4, 2, tmp2, 6, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp4, 3, tmp2, 7, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp6, 0, tmp5, 0, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp6, 1, tmp5, 1, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp6, 2, tmp5, 2, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp6, 3, tmp5, 3, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp7, 0, tmp5, 4, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp7, 1, tmp5, 5, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp7, 2, tmp5, 6, temp_src, 4);
+ temp_src += pitch;
+ VP8_ST6x1_UB(tmp7, 3, tmp5, 7, temp_src, 4);
+}
+
+void ff_vp8_h_loop_filter8uv_msa(uint8_t *src_u, uint8_t *src_v,
+ ptrdiff_t pitch, int b_limit_in, int limit_in,
+ int thresh_in)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8;
+ v16u8 row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+
+ LD_UB8(src_u - 4, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ LD_UB8(src_v - 4, pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev);
+
+ ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4);
+ ILVL_B2_SH(p1, p2, q0, p0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp6, tmp7);
+ ILVRL_B2_SH(q2, q1, tmp2, tmp5);
+
+ src_u -= 3;
+ VP8_ST6x1_UB(tmp3, 0, tmp2, 0, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp3, 1, tmp2, 1, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp3, 2, tmp2, 2, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp3, 3, tmp2, 3, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp4, 0, tmp2, 4, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp4, 1, tmp2, 5, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp4, 2, tmp2, 6, src_u, 4);
+ src_u += pitch;
+ VP8_ST6x1_UB(tmp4, 3, tmp2, 7, src_u, 4);
+
+ src_v -= 3;
+ VP8_ST6x1_UB(tmp6, 0, tmp5, 0, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp6, 1, tmp5, 1, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp6, 2, tmp5, 2, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp6, 3, tmp5, 3, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp7, 0, tmp5, 4, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp7, 1, tmp5, 5, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp7, 2, tmp5, 6, src_v, 4);
+ src_v += pitch;
+ VP8_ST6x1_UB(tmp7, 3, tmp5, 7, src_v, 4);
+}
+
+void ff_vp8_v_loop_filter_simple_msa(uint8_t *src, ptrdiff_t pitch,
+ int b_limit_ptr)
+{
+ v16u8 p1, p0, q1, q0;
+ v16u8 mask, b_limit;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ /* load vector elements */
+ LD_UB4(src - (pitch << 1), pitch, p1, p0, q0, q1);
+ VP8_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask);
+ VP8_SIMPLE_FILT(p1, p0, q0, q1, mask);
+ ST_UB2(p0, q0, (src - pitch), pitch);
+}
+
+void ff_vp8_h_loop_filter_simple_msa(uint8_t *src, ptrdiff_t pitch,
+ int b_limit_ptr)
+{
+ uint8_t *temp_src;
+ v16u8 p1, p0, q1, q0;
+ v16u8 mask, b_limit;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8;
+ v16u8 row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1;
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ temp_src = src - 2;
+ LD_UB8(temp_src, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ temp_src += (8 * pitch);
+ LD_UB8(temp_src, pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+ TRANSPOSE16x4_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p1, p0, q0, q1);
+ VP8_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask);
+ VP8_SIMPLE_FILT(p1, p0, q0, q1, mask);
+ ILVRL_B2_SH(q0, p0, tmp1, tmp0);
+
+ src -= 1;
+ ST2x4_UB(tmp1, 0, src, pitch);
+ src += 4 * pitch;
+ ST2x4_UB(tmp1, 4, src, pitch);
+ src += 4 * pitch;
+ ST2x4_UB(tmp0, 0, src, pitch);
+ src += 4 * pitch;
+ ST2x4_UB(tmp0, 4, src, pitch);
+ src += 4 * pitch;
+}
+
+void ff_vp8_v_loop_filter8uv_inner_msa(uint8_t *src_u, uint8_t *src_v,
+ ptrdiff_t pitch, int b_limit_in,
+ int limit_in, int thresh_in)
+{
+ uint64_t p1_d, p0_d, q0_d, q1_d;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+ v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u;
+ v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v;
+
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+
+ src_u = src_u - (pitch << 2);
+ LD_UB8(src_u, pitch, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u);
+ src_u += (5 * pitch);
+ src_v = src_v - (pitch << 2);
+ LD_UB8(src_v, pitch, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v);
+ src_v += (5 * pitch);
+
+ /* right 8 element of p3 are u pixel and
+ left 8 element of p3 are v pixel */
+ ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0);
+ ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3);
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev);
+
+ p1_d = __msa_copy_u_d((v2i64) p1, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1, 0);
+ SD4(q1_d, q0_d, p0_d, p1_d, src_u, (- pitch));
+
+ p1_d = __msa_copy_u_d((v2i64) p1, 1);
+ p0_d = __msa_copy_u_d((v2i64) p0, 1);
+ q0_d = __msa_copy_u_d((v2i64) q0, 1);
+ q1_d = __msa_copy_u_d((v2i64) q1, 1);
+ SD4(q1_d, q0_d, p0_d, p1_d, src_v, (- pitch));
+}
+
+void ff_vp8_h_loop_filter8uv_inner_msa(uint8_t *src_u, uint8_t *src_v,
+ ptrdiff_t pitch, int b_limit_in,
+ int limit_in, int thresh_in)
+{
+ uint8_t *temp_src_u, *temp_src_v;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 mask, hev, flat, thresh, limit, b_limit;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8;
+ v16u8 row9, row10, row11, row12, row13, row14, row15;
+ v4i32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
+
+ thresh = (v16u8) __msa_fill_b(thresh_in);
+ limit = (v16u8) __msa_fill_b(limit_in);
+ b_limit = (v16u8) __msa_fill_b(b_limit_in);
+
+ LD_UB8(src_u - 4, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ LD_UB8(src_v - 4, pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev);
+ ILVR_B2_SW(p0, p1, q1, q0, tmp0, tmp1);
+ ILVRL_H2_SW(tmp1, tmp0, tmp2, tmp3);
+ tmp0 = (v4i32) __msa_ilvl_b((v16i8) p0, (v16i8) p1);
+ tmp1 = (v4i32) __msa_ilvl_b((v16i8) q1, (v16i8) q0);
+ ILVRL_H2_SW(tmp1, tmp0, tmp4, tmp5);
+
+ temp_src_u = src_u - 2;
+ ST4x4_UB(tmp2, tmp2, 0, 1, 2, 3, temp_src_u, pitch);
+ temp_src_u += 4 * pitch;
+ ST4x4_UB(tmp3, tmp3, 0, 1, 2, 3, temp_src_u, pitch);
+
+ temp_src_v = src_v - 2;
+ ST4x4_UB(tmp4, tmp4, 0, 1, 2, 3, temp_src_v, pitch);
+ temp_src_v += 4 * pitch;
+ ST4x4_UB(tmp5, tmp5, 0, 1, 2, 3, temp_src_v, pitch);
+}
+
+void ff_vp8_v_loop_filter16_inner_msa(uint8_t *src, ptrdiff_t pitch,
+ int32_t e, int32_t i, int32_t h)
+{
+ v16u8 mask, hev, flat;
+ v16u8 thresh, b_limit, limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+
+ /* load vector elements */
+ LD_UB8((src - 4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+ thresh = (v16u8) __msa_fill_b(h);
+ b_limit = (v16u8) __msa_fill_b(e);
+ limit = (v16u8) __msa_fill_b(i);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev);
+
+ ST_UB4(p1, p0, q0, q1, (src - 2 * pitch), pitch);
+}
+
+void ff_vp8_h_loop_filter16_inner_msa(uint8_t *src, ptrdiff_t pitch,
+ int32_t e, int32_t i, int32_t h)
+{
+ v16u8 mask, hev, flat;
+ v16u8 thresh, b_limit, limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7;
+ v16u8 row8, row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
+
+ LD_UB8(src - 4, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ LD_UB8(src - 4 + (8 * pitch), pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(h);
+ b_limit = (v16u8) __msa_fill_b(e);
+ limit = (v16u8) __msa_fill_b(i);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP8_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev);
+ ILVR_B2_SH(p0, p1, q1, q0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp2, tmp3);
+ ILVL_B2_SH(p0, p1, q1, q0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp4, tmp5);
+
+ src -= 2;
+ ST4x8_UB(tmp2, tmp3, src, pitch);
+ src += (8 * pitch);
+ ST4x8_UB(tmp4, tmp5, src, pitch);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp8_mc_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_mc_msa.c
new file mode 100644
index 00000000000..2bf0abd8c92
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp8_mc_msa.c
@@ -0,0 +1,2332 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/vp8dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp8dsp_mips.h"
+
+static const uint8_t mc_filt_mask_arr[16 * 3] = {
+ /* 8 width cases */
+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
+ /* 4 width cases */
+ 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20,
+ /* 4 width cases */
+ 8, 9, 9, 10, 10, 11, 11, 12, 24, 25, 25, 26, 26, 27, 27, 28
+};
+
+static const int8_t subpel_filters_msa[7][8] = {
+ {-6, 123, 12, -1, 0, 0, 0, 0},
+ {2, -11, 108, 36, -8, 1, 0, 0}, /* New 1/4 pel 6 tap filter */
+ {-9, 93, 50, -6, 0, 0, 0, 0},
+ {3, -16, 77, 77, -16, 3, 0, 0}, /* New 1/2 pel 6 tap filter */
+ {-6, 50, 93, -9, 0, 0, 0, 0},
+ {1, -8, 36, 108, -11, 2, 0, 0}, /* New 1/4 pel 6 tap filter */
+ {-1, 12, 123, -6, 0, 0, 0, 0},
+};
+
+static const int8_t bilinear_filters_msa[7][2] = {
+ {112, 16},
+ {96, 32},
+ {80, 48},
+ {64, 64},
+ {48, 80},
+ {32, 96},
+ {16, 112}
+};
+
+#define HORIZ_6TAP_FILT(src0, src1, mask0, mask1, mask2, \
+ filt_h0, filt_h1, filt_h2) \
+( { \
+ v16i8 vec0_m, vec1_m, vec2_m; \
+ v8i16 hz_out_m; \
+ \
+ VSHF_B3_SB(src0, src1, src0, src1, src0, src1, mask0, mask1, mask2, \
+ vec0_m, vec1_m, vec2_m); \
+ hz_out_m = DPADD_SH3_SH(vec0_m, vec1_m, vec2_m, \
+ filt_h0, filt_h1, filt_h2); \
+ \
+ hz_out_m = __msa_srari_h(hz_out_m, 7); \
+ hz_out_m = __msa_sat_s_h(hz_out_m, 7); \
+ \
+ hz_out_m; \
+} )
+
+#define HORIZ_6TAP_4WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, mask2, \
+ filt0, filt1, filt2, \
+ out0, out1) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m, vec4_m, vec5_m; \
+ \
+ VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0_m, vec1_m); \
+ DOTP_SB2_SH(vec0_m, vec1_m, filt0, filt0, out0, out1); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec2_m, vec3_m); \
+ DPADD_SB2_SH(vec2_m, vec3_m, filt1, filt1, out0, out1); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask2, mask2, vec4_m, vec5_m); \
+ DPADD_SB2_SH(vec4_m, vec5_m, filt2, filt2, out0, out1); \
+}
+
+#define HORIZ_6TAP_8WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, mask2, \
+ filt0, filt1, filt2, \
+ out0, out1, out2, out3) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m, vec4_m, vec5_m, vec6_m, vec7_m; \
+ \
+ VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec2_m, vec3_m); \
+ DOTP_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt0, filt0, filt0, filt0, \
+ out0, out1, out2, out3); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec2_m, vec3_m); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask2, mask2, vec4_m, vec5_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask2, mask2, vec6_m, vec7_m); \
+ DPADD_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt1, filt1, filt1, filt1, \
+ out0, out1, out2, out3); \
+ DPADD_SB4_SH(vec4_m, vec5_m, vec6_m, vec7_m, filt2, filt2, filt2, filt2, \
+ out0, out1, out2, out3); \
+}
+
+#define FILT_4TAP_DPADD_S_H(vec0, vec1, filt0, filt1) \
+( { \
+ v8i16 tmp0; \
+ \
+ tmp0 = __msa_dotp_s_h((v16i8) vec0, (v16i8) filt0); \
+ tmp0 = __msa_dpadd_s_h(tmp0, (v16i8) vec1, (v16i8) filt1); \
+ \
+ tmp0; \
+} )
+
+#define HORIZ_4TAP_FILT(src0, src1, mask0, mask1, filt_h0, filt_h1) \
+( { \
+ v16i8 vec0_m, vec1_m; \
+ v8i16 hz_out_m; \
+ \
+ VSHF_B2_SB(src0, src1, src0, src1, mask0, mask1, vec0_m, vec1_m); \
+ hz_out_m = FILT_4TAP_DPADD_S_H(vec0_m, vec1_m, filt_h0, filt_h1); \
+ \
+ hz_out_m = __msa_srari_h(hz_out_m, 7); \
+ hz_out_m = __msa_sat_s_h(hz_out_m, 7); \
+ \
+ hz_out_m; \
+} )
+
+#define HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, filt0, filt1, \
+ out0, out1) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m; \
+ \
+ VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0_m, vec1_m); \
+ DOTP_SB2_SH(vec0_m, vec1_m, filt0, filt0, out0, out1); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec2_m, vec3_m); \
+ DPADD_SB2_SH(vec2_m, vec3_m, filt1, filt1, out0, out1); \
+}
+
+#define HORIZ_4TAP_8WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, filt0, filt1, \
+ out0, out1, out2, out3) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m; \
+ \
+ VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec2_m, vec3_m); \
+ DOTP_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt0, filt0, filt0, filt0, \
+ out0, out1, out2, out3); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec2_m, vec3_m); \
+ DPADD_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt1, filt1, filt1, filt1, \
+ out0, out1, out2, out3); \
+}
+
+static void common_hz_6t_4x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2;
+ v16u8 mask0, mask1, mask2, out;
+ v8i16 filt, out0, out1;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 2;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_6TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out0, out1);
+ SRARI_H2_SH(out0, out1, 7);
+ SAT_SH2_SH(out0, out1, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_6t_4x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2;
+ v16u8 mask0, mask1, mask2, out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 2;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_6TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out0, out1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_6TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_6t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_hz_6t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2;
+ v16u8 mask0, mask1, mask2, tmp0, tmp1;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+
+ src -= 2;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_6TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out0, out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ tmp0 = PCKEV_XORI128_UB(out0, out1);
+ tmp1 = PCKEV_XORI128_UB(out2, out3);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ for (loop_cnt = (height >> 2) - 1; loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_6TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out0, out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ tmp0 = PCKEV_XORI128_UB(out0, out1);
+ tmp1 = PCKEV_XORI128_UB(out2, out3);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, filt0, filt1, filt2;
+ v16u8 mask0, mask1, mask2, out;
+ v8i16 filt, out0, out1, out2, out3, out4, out5, out6, out7;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 2;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (4 * src_stride);
+
+ HORIZ_6TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ filt0, filt1, filt2, out0, out1, out2, out3);
+ HORIZ_6TAP_8WID_4VECS_FILT(src4, src5, src6, src7, mask0, mask1, mask2,
+ filt0, filt1, filt2, out4, out5, out6, out7);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SRARI_H4_SH(out4, out5, out6, out7, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out4, out5, out6, out7, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out4, out5);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out6, out7);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src21_r, src43_r, src65_r;
+ v16i8 src87_r, src2110, src4332, src6554, src8776, filt0, filt1, filt2;
+ v16u8 out;
+ v8i16 filt, out10, out32;
+
+ src -= (2 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3, src10_r, src21_r,
+ src32_r, src43_r);
+ ILVR_D2_SB(src21_r, src10_r, src43_r, src32_r, src2110, src4332);
+ XORI_B2_128_SB(src2110, src4332);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src5, src6, src7, src8);
+ src += (4 * src_stride);
+
+ ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r,
+ src65_r, src76_r, src87_r);
+ ILVR_D2_SB(src65_r, src54_r, src87_r, src76_r, src6554, src8776);
+ XORI_B2_128_SB(src6554, src8776);
+ out10 = DPADD_SH3_SH(src2110, src4332, src6554, filt0, filt1, filt2);
+ out32 = DPADD_SH3_SH(src4332, src6554, src8776, filt0, filt1, filt2);
+ SRARI_H2_SH(out10, out32, 7);
+ SAT_SH2_SH(out10, out32, 7);
+ out = PCKEV_XORI128_UB(out10, out32);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src2110 = src6554;
+ src4332 = src8776;
+ src4 = src8;
+ }
+}
+
+void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src7, src8, src9, src10;
+ v16i8 src10_r, src32_r, src76_r, src98_r, src21_r, src43_r, src87_r;
+ v16i8 src109_r, filt0, filt1, filt2;
+ v16u8 tmp0, tmp1;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r;
+
+ src -= (2 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ ILVR_B4_SB(src1, src0, src3, src2, src2, src1, src4, src3,
+ src10_r, src32_r, src21_r, src43_r);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ ILVR_B4_SB(src7, src4, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ out0_r = DPADD_SH3_SH(src10_r, src32_r, src76_r, filt0, filt1, filt2);
+ out1_r = DPADD_SH3_SH(src21_r, src43_r, src87_r, filt0, filt1, filt2);
+ out2_r = DPADD_SH3_SH(src32_r, src76_r, src98_r, filt0, filt1, filt2);
+ out3_r = DPADD_SH3_SH(src43_r, src87_r, src109_r, filt0, filt1, filt2);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ tmp0 = PCKEV_XORI128_UB(out0_r, out1_r);
+ tmp1 = PCKEV_XORI128_UB(out2_r, out3_r);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src76_r;
+ src32_r = src98_r;
+ src21_r = src87_r;
+ src43_r = src109_r;
+ src4 = src10;
+ }
+}
+
+void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src21_r, src43_r, src65_r;
+ v16i8 src87_r, src10_l, src32_l, src54_l, src76_l, src21_l, src43_l;
+ v16i8 src65_l, src87_l, filt0, filt1, filt2;
+ v16u8 tmp0, tmp1, tmp2, tmp3;
+ v8i16 out0_r, out1_r, out2_r, out3_r, out0_l, out1_l, out2_l, out3_l, filt;
+
+ src -= (2 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt0, filt1, filt2);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ ILVR_B4_SB(src1, src0, src3, src2, src4, src3, src2, src1, src10_r,
+ src32_r, src43_r, src21_r);
+ ILVL_B4_SB(src1, src0, src3, src2, src4, src3, src2, src1, src10_l,
+ src32_l, src43_l, src21_l);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src5, src6, src7, src8);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src5, src6, src7, src8);
+ ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r,
+ src65_r, src76_r, src87_r);
+ ILVL_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_l,
+ src65_l, src76_l, src87_l);
+ out0_r = DPADD_SH3_SH(src10_r, src32_r, src54_r, filt0, filt1,
+ filt2);
+ out1_r = DPADD_SH3_SH(src21_r, src43_r, src65_r, filt0, filt1,
+ filt2);
+ out2_r = DPADD_SH3_SH(src32_r, src54_r, src76_r, filt0, filt1,
+ filt2);
+ out3_r = DPADD_SH3_SH(src43_r, src65_r, src87_r, filt0, filt1,
+ filt2);
+ out0_l = DPADD_SH3_SH(src10_l, src32_l, src54_l, filt0, filt1,
+ filt2);
+ out1_l = DPADD_SH3_SH(src21_l, src43_l, src65_l, filt0, filt1,
+ filt2);
+ out2_l = DPADD_SH3_SH(src32_l, src54_l, src76_l, filt0, filt1,
+ filt2);
+ out3_l = DPADD_SH3_SH(src43_l, src65_l, src87_l, filt0, filt1,
+ filt2);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SRARI_H4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ PCKEV_B4_UB(out0_l, out0_r, out1_l, out1_r, out2_l, out2_r, out3_l,
+ out3_r, tmp0, tmp1, tmp2, tmp3);
+ XORI_B4_128_UB(tmp0, tmp1, tmp2, tmp3);
+ ST_UB4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src10_l = src54_l;
+ src32_l = src76_l;
+ src21_l = src65_l;
+ src43_l = src87_l;
+ src4 = src8;
+ }
+}
+
+void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 filt_hz0, filt_hz1, filt_hz2;
+ v16u8 mask0, mask1, mask2, out;
+ v8i16 tmp0, tmp1;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, filt, filt_vt0, filt_vt1, filt_vt2, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= (2 + 2 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt_hz0, filt_hz1, filt_hz2);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H3_SH(filt, 0, 1, 2, filt_vt0, filt_vt1, filt_vt2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_6TAP_FILT(src0, src1, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out2 = HORIZ_6TAP_FILT(src2, src3, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out1 = (v8i16) __msa_sldi_b((v16i8) hz_out2, (v16i8) hz_out0, 8);
+ hz_out3 = HORIZ_6TAP_FILT(src3, src4, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB2(src, src_stride, src5, src6);
+ src += (2 * src_stride);
+
+ XORI_B2_128_SB(src5, src6);
+ hz_out5 = HORIZ_6TAP_FILT(src5, src6, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out4 = (v8i16) __msa_sldi_b((v16i8) hz_out5, (v16i8) hz_out3, 8);
+
+ LD_SB2(src, src_stride, src7, src8);
+ src += (2 * src_stride);
+
+ XORI_B2_128_SB(src7, src8);
+ hz_out7 = HORIZ_6TAP_FILT(src7, src8, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out6 = (v8i16) __msa_sldi_b((v16i8) hz_out7, (v16i8) hz_out5, 8);
+
+ out2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp0 = DPADD_SH3_SH(out0, out1, out2, filt_vt0, filt_vt1, filt_vt2);
+
+ out3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp1 = DPADD_SH3_SH(out1, out2, out3, filt_vt0, filt_vt1, filt_vt2);
+
+ SRARI_H2_SH(tmp0, tmp1, 7);
+ SAT_SH2_SH(tmp0, tmp1, 7);
+ out = PCKEV_XORI128_UB(tmp0, tmp1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out3 = hz_out7;
+ out0 = out2;
+ out1 = out3;
+ }
+}
+
+void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 filt_hz0, filt_hz1, filt_hz2;
+ v16u8 mask0, mask1, mask2, vec0, vec1;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, out0, out1, out2, out3, out4, out5, out6, out7;
+ v8i16 tmp0, tmp1, tmp2, tmp3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= (2 + 2 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt_hz0, filt_hz1, filt_hz2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_6TAP_FILT(src0, src0, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out1 = HORIZ_6TAP_FILT(src1, src1, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out2 = HORIZ_6TAP_FILT(src2, src2, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out3 = HORIZ_6TAP_FILT(src3, src3, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out4 = HORIZ_6TAP_FILT(src4, src4, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H3_SH(filt, 0, 1, 2, filt_vt0, filt_vt1, filt_vt2);
+
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+ ILVEV_B2_SH(hz_out1, hz_out2, hz_out3, hz_out4, out3, out4);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src5, src6, src7, src8);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src5, src6, src7, src8);
+ hz_out5 = HORIZ_6TAP_FILT(src5, src5, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ out2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp0 = DPADD_SH3_SH(out0, out1, out2, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out6 = HORIZ_6TAP_FILT(src6, src6, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ out5 = (v8i16) __msa_ilvev_b((v16i8) hz_out6, (v16i8) hz_out5);
+ tmp1 = DPADD_SH3_SH(out3, out4, out5, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out7 = HORIZ_6TAP_FILT(src7, src7, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ out7 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp2 = DPADD_SH3_SH(out1, out2, out7, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out8 = HORIZ_6TAP_FILT(src8, src8, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ out6 = (v8i16) __msa_ilvev_b((v16i8) hz_out8, (v16i8) hz_out7);
+ tmp3 = DPADD_SH3_SH(out4, out5, out6, filt_vt0, filt_vt1, filt_vt2);
+
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ vec0 = PCKEV_XORI128_UB(tmp0, tmp1);
+ vec1 = PCKEV_XORI128_UB(tmp2, tmp3);
+ ST8x4_UB(vec0, vec1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out4 = hz_out8;
+ out0 = out2;
+ out1 = out7;
+ out3 = out5;
+ out4 = out6;
+ }
+}
+
+
+void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_put_vp8_epel8_h6v6_msa(dst, dst_stride, src, src_stride, height,
+ mx, my);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hz_4t_4x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, mask0, mask1;
+ v8i16 filt, out0, out1;
+ v16u8 out;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[16]);
+ src -= 1;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ filt0, filt1, out0, out1);
+ SRARI_H2_SH(out0, out1, 7);
+ SAT_SH2_SH(out0, out1, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_4t_4x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, mask0, mask1;
+ v16u8 out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[16]);
+ src -= 1;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ filt0, filt1, out0, out1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ filt0, filt1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_4t_4x16_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16i8 filt0, filt1, mask0, mask1;
+ v16u8 out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[16]);
+ src -= 1;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
+ HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ filt0, filt1, out0, out1);
+ HORIZ_4TAP_4WID_4VECS_FILT(src4, src5, src6, src7, mask0, mask1,
+ filt0, filt1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
+ HORIZ_4TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ filt0, filt1, out0, out1);
+ HORIZ_4TAP_4WID_4VECS_FILT(src4, src5, src6, src7, mask0, mask1,
+ filt0, filt1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_4t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_hz_4t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (16 == height) {
+ common_hz_4t_4x16_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, filt0, filt1, mask0, mask1;
+ v16u8 tmp0, tmp1;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[0]);
+ src -= 1;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ mask1 = mask0 + 2;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_4TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, filt0,
+ filt1, out0, out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ tmp0 = PCKEV_XORI128_UB(out0, out1);
+ tmp1 = PCKEV_XORI128_UB(out2, out3);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16i8 filt0, filt1, mask0, mask1;
+ v8i16 filt, out0, out1, out2, out3, out4, out5, out6, out7;
+ v16u8 out;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[0]);
+ src -= 1;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ mask1 = mask0 + 2;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
+ HORIZ_4TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, filt0,
+ filt1, out0, out1, out2, out3);
+ HORIZ_4TAP_8WID_4VECS_FILT(src4, src5, src6, src7, mask0, mask1, filt0,
+ filt1, out4, out5, out6, out7);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SRARI_H4_SH(out4, out5, out6, out7, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out4, out5, out6, out7, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out4, out5);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out6, out7);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5;
+ v16i8 src10_r, src32_r, src54_r, src21_r, src43_r, src65_r;
+ v16i8 src2110, src4332, filt0, filt1;
+ v8i16 filt, out10, out32;
+ v16u8 out;
+
+ src -= src_stride;
+
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r);
+
+ src2110 = (v16i8) __msa_ilvr_d((v2i64) src21_r, (v2i64) src10_r);
+ src2110 = (v16i8) __msa_xori_b((v16u8) src2110, 128);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB3(src, src_stride, src3, src4, src5);
+ src += (3 * src_stride);
+ ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r);
+ src4332 = (v16i8) __msa_ilvr_d((v2i64) src43_r, (v2i64) src32_r);
+ src4332 = (v16i8) __msa_xori_b((v16u8) src4332, 128);
+ out10 = FILT_4TAP_DPADD_S_H(src2110, src4332, filt0, filt1);
+
+ src2 = LD_SB(src);
+ src += (src_stride);
+ ILVR_B2_SB(src5, src4, src2, src5, src54_r, src65_r);
+ src2110 = (v16i8) __msa_ilvr_d((v2i64) src65_r, (v2i64) src54_r);
+ src2110 = (v16i8) __msa_xori_b((v16u8) src2110, 128);
+ out32 = FILT_4TAP_DPADD_S_H(src4332, src2110, filt0, filt1);
+ SRARI_H2_SH(out10, out32, 7);
+ SAT_SH2_SH(out10, out32, 7);
+ out = PCKEV_XORI128_UB(out10, out32);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src7, src8, src9, src10;
+ v16i8 src10_r, src72_r, src98_r, src21_r, src87_r, src109_r, filt0, filt1;
+ v16u8 tmp0, tmp1;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r;
+
+ src -= src_stride;
+
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ ILVR_B4_SB(src7, src2, src8, src7, src9, src8, src10, src9,
+ src72_r, src87_r, src98_r, src109_r);
+ out0_r = FILT_4TAP_DPADD_S_H(src10_r, src72_r, filt0, filt1);
+ out1_r = FILT_4TAP_DPADD_S_H(src21_r, src87_r, filt0, filt1);
+ out2_r = FILT_4TAP_DPADD_S_H(src72_r, src98_r, filt0, filt1);
+ out3_r = FILT_4TAP_DPADD_S_H(src87_r, src109_r, filt0, filt1);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ tmp0 = PCKEV_XORI128_UB(out0_r, out1_r);
+ tmp1 = PCKEV_XORI128_UB(out2_r, out3_r);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src98_r;
+ src21_r = src109_r;
+ src2 = src10;
+ }
+}
+
+void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6;
+ v16i8 src10_r, src32_r, src54_r, src21_r, src43_r, src65_r, src10_l;
+ v16i8 src32_l, src54_l, src21_l, src43_l, src65_l, filt0, filt1;
+ v16u8 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r, out0_l, out1_l, out2_l, out3_l;
+
+ src -= src_stride;
+
+ filt = LD_SH(filter);
+ SPLATI_H2_SB(filt, 0, 1, filt0, filt1);
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r);
+ ILVL_B2_SB(src1, src0, src2, src1, src10_l, src21_l);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src3, src4, src5, src6);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src3, src4, src5, src6);
+ ILVR_B4_SB(src3, src2, src4, src3, src5, src4, src6, src5,
+ src32_r, src43_r, src54_r, src65_r);
+ ILVL_B4_SB(src3, src2, src4, src3, src5, src4, src6, src5,
+ src32_l, src43_l, src54_l, src65_l);
+ out0_r = FILT_4TAP_DPADD_S_H(src10_r, src32_r, filt0, filt1);
+ out1_r = FILT_4TAP_DPADD_S_H(src21_r, src43_r, filt0, filt1);
+ out2_r = FILT_4TAP_DPADD_S_H(src32_r, src54_r, filt0, filt1);
+ out3_r = FILT_4TAP_DPADD_S_H(src43_r, src65_r, filt0, filt1);
+ out0_l = FILT_4TAP_DPADD_S_H(src10_l, src32_l, filt0, filt1);
+ out1_l = FILT_4TAP_DPADD_S_H(src21_l, src43_l, filt0, filt1);
+ out2_l = FILT_4TAP_DPADD_S_H(src32_l, src54_l, filt0, filt1);
+ out3_l = FILT_4TAP_DPADD_S_H(src43_l, src65_l, filt0, filt1);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SRARI_H4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ PCKEV_B4_UB(out0_l, out0_r, out1_l, out1_r, out2_l, out2_r, out3_l,
+ out3_r, tmp0, tmp1, tmp2, tmp3);
+ XORI_B4_128_UB(tmp0, tmp1, tmp2, tmp3);
+ ST_UB4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src21_r = src65_r;
+ src10_l = src54_l;
+ src21_l = src65_l;
+ src2 = src6;
+ }
+}
+
+void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, filt_hz0, filt_hz1;
+ v16u8 mask0, mask1, out;
+ v8i16 filt, filt_vt0, filt_vt1, tmp0, tmp1, vec0, vec1, vec2;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= (1 + 1 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H2_SB(filt, 0, 1, filt_hz0, filt_hz1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ hz_out0 = HORIZ_4TAP_FILT(src0, src1, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out1 = HORIZ_4TAP_FILT(src1, src2, mask0, mask1, filt_hz0, filt_hz1);
+ vec0 = (v8i16) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H2_SH(filt, 0, 1, filt_vt0, filt_vt1);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src3, src4, src5, src6);
+ src += (4 * src_stride);
+
+ XORI_B2_128_SB(src3, src4);
+ hz_out3 = HORIZ_4TAP_FILT(src3, src4, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out2 = (v8i16) __msa_sldi_b((v16i8) hz_out3, (v16i8) hz_out1, 8);
+ vec1 = (v8i16) __msa_ilvev_b((v16i8) hz_out3, (v16i8) hz_out2);
+ tmp0 = FILT_4TAP_DPADD_S_H(vec0, vec1, filt_vt0, filt_vt1);
+
+ XORI_B2_128_SB(src5, src6);
+ hz_out5 = HORIZ_4TAP_FILT(src5, src6, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out4 = (v8i16) __msa_sldi_b((v16i8) hz_out5, (v16i8) hz_out3, 8);
+ vec2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp1 = FILT_4TAP_DPADD_S_H(vec1, vec2, filt_vt0, filt_vt1);
+
+ SRARI_H2_SH(tmp0, tmp1, 7);
+ SAT_SH2_SH(tmp0, tmp1, 7);
+ out = PCKEV_XORI128_UB(tmp0, tmp1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out1 = hz_out5;
+ vec0 = vec2;
+ }
+}
+
+void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, filt_hz0, filt_hz1;
+ v16u8 mask0, mask1, out0, out1;
+ v8i16 filt, filt_vt0, filt_vt1, tmp0, tmp1, tmp2, tmp3;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3;
+ v8i16 vec0, vec1, vec2, vec3, vec4;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= (1 + 1 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H2_SB(filt, 0, 1, filt_hz0, filt_hz1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ hz_out0 = HORIZ_4TAP_FILT(src0, src0, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out1 = HORIZ_4TAP_FILT(src1, src1, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out2 = HORIZ_4TAP_FILT(src2, src2, mask0, mask1, filt_hz0, filt_hz1);
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out1, hz_out2, vec0, vec2);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H2_SH(filt, 0, 1, filt_vt0, filt_vt1);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src3, src4, src5, src6);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src3, src4, src5, src6);
+ hz_out3 = HORIZ_4TAP_FILT(src3, src3, mask0, mask1, filt_hz0, filt_hz1);
+ vec1 = (v8i16) __msa_ilvev_b((v16i8) hz_out3, (v16i8) hz_out2);
+ tmp0 = FILT_4TAP_DPADD_S_H(vec0, vec1, filt_vt0, filt_vt1);
+
+ hz_out0 = HORIZ_4TAP_FILT(src4, src4, mask0, mask1, filt_hz0, filt_hz1);
+ vec3 = (v8i16) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out3);
+ tmp1 = FILT_4TAP_DPADD_S_H(vec2, vec3, filt_vt0, filt_vt1);
+
+ hz_out1 = HORIZ_4TAP_FILT(src5, src5, mask0, mask1, filt_hz0, filt_hz1);
+ vec4 = (v8i16) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = FILT_4TAP_DPADD_S_H(vec1, vec4, filt_vt0, filt_vt1);
+
+ hz_out2 = HORIZ_4TAP_FILT(src6, src6, mask0, mask1, filt_hz0, filt_hz1);
+ ILVEV_B2_SH(hz_out3, hz_out0, hz_out1, hz_out2, vec0, vec1);
+ tmp3 = FILT_4TAP_DPADD_S_H(vec0, vec1, filt_vt0, filt_vt1);
+
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ out0 = PCKEV_XORI128_UB(tmp0, tmp1);
+ out1 = PCKEV_XORI128_UB(tmp2, tmp3);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ vec0 = vec4;
+ vec2 = vec1;
+ }
+}
+
+void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_put_vp8_epel8_h4v4_msa(dst, dst_stride, src, src_stride, height,
+ mx, my);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6;
+ v16i8 filt_hz0, filt_hz1, filt_hz2;
+ v16u8 res0, res1, mask0, mask1, mask2;
+ v8i16 filt, filt_vt0, filt_vt1, tmp0, tmp1, vec0, vec1, vec2;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= (2 + 1 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt_hz0, filt_hz1, filt_hz2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ hz_out0 = HORIZ_6TAP_FILT(src0, src1, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out1 = HORIZ_6TAP_FILT(src1, src2, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ vec0 = (v8i16) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H2_SH(filt, 0, 1, filt_vt0, filt_vt1);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src3, src4, src5, src6);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src3, src4, src5, src6);
+ hz_out3 = HORIZ_6TAP_FILT(src3, src4, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out2 = (v8i16) __msa_sldi_b((v16i8) hz_out3, (v16i8) hz_out1, 8);
+ vec1 = (v8i16) __msa_ilvev_b((v16i8) hz_out3, (v16i8) hz_out2);
+ tmp0 = FILT_4TAP_DPADD_S_H(vec0, vec1, filt_vt0, filt_vt1);
+
+ hz_out5 = HORIZ_6TAP_FILT(src5, src6, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out4 = (v8i16) __msa_sldi_b((v16i8) hz_out5, (v16i8) hz_out3, 8);
+ vec2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp1 = FILT_4TAP_DPADD_S_H(vec1, vec2, filt_vt0, filt_vt1);
+
+ SRARI_H2_SH(tmp0, tmp1, 7);
+ SAT_SH2_SH(tmp0, tmp1, 7);
+ PCKEV_B2_UB(tmp0, tmp0, tmp1, tmp1, res0, res1);
+ XORI_B2_128_UB(res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out1 = hz_out5;
+ vec0 = vec2;
+ }
+}
+
+void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6;
+ v16i8 filt_hz0, filt_hz1, filt_hz2, mask0, mask1, mask2;
+ v8i16 filt, filt_vt0, filt_vt1, hz_out0, hz_out1, hz_out2, hz_out3;
+ v8i16 tmp0, tmp1, tmp2, tmp3, vec0, vec1, vec2, vec3;
+ v16u8 out0, out1;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[0]);
+ src -= (2 + src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H3_SB(filt, 0, 1, 2, filt_hz0, filt_hz1, filt_hz2);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+
+ LD_SB3(src, src_stride, src0, src1, src2);
+ src += (3 * src_stride);
+
+ XORI_B3_128_SB(src0, src1, src2);
+ hz_out0 = HORIZ_6TAP_FILT(src0, src0, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out1 = HORIZ_6TAP_FILT(src1, src1, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ hz_out2 = HORIZ_6TAP_FILT(src2, src2, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out1, hz_out2, vec0, vec2);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H2_SH(filt, 0, 1, filt_vt0, filt_vt1);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src3, src4, src5, src6);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src3, src4, src5, src6);
+
+ hz_out3 = HORIZ_6TAP_FILT(src3, src3, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ vec1 = (v8i16) __msa_ilvev_b((v16i8) hz_out3, (v16i8) hz_out2);
+ tmp0 = FILT_4TAP_DPADD_S_H(vec0, vec1, filt_vt0, filt_vt1);
+
+ hz_out0 = HORIZ_6TAP_FILT(src4, src4, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ vec3 = (v8i16) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out3);
+ tmp1 = FILT_4TAP_DPADD_S_H(vec2, vec3, filt_vt0, filt_vt1);
+
+ hz_out1 = HORIZ_6TAP_FILT(src5, src5, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ vec0 = (v8i16) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = FILT_4TAP_DPADD_S_H(vec1, vec0, filt_vt0, filt_vt1);
+
+ hz_out2 = HORIZ_6TAP_FILT(src6, src6, mask0, mask1, mask2, filt_hz0,
+ filt_hz1, filt_hz2);
+ ILVEV_B2_SH(hz_out3, hz_out0, hz_out1, hz_out2, vec1, vec2);
+ tmp3 = FILT_4TAP_DPADD_S_H(vec1, vec2, filt_vt0, filt_vt1);
+
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ out0 = PCKEV_XORI128_UB(tmp0, tmp1);
+ out1 = PCKEV_XORI128_UB(tmp2, tmp3);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_put_vp8_epel8_h6v4_msa(dst, dst_stride, src, src_stride, height,
+ mx, my);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 filt_hz0, filt_hz1, mask0, mask1;
+ v16u8 out;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, tmp0, tmp1, out0, out1, out2, out3;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[16]);
+
+ src -= (1 + 2 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H2_SB(filt, 0, 1, filt_hz0, filt_hz1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_4TAP_FILT(src0, src1, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out2 = HORIZ_4TAP_FILT(src2, src3, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out3 = HORIZ_4TAP_FILT(src3, src4, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out1 = (v8i16) __msa_sldi_b((v16i8) hz_out2, (v16i8) hz_out0, 8);
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H3_SH(filt, 0, 1, 2, filt_vt0, filt_vt1, filt_vt2);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src5, src6, src7, src8);
+ XORI_B4_128_SB(src5, src6, src7, src8);
+ src += (4 * src_stride);
+
+ hz_out5 = HORIZ_4TAP_FILT(src5, src6, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out4 = (v8i16) __msa_sldi_b((v16i8) hz_out5, (v16i8) hz_out3, 8);
+ out2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp0 = DPADD_SH3_SH(out0, out1, out2, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out7 = HORIZ_4TAP_FILT(src7, src8, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out6 = (v8i16) __msa_sldi_b((v16i8) hz_out7, (v16i8) hz_out5, 8);
+ out3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp1 = DPADD_SH3_SH(out1, out2, out3, filt_vt0, filt_vt1, filt_vt2);
+
+ SRARI_H2_SH(tmp0, tmp1, 7);
+ SAT_SH2_SH(tmp0, tmp1, 7);
+ out = PCKEV_XORI128_UB(tmp0, tmp1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out3 = hz_out7;
+ out0 = out2;
+ out1 = out3;
+ }
+}
+
+void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = subpel_filters_msa[mx - 1];
+ const int8_t *filter_vert = subpel_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 filt_hz0, filt_hz1, mask0, mask1;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2, tmp0, tmp1, tmp2, tmp3;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, out0, out1, out2, out3, out4, out5, out6, out7;
+ v16u8 vec0, vec1;
+
+ mask0 = LD_SB(&mc_filt_mask_arr[0]);
+ src -= (1 + 2 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H2_SB(filt, 0, 1, filt_hz0, filt_hz1);
+
+ mask1 = mask0 + 2;
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ XORI_B5_128_SB(src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_4TAP_FILT(src0, src0, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out1 = HORIZ_4TAP_FILT(src1, src1, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out2 = HORIZ_4TAP_FILT(src2, src2, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out3 = HORIZ_4TAP_FILT(src3, src3, mask0, mask1, filt_hz0, filt_hz1);
+ hz_out4 = HORIZ_4TAP_FILT(src4, src4, mask0, mask1, filt_hz0, filt_hz1);
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+ ILVEV_B2_SH(hz_out1, hz_out2, hz_out3, hz_out4, out3, out4);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H3_SH(filt, 0, 1, 2, filt_vt0, filt_vt1, filt_vt2);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src5, src6, src7, src8);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src5, src6, src7, src8);
+
+ hz_out5 = HORIZ_4TAP_FILT(src5, src5, mask0, mask1, filt_hz0, filt_hz1);
+ out2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+ tmp0 = DPADD_SH3_SH(out0, out1, out2, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out6 = HORIZ_4TAP_FILT(src6, src6, mask0, mask1, filt_hz0, filt_hz1);
+ out5 = (v8i16) __msa_ilvev_b((v16i8) hz_out6, (v16i8) hz_out5);
+ tmp1 = DPADD_SH3_SH(out3, out4, out5, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out7 = HORIZ_4TAP_FILT(src7, src7, mask0, mask1, filt_hz0, filt_hz1);
+ out6 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp2 = DPADD_SH3_SH(out1, out2, out6, filt_vt0, filt_vt1, filt_vt2);
+
+ hz_out8 = HORIZ_4TAP_FILT(src8, src8, mask0, mask1, filt_hz0, filt_hz1);
+ out7 = (v8i16) __msa_ilvev_b((v16i8) hz_out8, (v16i8) hz_out7);
+ tmp3 = DPADD_SH3_SH(out4, out5, out7, filt_vt0, filt_vt1, filt_vt2);
+
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ vec0 = PCKEV_XORI128_UB(tmp0, tmp1);
+ vec1 = PCKEV_XORI128_UB(tmp2, tmp3);
+ ST8x4_UB(vec0, vec1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out4 = hz_out8;
+ out0 = out2;
+ out1 = out6;
+ out3 = out5;
+ out4 = out7;
+ }
+}
+
+void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_put_vp8_epel8_h4v6_msa(dst, dst_stride, src, src_stride, height,
+ mx, my);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hz_2t_4x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, mask;
+ v16u8 filt0, vec0, vec1, res0, res1;
+ v8u16 vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, vec2, vec3);
+ SRARI_H2_UH(vec2, vec3, 7);
+ PCKEV_B2_UB(vec2, vec2, vec3, vec3, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hz_2t_4x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 vec0, vec1, vec2, vec3, filt0;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16i8 res0, res1, res2, res3;
+ v8u16 vec4, vec5, vec6, vec7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src4, src5, src6, src7, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec4, vec5, vec6, vec7);
+ SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+ PCKEV_B4_SB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7,
+ res0, res1, res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_hz_2t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+static void common_hz_2t_8x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 filt0;
+ v16i8 src0, src1, src2, src3, mask;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, src0, src1);
+ ST8x4_UB(src0, src1, dst, dst_stride);
+}
+
+static void common_hz_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ v16u8 filt0;
+ v16i8 src0, src1, src2, src3, mask, out0, out1;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ if (16 == height) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst + 4 * dst_stride, dst_stride);
+ }
+}
+
+void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_8x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else {
+ common_hz_2t_8x8mult_msa(src, src_stride, dst, dst_stride, filter,
+ height);
+ }
+}
+
+void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 out0, out1, out2, out3, out4, out5, out6, out7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ loop_cnt = (height >> 2) - 1;
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out2, out3, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out4, out5, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out6, out7, dst);
+ dst += dst_stride;
+
+ for (; loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out2, out3, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out4, out5, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out6, out7, dst);
+ dst += dst_stride;
+ }
+}
+
+static void common_vt_2t_4x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4;
+ v16i8 src10_r, src32_r, src21_r, src43_r, src2110, src4332;
+ v16u8 filt0;
+ v8i16 filt;
+ v8u16 tmp0, tmp1;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3,
+ src10_r, src21_r, src32_r, src43_r);
+ ILVR_D2_SB(src21_r, src10_r, src43_r, src32_r, src2110, src4332);
+ DOTP_UB2_UH(src2110, src4332, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ src2110 = __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0);
+ ST4x4_UB(src2110, src2110, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_vt_2t_4x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src2110, src4332, src6554, src8776;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v16u8 filt0;
+ v8i16 filt;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ src8 = LD_SB(src);
+ src += src_stride;
+
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3, src10_r, src21_r,
+ src32_r, src43_r);
+ ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r, src65_r,
+ src76_r, src87_r);
+ ILVR_D4_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r,
+ src87_r, src76_r, src2110, src4332, src6554, src8776);
+ DOTP_UB4_UH(src2110, src4332, src6554, src8776, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, src2110, src4332);
+ ST4x4_UB(src2110, src2110, 0, 1, 2, 3, dst, dst_stride);
+ ST4x4_UB(src4332, src4332, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride);
+}
+
+void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_vt_2t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+static void common_vt_2t_8x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 src0, src1, src2, src3, src4, vec0, vec1, vec2, vec3, filt0;
+ v16i8 out0, out1;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_UB5(src, src_stride, src0, src1, src2, src3, src4);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec1);
+ ILVR_B2_UB(src3, src2, src4, src3, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+}
+
+static void common_vt_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v16i8 out0, out1;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src1, src2, src3, src4, src5, src6, src7, src8);
+ src += (8 * src_stride);
+
+ ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3,
+ vec0, vec1, vec2, vec3);
+ ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7,
+ vec4, vec5, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src8;
+ }
+}
+
+void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_8x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else {
+ common_vt_2t_8x8mult_msa(src, src_stride, dst, dst_stride, filter,
+ height);
+ }
+}
+
+void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+ dst += dst_stride;
+
+ ILVR_B2_UB(src3, src2, src4, src3, vec4, vec6);
+ ILVL_B2_UB(src3, src2, src4, src3, vec5, vec7);
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst);
+ dst += dst_stride;
+
+ src0 = src4;
+ }
+}
+
+static void common_hv_2ht_2vt_4x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask;
+ v16u8 filt_vt, filt_hz, vec0, vec1, res0, res1;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, filt, tmp0, tmp1;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ filt = LD_UH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out1 = (v8u16) __msa_sldi_b((v16i8) hz_out2, (v16i8) hz_out0, 8);
+ hz_out3 = (v8u16) __msa_pckod_d((v2i64) hz_out4, (v2i64) hz_out2);
+
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_B2_UB(tmp0, tmp0, tmp1, tmp1, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_4x8_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, mask;
+ v16i8 res0, res1, res2, res3;
+ v16u8 filt_hz, filt_vt, vec0, vec1, vec2, vec3;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8u16 hz_out7, hz_out8, vec4, vec5, vec6, vec7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ filt = LD_UH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_SB(src);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src5, mask, filt_hz, 7);
+ hz_out6 = HORIZ_2TAP_FILT_UH(src6, src7, mask, filt_hz, 7);
+ hz_out8 = HORIZ_2TAP_FILT_UH(src8, src8, mask, filt_hz, 7);
+ SLDI_B3_UH(hz_out2, hz_out4, hz_out6, hz_out0, hz_out2, hz_out4, hz_out1,
+ hz_out3, hz_out5, 8);
+ hz_out7 = (v8u16) __msa_pckod_d((v2i64) hz_out8, (v2i64) hz_out6);
+
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ ILVEV_B2_UB(hz_out4, hz_out5, hz_out6, hz_out7, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt_vt, filt_vt, filt_vt, filt_vt,
+ vec4, vec5, vec6, vec7);
+ SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+ SAT_UH4_UH(vec4, vec5, vec6, vec7, 7);
+ PCKEV_B4_SB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7,
+ res0, res1, res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_4x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else if (8 == height) {
+ common_hv_2ht_2vt_4x8_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ }
+}
+
+static void common_hv_2ht_2vt_8x4_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask, out0, out1;
+ v16u8 filt_hz, filt_vt, vec0, vec1, vec2, vec3;
+ v8u16 hz_out0, hz_out1, tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp0 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec1 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp1 = __msa_dotp_u_h(vec1, filt_vt);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec2 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = __msa_dotp_u_h(vec2, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec3 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp3 = __msa_dotp_u_h(vec3, filt_vt);
+
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_8x8mult_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, mask, out0, out1;
+ v16u8 filt_hz, filt_vt, vec0;
+ v8u16 hz_out0, hz_out1, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp1 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp2 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp3 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp4 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp3, tmp4, 7);
+ SAT_UH2_UH(tmp3, tmp4, 7);
+ PCKEV_B2_SB(tmp2, tmp1, tmp4, tmp3, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp5 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp6 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp7 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp8 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H4_UH(tmp5, tmp6, tmp7, tmp8, 7);
+ SAT_UH4_UH(tmp5, tmp6, tmp7, tmp8, 7);
+ PCKEV_B2_SB(tmp6, tmp5, tmp8, tmp7, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_8x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else {
+ common_hv_2ht_2vt_8x8mult_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert, height);
+ }
+}
+
+void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = bilinear_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt_hz, filt_vt, vec0, vec1;
+ v8u16 tmp1, tmp2, hz_out0, hz_out1, hz_out2, hz_out3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB2(src, 8, src0, src1);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src5, src5, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src6, src6, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src7, src7, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3, out4, out5, out6, out7;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 8) {
+ for (cnt = height >> 3; cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+ out4 = __msa_copy_u_d((v2i64) src4, 0);
+ out5 = __msa_copy_u_d((v2i64) src5, 0);
+ out6 = __msa_copy_u_d((v2i64) src6, 0);
+ out7 = __msa_copy_u_d((v2i64) src7, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(out4, out5, out6, out7, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 4) {
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
+
+static void copy_16multx8mult_msa(uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height, int32_t width)
+{
+ int32_t cnt, loop_cnt;
+ uint8_t *src_tmp, *dst_tmp;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src_tmp, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src_tmp += (8 * src_stride);
+
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst_tmp, dst_stride);
+ dst_tmp += (8 * dst_stride);
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3;
+
+ if (0 == height % 8) {
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 16);
+ } else if (0 == height % 4) {
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_init_mips.c
new file mode 100644
index 00000000000..58d1b6ce38e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_init_mips.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * VP8 compatible video decoder
+ */
+
+#include "config.h"
+#include "libavutil/attributes.h"
+#include "libavcodec/vp8dsp.h"
+#include "vp8dsp_mips.h"
+
+#define VP8_MC_MIPS_FUNC(IDX, SIZE) \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][1] = \
+ ff_put_vp8_epel##SIZE##_h4_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][2] = \
+ ff_put_vp8_epel##SIZE##_h6_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][1][0] = \
+ ff_put_vp8_epel##SIZE##_v4_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][1][1] = \
+ ff_put_vp8_epel##SIZE##_h4v4_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][1][2] = \
+ ff_put_vp8_epel##SIZE##_h6v4_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][2][0] = \
+ ff_put_vp8_epel##SIZE##_v6_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][2][1] = \
+ ff_put_vp8_epel##SIZE##_h4v6_msa; \
+ dsp->put_vp8_epel_pixels_tab[IDX][2][2] = \
+ ff_put_vp8_epel##SIZE##_h6v6_msa
+
+#define VP8_BILINEAR_MC_MIPS_FUNC(IDX, SIZE) \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = \
+ ff_put_vp8_bilinear##SIZE##_h_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = \
+ ff_put_vp8_bilinear##SIZE##_h_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = \
+ ff_put_vp8_bilinear##SIZE##_v_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = \
+ ff_put_vp8_bilinear##SIZE##_hv_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = \
+ ff_put_vp8_bilinear##SIZE##_hv_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = \
+ ff_put_vp8_bilinear##SIZE##_v_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = \
+ ff_put_vp8_bilinear##SIZE##_hv_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = \
+ ff_put_vp8_bilinear##SIZE##_hv_msa
+
+#define VP8_MC_MIPS_COPY(IDX, SIZE) \
+ dsp->put_vp8_epel_pixels_tab[IDX][0][0] = \
+ ff_put_vp8_pixels##SIZE##_msa; \
+ dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = \
+ ff_put_vp8_pixels##SIZE##_msa;
+
+#if HAVE_MSA
+static av_cold void vp8dsp_init_msa(VP8DSPContext *dsp)
+{
+ dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_msa;
+ dsp->vp8_idct_add = ff_vp8_idct_add_msa;
+ dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_msa;
+ dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_msa;
+ dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_msa;
+
+ VP8_MC_MIPS_FUNC(0, 16);
+ VP8_MC_MIPS_FUNC(1, 8);
+ VP8_MC_MIPS_FUNC(2, 4);
+
+ VP8_BILINEAR_MC_MIPS_FUNC(0, 16);
+ VP8_BILINEAR_MC_MIPS_FUNC(1, 8);
+ VP8_BILINEAR_MC_MIPS_FUNC(2, 4);
+
+ VP8_MC_MIPS_COPY(0, 16);
+ VP8_MC_MIPS_COPY(1, 8);
+
+ dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_msa;
+ dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_msa;
+ dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_msa;
+ dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_msa;
+
+ dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_msa;
+ dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_msa;
+ dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_msa;
+ dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_msa;
+
+ dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_msa;
+ dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_msa;
+}
+#endif // #if HAVE_MSA
+
+av_cold void ff_vp8dsp_init_mips(VP8DSPContext *dsp)
+{
+#if HAVE_MSA
+ vp8dsp_init_msa(dsp);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_mips.h
new file mode 100644
index 00000000000..8e715b58be8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp8dsp_mips.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_VP8DSP_MIPS_H
+#define AVCODEC_MIPS_VP8DSP_MIPS_H
+
+void ff_put_vp8_pixels4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int x, int y);
+void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int x, int y);
+void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int x, int y);
+
+void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dststride,
+ uint8_t *src, ptrdiff_t srcstride,
+ int h, int mx, int my);
+
+/* loop filter */
+void ff_vp8_h_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
+ int32_t e, int32_t i, int32_t h);
+void ff_vp8_v_loop_filter16_inner_msa(uint8_t *dst, ptrdiff_t stride,
+ int32_t e, int32_t i, int32_t h);
+void ff_vp8_h_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
+ ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_v_loop_filter8uv_inner_msa(uint8_t *dst_u, uint8_t *dst_v,
+ ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_h_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_v_loop_filter16_msa(uint8_t *dst, ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_h_loop_filter8uv_msa(uint8_t *dst_u, uint8_t *dst_v,
+ ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_v_loop_filter8uv_msa(uint8_t *dst_u, uint8_t *dst_v,
+ ptrdiff_t stride,
+ int flim_e, int flim_i, int hev_thresh);
+void ff_vp8_h_loop_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
+void ff_vp8_v_loop_filter_simple_msa(uint8_t *dst, ptrdiff_t stride, int flim);
+
+/* Idct functions */
+void ff_vp8_luma_dc_wht_msa(int16_t block[4][4][16], int16_t dc[16]);
+void ff_vp8_idct_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
+void ff_vp8_idct_dc_add_msa(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
+void ff_vp8_idct_dc_add4uv_msa(uint8_t *dst, int16_t block[4][16],
+ ptrdiff_t stride);
+void ff_vp8_idct_dc_add4y_msa(uint8_t *dst, int16_t block[4][16],
+ ptrdiff_t stride);
+
+#endif // #ifndef AVCODEC_MIPS_VP8DSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9_idct_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_idct_msa.c
new file mode 100644
index 00000000000..25ea16c72a0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_idct_msa.c
@@ -0,0 +1,2138 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+#include "libavcodec/vp9dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp9dsp_mips.h"
+
+#define VP9_DCT_CONST_BITS 14
+#define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n) - 1))) >> (n))
+
+static const int32_t cospi_1_64 = 16364;
+static const int32_t cospi_2_64 = 16305;
+static const int32_t cospi_3_64 = 16207;
+static const int32_t cospi_4_64 = 16069;
+static const int32_t cospi_5_64 = 15893;
+static const int32_t cospi_6_64 = 15679;
+static const int32_t cospi_7_64 = 15426;
+static const int32_t cospi_8_64 = 15137;
+static const int32_t cospi_9_64 = 14811;
+static const int32_t cospi_10_64 = 14449;
+static const int32_t cospi_11_64 = 14053;
+static const int32_t cospi_12_64 = 13623;
+static const int32_t cospi_13_64 = 13160;
+static const int32_t cospi_14_64 = 12665;
+static const int32_t cospi_15_64 = 12140;
+static const int32_t cospi_16_64 = 11585;
+static const int32_t cospi_17_64 = 11003;
+static const int32_t cospi_18_64 = 10394;
+static const int32_t cospi_19_64 = 9760;
+static const int32_t cospi_20_64 = 9102;
+static const int32_t cospi_21_64 = 8423;
+static const int32_t cospi_22_64 = 7723;
+static const int32_t cospi_23_64 = 7005;
+static const int32_t cospi_24_64 = 6270;
+static const int32_t cospi_25_64 = 5520;
+static const int32_t cospi_26_64 = 4756;
+static const int32_t cospi_27_64 = 3981;
+static const int32_t cospi_28_64 = 3196;
+static const int32_t cospi_29_64 = 2404;
+static const int32_t cospi_30_64 = 1606;
+static const int32_t cospi_31_64 = 804;
+
+// 16384 * sqrt(2) * sin(kPi/9) * 2 / 3
+static const int32_t sinpi_1_9 = 5283;
+static const int32_t sinpi_2_9 = 9929;
+static const int32_t sinpi_3_9 = 13377;
+static const int32_t sinpi_4_9 = 15212;
+
+#define VP9_DOTP_CONST_PAIR(reg0, reg1, cnst0, cnst1, out0, out1) \
+{ \
+ v8i16 k0_m = __msa_fill_h(cnst0); \
+ v4i32 s0_m, s1_m, s2_m, s3_m; \
+ \
+ s0_m = (v4i32) __msa_fill_h(cnst1); \
+ k0_m = __msa_ilvev_h((v8i16) s0_m, k0_m); \
+ \
+ ILVRL_H2_SW((-reg1), reg0, s1_m, s0_m); \
+ ILVRL_H2_SW(reg0, reg1, s3_m, s2_m); \
+ DOTP_SH2_SW(s1_m, s0_m, k0_m, k0_m, s1_m, s0_m); \
+ SRARI_W2_SW(s1_m, s0_m, VP9_DCT_CONST_BITS); \
+ out0 = __msa_pckev_h((v8i16) s0_m, (v8i16) s1_m); \
+ \
+ DOTP_SH2_SW(s3_m, s2_m, k0_m, k0_m, s1_m, s0_m); \
+ SRARI_W2_SW(s1_m, s0_m, VP9_DCT_CONST_BITS); \
+ out1 = __msa_pckev_h((v8i16) s0_m, (v8i16) s1_m); \
+}
+
+#define VP9_DOT_ADD_SUB_SRARI_PCK(in0, in1, in2, in3, in4, in5, in6, in7, \
+ dst0, dst1, dst2, dst3) \
+{ \
+ v4i32 tp0_m, tp1_m, tp2_m, tp3_m, tp4_m; \
+ v4i32 tp5_m, tp6_m, tp7_m, tp8_m, tp9_m; \
+ \
+ DOTP_SH4_SW(in0, in1, in0, in1, in4, in4, in5, in5, \
+ tp0_m, tp2_m, tp3_m, tp4_m); \
+ DOTP_SH4_SW(in2, in3, in2, in3, in6, in6, in7, in7, \
+ tp5_m, tp6_m, tp7_m, tp8_m); \
+ BUTTERFLY_4(tp0_m, tp3_m, tp7_m, tp5_m, tp1_m, tp9_m, tp7_m, tp5_m); \
+ BUTTERFLY_4(tp2_m, tp4_m, tp8_m, tp6_m, tp3_m, tp0_m, tp4_m, tp2_m); \
+ SRARI_W4_SW(tp1_m, tp9_m, tp7_m, tp5_m, VP9_DCT_CONST_BITS); \
+ SRARI_W4_SW(tp3_m, tp0_m, tp4_m, tp2_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H4_SH(tp1_m, tp3_m, tp9_m, tp0_m, tp7_m, tp4_m, tp5_m, tp2_m, \
+ dst0, dst1, dst2, dst3); \
+}
+
+#define VP9_DOT_SHIFT_RIGHT_PCK_H(in0, in1, in2) \
+( { \
+ v8i16 dst_m; \
+ v4i32 tp0_m, tp1_m; \
+ \
+ DOTP_SH2_SW(in0, in1, in2, in2, tp1_m, tp0_m); \
+ SRARI_W2_SW(tp1_m, tp0_m, VP9_DCT_CONST_BITS); \
+ dst_m = __msa_pckev_h((v8i16) tp1_m, (v8i16) tp0_m); \
+ \
+ dst_m; \
+} )
+
+#define VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, \
+ out0, out1, out2, out3, out4, out5, out6, out7) \
+{ \
+ v8i16 cnst0_m, cnst1_m, cnst2_m, cnst3_m, cnst4_m; \
+ v8i16 vec0_m, vec1_m, vec2_m, vec3_m, s0_m, s1_m; \
+ v8i16 coeff0_m = { cospi_2_64, cospi_6_64, cospi_10_64, cospi_14_64, \
+ cospi_18_64, cospi_22_64, cospi_26_64, cospi_30_64 }; \
+ v8i16 coeff1_m = { cospi_8_64, -cospi_8_64, cospi_16_64, \
+ -cospi_16_64, cospi_24_64, -cospi_24_64, 0, 0 }; \
+ \
+ SPLATI_H2_SH(coeff0_m, 0, 7, cnst0_m, cnst1_m); \
+ cnst2_m = -cnst0_m; \
+ ILVEV_H2_SH(cnst0_m, cnst1_m, cnst1_m, cnst2_m, cnst0_m, cnst1_m); \
+ SPLATI_H2_SH(coeff0_m, 4, 3, cnst2_m, cnst3_m); \
+ cnst4_m = -cnst2_m; \
+ ILVEV_H2_SH(cnst2_m, cnst3_m, cnst3_m, cnst4_m, cnst2_m, cnst3_m); \
+ \
+ ILVRL_H2_SH(in0, in7, vec1_m, vec0_m); \
+ ILVRL_H2_SH(in4, in3, vec3_m, vec2_m); \
+ VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
+ cnst1_m, cnst2_m, cnst3_m, in7, in0, \
+ in4, in3); \
+ \
+ SPLATI_H2_SH(coeff0_m, 2, 5, cnst0_m, cnst1_m); \
+ cnst2_m = -cnst0_m; \
+ ILVEV_H2_SH(cnst0_m, cnst1_m, cnst1_m, cnst2_m, cnst0_m, cnst1_m); \
+ SPLATI_H2_SH(coeff0_m, 6, 1, cnst2_m, cnst3_m); \
+ cnst4_m = -cnst2_m; \
+ ILVEV_H2_SH(cnst2_m, cnst3_m, cnst3_m, cnst4_m, cnst2_m, cnst3_m); \
+ \
+ ILVRL_H2_SH(in2, in5, vec1_m, vec0_m); \
+ ILVRL_H2_SH(in6, in1, vec3_m, vec2_m); \
+ \
+ VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
+ cnst1_m, cnst2_m, cnst3_m, in5, in2, \
+ in6, in1); \
+ BUTTERFLY_4(in7, in0, in2, in5, s1_m, s0_m, in2, in5); \
+ out7 = -s0_m; \
+ out0 = s1_m; \
+ \
+ SPLATI_H4_SH(coeff1_m, 0, 4, 1, 5, \
+ cnst0_m, cnst1_m, cnst2_m, cnst3_m); \
+ \
+ ILVEV_H2_SH(cnst3_m, cnst0_m, cnst1_m, cnst2_m, cnst3_m, cnst2_m); \
+ cnst0_m = __msa_ilvev_h(cnst1_m, cnst0_m); \
+ cnst1_m = cnst0_m; \
+ \
+ ILVRL_H2_SH(in4, in3, vec1_m, vec0_m); \
+ ILVRL_H2_SH(in6, in1, vec3_m, vec2_m); \
+ VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
+ cnst2_m, cnst3_m, cnst1_m, out1, out6, \
+ s0_m, s1_m); \
+ \
+ SPLATI_H2_SH(coeff1_m, 2, 3, cnst0_m, cnst1_m); \
+ cnst1_m = __msa_ilvev_h(cnst1_m, cnst0_m); \
+ \
+ ILVRL_H2_SH(in2, in5, vec1_m, vec0_m); \
+ ILVRL_H2_SH(s0_m, s1_m, vec3_m, vec2_m); \
+ out3 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec0_m, vec1_m, cnst0_m); \
+ out4 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec0_m, vec1_m, cnst1_m); \
+ out2 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec2_m, vec3_m, cnst0_m); \
+ out5 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec2_m, vec3_m, cnst1_m); \
+ \
+ out1 = -out1; \
+ out3 = -out3; \
+ out5 = -out5; \
+}
+
+#define VP9_MADD_SHORT(m0, m1, c0, c1, res0, res1) \
+{ \
+ v4i32 madd0_m, madd1_m, madd2_m, madd3_m; \
+ v8i16 madd_s0_m, madd_s1_m; \
+ \
+ ILVRL_H2_SH(m1, m0, madd_s0_m, madd_s1_m); \
+ DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s0_m, madd_s1_m, \
+ c0, c0, c1, c1, madd0_m, madd1_m, madd2_m, madd3_m); \
+ SRARI_W4_SW(madd0_m, madd1_m, madd2_m, madd3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(madd1_m, madd0_m, madd3_m, madd2_m, res0, res1); \
+}
+
+#define VP9_MADD_BF(inp0, inp1, inp2, inp3, cst0, cst1, cst2, cst3, \
+ out0, out1, out2, out3) \
+{ \
+ v8i16 madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m; \
+ v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m, m4_m, m5_m; \
+ \
+ ILVRL_H2_SH(inp1, inp0, madd_s0_m, madd_s1_m); \
+ ILVRL_H2_SH(inp3, inp2, madd_s2_m, madd_s3_m); \
+ DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m, \
+ cst0, cst0, cst2, cst2, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ BUTTERFLY_4(tmp0_m, tmp1_m, tmp3_m, tmp2_m, \
+ m4_m, m5_m, tmp3_m, tmp2_m); \
+ SRARI_W4_SW(m4_m, m5_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m5_m, m4_m, tmp3_m, tmp2_m, out0, out1); \
+ DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m, \
+ cst1, cst1, cst3, cst3, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ BUTTERFLY_4(tmp0_m, tmp1_m, tmp3_m, tmp2_m, \
+ m4_m, m5_m, tmp3_m, tmp2_m); \
+ SRARI_W4_SW(m4_m, m5_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m5_m, m4_m, tmp3_m, tmp2_m, out2, out3); \
+}
+
+#define VP9_SET_COSPI_PAIR(c0_h, c1_h) \
+( { \
+ v8i16 out0_m, r0_m, r1_m; \
+ \
+ r0_m = __msa_fill_h(c0_h); \
+ r1_m = __msa_fill_h(c1_h); \
+ out0_m = __msa_ilvev_h(r1_m, r0_m); \
+ \
+ out0_m; \
+} )
+
+#define VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3) \
+{ \
+ uint8_t *dst_m = (uint8_t *) (dst); \
+ v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
+ v16i8 tmp0_m, tmp1_m; \
+ v16i8 zero_m = { 0 }; \
+ v8i16 res0_m, res1_m, res2_m, res3_m; \
+ \
+ LD_UB4(dst_m, dst_stride, dst0_m, dst1_m, dst2_m, dst3_m); \
+ ILVR_B4_SH(zero_m, dst0_m, zero_m, dst1_m, zero_m, dst2_m, \
+ zero_m, dst3_m, res0_m, res1_m, res2_m, res3_m); \
+ ADD4(res0_m, in0, res1_m, in1, res2_m, in2, res3_m, in3, \
+ res0_m, res1_m, res2_m, res3_m); \
+ CLIP_SH4_0_255(res0_m, res1_m, res2_m, res3_m); \
+ PCKEV_B2_SB(res1_m, res0_m, res3_m, res2_m, tmp0_m, tmp1_m); \
+ ST8x4_UB(tmp0_m, tmp1_m, dst_m, dst_stride); \
+}
+
+#define VP9_IDCT4x4(in0, in1, in2, in3, out0, out1, out2, out3) \
+{ \
+ v8i16 c0_m, c1_m, c2_m, c3_m; \
+ v8i16 step0_m, step1_m; \
+ v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ \
+ c0_m = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64); \
+ c1_m = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64); \
+ step0_m = __msa_ilvr_h(in2, in0); \
+ DOTP_SH2_SW(step0_m, step0_m, c0_m, c1_m, tmp0_m, tmp1_m); \
+ \
+ c2_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
+ c3_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
+ step1_m = __msa_ilvr_h(in3, in1); \
+ DOTP_SH2_SW(step1_m, step1_m, c2_m, c3_m, tmp2_m, tmp3_m); \
+ SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ \
+ PCKEV_H2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, tmp0_m, tmp2_m); \
+ SLDI_B2_0_SW(tmp0_m, tmp2_m, tmp1_m, tmp3_m, 8); \
+ BUTTERFLY_4((v8i16) tmp0_m, (v8i16) tmp1_m, \
+ (v8i16) tmp2_m, (v8i16) tmp3_m, \
+ out0, out1, out2, out3); \
+}
+
+#define VP9_IADST4x4(in0, in1, in2, in3, out0, out1, out2, out3) \
+{ \
+ v8i16 res0_m, res1_m, c0_m, c1_m; \
+ v8i16 k1_m, k2_m, k3_m, k4_m; \
+ v8i16 zero_m = { 0 }; \
+ v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ v4i32 int0_m, int1_m, int2_m, int3_m; \
+ v8i16 mask_m = { sinpi_1_9, sinpi_2_9, sinpi_3_9, \
+ sinpi_4_9, -sinpi_1_9, -sinpi_2_9, -sinpi_3_9, \
+ -sinpi_4_9 }; \
+ \
+ SPLATI_H4_SH(mask_m, 3, 0, 1, 2, c0_m, c1_m, k1_m, k2_m); \
+ ILVEV_H2_SH(c0_m, c1_m, k1_m, k2_m, c0_m, c1_m); \
+ ILVR_H2_SH(in0, in2, in1, in3, res0_m, res1_m); \
+ DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp2_m, tmp1_m); \
+ int0_m = tmp2_m + tmp1_m; \
+ \
+ SPLATI_H2_SH(mask_m, 4, 7, k4_m, k3_m); \
+ ILVEV_H2_SH(k4_m, k1_m, k3_m, k2_m, c0_m, c1_m); \
+ DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp0_m, tmp1_m); \
+ int1_m = tmp0_m + tmp1_m; \
+ \
+ c0_m = __msa_splati_h(mask_m, 6); \
+ ILVL_H2_SH(k2_m, c0_m, zero_m, k2_m, c0_m, c1_m); \
+ ILVR_H2_SH(in0, in2, in1, in3, res0_m, res1_m); \
+ DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp0_m, tmp1_m); \
+ int2_m = tmp0_m + tmp1_m; \
+ \
+ c0_m = __msa_splati_h(mask_m, 6); \
+ c0_m = __msa_ilvev_h(c0_m, k1_m); \
+ \
+ res0_m = __msa_ilvr_h((in1), (in3)); \
+ tmp0_m = __msa_dotp_s_w(res0_m, c0_m); \
+ int3_m = tmp2_m + tmp0_m; \
+ \
+ res0_m = __msa_ilvr_h((in2), (in3)); \
+ c1_m = __msa_ilvev_h(k4_m, k3_m); \
+ \
+ tmp2_m = __msa_dotp_s_w(res0_m, c1_m); \
+ res1_m = __msa_ilvr_h((in0), (in2)); \
+ c1_m = __msa_ilvev_h(k1_m, zero_m); \
+ \
+ tmp3_m = __msa_dotp_s_w(res1_m, c1_m); \
+ int3_m += tmp2_m; \
+ int3_m += tmp3_m; \
+ \
+ SRARI_W4_SW(int0_m, int1_m, int2_m, int3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(int0_m, int0_m, int1_m, int1_m, out0, out1); \
+ PCKEV_H2_SH(int2_m, int2_m, int3_m, int3_m, out2, out3); \
+}
+
+#define TRANSPOSE4X8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, \
+ out0, out1, out2, out3, out4, out5, out6, out7) \
+{ \
+ v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ v8i16 tmp0_n, tmp1_n, tmp2_n, tmp3_n; \
+ v8i16 zero_m = { 0 }; \
+ \
+ ILVR_H4_SH(in1, in0, in3, in2, in5, in4, in7, in6, \
+ tmp0_n, tmp1_n, tmp2_n, tmp3_n); \
+ ILVRL_W2_SH(tmp1_n, tmp0_n, tmp0_m, tmp2_m); \
+ ILVRL_W2_SH(tmp3_n, tmp2_n, tmp1_m, tmp3_m); \
+ \
+ out0 = (v8i16) __msa_ilvr_d((v2i64) tmp1_m, (v2i64) tmp0_m); \
+ out1 = (v8i16) __msa_ilvl_d((v2i64) tmp1_m, (v2i64) tmp0_m); \
+ out2 = (v8i16) __msa_ilvr_d((v2i64) tmp3_m, (v2i64) tmp2_m); \
+ out3 = (v8i16) __msa_ilvl_d((v2i64) tmp3_m, (v2i64) tmp2_m); \
+ \
+ out4 = zero_m; \
+ out5 = zero_m; \
+ out6 = zero_m; \
+ out7 = zero_m; \
+}
+
+static void vp9_idct4x4_1_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int16_t out;
+ v8i16 vec;
+
+ out = ROUND_POWER_OF_TWO((input[0] * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO((out * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO(out, 4);
+ vec = __msa_fill_h(out);
+
+ ADDBLK_ST4x4_UB(vec, vec, vec, vec, dst, dst_stride);
+}
+
+static void vp9_idct4x4_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 in0, in1, in2, in3;
+
+ /* load vector elements of 4x4 block */
+ LD4x4_SH(input, in0, in1, in2, in3);
+ /* rows */
+ VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* columns */
+ TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
+ VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* rounding (add 2^3, divide by 2^4) */
+ SRARI_H4_SH(in0, in1, in2, in3, 4);
+ ADDBLK_ST4x4_UB(in0, in1, in2, in3, dst, dst_stride);
+}
+
+static void vp9_iadst4x4_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 in0, in1, in2, in3;
+
+ /* load vector elements of 4x4 block */
+ LD4x4_SH(input, in0, in1, in2, in3);
+ /* rows */
+ VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* columns */
+ TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
+ VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* rounding (add 2^3, divide by 2^4) */
+ SRARI_H4_SH(in0, in1, in2, in3, 4);
+ ADDBLK_ST4x4_UB(in0, in1, in2, in3, dst, dst_stride);
+}
+
+static void vp9_iadst_idct_4x4_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ v8i16 in0, in1, in2, in3;
+
+ /* load vector elements of 4x4 block */
+ LD4x4_SH(input, in0, in1, in2, in3);
+ /* cols */
+ VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* columns */
+ TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
+ VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* rounding (add 2^3, divide by 2^4) */
+ SRARI_H4_SH(in0, in1, in2, in3, 4);
+ ADDBLK_ST4x4_UB(in0, in1, in2, in3, dst, dst_stride);
+}
+
+static void vp9_idct_iadst_4x4_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ v8i16 in0, in1, in2, in3;
+
+ /* load vector elements of 4x4 block */
+ LD4x4_SH(input, in0, in1, in2, in3);
+ /* cols */
+ VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* columns */
+ TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
+ VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
+ /* rounding (add 2^3, divide by 2^4) */
+ SRARI_H4_SH(in0, in1, in2, in3, 4);
+ ADDBLK_ST4x4_UB(in0, in1, in2, in3, dst, dst_stride);
+}
+
+#define VP9_SET_CONST_PAIR(mask_h, idx1_h, idx2_h) \
+( { \
+ v8i16 c0_m, c1_m; \
+ \
+ SPLATI_H2_SH(mask_h, idx1_h, idx2_h, c0_m, c1_m); \
+ c0_m = __msa_ilvev_h(c1_m, c0_m); \
+ \
+ c0_m; \
+} )
+
+/* multiply and add macro */
+#define VP9_MADD(inp0, inp1, inp2, inp3, cst0, cst1, cst2, cst3, \
+ out0, out1, out2, out3) \
+{ \
+ v8i16 madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m; \
+ v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ \
+ ILVRL_H2_SH(inp1, inp0, madd_s1_m, madd_s0_m); \
+ ILVRL_H2_SH(inp3, inp2, madd_s3_m, madd_s2_m); \
+ DOTP_SH4_SW(madd_s1_m, madd_s0_m, madd_s1_m, madd_s0_m, \
+ cst0, cst0, cst1, cst1, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \
+ DOTP_SH4_SW(madd_s3_m, madd_s2_m, madd_s3_m, madd_s2_m, \
+ cst2, cst2, cst3, cst3, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out2, out3); \
+}
+
+/* idct 8x8 macro */
+#define VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7, \
+ out0, out1, out2, out3, out4, out5, out6, out7) \
+{ \
+ v8i16 tp0_m, tp1_m, tp2_m, tp3_m, tp4_m, tp5_m, tp6_m, tp7_m; \
+ v8i16 k0_m, k1_m, k2_m, k3_m, res0_m, res1_m, res2_m, res3_m; \
+ v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ v8i16 mask_m = { cospi_28_64, cospi_4_64, cospi_20_64, cospi_12_64, \
+ cospi_16_64, -cospi_4_64, -cospi_20_64, -cospi_16_64 }; \
+ \
+ k0_m = VP9_SET_CONST_PAIR(mask_m, 0, 5); \
+ k1_m = VP9_SET_CONST_PAIR(mask_m, 1, 0); \
+ k2_m = VP9_SET_CONST_PAIR(mask_m, 6, 3); \
+ k3_m = VP9_SET_CONST_PAIR(mask_m, 3, 2); \
+ VP9_MADD(in1, in7, in3, in5, k0_m, k1_m, k2_m, k3_m, in1, in7, in3, in5); \
+ SUB2(in1, in3, in7, in5, res0_m, res1_m); \
+ k0_m = VP9_SET_CONST_PAIR(mask_m, 4, 7); \
+ k1_m = __msa_splati_h(mask_m, 4); \
+ \
+ ILVRL_H2_SH(res0_m, res1_m, res2_m, res3_m); \
+ DOTP_SH4_SW(res2_m, res3_m, res2_m, res3_m, k0_m, k0_m, k1_m, k1_m, \
+ tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
+ tp4_m = in1 + in3; \
+ PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, tp5_m, tp6_m); \
+ tp7_m = in7 + in5; \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
+ k3_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
+ VP9_MADD(in0, in4, in2, in6, k1_m, k0_m, k2_m, k3_m, \
+ in0, in4, in2, in6); \
+ BUTTERFLY_4(in0, in4, in2, in6, tp0_m, tp1_m, tp2_m, tp3_m); \
+ BUTTERFLY_8(tp0_m, tp1_m, tp2_m, tp3_m, tp4_m, tp5_m, tp6_m, tp7_m, \
+ out0, out1, out2, out3, out4, out5, out6, out7); \
+}
+
+#define VP9_IADST8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7, \
+ out0, out1, out2, out3, out4, out5, out6, out7) \
+{ \
+ v4i32 r0_m, r1_m, r2_m, r3_m, r4_m, r5_m, r6_m, r7_m; \
+ v4i32 m0_m, m1_m, m2_m, m3_m, t0_m, t1_m; \
+ v8i16 res0_m, res1_m, res2_m, res3_m, k0_m, k1_m, in_s0, in_s1; \
+ v8i16 mask1_m = { cospi_2_64, cospi_30_64, -cospi_2_64, \
+ cospi_10_64, cospi_22_64, -cospi_10_64, cospi_18_64, cospi_14_64 }; \
+ v8i16 mask2_m = { cospi_14_64, -cospi_18_64, cospi_26_64, \
+ cospi_6_64, -cospi_26_64, cospi_8_64, cospi_24_64, -cospi_8_64 }; \
+ v8i16 mask3_m = { -cospi_24_64, cospi_8_64, cospi_16_64, \
+ -cospi_16_64, 0, 0, 0, 0 }; \
+ \
+ k0_m = VP9_SET_CONST_PAIR(mask1_m, 0, 1); \
+ k1_m = VP9_SET_CONST_PAIR(mask1_m, 1, 2); \
+ ILVRL_H2_SH(in1, in0, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ r0_m, r1_m, r2_m, r3_m); \
+ k0_m = VP9_SET_CONST_PAIR(mask1_m, 6, 7); \
+ k1_m = VP9_SET_CONST_PAIR(mask2_m, 0, 1); \
+ ILVRL_H2_SH(in5, in4, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ r4_m, r5_m, r6_m, r7_m); \
+ ADD4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, res0_m, res1_m); \
+ SUB4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SW(m1_m, m0_m, m3_m, m2_m, t0_m, t1_m); \
+ k0_m = VP9_SET_CONST_PAIR(mask1_m, 3, 4); \
+ k1_m = VP9_SET_CONST_PAIR(mask1_m, 4, 5); \
+ ILVRL_H2_SH(in3, in2, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ r0_m, r1_m, r2_m, r3_m); \
+ k0_m = VP9_SET_CONST_PAIR(mask2_m, 2, 3); \
+ k1_m = VP9_SET_CONST_PAIR(mask2_m, 3, 4); \
+ ILVRL_H2_SH(in7, in6, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ r4_m, r5_m, r6_m, r7_m); \
+ ADD4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, res2_m, res3_m); \
+ SUB4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SW(m1_m, m0_m, m3_m, m2_m, r2_m, r3_m); \
+ ILVRL_H2_SW(r3_m, r2_m, m2_m, m3_m); \
+ BUTTERFLY_4(res0_m, res1_m, res3_m, res2_m, out0, in7, in4, in3); \
+ k0_m = VP9_SET_CONST_PAIR(mask2_m, 5, 6); \
+ k1_m = VP9_SET_CONST_PAIR(mask2_m, 6, 7); \
+ ILVRL_H2_SH(t1_m, t0_m, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ r0_m, r1_m, r2_m, r3_m); \
+ k1_m = VP9_SET_CONST_PAIR(mask3_m, 0, 1); \
+ DOTP_SH4_SW(m2_m, m3_m, m2_m, m3_m, k0_m, k0_m, k1_m, k1_m, \
+ r4_m, r5_m, r6_m, r7_m); \
+ ADD4(r0_m, r6_m, r1_m, r7_m, r2_m, r4_m, r3_m, r5_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in1, out6); \
+ SUB4(r0_m, r6_m, r1_m, r7_m, r2_m, r4_m, r3_m, r5_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in2, in5); \
+ k0_m = VP9_SET_CONST_PAIR(mask3_m, 2, 2); \
+ k1_m = VP9_SET_CONST_PAIR(mask3_m, 2, 3); \
+ ILVRL_H2_SH(in4, in3, in_s1, in_s0); \
+ DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in3, out4); \
+ ILVRL_H2_SW(in5, in2, m2_m, m3_m); \
+ DOTP_SH4_SW(m2_m, m3_m, m2_m, m3_m, k0_m, k0_m, k1_m, k1_m, \
+ m0_m, m1_m, m2_m, m3_m); \
+ SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
+ PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, out2, in5); \
+ \
+ out1 = -in1; \
+ out3 = -in3; \
+ out5 = -in5; \
+ out7 = -in7; \
+}
+
+static void vp9_idct8x8_1_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int16_t out;
+ int32_t val;
+ v8i16 vec;
+
+ out = ROUND_POWER_OF_TWO((input[0] * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO((out * cospi_16_64), VP9_DCT_CONST_BITS);
+ val = ROUND_POWER_OF_TWO(out, 5);
+ vec = __msa_fill_h(val);
+
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, vec, vec, vec, vec);
+ dst += (4 * dst_stride);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, vec, vec, vec, vec);
+}
+
+static void vp9_idct8x8_12_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v8i16 s0, s1, s2, s3, s4, s5, s6, s7, k0, k1, k2, k3, m0, m1, m2, m3;
+ v4i32 tmp0, tmp1, tmp2, tmp3;
+ v8i16 zero = { 0 };
+
+ /* load vector elements of 8x8 block */
+ LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ ILVR_D2_SH(in1, in0, in3, in2, in0, in1);
+ ILVR_D2_SH(in5, in4, in7, in6, in2, in3);
+ //TRANSPOSE8X4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
+
+ /* stage1 */
+ ILVL_H2_SH(in3, in0, in2, in1, s0, s1);
+ k0 = VP9_SET_COSPI_PAIR(cospi_28_64, -cospi_4_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_4_64, cospi_28_64);
+ k2 = VP9_SET_COSPI_PAIR(-cospi_20_64, cospi_12_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_12_64, cospi_20_64);
+ DOTP_SH4_SW(s0, s0, s1, s1, k0, k1, k2, k3, tmp0, tmp1, tmp2, tmp3);
+ SRARI_W4_SW(tmp0, tmp1, tmp2, tmp3, VP9_DCT_CONST_BITS);
+ PCKEV_H2_SH(zero, tmp0, zero, tmp1, s0, s1);
+ PCKEV_H2_SH(zero, tmp2, zero, tmp3, s2, s3);
+ BUTTERFLY_4(s0, s1, s3, s2, s4, s7, s6, s5);
+
+ /* stage2 */
+ ILVR_H2_SH(in3, in1, in2, in0, s1, s0);
+ k0 = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64);
+ DOTP_SH4_SW(s0, s0, s1, s1, k0, k1, k2, k3, tmp0, tmp1, tmp2, tmp3);
+ SRARI_W4_SW(tmp0, tmp1, tmp2, tmp3, VP9_DCT_CONST_BITS);
+ PCKEV_H2_SH(zero, tmp0, zero, tmp1, s0, s1);
+ PCKEV_H2_SH(zero, tmp2, zero, tmp3, s2, s3);
+ BUTTERFLY_4(s0, s1, s2, s3, m0, m1, m2, m3);
+
+ /* stage3 */
+ s0 = __msa_ilvr_h(s6, s5);
+
+ k1 = VP9_SET_COSPI_PAIR(-cospi_16_64, cospi_16_64);
+ DOTP_SH2_SW(s0, s0, k1, k0, tmp0, tmp1);
+ SRARI_W2_SW(tmp0, tmp1, VP9_DCT_CONST_BITS);
+ PCKEV_H2_SH(zero, tmp0, zero, tmp1, s2, s3);
+
+ /* stage4 */
+ BUTTERFLY_8(m0, m1, m2, m3, s4, s2, s3, s7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ TRANSPOSE4X8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ /* final rounding (add 2^4, divide by 2^5) and shift */
+ SRARI_H4_SH(in0, in1, in2, in3, 5);
+ SRARI_H4_SH(in4, in5, in6, in7, 5);
+
+ /* add block and store 8x8 */
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3);
+ dst += (4 * dst_stride);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in4, in5, in6, in7);
+}
+
+static void vp9_idct8x8_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+
+ /* load vector elements of 8x8 block */
+ LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+ /* 1D idct8x8 */
+ VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* columns transform */
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* 1D idct8x8 */
+ VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* final rounding (add 2^4, divide by 2^5) and shift */
+ SRARI_H4_SH(in0, in1, in2, in3, 5);
+ SRARI_H4_SH(in4, in5, in6, in7, 5);
+ /* add block and store 8x8 */
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3);
+ dst += (4 * dst_stride);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in4, in5, in6, in7);
+}
+
+static void vp9_iadst8x8_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+ v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v8i16 out0, out1, out2, out3, out4, out5, out6, out7;
+ v8i16 cnst0, cnst1, cnst2, cnst3, cnst4;
+ v8i16 temp0, temp1, temp2, temp3, s0, s1;
+ v16i8 zero = { 0 };
+
+ /* load vector elements of 8x8 block */
+ LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+
+ /* 1D adst8x8 */
+ VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ /* columns transform */
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+
+ cnst0 = __msa_fill_h(cospi_2_64);
+ cnst1 = __msa_fill_h(cospi_30_64);
+ cnst2 = -cnst0;
+ ILVEV_H2_SH(cnst0, cnst1, cnst1, cnst2, cnst0, cnst1);
+ cnst2 = __msa_fill_h(cospi_18_64);
+ cnst3 = __msa_fill_h(cospi_14_64);
+ cnst4 = -cnst2;
+ ILVEV_H2_SH(cnst2, cnst3, cnst3, cnst4, cnst2, cnst3);
+
+ ILVRL_H2_SH(in0, in7, temp1, temp0);
+ ILVRL_H2_SH(in4, in3, temp3, temp2);
+ VP9_DOT_ADD_SUB_SRARI_PCK(temp0, temp1, temp2, temp3, cnst0, cnst1, cnst2,
+ cnst3, in7, in0, in4, in3);
+
+ cnst0 = __msa_fill_h(cospi_10_64);
+ cnst1 = __msa_fill_h(cospi_22_64);
+ cnst2 = -cnst0;
+ ILVEV_H2_SH(cnst0, cnst1, cnst1, cnst2, cnst0, cnst1);
+ cnst2 = __msa_fill_h(cospi_26_64);
+ cnst3 = __msa_fill_h(cospi_6_64);
+ cnst4 = -cnst2;
+ ILVEV_H2_SH(cnst2, cnst3, cnst3, cnst4, cnst2, cnst3);
+
+ ILVRL_H2_SH(in2, in5, temp1, temp0);
+ ILVRL_H2_SH(in6, in1, temp3, temp2);
+ VP9_DOT_ADD_SUB_SRARI_PCK(temp0, temp1, temp2, temp3, cnst0, cnst1, cnst2,
+ cnst3, in5, in2, in6, in1);
+ BUTTERFLY_4(in7, in0, in2, in5, s1, s0, in2, in5);
+ out7 = -s0;
+ out0 = s1;
+ SRARI_H2_SH(out0, out7, 5);
+ dst0 = LD_UB(dst + 0 * dst_stride);
+ dst7 = LD_UB(dst + 7 * dst_stride);
+
+ res0 = (v8i16) __msa_ilvr_b(zero, (v16i8) dst0);
+ res0 += out0;
+ res0 = CLIP_SH_0_255(res0);
+ res0 = (v8i16) __msa_pckev_b((v16i8) res0, (v16i8) res0);
+ ST8x1_UB(res0, dst);
+
+ res7 = (v8i16) __msa_ilvr_b(zero, (v16i8) dst7);
+ res7 += out7;
+ res7 = CLIP_SH_0_255(res7);
+ res7 = (v8i16) __msa_pckev_b((v16i8) res7, (v16i8) res7);
+ ST8x1_UB(res7, dst + 7 * dst_stride);
+
+ cnst1 = __msa_fill_h(cospi_24_64);
+ cnst0 = __msa_fill_h(cospi_8_64);
+ cnst3 = -cnst1;
+ cnst2 = -cnst0;
+
+ ILVEV_H2_SH(cnst3, cnst0, cnst1, cnst2, cnst3, cnst2);
+ cnst0 = __msa_ilvev_h(cnst1, cnst0);
+ cnst1 = cnst0;
+
+ ILVRL_H2_SH(in4, in3, temp1, temp0);
+ ILVRL_H2_SH(in6, in1, temp3, temp2);
+ VP9_DOT_ADD_SUB_SRARI_PCK(temp0, temp1, temp2, temp3, cnst0, cnst2, cnst3,
+ cnst1, out1, out6, s0, s1);
+ out1 = -out1;
+ SRARI_H2_SH(out1, out6, 5);
+ dst1 = LD_UB(dst + 1 * dst_stride);
+ dst6 = LD_UB(dst + 6 * dst_stride);
+ ILVR_B2_SH(zero, dst1, zero, dst6, res1, res6);
+ ADD2(res1, out1, res6, out6, res1, res6);
+ CLIP_SH2_0_255(res1, res6);
+ PCKEV_B2_SH(res1, res1, res6, res6, res1, res6);
+ ST8x1_UB(res1, dst + dst_stride);
+ ST8x1_UB(res6, dst + 6 * dst_stride);
+
+ cnst0 = __msa_fill_h(cospi_16_64);
+ cnst1 = -cnst0;
+ cnst1 = __msa_ilvev_h(cnst1, cnst0);
+
+ ILVRL_H2_SH(in2, in5, temp1, temp0);
+ ILVRL_H2_SH(s0, s1, temp3, temp2);
+ out3 = VP9_DOT_SHIFT_RIGHT_PCK_H(temp0, temp1, cnst0);
+ out4 = VP9_DOT_SHIFT_RIGHT_PCK_H(temp0, temp1, cnst1);
+ out3 = -out3;
+ SRARI_H2_SH(out3, out4, 5);
+ dst3 = LD_UB(dst + 3 * dst_stride);
+ dst4 = LD_UB(dst + 4 * dst_stride);
+ ILVR_B2_SH(zero, dst3, zero, dst4, res3, res4);
+ ADD2(res3, out3, res4, out4, res3, res4);
+ CLIP_SH2_0_255(res3, res4);
+ PCKEV_B2_SH(res3, res3, res4, res4, res3, res4);
+ ST8x1_UB(res3, dst + 3 * dst_stride);
+ ST8x1_UB(res4, dst + 4 * dst_stride);
+
+ out2 = VP9_DOT_SHIFT_RIGHT_PCK_H(temp2, temp3, cnst0);
+ out5 = VP9_DOT_SHIFT_RIGHT_PCK_H(temp2, temp3, cnst1);
+ out5 = -out5;
+ SRARI_H2_SH(out2, out5, 5);
+ dst2 = LD_UB(dst + 2 * dst_stride);
+ dst5 = LD_UB(dst + 5 * dst_stride);
+ ILVR_B2_SH(zero, dst2, zero, dst5, res2, res5);
+ ADD2(res2, out2, res5, out5, res2, res5);
+ CLIP_SH2_0_255(res2, res5);
+ PCKEV_B2_SH(res2, res2, res5, res5, res2, res5);
+ ST8x1_UB(res2, dst + 2 * dst_stride);
+ ST8x1_UB(res5, dst + 5 * dst_stride);
+}
+
+static void vp9_iadst_idct_8x8_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+
+ /* load vector elements of 8x8 block */
+ LD_SH8(input, 8, in1, in6, in3, in4, in5, in2, in7, in0);
+ /* 1D idct8x8 */
+ VP9_IADST8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* columns transform */
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* 1D idct8x8 */
+ VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* final rounding (add 2^4, divide by 2^5) and shift */
+ SRARI_H4_SH(in0, in1, in2, in3, 5);
+ SRARI_H4_SH(in4, in5, in6, in7, 5);
+ /* add block and store 8x8 */
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3);
+ dst += (4 * dst_stride);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in4, in5, in6, in7);
+}
+
+static void vp9_idct_iadst_8x8_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
+
+ /* load vector elements of 8x8 block */
+ LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
+
+ /* 1D idct8x8 */
+ VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* columns transform */
+ TRANSPOSE8x8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,
+ in1, in6, in3, in4, in5, in2, in7, in0);
+ /* 1D idct8x8 */
+ VP9_IADST8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
+ /* final rounding (add 2^4, divide by 2^5) and shift */
+ SRARI_H4_SH(in0, in1, in2, in3, 5);
+ SRARI_H4_SH(in4, in5, in6, in7, 5);
+ /* add block and store 8x8 */
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3);
+ dst += (4 * dst_stride);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in4, in5, in6, in7);
+}
+
+#define VP9_IADST8x16_1D(r0, r1, r2, r3, r4, r5, r6, r7, r8, \
+ r9, r10, r11, r12, r13, r14, r15, \
+ out0, out1, out2, out3, out4, out5, \
+ out6, out7, out8, out9, out10, out11, \
+ out12, out13, out14, out15) \
+{ \
+ v8i16 g0_m, g1_m, g2_m, g3_m, g4_m, g5_m, g6_m, g7_m; \
+ v8i16 g8_m, g9_m, g10_m, g11_m, g12_m, g13_m, g14_m, g15_m; \
+ v8i16 h0_m, h1_m, h2_m, h3_m, h4_m, h5_m, h6_m, h7_m; \
+ v8i16 h8_m, h9_m, h10_m, h11_m; \
+ v8i16 k0_m, k1_m, k2_m, k3_m; \
+ \
+ /* stage 1 */ \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_1_64, cospi_31_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_31_64, -cospi_1_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_17_64, cospi_15_64); \
+ k3_m = VP9_SET_COSPI_PAIR(cospi_15_64, -cospi_17_64); \
+ VP9_MADD_BF(r15, r0, r7, r8, k0_m, k1_m, k2_m, k3_m, \
+ g0_m, g1_m, g2_m, g3_m); \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_5_64, cospi_27_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_27_64, -cospi_5_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_21_64, cospi_11_64); \
+ k3_m = VP9_SET_COSPI_PAIR(cospi_11_64, -cospi_21_64); \
+ VP9_MADD_BF(r13, r2, r5, r10, k0_m, k1_m, k2_m, k3_m, \
+ g4_m, g5_m, g6_m, g7_m); \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_9_64, cospi_23_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_23_64, -cospi_9_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_25_64, cospi_7_64); \
+ k3_m = VP9_SET_COSPI_PAIR(cospi_7_64, -cospi_25_64); \
+ VP9_MADD_BF(r11, r4, r3, r12, k0_m, k1_m, k2_m, k3_m, \
+ g8_m, g9_m, g10_m, g11_m); \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_13_64, cospi_19_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_19_64, -cospi_13_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_29_64, cospi_3_64); \
+ k3_m = VP9_SET_COSPI_PAIR(cospi_3_64, -cospi_29_64); \
+ VP9_MADD_BF(r9, r6, r1, r14, k0_m, k1_m, k2_m, k3_m, \
+ g12_m, g13_m, g14_m, g15_m); \
+ \
+ /* stage 2 */ \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_4_64, cospi_28_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_28_64, -cospi_4_64); \
+ k2_m = VP9_SET_COSPI_PAIR(-cospi_28_64, cospi_4_64); \
+ VP9_MADD_BF(g1_m, g3_m, g9_m, g11_m, k0_m, k1_m, k2_m, k0_m, \
+ h0_m, h1_m, h2_m, h3_m); \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_12_64, cospi_20_64); \
+ k1_m = VP9_SET_COSPI_PAIR(-cospi_20_64, cospi_12_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_20_64, -cospi_12_64); \
+ VP9_MADD_BF(g7_m, g5_m, g15_m, g13_m, k0_m, k1_m, k2_m, k0_m, \
+ h4_m, h5_m, h6_m, h7_m); \
+ BUTTERFLY_4(h0_m, h2_m, h6_m, h4_m, out8, out9, out11, out10); \
+ BUTTERFLY_8(g0_m, g2_m, g4_m, g6_m, g14_m, g12_m, g10_m, g8_m, \
+ h8_m, h9_m, h10_m, h11_m, h6_m, h4_m, h2_m, h0_m); \
+ \
+ /* stage 3 */ \
+ BUTTERFLY_4(h8_m, h9_m, h11_m, h10_m, out0, out1, h11_m, h10_m); \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
+ k1_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
+ k2_m = VP9_SET_COSPI_PAIR(-cospi_24_64, cospi_8_64); \
+ VP9_MADD_BF(h0_m, h2_m, h4_m, h6_m, k0_m, k1_m, k2_m, k0_m, \
+ out4, out6, out5, out7); \
+ VP9_MADD_BF(h1_m, h3_m, h5_m, h7_m, k0_m, k1_m, k2_m, k0_m, \
+ out12, out14, out13, out15); \
+ \
+ /* stage 4 */ \
+ k0_m = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64); \
+ k1_m = VP9_SET_COSPI_PAIR(-cospi_16_64, -cospi_16_64); \
+ k2_m = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64); \
+ k3_m = VP9_SET_COSPI_PAIR(-cospi_16_64, cospi_16_64); \
+ VP9_MADD_SHORT(h10_m, h11_m, k1_m, k2_m, out2, out3); \
+ VP9_MADD_SHORT(out6, out7, k0_m, k3_m, out6, out7); \
+ VP9_MADD_SHORT(out10, out11, k0_m, k3_m, out10, out11); \
+ VP9_MADD_SHORT(out14, out15, k1_m, k2_m, out14, out15); \
+}
+
+static void vp9_idct16_1d_columns_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 loc0, loc1, loc2, loc3;
+ v8i16 reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14;
+ v8i16 reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15;
+ v8i16 tmp5, tmp6, tmp7;
+
+ /* load up 8x8 */
+ LD_SH8(input, 16, reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
+ input += 8 * 16;
+ /* load bottom 8x8 */
+ LD_SH8(input, 16, reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15);
+
+ VP9_DOTP_CONST_PAIR(reg2, reg14, cospi_28_64, cospi_4_64, reg2, reg14);
+ VP9_DOTP_CONST_PAIR(reg10, reg6, cospi_12_64, cospi_20_64, reg10, reg6);
+ BUTTERFLY_4(reg2, reg14, reg6, reg10, loc0, loc1, reg14, reg2);
+ VP9_DOTP_CONST_PAIR(reg14, reg2, cospi_16_64, cospi_16_64, loc2, loc3);
+ VP9_DOTP_CONST_PAIR(reg0, reg8, cospi_16_64, cospi_16_64, reg0, reg8);
+ VP9_DOTP_CONST_PAIR(reg4, reg12, cospi_24_64, cospi_8_64, reg4, reg12);
+ BUTTERFLY_4(reg8, reg0, reg4, reg12, reg2, reg6, reg10, reg14);
+
+ reg0 = reg2 - loc1;
+ reg2 = reg2 + loc1;
+ reg12 = reg14 - loc0;
+ reg14 = reg14 + loc0;
+ reg4 = reg6 - loc3;
+ reg6 = reg6 + loc3;
+ reg8 = reg10 - loc2;
+ reg10 = reg10 + loc2;
+
+ /* stage 2 */
+ VP9_DOTP_CONST_PAIR(reg1, reg15, cospi_30_64, cospi_2_64, reg1, reg15);
+ VP9_DOTP_CONST_PAIR(reg9, reg7, cospi_14_64, cospi_18_64, loc2, loc3);
+
+ reg9 = reg1 - loc2;
+ reg1 = reg1 + loc2;
+ reg7 = reg15 - loc3;
+ reg15 = reg15 + loc3;
+
+ VP9_DOTP_CONST_PAIR(reg5, reg11, cospi_22_64, cospi_10_64, reg5, reg11);
+ VP9_DOTP_CONST_PAIR(reg13, reg3, cospi_6_64, cospi_26_64, loc0, loc1);
+ BUTTERFLY_4(loc0, loc1, reg11, reg5, reg13, reg3, reg11, reg5);
+
+ loc1 = reg15 + reg3;
+ reg3 = reg15 - reg3;
+ loc2 = reg2 + loc1;
+ reg15 = reg2 - loc1;
+
+ loc1 = reg1 + reg13;
+ reg13 = reg1 - reg13;
+ loc0 = reg0 + loc1;
+ loc1 = reg0 - loc1;
+ tmp6 = loc0;
+ tmp7 = loc1;
+ reg0 = loc2;
+
+ VP9_DOTP_CONST_PAIR(reg7, reg9, cospi_24_64, cospi_8_64, reg7, reg9);
+ VP9_DOTP_CONST_PAIR((-reg5), (-reg11), cospi_8_64, cospi_24_64, reg5,
+ reg11);
+
+ loc0 = reg9 + reg5;
+ reg5 = reg9 - reg5;
+ reg2 = reg6 + loc0;
+ reg1 = reg6 - loc0;
+
+ loc0 = reg7 + reg11;
+ reg11 = reg7 - reg11;
+ loc1 = reg4 + loc0;
+ loc2 = reg4 - loc0;
+ tmp5 = loc1;
+
+ VP9_DOTP_CONST_PAIR(reg5, reg11, cospi_16_64, cospi_16_64, reg5, reg11);
+ BUTTERFLY_4(reg8, reg10, reg11, reg5, loc0, reg4, reg9, loc1);
+
+ reg10 = loc0;
+ reg11 = loc1;
+
+ VP9_DOTP_CONST_PAIR(reg3, reg13, cospi_16_64, cospi_16_64, reg3, reg13);
+ BUTTERFLY_4(reg12, reg14, reg13, reg3, reg8, reg6, reg7, reg5);
+ reg13 = loc2;
+
+ /* Transpose and store the output */
+ reg12 = tmp5;
+ reg14 = tmp6;
+ reg3 = tmp7;
+
+ SRARI_H4_SH(reg0, reg2, reg4, reg6, 6);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, reg0, reg2, reg4, reg6);
+ dst += (4 * dst_stride);
+ SRARI_H4_SH(reg8, reg10, reg12, reg14, 6);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, reg8, reg10, reg12, reg14);
+ dst += (4 * dst_stride);
+ SRARI_H4_SH(reg3, reg13, reg11, reg5, 6);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, reg3, reg13, reg11, reg5);
+ dst += (4 * dst_stride);
+ SRARI_H4_SH(reg7, reg9, reg1, reg15, 6);
+ VP9_ADDBLK_ST8x4_UB(dst, dst_stride, reg7, reg9, reg1, reg15);
+}
+
+static void vp9_idct16_1d_columns_msa(int16_t *input, int16_t *output)
+{
+ v8i16 loc0, loc1, loc2, loc3;
+ v8i16 reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14;
+ v8i16 reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15;
+ v8i16 tmp5, tmp6, tmp7;
+
+ /* load up 8x8 */
+ LD_SH8(input, 16, reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
+ input += 8 * 16;
+ /* load bottom 8x8 */
+ LD_SH8(input, 16, reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15);
+
+ VP9_DOTP_CONST_PAIR(reg2, reg14, cospi_28_64, cospi_4_64, reg2, reg14);
+ VP9_DOTP_CONST_PAIR(reg10, reg6, cospi_12_64, cospi_20_64, reg10, reg6);
+ BUTTERFLY_4(reg2, reg14, reg6, reg10, loc0, loc1, reg14, reg2);
+ VP9_DOTP_CONST_PAIR(reg14, reg2, cospi_16_64, cospi_16_64, loc2, loc3);
+ VP9_DOTP_CONST_PAIR(reg0, reg8, cospi_16_64, cospi_16_64, reg0, reg8);
+ VP9_DOTP_CONST_PAIR(reg4, reg12, cospi_24_64, cospi_8_64, reg4, reg12);
+ BUTTERFLY_4(reg8, reg0, reg4, reg12, reg2, reg6, reg10, reg14);
+
+ reg0 = reg2 - loc1;
+ reg2 = reg2 + loc1;
+ reg12 = reg14 - loc0;
+ reg14 = reg14 + loc0;
+ reg4 = reg6 - loc3;
+ reg6 = reg6 + loc3;
+ reg8 = reg10 - loc2;
+ reg10 = reg10 + loc2;
+
+ /* stage 2 */
+ VP9_DOTP_CONST_PAIR(reg1, reg15, cospi_30_64, cospi_2_64, reg1, reg15);
+ VP9_DOTP_CONST_PAIR(reg9, reg7, cospi_14_64, cospi_18_64, loc2, loc3);
+
+ reg9 = reg1 - loc2;
+ reg1 = reg1 + loc2;
+ reg7 = reg15 - loc3;
+ reg15 = reg15 + loc3;
+
+ VP9_DOTP_CONST_PAIR(reg5, reg11, cospi_22_64, cospi_10_64, reg5, reg11);
+ VP9_DOTP_CONST_PAIR(reg13, reg3, cospi_6_64, cospi_26_64, loc0, loc1);
+ BUTTERFLY_4(loc0, loc1, reg11, reg5, reg13, reg3, reg11, reg5);
+
+ loc1 = reg15 + reg3;
+ reg3 = reg15 - reg3;
+ loc2 = reg2 + loc1;
+ reg15 = reg2 - loc1;
+
+ loc1 = reg1 + reg13;
+ reg13 = reg1 - reg13;
+ loc0 = reg0 + loc1;
+ loc1 = reg0 - loc1;
+ tmp6 = loc0;
+ tmp7 = loc1;
+ reg0 = loc2;
+
+ VP9_DOTP_CONST_PAIR(reg7, reg9, cospi_24_64, cospi_8_64, reg7, reg9);
+ VP9_DOTP_CONST_PAIR((-reg5), (-reg11), cospi_8_64, cospi_24_64, reg5,
+ reg11);
+
+ loc0 = reg9 + reg5;
+ reg5 = reg9 - reg5;
+ reg2 = reg6 + loc0;
+ reg1 = reg6 - loc0;
+
+ loc0 = reg7 + reg11;
+ reg11 = reg7 - reg11;
+ loc1 = reg4 + loc0;
+ loc2 = reg4 - loc0;
+
+ tmp5 = loc1;
+
+ VP9_DOTP_CONST_PAIR(reg5, reg11, cospi_16_64, cospi_16_64, reg5, reg11);
+ BUTTERFLY_4(reg8, reg10, reg11, reg5, loc0, reg4, reg9, loc1);
+
+ reg10 = loc0;
+ reg11 = loc1;
+
+ VP9_DOTP_CONST_PAIR(reg3, reg13, cospi_16_64, cospi_16_64, reg3, reg13);
+ BUTTERFLY_4(reg12, reg14, reg13, reg3, reg8, reg6, reg7, reg5);
+ reg13 = loc2;
+
+ /* Transpose and store the output */
+ reg12 = tmp5;
+ reg14 = tmp6;
+ reg3 = tmp7;
+
+ /* transpose block */
+ TRANSPOSE8x8_SH_SH(reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14,
+ reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14);
+ ST_SH4(reg0, reg2, reg4, reg6, output, 16);
+ ST_SH4(reg8, reg10, reg12, reg14, (output + 4 * 16), 16);
+
+ /* transpose block */
+ TRANSPOSE8x8_SH_SH(reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15,
+ reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15);
+ ST_SH4(reg3, reg13, reg11, reg5, (output + 8), 16);
+ ST_SH4(reg7, reg9, reg1, reg15, (output + 8 + 4 * 16), 16);
+}
+
+static void vp9_idct16x16_1_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ uint8_t i;
+ int16_t out;
+ v8i16 vec, res0, res1, res2, res3, res4, res5, res6, res7;
+ v16u8 dst0, dst1, dst2, dst3, tmp0, tmp1, tmp2, tmp3;
+
+ out = ROUND_POWER_OF_TWO((input[0] * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO((out * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO(out, 6);
+
+ vec = __msa_fill_h(out);
+
+ for (i = 4; i--;)
+ {
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ UNPCK_UB_SH(dst0, res0, res4);
+ UNPCK_UB_SH(dst1, res1, res5);
+ UNPCK_UB_SH(dst2, res2, res6);
+ UNPCK_UB_SH(dst3, res3, res7);
+ ADD4(res0, vec, res1, vec, res2, vec, res3, vec, res0, res1, res2,
+ res3);
+ ADD4(res4, vec, res5, vec, res6, vec, res7, vec, res4, res5, res6,
+ res7);
+ CLIP_SH4_0_255(res0, res1, res2, res3);
+ CLIP_SH4_0_255(res4, res5, res6, res7);
+ PCKEV_B4_UB(res4, res0, res5, res1, res6, res2, res7, res3,
+ tmp0, tmp1, tmp2, tmp3);
+ ST_UB4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void vp9_idct16x16_10_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int32_t i;
+ int16_t out_arr[16 * 16] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t *out = out_arr;
+
+ /* transform rows */
+ vp9_idct16_1d_columns_msa(input, out);
+
+ /* short case just considers top 4 rows as valid output */
+ out += 4 * 16;
+ for (i = 12; i--;) {
+ __asm__ volatile (
+ "sw $zero, 0(%[out]) \n\t"
+ "sw $zero, 4(%[out]) \n\t"
+ "sw $zero, 8(%[out]) \n\t"
+ "sw $zero, 12(%[out]) \n\t"
+ "sw $zero, 16(%[out]) \n\t"
+ "sw $zero, 20(%[out]) \n\t"
+ "sw $zero, 24(%[out]) \n\t"
+ "sw $zero, 28(%[out]) \n\t"
+
+ :
+ : [out] "r" (out)
+ );
+
+ out += 16;
+ }
+
+ out = out_arr;
+
+ /* transform columns */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_idct16_1d_columns_addblk_msa((out + (i << 3)), (dst + (i << 3)),
+ dst_stride);
+ }
+}
+
+static void vp9_idct16x16_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int32_t i;
+ int16_t out_arr[16 * 16] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t *out = out_arr;
+
+ /* transform rows */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_idct16_1d_columns_msa((input + (i << 3)), (out + (i << 7)));
+ }
+
+ /* transform columns */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_idct16_1d_columns_addblk_msa((out + (i << 3)), (dst + (i << 3)),
+ dst_stride);
+ }
+}
+
+static void vp9_iadst16_1d_columns_msa(int16_t *input, int16_t *output)
+{
+ v8i16 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
+ v8i16 l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
+
+ /* load input data */
+ LD_SH16(input, 16,
+ l0, l1, l2, l3, l4, l5, l6, l7,
+ l8, l9, l10, l11, l12, l13, l14, l15);
+
+ /* ADST in horizontal */
+ VP9_IADST8x16_1D(l0, l1, l2, l3, l4, l5, l6, l7,
+ l8, l9, l10, l11, l12, l13, l14, l15,
+ r0, r1, r2, r3, r4, r5, r6, r7,
+ r8, r9, r10, r11, r12, r13, r14, r15);
+
+ l1 = -r8;
+ l3 = -r4;
+ l13 = -r13;
+ l15 = -r1;
+
+ TRANSPOSE8x8_SH_SH(r0, l1, r12, l3, r6, r14, r10, r2,
+ l0, l1, l2, l3, l4, l5, l6, l7);
+ ST_SH8(l0, l1, l2, l3, l4, l5, l6, l7, output, 16);
+ TRANSPOSE8x8_SH_SH(r3, r11, r15, r7, r5, l13, r9, l15,
+ l8, l9, l10, l11, l12, l13, l14, l15);
+ ST_SH8(l8, l9, l10, l11, l12, l13, l14, l15, (output + 8), 16);
+}
+
+static void vp9_iadst16_1d_columns_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 v0, v2, v4, v6, k0, k1, k2, k3;
+ v8i16 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
+ v8i16 out0, out1, out2, out3, out4, out5, out6, out7;
+ v8i16 out8, out9, out10, out11, out12, out13, out14, out15;
+ v8i16 g0, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12, g13, g14, g15;
+ v8i16 h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11;
+ v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
+ v8i16 res8, res9, res10, res11, res12, res13, res14, res15;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16u8 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15;
+ v16i8 zero = { 0 };
+
+ r0 = LD_SH(input + 0 * 16);
+ r3 = LD_SH(input + 3 * 16);
+ r4 = LD_SH(input + 4 * 16);
+ r7 = LD_SH(input + 7 * 16);
+ r8 = LD_SH(input + 8 * 16);
+ r11 = LD_SH(input + 11 * 16);
+ r12 = LD_SH(input + 12 * 16);
+ r15 = LD_SH(input + 15 * 16);
+
+ /* stage 1 */
+ k0 = VP9_SET_COSPI_PAIR(cospi_1_64, cospi_31_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_31_64, -cospi_1_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_17_64, cospi_15_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_15_64, -cospi_17_64);
+ VP9_MADD_BF(r15, r0, r7, r8, k0, k1, k2, k3, g0, g1, g2, g3);
+ k0 = VP9_SET_COSPI_PAIR(cospi_9_64, cospi_23_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_23_64, -cospi_9_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_25_64, cospi_7_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_7_64, -cospi_25_64);
+ VP9_MADD_BF(r11, r4, r3, r12, k0, k1, k2, k3, g8, g9, g10, g11);
+ BUTTERFLY_4(g0, g2, g10, g8, h8, h9, v2, v0);
+ k0 = VP9_SET_COSPI_PAIR(cospi_4_64, cospi_28_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_28_64, -cospi_4_64);
+ k2 = VP9_SET_COSPI_PAIR(-cospi_28_64, cospi_4_64);
+ VP9_MADD_BF(g1, g3, g9, g11, k0, k1, k2, k0, h0, h1, h2, h3);
+
+ r1 = LD_SH(input + 1 * 16);
+ r2 = LD_SH(input + 2 * 16);
+ r5 = LD_SH(input + 5 * 16);
+ r6 = LD_SH(input + 6 * 16);
+ r9 = LD_SH(input + 9 * 16);
+ r10 = LD_SH(input + 10 * 16);
+ r13 = LD_SH(input + 13 * 16);
+ r14 = LD_SH(input + 14 * 16);
+
+ k0 = VP9_SET_COSPI_PAIR(cospi_5_64, cospi_27_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_27_64, -cospi_5_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_21_64, cospi_11_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_11_64, -cospi_21_64);
+ VP9_MADD_BF(r13, r2, r5, r10, k0, k1, k2, k3, g4, g5, g6, g7);
+ k0 = VP9_SET_COSPI_PAIR(cospi_13_64, cospi_19_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_19_64, -cospi_13_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_29_64, cospi_3_64);
+ k3 = VP9_SET_COSPI_PAIR(cospi_3_64, -cospi_29_64);
+ VP9_MADD_BF(r9, r6, r1, r14, k0, k1, k2, k3, g12, g13, g14, g15);
+ BUTTERFLY_4(g4, g6, g14, g12, h10, h11, v6, v4);
+ BUTTERFLY_4(h8, h9, h11, h10, out0, out1, h11, h10);
+ out1 = -out1;
+ SRARI_H2_SH(out0, out1, 6);
+ dst0 = LD_UB(dst + 0 * dst_stride);
+ dst1 = LD_UB(dst + 15 * dst_stride);
+ ILVR_B2_SH(zero, dst0, zero, dst1, res0, res1);
+ ADD2(res0, out0, res1, out1, res0, res1);
+ CLIP_SH2_0_255(res0, res1);
+ PCKEV_B2_SH(res0, res0, res1, res1, res0, res1);
+ ST8x1_UB(res0, dst);
+ ST8x1_UB(res1, dst + 15 * dst_stride);
+
+ k0 = VP9_SET_COSPI_PAIR(cospi_12_64, cospi_20_64);
+ k1 = VP9_SET_COSPI_PAIR(-cospi_20_64, cospi_12_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_20_64, -cospi_12_64);
+ VP9_MADD_BF(g7, g5, g15, g13, k0, k1, k2, k0, h4, h5, h6, h7);
+ BUTTERFLY_4(h0, h2, h6, h4, out8, out9, out11, out10);
+ out8 = -out8;
+
+ SRARI_H2_SH(out8, out9, 6);
+ dst8 = LD_UB(dst + 1 * dst_stride);
+ dst9 = LD_UB(dst + 14 * dst_stride);
+ ILVR_B2_SH(zero, dst8, zero, dst9, res8, res9);
+ ADD2(res8, out8, res9, out9, res8, res9);
+ CLIP_SH2_0_255(res8, res9);
+ PCKEV_B2_SH(res8, res8, res9, res9, res8, res9);
+ ST8x1_UB(res8, dst + dst_stride);
+ ST8x1_UB(res9, dst + 14 * dst_stride);
+
+ k0 = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64);
+ k1 = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64);
+ k2 = VP9_SET_COSPI_PAIR(-cospi_24_64, cospi_8_64);
+ VP9_MADD_BF(v0, v2, v4, v6, k0, k1, k2, k0, out4, out6, out5, out7);
+ out4 = -out4;
+ SRARI_H2_SH(out4, out5, 6);
+ dst4 = LD_UB(dst + 3 * dst_stride);
+ dst5 = LD_UB(dst + 12 * dst_stride);
+ ILVR_B2_SH(zero, dst4, zero, dst5, res4, res5);
+ ADD2(res4, out4, res5, out5, res4, res5);
+ CLIP_SH2_0_255(res4, res5);
+ PCKEV_B2_SH(res4, res4, res5, res5, res4, res5);
+ ST8x1_UB(res4, dst + 3 * dst_stride);
+ ST8x1_UB(res5, dst + 12 * dst_stride);
+
+ VP9_MADD_BF(h1, h3, h5, h7, k0, k1, k2, k0, out12, out14, out13, out15);
+ out13 = -out13;
+ SRARI_H2_SH(out12, out13, 6);
+ dst12 = LD_UB(dst + 2 * dst_stride);
+ dst13 = LD_UB(dst + 13 * dst_stride);
+ ILVR_B2_SH(zero, dst12, zero, dst13, res12, res13);
+ ADD2(res12, out12, res13, out13, res12, res13);
+ CLIP_SH2_0_255(res12, res13);
+ PCKEV_B2_SH(res12, res12, res13, res13, res12, res13);
+ ST8x1_UB(res12, dst + 2 * dst_stride);
+ ST8x1_UB(res13, dst + 13 * dst_stride);
+
+ k0 = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64);
+ k3 = VP9_SET_COSPI_PAIR(-cospi_16_64, cospi_16_64);
+ VP9_MADD_SHORT(out6, out7, k0, k3, out6, out7);
+ SRARI_H2_SH(out6, out7, 6);
+ dst6 = LD_UB(dst + 4 * dst_stride);
+ dst7 = LD_UB(dst + 11 * dst_stride);
+ ILVR_B2_SH(zero, dst6, zero, dst7, res6, res7);
+ ADD2(res6, out6, res7, out7, res6, res7);
+ CLIP_SH2_0_255(res6, res7);
+ PCKEV_B2_SH(res6, res6, res7, res7, res6, res7);
+ ST8x1_UB(res6, dst + 4 * dst_stride);
+ ST8x1_UB(res7, dst + 11 * dst_stride);
+
+ VP9_MADD_SHORT(out10, out11, k0, k3, out10, out11);
+ SRARI_H2_SH(out10, out11, 6);
+ dst10 = LD_UB(dst + 6 * dst_stride);
+ dst11 = LD_UB(dst + 9 * dst_stride);
+ ILVR_B2_SH(zero, dst10, zero, dst11, res10, res11);
+ ADD2(res10, out10, res11, out11, res10, res11);
+ CLIP_SH2_0_255(res10, res11);
+ PCKEV_B2_SH(res10, res10, res11, res11, res10, res11);
+ ST8x1_UB(res10, dst + 6 * dst_stride);
+ ST8x1_UB(res11, dst + 9 * dst_stride);
+
+ k1 = VP9_SET_COSPI_PAIR(-cospi_16_64, -cospi_16_64);
+ k2 = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64);
+ VP9_MADD_SHORT(h10, h11, k1, k2, out2, out3);
+ SRARI_H2_SH(out2, out3, 6);
+ dst2 = LD_UB(dst + 7 * dst_stride);
+ dst3 = LD_UB(dst + 8 * dst_stride);
+ ILVR_B2_SH(zero, dst2, zero, dst3, res2, res3);
+ ADD2(res2, out2, res3, out3, res2, res3);
+ CLIP_SH2_0_255(res2, res3);
+ PCKEV_B2_SH(res2, res2, res3, res3, res2, res3);
+ ST8x1_UB(res2, dst + 7 * dst_stride);
+ ST8x1_UB(res3, dst + 8 * dst_stride);
+
+ VP9_MADD_SHORT(out14, out15, k1, k2, out14, out15);
+ SRARI_H2_SH(out14, out15, 6);
+ dst14 = LD_UB(dst + 5 * dst_stride);
+ dst15 = LD_UB(dst + 10 * dst_stride);
+ ILVR_B2_SH(zero, dst14, zero, dst15, res14, res15);
+ ADD2(res14, out14, res15, out15, res14, res15);
+ CLIP_SH2_0_255(res14, res15);
+ PCKEV_B2_SH(res14, res14, res15, res15, res14, res15);
+ ST8x1_UB(res14, dst + 5 * dst_stride);
+ ST8x1_UB(res15, dst + 10 * dst_stride);
+}
+
+static void vp9_iadst16x16_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int16_t out_arr[16 * 16] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t *out = out_arr;
+ int32_t i;
+
+ /* transform rows */
+ for (i = 0; i < 2; i++) {
+ /* process 16 * 8 block */
+ vp9_iadst16_1d_columns_msa((input + (i << 3)), (out + (i << 7)));
+ }
+
+ /* transform columns */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_iadst16_1d_columns_addblk_msa((out + (i << 3)), (dst + (i << 3)),
+ dst_stride);
+ }
+}
+
+static void vp9_iadst_idct_16x16_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ int32_t i;
+ int16_t out[16 * 16];
+ int16_t *out_ptr = &out[0];
+
+ /* transform rows */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_iadst16_1d_columns_msa((input + (i << 3)), (out_ptr + (i << 7)));
+ }
+
+ /* transform columns */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_idct16_1d_columns_addblk_msa((out_ptr + (i << 3)),
+ (dst + (i << 3)), dst_stride);
+ }
+}
+
+static void vp9_idct_iadst_16x16_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride, int32_t eob)
+{
+ int32_t i;
+ int16_t out[16 * 16];
+ int16_t *out_ptr = &out[0];
+
+ /* transform rows */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_idct16_1d_columns_msa((input + (i << 3)), (out_ptr + (i << 7)));
+ }
+
+ /* transform columns */
+ for (i = 0; i < 2; i++) {
+ /* process 8 * 16 block */
+ vp9_iadst16_1d_columns_addblk_msa((out_ptr + (i << 3)),
+ (dst + (i << 3)), dst_stride);
+ }
+}
+
+static void vp9_idct_butterfly_transpose_store(int16_t *tmp_buf,
+ int16_t *tmp_eve_buf,
+ int16_t *tmp_odd_buf,
+ int16_t *dst)
+{
+ v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
+ v8i16 m0, m1, m2, m3, m4, m5, m6, m7, n0, n1, n2, n3, n4, n5, n6, n7;
+
+ /* FINAL BUTTERFLY : Dependency on Even & Odd */
+ vec0 = LD_SH(tmp_odd_buf);
+ vec1 = LD_SH(tmp_odd_buf + 9 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 14 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 6 * 8);
+ loc0 = LD_SH(tmp_eve_buf);
+ loc1 = LD_SH(tmp_eve_buf + 8 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 4 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 12 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m0, m4, m2, m6);
+
+ ST_SH((loc0 - vec3), (tmp_buf + 31 * 8));
+ ST_SH((loc1 - vec2), (tmp_buf + 23 * 8));
+ ST_SH((loc2 - vec1), (tmp_buf + 27 * 8));
+ ST_SH((loc3 - vec0), (tmp_buf + 19 * 8));
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 4 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 13 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 10 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 3 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 2 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 10 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 6 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 14 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m1, m5, m3, m7);
+
+ ST_SH((loc0 - vec3), (tmp_buf + 29 * 8));
+ ST_SH((loc1 - vec2), (tmp_buf + 21 * 8));
+ ST_SH((loc2 - vec1), (tmp_buf + 25 * 8));
+ ST_SH((loc3 - vec0), (tmp_buf + 17 * 8));
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 2 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 11 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 12 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 7 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 1 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 9 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 5 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 13 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n0, n4, n2, n6);
+
+ ST_SH((loc0 - vec3), (tmp_buf + 30 * 8));
+ ST_SH((loc1 - vec2), (tmp_buf + 22 * 8));
+ ST_SH((loc2 - vec1), (tmp_buf + 26 * 8));
+ ST_SH((loc3 - vec0), (tmp_buf + 18 * 8));
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 5 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 15 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 8 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 1 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 3 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 11 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 7 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 15 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n1, n5, n3, n7);
+
+ ST_SH((loc0 - vec3), (tmp_buf + 28 * 8));
+ ST_SH((loc1 - vec2), (tmp_buf + 20 * 8));
+ ST_SH((loc2 - vec1), (tmp_buf + 24 * 8));
+ ST_SH((loc3 - vec0), (tmp_buf + 16 * 8));
+
+ /* Transpose : 16 vectors */
+ /* 1st & 2nd 8x8 */
+ TRANSPOSE8x8_SH_SH(m0, n0, m1, n1, m2, n2, m3, n3,
+ m0, n0, m1, n1, m2, n2, m3, n3);
+ ST_SH4(m0, n0, m1, n1, (dst + 0), 32);
+ ST_SH4(m2, n2, m3, n3, (dst + 4 * 32), 32);
+
+ TRANSPOSE8x8_SH_SH(m4, n4, m5, n5, m6, n6, m7, n7,
+ m4, n4, m5, n5, m6, n6, m7, n7);
+ ST_SH4(m4, n4, m5, n5, (dst + 8), 32);
+ ST_SH4(m6, n6, m7, n7, (dst + 8 + 4 * 32), 32);
+
+ /* 3rd & 4th 8x8 */
+ LD_SH8((tmp_buf + 8 * 16), 8, m0, n0, m1, n1, m2, n2, m3, n3);
+ LD_SH8((tmp_buf + 12 * 16), 8, m4, n4, m5, n5, m6, n6, m7, n7);
+ TRANSPOSE8x8_SH_SH(m0, n0, m1, n1, m2, n2, m3, n3,
+ m0, n0, m1, n1, m2, n2, m3, n3);
+ ST_SH4(m0, n0, m1, n1, (dst + 16), 32);
+ ST_SH4(m2, n2, m3, n3, (dst + 16 + 4 * 32), 32);
+
+ TRANSPOSE8x8_SH_SH(m4, n4, m5, n5, m6, n6, m7, n7,
+ m4, n4, m5, n5, m6, n6, m7, n7);
+ ST_SH4(m4, n4, m5, n5, (dst + 24), 32);
+ ST_SH4(m6, n6, m7, n7, (dst + 24 + 4 * 32), 32);
+}
+
+static void vp9_idct8x32_column_even_process_store(int16_t *tmp_buf,
+ int16_t *tmp_eve_buf)
+{
+ v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
+ v8i16 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
+ v8i16 stp0, stp1, stp2, stp3, stp4, stp5, stp6, stp7;
+
+ /* Even stage 1 */
+ LD_SH8(tmp_buf, (4 * 32), reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
+ tmp_buf += (2 * 32);
+
+ VP9_DOTP_CONST_PAIR(reg1, reg7, cospi_28_64, cospi_4_64, reg1, reg7);
+ VP9_DOTP_CONST_PAIR(reg5, reg3, cospi_12_64, cospi_20_64, reg5, reg3);
+ BUTTERFLY_4(reg1, reg7, reg3, reg5, vec1, vec3, vec2, vec0);
+ VP9_DOTP_CONST_PAIR(vec2, vec0, cospi_16_64, cospi_16_64, loc2, loc3);
+
+ loc1 = vec3;
+ loc0 = vec1;
+
+ VP9_DOTP_CONST_PAIR(reg0, reg4, cospi_16_64, cospi_16_64, reg0, reg4);
+ VP9_DOTP_CONST_PAIR(reg2, reg6, cospi_24_64, cospi_8_64, reg2, reg6);
+ BUTTERFLY_4(reg4, reg0, reg2, reg6, vec1, vec3, vec2, vec0);
+ BUTTERFLY_4(vec0, vec1, loc1, loc0, stp3, stp0, stp7, stp4);
+ BUTTERFLY_4(vec2, vec3, loc3, loc2, stp2, stp1, stp6, stp5);
+
+ /* Even stage 2 */
+ /* Load 8 */
+ LD_SH8(tmp_buf, (4 * 32), reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
+
+ VP9_DOTP_CONST_PAIR(reg0, reg7, cospi_30_64, cospi_2_64, reg0, reg7);
+ VP9_DOTP_CONST_PAIR(reg4, reg3, cospi_14_64, cospi_18_64, reg4, reg3);
+ VP9_DOTP_CONST_PAIR(reg2, reg5, cospi_22_64, cospi_10_64, reg2, reg5);
+ VP9_DOTP_CONST_PAIR(reg6, reg1, cospi_6_64, cospi_26_64, reg6, reg1);
+
+ vec0 = reg0 + reg4;
+ reg0 = reg0 - reg4;
+ reg4 = reg6 + reg2;
+ reg6 = reg6 - reg2;
+ reg2 = reg1 + reg5;
+ reg1 = reg1 - reg5;
+ reg5 = reg7 + reg3;
+ reg7 = reg7 - reg3;
+ reg3 = vec0;
+
+ vec1 = reg2;
+ reg2 = reg3 + reg4;
+ reg3 = reg3 - reg4;
+ reg4 = reg5 - vec1;
+ reg5 = reg5 + vec1;
+
+ VP9_DOTP_CONST_PAIR(reg7, reg0, cospi_24_64, cospi_8_64, reg0, reg7);
+ VP9_DOTP_CONST_PAIR((-reg6), reg1, cospi_24_64, cospi_8_64, reg6, reg1);
+
+ vec0 = reg0 - reg6;
+ reg0 = reg0 + reg6;
+ vec1 = reg7 - reg1;
+ reg7 = reg7 + reg1;
+
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_16_64, cospi_16_64, reg6, reg1);
+ VP9_DOTP_CONST_PAIR(reg4, reg3, cospi_16_64, cospi_16_64, reg3, reg4);
+
+ /* Even stage 3 : Dependency on Even stage 1 & Even stage 2 */
+ /* Store 8 */
+ BUTTERFLY_4(stp0, stp1, reg7, reg5, loc1, loc3, loc2, loc0);
+ ST_SH2(loc1, loc3, tmp_eve_buf, 8);
+ ST_SH2(loc2, loc0, (tmp_eve_buf + 14 * 8), 8);
+
+ BUTTERFLY_4(stp2, stp3, reg4, reg1, loc1, loc3, loc2, loc0);
+ ST_SH2(loc1, loc3, (tmp_eve_buf + 2 * 8), 8);
+ ST_SH2(loc2, loc0, (tmp_eve_buf + 12 * 8), 8);
+
+ /* Store 8 */
+ BUTTERFLY_4(stp4, stp5, reg6, reg3, loc1, loc3, loc2, loc0);
+ ST_SH2(loc1, loc3, (tmp_eve_buf + 4 * 8), 8);
+ ST_SH2(loc2, loc0, (tmp_eve_buf + 10 * 8), 8);
+
+ BUTTERFLY_4(stp6, stp7, reg2, reg0, loc1, loc3, loc2, loc0);
+ ST_SH2(loc1, loc3, (tmp_eve_buf + 6 * 8), 8);
+ ST_SH2(loc2, loc0, (tmp_eve_buf + 8 * 8), 8);
+}
+
+static void vp9_idct8x32_column_odd_process_store(int16_t *tmp_buf,
+ int16_t *tmp_odd_buf)
+{
+ v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
+ v8i16 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
+
+ /* Odd stage 1 */
+ reg0 = LD_SH(tmp_buf + 32);
+ reg1 = LD_SH(tmp_buf + 7 * 32);
+ reg2 = LD_SH(tmp_buf + 9 * 32);
+ reg3 = LD_SH(tmp_buf + 15 * 32);
+ reg4 = LD_SH(tmp_buf + 17 * 32);
+ reg5 = LD_SH(tmp_buf + 23 * 32);
+ reg6 = LD_SH(tmp_buf + 25 * 32);
+ reg7 = LD_SH(tmp_buf + 31 * 32);
+
+ VP9_DOTP_CONST_PAIR(reg0, reg7, cospi_31_64, cospi_1_64, reg0, reg7);
+ VP9_DOTP_CONST_PAIR(reg4, reg3, cospi_15_64, cospi_17_64, reg3, reg4);
+ VP9_DOTP_CONST_PAIR(reg2, reg5, cospi_23_64, cospi_9_64, reg2, reg5);
+ VP9_DOTP_CONST_PAIR(reg6, reg1, cospi_7_64, cospi_25_64, reg1, reg6);
+
+ vec0 = reg0 + reg3;
+ reg0 = reg0 - reg3;
+ reg3 = reg7 + reg4;
+ reg7 = reg7 - reg4;
+ reg4 = reg1 + reg2;
+ reg1 = reg1 - reg2;
+ reg2 = reg6 + reg5;
+ reg6 = reg6 - reg5;
+ reg5 = vec0;
+
+ /* 4 Stores */
+ ADD2(reg5, reg4, reg3, reg2, vec0, vec1);
+ ST_SH2(vec0, vec1, (tmp_odd_buf + 4 * 8), 8);
+ SUB2(reg5, reg4, reg3, reg2, vec0, vec1);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_24_64, cospi_8_64, vec0, vec1);
+ ST_SH2(vec0, vec1, tmp_odd_buf, 8);
+
+ /* 4 Stores */
+ VP9_DOTP_CONST_PAIR(reg7, reg0, cospi_28_64, cospi_4_64, reg0, reg7);
+ VP9_DOTP_CONST_PAIR(reg6, reg1, -cospi_4_64, cospi_28_64, reg1, reg6);
+ BUTTERFLY_4(reg0, reg7, reg6, reg1, vec0, vec1, vec2, vec3);
+ ST_SH2(vec0, vec1, (tmp_odd_buf + 6 * 8), 8);
+ VP9_DOTP_CONST_PAIR(vec2, vec3, cospi_24_64, cospi_8_64, vec2, vec3);
+ ST_SH2(vec2, vec3, (tmp_odd_buf + 2 * 8), 8);
+
+ /* Odd stage 2 */
+ /* 8 loads */
+ reg0 = LD_SH(tmp_buf + 3 * 32);
+ reg1 = LD_SH(tmp_buf + 5 * 32);
+ reg2 = LD_SH(tmp_buf + 11 * 32);
+ reg3 = LD_SH(tmp_buf + 13 * 32);
+ reg4 = LD_SH(tmp_buf + 19 * 32);
+ reg5 = LD_SH(tmp_buf + 21 * 32);
+ reg6 = LD_SH(tmp_buf + 27 * 32);
+ reg7 = LD_SH(tmp_buf + 29 * 32);
+
+ VP9_DOTP_CONST_PAIR(reg1, reg6, cospi_27_64, cospi_5_64, reg1, reg6);
+ VP9_DOTP_CONST_PAIR(reg5, reg2, cospi_11_64, cospi_21_64, reg2, reg5);
+ VP9_DOTP_CONST_PAIR(reg3, reg4, cospi_19_64, cospi_13_64, reg3, reg4);
+ VP9_DOTP_CONST_PAIR(reg7, reg0, cospi_3_64, cospi_29_64, reg0, reg7);
+
+ /* 4 Stores */
+ SUB4(reg1, reg2, reg6, reg5, reg0, reg3, reg7, reg4,
+ vec0, vec1, vec2, vec3);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_12_64, cospi_20_64, loc0, loc1);
+ VP9_DOTP_CONST_PAIR(vec3, vec2, -cospi_20_64, cospi_12_64, loc2, loc3);
+ BUTTERFLY_4(loc2, loc3, loc1, loc0, vec0, vec1, vec3, vec2);
+ ST_SH2(vec0, vec1, (tmp_odd_buf + 12 * 8), 3 * 8);
+ VP9_DOTP_CONST_PAIR(vec3, vec2, -cospi_8_64, cospi_24_64, vec0, vec1);
+ ST_SH2(vec0, vec1, (tmp_odd_buf + 10 * 8), 8);
+
+ /* 4 Stores */
+ ADD4(reg0, reg3, reg1, reg2, reg5, reg6, reg4, reg7,
+ vec0, vec1, vec2, vec3);
+ BUTTERFLY_4(vec0, vec3, vec2, vec1, reg0, reg1, reg3, reg2);
+ ST_SH2(reg0, reg1, (tmp_odd_buf + 13 * 8), 8);
+ VP9_DOTP_CONST_PAIR(reg3, reg2, -cospi_8_64, cospi_24_64, reg0, reg1);
+ ST_SH2(reg0, reg1, (tmp_odd_buf + 8 * 8), 8);
+
+ /* Odd stage 3 : Dependency on Odd stage 1 & Odd stage 2 */
+ /* Load 8 & Store 8 */
+ LD_SH4(tmp_odd_buf, 8, reg0, reg1, reg2, reg3);
+ LD_SH4((tmp_odd_buf + 8 * 8), 8, reg4, reg5, reg6, reg7);
+
+ ADD4(reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
+ loc0, loc1, loc2, loc3);
+ ST_SH4(loc0, loc1, loc2, loc3, tmp_odd_buf, 8);
+
+ SUB2(reg0, reg4, reg1, reg5, vec0, vec1);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_16_64, cospi_16_64, loc0, loc1);
+
+ SUB2(reg2, reg6, reg3, reg7, vec0, vec1);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_16_64, cospi_16_64, loc2, loc3);
+ ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 8 * 8), 8);
+
+ /* Load 8 & Store 8 */
+ LD_SH4((tmp_odd_buf + 4 * 8), 8, reg1, reg2, reg0, reg3);
+ LD_SH4((tmp_odd_buf + 12 * 8), 8, reg4, reg5, reg6, reg7);
+
+ ADD4(reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
+ loc0, loc1, loc2, loc3);
+ ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 4 * 8), 8);
+
+ SUB2(reg0, reg4, reg3, reg7, vec0, vec1);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_16_64, cospi_16_64, loc0, loc1);
+
+ SUB2(reg1, reg5, reg2, reg6, vec0, vec1);
+ VP9_DOTP_CONST_PAIR(vec1, vec0, cospi_16_64, cospi_16_64, loc2, loc3);
+ ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 12 * 8), 8);
+}
+
+static void vp9_idct8x32_column_butterfly_addblk(int16_t *tmp_eve_buf,
+ int16_t *tmp_odd_buf,
+ uint8_t *dst,
+ int32_t dst_stride)
+{
+ v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
+ v8i16 m0, m1, m2, m3, m4, m5, m6, m7, n0, n1, n2, n3, n4, n5, n6, n7;
+
+ /* FINAL BUTTERFLY : Dependency on Even & Odd */
+ vec0 = LD_SH(tmp_odd_buf);
+ vec1 = LD_SH(tmp_odd_buf + 9 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 14 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 6 * 8);
+ loc0 = LD_SH(tmp_eve_buf);
+ loc1 = LD_SH(tmp_eve_buf + 8 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 4 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 12 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m0, m4, m2, m6);
+ SRARI_H4_SH(m0, m2, m4, m6, 6);
+ VP9_ADDBLK_ST8x4_UB(dst, (4 * dst_stride), m0, m2, m4, m6);
+
+ SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m6, m2, m4, m0);
+ SRARI_H4_SH(m0, m2, m4, m6, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 19 * dst_stride), (4 * dst_stride),
+ m0, m2, m4, m6);
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 4 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 13 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 10 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 3 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 2 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 10 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 6 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 14 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m1, m5, m3, m7);
+ SRARI_H4_SH(m1, m3, m5, m7, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 2 * dst_stride), (4 * dst_stride),
+ m1, m3, m5, m7);
+
+ SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m7, m3, m5, m1);
+ SRARI_H4_SH(m1, m3, m5, m7, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 17 * dst_stride), (4 * dst_stride),
+ m1, m3, m5, m7);
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 2 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 11 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 12 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 7 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 1 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 9 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 5 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 13 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n0, n4, n2, n6);
+ SRARI_H4_SH(n0, n2, n4, n6, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 1 * dst_stride), (4 * dst_stride),
+ n0, n2, n4, n6);
+
+ SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n6, n2, n4, n0);
+ SRARI_H4_SH(n0, n2, n4, n6, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 18 * dst_stride), (4 * dst_stride),
+ n0, n2, n4, n6);
+
+ /* Load 8 & Store 8 */
+ vec0 = LD_SH(tmp_odd_buf + 5 * 8);
+ vec1 = LD_SH(tmp_odd_buf + 15 * 8);
+ vec2 = LD_SH(tmp_odd_buf + 8 * 8);
+ vec3 = LD_SH(tmp_odd_buf + 1 * 8);
+ loc0 = LD_SH(tmp_eve_buf + 3 * 8);
+ loc1 = LD_SH(tmp_eve_buf + 11 * 8);
+ loc2 = LD_SH(tmp_eve_buf + 7 * 8);
+ loc3 = LD_SH(tmp_eve_buf + 15 * 8);
+
+ ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n1, n5, n3, n7);
+ SRARI_H4_SH(n1, n3, n5, n7, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 3 * dst_stride), (4 * dst_stride),
+ n1, n3, n5, n7);
+
+ SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n7, n3, n5, n1);
+ SRARI_H4_SH(n1, n3, n5, n7, 6);
+ VP9_ADDBLK_ST8x4_UB((dst + 16 * dst_stride), (4 * dst_stride),
+ n1, n3, n5, n7);
+}
+
+static void vp9_idct8x32_1d_columns_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int16_t tmp_odd_buf[16 * 8] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t tmp_eve_buf[16 * 8] ALLOC_ALIGNED(ALIGNMENT);
+
+ vp9_idct8x32_column_even_process_store(input, &tmp_eve_buf[0]);
+ vp9_idct8x32_column_odd_process_store(input, &tmp_odd_buf[0]);
+ vp9_idct8x32_column_butterfly_addblk(&tmp_eve_buf[0], &tmp_odd_buf[0],
+ dst, dst_stride);
+}
+
+static void vp9_idct8x32_1d_columns_msa(int16_t *input, int16_t *output,
+ int16_t *tmp_buf)
+{
+ int16_t tmp_odd_buf[16 * 8] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t tmp_eve_buf[16 * 8] ALLOC_ALIGNED(ALIGNMENT);
+
+ vp9_idct8x32_column_even_process_store(input, &tmp_eve_buf[0]);
+ vp9_idct8x32_column_odd_process_store(input, &tmp_odd_buf[0]);
+ vp9_idct_butterfly_transpose_store(tmp_buf, &tmp_eve_buf[0],
+ &tmp_odd_buf[0], output);
+}
+
+static void vp9_idct32x32_1_add_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int32_t i;
+ int16_t out;
+ v16u8 dst0, dst1, dst2, dst3, tmp0, tmp1, tmp2, tmp3;
+ v8i16 res0, res1, res2, res3, res4, res5, res6, res7, vec;
+
+ out = ROUND_POWER_OF_TWO((input[0] * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO((out * cospi_16_64), VP9_DCT_CONST_BITS);
+ out = ROUND_POWER_OF_TWO(out, 6);
+
+ vec = __msa_fill_h(out);
+
+ for (i = 16; i--;)
+ {
+ LD_UB2(dst, 16, dst0, dst1);
+ LD_UB2(dst + dst_stride, 16, dst2, dst3);
+
+ UNPCK_UB_SH(dst0, res0, res4);
+ UNPCK_UB_SH(dst1, res1, res5);
+ UNPCK_UB_SH(dst2, res2, res6);
+ UNPCK_UB_SH(dst3, res3, res7);
+ ADD4(res0, vec, res1, vec, res2, vec, res3, vec, res0, res1, res2,
+ res3);
+ ADD4(res4, vec, res5, vec, res6, vec, res7, vec, res4, res5, res6,
+ res7);
+ CLIP_SH4_0_255(res0, res1, res2, res3);
+ CLIP_SH4_0_255(res4, res5, res6, res7);
+ PCKEV_B4_UB(res4, res0, res5, res1, res6, res2, res7, res3,
+ tmp0, tmp1, tmp2, tmp3);
+
+ ST_UB2(tmp0, tmp1, dst, 16);
+ dst += dst_stride;
+ ST_UB2(tmp2, tmp3, dst, 16);
+ dst += dst_stride;
+ }
+}
+
+static void vp9_idct32x32_34_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int32_t i;
+ int16_t out_arr[32 * 32] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t *out_ptr = out_arr;
+ int16_t tmp_buf[8 * 32] ALLOC_ALIGNED(ALIGNMENT);
+
+ for (i = 32; i--;) {
+ __asm__ volatile (
+ "sw $zero, (%[out_ptr]) \n\t"
+ "sw $zero, 4(%[out_ptr]) \n\t"
+ "sw $zero, 8(%[out_ptr]) \n\t"
+ "sw $zero, 12(%[out_ptr]) \n\t"
+ "sw $zero, 16(%[out_ptr]) \n\t"
+ "sw $zero, 20(%[out_ptr]) \n\t"
+ "sw $zero, 24(%[out_ptr]) \n\t"
+ "sw $zero, 28(%[out_ptr]) \n\t"
+ "sw $zero, 32(%[out_ptr]) \n\t"
+ "sw $zero, 36(%[out_ptr]) \n\t"
+ "sw $zero, 40(%[out_ptr]) \n\t"
+ "sw $zero, 44(%[out_ptr]) \n\t"
+ "sw $zero, 48(%[out_ptr]) \n\t"
+ "sw $zero, 52(%[out_ptr]) \n\t"
+ "sw $zero, 56(%[out_ptr]) \n\t"
+ "sw $zero, 60(%[out_ptr]) \n\t"
+
+ :
+ : [out_ptr] "r" (out_ptr)
+ );
+
+ out_ptr += 32;
+ }
+
+ out_ptr = out_arr;
+
+ /* process 8*32 block */
+ vp9_idct8x32_1d_columns_msa(input, out_ptr, &tmp_buf[0]);
+
+ /* transform columns */
+ for (i = 0; i < 4; i++) {
+ /* process 8*32 block */
+ vp9_idct8x32_1d_columns_addblk_msa((out_ptr + (i << 3)),
+ (dst + (i << 3)), dst_stride);
+ }
+}
+
+static void vp9_idct32x32_colcol_addblk_msa(int16_t *input, uint8_t *dst,
+ int32_t dst_stride)
+{
+ int32_t i;
+ int16_t out_arr[32 * 32] ALLOC_ALIGNED(ALIGNMENT);
+ int16_t *out_ptr = out_arr;
+ int16_t tmp_buf[8 * 32] ALLOC_ALIGNED(ALIGNMENT);
+
+ /* transform rows */
+ for (i = 0; i < 4; i++) {
+ /* process 8*32 block */
+ vp9_idct8x32_1d_columns_msa((input + (i << 3)), (out_ptr + (i << 8)),
+ &tmp_buf[0]);
+ }
+
+ /* transform columns */
+ for (i = 0; i < 4; i++) {
+ /* process 8*32 block */
+ vp9_idct8x32_1d_columns_addblk_msa((out_ptr + (i << 3)),
+ (dst + (i << 3)), dst_stride);
+ }
+}
+
+void ff_idct_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ if (eob > 1) {
+ vp9_idct4x4_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 4 * 4 * sizeof(*block));
+ }
+ else {
+ vp9_idct4x4_1_add_msa(block, dst, stride);
+ block[0] = 0;
+ }
+}
+
+void ff_idct_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ if (eob == 1) {
+ vp9_idct8x8_1_add_msa(block, dst, stride);
+ block[0] = 0;
+ }
+ else if (eob <= 12) {
+ vp9_idct8x8_12_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 4 * 8 * sizeof(*block));
+ }
+ else {
+ vp9_idct8x8_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 8 * 8 * sizeof(*block));
+ }
+}
+
+void ff_idct_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ int i;
+
+ if (eob == 1) {
+ /* DC only DCT coefficient. */
+ vp9_idct16x16_1_add_msa(block, dst, stride);
+ block[0] = 0;
+ }
+ else if (eob <= 10) {
+ vp9_idct16x16_10_colcol_addblk_msa(block, dst, stride);
+ for (i = 0; i < 4; ++i) {
+ memset(block, 0, 4 * sizeof(*block));
+ block += 16;
+ }
+ }
+ else {
+ vp9_idct16x16_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 16 * 16 * sizeof(*block));
+ }
+}
+
+void ff_idct_idct_32x32_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ int i;
+
+ if (eob == 1) {
+ vp9_idct32x32_1_add_msa(block, dst, stride);
+ block[0] = 0;
+ }
+ else if (eob <= 34) {
+ vp9_idct32x32_34_colcol_addblk_msa(block, dst, stride);
+ for (i = 0; i < 8; ++i) {
+ memset(block, 0, 8 * sizeof(*block));
+ block += 32;
+ }
+ }
+ else {
+ vp9_idct32x32_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 32 * 32 * sizeof(*block));
+ }
+}
+
+void ff_iadst_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst4x4_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 4 * 4 * sizeof(*block));
+}
+
+void ff_iadst_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst8x8_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 8 * 8 * sizeof(*block));
+}
+
+void ff_iadst_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst16x16_colcol_addblk_msa(block, dst, stride);
+ memset(block, 0, 16 * 16 * sizeof(*block));
+}
+
+void ff_idct_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_idct_iadst_4x4_add_msa(block, dst, stride, eob);
+ memset(block, 0, 4 * 4 * sizeof(*block));
+}
+
+void ff_idct_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_idct_iadst_8x8_add_msa(block, dst, stride, eob);
+ memset(block, 0, 8 * 8 * sizeof(*block));
+}
+
+void ff_idct_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_idct_iadst_16x16_add_msa(block, dst, stride, eob);
+ memset(block, 0, 16 * 16 * sizeof(*block));
+}
+
+void ff_iadst_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst_idct_4x4_add_msa(block, dst, stride, eob);
+ memset(block, 0, 4 * 4 * sizeof(*block));
+}
+
+void ff_iadst_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst_idct_8x8_add_msa(block, dst, stride, eob);
+ memset(block, 0, 8 * 8 * sizeof(*block));
+}
+
+void ff_iadst_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob)
+{
+ vp9_iadst_idct_16x16_add_msa(block, dst, stride, eob);
+ memset(block, 0, 16 * 16 * sizeof(*block));
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9_intra_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_intra_msa.c
new file mode 100644
index 00000000000..54cf0ae94f1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_intra_msa.c
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/vp9dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp9dsp_mips.h"
+
+#define IPRED_SUBS_UH2_UH(in0, in1, out0, out1) \
+{ \
+ out0 = __msa_subs_u_h(out0, in0); \
+ out1 = __msa_subs_u_h(out1, in1); \
+}
+
+void ff_vert_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *left,
+ const uint8_t *src)
+{
+ uint32_t row;
+ v16u8 src0;
+
+ src0 = LD_UB(src);
+
+ for (row = 16; row--;) {
+ ST_UB(src0, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_vert_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *left,
+ const uint8_t *src)
+{
+ uint32_t row;
+ v16u8 src1, src2;
+
+ src1 = LD_UB(src);
+ src2 = LD_UB(src + 16);
+
+ for (row = 32; row--;) {
+ ST_UB2(src1, src2, dst, 16);
+ dst += dst_stride;
+ }
+}
+
+void ff_hor_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src,
+ const uint8_t *top)
+{
+ uint32_t row, inp;
+ v16u8 src0, src1, src2, src3;
+
+ src += 12;
+ for (row = 4; row--;) {
+ inp = LW(src);
+ src -= 4;
+
+ src0 = (v16u8) __msa_fill_b(inp >> 24);
+ src1 = (v16u8) __msa_fill_b(inp >> 16);
+ src2 = (v16u8) __msa_fill_b(inp >> 8);
+ src3 = (v16u8) __msa_fill_b(inp);
+
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_hor_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src,
+ const uint8_t *top)
+{
+ uint32_t row, inp;
+ v16u8 src0, src1, src2, src3;
+
+ src += 28;
+ for (row = 8; row--;) {
+ inp = LW(src);
+ src -= 4;
+
+ src0 = (v16u8) __msa_fill_b(inp >> 24);
+ src1 = (v16u8) __msa_fill_b(inp >> 16);
+ src2 = (v16u8) __msa_fill_b(inp >> 8);
+ src3 = (v16u8) __msa_fill_b(inp);
+
+ ST_UB2(src0, src0, dst, 16);
+ dst += dst_stride;
+ ST_UB2(src1, src1, dst, 16);
+ dst += dst_stride;
+ ST_UB2(src2, src2, dst, 16);
+ dst += dst_stride;
+ ST_UB2(src3, src3, dst, 16);
+ dst += dst_stride;
+ }
+}
+
+void ff_dc_4x4_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src_left,
+ const uint8_t *src_top)
+{
+ uint32_t val0, val1;
+ v16i8 store, src = { 0 };
+ v8u16 sum_h;
+ v4u32 sum_w;
+ v2u64 sum_d;
+
+ val0 = LW(src_top);
+ val1 = LW(src_left);
+ INSERT_W2_SB(val0, val1, src);
+ sum_h = __msa_hadd_u_h((v16u8) src, (v16u8) src);
+ sum_w = __msa_hadd_u_w(sum_h, sum_h);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 3);
+ store = __msa_splati_b((v16i8) sum_w, 0);
+ val0 = __msa_copy_u_w((v4i32) store, 0);
+
+ SW4(val0, val0, val0, val0, dst, dst_stride);
+}
+
+#define INTRA_DC_TL_4x4(dir) \
+void ff_dc_##dir##_4x4_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, \
+ const uint8_t *top) \
+{ \
+ uint32_t val0; \
+ v16i8 store, data = { 0 }; \
+ v8u16 sum_h; \
+ v4u32 sum_w; \
+ \
+ val0 = LW(dir); \
+ data = (v16i8) __msa_insert_w((v4i32) data, 0, val0); \
+ sum_h = __msa_hadd_u_h((v16u8) data, (v16u8) data); \
+ sum_w = __msa_hadd_u_w(sum_h, sum_h); \
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_w, 2); \
+ store = __msa_splati_b((v16i8) sum_w, 0); \
+ val0 = __msa_copy_u_w((v4i32) store, 0); \
+ \
+ SW4(val0, val0, val0, val0, dst, dst_stride); \
+}
+INTRA_DC_TL_4x4(top);
+INTRA_DC_TL_4x4(left);
+
+void ff_dc_8x8_msa(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src_left,
+ const uint8_t *src_top)
+{
+ uint64_t val0, val1;
+ v16i8 store;
+ v16u8 src = { 0 };
+ v8u16 sum_h;
+ v4u32 sum_w;
+ v2u64 sum_d;
+
+ val0 = LD(src_top);
+ val1 = LD(src_left);
+ INSERT_D2_UB(val0, val1, src);
+ sum_h = __msa_hadd_u_h(src, src);
+ sum_w = __msa_hadd_u_w(sum_h, sum_h);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_pckev_w((v4i32) sum_d, (v4i32) sum_d);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 4);
+ store = __msa_splati_b((v16i8) sum_w, 0);
+ val0 = __msa_copy_u_d((v2i64) store, 0);
+
+ SD4(val0, val0, val0, val0, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(val0, val0, val0, val0, dst, dst_stride);
+}
+
+#define INTRA_DC_TL_8x8(dir) \
+void ff_dc_##dir##_8x8_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, \
+ const uint8_t *top) \
+{ \
+ uint64_t val0; \
+ v16i8 store; \
+ v16u8 data = { 0 }; \
+ v8u16 sum_h; \
+ v4u32 sum_w; \
+ v2u64 sum_d; \
+ \
+ val0 = LD(dir); \
+ data = (v16u8) __msa_insert_d((v2i64) data, 0, val0); \
+ sum_h = __msa_hadd_u_h(data, data); \
+ sum_w = __msa_hadd_u_w(sum_h, sum_h); \
+ sum_d = __msa_hadd_u_d(sum_w, sum_w); \
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 3); \
+ store = __msa_splati_b((v16i8) sum_w, 0); \
+ val0 = __msa_copy_u_d((v2i64) store, 0); \
+ \
+ SD4(val0, val0, val0, val0, dst, dst_stride); \
+ dst += (4 * dst_stride); \
+ SD4(val0, val0, val0, val0, dst, dst_stride); \
+}
+
+INTRA_DC_TL_8x8(top);
+INTRA_DC_TL_8x8(left);
+
+void ff_dc_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top)
+{
+ v16u8 top, left, out;
+ v8u16 sum_h, sum_top, sum_left;
+ v4u32 sum_w;
+ v2u64 sum_d;
+
+ top = LD_UB(src_top);
+ left = LD_UB(src_left);
+ HADD_UB2_UH(top, left, sum_top, sum_left);
+ sum_h = sum_top + sum_left;
+ sum_w = __msa_hadd_u_w(sum_h, sum_h);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_pckev_w((v4i32) sum_d, (v4i32) sum_d);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 5);
+ out = (v16u8) __msa_splati_b((v16i8) sum_w, 0);
+
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride);
+ dst += (8 * dst_stride);
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride);
+}
+
+#define INTRA_DC_TL_16x16(dir) \
+void ff_dc_##dir##_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, \
+ const uint8_t *top) \
+{ \
+ v16u8 data, out; \
+ v8u16 sum_h; \
+ v4u32 sum_w; \
+ v2u64 sum_d; \
+ \
+ data = LD_UB(dir); \
+ sum_h = __msa_hadd_u_h(data, data); \
+ sum_w = __msa_hadd_u_w(sum_h, sum_h); \
+ sum_d = __msa_hadd_u_d(sum_w, sum_w); \
+ sum_w = (v4u32) __msa_pckev_w((v4i32) sum_d, (v4i32) sum_d); \
+ sum_d = __msa_hadd_u_d(sum_w, sum_w); \
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 4); \
+ out = (v16u8) __msa_splati_b((v16i8) sum_w, 0); \
+ \
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \
+ dst += (8 * dst_stride); \
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \
+}
+INTRA_DC_TL_16x16(top);
+INTRA_DC_TL_16x16(left);
+
+void ff_dc_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top)
+{
+ uint32_t row;
+ v16u8 top0, top1, left0, left1, out;
+ v8u16 sum_h, sum_top0, sum_top1, sum_left0, sum_left1;
+ v4u32 sum_w;
+ v2u64 sum_d;
+
+ LD_UB2(src_top, 16, top0, top1);
+ LD_UB2(src_left, 16, left0, left1);
+ HADD_UB2_UH(top0, top1, sum_top0, sum_top1);
+ HADD_UB2_UH(left0, left1, sum_left0, sum_left1);
+ sum_h = sum_top0 + sum_top1;
+ sum_h += sum_left0 + sum_left1;
+ sum_w = __msa_hadd_u_w(sum_h, sum_h);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_pckev_w((v4i32) sum_d, (v4i32) sum_d);
+ sum_d = __msa_hadd_u_d(sum_w, sum_w);
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 6);
+ out = (v16u8) __msa_splati_b((v16i8) sum_w, 0);
+
+ for (row = 16; row--;)
+ {
+ ST_UB2(out, out, dst, 16);
+ dst += dst_stride;
+ ST_UB2(out, out, dst, 16);
+ dst += dst_stride;
+ }
+}
+
+#define INTRA_DC_TL_32x32(dir) \
+void ff_dc_##dir##_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, \
+ const uint8_t *top) \
+{ \
+ uint32_t row; \
+ v16u8 data0, data1, out; \
+ v8u16 sum_h, sum_data0, sum_data1; \
+ v4u32 sum_w; \
+ v2u64 sum_d; \
+ \
+ LD_UB2(dir, 16, data0, data1); \
+ HADD_UB2_UH(data0, data1, sum_data0, sum_data1); \
+ sum_h = sum_data0 + sum_data1; \
+ sum_w = __msa_hadd_u_w(sum_h, sum_h); \
+ sum_d = __msa_hadd_u_d(sum_w, sum_w); \
+ sum_w = (v4u32) __msa_pckev_w((v4i32) sum_d, (v4i32) sum_d); \
+ sum_d = __msa_hadd_u_d(sum_w, sum_w); \
+ sum_w = (v4u32) __msa_srari_w((v4i32) sum_d, 5); \
+ out = (v16u8) __msa_splati_b((v16i8) sum_w, 0); \
+ \
+ for (row = 16; row--;) \
+ { \
+ ST_UB2(out, out, dst, 16); \
+ dst += dst_stride; \
+ ST_UB2(out, out, dst, 16); \
+ dst += dst_stride; \
+ } \
+}
+INTRA_DC_TL_32x32(top);
+INTRA_DC_TL_32x32(left);
+
+#define INTRA_PREDICT_VALDC_16X16_MSA(val) \
+void ff_dc_##val##_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, const uint8_t *top) \
+{ \
+ v16u8 out = (v16u8) __msa_ldi_b(val); \
+ \
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \
+ dst += (8 * dst_stride); \
+ ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \
+}
+
+INTRA_PREDICT_VALDC_16X16_MSA(127);
+INTRA_PREDICT_VALDC_16X16_MSA(128);
+INTRA_PREDICT_VALDC_16X16_MSA(129);
+
+#define INTRA_PREDICT_VALDC_32X32_MSA(val) \
+void ff_dc_##val##_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride, \
+ const uint8_t *left, const uint8_t *top) \
+{ \
+ uint32_t row; \
+ v16u8 out = (v16u8) __msa_ldi_b(val); \
+ \
+ for (row = 16; row--;) \
+ { \
+ ST_UB2(out, out, dst, 16); \
+ dst += dst_stride; \
+ ST_UB2(out, out, dst, 16); \
+ dst += dst_stride; \
+ } \
+}
+
+INTRA_PREDICT_VALDC_32X32_MSA(127);
+INTRA_PREDICT_VALDC_32X32_MSA(128);
+INTRA_PREDICT_VALDC_32X32_MSA(129);
+
+void ff_tm_4x4_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top_ptr)
+{
+ uint32_t left;
+ uint8_t top_left = src_top_ptr[-1];
+ v16i8 src_top, src_left0, src_left1, src_left2, src_left3, tmp0, tmp1;
+ v16u8 src0, src1, src2, src3;
+ v8u16 src_top_left, vec0, vec1, vec2, vec3;
+
+ src_top_left = (v8u16) __msa_fill_h(top_left);
+ src_top = LD_SB(src_top_ptr);
+ left = LW(src_left);
+ src_left0 = __msa_fill_b(left >> 24);
+ src_left1 = __msa_fill_b(left >> 16);
+ src_left2 = __msa_fill_b(left >> 8);
+ src_left3 = __msa_fill_b(left);
+
+ ILVR_B4_UB(src_left0, src_top, src_left1, src_top, src_left2, src_top,
+ src_left3, src_top, src0, src1, src2, src3);
+ HADD_UB4_UH(src0, src1, src2, src3, vec0, vec1, vec2, vec3);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, vec0, vec1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, vec2, vec3);
+ SAT_UH4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, tmp0, tmp1);
+ ST4x4_UB(tmp0, tmp1, 0, 2, 0, 2, dst, dst_stride);
+}
+
+void ff_tm_8x8_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top_ptr)
+{
+ uint8_t top_left = src_top_ptr[-1];
+ uint32_t loop_cnt, left;
+ v16i8 src_top, src_left0, src_left1, src_left2, src_left3, tmp0, tmp1;
+ v8u16 src_top_left, vec0, vec1, vec2, vec3;
+ v16u8 src0, src1, src2, src3;
+
+ src_top = LD_SB(src_top_ptr);
+ src_top_left = (v8u16) __msa_fill_h(top_left);
+
+ src_left += 4;
+ for (loop_cnt = 2; loop_cnt--;) {
+ left = LW(src_left);
+ src_left0 = __msa_fill_b(left >> 24);
+ src_left1 = __msa_fill_b(left >> 16);
+ src_left2 = __msa_fill_b(left >> 8);
+ src_left3 = __msa_fill_b(left);
+ src_left -= 4;
+
+ ILVR_B4_UB(src_left0, src_top, src_left1, src_top, src_left2, src_top,
+ src_left3, src_top, src0, src1, src2, src3);
+ HADD_UB4_UH(src0, src1, src2, src3, vec0, vec1, vec2, vec3);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, vec0, vec1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, vec2, vec3);
+ SAT_UH4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, tmp0, tmp1);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_tm_16x16_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top_ptr)
+{
+ uint8_t top_left = src_top_ptr[-1];
+ uint32_t loop_cnt, left;
+ v16i8 src_top, src_left0, src_left1, src_left2, src_left3;
+ v8u16 src_top_left, res_r, res_l;
+
+ src_top = LD_SB(src_top_ptr);
+ src_top_left = (v8u16) __msa_fill_h(top_left);
+
+ src_left += 12;
+ for (loop_cnt = 4; loop_cnt--;) {
+ left = LW(src_left);
+ src_left0 = __msa_fill_b(left >> 24);
+ src_left1 = __msa_fill_b(left >> 16);
+ src_left2 = __msa_fill_b(left >> 8);
+ src_left3 = __msa_fill_b(left);
+ src_left -= 4;
+
+ ILVRL_B2_UH(src_left0, src_top, res_r, res_l);
+ HADD_UB2_UH(res_r, res_l, res_r, res_l);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r, res_l);
+
+ SAT_UH2_UH(res_r, res_l, 7);
+ PCKEV_ST_SB(res_r, res_l, dst);
+ dst += dst_stride;
+
+ ILVRL_B2_UH(src_left1, src_top, res_r, res_l);
+ HADD_UB2_UH(res_r, res_l, res_r, res_l);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r, res_l);
+ SAT_UH2_UH(res_r, res_l, 7);
+ PCKEV_ST_SB(res_r, res_l, dst);
+ dst += dst_stride;
+
+ ILVRL_B2_UH(src_left2, src_top, res_r, res_l);
+ HADD_UB2_UH(res_r, res_l, res_r, res_l);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r, res_l);
+ SAT_UH2_UH(res_r, res_l, 7);
+ PCKEV_ST_SB(res_r, res_l, dst);
+ dst += dst_stride;
+
+ ILVRL_B2_UH(src_left3, src_top, res_r, res_l);
+ HADD_UB2_UH(res_r, res_l, res_r, res_l);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r, res_l);
+ SAT_UH2_UH(res_r, res_l, 7);
+ PCKEV_ST_SB(res_r, res_l, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_tm_32x32_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src_left, const uint8_t *src_top_ptr)
+{
+ uint8_t top_left = src_top_ptr[-1];
+ uint32_t loop_cnt, left;
+ v16i8 src_top0, src_top1, src_left0, src_left1, src_left2, src_left3;
+ v8u16 src_top_left, res_r0, res_r1, res_l0, res_l1;
+
+ src_top0 = LD_SB(src_top_ptr);
+ src_top1 = LD_SB(src_top_ptr + 16);
+ src_top_left = (v8u16) __msa_fill_h(top_left);
+
+ src_left += 28;
+ for (loop_cnt = 8; loop_cnt--;) {
+ left = LW(src_left);
+ src_left0 = __msa_fill_b(left >> 24);
+ src_left1 = __msa_fill_b(left >> 16);
+ src_left2 = __msa_fill_b(left >> 8);
+ src_left3 = __msa_fill_b(left);
+ src_left -= 4;
+
+ ILVR_B2_UH(src_left0, src_top0, src_left0, src_top1, res_r0, res_r1);
+ ILVL_B2_UH(src_left0, src_top0, src_left0, src_top1, res_l0, res_l1);
+ HADD_UB4_UH(res_r0, res_l0, res_r1, res_l1, res_r0, res_l0, res_r1,
+ res_l1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r0, res_l0);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r1, res_l1);
+ SAT_UH4_UH(res_r0, res_l0, res_r1, res_l1, 7);
+ PCKEV_ST_SB(res_r0, res_l0, dst);
+ PCKEV_ST_SB(res_r1, res_l1, dst + 16);
+ dst += dst_stride;
+
+ ILVR_B2_UH(src_left1, src_top0, src_left1, src_top1, res_r0, res_r1);
+ ILVL_B2_UH(src_left1, src_top0, src_left1, src_top1, res_l0, res_l1);
+ HADD_UB4_UH(res_r0, res_l0, res_r1, res_l1, res_r0, res_l0, res_r1,
+ res_l1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r0, res_l0);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r1, res_l1);
+ SAT_UH4_UH(res_r0, res_l0, res_r1, res_l1, 7);
+ PCKEV_ST_SB(res_r0, res_l0, dst);
+ PCKEV_ST_SB(res_r1, res_l1, dst + 16);
+ dst += dst_stride;
+
+ ILVR_B2_UH(src_left2, src_top0, src_left2, src_top1, res_r0, res_r1);
+ ILVL_B2_UH(src_left2, src_top0, src_left2, src_top1, res_l0, res_l1);
+ HADD_UB4_UH(res_r0, res_l0, res_r1, res_l1, res_r0, res_l0, res_r1,
+ res_l1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r0, res_l0);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r1, res_l1);
+ SAT_UH4_UH(res_r0, res_l0, res_r1, res_l1, 7);
+ PCKEV_ST_SB(res_r0, res_l0, dst);
+ PCKEV_ST_SB(res_r1, res_l1, dst + 16);
+ dst += dst_stride;
+
+ ILVR_B2_UH(src_left3, src_top0, src_left3, src_top1, res_r0, res_r1);
+ ILVL_B2_UH(src_left3, src_top0, src_left3, src_top1, res_l0, res_l1);
+ HADD_UB4_UH(res_r0, res_l0, res_r1, res_l1, res_r0, res_l0, res_r1,
+ res_l1);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r0, res_l0);
+ IPRED_SUBS_UH2_UH(src_top_left, src_top_left, res_r1, res_l1);
+ SAT_UH4_UH(res_r0, res_l0, res_r1, res_l1, 7);
+ PCKEV_ST_SB(res_r0, res_l0, dst);
+ PCKEV_ST_SB(res_r1, res_l1, dst + 16);
+ dst += dst_stride;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9_lpf_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_lpf_msa.c
new file mode 100644
index 00000000000..63e538eb905
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_lpf_msa.c
@@ -0,0 +1,2599 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/vp9dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp9dsp_mips.h"
+
+#define VP9_LPF_FILTER4_8W(p1_in, p0_in, q0_in, q1_in, mask_in, hev_in, \
+ p1_out, p0_out, q0_out, q1_out) \
+{ \
+ v16i8 p1_m, p0_m, q0_m, q1_m, q0_sub_p0, filt_sign; \
+ v16i8 filt, filt1, filt2, cnst4b, cnst3b; \
+ v8i16 q0_sub_p0_r, filt_r, cnst3h; \
+ \
+ p1_m = (v16i8) __msa_xori_b(p1_in, 0x80); \
+ p0_m = (v16i8) __msa_xori_b(p0_in, 0x80); \
+ q0_m = (v16i8) __msa_xori_b(q0_in, 0x80); \
+ q1_m = (v16i8) __msa_xori_b(q1_in, 0x80); \
+ \
+ filt = __msa_subs_s_b(p1_m, q1_m); \
+ filt = filt & (v16i8) hev_in; \
+ q0_sub_p0 = q0_m - p0_m; \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ \
+ cnst3h = __msa_ldi_h(3); \
+ q0_sub_p0_r = (v8i16) __msa_ilvr_b(q0_sub_p0, q0_sub_p0); \
+ q0_sub_p0_r = __msa_dotp_s_h((v16i8) q0_sub_p0_r, (v16i8) cnst3h); \
+ filt_r = (v8i16) __msa_ilvr_b(filt_sign, filt); \
+ filt_r += q0_sub_p0_r; \
+ filt_r = __msa_sat_s_h(filt_r, 7); \
+ \
+ /* combine left and right part */ \
+ filt = __msa_pckev_b((v16i8) filt_r, (v16i8) filt_r); \
+ \
+ filt = filt & (v16i8) mask_in; \
+ cnst4b = __msa_ldi_b(4); \
+ filt1 = __msa_adds_s_b(filt, cnst4b); \
+ filt1 >>= 3; \
+ \
+ cnst3b = __msa_ldi_b(3); \
+ filt2 = __msa_adds_s_b(filt, cnst3b); \
+ filt2 >>= 3; \
+ \
+ q0_m = __msa_subs_s_b(q0_m, filt1); \
+ q0_out = __msa_xori_b((v16u8) q0_m, 0x80); \
+ p0_m = __msa_adds_s_b(p0_m, filt2); \
+ p0_out = __msa_xori_b((v16u8) p0_m, 0x80); \
+ \
+ filt = __msa_srari_b(filt1, 1); \
+ hev_in = __msa_xori_b((v16u8) hev_in, 0xff); \
+ filt = filt & (v16i8) hev_in; \
+ \
+ q1_m = __msa_subs_s_b(q1_m, filt); \
+ q1_out = __msa_xori_b((v16u8) q1_m, 0x80); \
+ p1_m = __msa_adds_s_b(p1_m, filt); \
+ p1_out = __msa_xori_b((v16u8) p1_m, 0x80); \
+}
+
+#define VP9_LPF_FILTER4_4W(p1_in, p0_in, q0_in, q1_in, mask_in, hev_in, \
+ p1_out, p0_out, q0_out, q1_out) \
+{ \
+ v16i8 p1_m, p0_m, q0_m, q1_m, q0_sub_p0, filt_sign; \
+ v16i8 filt, filt1, filt2, cnst4b, cnst3b; \
+ v8i16 q0_sub_p0_r, q0_sub_p0_l, filt_l, filt_r, cnst3h; \
+ \
+ p1_m = (v16i8) __msa_xori_b(p1_in, 0x80); \
+ p0_m = (v16i8) __msa_xori_b(p0_in, 0x80); \
+ q0_m = (v16i8) __msa_xori_b(q0_in, 0x80); \
+ q1_m = (v16i8) __msa_xori_b(q1_in, 0x80); \
+ \
+ filt = __msa_subs_s_b(p1_m, q1_m); \
+ \
+ filt = filt & (v16i8) hev_in; \
+ \
+ q0_sub_p0 = q0_m - p0_m; \
+ filt_sign = __msa_clti_s_b(filt, 0); \
+ \
+ cnst3h = __msa_ldi_h(3); \
+ q0_sub_p0_r = (v8i16) __msa_ilvr_b(q0_sub_p0, q0_sub_p0); \
+ q0_sub_p0_r = __msa_dotp_s_h((v16i8) q0_sub_p0_r, (v16i8) cnst3h); \
+ filt_r = (v8i16) __msa_ilvr_b(filt_sign, filt); \
+ filt_r += q0_sub_p0_r; \
+ filt_r = __msa_sat_s_h(filt_r, 7); \
+ \
+ q0_sub_p0_l = (v8i16) __msa_ilvl_b(q0_sub_p0, q0_sub_p0); \
+ q0_sub_p0_l = __msa_dotp_s_h((v16i8) q0_sub_p0_l, (v16i8) cnst3h); \
+ filt_l = (v8i16) __msa_ilvl_b(filt_sign, filt); \
+ filt_l += q0_sub_p0_l; \
+ filt_l = __msa_sat_s_h(filt_l, 7); \
+ \
+ filt = __msa_pckev_b((v16i8) filt_l, (v16i8) filt_r); \
+ filt = filt & (v16i8) mask_in; \
+ \
+ cnst4b = __msa_ldi_b(4); \
+ filt1 = __msa_adds_s_b(filt, cnst4b); \
+ filt1 >>= 3; \
+ \
+ cnst3b = __msa_ldi_b(3); \
+ filt2 = __msa_adds_s_b(filt, cnst3b); \
+ filt2 >>= 3; \
+ \
+ q0_m = __msa_subs_s_b(q0_m, filt1); \
+ q0_out = __msa_xori_b((v16u8) q0_m, 0x80); \
+ p0_m = __msa_adds_s_b(p0_m, filt2); \
+ p0_out = __msa_xori_b((v16u8) p0_m, 0x80); \
+ \
+ filt = __msa_srari_b(filt1, 1); \
+ hev_in = __msa_xori_b((v16u8) hev_in, 0xff); \
+ filt = filt & (v16i8) hev_in; \
+ \
+ q1_m = __msa_subs_s_b(q1_m, filt); \
+ q1_out = __msa_xori_b((v16u8) q1_m, 0x80); \
+ p1_m = __msa_adds_s_b(p1_m, filt); \
+ p1_out = __msa_xori_b((v16u8) p1_m, 0x80); \
+}
+
+#define VP9_FLAT4(p3_in, p2_in, p0_in, q0_in, q2_in, q3_in, flat_out) \
+{ \
+ v16u8 tmp, p2_a_sub_p0, q2_a_sub_q0, p3_a_sub_p0, q3_a_sub_q0; \
+ v16u8 zero_in = { 0 }; \
+ \
+ tmp = __msa_ori_b(zero_in, 1); \
+ p2_a_sub_p0 = __msa_asub_u_b(p2_in, p0_in); \
+ q2_a_sub_q0 = __msa_asub_u_b(q2_in, q0_in); \
+ p3_a_sub_p0 = __msa_asub_u_b(p3_in, p0_in); \
+ q3_a_sub_q0 = __msa_asub_u_b(q3_in, q0_in); \
+ \
+ p2_a_sub_p0 = __msa_max_u_b(p2_a_sub_p0, q2_a_sub_q0); \
+ flat_out = __msa_max_u_b(p2_a_sub_p0, flat_out); \
+ p3_a_sub_p0 = __msa_max_u_b(p3_a_sub_p0, q3_a_sub_q0); \
+ flat_out = __msa_max_u_b(p3_a_sub_p0, flat_out); \
+ \
+ flat_out = (tmp < (v16u8) flat_out); \
+ flat_out = __msa_xori_b(flat_out, 0xff); \
+ flat_out = flat_out & (mask); \
+}
+
+#define VP9_FLAT5(p7_in, p6_in, p5_in, p4_in, p0_in, q0_in, q4_in, \
+ q5_in, q6_in, q7_in, flat_in, flat2_out) \
+{ \
+ v16u8 tmp, zero_in = { 0 }; \
+ v16u8 p4_a_sub_p0, q4_a_sub_q0, p5_a_sub_p0, q5_a_sub_q0; \
+ v16u8 p6_a_sub_p0, q6_a_sub_q0, p7_a_sub_p0, q7_a_sub_q0; \
+ \
+ tmp = __msa_ori_b(zero_in, 1); \
+ p4_a_sub_p0 = __msa_asub_u_b(p4_in, p0_in); \
+ q4_a_sub_q0 = __msa_asub_u_b(q4_in, q0_in); \
+ p5_a_sub_p0 = __msa_asub_u_b(p5_in, p0_in); \
+ q5_a_sub_q0 = __msa_asub_u_b(q5_in, q0_in); \
+ p6_a_sub_p0 = __msa_asub_u_b(p6_in, p0_in); \
+ q6_a_sub_q0 = __msa_asub_u_b(q6_in, q0_in); \
+ p7_a_sub_p0 = __msa_asub_u_b(p7_in, p0_in); \
+ q7_a_sub_q0 = __msa_asub_u_b(q7_in, q0_in); \
+ \
+ p4_a_sub_p0 = __msa_max_u_b(p4_a_sub_p0, q4_a_sub_q0); \
+ flat2_out = __msa_max_u_b(p5_a_sub_p0, q5_a_sub_q0); \
+ flat2_out = __msa_max_u_b(p4_a_sub_p0, flat2_out); \
+ p6_a_sub_p0 = __msa_max_u_b(p6_a_sub_p0, q6_a_sub_q0); \
+ flat2_out = __msa_max_u_b(p6_a_sub_p0, flat2_out); \
+ p7_a_sub_p0 = __msa_max_u_b(p7_a_sub_p0, q7_a_sub_q0); \
+ flat2_out = __msa_max_u_b(p7_a_sub_p0, flat2_out); \
+ \
+ flat2_out = (tmp < (v16u8) flat2_out); \
+ flat2_out = __msa_xori_b(flat2_out, 0xff); \
+ flat2_out = flat2_out & flat_in; \
+}
+
+#define VP9_FILTER8(p3_in, p2_in, p1_in, p0_in, \
+ q0_in, q1_in, q2_in, q3_in, \
+ p2_filt8_out, p1_filt8_out, p0_filt8_out, \
+ q0_filt8_out, q1_filt8_out, q2_filt8_out) \
+{ \
+ v8u16 tmp0, tmp1, tmp2; \
+ \
+ tmp2 = p2_in + p1_in + p0_in; \
+ tmp0 = p3_in << 1; \
+ \
+ tmp0 = tmp0 + tmp2 + q0_in; \
+ tmp1 = tmp0 + p3_in + p2_in; \
+ p2_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp1, 3); \
+ \
+ tmp1 = tmp0 + p1_in + q1_in; \
+ p1_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp1, 3); \
+ \
+ tmp1 = q2_in + q1_in + q0_in; \
+ tmp2 = tmp2 + tmp1; \
+ tmp0 = tmp2 + (p0_in); \
+ tmp0 = tmp0 + (p3_in); \
+ p0_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp0, 3); \
+ \
+ tmp0 = q2_in + q3_in; \
+ tmp0 = p0_in + tmp1 + tmp0; \
+ tmp1 = q3_in + q3_in; \
+ tmp1 = tmp1 + tmp0; \
+ q2_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp1, 3); \
+ \
+ tmp0 = tmp2 + q3_in; \
+ tmp1 = tmp0 + q0_in; \
+ q0_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp1, 3); \
+ \
+ tmp1 = tmp0 - p2_in; \
+ tmp0 = q1_in + q3_in; \
+ tmp1 = tmp0 + tmp1; \
+ q1_filt8_out = (v8i16) __msa_srari_h((v8i16) tmp1, 3); \
+}
+
+#define LPF_MASK_HEV(p3_in, p2_in, p1_in, p0_in, \
+ q0_in, q1_in, q2_in, q3_in, \
+ limit_in, b_limit_in, thresh_in, \
+ hev_out, mask_out, flat_out) \
+{ \
+ v16u8 p3_asub_p2_m, p2_asub_p1_m, p1_asub_p0_m, q1_asub_q0_m; \
+ v16u8 p1_asub_q1_m, p0_asub_q0_m, q3_asub_q2_m, q2_asub_q1_m; \
+ \
+ /* absolute subtraction of pixel values */ \
+ p3_asub_p2_m = __msa_asub_u_b(p3_in, p2_in); \
+ p2_asub_p1_m = __msa_asub_u_b(p2_in, p1_in); \
+ p1_asub_p0_m = __msa_asub_u_b(p1_in, p0_in); \
+ q1_asub_q0_m = __msa_asub_u_b(q1_in, q0_in); \
+ q2_asub_q1_m = __msa_asub_u_b(q2_in, q1_in); \
+ q3_asub_q2_m = __msa_asub_u_b(q3_in, q2_in); \
+ p0_asub_q0_m = __msa_asub_u_b(p0_in, q0_in); \
+ p1_asub_q1_m = __msa_asub_u_b(p1_in, q1_in); \
+ \
+ /* calculation of hev */ \
+ flat_out = __msa_max_u_b(p1_asub_p0_m, q1_asub_q0_m); \
+ hev_out = thresh_in < (v16u8) flat_out; \
+ \
+ /* calculation of mask */ \
+ p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p0_asub_q0_m); \
+ p1_asub_q1_m >>= 1; \
+ p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p1_asub_q1_m); \
+ \
+ mask_out = b_limit_in < p0_asub_q0_m; \
+ mask_out = __msa_max_u_b(flat_out, mask_out); \
+ p3_asub_p2_m = __msa_max_u_b(p3_asub_p2_m, p2_asub_p1_m); \
+ mask_out = __msa_max_u_b(p3_asub_p2_m, mask_out); \
+ q2_asub_q1_m = __msa_max_u_b(q2_asub_q1_m, q3_asub_q2_m); \
+ mask_out = __msa_max_u_b(q2_asub_q1_m, mask_out); \
+ \
+ mask_out = limit_in < (v16u8) mask_out; \
+ mask_out = __msa_xori_b(mask_out, 0xff); \
+}
+
+void ff_loop_filter_v_4_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint64_t p1_d, p0_d, q0_d, q1_d;
+ v16u8 mask, hev, flat, thresh, b_limit, limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0, p1_out, p0_out, q0_out, q1_out;
+
+ /* load vector elements */
+ LD_UB8((src - 4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
+ SD4(p1_d, p0_d, q0_d, q1_d, (src - 2 * pitch), pitch);
+}
+
+
+void ff_loop_filter_v_44_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 mask, hev, flat, thresh0, b_limit0, limit0, thresh1, b_limit1, limit1;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+
+ /* load vector elements */
+ LD_UB8((src - 4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh0 = (v16u8) __msa_fill_b(thresh_ptr);
+ thresh1 = (v16u8) __msa_fill_b(thresh_ptr >> 8);
+ thresh0 = (v16u8) __msa_ilvr_d((v2i64) thresh1, (v2i64) thresh0);
+
+ b_limit0 = (v16u8) __msa_fill_b(b_limit_ptr);
+ b_limit1 = (v16u8) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit0 = (v16u8) __msa_ilvr_d((v2i64) b_limit1, (v2i64) b_limit0);
+
+ limit0 = (v16u8) __msa_fill_b(limit_ptr);
+ limit1 = (v16u8) __msa_fill_b(limit_ptr >> 8);
+ limit0 = (v16u8) __msa_ilvr_d((v2i64) limit1, (v2i64) limit0);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0,
+ hev, mask, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1, p0, q0, q1);
+
+ ST_UB4(p1, p0, q0, q1, (src - 2 * pitch), pitch);
+}
+
+void ff_loop_filter_v_8_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d;
+ v16u8 mask, hev, flat, thresh, b_limit, limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v8i16 p2_filter8, p1_filter8, p0_filter8;
+ v8i16 q0_filter8, q1_filter8, q2_filter8;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q3_r, q2_r, q1_r, q0_r;
+ v16i8 zero = { 0 };
+
+ /* load vector elements */
+ LD_UB8((src - 4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
+ SD4(p1_d, p0_d, q0_d, q1_d, (src - 2 * pitch), pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r,
+ q2_r, q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filter8,
+ p1_filter8, p0_filter8, q0_filter8, q1_filter8, q2_filter8);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(zero, p2_filter8, zero, p1_filter8, zero, p0_filter8,
+ zero, q0_filter8, p2_filter8, p1_filter8, p0_filter8,
+ q0_filter8);
+ PCKEV_B2_SH(zero, q1_filter8, zero, q2_filter8, q1_filter8, q2_filter8);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filter8, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filter8, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filter8, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filter8, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filter8, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filter8, flat);
+
+ p2_d = __msa_copy_u_d((v2i64) p2_out, 0);
+ p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
+ q2_d = __msa_copy_u_d((v2i64) q2_out, 0);
+
+ src -= 3 * pitch;
+
+ SD4(p2_d, p1_d, p0_d, q0_d, src, pitch);
+ src += (4 * pitch);
+ SD(q1_d, src);
+ src += pitch;
+ SD(q2_d, src);
+ }
+}
+
+void ff_loop_filter_v_88_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, tmp, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16u8 zero = { 0 };
+
+ /* load vector elements */
+ LD_UB8(src - (4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ tmp = (v16u8) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ tmp = (v16u8) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ tmp = (v16u8) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ST_UB4(p1_out, p0_out, q0_out, q1_out, (src - 2 * pitch), pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r,
+ q2_r, q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_r, p1_filt8_l, p1_filt8_r, p0_filt8_l,
+ p0_filt8_r, q0_filt8_l, q0_filt8_r, p2_filt8_r, p1_filt8_r,
+ p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_r, q2_filt8_l, q2_filt8_r,
+ q1_filt8_r, q2_filt8_r);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ src -= 3 * pitch;
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, src, pitch);
+ src += (4 * pitch);
+ ST_UB2(q1_out, q2_out, src, pitch);
+ src += (2 * pitch);
+ }
+}
+
+void ff_loop_filter_v_84_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, tmp, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v16u8 zero = { 0 };
+
+ /* load vector elements */
+ LD_UB8(src - (4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ tmp = (v16u8) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ tmp = (v16u8) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ tmp = (v16u8) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ST_UB4(p1_out, p0_out, q0_out, q1_out, (src - 2 * pitch), pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r,
+ q2_r, q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_r, p2_filt8_r, p1_filt8_r, p1_filt8_r,
+ p0_filt8_r, p0_filt8_r, q0_filt8_r, q0_filt8_r,
+ p2_filt8_r, p1_filt8_r, p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_r, q1_filt8_r, q2_filt8_r, q2_filt8_r,
+ q1_filt8_r, q2_filt8_r);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ src -= 3 * pitch;
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, src, pitch);
+ src += (4 * pitch);
+ ST_UB2(q1_out, q2_out, src, pitch);
+ src += (2 * pitch);
+ }
+}
+
+void ff_loop_filter_v_48_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, tmp, thresh, b_limit, limit;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16u8 zero = { 0 };
+
+ /* load vector elements */
+ LD_UB8(src - (4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ tmp = (v16u8) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ tmp = (v16u8) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ tmp = (v16u8) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) tmp, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_insve_d((v2i64) flat, 0, (v2i64) zero);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ST_UB4(p1_out, p0_out, q0_out, q1_out, (src - 2 * pitch), pitch);
+ } else {
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_l, p1_filt8_l, p1_filt8_l,
+ p0_filt8_l, p0_filt8_l, q0_filt8_l, q0_filt8_l,
+ p2_filt8_l, p1_filt8_l, p0_filt8_l, q0_filt8_l);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_l, q2_filt8_l, q2_filt8_l,
+ q1_filt8_l, q2_filt8_l);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filt8_l, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_l, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_l, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_l, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_l, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filt8_l, flat);
+
+ src -= 3 * pitch;
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, src, pitch);
+ src += (4 * pitch);
+ ST_UB2(q1_out, q2_out, src, pitch);
+ src += (2 * pitch);
+ }
+}
+
+static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, int32_t pitch,
+ uint8_t *filter48,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16u8 zero = { 0 };
+
+ /* load vector elements */
+ LD_UB8(src - (4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ST_UB4(p1_out, p0_out, q0_out, q1_out, (src - 2 * pitch), pitch);
+
+ return 1;
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r,
+ q2_r, q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_r, p1_filt8_l, p1_filt8_r, p0_filt8_l,
+ p0_filt8_r, q0_filt8_l, q0_filt8_r, p2_filt8_r, p1_filt8_r,
+ p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_r, q2_filt8_l, q2_filt8_r, q1_filt8_r,
+ q2_filt8_r);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, filter48, 16);
+ filter48 += (4 * 16);
+ ST_UB2(q1_out, q2_out, filter48, 16);
+ filter48 += (2 * 16);
+ ST_UB(flat, filter48);
+
+ return 0;
+ }
+}
+
+static void vp9_hz_lpf_t16_16w(uint8_t *src, int32_t pitch, uint8_t *filter48)
+{
+ v16u8 flat, flat2, filter8;
+ v16i8 zero = { 0 };
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+ v8u16 p7_r_in, p6_r_in, p5_r_in, p4_r_in;
+ v8u16 p3_r_in, p2_r_in, p1_r_in, p0_r_in;
+ v8u16 q7_r_in, q6_r_in, q5_r_in, q4_r_in;
+ v8u16 q3_r_in, q2_r_in, q1_r_in, q0_r_in;
+ v8u16 p7_l_in, p6_l_in, p5_l_in, p4_l_in;
+ v8u16 p3_l_in, p2_l_in, p1_l_in, p0_l_in;
+ v8u16 q7_l_in, q6_l_in, q5_l_in, q4_l_in;
+ v8u16 q3_l_in, q2_l_in, q1_l_in, q0_l_in;
+ v8u16 tmp0_r, tmp1_r, tmp0_l, tmp1_l;
+ v8i16 l_out, r_out;
+
+ flat = LD_UB(filter48 + 96);
+
+ LD_UB8((src - 8 * pitch), pitch, p7, p6, p5, p4, p3, p2, p1, p0);
+ LD_UB8(src, pitch, q0, q1, q2, q3, q4, q5, q6, q7);
+ VP9_FLAT5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, flat, flat2);
+
+ /* if flat2 is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat2)) {
+ LD_UB4(filter48, 16, p2, p1, p0, q0);
+ LD_UB2(filter48 + 4 * 16, 16, q1, q2);
+
+ src -= 3 * pitch;
+ ST_UB4(p2, p1, p0, q0, src, pitch);
+ src += (4 * pitch);
+ ST_UB2(q1, q2, src, pitch);
+ } else {
+ src -= 7 * pitch;
+
+ ILVR_B8_UH(zero, p7, zero, p6, zero, p5, zero, p4, zero, p3, zero, p2,
+ zero, p1, zero, p0, p7_r_in, p6_r_in, p5_r_in, p4_r_in,
+ p3_r_in, p2_r_in, p1_r_in, p0_r_in);
+
+ q0_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q0);
+
+ tmp0_r = p7_r_in << 3;
+ tmp0_r -= p7_r_in;
+ tmp0_r += p6_r_in;
+ tmp0_r += q0_r_in;
+ tmp1_r = p6_r_in + p5_r_in;
+ tmp1_r += p4_r_in;
+ tmp1_r += p3_r_in;
+ tmp1_r += p2_r_in;
+ tmp1_r += p1_r_in;
+ tmp1_r += p0_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ ILVL_B4_UH(zero, p7, zero, p6, zero, p5, zero, p4, p7_l_in, p6_l_in,
+ p5_l_in, p4_l_in);
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l_in, p2_l_in,
+ p1_l_in, p0_l_in);
+ q0_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q0);
+
+ tmp0_l = p7_l_in << 3;
+ tmp0_l -= p7_l_in;
+ tmp0_l += p6_l_in;
+ tmp0_l += q0_l_in;
+ tmp1_l = p6_l_in + p5_l_in;
+ tmp1_l += p4_l_in;
+ tmp1_l += p3_l_in;
+ tmp1_l += p2_l_in;
+ tmp1_l += p1_l_in;
+ tmp1_l += p0_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p6 = __msa_bmnz_v(p6, (v16u8) r_out, flat2);
+ ST_UB(p6, src);
+ src += pitch;
+
+ /* p5 */
+ q1_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q1);
+ tmp0_r = p5_r_in - p6_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q1_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q1);
+ tmp0_l = p5_l_in - p6_l_in;
+ tmp0_l += q1_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p5 = __msa_bmnz_v(p5, (v16u8) r_out, flat2);
+ ST_UB(p5, src);
+ src += pitch;
+
+ /* p4 */
+ q2_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q2);
+ tmp0_r = p4_r_in - p5_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = (v8i16) __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q2_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q2);
+ tmp0_l = p4_l_in - p5_l_in;
+ tmp0_l += q2_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p4 = __msa_bmnz_v(p4, (v16u8) r_out, flat2);
+ ST_UB(p4, src);
+ src += pitch;
+
+ /* p3 */
+ q3_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q3);
+ tmp0_r = p3_r_in - p4_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q3_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q3);
+ tmp0_l = p3_l_in - p4_l_in;
+ tmp0_l += q3_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p3 = __msa_bmnz_v(p3, (v16u8) r_out, flat2);
+ ST_UB(p3, src);
+ src += pitch;
+
+ /* p2 */
+ q4_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q4);
+ filter8 = LD_UB(filter48);
+ tmp0_r = p2_r_in - p3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q4_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q4);
+ tmp0_l = p2_l_in - p3_l_in;
+ tmp0_l += q4_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* p1 */
+ q5_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q5);
+ filter8 = LD_UB(filter48 + 16);
+ tmp0_r = p1_r_in - p2_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q5_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q5);
+ tmp0_l = p1_l_in - p2_l_in;
+ tmp0_l += q5_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* p0 */
+ q6_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q6);
+ filter8 = LD_UB(filter48 + 32);
+ tmp0_r = p0_r_in - p1_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q6_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q6);
+ tmp0_l = p0_l_in - p1_l_in;
+ tmp0_l += q6_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* q0 */
+ q7_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q7);
+ filter8 = LD_UB(filter48 + 48);
+ tmp0_r = q7_r_in - p0_r_in;
+ tmp0_r += q0_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ q7_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q7);
+ tmp0_l = q7_l_in - p0_l_in;
+ tmp0_l += q0_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* q1 */
+ filter8 = LD_UB(filter48 + 64);
+ tmp0_r = q7_r_in - q0_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p6_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q0_l_in;
+ tmp0_l += q1_l_in;
+ tmp0_l -= p6_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* q2 */
+ filter8 = LD_UB(filter48 + 80);
+ tmp0_r = q7_r_in - q1_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p5_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q1_l_in;
+ tmp0_l += q2_l_in;
+ tmp0_l -= p5_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += pitch;
+
+ /* q3 */
+ tmp0_r = q7_r_in - q2_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p4_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q2_l_in;
+ tmp0_l += q3_l_in;
+ tmp0_l -= p4_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q3 = __msa_bmnz_v(q3, (v16u8) r_out, flat2);
+ ST_UB(q3, src);
+ src += pitch;
+
+ /* q4 */
+ tmp0_r = q7_r_in - q3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p3_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q3_l_in;
+ tmp0_l += q4_l_in;
+ tmp0_l -= p3_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q4 = __msa_bmnz_v(q4, (v16u8) r_out, flat2);
+ ST_UB(q4, src);
+ src += pitch;
+
+ /* q5 */
+ tmp0_r = q7_r_in - q4_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p2_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q4_l_in;
+ tmp0_l += q5_l_in;
+ tmp0_l -= p2_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q5 = __msa_bmnz_v(q5, (v16u8) r_out, flat2);
+ ST_UB(q5, src);
+ src += pitch;
+
+ /* q6 */
+ tmp0_r = q7_r_in - q5_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p1_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ tmp0_l = q7_l_in - q5_l_in;
+ tmp0_l += q6_l_in;
+ tmp0_l -= p1_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q6 = __msa_bmnz_v(q6, (v16u8) r_out, flat2);
+ ST_UB(q6, src);
+ }
+}
+
+void ff_loop_filter_v_16_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t filter48[16 * 8] ALLOC_ALIGNED(ALIGNMENT);
+ uint8_t early_exit = 0;
+
+ early_exit = vp9_hz_lpf_t4_and_t8_16w(src, pitch, &filter48[0],
+ b_limit_ptr, limit_ptr, thresh_ptr);
+
+ if (0 == early_exit) {
+ vp9_hz_lpf_t16_16w(src, pitch, filter48);
+ }
+}
+
+void ff_loop_filter_v_16_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d;
+ uint64_t dword0, dword1;
+ v16u8 flat2, mask, hev, flat, thresh, b_limit, limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0, p7, p6, p5, p4, q4, q5, q6, q7;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 p0_filter16, p1_filter16;
+ v8i16 p2_filter8, p1_filter8, p0_filter8;
+ v8i16 q0_filter8, q1_filter8, q2_filter8;
+ v8u16 p7_r, p6_r, p5_r, p4_r, q7_r, q6_r, q5_r, q4_r;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q3_r, q2_r, q1_r, q0_r;
+ v16i8 zero = { 0 };
+ v8u16 tmp0, tmp1, tmp2;
+
+ /* load vector elements */
+ LD_UB8((src - 4 * pitch), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
+ SD4(p1_d, p0_d, q0_d, q1_d, src - 2 * pitch, pitch);
+ } else {
+ /* convert 8 bit input data into 16 bit */
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero,
+ q1, zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r,
+ q1_r, q2_r, q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r,
+ p2_filter8, p1_filter8, p0_filter8, q0_filter8,
+ q1_filter8, q2_filter8);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(zero, p2_filter8, zero, p1_filter8, zero, p0_filter8,
+ zero, q0_filter8, p2_filter8, p1_filter8, p0_filter8,
+ q0_filter8);
+ PCKEV_B2_SH(zero, q1_filter8, zero, q2_filter8, q1_filter8,
+ q2_filter8);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filter8, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filter8, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filter8, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filter8, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filter8, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filter8, flat);
+
+ /* load 16 vector elements */
+ LD_UB4((src - 8 * pitch), pitch, p7, p6, p5, p4);
+ LD_UB4(src + (4 * pitch), pitch, q4, q5, q6, q7);
+
+ VP9_FLAT5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, flat, flat2);
+
+ /* if flat2 is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat2)) {
+ p2_d = __msa_copy_u_d((v2i64) p2_out, 0);
+ p1_d = __msa_copy_u_d((v2i64) p1_out, 0);
+ p0_d = __msa_copy_u_d((v2i64) p0_out, 0);
+ q0_d = __msa_copy_u_d((v2i64) q0_out, 0);
+ q1_d = __msa_copy_u_d((v2i64) q1_out, 0);
+ q2_d = __msa_copy_u_d((v2i64) q2_out, 0);
+
+ SD4(p2_d, p1_d, p0_d, q0_d, src - 3 * pitch, pitch);
+ SD(q1_d, src + pitch);
+ SD(q2_d, src + 2 * pitch);
+ } else {
+ /* LSB(right) 8 pixel operation */
+ ILVR_B8_UH(zero, p7, zero, p6, zero, p5, zero, p4, zero, q4,
+ zero, q5, zero, q6, zero, q7, p7_r, p6_r, p5_r, p4_r,
+ q4_r, q5_r, q6_r, q7_r);
+
+ tmp0 = p7_r << 3;
+ tmp0 -= p7_r;
+ tmp0 += p6_r;
+ tmp0 += q0_r;
+
+ src -= 7 * pitch;
+
+ /* calculation of p6 and p5 */
+ tmp1 = p6_r + p5_r + p4_r + p3_r;
+ tmp1 += (p2_r + p1_r + p0_r);
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp0 = p5_r - p6_r + q1_r - p7_r;
+ tmp1 += tmp0;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(p6, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(p5, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of p4 and p3 */
+ tmp0 = p4_r - p5_r + q2_r - p7_r;
+ tmp2 = p3_r - p4_r + q3_r - p7_r;
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(p4, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(p3, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of p2 and p1 */
+ tmp0 = p2_r - p3_r + q4_r - p7_r;
+ tmp2 = p1_r - p2_r + q5_r - p7_r;
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(p2_out, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(p1_out, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of p0 and q0 */
+ tmp0 = (p0_r - p1_r) + (q6_r - p7_r);
+ tmp2 = (q7_r - p0_r) + (q0_r - p7_r);
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(p0_out, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(q0_out, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of q1 and q2 */
+ tmp0 = q7_r - q0_r + q1_r - p6_r;
+ tmp2 = q7_r - q1_r + q2_r - p5_r;
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(q1_out, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(q2_out, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of q3 and q4 */
+ tmp0 = (q7_r - q2_r) + (q3_r - p4_r);
+ tmp2 = (q7_r - q3_r) + (q4_r - p3_r);
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(q3, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(q4, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ src += pitch;
+
+ /* calculation of q5 and q6 */
+ tmp0 = (q7_r - q4_r) + (q5_r - p2_r);
+ tmp2 = (q7_r - q5_r) + (q6_r - p1_r);
+ tmp1 += tmp0;
+ p0_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ tmp1 += tmp2;
+ p1_filter16 = (v16u8) __msa_srari_h((v8i16) tmp1, 4);
+ PCKEV_B2_UB(zero, p0_filter16, zero, p1_filter16,
+ p0_filter16, p1_filter16);
+ p0_filter16 = __msa_bmnz_v(q5, p0_filter16, flat2);
+ p1_filter16 = __msa_bmnz_v(q6, p1_filter16, flat2);
+ dword0 = __msa_copy_u_d((v2i64) p0_filter16, 0);
+ dword1 = __msa_copy_u_d((v2i64) p1_filter16, 0);
+ SD(dword0, src);
+ src += pitch;
+ SD(dword1, src);
+ }
+ }
+}
+
+void ff_loop_filter_h_4_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 mask, hev, flat, limit, thresh, b_limit;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v8i16 vec0, vec1, vec2, vec3;
+
+ LD_UB8((src - 4), pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ TRANSPOSE8x8_UB_UB(p3, p2, p1, p0, q0, q1, q2, q3,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1, p0, q0, q1);
+ ILVR_B2_SH(p0, p1, q1, q0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+
+ src -= 2;
+ ST4x4_UB(vec2, vec2, 0, 1, 2, 3, src, pitch);
+ src += 4 * pitch;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+}
+
+void ff_loop_filter_h_44_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 mask, hev, flat;
+ v16u8 thresh0, b_limit0, limit0, thresh1, b_limit1, limit1;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7;
+ v16u8 row8, row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
+
+ LD_UB8(src - 4, pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ LD_UB8(src - 4 + (8 * pitch), pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh0 = (v16u8) __msa_fill_b(thresh_ptr);
+ thresh1 = (v16u8) __msa_fill_b(thresh_ptr >> 8);
+ thresh0 = (v16u8) __msa_ilvr_d((v2i64) thresh1, (v2i64) thresh0);
+
+ b_limit0 = (v16u8) __msa_fill_b(b_limit_ptr);
+ b_limit1 = (v16u8) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit0 = (v16u8) __msa_ilvr_d((v2i64) b_limit1, (v2i64) b_limit0);
+
+ limit0 = (v16u8) __msa_fill_b(limit_ptr);
+ limit1 = (v16u8) __msa_fill_b(limit_ptr >> 8);
+ limit0 = (v16u8) __msa_ilvr_d((v2i64) limit1, (v2i64) limit0);
+
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0,
+ hev, mask, flat);
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1, p0, q0, q1);
+ ILVR_B2_SH(p0, p1, q1, q0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp2, tmp3);
+ ILVL_B2_SH(p0, p1, q1, q0, tmp0, tmp1);
+ ILVRL_H2_SH(tmp1, tmp0, tmp4, tmp5);
+
+ src -= 2;
+
+ ST4x8_UB(tmp2, tmp3, src, pitch);
+ src += (8 * pitch);
+ ST4x8_UB(tmp4, tmp5, src, pitch);
+}
+
+void ff_loop_filter_h_8_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p1_out, p0_out, q0_out, q1_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v16u8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3, vec4;
+
+ /* load vector elements */
+ LD_UB8(src - 4, pitch, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ TRANSPOSE8x8_UB_UB(p3, p2, p1, p0, q0, q1, q2, q3,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ /* Store 4 pixels p1-_q1 */
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+
+ src -= 2;
+ ST4x4_UB(vec2, vec2, 0, 1, 2, 3, src, pitch);
+ src += 4 * pitch;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r,
+ q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_r, p2_filt8_r, p1_filt8_r, p1_filt8_r, p0_filt8_r,
+ p0_filt8_r, q0_filt8_r, q0_filt8_r, p2_filt8_r, p1_filt8_r,
+ p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_r, q1_filt8_r, q2_filt8_r, q2_filt8_r, q1_filt8_r,
+ q2_filt8_r);
+
+ /* store pixel values */
+ p2 = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1 = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0 = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0 = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1 = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2 = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ /* Store 6 pixels p2-_q2 */
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ vec4 = (v8i16) __msa_ilvr_b((v16i8) q2, (v16i8) q1);
+
+ src -= 3;
+ ST4x4_UB(vec2, vec2, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec4, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec4, 4, src + 4, pitch);
+ }
+}
+
+void ff_loop_filter_h_88_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t *temp_src;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p1_out, p0_out, q0_out, q1_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v16u8 row4, row5, row6, row7, row12, row13, row14, row15;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16u8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+
+ temp_src = src - 4;
+
+ LD_UB8(temp_src, pitch, p0, p1, p2, p3, row4, row5, row6, row7);
+ temp_src += (8 * pitch);
+ LD_UB8(temp_src, pitch, q3, q2, q1, q0, row12, row13, row14, row15);
+
+ /* transpose 16x8 matrix into 8x16 */
+ TRANSPOSE16x8_UB_UB(p0, p1, p2, p3, row4, row5, row6, row7,
+ q3, q2, q1, q0, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ vec0 = (v8i16) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ ILVL_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec4, vec5);
+
+ src -= 2;
+ ST4x8_UB(vec2, vec3, src, pitch);
+ src += 8 * pitch;
+ ST4x8_UB(vec4, vec5, src, pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r,
+ q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+
+ /* filter8 */
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_r, p1_filt8_l, p1_filt8_r, p0_filt8_l,
+ p0_filt8_r, q0_filt8_l, q0_filt8_r, p2_filt8_r, p1_filt8_r,
+ p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_r, q2_filt8_l, q2_filt8_r, q1_filt8_r,
+ q2_filt8_r);
+
+ /* store pixel values */
+ p2 = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1 = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0 = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0 = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1 = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2 = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec3, vec4);
+ ILVL_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec6, vec7);
+ ILVRL_B2_SH(q2, q1, vec2, vec5);
+
+ src -= 3;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec4, vec4, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 4, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec6, vec6, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec7, vec7, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 4, src + 4, pitch);
+ }
+}
+
+void ff_loop_filter_h_84_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t *temp_src;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p1_out, p0_out, q0_out, q1_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v16u8 row4, row5, row6, row7, row12, row13, row14, row15;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v16u8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+
+ temp_src = src - 4;
+
+ LD_UB8(temp_src, pitch, p0, p1, p2, p3, row4, row5, row6, row7);
+ temp_src += (8 * pitch);
+ LD_UB8(temp_src, pitch, q3, q2, q1, q0, row12, row13, row14, row15);
+
+ /* transpose 16x8 matrix into 8x16 */
+ TRANSPOSE16x8_UB_UB(p0, p1, p2, p3, row4, row5, row6, row7,
+ q3, q2, q1, q0, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ vec0 = (v8i16) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ ILVL_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec4, vec5);
+
+ src -= 2;
+ ST4x8_UB(vec2, vec3, src, pitch);
+ src += 8 * pitch;
+ ST4x8_UB(vec4, vec5, src, pitch);
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r,
+ q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_r, p2_filt8_r, p1_filt8_r, p1_filt8_r,
+ p0_filt8_r, p0_filt8_r, q0_filt8_r, q0_filt8_r,
+ p2_filt8_r, p1_filt8_r, p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_r, q1_filt8_r, q2_filt8_r, q2_filt8_r,
+ q1_filt8_r, q2_filt8_r);
+
+ /* store pixel values */
+ p2 = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1 = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0 = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0 = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1 = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2 = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec3, vec4);
+ ILVL_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec6, vec7);
+ ILVRL_B2_SH(q2, q1, vec2, vec5);
+
+ src -= 3;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec4, vec4, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 4, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec6, vec6, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec7, vec7, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 4, src + 4, pitch);
+ }
+}
+
+void ff_loop_filter_h_48_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t *temp_src;
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p1_out, p0_out, q0_out, q1_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v16u8 row4, row5, row6, row7, row12, row13, row14, row15;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16u8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+
+ temp_src = src - 4;
+
+ LD_UB8(temp_src, pitch, p0, p1, p2, p3, row4, row5, row6, row7);
+ temp_src += (8 * pitch);
+ LD_UB8(temp_src, pitch, q3, q2, q1, q0, row12, row13, row14, row15);
+
+ /* transpose 16x8 matrix into 8x16 */
+ TRANSPOSE16x8_UB_UB(p0, p1, p2, p3, row4, row5, row6, row7,
+ q3, q2, q1, q0, row12, row13, row14, row15,
+ p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ vec0 = (v8i16) __msa_fill_b(thresh_ptr >> 8);
+ thresh = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) thresh);
+
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(b_limit_ptr >> 8);
+ b_limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) b_limit);
+
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+ vec0 = (v8i16) __msa_fill_b(limit_ptr >> 8);
+ limit = (v16u8) __msa_ilvr_d((v2i64) vec0, (v2i64) limit);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_insve_d((v2i64) flat, 0, (v2i64) zero);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ ILVL_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec4, vec5);
+
+ src -= 2;
+ ST4x8_UB(vec2, vec3, src, pitch);
+ src += 8 * pitch;
+ ST4x8_UB(vec4, vec5, src, pitch);
+ } else {
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_l, p1_filt8_l, p1_filt8_l,
+ p0_filt8_l, p0_filt8_l, q0_filt8_l, q0_filt8_l,
+ p2_filt8_l, p1_filt8_l, p0_filt8_l, q0_filt8_l);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_l, q2_filt8_l, q2_filt8_l,
+ q1_filt8_l, q2_filt8_l);
+
+ /* store pixel values */
+ p2 = __msa_bmnz_v(p2, (v16u8) p2_filt8_l, flat);
+ p1 = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_l, flat);
+ p0 = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_l, flat);
+ q0 = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_l, flat);
+ q1 = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_l, flat);
+ q2 = __msa_bmnz_v(q2, (v16u8) q2_filt8_l, flat);
+
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec3, vec4);
+ ILVL_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec6, vec7);
+ ILVRL_B2_SH(q2, q1, vec2, vec5);
+
+ src -= 3;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec4, vec4, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec2, 4, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec6, vec6, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 0, src + 4, pitch);
+ src += (4 * pitch);
+ ST4x4_UB(vec7, vec7, 0, 1, 2, 3, src, pitch);
+ ST2x4_UB(vec5, 4, src + 4, pitch);
+ }
+}
+
+static void vp9_transpose_16x8_to_8x16(uint8_t *input, int32_t in_pitch,
+ uint8_t *output, int32_t out_pitch)
+{
+ v16u8 p7_org, p6_org, p5_org, p4_org, p3_org, p2_org, p1_org, p0_org;
+ v16i8 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+
+ LD_UB8(input, in_pitch,
+ p7_org, p6_org, p5_org, p4_org, p3_org, p2_org, p1_org, p0_org);
+ /* 8x8 transpose */
+ TRANSPOSE8x8_UB_UB(p7_org, p6_org, p5_org, p4_org, p3_org, p2_org, p1_org,
+ p0_org, p7, p6, p5, p4, p3, p2, p1, p0);
+ /* 8x8 transpose */
+ ILVL_B4_SB(p5_org, p7_org, p4_org, p6_org, p1_org, p3_org, p0_org, p2_org,
+ tmp0, tmp1, tmp2, tmp3);
+ ILVR_B2_SB(tmp1, tmp0, tmp3, tmp2, tmp4, tmp6);
+ ILVL_B2_SB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp7);
+ ILVR_W2_UB(tmp6, tmp4, tmp7, tmp5, q0, q4);
+ ILVL_W2_UB(tmp6, tmp4, tmp7, tmp5, q2, q6);
+ SLDI_B4_0_UB(q0, q2, q4, q6, q1, q3, q5, q7, 8);
+
+ ST_UB8(p7, p6, p5, p4, p3, p2, p1, p0, output, out_pitch);
+ output += (8 * out_pitch);
+ ST_UB8(q0, q1, q2, q3, q4, q5, q6, q7, output, out_pitch);
+}
+
+static void vp9_transpose_8x16_to_16x8(uint8_t *input, int32_t in_pitch,
+ uint8_t *output, int32_t out_pitch)
+{
+ v16u8 p7_o, p6_o, p5_o, p4_o, p3_o, p2_o, p1_o, p0_o;
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+
+ LD_UB8(input, in_pitch, p7, p6, p5, p4, p3, p2, p1, p0);
+ LD_UB8(input + (8 * in_pitch), in_pitch, q0, q1, q2, q3, q4, q5, q6, q7);
+ TRANSPOSE16x8_UB_UB(p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5,
+ q6, q7, p7_o, p6_o, p5_o, p4_o, p3_o, p2_o, p1_o, p0_o);
+ ST_UB8(p7_o, p6_o, p5_o, p4_o, p3_o, p2_o, p1_o, p0_o, output, out_pitch);
+}
+
+static void vp9_transpose_16x16(uint8_t *input, int32_t in_pitch,
+ uint8_t *output, int32_t out_pitch)
+{
+ v16u8 row0, row1, row2, row3, row4, row5, row6, row7;
+ v16u8 row8, row9, row10, row11, row12, row13, row14, row15;
+ v8i16 tmp0, tmp1, tmp4, tmp5, tmp6, tmp7;
+ v4i32 tmp2, tmp3;
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+
+ LD_UB8(input, in_pitch, row0, row1, row2, row3, row4, row5, row6, row7);
+ input += (8 * in_pitch);
+ LD_UB8(input, in_pitch,
+ row8, row9, row10, row11, row12, row13, row14, row15);
+
+ TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7,
+ row8, row9, row10, row11, row12, row13, row14, row15,
+ p7, p6, p5, p4, p3, p2, p1, p0);
+
+ /* transpose 16x8 matrix into 8x16 */
+ /* total 8 intermediate register and 32 instructions */
+ q7 = (v16u8) __msa_ilvod_d((v2i64) row8, (v2i64) row0);
+ q6 = (v16u8) __msa_ilvod_d((v2i64) row9, (v2i64) row1);
+ q5 = (v16u8) __msa_ilvod_d((v2i64) row10, (v2i64) row2);
+ q4 = (v16u8) __msa_ilvod_d((v2i64) row11, (v2i64) row3);
+ q3 = (v16u8) __msa_ilvod_d((v2i64) row12, (v2i64) row4);
+ q2 = (v16u8) __msa_ilvod_d((v2i64) row13, (v2i64) row5);
+ q1 = (v16u8) __msa_ilvod_d((v2i64) row14, (v2i64) row6);
+ q0 = (v16u8) __msa_ilvod_d((v2i64) row15, (v2i64) row7);
+
+ ILVEV_B2_SH(q7, q6, q5, q4, tmp0, tmp1);
+ tmp4 = (v8i16) __msa_ilvod_b((v16i8) q6, (v16i8) q7);
+ tmp5 = (v8i16) __msa_ilvod_b((v16i8) q4, (v16i8) q5);
+
+ ILVEV_B2_UB(q3, q2, q1, q0, q5, q7);
+ tmp6 = (v8i16) __msa_ilvod_b((v16i8) q2, (v16i8) q3);
+ tmp7 = (v8i16) __msa_ilvod_b((v16i8) q0, (v16i8) q1);
+
+ ILVEV_H2_SW(tmp0, tmp1, q5, q7, tmp2, tmp3);
+ q0 = (v16u8) __msa_ilvev_w(tmp3, tmp2);
+ q4 = (v16u8) __msa_ilvod_w(tmp3, tmp2);
+
+ tmp2 = (v4i32) __msa_ilvod_h(tmp1, tmp0);
+ tmp3 = (v4i32) __msa_ilvod_h((v8i16) q7, (v8i16) q5);
+ q2 = (v16u8) __msa_ilvev_w(tmp3, tmp2);
+ q6 = (v16u8) __msa_ilvod_w(tmp3, tmp2);
+
+ ILVEV_H2_SW(tmp4, tmp5, tmp6, tmp7, tmp2, tmp3);
+ q1 = (v16u8) __msa_ilvev_w(tmp3, tmp2);
+ q5 = (v16u8) __msa_ilvod_w(tmp3, tmp2);
+
+ tmp2 = (v4i32) __msa_ilvod_h(tmp5, tmp4);
+ tmp3 = (v4i32) __msa_ilvod_h(tmp7, tmp6);
+ q3 = (v16u8) __msa_ilvev_w(tmp3, tmp2);
+ q7 = (v16u8) __msa_ilvod_w(tmp3, tmp2);
+
+ ST_UB8(p7, p6, p5, p4, p3, p2, p1, p0, output, out_pitch);
+ output += (8 * out_pitch);
+ ST_UB8(q0, q1, q2, q3, q4, q5, q6, q7, output, out_pitch);
+}
+
+static int32_t vp9_vt_lpf_t4_and_t8_8w(uint8_t *src, uint8_t *filter48,
+ uint8_t *src_org, int32_t pitch_org,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v16i8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3;
+
+ /* load vector elements */
+ LD_UB8(src - (4 * 16), 16, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_8W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ flat = (v16u8) __msa_ilvr_d((v2i64) zero, (v2i64) flat);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ ST4x8_UB(vec2, vec3, (src_org - 2), pitch_org);
+ return 1;
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r,
+ q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+
+ /* convert 16 bit output data into 8 bit */
+ p2_r = (v8u16) __msa_pckev_b((v16i8) p2_filt8_r, (v16i8) p2_filt8_r);
+ p1_r = (v8u16) __msa_pckev_b((v16i8) p1_filt8_r, (v16i8) p1_filt8_r);
+ p0_r = (v8u16) __msa_pckev_b((v16i8) p0_filt8_r, (v16i8) p0_filt8_r);
+ q0_r = (v8u16) __msa_pckev_b((v16i8) q0_filt8_r, (v16i8) q0_filt8_r);
+ q1_r = (v8u16) __msa_pckev_b((v16i8) q1_filt8_r, (v16i8) q1_filt8_r);
+ q2_r = (v8u16) __msa_pckev_b((v16i8) q2_filt8_r, (v16i8) q2_filt8_r);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_r, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_r, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_r, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_r, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_r, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_r, flat);
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, filter48, 16);
+ filter48 += (4 * 16);
+ ST_UB2(q1_out, q2_out, filter48, 16);
+ filter48 += (2 * 16);
+ ST_UB(flat, filter48);
+
+ return 0;
+ }
+}
+
+static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, int32_t pitch,
+ uint8_t *filter48)
+{
+ v16i8 zero = { 0 };
+ v16u8 filter8, flat, flat2;
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+ v8u16 p7_r_in, p6_r_in, p5_r_in, p4_r_in;
+ v8u16 p3_r_in, p2_r_in, p1_r_in, p0_r_in;
+ v8u16 q7_r_in, q6_r_in, q5_r_in, q4_r_in;
+ v8u16 q3_r_in, q2_r_in, q1_r_in, q0_r_in;
+ v8u16 tmp0_r, tmp1_r;
+ v8i16 r_out;
+
+ flat = LD_UB(filter48 + 6 * 16);
+
+ LD_UB8((src - 8 * 16), 16, p7, p6, p5, p4, p3, p2, p1, p0);
+ LD_UB8(src, 16, q0, q1, q2, q3, q4, q5, q6, q7);
+
+ VP9_FLAT5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, flat, flat2);
+
+ /* if flat2 is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat2)) {
+ v8i16 vec0, vec1, vec2, vec3, vec4;
+
+ LD_UB4(filter48, 16, p2, p1, p0, q0);
+ LD_UB2(filter48 + 4 * 16, 16, q1, q2);
+
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec3, vec4);
+ vec2 = (v8i16) __msa_ilvr_b((v16i8) q2, (v16i8) q1);
+
+ src_org -= 3;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec2, 0, (src_org + 4), pitch);
+ src_org += (4 * pitch);
+ ST4x4_UB(vec4, vec4, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec2, 4, (src_org + 4), pitch);
+
+ return 1;
+ } else {
+ src -= 7 * 16;
+
+ ILVR_B8_UH(zero, p7, zero, p6, zero, p5, zero, p4, zero, p3, zero, p2,
+ zero, p1, zero, p0, p7_r_in, p6_r_in, p5_r_in, p4_r_in,
+ p3_r_in, p2_r_in, p1_r_in, p0_r_in);
+ q0_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q0);
+
+ tmp0_r = p7_r_in << 3;
+ tmp0_r -= p7_r_in;
+ tmp0_r += p6_r_in;
+ tmp0_r += q0_r_in;
+ tmp1_r = p6_r_in + p5_r_in;
+ tmp1_r += p4_r_in;
+ tmp1_r += p3_r_in;
+ tmp1_r += p2_r_in;
+ tmp1_r += p1_r_in;
+ tmp1_r += p0_r_in;
+ tmp1_r += tmp0_r;
+
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ p6 = __msa_bmnz_v(p6, (v16u8) r_out, flat2);
+ ST8x1_UB(p6, src);
+ src += 16;
+
+ /* p5 */
+ q1_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q1);
+ tmp0_r = p5_r_in - p6_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ p5 = __msa_bmnz_v(p5, (v16u8) r_out, flat2);
+ ST8x1_UB(p5, src);
+ src += 16;
+
+ /* p4 */
+ q2_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q2);
+ tmp0_r = p4_r_in - p5_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ p4 = __msa_bmnz_v(p4, (v16u8) r_out, flat2);
+ ST8x1_UB(p4, src);
+ src += 16;
+
+ /* p3 */
+ q3_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q3);
+ tmp0_r = p3_r_in - p4_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ p3 = __msa_bmnz_v(p3, (v16u8) r_out, flat2);
+ ST8x1_UB(p3, src);
+ src += 16;
+
+ /* p2 */
+ q4_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q4);
+ filter8 = LD_UB(filter48);
+ tmp0_r = p2_r_in - p3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* p1 */
+ q5_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q5);
+ filter8 = LD_UB(filter48 + 16);
+ tmp0_r = p1_r_in - p2_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* p0 */
+ q6_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q6);
+ filter8 = LD_UB(filter48 + 32);
+ tmp0_r = p0_r_in - p1_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* q0 */
+ q7_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q7);
+ filter8 = LD_UB(filter48 + 48);
+ tmp0_r = q7_r_in - p0_r_in;
+ tmp0_r += q0_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* q1 */
+ filter8 = LD_UB(filter48 + 64);
+ tmp0_r = q7_r_in - q0_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p6_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* q2 */
+ filter8 = LD_UB(filter48 + 80);
+ tmp0_r = q7_r_in - q1_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p5_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST8x1_UB(filter8, src);
+ src += 16;
+
+ /* q3 */
+ tmp0_r = q7_r_in - q2_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p4_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ q3 = __msa_bmnz_v(q3, (v16u8) r_out, flat2);
+ ST8x1_UB(q3, src);
+ src += 16;
+
+ /* q4 */
+ tmp0_r = q7_r_in - q3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p3_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ q4 = __msa_bmnz_v(q4, (v16u8) r_out, flat2);
+ ST8x1_UB(q4, src);
+ src += 16;
+
+ /* q5 */
+ tmp0_r = q7_r_in - q4_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p2_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ q5 = __msa_bmnz_v(q5, (v16u8) r_out, flat2);
+ ST8x1_UB(q5, src);
+ src += 16;
+
+ /* q6 */
+ tmp0_r = q7_r_in - q5_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p1_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) r_out, (v16i8) r_out);
+ q6 = __msa_bmnz_v(q6, (v16u8) r_out, flat2);
+ ST8x1_UB(q6, src);
+
+ return 0;
+ }
+}
+
+void ff_loop_filter_h_16_8_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t early_exit = 0;
+ uint8_t transposed_input[16 * 24] ALLOC_ALIGNED(ALIGNMENT);
+ uint8_t *filter48 = &transposed_input[16 * 16];
+
+ vp9_transpose_16x8_to_8x16(src - 8, pitch, transposed_input, 16);
+
+ early_exit = vp9_vt_lpf_t4_and_t8_8w((transposed_input + 16 * 8),
+ &filter48[0], src, pitch,
+ b_limit_ptr, limit_ptr, thresh_ptr);
+
+ if (0 == early_exit) {
+ early_exit = vp9_vt_lpf_t16_8w((transposed_input + 16 * 8), src, pitch,
+ &filter48[0]);
+
+ if (0 == early_exit) {
+ vp9_transpose_8x16_to_16x8(transposed_input, 16, src - 8, pitch);
+ }
+ }
+}
+
+static int32_t vp9_vt_lpf_t4_and_t8_16w(uint8_t *src, uint8_t *filter48,
+ uint8_t *src_org, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ v16u8 p3, p2, p1, p0, q3, q2, q1, q0;
+ v16u8 p2_out, p1_out, p0_out, q0_out, q1_out, q2_out;
+ v16u8 flat, mask, hev, thresh, b_limit, limit;
+ v8u16 p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r;
+ v8u16 p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l;
+ v8i16 p2_filt8_r, p1_filt8_r, p0_filt8_r;
+ v8i16 q0_filt8_r, q1_filt8_r, q2_filt8_r;
+ v8i16 p2_filt8_l, p1_filt8_l, p0_filt8_l;
+ v8i16 q0_filt8_l, q1_filt8_l, q2_filt8_l;
+ v16i8 zero = { 0 };
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5;
+
+ /* load vector elements */
+ LD_UB8(src - (4 * 16), 16, p3, p2, p1, p0, q0, q1, q2, q3);
+
+ thresh = (v16u8) __msa_fill_b(thresh_ptr);
+ b_limit = (v16u8) __msa_fill_b(b_limit_ptr);
+ limit = (v16u8) __msa_fill_b(limit_ptr);
+
+ /* mask and hev */
+ LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh,
+ hev, mask, flat);
+ /* flat4 */
+ VP9_FLAT4(p3, p2, p0, q0, q2, q3, flat);
+ /* filter4 */
+ VP9_LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev, p1_out, p0_out, q0_out,
+ q1_out);
+
+ /* if flat is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat)) {
+ ILVR_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec2, vec3);
+ ILVL_B2_SH(p0_out, p1_out, q1_out, q0_out, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec4, vec5);
+
+ src_org -= 2;
+ ST4x8_UB(vec2, vec3, src_org, pitch);
+ src_org += 8 * pitch;
+ ST4x8_UB(vec4, vec5, src_org, pitch);
+
+ return 1;
+ } else {
+ ILVR_B8_UH(zero, p3, zero, p2, zero, p1, zero, p0, zero, q0, zero, q1,
+ zero, q2, zero, q3, p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r,
+ q3_r);
+ VP9_FILTER8(p3_r, p2_r, p1_r, p0_r, q0_r, q1_r, q2_r, q3_r, p2_filt8_r,
+ p1_filt8_r, p0_filt8_r, q0_filt8_r, q1_filt8_r, q2_filt8_r);
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l, p2_l, p1_l,
+ p0_l);
+ ILVL_B4_UH(zero, q0, zero, q1, zero, q2, zero, q3, q0_l, q1_l, q2_l,
+ q3_l);
+ VP9_FILTER8(p3_l, p2_l, p1_l, p0_l, q0_l, q1_l, q2_l, q3_l, p2_filt8_l,
+ p1_filt8_l, p0_filt8_l, q0_filt8_l, q1_filt8_l, q2_filt8_l);
+
+ /* convert 16 bit output data into 8 bit */
+ PCKEV_B4_SH(p2_filt8_l, p2_filt8_r, p1_filt8_l, p1_filt8_r, p0_filt8_l,
+ p0_filt8_r, q0_filt8_l, q0_filt8_r, p2_filt8_r, p1_filt8_r,
+ p0_filt8_r, q0_filt8_r);
+ PCKEV_B2_SH(q1_filt8_l, q1_filt8_r, q2_filt8_l, q2_filt8_r, q1_filt8_r,
+ q2_filt8_r);
+
+ /* store pixel values */
+ p2_out = __msa_bmnz_v(p2, (v16u8) p2_filt8_r, flat);
+ p1_out = __msa_bmnz_v(p1_out, (v16u8) p1_filt8_r, flat);
+ p0_out = __msa_bmnz_v(p0_out, (v16u8) p0_filt8_r, flat);
+ q0_out = __msa_bmnz_v(q0_out, (v16u8) q0_filt8_r, flat);
+ q1_out = __msa_bmnz_v(q1_out, (v16u8) q1_filt8_r, flat);
+ q2_out = __msa_bmnz_v(q2, (v16u8) q2_filt8_r, flat);
+
+ ST_UB4(p2_out, p1_out, p0_out, q0_out, filter48, 16);
+ filter48 += (4 * 16);
+ ST_UB2(q1_out, q2_out, filter48, 16);
+ filter48 += (2 * 16);
+ ST_UB(flat, filter48);
+
+ return 0;
+ }
+}
+
+static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, int32_t pitch,
+ uint8_t *filter48)
+{
+ v16u8 flat, flat2, filter8;
+ v16i8 zero = { 0 };
+ v16u8 p7, p6, p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, q7;
+ v8u16 p7_r_in, p6_r_in, p5_r_in, p4_r_in;
+ v8u16 p3_r_in, p2_r_in, p1_r_in, p0_r_in;
+ v8u16 q7_r_in, q6_r_in, q5_r_in, q4_r_in;
+ v8u16 q3_r_in, q2_r_in, q1_r_in, q0_r_in;
+ v8u16 p7_l_in, p6_l_in, p5_l_in, p4_l_in;
+ v8u16 p3_l_in, p2_l_in, p1_l_in, p0_l_in;
+ v8u16 q7_l_in, q6_l_in, q5_l_in, q4_l_in;
+ v8u16 q3_l_in, q2_l_in, q1_l_in, q0_l_in;
+ v8u16 tmp0_r, tmp1_r, tmp0_l, tmp1_l;
+ v8i16 l_out, r_out;
+
+ flat = LD_UB(filter48 + 6 * 16);
+
+ LD_UB8((src - 8 * 16), 16, p7, p6, p5, p4, p3, p2, p1, p0);
+ LD_UB8(src, 16, q0, q1, q2, q3, q4, q5, q6, q7);
+
+ VP9_FLAT5(p7, p6, p5, p4, p0, q0, q4, q5, q6, q7, flat, flat2);
+
+ /* if flat2 is zero for all pixels, then no need to calculate other filter */
+ if (__msa_test_bz_v(flat2)) {
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+
+ LD_UB4(filter48, 16, p2, p1, p0, q0);
+ LD_UB2(filter48 + 4 * 16, 16, q1, q2);
+
+ ILVR_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec3, vec4);
+ ILVL_B2_SH(p1, p2, q0, p0, vec0, vec1);
+ ILVRL_H2_SH(vec1, vec0, vec6, vec7);
+ ILVRL_B2_SH(q2, q1, vec2, vec5);
+
+ src_org -= 3;
+ ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec2, 0, (src_org + 4), pitch);
+ src_org += (4 * pitch);
+ ST4x4_UB(vec4, vec4, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec2, 4, (src_org + 4), pitch);
+ src_org += (4 * pitch);
+ ST4x4_UB(vec6, vec6, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec5, 0, (src_org + 4), pitch);
+ src_org += (4 * pitch);
+ ST4x4_UB(vec7, vec7, 0, 1, 2, 3, src_org, pitch);
+ ST2x4_UB(vec5, 4, (src_org + 4), pitch);
+
+ return 1;
+ } else {
+ src -= 7 * 16;
+
+ ILVR_B8_UH(zero, p7, zero, p6, zero, p5, zero, p4, zero, p3, zero, p2,
+ zero, p1, zero, p0, p7_r_in, p6_r_in, p5_r_in, p4_r_in,
+ p3_r_in, p2_r_in, p1_r_in, p0_r_in);
+ q0_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q0);
+
+ tmp0_r = p7_r_in << 3;
+ tmp0_r -= p7_r_in;
+ tmp0_r += p6_r_in;
+ tmp0_r += q0_r_in;
+ tmp1_r = p6_r_in + p5_r_in;
+ tmp1_r += p4_r_in;
+ tmp1_r += p3_r_in;
+ tmp1_r += p2_r_in;
+ tmp1_r += p1_r_in;
+ tmp1_r += p0_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+
+ ILVL_B4_UH(zero, p7, zero, p6, zero, p5, zero, p4, p7_l_in, p6_l_in,
+ p5_l_in, p4_l_in);
+ ILVL_B4_UH(zero, p3, zero, p2, zero, p1, zero, p0, p3_l_in, p2_l_in,
+ p1_l_in, p0_l_in);
+ q0_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q0);
+
+ tmp0_l = p7_l_in << 3;
+ tmp0_l -= p7_l_in;
+ tmp0_l += p6_l_in;
+ tmp0_l += q0_l_in;
+ tmp1_l = p6_l_in + p5_l_in;
+ tmp1_l += p4_l_in;
+ tmp1_l += p3_l_in;
+ tmp1_l += p2_l_in;
+ tmp1_l += p1_l_in;
+ tmp1_l += p0_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p6 = __msa_bmnz_v(p6, (v16u8) r_out, flat2);
+ ST_UB(p6, src);
+ src += 16;
+
+ /* p5 */
+ q1_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q1);
+ tmp0_r = p5_r_in - p6_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q1_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q1);
+ tmp0_l = p5_l_in - p6_l_in;
+ tmp0_l += q1_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p5 = __msa_bmnz_v(p5, (v16u8) r_out, flat2);
+ ST_UB(p5, src);
+ src += 16;
+
+ /* p4 */
+ q2_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q2);
+ tmp0_r = p4_r_in - p5_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q2_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q2);
+ tmp0_l = p4_l_in - p5_l_in;
+ tmp0_l += q2_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p4 = __msa_bmnz_v(p4, (v16u8) r_out, flat2);
+ ST_UB(p4, src);
+ src += 16;
+
+ /* p3 */
+ q3_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q3);
+ tmp0_r = p3_r_in - p4_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q3_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q3);
+ tmp0_l = p3_l_in - p4_l_in;
+ tmp0_l += q3_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ p3 = __msa_bmnz_v(p3, (v16u8) r_out, flat2);
+ ST_UB(p3, src);
+ src += 16;
+
+ /* p2 */
+ q4_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q4);
+ filter8 = LD_UB(filter48);
+ tmp0_r = p2_r_in - p3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q4_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q4);
+ tmp0_l = p2_l_in - p3_l_in;
+ tmp0_l += q4_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* p1 */
+ q5_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q5);
+ filter8 = LD_UB(filter48 + 16);
+ tmp0_r = p1_r_in - p2_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q5_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q5);
+ tmp0_l = p1_l_in - p2_l_in;
+ tmp0_l += q5_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) (tmp1_l), 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* p0 */
+ q6_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q6);
+ filter8 = LD_UB(filter48 + 32);
+ tmp0_r = p0_r_in - p1_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q6_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q6);
+ tmp0_l = p0_l_in - p1_l_in;
+ tmp0_l += q6_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* q0 */
+ q7_r_in = (v8u16) __msa_ilvr_b(zero, (v16i8) q7);
+ filter8 = LD_UB(filter48 + 48);
+ tmp0_r = q7_r_in - p0_r_in;
+ tmp0_r += q0_r_in;
+ tmp0_r -= p7_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ q7_l_in = (v8u16) __msa_ilvl_b(zero, (v16i8) q7);
+ tmp0_l = q7_l_in - p0_l_in;
+ tmp0_l += q0_l_in;
+ tmp0_l -= p7_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* q1 */
+ filter8 = LD_UB(filter48 + 64);
+ tmp0_r = q7_r_in - q0_r_in;
+ tmp0_r += q1_r_in;
+ tmp0_r -= p6_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q0_l_in;
+ tmp0_l += q1_l_in;
+ tmp0_l -= p6_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* q2 */
+ filter8 = LD_UB(filter48 + 80);
+ tmp0_r = q7_r_in - q1_r_in;
+ tmp0_r += q2_r_in;
+ tmp0_r -= p5_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q1_l_in;
+ tmp0_l += q2_l_in;
+ tmp0_l -= p5_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ filter8 = __msa_bmnz_v(filter8, (v16u8) r_out, flat2);
+ ST_UB(filter8, src);
+ src += 16;
+
+ /* q3 */
+ tmp0_r = q7_r_in - q2_r_in;
+ tmp0_r += q3_r_in;
+ tmp0_r -= p4_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q2_l_in;
+ tmp0_l += q3_l_in;
+ tmp0_l -= p4_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q3 = __msa_bmnz_v(q3, (v16u8) r_out, flat2);
+ ST_UB(q3, src);
+ src += 16;
+
+ /* q4 */
+ tmp0_r = q7_r_in - q3_r_in;
+ tmp0_r += q4_r_in;
+ tmp0_r -= p3_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q3_l_in;
+ tmp0_l += q4_l_in;
+ tmp0_l -= p3_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q4 = __msa_bmnz_v(q4, (v16u8) r_out, flat2);
+ ST_UB(q4, src);
+ src += 16;
+
+ /* q5 */
+ tmp0_r = q7_r_in - q4_r_in;
+ tmp0_r += q5_r_in;
+ tmp0_r -= p2_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q4_l_in;
+ tmp0_l += q5_l_in;
+ tmp0_l -= p2_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q5 = __msa_bmnz_v(q5, (v16u8) r_out, flat2);
+ ST_UB(q5, src);
+ src += 16;
+
+ /* q6 */
+ tmp0_r = q7_r_in - q5_r_in;
+ tmp0_r += q6_r_in;
+ tmp0_r -= p1_r_in;
+ tmp1_r += tmp0_r;
+ r_out = __msa_srari_h((v8i16) tmp1_r, 4);
+ tmp0_l = q7_l_in - q5_l_in;
+ tmp0_l += q6_l_in;
+ tmp0_l -= p1_l_in;
+ tmp1_l += tmp0_l;
+ l_out = __msa_srari_h((v8i16) tmp1_l, 4);
+ r_out = (v8i16) __msa_pckev_b((v16i8) l_out, (v16i8) r_out);
+ q6 = __msa_bmnz_v(q6, (v16u8) r_out, flat2);
+ ST_UB(q6, src);
+
+ return 0;
+ }
+}
+
+void ff_loop_filter_h_16_16_msa(uint8_t *src, int32_t pitch,
+ int32_t b_limit_ptr,
+ int32_t limit_ptr,
+ int32_t thresh_ptr)
+{
+ uint8_t early_exit = 0;
+ uint8_t transposed_input[16 * 24] ALLOC_ALIGNED(ALIGNMENT);
+ uint8_t *filter48 = &transposed_input[16 * 16];
+
+ vp9_transpose_16x16((src - 8), pitch, &transposed_input[0], 16);
+
+ early_exit = vp9_vt_lpf_t4_and_t8_16w((transposed_input + 16 * 8),
+ &filter48[0], src, pitch,
+ b_limit_ptr, limit_ptr, thresh_ptr);
+
+ if (0 == early_exit) {
+ early_exit = vp9_vt_lpf_t16_16w((transposed_input + 16 * 8), src, pitch,
+ &filter48[0]);
+
+ if (0 == early_exit) {
+ vp9_transpose_16x16(transposed_input, 16, (src - 8), pitch);
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9_mc_msa.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_mc_msa.c
new file mode 100644
index 00000000000..1671d973a4a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9_mc_msa.c
@@ -0,0 +1,4510 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/vp9dsp.h"
+#include "libavutil/mips/generic_macros_msa.h"
+#include "vp9dsp_mips.h"
+
+static const uint8_t mc_filt_mask_arr[16 * 3] = {
+ /* 8 width cases */
+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
+ /* 4 width cases */
+ 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20,
+ /* 4 width cases */
+ 8, 9, 9, 10, 10, 11, 11, 12, 24, 25, 25, 26, 26, 27, 27, 28
+};
+
+static const int8_t vp9_bilinear_filters_msa[15][2] = {
+ {120, 8},
+ {112, 16},
+ {104, 24},
+ {96, 32},
+ {88, 40},
+ {80, 48},
+ {72, 56},
+ {64, 64},
+ {56, 72},
+ {48, 80},
+ {40, 88},
+ {32, 96},
+ {24, 104},
+ {16, 112},
+ {8, 120}
+};
+
+#define FILT_8TAP_DPADD_S_H(vec0, vec1, vec2, vec3, \
+ filt0, filt1, filt2, filt3) \
+( { \
+ v8i16 tmp0, tmp1; \
+ \
+ tmp0 = __msa_dotp_s_h((v16i8) vec0, (v16i8) filt0); \
+ tmp0 = __msa_dpadd_s_h(tmp0, (v16i8) vec1, (v16i8) filt1); \
+ tmp1 = __msa_dotp_s_h((v16i8) vec2, (v16i8) filt2); \
+ tmp1 = __msa_dpadd_s_h(tmp1, (v16i8) vec3, (v16i8) filt3); \
+ tmp0 = __msa_adds_s_h(tmp0, tmp1); \
+ \
+ tmp0; \
+} )
+
+#define HORIZ_8TAP_FILT(src0, src1, mask0, mask1, mask2, mask3, \
+ filt_h0, filt_h1, filt_h2, filt_h3) \
+( { \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m; \
+ v8i16 hz_out_m; \
+ \
+ VSHF_B4_SB(src0, src1, mask0, mask1, mask2, mask3, \
+ vec0_m, vec1_m, vec2_m, vec3_m); \
+ hz_out_m = FILT_8TAP_DPADD_S_H(vec0_m, vec1_m, vec2_m, vec3_m, \
+ filt_h0, filt_h1, filt_h2, filt_h3); \
+ \
+ hz_out_m = __msa_srari_h(hz_out_m, 7); \
+ hz_out_m = __msa_sat_s_h(hz_out_m, 7); \
+ \
+ hz_out_m; \
+} )
+
+#define HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, mask2, mask3, \
+ filt0, filt1, filt2, filt3, \
+ out0, out1) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m, vec4_m, vec5_m, vec6_m, vec7_m; \
+ v8i16 res0_m, res1_m, res2_m, res3_m; \
+ \
+ VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0_m, vec1_m); \
+ DOTP_SB2_SH(vec0_m, vec1_m, filt0, filt0, res0_m, res1_m); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec2_m, vec3_m); \
+ DPADD_SB2_SH(vec2_m, vec3_m, filt1, filt1, res0_m, res1_m); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask2, mask2, vec4_m, vec5_m); \
+ DOTP_SB2_SH(vec4_m, vec5_m, filt2, filt2, res2_m, res3_m); \
+ VSHF_B2_SB(src0, src1, src2, src3, mask3, mask3, vec6_m, vec7_m); \
+ DPADD_SB2_SH(vec6_m, vec7_m, filt3, filt3, res2_m, res3_m); \
+ ADDS_SH2_SH(res0_m, res2_m, res1_m, res3_m, out0, out1); \
+}
+
+#define HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, \
+ mask0, mask1, mask2, mask3, \
+ filt0, filt1, filt2, filt3, \
+ out0, out1, out2, out3) \
+{ \
+ v16i8 vec0_m, vec1_m, vec2_m, vec3_m, vec4_m, vec5_m, vec6_m, vec7_m; \
+ v8i16 res0_m, res1_m, res2_m, res3_m, res4_m, res5_m, res6_m, res7_m; \
+ \
+ VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec2_m, vec3_m); \
+ DOTP_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt0, filt0, filt0, filt0, \
+ res0_m, res1_m, res2_m, res3_m); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask2, mask2, vec0_m, vec1_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask2, mask2, vec2_m, vec3_m); \
+ DOTP_SB4_SH(vec0_m, vec1_m, vec2_m, vec3_m, filt2, filt2, filt2, filt2, \
+ res4_m, res5_m, res6_m, res7_m); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec4_m, vec5_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec6_m, vec7_m); \
+ DPADD_SB4_SH(vec4_m, vec5_m, vec6_m, vec7_m, filt1, filt1, filt1, filt1, \
+ res0_m, res1_m, res2_m, res3_m); \
+ VSHF_B2_SB(src0, src0, src1, src1, mask3, mask3, vec4_m, vec5_m); \
+ VSHF_B2_SB(src2, src2, src3, src3, mask3, mask3, vec6_m, vec7_m); \
+ DPADD_SB4_SH(vec4_m, vec5_m, vec6_m, vec7_m, filt3, filt3, filt3, filt3, \
+ res4_m, res5_m, res6_m, res7_m); \
+ ADDS_SH4_SH(res0_m, res4_m, res1_m, res5_m, res2_m, res6_m, res3_m, \
+ res7_m, out0, out1, out2, out3); \
+}
+
+#define PCKEV_XORI128_AVG_ST_UB(in0, in1, dst, pdst) \
+{ \
+ v16u8 tmp_m; \
+ \
+ tmp_m = PCKEV_XORI128_UB(in1, in0); \
+ tmp_m = __msa_aver_u_b(tmp_m, (v16u8) dst); \
+ ST_UB(tmp_m, (pdst)); \
+}
+
+#define PCKEV_AVG_ST_UB(in0, in1, dst, pdst) \
+{ \
+ v16u8 tmp_m; \
+ \
+ tmp_m = (v16u8) __msa_pckev_b((v16i8) in0, (v16i8) in1); \
+ tmp_m = __msa_aver_u_b(tmp_m, (v16u8) dst); \
+ ST_UB(tmp_m, (pdst)); \
+}
+
+#define PCKEV_AVG_ST8x4_UB(in1, dst0, in2, dst1, in3, dst2, in4, dst3, \
+ pdst, stride) \
+{ \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ uint8_t *pdst_m = (uint8_t *) (pdst); \
+ \
+ PCKEV_B2_UB(in2, in1, in4, in3, tmp0_m, tmp1_m); \
+ PCKEV_D2_UB(dst1, dst0, dst3, dst2, tmp2_m, tmp3_m); \
+ AVER_UB2_UB(tmp0_m, tmp2_m, tmp1_m, tmp3_m, tmp0_m, tmp1_m); \
+ ST8x4_UB(tmp0_m, tmp1_m, pdst_m, stride); \
+}
+
+static void common_hz_8t_4x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v8i16 filt, out0, out1;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0, out1);
+ SRARI_H2_SH(out0, out1, 7);
+ SAT_SH2_SH(out0, out1, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_8t_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 filt0, filt1, filt2, filt3;
+ v16i8 src0, src1, src2, src3;
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0, out1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_8t_4x16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0, out1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0, out1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out2, out3);
+
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_hz_8t_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ if (4 == height) {
+ common_hz_8t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_hz_8t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (16 == height) {
+ common_hz_8t_4x16_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+static void common_hz_8t_8x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, tmp0, tmp1;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0, out1,
+ out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ tmp0 = PCKEV_XORI128_UB(out0, out1);
+ tmp1 = PCKEV_XORI128_UB(out2, out3);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+}
+
+static void common_hz_8t_8x8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, tmp0, tmp1;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ tmp0 = PCKEV_XORI128_UB(out0, out1);
+ tmp1 = PCKEV_XORI128_UB(out2, out3);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hz_8t_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ if (4 == height) {
+ common_hz_8t_8x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else {
+ common_hz_8t_8x8mult_msa(src, src_stride, dst, dst_stride, filter,
+ height);
+ }
+}
+
+static void common_hz_8t_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_SB2(src, src_stride, src0, src2);
+ LD_SB2(src + 8, src_stride, src1, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (2 * src_stride);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_8t_32w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst + 16);
+ dst += dst_stride;
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst + 16);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_8t_64w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ int32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = height; loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ mask2, mask3, filt0, filt1, filt2, filt3,
+ out0, out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst + 16);
+
+ src0 = LD_SB(src + 32);
+ src2 = LD_SB(src + 48);
+ src3 = LD_SB(src + 56);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1,
+ mask2, mask3, filt0, filt1, filt2, filt3,
+ out0, out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ out = PCKEV_XORI128_UB(out0, out1);
+ ST_UB(out, dst + 32);
+ out = PCKEV_XORI128_UB(out2, out3);
+ ST_UB(out, dst + 48);
+ dst += dst_stride;
+ }
+}
+
+static void common_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, src2110, src4332, src6554, src8776;
+ v16i8 src10998, filt0, filt1, filt2, filt3;
+ v16u8 out;
+ v8i16 filt, out10, out32;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r,
+ src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+ ILVR_D3_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r, src2110,
+ src4332, src6554);
+ XORI_B3_128_SB(src2110, src4332, src6554);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ ILVR_D2_SB(src87_r, src76_r, src109_r, src98_r, src8776, src10998);
+ XORI_B2_128_SB(src8776, src10998);
+ out10 = FILT_8TAP_DPADD_S_H(src2110, src4332, src6554, src8776, filt0,
+ filt1, filt2, filt3);
+ out32 = FILT_8TAP_DPADD_S_H(src4332, src6554, src8776, src10998, filt0,
+ filt1, filt2, filt3);
+ SRARI_H2_SH(out10, out32, 7);
+ SAT_SH2_SH(out10, out32, 7);
+ out = PCKEV_XORI128_UB(out10, out32);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src2110 = src6554;
+ src4332 = src8776;
+ src6554 = src10998;
+ src6 = src10;
+ }
+}
+
+static void common_vt_8t_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, filt0, filt1, filt2, filt3;
+ v16u8 tmp0, tmp1;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r,
+ src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ out0_r = FILT_8TAP_DPADD_S_H(src10_r, src32_r, src54_r, src76_r, filt0,
+ filt1, filt2, filt3);
+ out1_r = FILT_8TAP_DPADD_S_H(src21_r, src43_r, src65_r, src87_r, filt0,
+ filt1, filt2, filt3);
+ out2_r = FILT_8TAP_DPADD_S_H(src32_r, src54_r, src76_r, src98_r, filt0,
+ filt1, filt2, filt3);
+ out3_r = FILT_8TAP_DPADD_S_H(src43_r, src65_r, src87_r, src109_r, filt0,
+ filt1, filt2, filt3);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ tmp0 = PCKEV_XORI128_UB(out0_r, out1_r);
+ tmp1 = PCKEV_XORI128_UB(out2_r, out3_r);
+ ST8x4_UB(tmp0, tmp1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src54_r = src98_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src65_r = src109_r;
+ src6 = src10;
+ }
+}
+
+static void common_vt_8t_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 filt0, filt1, filt2, filt3;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, src10_l, src32_l, src54_l, src76_l;
+ v16i8 src98_l, src21_l, src43_l, src65_l, src87_l, src109_l;
+ v16u8 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r, out0_l, out1_l, out2_l, out3_l;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r,
+ src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+ ILVL_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_l, src32_l,
+ src54_l, src21_l);
+ ILVL_B2_SB(src4, src3, src6, src5, src43_l, src65_l);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ ILVL_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_l,
+ src87_l, src98_l, src109_l);
+ out0_r = FILT_8TAP_DPADD_S_H(src10_r, src32_r, src54_r, src76_r, filt0,
+ filt1, filt2, filt3);
+ out1_r = FILT_8TAP_DPADD_S_H(src21_r, src43_r, src65_r, src87_r, filt0,
+ filt1, filt2, filt3);
+ out2_r = FILT_8TAP_DPADD_S_H(src32_r, src54_r, src76_r, src98_r, filt0,
+ filt1, filt2, filt3);
+ out3_r = FILT_8TAP_DPADD_S_H(src43_r, src65_r, src87_r, src109_r, filt0,
+ filt1, filt2, filt3);
+ out0_l = FILT_8TAP_DPADD_S_H(src10_l, src32_l, src54_l, src76_l, filt0,
+ filt1, filt2, filt3);
+ out1_l = FILT_8TAP_DPADD_S_H(src21_l, src43_l, src65_l, src87_l, filt0,
+ filt1, filt2, filt3);
+ out2_l = FILT_8TAP_DPADD_S_H(src32_l, src54_l, src76_l, src98_l, filt0,
+ filt1, filt2, filt3);
+ out3_l = FILT_8TAP_DPADD_S_H(src43_l, src65_l, src87_l, src109_l, filt0,
+ filt1, filt2, filt3);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SRARI_H4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ PCKEV_B4_UB(out0_l, out0_r, out1_l, out1_r, out2_l, out2_r, out3_l,
+ out3_r, tmp0, tmp1, tmp2, tmp3);
+ XORI_B4_128_UB(tmp0, tmp1, tmp2, tmp3);
+ ST_UB4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src54_r = src98_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src65_r = src109_r;
+ src10_l = src54_l;
+ src32_l = src76_l;
+ src54_l = src98_l;
+ src21_l = src65_l;
+ src43_l = src87_l;
+ src65_l = src109_l;
+ src6 = src10;
+ }
+}
+
+static void common_vt_8t_16w_mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height,
+ int32_t width)
+{
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
+ uint32_t loop_cnt, cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 filt0, filt1, filt2, filt3;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, src10_l, src32_l, src54_l, src76_l;
+ v16i8 src98_l, src21_l, src43_l, src65_l, src87_l, src109_l;
+ v16u8 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt, out0_r, out1_r, out2_r, out3_r, out0_l, out1_l, out2_l, out3_l;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ LD_SB7(src_tmp, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src_tmp += (7 * src_stride);
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r,
+ src32_r, src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+ ILVL_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_l,
+ src32_l, src54_l, src21_l);
+ ILVL_B2_SB(src4, src3, src6, src5, src43_l, src65_l);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src_tmp, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src_tmp += (4 * src_stride);
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ ILVL_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_l,
+ src87_l, src98_l, src109_l);
+ out0_r = FILT_8TAP_DPADD_S_H(src10_r, src32_r, src54_r, src76_r,
+ filt0, filt1, filt2, filt3);
+ out1_r = FILT_8TAP_DPADD_S_H(src21_r, src43_r, src65_r, src87_r,
+ filt0, filt1, filt2, filt3);
+ out2_r = FILT_8TAP_DPADD_S_H(src32_r, src54_r, src76_r, src98_r,
+ filt0, filt1, filt2, filt3);
+ out3_r = FILT_8TAP_DPADD_S_H(src43_r, src65_r, src87_r, src109_r,
+ filt0, filt1, filt2, filt3);
+ out0_l = FILT_8TAP_DPADD_S_H(src10_l, src32_l, src54_l, src76_l,
+ filt0, filt1, filt2, filt3);
+ out1_l = FILT_8TAP_DPADD_S_H(src21_l, src43_l, src65_l, src87_l,
+ filt0, filt1, filt2, filt3);
+ out2_l = FILT_8TAP_DPADD_S_H(src32_l, src54_l, src76_l, src98_l,
+ filt0, filt1, filt2, filt3);
+ out3_l = FILT_8TAP_DPADD_S_H(src43_l, src65_l, src87_l, src109_l,
+ filt0, filt1, filt2, filt3);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SRARI_H4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ PCKEV_B4_UB(out0_l, out0_r, out1_l, out1_r, out2_l, out2_r, out3_l,
+ out3_r, tmp0, tmp1, tmp2, tmp3);
+ XORI_B4_128_UB(tmp0, tmp1, tmp2, tmp3);
+ ST_UB4(tmp0, tmp1, tmp2, tmp3, dst_tmp, dst_stride);
+ dst_tmp += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src54_r = src98_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src65_r = src109_r;
+ src10_l = src54_l;
+ src32_l = src76_l;
+ src54_l = src98_l;
+ src21_l = src65_l;
+ src43_l = src87_l;
+ src65_l = src109_l;
+ src6 = src10;
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void common_vt_8t_32w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ common_vt_8t_16w_mult_msa(src, src_stride, dst, dst_stride, filter, height,
+ 32);
+}
+
+static void common_vt_8t_64w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ common_vt_8t_16w_mult_msa(src, src_stride, dst, dst_stride, filter, height,
+ 64);
+}
+
+static void common_hv_8ht_8vt_4w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 filt_hz0, filt_hz1, filt_hz2, filt_hz3;
+ v16u8 mask0, mask1, mask2, mask3, out;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, hz_out9, tmp0, tmp1, out0, out1, out2, out3, out4;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2, filt_vt3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= (3 + 3 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ hz_out0 = HORIZ_8TAP_FILT(src0, src1, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out2 = HORIZ_8TAP_FILT(src2, src3, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out4 = HORIZ_8TAP_FILT(src4, src5, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out5 = HORIZ_8TAP_FILT(src5, src6, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ SLDI_B2_SH(hz_out2, hz_out4, hz_out0, hz_out2, hz_out1, hz_out3, 8);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H4_SH(filt, 0, 1, 2, 3, filt_vt0, filt_vt1, filt_vt2, filt_vt3);
+
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+ out2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ hz_out7 = HORIZ_8TAP_FILT(src7, src8, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ hz_out6 = (v8i16) __msa_sldi_b((v16i8) hz_out7, (v16i8) hz_out5, 8);
+ out3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp0 = FILT_8TAP_DPADD_S_H(out0, out1, out2, out3, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out9 = HORIZ_8TAP_FILT(src9, src10, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ hz_out8 = (v8i16) __msa_sldi_b((v16i8) hz_out9, (v16i8) hz_out7, 8);
+ out4 = (v8i16) __msa_ilvev_b((v16i8) hz_out9, (v16i8) hz_out8);
+ tmp1 = FILT_8TAP_DPADD_S_H(out1, out2, out3, out4, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+ SRARI_H2_SH(tmp0, tmp1, 7);
+ SAT_SH2_SH(tmp0, tmp1, 7);
+ out = PCKEV_XORI128_UB(tmp0, tmp1);
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out5 = hz_out9;
+ out0 = out2;
+ out1 = out3;
+ out2 = out4;
+ }
+}
+
+static void common_hv_8ht_8vt_8w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 filt_hz0, filt_hz1, filt_hz2, filt_hz3;
+ v16u8 mask0, mask1, mask2, mask3, vec0, vec1;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2, filt_vt3;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, hz_out9, hz_out10, tmp0, tmp1, tmp2, tmp3;
+ v8i16 out0, out1, out2, out3, out4, out5, out6, out7, out8, out9;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= (3 + 3 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ hz_out0 = HORIZ_8TAP_FILT(src0, src0, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out1 = HORIZ_8TAP_FILT(src1, src1, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out2 = HORIZ_8TAP_FILT(src2, src2, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out3 = HORIZ_8TAP_FILT(src3, src3, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out4 = HORIZ_8TAP_FILT(src4, src4, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out5 = HORIZ_8TAP_FILT(src5, src5, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out6 = HORIZ_8TAP_FILT(src6, src6, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H4_SH(filt, 0, 1, 2, 3, filt_vt0, filt_vt1, filt_vt2, filt_vt3);
+
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+ ILVEV_B2_SH(hz_out4, hz_out5, hz_out1, hz_out2, out2, out4);
+ ILVEV_B2_SH(hz_out3, hz_out4, hz_out5, hz_out6, out5, out6);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ XORI_B4_128_SB(src7, src8, src9, src10);
+
+ hz_out7 = HORIZ_8TAP_FILT(src7, src7, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp0 = FILT_8TAP_DPADD_S_H(out0, out1, out2, out3, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out8 = HORIZ_8TAP_FILT(src8, src8, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out7 = (v8i16) __msa_ilvev_b((v16i8) hz_out8, (v16i8) hz_out7);
+ tmp1 = FILT_8TAP_DPADD_S_H(out4, out5, out6, out7, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out9 = HORIZ_8TAP_FILT(src9, src9, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out8 = (v8i16) __msa_ilvev_b((v16i8) hz_out9, (v16i8) hz_out8);
+ tmp2 = FILT_8TAP_DPADD_S_H(out1, out2, out3, out8, filt_vt0,
+ filt_vt1, filt_vt2, filt_vt3);
+
+ hz_out10 = HORIZ_8TAP_FILT(src10, src10, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out9 = (v8i16) __msa_ilvev_b((v16i8) hz_out10, (v16i8) hz_out9);
+ tmp3 = FILT_8TAP_DPADD_S_H(out5, out6, out7, out9, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ vec0 = PCKEV_XORI128_UB(tmp0, tmp1);
+ vec1 = PCKEV_XORI128_UB(tmp2, tmp3);
+ ST8x4_UB(vec0, vec1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out6 = hz_out10;
+ out0 = out2;
+ out1 = out3;
+ out2 = out8;
+ out4 = out6;
+ out5 = out7;
+ out6 = out9;
+ }
+}
+
+static void common_hv_8ht_8vt_16w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ common_hv_8ht_8vt_8w_msa(src, src_stride, dst, dst_stride, filter_horiz,
+ filter_vert, height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hv_8ht_8vt_32w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 4; multiple8_cnt--;) {
+ common_hv_8ht_8vt_8w_msa(src, src_stride, dst, dst_stride, filter_horiz,
+ filter_vert, height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hv_8ht_8vt_64w_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 8; multiple8_cnt--;) {
+ common_hv_8ht_8vt_8w_msa(src, src_stride, dst, dst_stride, filter_horiz,
+ filter_vert, height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hz_8t_and_aver_dst_4x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 dst0, dst1, dst2, dst3, res2, res3;
+ v16u8 mask0, mask1, mask2, mask3;
+ v8i16 filt, res0, res1;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, res0, res1);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ SRARI_H2_SH(res0, res1, 7);
+ SAT_SH2_SH(res0, res1, 7);
+ PCKEV_B2_UB(res0, res0, res1, res1, res2, res3);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst2);
+ XORI_B2_128_UB(res2, res3);
+ AVER_UB2_UB(res2, dst0, res3, dst2, res2, res3);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hz_8t_and_aver_dst_4x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, res0, res1, res2, res3;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v8i16 filt, vec0, vec1, vec2, vec3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, vec0, vec1);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ HORIZ_8TAP_4WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, vec2, vec3);
+ SRARI_H4_SH(vec0, vec1, vec2, vec3, 7);
+ SAT_SH4_SH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B4_UB(vec0, vec0, vec1, vec1, vec2, vec2, vec3, vec3,
+ res0, res1, res2, res3);
+ ILVR_D2_UB(res1, res0, res3, res2, res0, res2);
+ XORI_B2_128_UB(res0, res2);
+ ILVR_W4_UB(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
+ dst0, dst2, dst4, dst6);
+ ILVR_D2_UB(dst2, dst0, dst6, dst4, dst0, dst4);
+ AVER_UB2_UB(res0, dst0, res2, dst4, res0, res2);
+ ST4x8_UB(res0, res2, dst, dst_stride);
+}
+
+static void common_hz_8t_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ if (4 == height) {
+ common_hz_8t_and_aver_dst_4x4_msa(src, src_stride, dst, dst_stride,
+ filter);
+ } else if (8 == height) {
+ common_hz_8t_and_aver_dst_4x8_msa(src, src_stride, dst, dst_stride,
+ filter);
+ }
+}
+
+static void common_hz_8t_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ int32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, dst0, dst1, dst2, dst3;
+ v8i16 filt, out0, out1, out2, out3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ src += (4 * src_stride);
+ HORIZ_8TAP_8WID_4VECS_FILT(src0, src1, src2, src3, mask0, mask1, mask2,
+ mask3, filt0, filt1, filt2, filt3, out0,
+ out1, out2, out3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ CONVERT_UB_AVG_ST8x4_UB(out0, out1, out2, out3, dst0, dst1, dst2, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void common_hz_8t_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ int32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 mask0, mask1, mask2, mask3, dst0, dst1;
+ v8i16 filt, out0, out1, out2, out3;
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8i16 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = height >> 1; loop_cnt--;) {
+ LD_SB2(src, src_stride, src0, src2);
+ LD_SB2(src + 8, src_stride, src1, src3);
+ src += (2 * src_stride);
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ VSHF_B4_SH(src0, src0, mask0, mask1, mask2, mask3, vec0, vec4, vec8,
+ vec12);
+ VSHF_B4_SH(src1, src1, mask0, mask1, mask2, mask3, vec1, vec5, vec9,
+ vec13);
+ VSHF_B4_SH(src2, src2, mask0, mask1, mask2, mask3, vec2, vec6, vec10,
+ vec14);
+ VSHF_B4_SH(src3, src3, mask0, mask1, mask2, mask3, vec3, vec7, vec11,
+ vec15);
+ DOTP_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0,
+ vec1, vec2, vec3);
+ DOTP_SB4_SH(vec8, vec9, vec10, vec11, filt2, filt2, filt2, filt2, vec8,
+ vec9, vec10, vec11);
+ DPADD_SB4_SH(vec4, vec5, vec6, vec7, filt1, filt1, filt1, filt1, vec0,
+ vec1, vec2, vec3);
+ DPADD_SB4_SH(vec12, vec13, vec14, vec15, filt3, filt3, filt3, filt3,
+ vec8, vec9, vec10, vec11);
+ ADDS_SH4_SH(vec0, vec8, vec1, vec9, vec2, vec10, vec3, vec11, out0,
+ out1, out2, out3);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ PCKEV_XORI128_AVG_ST_UB(out1, out0, dst0, dst);
+ dst += dst_stride;
+ PCKEV_XORI128_AVG_ST_UB(out3, out2, dst1, dst);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_8t_and_aver_dst_32w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 dst1, dst2, mask0, mask1, mask2, mask3;
+ v8i16 filt, out0, out1, out2, out3;
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8i16 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = height; loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ VSHF_B4_SH(src0, src0, mask0, mask1, mask2, mask3, vec0, vec4, vec8,
+ vec12);
+ VSHF_B4_SH(src1, src1, mask0, mask1, mask2, mask3, vec1, vec5, vec9,
+ vec13);
+ VSHF_B4_SH(src2, src2, mask0, mask1, mask2, mask3, vec2, vec6, vec10,
+ vec14);
+ VSHF_B4_SH(src3, src3, mask0, mask1, mask2, mask3, vec3, vec7, vec11,
+ vec15);
+ DOTP_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0,
+ vec1, vec2, vec3);
+ DOTP_SB4_SH(vec8, vec9, vec10, vec11, filt2, filt2, filt2, filt2, vec8,
+ vec9, vec10, vec11);
+ DPADD_SB4_SH(vec4, vec5, vec6, vec7, filt1, filt1, filt1, filt1, vec0,
+ vec1, vec2, vec3);
+ DPADD_SB4_SH(vec12, vec13, vec14, vec15, filt3, filt3, filt3, filt3,
+ vec8, vec9, vec10, vec11);
+ ADDS_SH4_SH(vec0, vec8, vec1, vec9, vec2, vec10, vec3, vec11, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ LD_UB2(dst, 16, dst1, dst2);
+ PCKEV_XORI128_AVG_ST_UB(out1, out0, dst1, dst);
+ PCKEV_XORI128_AVG_ST_UB(out3, out2, dst2, dst + 16);
+ dst += dst_stride;
+ }
+}
+
+static void common_hz_8t_and_aver_dst_64w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ uint32_t loop_cnt, cnt;
+ v16i8 src0, src1, src2, src3, filt0, filt1, filt2, filt3;
+ v16u8 dst1, dst2, mask0, mask1, mask2, mask3;
+ v8i16 filt, out0, out1, out2, out3;
+ v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8i16 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= 3;
+
+ /* rearranging filter */
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ for (loop_cnt = height; loop_cnt--;) {
+ for (cnt = 0; cnt < 2; ++cnt) {
+ src0 = LD_SB(&src[cnt << 5]);
+ src2 = LD_SB(&src[16 + (cnt << 5)]);
+ src3 = LD_SB(&src[24 + (cnt << 5)]);
+ src1 = __msa_sldi_b(src2, src0, 8);
+
+ XORI_B4_128_SB(src0, src1, src2, src3);
+ VSHF_B4_SH(src0, src0, mask0, mask1, mask2, mask3, vec0, vec4, vec8,
+ vec12);
+ VSHF_B4_SH(src1, src1, mask0, mask1, mask2, mask3, vec1, vec5, vec9,
+ vec13);
+ VSHF_B4_SH(src2, src2, mask0, mask1, mask2, mask3, vec2, vec6,
+ vec10, vec14);
+ VSHF_B4_SH(src3, src3, mask0, mask1, mask2, mask3, vec3, vec7,
+ vec11, vec15);
+ DOTP_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ DOTP_SB4_SH(vec8, vec9, vec10, vec11, filt2, filt2, filt2, filt2,
+ vec8, vec9, vec10, vec11);
+ DPADD_SB4_SH(vec4, vec5, vec6, vec7, filt1, filt1, filt1, filt1,
+ vec0, vec1, vec2, vec3);
+ DPADD_SB4_SH(vec12, vec13, vec14, vec15, filt3, filt3, filt3, filt3,
+ vec8, vec9, vec10, vec11);
+ ADDS_SH4_SH(vec0, vec8, vec1, vec9, vec2, vec10, vec3, vec11, out0,
+ out1, out2, out3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ LD_UB2(&dst[cnt << 5], 16, dst1, dst2);
+ PCKEV_XORI128_AVG_ST_UB(out1, out0, dst1, &dst[cnt << 5]);
+ PCKEV_XORI128_AVG_ST_UB(out3, out2, dst2, &dst[16 + (cnt << 5)]);
+ }
+
+ src += src_stride;
+ dst += dst_stride;
+ }
+}
+
+static void common_vt_8t_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16u8 dst0, dst1, dst2, dst3, out;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, src2110, src4332, src6554, src8776;
+ v16i8 src10998, filt0, filt1, filt2, filt3;
+ v8i16 filt, out10, out32;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r,
+ src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+ ILVR_D3_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r, src2110,
+ src4332, src6554);
+ XORI_B3_128_SB(src2110, src4332, src6554);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ ILVR_D2_SB(src87_r, src76_r, src109_r, src98_r, src8776, src10998);
+ XORI_B2_128_SB(src8776, src10998);
+ out10 = FILT_8TAP_DPADD_S_H(src2110, src4332, src6554, src8776, filt0,
+ filt1, filt2, filt3);
+ out32 = FILT_8TAP_DPADD_S_H(src4332, src6554, src8776, src10998, filt0,
+ filt1, filt2, filt3);
+ SRARI_H2_SH(out10, out32, 7);
+ SAT_SH2_SH(out10, out32, 7);
+ out = PCKEV_XORI128_UB(out10, out32);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst2);
+
+ dst0 = (v16u8) __msa_ilvr_d((v2i64) dst2, (v2i64) dst0);
+ out = __msa_aver_u_b(out, dst0);
+
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src2110 = src6554;
+ src4332 = src8776;
+ src6554 = src10998;
+ src6 = src10;
+ }
+}
+
+static void common_vt_8t_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16u8 dst0, dst1, dst2, dst3;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, filt0, filt1, filt2, filt3;
+ v8i16 filt, out0, out1, out2, out3;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r,
+ src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ out0 = FILT_8TAP_DPADD_S_H(src10_r, src32_r, src54_r, src76_r, filt0,
+ filt1, filt2, filt3);
+ out1 = FILT_8TAP_DPADD_S_H(src21_r, src43_r, src65_r, src87_r, filt0,
+ filt1, filt2, filt3);
+ out2 = FILT_8TAP_DPADD_S_H(src32_r, src54_r, src76_r, src98_r, filt0,
+ filt1, filt2, filt3);
+ out3 = FILT_8TAP_DPADD_S_H(src43_r, src65_r, src87_r, src109_r, filt0,
+ filt1, filt2, filt3);
+ SRARI_H4_SH(out0, out1, out2, out3, 7);
+ SAT_SH4_SH(out0, out1, out2, out3, 7);
+ CONVERT_UB_AVG_ST8x4_UB(out0, out1, out2, out3, dst0, dst1, dst2, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src54_r = src98_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src65_r = src109_r;
+ src6 = src10;
+ }
+}
+
+static void common_vt_8t_and_aver_dst_16w_mult_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height,
+ int32_t width)
+{
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
+ uint32_t loop_cnt, cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src98_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src109_r, src10_l, src32_l, src54_l, src76_l;
+ v16i8 src98_l, src21_l, src43_l, src65_l, src87_l, src109_l;
+ v16i8 filt0, filt1, filt2, filt3;
+ v16u8 dst0, dst1, dst2, dst3, tmp0, tmp1, tmp2, tmp3;
+ v8i16 out0_r, out1_r, out2_r, out3_r, out0_l, out1_l, out2_l, out3_l, filt;
+
+ src -= (3 * src_stride);
+
+ filt = LD_SH(filter);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt0, filt1, filt2, filt3);
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ LD_SB7(src_tmp, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src_tmp += (7 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r,
+ src32_r, src54_r, src21_r);
+ ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r);
+ ILVL_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_l,
+ src32_l, src54_l, src21_l);
+ ILVL_B2_SB(src4, src3, src6, src5, src43_l, src65_l);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src_tmp, src_stride, src7, src8, src9, src10);
+ src_tmp += (4 * src_stride);
+
+ LD_UB4(dst_tmp, dst_stride, dst0, dst1, dst2, dst3);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r,
+ src87_r, src98_r, src109_r);
+ ILVL_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_l,
+ src87_l, src98_l, src109_l);
+ out0_r = FILT_8TAP_DPADD_S_H(src10_r, src32_r, src54_r, src76_r,
+ filt0, filt1, filt2, filt3);
+ out1_r = FILT_8TAP_DPADD_S_H(src21_r, src43_r, src65_r, src87_r,
+ filt0, filt1, filt2, filt3);
+ out2_r = FILT_8TAP_DPADD_S_H(src32_r, src54_r, src76_r, src98_r,
+ filt0, filt1, filt2, filt3);
+ out3_r = FILT_8TAP_DPADD_S_H(src43_r, src65_r, src87_r, src109_r,
+ filt0, filt1, filt2, filt3);
+ out0_l = FILT_8TAP_DPADD_S_H(src10_l, src32_l, src54_l, src76_l,
+ filt0, filt1, filt2, filt3);
+ out1_l = FILT_8TAP_DPADD_S_H(src21_l, src43_l, src65_l, src87_l,
+ filt0, filt1, filt2, filt3);
+ out2_l = FILT_8TAP_DPADD_S_H(src32_l, src54_l, src76_l, src98_l,
+ filt0, filt1, filt2, filt3);
+ out3_l = FILT_8TAP_DPADD_S_H(src43_l, src65_l, src87_l, src109_l,
+ filt0, filt1, filt2, filt3);
+ SRARI_H4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SRARI_H4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ SAT_SH4_SH(out0_r, out1_r, out2_r, out3_r, 7);
+ SAT_SH4_SH(out0_l, out1_l, out2_l, out3_l, 7);
+ PCKEV_B4_UB(out0_l, out0_r, out1_l, out1_r, out2_l, out2_r, out3_l,
+ out3_r, tmp0, tmp1, tmp2, tmp3);
+ XORI_B4_128_UB(tmp0, tmp1, tmp2, tmp3);
+ AVER_UB4_UB(tmp0, dst0, tmp1, dst1, tmp2, dst2, tmp3, dst3,
+ dst0, dst1, dst2, dst3);
+ ST_UB4(dst0, dst1, dst2, dst3, dst_tmp, dst_stride);
+ dst_tmp += (4 * dst_stride);
+
+ src10_r = src54_r;
+ src32_r = src76_r;
+ src54_r = src98_r;
+ src21_r = src65_r;
+ src43_r = src87_r;
+ src65_r = src109_r;
+ src10_l = src54_l;
+ src32_l = src76_l;
+ src54_l = src98_l;
+ src21_l = src65_l;
+ src43_l = src87_l;
+ src65_l = src109_l;
+ src6 = src10;
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void common_vt_8t_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ common_vt_8t_and_aver_dst_16w_mult_msa(src, src_stride, dst, dst_stride,
+ filter, height, 16);
+}
+
+static void common_vt_8t_and_aver_dst_32w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ common_vt_8t_and_aver_dst_16w_mult_msa(src, src_stride, dst, dst_stride,
+ filter, height, 32);
+}
+
+static void common_vt_8t_and_aver_dst_64w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ common_vt_8t_and_aver_dst_16w_mult_msa(src, src_stride, dst, dst_stride,
+ filter, height, 64);
+}
+
+static void common_hv_8ht_8vt_and_aver_dst_4w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16u8 dst0, dst1, dst2, dst3, mask0, mask1, mask2, mask3, tmp0, tmp1;
+ v16i8 filt_hz0, filt_hz1, filt_hz2, filt_hz3;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, hz_out9, res0, res1, vec0, vec1, vec2, vec3, vec4;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2, filt_vt3;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[16]);
+ src -= (3 + 3 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ hz_out0 = HORIZ_8TAP_FILT(src0, src1, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out2 = HORIZ_8TAP_FILT(src2, src3, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out4 = HORIZ_8TAP_FILT(src4, src5, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out5 = HORIZ_8TAP_FILT(src5, src6, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ SLDI_B2_SH(hz_out2, hz_out4, hz_out0, hz_out2, hz_out1, hz_out3, 8);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H4_SH(filt, 0, 1, 2, 3, filt_vt0, filt_vt1, filt_vt2, filt_vt3);
+
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ vec2 = (v8i16) __msa_ilvev_b((v16i8) hz_out5, (v16i8) hz_out4);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ hz_out7 = HORIZ_8TAP_FILT(src7, src8, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ hz_out6 = (v8i16) __msa_sldi_b((v16i8) hz_out7, (v16i8) hz_out5, 8);
+ vec3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ res0 = FILT_8TAP_DPADD_S_H(vec0, vec1, vec2, vec3, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out9 = HORIZ_8TAP_FILT(src9, src10, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ hz_out8 = (v8i16) __msa_sldi_b((v16i8) hz_out9, (v16i8) hz_out7, 8);
+ vec4 = (v8i16) __msa_ilvev_b((v16i8) hz_out9, (v16i8) hz_out8);
+ res1 = FILT_8TAP_DPADD_S_H(vec1, vec2, vec3, vec4, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst2);
+
+ SRARI_H2_SH(res0, res1, 7);
+ SAT_SH2_SH(res0, res1, 7);
+ PCKEV_B2_UB(res0, res0, res1, res1, tmp0, tmp1);
+ XORI_B2_128_UB(tmp0, tmp1);
+ AVER_UB2_UB(tmp0, dst0, tmp1, dst2, tmp0, tmp1);
+ ST4x4_UB(tmp0, tmp1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out5 = hz_out9;
+ vec0 = vec2;
+ vec1 = vec3;
+ vec2 = vec4;
+ }
+}
+
+static void common_hv_8ht_8vt_and_aver_dst_8w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16i8 filt_hz0, filt_hz1, filt_hz2, filt_hz3;
+ v8i16 filt, filt_vt0, filt_vt1, filt_vt2, filt_vt3;
+ v16u8 dst0, dst1, dst2, dst3, mask0, mask1, mask2, mask3;
+ v8i16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8i16 hz_out7, hz_out8, hz_out9, hz_out10, tmp0, tmp1, tmp2, tmp3;
+ v8i16 out0, out1, out2, out3, out4, out5, out6, out7, out8, out9;
+
+ mask0 = LD_UB(&mc_filt_mask_arr[0]);
+ src -= (3 + 3 * src_stride);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ SPLATI_H4_SB(filt, 0, 1, 2, 3, filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+
+ mask1 = mask0 + 2;
+ mask2 = mask0 + 4;
+ mask3 = mask0 + 6;
+
+ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6);
+ src += (7 * src_stride);
+
+ XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6);
+ hz_out0 = HORIZ_8TAP_FILT(src0, src0, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out1 = HORIZ_8TAP_FILT(src1, src1, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out2 = HORIZ_8TAP_FILT(src2, src2, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out3 = HORIZ_8TAP_FILT(src3, src3, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out4 = HORIZ_8TAP_FILT(src4, src4, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out5 = HORIZ_8TAP_FILT(src5, src5, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+ hz_out6 = HORIZ_8TAP_FILT(src6, src6, mask0, mask1, mask2, mask3, filt_hz0,
+ filt_hz1, filt_hz2, filt_hz3);
+
+ filt = LD_SH(filter_vert);
+ SPLATI_H4_SH(filt, 0, 1, 2, 3, filt_vt0, filt_vt1, filt_vt2, filt_vt3);
+
+ ILVEV_B2_SH(hz_out0, hz_out1, hz_out2, hz_out3, out0, out1);
+ ILVEV_B2_SH(hz_out4, hz_out5, hz_out1, hz_out2, out2, out4);
+ ILVEV_B2_SH(hz_out3, hz_out4, hz_out5, hz_out6, out5, out6);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src7, src8, src9, src10);
+ XORI_B4_128_SB(src7, src8, src9, src10);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ hz_out7 = HORIZ_8TAP_FILT(src7, src7, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out3 = (v8i16) __msa_ilvev_b((v16i8) hz_out7, (v16i8) hz_out6);
+ tmp0 = FILT_8TAP_DPADD_S_H(out0, out1, out2, out3, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out8 = HORIZ_8TAP_FILT(src8, src8, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out7 = (v8i16) __msa_ilvev_b((v16i8) hz_out8, (v16i8) hz_out7);
+ tmp1 = FILT_8TAP_DPADD_S_H(out4, out5, out6, out7, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out9 = HORIZ_8TAP_FILT(src9, src9, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out8 = (v8i16) __msa_ilvev_b((v16i8) hz_out9, (v16i8) hz_out8);
+ tmp2 = FILT_8TAP_DPADD_S_H(out1, out2, out3, out8, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ hz_out10 = HORIZ_8TAP_FILT(src10, src10, mask0, mask1, mask2, mask3,
+ filt_hz0, filt_hz1, filt_hz2, filt_hz3);
+ out9 = (v8i16) __msa_ilvev_b((v16i8) hz_out10, (v16i8) hz_out9);
+ tmp3 = FILT_8TAP_DPADD_S_H(out5, out6, out7, out9, filt_vt0, filt_vt1,
+ filt_vt2, filt_vt3);
+
+ SRARI_H4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_SH4_SH(tmp0, tmp1, tmp2, tmp3, 7);
+ CONVERT_UB_AVG_ST8x4_UB(tmp0, tmp1, tmp2, tmp3, dst0, dst1, dst2, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out6 = hz_out10;
+ out0 = out2;
+ out1 = out3;
+ out2 = out8;
+ out4 = out6;
+ out5 = out7;
+ out6 = out9;
+ }
+}
+
+static void common_hv_8ht_8vt_and_aver_dst_16w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ common_hv_8ht_8vt_and_aver_dst_8w_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert,
+ height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hv_8ht_8vt_and_aver_dst_32w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 4; multiple8_cnt--;) {
+ common_hv_8ht_8vt_and_aver_dst_8w_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert,
+ height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hv_8ht_8vt_and_aver_dst_64w_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 8; multiple8_cnt--;) {
+ common_hv_8ht_8vt_and_aver_dst_8w_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert,
+ height);
+
+ src += 8;
+ dst += 8;
+ }
+}
+
+static void common_hz_2t_4x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, mask;
+ v16u8 filt0, vec0, vec1, res0, res1;
+ v8u16 vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, vec2, vec3);
+ SRARI_H2_UH(vec2, vec3, 7);
+ PCKEV_B2_UB(vec2, vec2, vec3, vec3, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hz_2t_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 vec0, vec1, vec2, vec3, filt0;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16i8 res0, res1, res2, res3;
+ v8u16 vec4, vec5, vec6, vec7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src4, src5, src6, src7, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec4, vec5, vec6, vec7);
+ SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+ PCKEV_B4_SB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7,
+ res0, res1, res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_put_bilin_4h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_hz_2t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+static void common_hz_2t_8x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 filt0;
+ v16i8 src0, src1, src2, src3, mask;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, src0, src1);
+ ST8x4_UB(src0, src1, dst, dst_stride);
+}
+
+static void common_hz_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ v16u8 filt0;
+ v16i8 src0, src1, src2, src3, mask, out0, out1;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ if (16 == height) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ PCKEV_B2_SB(vec1, vec0, vec3, vec2, out0, out1);
+ ST8x4_UB(out0, out1, dst + 4 * dst_stride, dst_stride);
+ }
+}
+
+void ff_put_bilin_8h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_8x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else {
+ common_hz_2t_8x8mult_msa(src, src_stride, dst, dst_stride, filter,
+ height);
+ }
+}
+
+void ff_put_bilin_16h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 out0, out1, out2, out3, out4, out5, out6, out7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ loop_cnt = (height >> 2) - 1;
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out2, out3, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out4, out5, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out6, out7, dst);
+ dst += dst_stride;
+
+ for (; loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out2, out3, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out4, out5, dst);
+ dst += dst_stride;
+ PCKEV_ST_SB(out6, out7, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_bilin_32h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 out0, out1, out2, out3, out4, out5, out6, out7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ for (loop_cnt = height >> 1; loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+ src4 = LD_SB(src);
+ src6 = LD_SB(src + 16);
+ src7 = LD_SB(src + 24);
+ src5 = __msa_sldi_b(src6, src4, 8);
+ src += src_stride;
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ PCKEV_ST_SB(out2, out3, dst + 16);
+ dst += dst_stride;
+ PCKEV_ST_SB(out4, out5, dst);
+ PCKEV_ST_SB(out6, out7, dst + 16);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_bilin_64h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 out0, out1, out2, out3, out4, out5, out6, out7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ for (loop_cnt = height; loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src4 = LD_SB(src + 32);
+ src6 = LD_SB(src + 48);
+ src7 = LD_SB(src + 56);
+ SLDI_B3_SB(src2, src4, src6, src0, src2, src4, src1, src3, src5, 8);
+ src += src_stride;
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ PCKEV_ST_SB(out0, out1, dst);
+ PCKEV_ST_SB(out2, out3, dst + 16);
+ PCKEV_ST_SB(out4, out5, dst + 32);
+ PCKEV_ST_SB(out6, out7, dst + 48);
+ dst += dst_stride;
+ }
+}
+
+static void common_vt_2t_4x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4;
+ v16i8 src10_r, src32_r, src21_r, src43_r, src2110, src4332;
+ v16u8 filt0;
+ v8i16 filt;
+ v8u16 tmp0, tmp1;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3,
+ src10_r, src21_r, src32_r, src43_r);
+ ILVR_D2_SB(src21_r, src10_r, src43_r, src32_r, src2110, src4332);
+ DOTP_UB2_UH(src2110, src4332, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ src2110 = __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0);
+ ST4x4_UB(src2110, src2110, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_vt_2t_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src21_r, src43_r;
+ v16i8 src65_r, src87_r, src2110, src4332, src6554, src8776;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v16u8 filt0;
+ v8i16 filt;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ src8 = LD_SB(src);
+ src += src_stride;
+
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3, src10_r, src21_r,
+ src32_r, src43_r);
+ ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r, src65_r,
+ src76_r, src87_r);
+ ILVR_D4_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r,
+ src87_r, src76_r, src2110, src4332, src6554, src8776);
+ DOTP_UB4_UH(src2110, src4332, src6554, src8776, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, src2110, src4332);
+ ST4x4_UB(src2110, src2110, 0, 1, 2, 3, dst, dst_stride);
+ ST4x4_UB(src4332, src4332, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride);
+}
+
+void ff_put_bilin_4v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_4x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else if (8 == height) {
+ common_vt_2t_4x8_msa(src, src_stride, dst, dst_stride, filter);
+ }
+}
+
+static void common_vt_2t_8x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 src0, src1, src2, src3, src4, vec0, vec1, vec2, vec3, filt0;
+ v16i8 out0, out1;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_UB5(src, src_stride, src0, src1, src2, src3, src4);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec1);
+ ILVR_B2_UB(src3, src2, src4, src3, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+}
+
+static void common_vt_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter, int32_t height)
+{
+ uint32_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v16i8 out0, out1;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src1, src2, src3, src4, src5, src6, src7, src8);
+ src += (8 * src_stride);
+
+ ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3,
+ vec0, vec1, vec2, vec3);
+ ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7,
+ vec4, vec5, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src8;
+ }
+}
+
+void ff_put_bilin_8v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_8x4_msa(src, src_stride, dst, dst_stride, filter);
+ } else {
+ common_vt_2t_8x8mult_msa(src, src_stride, dst, dst_stride, filter,
+ height);
+ }
+}
+
+void ff_put_bilin_16v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+ dst += dst_stride;
+
+ ILVR_B2_UB(src3, src2, src4, src3, vec4, vec6);
+ ILVL_B2_UB(src3, src2, src4, src3, vec5, vec7);
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst);
+ dst += dst_stride;
+
+ src0 = src4;
+ }
+}
+
+void ff_put_bilin_32v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src5 = LD_UB(src + 16);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+
+ LD_UB4(src + 16, src_stride, src6, src7, src8, src9);
+ src += (4 * src_stride);
+
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + dst_stride);
+
+ ILVR_B2_UB(src3, src2, src4, src3, vec4, vec6);
+ ILVL_B2_UB(src3, src2, src4, src3, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst + 2 * dst_stride);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + 3 * dst_stride);
+
+ ILVR_B2_UB(src6, src5, src7, src6, vec0, vec2);
+ ILVL_B2_UB(src6, src5, src7, src6, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst + 16);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + 16 + dst_stride);
+
+ ILVR_B2_UB(src8, src7, src9, src8, vec4, vec6);
+ ILVL_B2_UB(src8, src7, src9, src8, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst + 16 + 2 * dst_stride);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + 16 + 3 * dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src4;
+ src5 = src9;
+ }
+}
+
+void ff_put_bilin_64v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10;
+ v16u8 src11, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_UB4(src, 16, src0, src3, src6, src9);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src1, src2);
+ LD_UB2(src + 16, src_stride, src4, src5);
+ LD_UB2(src + 32, src_stride, src7, src8);
+ LD_UB2(src + 48, src_stride, src10, src11);
+ src += (2 * src_stride);
+
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + dst_stride);
+
+ ILVR_B2_UB(src4, src3, src5, src4, vec4, vec6);
+ ILVL_B2_UB(src4, src3, src5, src4, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp4, tmp5);
+ SRARI_H2_UH(tmp4, tmp5, 7);
+ SAT_UH2_UH(tmp4, tmp5, 7);
+ PCKEV_ST_SB(tmp4, tmp5, dst + 16);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp6, tmp7);
+ SRARI_H2_UH(tmp6, tmp7, 7);
+ SAT_UH2_UH(tmp6, tmp7, 7);
+ PCKEV_ST_SB(tmp6, tmp7, dst + 16 + dst_stride);
+
+ ILVR_B2_UB(src7, src6, src8, src7, vec0, vec2);
+ ILVL_B2_UB(src7, src6, src8, src7, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_ST_SB(tmp0, tmp1, dst + 32);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_ST_SB(tmp2, tmp3, dst + 32 + dst_stride);
+
+ ILVR_B2_UB(src10, src9, src11, src10, vec4, vec6);
+ ILVL_B2_UB(src10, src9, src11, src10, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp4, tmp5);
+ SRARI_H2_UH(tmp4, tmp5, 7);
+ SAT_UH2_UH(tmp4, tmp5, 7);
+ PCKEV_ST_SB(tmp4, tmp5, dst + 48);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp6, tmp7);
+ SRARI_H2_UH(tmp6, tmp7, 7);
+ SAT_UH2_UH(tmp6, tmp7, 7);
+ PCKEV_ST_SB(tmp6, tmp7, dst + 48 + dst_stride);
+ dst += (2 * dst_stride);
+
+ src0 = src2;
+ src3 = src5;
+ src6 = src8;
+ src9 = src11;
+ }
+}
+
+static void common_hv_2ht_2vt_4x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz, const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask;
+ v16u8 filt_vt, filt_hz, vec0, vec1, res0, res1;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, filt, tmp0, tmp1;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ filt = LD_UH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out1 = (v8u16) __msa_sldi_b((v16i8) hz_out2, (v16i8) hz_out0, 8);
+ hz_out3 = (v8u16) __msa_pckod_d((v2i64) hz_out4, (v2i64) hz_out2);
+
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_B2_UB(tmp0, tmp0, tmp1, tmp1, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_4x8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz, const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, mask;
+ v16i8 res0, res1, res2, res3;
+ v16u8 filt_hz, filt_vt, vec0, vec1, vec2, vec3;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8u16 hz_out7, hz_out8, vec4, vec5, vec6, vec7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ filt = LD_UH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_SB(src);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src5, mask, filt_hz, 7);
+ hz_out6 = HORIZ_2TAP_FILT_UH(src6, src7, mask, filt_hz, 7);
+ hz_out8 = HORIZ_2TAP_FILT_UH(src8, src8, mask, filt_hz, 7);
+ SLDI_B3_UH(hz_out2, hz_out4, hz_out6, hz_out0, hz_out2, hz_out4, hz_out1,
+ hz_out3, hz_out5, 8);
+ hz_out7 = (v8u16) __msa_pckod_d((v2i64) hz_out8, (v2i64) hz_out6);
+
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ ILVEV_B2_UB(hz_out4, hz_out5, hz_out6, hz_out7, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt_vt, filt_vt, filt_vt, filt_vt,
+ vec4, vec5, vec6, vec7);
+ SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+ SAT_UH4_UH(vec4, vec5, vec6, vec7, 7);
+ PCKEV_B4_SB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7,
+ res0, res1, res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_put_bilin_4hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_4x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else if (8 == height) {
+ common_hv_2ht_2vt_4x8_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ }
+}
+
+static void common_hv_2ht_2vt_8x4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz, const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask, out0, out1;
+ v16u8 filt_hz, filt_vt, vec0, vec1, vec2, vec3;
+ v8u16 hz_out0, hz_out1, tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp0 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec1 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp1 = __msa_dotp_u_h(vec1, filt_vt);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec2 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = __msa_dotp_u_h(vec2, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec3 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp3 = __msa_dotp_u_h(vec3, filt_vt);
+
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_SB(tmp1, tmp0, tmp3, tmp2, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_8x8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter_horiz, const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, mask, out0, out1;
+ v16u8 filt_hz, filt_vt, vec0;
+ v8u16 hz_out0, hz_out1, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp1 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp2 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp3 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp4 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp3, tmp4, 7);
+ SAT_UH2_UH(tmp3, tmp4, 7);
+ PCKEV_B2_SB(tmp2, tmp1, tmp4, tmp3, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp5 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp6 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp7 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp8 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H4_UH(tmp5, tmp6, tmp7, tmp8, 7);
+ SAT_UH4_UH(tmp5, tmp6, tmp7, tmp8, 7);
+ PCKEV_B2_SB(tmp6, tmp5, tmp8, tmp7, out0, out1);
+ ST8x4_UB(out0, out1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_put_bilin_8hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_8x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else {
+ common_hv_2ht_2vt_8x8mult_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert, height);
+ }
+}
+
+void ff_put_bilin_16hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt_hz, filt_vt, vec0, vec1;
+ v8u16 tmp1, tmp2, hz_out0, hz_out1, hz_out2, hz_out3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB2(src, 8, src0, src1);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src5, src5, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src6, src6, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src7, src7, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp1, tmp2);
+ SRARI_H2_UH(tmp1, tmp2, 7);
+ SAT_UH2_UH(tmp1, tmp2, 7);
+ PCKEV_ST_SB(tmp1, tmp2, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_put_bilin_32hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_put_bilin_16hv_msa(dst, dst_stride, src, src_stride, height, mx, my);
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+void ff_put_bilin_64hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 4; multiple8_cnt--;) {
+ ff_put_bilin_16hv_msa(dst, dst_stride, src, src_stride, height, mx, my);
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void common_hz_2t_and_aver_dst_4x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3, vec0, vec1, res0, res1;
+ v8u16 vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, vec2, vec3);
+ SRARI_H2_UH(vec2, vec3, 7);
+ PCKEV_B2_UB(vec2, vec2, vec3, vec3, res0, res1);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst2);
+ AVER_UB2_UB(res0, dst0, res1, dst2, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hz_2t_and_aver_dst_4x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, vec0, vec1, vec2, vec3, res0, res1, res2, res3;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v8u16 vec4, vec5, vec6, vec7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ VSHF_B2_UB(src0, src1, src2, src3, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src4, src5, src6, src7, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec4, vec5,
+ vec6, vec7);
+ SRARI_H4_UH(vec4, vec5, vec6, vec7, 7);
+ PCKEV_B4_UB(vec4, vec4, vec5, vec5, vec6, vec6, vec7, vec7, res0, res1,
+ res2, res3);
+ ILVR_W4_UB(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, dst0, dst2,
+ dst4, dst6);
+ AVER_UB4_UB(res0, dst0, res1, dst2, res2, dst4, res3, dst6, res0, res1,
+ res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_avg_bilin_4h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_and_aver_dst_4x4_msa(src, src_stride, dst, dst_stride,
+ filter);
+ } else if (8 == height) {
+ common_hz_2t_and_aver_dst_4x8_msa(src, src_stride, dst, dst_stride,
+ filter);
+ }
+}
+
+static void common_hz_2t_and_aver_dst_8x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ vec0, vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST8x4_UB(vec0, dst0, vec1, dst1, vec2, dst2, vec3, dst3,
+ dst, dst_stride);
+}
+
+static void common_hz_2t_and_aver_dst_8x8mult_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ v16i8 src0, src1, src2, src3, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3;
+ v8u16 vec0, vec1, vec2, vec3, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0, vec1,
+ vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ PCKEV_AVG_ST8x4_UB(vec0, dst0, vec1, dst1, vec2, dst2, vec3, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0, vec1,
+ vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST8x4_UB(vec0, dst0, vec1, dst1, vec2, dst2, vec3, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ if (16 == height) {
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0,
+ vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ PCKEV_AVG_ST8x4_UB(vec0, dst0, vec1, dst1, vec2, dst2, vec3, dst3,
+ dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ VSHF_B2_UH(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UH(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, vec0,
+ vec1, vec2, vec3);
+ SRARI_H4_UH(vec0, vec1, vec2, vec3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST8x4_UB(vec0, dst0, vec1, dst1, vec2, dst2, vec3, dst3,
+ dst, dst_stride);
+ }
+}
+
+void ff_avg_bilin_8h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+
+ if (4 == height) {
+ common_hz_2t_and_aver_dst_8x4_msa(src, src_stride, dst, dst_stride,
+ filter);
+ } else {
+ common_hz_2t_and_aver_dst_8x8mult_msa(src, src_stride, dst, dst_stride,
+ filter, height);
+ }
+}
+
+void ff_avg_bilin_16h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 res0, res1, res2, res3, res4, res5, res6, res7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, res0, res1,
+ res2, res3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0, res4, res5,
+ res6, res7);
+ SRARI_H4_UH(res0, res1, res2, res3, 7);
+ SRARI_H4_UH(res4, res5, res6, res7, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST_UB(res1, res0, dst0, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res3, res2, dst1, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res5, res4, dst2, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res7, res6, dst3, dst);
+ dst += dst_stride;
+
+ for (loop_cnt = (height >> 2) - 1; loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, res0,
+ res1, res2, res3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0, res4,
+ res5, res6, res7);
+ SRARI_H4_UH(res0, res1, res2, res3, 7);
+ SRARI_H4_UH(res4, res5, res6, res7, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST_UB(res1, res0, dst0, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res3, res2, dst1, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res5, res4, dst2, dst);
+ dst += dst_stride;
+ PCKEV_AVG_ST_UB(res7, res6, dst3, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_avg_bilin_32h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 res0, res1, res2, res3, res4, res5, res6, res7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ src0 = LD_SB(src);
+ src2 = LD_SB(src + 16);
+ src3 = LD_SB(src + 24);
+ src1 = __msa_sldi_b(src2, src0, 8);
+ src += src_stride;
+ src4 = LD_SB(src);
+ src6 = LD_SB(src + 16);
+ src7 = LD_SB(src + 24);
+ src5 = __msa_sldi_b(src6, src4, 8);
+ src += src_stride;
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ res0, res1, res2, res3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ res4, res5, res6, res7);
+ SRARI_H4_UH(res0, res1, res2, res3, 7);
+ SRARI_H4_UH(res4, res5, res6, res7, 7);
+ LD_UB2(dst, 16, dst0, dst1);
+ PCKEV_AVG_ST_UB(res1, res0, dst0, dst);
+ PCKEV_AVG_ST_UB(res3, res2, dst1, (dst + 16));
+ dst += dst_stride;
+ LD_UB2(dst, 16, dst2, dst3);
+ PCKEV_AVG_ST_UB(res5, res4, dst2, dst);
+ PCKEV_AVG_ST_UB(res7, res6, dst3, (dst + 16));
+ dst += dst_stride;
+ }
+}
+
+void ff_avg_bilin_64h_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[mx - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt0, dst0, dst1, dst2, dst3;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 out0, out1, out2, out3, out4, out5, out6, out7, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ for (loop_cnt = height; loop_cnt--;) {
+ LD_SB4(src, 16, src0, src2, src4, src6);
+ src7 = LD_SB(src + 56);
+ SLDI_B3_SB(src2, src4, src6, src0, src2, src4, src1, src3, src5, 8);
+ src += src_stride;
+
+ VSHF_B2_UB(src0, src0, src1, src1, mask, mask, vec0, vec1);
+ VSHF_B2_UB(src2, src2, src3, src3, mask, mask, vec2, vec3);
+ VSHF_B2_UB(src4, src4, src5, src5, mask, mask, vec4, vec5);
+ VSHF_B2_UB(src6, src6, src7, src7, mask, mask, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ out0, out1, out2, out3);
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ out4, out5, out6, out7);
+ SRARI_H4_UH(out0, out1, out2, out3, 7);
+ SRARI_H4_UH(out4, out5, out6, out7, 7);
+ LD_UB4(dst, 16, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST_UB(out1, out0, dst0, dst);
+ PCKEV_AVG_ST_UB(out3, out2, dst1, dst + 16);
+ PCKEV_AVG_ST_UB(out5, out4, dst2, dst + 32);
+ PCKEV_AVG_ST_UB(out7, out6, dst3, dst + 48);
+ dst += dst_stride;
+ }
+}
+
+static void common_vt_2t_and_aver_dst_4x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16i8 src0, src1, src2, src3, src4;
+ v16u8 dst0, dst1, dst2, dst3, out, filt0, src2110, src4332;
+ v16i8 src10_r, src32_r, src21_r, src43_r;
+ v8i16 filt;
+ v8u16 tmp0, tmp1;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ src4 = LD_SB(src);
+ src += src_stride;
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst1);
+ dst0 = (v16u8) __msa_ilvr_d((v2i64) dst1, (v2i64) dst0);
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3,
+ src10_r, src21_r, src32_r, src43_r);
+ ILVR_D2_UB(src21_r, src10_r, src43_r, src32_r, src2110, src4332);
+ DOTP_UB2_UH(src2110, src4332, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+
+ out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0);
+ out = __msa_aver_u_b(out, dst0);
+
+ ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
+}
+
+static void common_vt_2t_and_aver_dst_4x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src87_r;
+ v16i8 src10_r, src32_r, src54_r, src76_r, src21_r, src43_r, src65_r;
+ v16u8 src2110, src4332, src6554, src8776, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_SB(src);
+
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ ILVR_W4_UB(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, dst0, dst1,
+ dst2, dst3);
+ ILVR_D2_UB(dst1, dst0, dst3, dst2, dst0, dst1);
+ ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3, src10_r, src21_r,
+ src32_r, src43_r);
+ ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r, src65_r,
+ src76_r, src87_r);
+ ILVR_D4_UB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r,
+ src87_r, src76_r, src2110, src4332, src6554, src8776);
+ DOTP_UB4_UH(src2110, src4332, src6554, src8776, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, src2110, src4332);
+ AVER_UB2_UB(src2110, dst0, src4332, dst1, src2110, src4332);
+ ST4x4_UB(src2110, src2110, 0, 1, 2, 3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(src4332, src4332, 0, 1, 2, 3, dst, dst_stride);
+}
+
+void ff_avg_bilin_4v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_and_aver_dst_4x4_msa(src, src_stride, dst, dst_stride,
+ filter);
+ } else if (8 == height) {
+ common_vt_2t_and_aver_dst_4x8_msa(src, src_stride, dst, dst_stride,
+ filter);
+ }
+}
+
+static void common_vt_2t_and_aver_dst_8x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter)
+{
+ v16u8 src0, src1, src2, src3, src4;
+ v16u8 dst0, dst1, dst2, dst3, vec0, vec1, vec2, vec3, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_UB5(src, src_stride, src0, src1, src2, src3, src4);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec1);
+ ILVR_B2_UB(src3, src2, src4, src3, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_AVG_ST8x4_UB(tmp0, dst0, tmp1, dst1, tmp2, dst2, tmp3, dst3,
+ dst, dst_stride);
+}
+
+static void common_vt_2t_and_aver_dst_8x8mult_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
+ v16u8 dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_SH(filter);
+ filt0 = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src, src_stride, src1, src2, src3, src4, src5, src6, src7, src8);
+ src += (8 * src_stride);
+ LD_UB8(dst, dst_stride, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8);
+
+ ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3,
+ vec0, vec1, vec2, vec3);
+ ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7,
+ vec4, vec5, vec6, vec7);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_AVG_ST8x4_UB(tmp0, dst1, tmp1, dst2, tmp2, dst3, tmp3,
+ dst4, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ DOTP_UB4_UH(vec4, vec5, vec6, vec7, filt0, filt0, filt0, filt0,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_AVG_ST8x4_UB(tmp0, dst5, tmp1, dst6, tmp2, dst7, tmp3,
+ dst8, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src8;
+ }
+}
+
+void ff_avg_bilin_8v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_vt_2t_and_aver_dst_8x4_msa(src, src_stride, dst, dst_stride,
+ filter);
+ } else {
+ common_vt_2t_and_aver_dst_8x8mult_msa(src, src_stride, dst, dst_stride,
+ filter, height);
+ }
+}
+
+void ff_avg_bilin_16v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4, dst0, dst1, dst2, dst3, filt0;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 tmp0, tmp1, tmp2, tmp3, filt;
+
+ /* rearranging filter_y */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ src0 = LD_UB(src);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst0, dst);
+ dst += dst_stride;
+
+ ILVR_B2_UB(src3, src2, src4, src3, vec4, vec6);
+ ILVL_B2_UB(src3, src2, src4, src3, vec5, vec7);
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst1, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst2, dst);
+ dst += dst_stride;
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst3, dst);
+ dst += dst_stride;
+
+ src0 = src4;
+ }
+}
+
+void ff_avg_bilin_32v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, filt0;
+ v8u16 tmp0, tmp1, tmp2, tmp3, filt;
+
+ /* rearranging filter_y */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_UB2(src, 16, src0, src5);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_UB4(src, src_stride, src1, src2, src3, src4);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+
+ LD_UB4(src + 16, src_stride, src6, src7, src8, src9);
+ LD_UB4(dst + 16, dst_stride, dst4, dst5, dst6, dst7);
+ src += (4 * src_stride);
+
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst0, dst);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst1, dst + dst_stride);
+
+ ILVR_B2_UB(src3, src2, src4, src3, vec4, vec6);
+ ILVL_B2_UB(src3, src2, src4, src3, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst2, dst + 2 * dst_stride);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst3, dst + 3 * dst_stride);
+
+ ILVR_B2_UB(src6, src5, src7, src6, vec0, vec2);
+ ILVL_B2_UB(src6, src5, src7, src6, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst4, dst + 16);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst5, dst + 16 + dst_stride);
+
+ ILVR_B2_UB(src8, src7, src9, src8, vec4, vec6);
+ ILVL_B2_UB(src8, src7, src9, src8, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst6, dst + 16 + 2 * dst_stride);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst7, dst + 16 + 3 * dst_stride);
+ dst += (4 * dst_stride);
+
+ src0 = src4;
+ src5 = src9;
+ }
+}
+
+void ff_avg_bilin_64v_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter = vp9_bilinear_filters_msa[my - 1];
+ v16u8 src0, src1, src2, src3, src4, src5;
+ v16u8 src6, src7, src8, src9, src10, src11, filt0;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16u8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
+ v8u16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ v8u16 filt;
+
+ /* rearranging filter_y */
+ filt = LD_UH(filter);
+ filt0 = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_UB4(src, 16, src0, src3, src6, src9);
+ src += src_stride;
+
+ for (loop_cnt = (height >> 1); loop_cnt--;) {
+ LD_UB2(src, src_stride, src1, src2);
+ LD_UB2(dst, dst_stride, dst0, dst1);
+ LD_UB2(src + 16, src_stride, src4, src5);
+ LD_UB2(dst + 16, dst_stride, dst2, dst3);
+ LD_UB2(src + 32, src_stride, src7, src8);
+ LD_UB2(dst + 32, dst_stride, dst4, dst5);
+ LD_UB2(src + 48, src_stride, src10, src11);
+ LD_UB2(dst + 48, dst_stride, dst6, dst7);
+ src += (2 * src_stride);
+
+ ILVR_B2_UB(src1, src0, src2, src1, vec0, vec2);
+ ILVL_B2_UB(src1, src0, src2, src1, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst0, dst);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst1, dst + dst_stride);
+
+ ILVR_B2_UB(src4, src3, src5, src4, vec4, vec6);
+ ILVL_B2_UB(src4, src3, src5, src4, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp4, tmp5);
+ SRARI_H2_UH(tmp4, tmp5, 7);
+ SAT_UH2_UH(tmp4, tmp5, 7);
+ PCKEV_AVG_ST_UB(tmp5, tmp4, dst2, dst + 16);
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp6, tmp7);
+ SRARI_H2_UH(tmp6, tmp7, 7);
+ SAT_UH2_UH(tmp6, tmp7, 7);
+ PCKEV_AVG_ST_UB(tmp7, tmp6, dst3, dst + 16 + dst_stride);
+
+ ILVR_B2_UB(src7, src6, src8, src7, vec0, vec2);
+ ILVL_B2_UB(src7, src6, src8, src7, vec1, vec3);
+ DOTP_UB2_UH(vec0, vec1, filt0, filt0, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst4, dst + 32);
+
+ DOTP_UB2_UH(vec2, vec3, filt0, filt0, tmp2, tmp3);
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ PCKEV_AVG_ST_UB(tmp3, tmp2, dst5, dst + 32 + dst_stride);
+
+ ILVR_B2_UB(src10, src9, src11, src10, vec4, vec6);
+ ILVL_B2_UB(src10, src9, src11, src10, vec5, vec7);
+ DOTP_UB2_UH(vec4, vec5, filt0, filt0, tmp4, tmp5);
+ SRARI_H2_UH(tmp4, tmp5, 7);
+ SAT_UH2_UH(tmp4, tmp5, 7);
+ PCKEV_AVG_ST_UB(tmp5, tmp4, dst6, (dst + 48));
+
+ DOTP_UB2_UH(vec6, vec7, filt0, filt0, tmp6, tmp7);
+ SRARI_H2_UH(tmp6, tmp7, 7);
+ SAT_UH2_UH(tmp6, tmp7, 7);
+ PCKEV_AVG_ST_UB(tmp7, tmp6, dst7, dst + 48 + dst_stride);
+ dst += (2 * dst_stride);
+
+ src0 = src2;
+ src3 = src5;
+ src6 = src8;
+ src9 = src11;
+ }
+}
+
+static void common_hv_2ht_2vt_and_aver_dst_4x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask;
+ v16u8 filt_hz, filt_vt, vec0, vec1;
+ v16u8 dst0, dst1, dst2, dst3, res0, res1;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, tmp0, tmp1, filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_UH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ filt = LD_UH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h((v8i16) filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out1 = (v8u16) __msa_sldi_b((v16i8) hz_out2, (v16i8) hz_out0, 8);
+ hz_out3 = (v8u16) __msa_pckod_d((v2i64) hz_out4, (v2i64) hz_out2);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ ILVR_W2_UB(dst1, dst0, dst3, dst2, dst0, dst2);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_B2_UB(tmp0, tmp0, tmp1, tmp1, res0, res1);
+ AVER_UB2_UB(res0, dst0, res1, dst2, res0, res1);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_and_aver_dst_4x8_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, mask;
+ v16u8 filt_hz, filt_vt, vec0, vec1, vec2, vec3, res0, res1, res2, res3;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, hz_out4, hz_out5, hz_out6;
+ v8u16 hz_out7, hz_out8, tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[16]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ src8 = LD_SB(src);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src1, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src2, src3, mask, filt_hz, 7);
+ hz_out4 = HORIZ_2TAP_FILT_UH(src4, src5, mask, filt_hz, 7);
+ hz_out6 = HORIZ_2TAP_FILT_UH(src6, src7, mask, filt_hz, 7);
+ hz_out8 = HORIZ_2TAP_FILT_UH(src8, src8, mask, filt_hz, 7);
+ SLDI_B3_UH(hz_out2, hz_out4, hz_out6, hz_out0, hz_out2, hz_out4, hz_out1,
+ hz_out3, hz_out5, 8);
+ hz_out7 = (v8u16) __msa_pckod_d((v2i64) hz_out8, (v2i64) hz_out6);
+
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+ ILVR_W4_UB(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, dst0, dst2,
+ dst4, dst6);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ ILVEV_B2_UB(hz_out4, hz_out5, hz_out6, hz_out7, vec2, vec3);
+ DOTP_UB4_UH(vec0, vec1, vec2, vec3, filt_vt, filt_vt, filt_vt, filt_vt,
+ tmp0, tmp1, tmp2, tmp3);
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_B4_UB(tmp0, tmp0, tmp1, tmp1, tmp2, tmp2, tmp3, tmp3, res0, res1,
+ res2, res3);
+ AVER_UB4_UB(res0, dst0, res1, dst2, res2, dst4, res3, dst6, res0, res1,
+ res2, res3);
+ ST4x4_UB(res0, res1, 0, 1, 0, 1, dst, dst_stride);
+ dst += (4 * dst_stride);
+ ST4x4_UB(res2, res3, 0, 1, 0, 1, dst, dst_stride);
+}
+
+void ff_avg_bilin_4hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_and_aver_dst_4x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else if (8 == height) {
+ common_hv_2ht_2vt_and_aver_dst_4x8_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ }
+}
+
+static void common_hv_2ht_2vt_and_aver_dst_8x4_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert)
+{
+ v16i8 src0, src1, src2, src3, src4, mask;
+ v16u8 filt_hz, filt_vt, dst0, dst1, dst2, dst3, vec0, vec1, vec2, vec3;
+ v8u16 hz_out0, hz_out1, tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB5(src, src_stride, src0, src1, src2, src3, src4);
+ src += (5 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp0 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec1 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp1 = __msa_dotp_u_h(vec1, filt_vt);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec2 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = __msa_dotp_u_h(vec2, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec3 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp3 = __msa_dotp_u_h(vec3, filt_vt);
+
+ SRARI_H4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ SAT_UH4_UH(tmp0, tmp1, tmp2, tmp3, 7);
+ PCKEV_AVG_ST8x4_UB(tmp0, dst0, tmp1, dst1, tmp2, dst2, tmp3, dst3,
+ dst, dst_stride);
+}
+
+static void common_hv_2ht_2vt_and_aver_dst_8x8mult_msa(const uint8_t *src,
+ int32_t src_stride,
+ uint8_t *dst,
+ int32_t dst_stride,
+ const int8_t *filter_horiz,
+ const int8_t *filter_vert,
+ int32_t height)
+{
+ uint32_t loop_cnt;
+ v16i8 src0, src1, src2, src3, src4, mask;
+ v16u8 filt_hz, filt_vt, vec0, dst0, dst1, dst2, dst3;
+ v8u16 hz_out0, hz_out1, tmp0, tmp1, tmp2, tmp3;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ src0 = LD_SB(src);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src1, src2, src3, src4);
+ src += (4 * src_stride);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp0 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp1 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out1, (v16i8) hz_out0);
+ tmp2 = __msa_dotp_u_h(vec0, filt_vt);
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ vec0 = (v16u8) __msa_ilvev_b((v16i8) hz_out0, (v16i8) hz_out1);
+ tmp3 = __msa_dotp_u_h(vec0, filt_vt);
+
+ SRARI_H2_UH(tmp2, tmp3, 7);
+ SAT_UH2_UH(tmp2, tmp3, 7);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+ PCKEV_AVG_ST8x4_UB(tmp0, dst0, tmp1, dst1, tmp2, dst2, tmp3,
+ dst3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+void ff_avg_bilin_8hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+
+ if (4 == height) {
+ common_hv_2ht_2vt_and_aver_dst_8x4_msa(src, src_stride, dst, dst_stride,
+ filter_horiz, filter_vert);
+ } else {
+ common_hv_2ht_2vt_and_aver_dst_8x8mult_msa(src, src_stride,
+ dst, dst_stride,
+ filter_horiz, filter_vert,
+ height);
+ }
+}
+
+void ff_avg_bilin_16hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ uint32_t loop_cnt;
+ const int8_t *filter_horiz = vp9_bilinear_filters_msa[mx - 1];
+ const int8_t *filter_vert = vp9_bilinear_filters_msa[my - 1];
+ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask;
+ v16u8 filt_hz, filt_vt, vec0, vec1, dst0, dst1, dst2, dst3;
+ v8u16 hz_out0, hz_out1, hz_out2, hz_out3, tmp0, tmp1;
+ v8i16 filt;
+
+ mask = LD_SB(&mc_filt_mask_arr[0]);
+
+ /* rearranging filter */
+ filt = LD_SH(filter_horiz);
+ filt_hz = (v16u8) __msa_splati_h(filt, 0);
+
+ filt = LD_SH(filter_vert);
+ filt_vt = (v16u8) __msa_splati_h(filt, 0);
+
+ LD_SB2(src, 8, src0, src1);
+ src += src_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+
+ for (loop_cnt = (height >> 2); loop_cnt--;) {
+ LD_SB4(src, src_stride, src0, src2, src4, src6);
+ LD_SB4(src + 8, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src0, src0, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src1, src1, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst0, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src2, src2, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src3, src3, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst1, dst);
+ dst += dst_stride;
+
+ hz_out1 = HORIZ_2TAP_FILT_UH(src4, src4, mask, filt_hz, 7);
+ hz_out3 = HORIZ_2TAP_FILT_UH(src5, src5, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out0, hz_out1, hz_out2, hz_out3, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst2, dst);
+ dst += dst_stride;
+
+ hz_out0 = HORIZ_2TAP_FILT_UH(src6, src6, mask, filt_hz, 7);
+ hz_out2 = HORIZ_2TAP_FILT_UH(src7, src7, mask, filt_hz, 7);
+ ILVEV_B2_UB(hz_out1, hz_out0, hz_out3, hz_out2, vec0, vec1);
+ DOTP_UB2_UH(vec0, vec1, filt_vt, filt_vt, tmp0, tmp1);
+ SRARI_H2_UH(tmp0, tmp1, 7);
+ SAT_UH2_UH(tmp0, tmp1, 7);
+ PCKEV_AVG_ST_UB(tmp1, tmp0, dst3, dst);
+ dst += dst_stride;
+ }
+}
+
+void ff_avg_bilin_32hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 2; multiple8_cnt--;) {
+ ff_avg_bilin_16hv_msa(dst, dst_stride, src, src_stride, height, mx, my);
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+void ff_avg_bilin_64hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ int height, int mx, int my)
+{
+ int32_t multiple8_cnt;
+
+ for (multiple8_cnt = 4; multiple8_cnt--;) {
+ ff_avg_bilin_16hv_msa(dst, dst_stride, src, src_stride, height, mx, my);
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void copy_width8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3, out4, out5, out6, out7;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+ out4 = __msa_copy_u_d((v2i64) src4, 0);
+ out5 = __msa_copy_u_d((v2i64) src5, 0);
+ out6 = __msa_copy_u_d((v2i64) src6, 0);
+ out7 = __msa_copy_u_d((v2i64) src7, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(out4, out5, out6, out7, dst, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ for (cnt = height >> 3; cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+ out4 = __msa_copy_u_d((v2i64) src4, 0);
+ out5 = __msa_copy_u_d((v2i64) src5, 0);
+ out6 = __msa_copy_u_d((v2i64) src6, 0);
+ out7 = __msa_copy_u_d((v2i64) src7, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ SD4(out4, out5, out6, out7, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 4) {
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+ out2 = __msa_copy_u_d((v2i64) src2, 0);
+ out3 = __msa_copy_u_d((v2i64) src3, 0);
+
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 2) {
+ for (cnt = (height / 2); cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+ out0 = __msa_copy_u_d((v2i64) src0, 0);
+ out1 = __msa_copy_u_d((v2i64) src1, 0);
+
+ SD(out0, dst);
+ dst += dst_stride;
+ SD(out1, dst);
+ dst += dst_stride;
+ }
+ }
+}
+
+static void copy_16multx8mult_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height, int32_t width)
+{
+ int32_t cnt, loop_cnt;
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ for (cnt = (width >> 4); cnt--;) {
+ src_tmp = src;
+ dst_tmp = dst;
+
+ for (loop_cnt = (height >> 3); loop_cnt--;) {
+ LD_UB8(src_tmp, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src_tmp += (8 * src_stride);
+
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst_tmp, dst_stride);
+ dst_tmp += (8 * dst_stride);
+ }
+
+ src += 16;
+ dst += 16;
+ }
+}
+
+static void copy_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB8(src, src_stride,
+ src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7,
+ dst, dst_stride);
+ dst += (8 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 16);
+ } else if (0 == height % 4) {
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
+
+static void copy_width32_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+
+ if (0 == height % 12) {
+ for (cnt = (height / 12); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4(src + 16, src_stride, src4, src5, src6, src7);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ ST_UB4(src4, src5, src6, src7, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4(src + 16, src_stride, src4, src5, src6, src7);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ ST_UB4(src4, src5, src6, src7, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4(src + 16, src_stride, src4, src5, src6, src7);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ ST_UB4(src4, src5, src6, src7, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == height % 8) {
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 32);
+ } else if (0 == height % 4) {
+ for (cnt = (height >> 2); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ LD_UB4(src + 16, src_stride, src4, src5, src6, src7);
+ src += (4 * src_stride);
+ ST_UB4(src0, src1, src2, src3, dst, dst_stride);
+ ST_UB4(src4, src5, src6, src7, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ }
+}
+
+static void copy_width64_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ copy_16multx8mult_msa(src, src_stride, dst, dst_stride, height, 64);
+}
+
+static void avg_width4_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint32_t out0, out1, out2, out3;
+ v16u8 src0, src1, src2, src3;
+ v16u8 dst0, dst1, dst2, dst3;
+
+ if (0 == (height % 4)) {
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+
+ out0 = __msa_copy_u_w((v4i32) dst0, 0);
+ out1 = __msa_copy_u_w((v4i32) dst1, 0);
+ out2 = __msa_copy_u_w((v4i32) dst2, 0);
+ out3 = __msa_copy_u_w((v4i32) dst3, 0);
+ SW4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+ } else if (0 == (height % 2)) {
+ for (cnt = (height / 2); cnt--;) {
+ LD_UB2(src, src_stride, src0, src1);
+ src += (2 * src_stride);
+
+ LD_UB2(dst, dst_stride, dst0, dst1);
+
+ AVER_UB2_UB(src0, dst0, src1, dst1, dst0, dst1);
+
+ out0 = __msa_copy_u_w((v4i32) dst0, 0);
+ out1 = __msa_copy_u_w((v4i32) dst1, 0);
+ SW(out0, dst);
+ dst += dst_stride;
+ SW(out1, dst);
+ dst += dst_stride;
+ }
+ }
+}
+
+static void avg_width8_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint64_t out0, out1, out2, out3;
+ v16u8 src0, src1, src2, src3;
+ v16u8 dst0, dst1, dst2, dst3;
+
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, src_stride, src0, src1, src2, src3);
+ src += (4 * src_stride);
+ LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+
+ out0 = __msa_copy_u_d((v2i64) dst0, 0);
+ out1 = __msa_copy_u_d((v2i64) dst1, 0);
+ out2 = __msa_copy_u_d((v2i64) dst2, 0);
+ out3 = __msa_copy_u_d((v2i64) dst3, 0);
+ SD4(out0, out1, out2, out3, dst, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void avg_width16_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+
+ for (cnt = (height / 8); cnt--;) {
+ LD_UB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7);
+ src += (8 * src_stride);
+ LD_UB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+ AVER_UB4_UB(src4, dst4, src5, dst5, src6, dst6, src7, dst7,
+ dst4, dst5, dst6, dst7);
+ ST_UB8(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst, dst_stride);
+ dst += (8 * dst_stride);
+ }
+}
+
+static void avg_width32_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint8_t *dst_dup = dst;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16u8 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15;
+
+ for (cnt = (height / 8); cnt--;) {
+ LD_UB4(src, src_stride, src0, src2, src4, src6);
+ LD_UB4(src + 16, src_stride, src1, src3, src5, src7);
+ src += (4 * src_stride);
+ LD_UB4(dst_dup, dst_stride, dst0, dst2, dst4, dst6);
+ LD_UB4(dst_dup + 16, dst_stride, dst1, dst3, dst5, dst7);
+ dst_dup += (4 * dst_stride);
+ LD_UB4(src, src_stride, src8, src10, src12, src14);
+ LD_UB4(src + 16, src_stride, src9, src11, src13, src15);
+ src += (4 * src_stride);
+ LD_UB4(dst_dup, dst_stride, dst8, dst10, dst12, dst14);
+ LD_UB4(dst_dup + 16, dst_stride, dst9, dst11, dst13, dst15);
+ dst_dup += (4 * dst_stride);
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+ AVER_UB4_UB(src4, dst4, src5, dst5, src6, dst6, src7, dst7,
+ dst4, dst5, dst6, dst7);
+ AVER_UB4_UB(src8, dst8, src9, dst9, src10, dst10, src11, dst11,
+ dst8, dst9, dst10, dst11);
+ AVER_UB4_UB(src12, dst12, src13, dst13, src14, dst14, src15, dst15,
+ dst12, dst13, dst14, dst15);
+
+ ST_UB4(dst0, dst2, dst4, dst6, dst, dst_stride);
+ ST_UB4(dst1, dst3, dst5, dst7, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+ ST_UB4(dst8, dst10, dst12, dst14, dst, dst_stride);
+ ST_UB4(dst9, dst11, dst13, dst15, dst + 16, dst_stride);
+ dst += (4 * dst_stride);
+ }
+}
+
+static void avg_width64_msa(const uint8_t *src, int32_t src_stride,
+ uint8_t *dst, int32_t dst_stride,
+ int32_t height)
+{
+ int32_t cnt;
+ uint8_t *dst_dup = dst;
+ v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
+ v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
+ v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
+ v16u8 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15;
+
+ for (cnt = (height / 4); cnt--;) {
+ LD_UB4(src, 16, src0, src1, src2, src3);
+ src += src_stride;
+ LD_UB4(src, 16, src4, src5, src6, src7);
+ src += src_stride;
+ LD_UB4(src, 16, src8, src9, src10, src11);
+ src += src_stride;
+ LD_UB4(src, 16, src12, src13, src14, src15);
+ src += src_stride;
+
+ LD_UB4(dst_dup, 16, dst0, dst1, dst2, dst3);
+ dst_dup += dst_stride;
+ LD_UB4(dst_dup, 16, dst4, dst5, dst6, dst7);
+ dst_dup += dst_stride;
+ LD_UB4(dst_dup, 16, dst8, dst9, dst10, dst11);
+ dst_dup += dst_stride;
+ LD_UB4(dst_dup, 16, dst12, dst13, dst14, dst15);
+ dst_dup += dst_stride;
+
+ AVER_UB4_UB(src0, dst0, src1, dst1, src2, dst2, src3, dst3,
+ dst0, dst1, dst2, dst3);
+ AVER_UB4_UB(src4, dst4, src5, dst5, src6, dst6, src7, dst7,
+ dst4, dst5, dst6, dst7);
+ AVER_UB4_UB(src8, dst8, src9, dst9, src10, dst10, src11, dst11,
+ dst8, dst9, dst10, dst11);
+ AVER_UB4_UB(src12, dst12, src13, dst13, src14, dst14, src15, dst15,
+ dst12, dst13, dst14, dst15);
+
+ ST_UB4(dst0, dst1, dst2, dst3, dst, 16);
+ dst += dst_stride;
+ ST_UB4(dst4, dst5, dst6, dst7, dst, 16);
+ dst += dst_stride;
+ ST_UB4(dst8, dst9, dst10, dst11, dst, 16);
+ dst += dst_stride;
+ ST_UB4(dst12, dst13, dst14, dst15, dst, 16);
+ dst += dst_stride;
+ }
+}
+
+static const int8_t vp9_subpel_filters_msa[3][15][8] = {
+ [FILTER_8TAP_REGULAR] = {
+ {0, 1, -5, 126, 8, -3, 1, 0},
+ {-1, 3, -10, 122, 18, -6, 2, 0},
+ {-1, 4, -13, 118, 27, -9, 3, -1},
+ {-1, 4, -16, 112, 37, -11, 4, -1},
+ {-1, 5, -18, 105, 48, -14, 4, -1},
+ {-1, 5, -19, 97, 58, -16, 5, -1},
+ {-1, 6, -19, 88, 68, -18, 5, -1},
+ {-1, 6, -19, 78, 78, -19, 6, -1},
+ {-1, 5, -18, 68, 88, -19, 6, -1},
+ {-1, 5, -16, 58, 97, -19, 5, -1},
+ {-1, 4, -14, 48, 105, -18, 5, -1},
+ {-1, 4, -11, 37, 112, -16, 4, -1},
+ {-1, 3, -9, 27, 118, -13, 4, -1},
+ {0, 2, -6, 18, 122, -10, 3, -1},
+ {0, 1, -3, 8, 126, -5, 1, 0},
+ }, [FILTER_8TAP_SHARP] = {
+ {-1, 3, -7, 127, 8, -3, 1, 0},
+ {-2, 5, -13, 125, 17, -6, 3, -1},
+ {-3, 7, -17, 121, 27, -10, 5, -2},
+ {-4, 9, -20, 115, 37, -13, 6, -2},
+ {-4, 10, -23, 108, 48, -16, 8, -3},
+ {-4, 10, -24, 100, 59, -19, 9, -3},
+ {-4, 11, -24, 90, 70, -21, 10, -4},
+ {-4, 11, -23, 80, 80, -23, 11, -4},
+ {-4, 10, -21, 70, 90, -24, 11, -4},
+ {-3, 9, -19, 59, 100, -24, 10, -4},
+ {-3, 8, -16, 48, 108, -23, 10, -4},
+ {-2, 6, -13, 37, 115, -20, 9, -4},
+ {-2, 5, -10, 27, 121, -17, 7, -3},
+ {-1, 3, -6, 17, 125, -13, 5, -2},
+ {0, 1, -3, 8, 127, -7, 3, -1},
+ }, [FILTER_8TAP_SMOOTH] = {
+ {-3, -1, 32, 64, 38, 1, -3, 0},
+ {-2, -2, 29, 63, 41, 2, -3, 0},
+ {-2, -2, 26, 63, 43, 4, -4, 0},
+ {-2, -3, 24, 62, 46, 5, -4, 0},
+ {-2, -3, 21, 60, 49, 7, -4, 0},
+ {-1, -4, 18, 59, 51, 9, -4, 0},
+ {-1, -4, 16, 57, 53, 12, -4, -1},
+ {-1, -4, 14, 55, 55, 14, -4, -1},
+ {-1, -4, 12, 53, 57, 16, -4, -1},
+ {0, -4, 9, 51, 59, 18, -4, -1},
+ {0, -4, 7, 49, 60, 21, -3, -2},
+ {0, -4, 5, 46, 62, 24, -3, -2},
+ {0, -4, 4, 43, 63, 26, -2, -2},
+ {0, -3, 2, 41, 63, 29, -2, -2},
+ {0, -3, 1, 38, 64, 32, -1, -3},
+ }
+};
+
+#define VP9_8TAP_MIPS_MSA_FUNC(SIZE, type, type_idx) \
+void ff_put_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const int8_t *filter = vp9_subpel_filters_msa[type_idx][mx-1]; \
+ \
+ common_hz_8t_##SIZE##w_msa(src, srcstride, dst, dststride, filter, h); \
+} \
+ \
+void ff_put_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const int8_t *filter = vp9_subpel_filters_msa[type_idx][my-1]; \
+ \
+ common_vt_8t_##SIZE##w_msa(src, srcstride, dst, dststride, filter, h); \
+} \
+ \
+void ff_put_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const uint8_t *hfilter = vp9_subpel_filters_msa[type_idx][mx-1]; \
+ const uint8_t *vfilter = vp9_subpel_filters_msa[type_idx][my-1]; \
+ \
+ common_hv_8ht_8vt_##SIZE##w_msa(src, srcstride, dst, dststride, hfilter, \
+ vfilter, h); \
+} \
+ \
+void ff_avg_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const int8_t *filter = vp9_subpel_filters_msa[type_idx][mx-1]; \
+ \
+ common_hz_8t_and_aver_dst_##SIZE##w_msa(src, srcstride, dst, \
+ dststride, filter, h); \
+} \
+ \
+void ff_avg_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const int8_t *filter = vp9_subpel_filters_msa[type_idx][my-1]; \
+ \
+ common_vt_8t_and_aver_dst_##SIZE##w_msa(src, srcstride, dst, dststride, \
+ filter, h); \
+} \
+ \
+void ff_avg_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ const uint8_t *hfilter = vp9_subpel_filters_msa[type_idx][mx-1]; \
+ const uint8_t *vfilter = vp9_subpel_filters_msa[type_idx][my-1]; \
+ \
+ common_hv_8ht_8vt_and_aver_dst_##SIZE##w_msa(src, srcstride, dst, \
+ dststride, hfilter, \
+ vfilter, h); \
+}
+
+#define VP9_COPY_AVG_MIPS_MSA_FUNC(SIZE) \
+void ff_copy##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ \
+ copy_width##SIZE##_msa(src, srcstride, dst, dststride, h); \
+} \
+ \
+void ff_avg##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ \
+ avg_width##SIZE##_msa(src, srcstride, dst, dststride, h); \
+}
+
+#define VP9_AVG_MIPS_MSA_FUNC(SIZE) \
+void ff_avg##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my) \
+{ \
+ \
+ avg_width##SIZE##_msa(src, srcstride, dst, dststride, h); \
+}
+
+VP9_8TAP_MIPS_MSA_FUNC(64, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(32, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(16, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(8, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(4, regular, FILTER_8TAP_REGULAR);
+
+VP9_8TAP_MIPS_MSA_FUNC(64, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(32, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(16, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(8, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(4, sharp, FILTER_8TAP_SHARP);
+
+VP9_8TAP_MIPS_MSA_FUNC(64, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(32, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(16, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(8, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(4, smooth, FILTER_8TAP_SMOOTH);
+
+VP9_COPY_AVG_MIPS_MSA_FUNC(64);
+VP9_COPY_AVG_MIPS_MSA_FUNC(32);
+VP9_COPY_AVG_MIPS_MSA_FUNC(16);
+VP9_COPY_AVG_MIPS_MSA_FUNC(8);
+VP9_AVG_MIPS_MSA_FUNC(4);
+
+#undef VP9_8TAP_MIPS_MSA_FUNC
+#undef VP9_COPY_AVG_MIPS_MSA_FUNC
+#undef VP9_AVG_MIPS_MSA_FUNC
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_init_mips.c
new file mode 100644
index 00000000000..c8a48908af3
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_init_mips.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/common.h"
+#include "libavcodec/vp9dsp.h"
+#include "vp9dsp_mips.h"
+
+#if HAVE_MSA
+static av_cold void vp9dsp_intrapred_init_msa(VP9DSPContext *dsp, int bpp)
+{
+ if (bpp == 8) {
+#define init_intra_pred_msa(tx, sz) \
+ dsp->intra_pred[tx][VERT_PRED] = ff_vert_##sz##_msa; \
+ dsp->intra_pred[tx][HOR_PRED] = ff_hor_##sz##_msa; \
+ dsp->intra_pred[tx][DC_PRED] = ff_dc_##sz##_msa; \
+ dsp->intra_pred[tx][LEFT_DC_PRED] = ff_dc_left_##sz##_msa; \
+ dsp->intra_pred[tx][TOP_DC_PRED] = ff_dc_top_##sz##_msa; \
+ dsp->intra_pred[tx][DC_128_PRED] = ff_dc_128_##sz##_msa; \
+ dsp->intra_pred[tx][DC_127_PRED] = ff_dc_127_##sz##_msa; \
+ dsp->intra_pred[tx][DC_129_PRED] = ff_dc_129_##sz##_msa; \
+ dsp->intra_pred[tx][TM_VP8_PRED] = ff_tm_##sz##_msa; \
+
+ init_intra_pred_msa(TX_16X16, 16x16);
+ init_intra_pred_msa(TX_32X32, 32x32);
+#undef init_intra_pred_msa
+
+#define init_intra_pred_msa(tx, sz) \
+ dsp->intra_pred[tx][DC_PRED] = ff_dc_##sz##_msa; \
+ dsp->intra_pred[tx][LEFT_DC_PRED] = ff_dc_left_##sz##_msa; \
+ dsp->intra_pred[tx][TOP_DC_PRED] = ff_dc_top_##sz##_msa; \
+ dsp->intra_pred[tx][TM_VP8_PRED] = ff_tm_##sz##_msa; \
+
+ init_intra_pred_msa(TX_4X4, 4x4);
+ init_intra_pred_msa(TX_8X8, 8x8);
+#undef init_intra_pred_msa
+ }
+}
+
+static av_cold void vp9dsp_itxfm_init_msa(VP9DSPContext *dsp, int bpp)
+{
+ if (bpp == 8) {
+#define init_itxfm(tx, sz) \
+ dsp->itxfm_add[tx][DCT_DCT] = ff_idct_idct_##sz##_add_msa; \
+ dsp->itxfm_add[tx][DCT_ADST] = ff_iadst_idct_##sz##_add_msa; \
+ dsp->itxfm_add[tx][ADST_DCT] = ff_idct_iadst_##sz##_add_msa; \
+ dsp->itxfm_add[tx][ADST_ADST] = ff_iadst_iadst_##sz##_add_msa \
+
+#define init_idct(tx, nm) \
+ dsp->itxfm_add[tx][DCT_DCT] = \
+ dsp->itxfm_add[tx][ADST_DCT] = \
+ dsp->itxfm_add[tx][DCT_ADST] = \
+ dsp->itxfm_add[tx][ADST_ADST] = nm##_add_msa
+
+ init_itxfm(TX_4X4, 4x4);
+ init_itxfm(TX_8X8, 8x8);
+ init_itxfm(TX_16X16, 16x16);
+ init_idct(TX_32X32, ff_idct_idct_32x32);
+#undef init_itxfm
+#undef init_idct
+ }
+}
+
+static av_cold void vp9dsp_mc_init_msa(VP9DSPContext *dsp, int bpp)
+{
+ if (bpp == 8) {
+#define init_fpel(idx1, idx2, sz, type) \
+ dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = ff_##type##sz##_msa; \
+ dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = ff_##type##sz##_msa; \
+ dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = ff_##type##sz##_msa; \
+ dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_##type##sz##_msa
+
+#define init_copy_avg(idx, sz) \
+ init_fpel(idx, 0, sz, copy); \
+ init_fpel(idx, 1, sz, avg)
+
+#define init_avg(idx, sz) \
+ init_fpel(idx, 1, sz, avg)
+
+ init_copy_avg(0, 64);
+ init_copy_avg(1, 32);
+ init_copy_avg(2, 16);
+ init_copy_avg(3, 8);
+ init_avg(4, 4);
+
+#undef init_copy_avg
+#undef init_avg
+#undef init_fpel
+
+#define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type) \
+ dsp->mc[idx1][FILTER_BILINEAR ][idx2][idxh][idxv] = \
+ ff_##type##_bilin_##sz##dir##_msa; \
+ dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][idxh][idxv] = \
+ ff_##type##_8tap_smooth_##sz##dir##_msa; \
+ dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][idxh][idxv] = \
+ ff_##type##_8tap_regular_##sz##dir##_msa; \
+ dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][idxh][idxv] = \
+ ff_##type##_8tap_sharp_##sz##dir##_msa;
+
+#define init_subpel2(idx, idxh, idxv, dir, type) \
+ init_subpel1(0, idx, idxh, idxv, 64, dir, type); \
+ init_subpel1(1, idx, idxh, idxv, 32, dir, type); \
+ init_subpel1(2, idx, idxh, idxv, 16, dir, type); \
+ init_subpel1(3, idx, idxh, idxv, 8, dir, type); \
+ init_subpel1(4, idx, idxh, idxv, 4, dir, type)
+
+#define init_subpel3(idx, type) \
+ init_subpel2(idx, 1, 1, hv, type); \
+ init_subpel2(idx, 0, 1, v, type); \
+ init_subpel2(idx, 1, 0, h, type)
+
+ init_subpel3(0, put);
+ init_subpel3(1, avg);
+
+#undef init_subpel1
+#undef init_subpel2
+#undef init_subpel3
+ }
+}
+
+static av_cold void vp9dsp_loopfilter_init_msa(VP9DSPContext *dsp, int bpp)
+{
+ if (bpp == 8) {
+ dsp->loop_filter_8[0][0] = ff_loop_filter_h_4_8_msa;
+ dsp->loop_filter_8[0][1] = ff_loop_filter_v_4_8_msa;
+ dsp->loop_filter_8[1][0] = ff_loop_filter_h_8_8_msa;
+ dsp->loop_filter_8[1][1] = ff_loop_filter_v_8_8_msa;
+ dsp->loop_filter_8[2][0] = ff_loop_filter_h_16_8_msa;
+ dsp->loop_filter_8[2][1] = ff_loop_filter_v_16_8_msa;
+
+ dsp->loop_filter_16[0] = ff_loop_filter_h_16_16_msa;
+ dsp->loop_filter_16[1] = ff_loop_filter_v_16_16_msa;
+
+ dsp->loop_filter_mix2[0][0][0] = ff_loop_filter_h_44_16_msa;
+ dsp->loop_filter_mix2[0][0][1] = ff_loop_filter_v_44_16_msa;
+ dsp->loop_filter_mix2[0][1][0] = ff_loop_filter_h_48_16_msa;
+ dsp->loop_filter_mix2[0][1][1] = ff_loop_filter_v_48_16_msa;
+ dsp->loop_filter_mix2[1][0][0] = ff_loop_filter_h_84_16_msa;
+ dsp->loop_filter_mix2[1][0][1] = ff_loop_filter_v_84_16_msa;
+ dsp->loop_filter_mix2[1][1][0] = ff_loop_filter_h_88_16_msa;
+ dsp->loop_filter_mix2[1][1][1] = ff_loop_filter_v_88_16_msa;
+ }
+}
+
+static av_cold void vp9dsp_init_msa(VP9DSPContext *dsp, int bpp)
+{
+ vp9dsp_intrapred_init_msa(dsp, bpp);
+ vp9dsp_itxfm_init_msa(dsp, bpp);
+ vp9dsp_mc_init_msa(dsp, bpp);
+ vp9dsp_loopfilter_init_msa(dsp, bpp);
+}
+#endif // #if HAVE_MSA
+
+av_cold void ff_vp9dsp_init_mips(VP9DSPContext *dsp, int bpp)
+{
+#if HAVE_MSA
+ vp9dsp_init_msa(dsp, bpp);
+#endif // #if HAVE_MSA
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_mips.h
new file mode 100644
index 00000000000..4d7303888d0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/vp9dsp_mips.h
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_VP9DSP_MIPS_H
+#define AVCODEC_MIPS_VP9DSP_MIPS_H
+
+#define VP9_8TAP_MIPS_MSA_FUNC(SIZE, type, type_idx) \
+void ff_put_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_put_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_put_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_8tap_##type##_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_8tap_##type##_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, \
+ ptrdiff_t srcstride, \
+ int h, int mx, int my);
+
+#define VP9_BILINEAR_MIPS_MSA_FUNC(SIZE) \
+void ff_put_bilin_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_put_bilin_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_put_bilin_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_bilin_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_bilin_##SIZE##v_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg_bilin_##SIZE##hv_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my);
+
+#define VP9_COPY_AVG_MIPS_MSA_FUNC(SIZE) \
+void ff_copy##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my); \
+ \
+void ff_avg##SIZE##_msa(uint8_t *dst, ptrdiff_t dststride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
+ int h, int mx, int my);
+
+VP9_8TAP_MIPS_MSA_FUNC(64, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(32, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(16, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(8, regular, FILTER_8TAP_REGULAR);
+VP9_8TAP_MIPS_MSA_FUNC(4, regular, FILTER_8TAP_REGULAR);
+
+VP9_8TAP_MIPS_MSA_FUNC(64, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(32, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(16, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(8, sharp, FILTER_8TAP_SHARP);
+VP9_8TAP_MIPS_MSA_FUNC(4, sharp, FILTER_8TAP_SHARP);
+
+VP9_8TAP_MIPS_MSA_FUNC(64, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(32, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(16, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(8, smooth, FILTER_8TAP_SMOOTH);
+VP9_8TAP_MIPS_MSA_FUNC(4, smooth, FILTER_8TAP_SMOOTH);
+
+VP9_BILINEAR_MIPS_MSA_FUNC(64);
+VP9_BILINEAR_MIPS_MSA_FUNC(32);
+VP9_BILINEAR_MIPS_MSA_FUNC(16);
+VP9_BILINEAR_MIPS_MSA_FUNC(8);
+VP9_BILINEAR_MIPS_MSA_FUNC(4);
+
+VP9_COPY_AVG_MIPS_MSA_FUNC(64);
+VP9_COPY_AVG_MIPS_MSA_FUNC(32);
+VP9_COPY_AVG_MIPS_MSA_FUNC(16);
+VP9_COPY_AVG_MIPS_MSA_FUNC(8);
+VP9_COPY_AVG_MIPS_MSA_FUNC(4);
+
+#undef VP9_8TAP_MIPS_MSA_FUNC
+#undef VP9_BILINEAR_MIPS_MSA_FUNC
+#undef VP9_COPY_AVG_MIPS_MSA_FUNC
+
+void ff_loop_filter_h_4_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_8_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_16_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_4_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_8_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_16_8_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_44_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_88_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_16_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_44_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_88_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_16_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_48_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_h_84_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_48_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_loop_filter_v_84_16_msa(uint8_t *dst, ptrdiff_t stride, int32_t e,
+ int32_t i, int32_t h);
+void ff_idct_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_idct_32x32_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iadst_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_iadst_4x4_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_iadst_8x8_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_idct_iadst_16x16_add_msa(uint8_t *pu8Dest, ptrdiff_t stride,
+ int16_t *block, int eob);
+void ff_iwht_iwht_4x4_add_msa(uint8_t *dst, ptrdiff_t stride,
+ int16_t *block, int eob);
+
+void ff_vert_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_vert_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_hor_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_hor_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_left_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_left_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_left_16x16_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_left_32x32_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_top_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_top_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_dc_top_16x16_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_top_32x32_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_128_16x16_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_128_32x32_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_127_16x16_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_127_32x32_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_129_16x16_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_dc_129_32x32_msa(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *left, const uint8_t *top);
+void ff_tm_4x4_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_tm_8x8_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_tm_16x16_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+void ff_tm_32x32_msa(uint8_t *dst, ptrdiff_t stride, const uint8_t *left,
+ const uint8_t *top);
+
+#endif // #ifndef AVCODEC_MIPS_VP9DSP_MIPS_H
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/xvid_idct_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/xvid_idct_mmi.c
new file mode 100644
index 00000000000..d3f9acb0e2e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/xvid_idct_mmi.c
@@ -0,0 +1,253 @@
+/*
+ * Loongson SIMD optimized xvid idct
+ *
+ * Copyright (c) 2015 Loongson Technology Corporation Limited
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "idctdsp_mips.h"
+#include "xvididct_mips.h"
+
+#define BITS_INV_ACC 5 // 4 or 5 for IEEE
+#define SHIFT_INV_ROW (16 - BITS_INV_ACC) //11
+#define SHIFT_INV_COL (1 + BITS_INV_ACC) //6
+#define RND_INV_ROW (1024 * (6 - BITS_INV_ACC))
+#define RND_INV_COL (16 * (BITS_INV_ACC - 3))
+#define RND_INV_CORR (RND_INV_COL - 1)
+
+#define BITS_FRW_ACC 3 // 2 or 3 for accuracy
+#define SHIFT_FRW_COL BITS_FRW_ACC
+#define SHIFT_FRW_ROW (BITS_FRW_ACC + 17)
+#define RND_FRW_ROW (262144*(BITS_FRW_ACC - 1))
+
+DECLARE_ALIGNED(8, static const int16_t, tg_1_16)[4*4] = {
+ 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5
+ 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5
+ -21746,-21746,-21746,-21746, // tg * (2<<16) + 0.5
+ 23170, 23170, 23170, 23170 // cos * (2<<15) + 0.5
+};
+
+DECLARE_ALIGNED(8, static const int32_t, rounder_0)[2*8] = {
+ 65536,65536,
+ 3597, 3597,
+ 2260, 2260,
+ 1203, 1203,
+ 0, 0,
+ 120, 120,
+ 512, 512,
+ 512, 512
+};
+
+DECLARE_ALIGNED(8, static const int16_t, tab_i_04_mmi)[32*4] = {
+ 16384, 21407, 16384, 8867, // w05 w04 w01 w00
+ 16384, 8867,-16384,-21407, // w07 w06 w03 w02
+ 16384, -8867, 16384,-21407, // w13 w12 w09 w08
+ -16384, 21407, 16384, -8867, // w15 w14 w11 w10
+ 22725, 19266, 19266, -4520, // w21 w20 w17 w16
+ 12873, 4520,-22725,-12873, // w23 w22 w19 w18
+ 12873,-22725, 4520,-12873, // w29 w28 w25 w24
+ 4520, 19266, 19266,-22725, // w31 w30 w27 w26
+
+ 22725, 29692, 22725, 12299, // w05 w04 w01 w00
+ 22725, 12299,-22725,-29692, // w07 w06 w03 w02
+ 22725,-12299, 22725,-29692, // w13 w12 w09 w08
+ -22725, 29692, 22725,-12299, // w15 w14 w11 w10
+ 31521, 26722, 26722, -6270, // w21 w20 w17 w16
+ 17855, 6270,-31521,-17855, // w23 w22 w19 w18
+ 17855,-31521, 6270,-17855, // w29 w28 w25 w24
+ 6270, 26722, 26722,-31521, // w31 w30 w27 w26
+
+ 21407, 27969, 21407, 11585, // w05 w04 w01 w00
+ 21407, 11585,-21407,-27969, // w07 w06 w03 w02
+ 21407,-11585, 21407,-27969, // w13 w12 w09 w08
+ -21407, 27969, 21407,-11585, // w15 w14 w11 w10
+ 29692, 25172, 25172, -5906, // w21 w20 w17 w16
+ 16819, 5906,-29692,-16819, // w23 w22 w19 w18
+ 16819,-29692, 5906,-16819, // w29 w28 w25 w24
+ 5906, 25172, 25172,-29692, // w31 w30 w27 w26
+
+ 19266, 25172, 19266, 10426, // w05 w04 w01 w00
+ 19266, 10426,-19266,-25172, // w07 w06 w03 w02
+ 19266,-10426, 19266,-25172, // w13 w12 w09 w08
+ -19266, 25172, 19266,-10426, // w15 w14 w11 w10
+ 26722, 22654, 22654, -5315, // w21 w20 w17 w16
+ 15137, 5315,-26722,-15137, // w23 w22 w19 w18
+ 15137,-26722, 5315,-15137, // w29 w28 w25 w24
+ 5315, 22654, 22654,-26722, // w31 w30 w27 w26
+};
+
+#define DCT_8_INV_ROW_MMI(A1,A2,A3,A4) \
+ "dli $10, 0x88 \n\t" \
+ "ldc1 $f4, "#A1" \n\t" /* 0; x3 x2 x1 x0 */\
+ "dmtc1 $10, $f16 \n\t" \
+ "ldc1 $f10, 8+"#A1" \n\t" /* 1; x7 x6 x5 x4 */\
+ "ldc1 $f6, "#A3" \n\t" /* 3; w05 w04 w01 w00 */\
+ "pshufh $f0, $f4, $f16 \n\t" /* x2 x0 x2 x0 */\
+ "ldc1 $f8, 8+"#A3" \n\t" /* 4; w07 w06 w03 w02 */\
+ "ldc1 $f12, 32+"#A3" \n\t" /* 6; w21 w20 w17 w16 */\
+ "pmaddhw $f6, $f6, $f0 \n\t" /* x2*w05+x0*w04 x2*w01+x0*w00 */\
+ "dli $10, 0xdd \n\t" \
+ "pshufh $f2, $f10, $f16 \n\t" /* x6 x4 x6 x4 */\
+ "dmtc1 $10, $f16 \n\t" \
+ "pmaddhw $f8, $f8, $f2 \n\t" /* x6*w07+x4*w06 x6*w03+x4*w02 */\
+ "ldc1 $f14, 40+"#A3" \n\t" /* 7; w23 w22 w19 w18 */\
+ "pshufh $f4, $f4, $f16 \n\t" /* x3 x1 x3 x1 */\
+ "pmaddhw $f12, $f12, $f4 \n\t" /* x3*w21+x1*w20 x3*w17+x1*w16 */\
+ "pshufh $f10, $f10, $f16 \n\t" /* x7 x5 x7 x5 */\
+ "ldc1 $f18, "#A4" \n\t" \
+ "pmaddhw $f14, $f14, $f10 \n\t" /* x7*w23+x5*w22 x7*w19+x5*w18 */\
+ "paddw $f6, $f6, $f18 \n\t" /* +%4 */\
+ "ldc1 $f16, 16+"#A3" \n\t" \
+ "pmaddhw $f0, $f0, $f16 \n\t" /* x2*w13+x0*w12 x2*w09+x0*w08 */\
+ "ldc1 $f16, 24+"#A3" \n\t" \
+ "paddw $f6, $f6, $f8 \n\t" /* 4; a1=sum(even1) a0=sum(even0) */\
+ "pmaddhw $f2, $f2, $f16 \n\t" /* x6*w15+x4*w14 x6*w11+x4*w10 */\
+ "ldc1 $f16, 48+"#A3" \n\t" \
+ "pmaddhw $f4, $f4, $f16 \n\t" /* x3*w29+x1*w28 x3*w25+x1*w24 */\
+ "ldc1 $f16, 56+"#A3" \n\t" \
+ "paddw $f12, $f12, $f14 \n\t" /* 7; b1=sum(odd1) b0=sum(odd0) */\
+ "dli $10, 11 \n\t" \
+ "pmaddhw $f10, $f10, $f16 \n\t" /* x7*w31+x5*w30 x7*w27+x5*w26 */\
+ "dmtc1 $10, $f16 \n\t" \
+ "psubw $f8, $f6, $f12 \n\t" /* 6; a1-b1 a0-b0 */\
+ "paddw $f6, $f6, $f12 \n\t" /* a1+b1 a0+b0 */\
+ "paddw $f0, $f0, $f18 \n\t" /* +%4 */\
+ "psraw $f6, $f6, $f16 \n\t" /* y1=a1+b1 y0=a0+b0 */\
+ "paddw $f0, $f0, $f2 \n\t" /* 1; a3=sum(even3) a2=sum(even2) */\
+ "paddw $f4, $f4, $f10 \n\t" /* 5; b3=sum(odd3) b2=sum(odd2) */\
+ "psraw $f8, $f8, $f16 \n\t" /* y6=a1-b1 y7=a0-b0 */\
+ "psubw $f14, $f0, $f4 \n\t" /* 2; a3-b3 a2-b2 */\
+ "paddw $f0, $f0, $f4 \n\t" /* a3+b3 a2+b2 */\
+ "psraw $f0, $f0, $f16 \n\t" /* y3=a3+b3 y2=a2+b2 */\
+ "psraw $f14, $f14, $f16 \n\t" /* y4=a3-b3 y5=a2-b2 */\
+ "dli $10, 0xb1 \n\t" \
+ "packsswh $f6, $f6, $f0 \n\t" /* 0; y3 y2 y1 y0 */\
+ "dmtc1 $10, $f16 \n\t" \
+ "packsswh $f14, $f14, $f8 \n\t" /* 4; y6 y7 y4 y5 */\
+ "sdc1 $f6, "#A2" \n\t" /* 3; save y3 y2 y1 y0 */\
+ "pshufh $f14, $f14, $f16 \n\t" /* y7 y6 y5 y4 */\
+ "sdc1 $f14, 8+"#A2" \n\t" /* 7; save y7 y6 y5 y4 */\
+
+
+#define DCT_8_INV_COL(A1,A2) \
+ "ldc1 $f2, 2*8(%3) \n\t" \
+ "ldc1 $f6, 16*3+"#A1" \n\t" \
+ "ldc1 $f10, 16*5+"#A1" \n\t" \
+ "pmulhh $f0, $f2, $f6 \n\t" /* x3*(tg_3_16-1) */\
+ "ldc1 $f4, 0(%3) \n\t" \
+ "pmulhh $f2, $f2, $f10 \n\t" /* x5*(tg_3_16-1) */\
+ "ldc1 $f14, 16*7+"#A1" \n\t" \
+ "ldc1 $f12, 16*1+"#A1" \n\t" \
+ "pmulhh $f8, $f4, $f14 \n\t" /* x7*tg_1_16 */\
+ "paddsh $f0, $f0, $f6 \n\t" /* x3*tg_3_16 */\
+ "pmulhh $f4, $f4, $f12 \n\t" /* x1*tg_1_16 */\
+ "paddsh $f2, $f2, $f6 \n\t" /* x3+x5*(tg_3_16-1) */\
+ "psubsh $f0, $f0, $f10 \n\t" /* x3*tg_3_16-x5 = tm35 */\
+ "ldc1 $f6, 3*8(%3) \n\t" \
+ "paddsh $f2, $f2, $f10 \n\t" /* x3+x5*tg_3_16 = tp35 */\
+ "paddsh $f8, $f8, $f12 \n\t" /* x1+tg_1_16*x7 = tp17 */\
+ "psubsh $f4, $f4, $f14 \n\t" /* x1*tg_1_16-x7 = tm17 */\
+ "paddsh $f10, $f8, $f2 \n\t" /* tp17+tp35 = b0 */\
+ "psubsh $f12, $f4, $f0 \n\t" /* tm17-tm35 = b3 */\
+ "psubsh $f8, $f8, $f2 \n\t" /* tp17-tp35 = t1 */\
+ "paddsh $f4, $f4, $f0 \n\t" /* tm17+tm35 = t2 */\
+ "ldc1 $f14, 1*8(%3) \n\t" \
+ "sdc1 $f10, 3*16+"#A2" \n\t" /* save b0 */\
+ "paddsh $f2, $f8, $f4 \n\t" /* t1+t2 */\
+ "sdc1 $f12, 5*16+"#A2" \n\t" /* save b3 */\
+ "psubsh $f8, $f8, $f4 \n\t" /* t1-t2 */\
+ "ldc1 $f10, 2*16+"#A1" \n\t" \
+ "ldc1 $f12, 6*16+"#A1" \n\t" \
+ "pmulhh $f0, $f14, $f10 \n\t" /* x2*tg_2_16 */\
+ "pmulhh $f14, $f14, $f12 \n\t" /* x6*tg_2_16 */\
+ "pmulhh $f2, $f2, $f6 \n\t" /* ocos_4_16*(t1+t2) = b1/2 */\
+ "ldc1 $f4, 0*16+"#A1" \n\t" \
+ "pmulhh $f8, $f8, $f6 \n\t" /* ocos_4_16*(t1-t2) = b2/2 */\
+ "psubsh $f0, $f0, $f12 \n\t" /* t2*tg_2_16-x6 = tm26 */\
+ "ldc1 $f12, 4*16+"#A1" \n\t" \
+ "paddsh $f14, $f14, $f10 \n\t" /* x2+x6*tg_2_16 = tp26 */\
+ "psubsh $f6, $f4, $f12 \n\t" /* x0-x4 = tm04 */\
+ "paddsh $f4, $f4, $f12 \n\t" /* x0+x4 = tp04 */\
+ "paddsh $f10, $f4, $f14 \n\t" /* tp04+tp26 = a0 */\
+ "psubsh $f12, $f6, $f0 \n\t" /* tm04-tm26 = a2 */\
+ "psubsh $f4, $f4, $f14 \n\t" /* tp04-tp26 = a3 */\
+ "paddsh $f6, $f6, $f0 \n\t" /* tm04+tm26 = a1 */\
+ "paddsh $f2, $f2, $f2 \n\t" /* b1 */\
+ "paddsh $f8, $f8, $f8 \n\t" /* b2 */\
+ "psubsh $f14, $f6, $f2 \n\t" /* a1-b1 */\
+ "dli $10, 6 \n\t" \
+ "paddsh $f6, $f6, $f2 \n\t" /* a1+b1 */\
+ "dmtc1 $10, $f16 \n\t" \
+ "psubsh $f0, $f12, $f8 \n\t" /* a2-b2 */\
+ "paddsh $f12, $f12, $f8 \n\t" /* a2+b2 */\
+ "psrah $f6, $f6, $f16 \n\t" /* dst1 */\
+ "psrah $f12, $f12, $f16 \n\t" /* dst2 */\
+ "ldc1 $f2, 3*16+"#A2" \n\t" /* load b0 */\
+ "psrah $f14, $f14, $f16 \n\t" /* dst6 */\
+ "psrah $f0, $f0, $f16 \n\t" /* dst5 */\
+ "sdc1 $f6, 1*16+"#A2" \n\t" \
+ "psubsh $f8, $f10, $f2 \n\t" /* a0-b0 */\
+ "paddsh $f10, $f10, $f2 \n\t" /* a0+b0 */\
+ "sdc1 $f12, 2*16+"#A2" \n\t" \
+ "ldc1 $f6, 5*16+"#A2" \n\t" /* load b3 */\
+ "psrah $f10, $f10, $f16 \n\t" /* dst0 */\
+ "psrah $f8, $f8, $f16 \n\t" /* dst7 */\
+ "sdc1 $f0, 5*16+"#A2" \n\t" \
+ "psubsh $f12, $f4, $f6 \n\t" /* a3-b3 */\
+ "paddsh $f4, $f4, $f6 \n\t" /* a3+b3 */\
+ "sdc1 $f14, 6*16+"#A2" \n\t" \
+ "sdc1 $f10, 0*16+"#A2" \n\t" \
+ "psrah $f4, $f4, $f16 \n\t" /* dst3 */\
+ "sdc1 $f8, 7*16+"#A2" \n\t" \
+ "psrah $f12, $f12, $f16 \n\t" /* dst4 */\
+ "sdc1 $f4, 3*16+"#A2" \n\t" \
+ "sdc1 $f12, 4*16+"#A2" \n\t" \
+
+
+void ff_xvid_idct_mmi(int16_t *block)
+{
+ __asm__ volatile (
+ //# Process each row
+ DCT_8_INV_ROW_MMI(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
+ DCT_8_INV_ROW_MMI(1*16(%0), 1*16(%0), 64*1(%2), 8*1(%1))
+ DCT_8_INV_ROW_MMI(2*16(%0), 2*16(%0), 64*2(%2), 8*2(%1))
+ DCT_8_INV_ROW_MMI(3*16(%0), 3*16(%0), 64*3(%2), 8*3(%1))
+ DCT_8_INV_ROW_MMI(4*16(%0), 4*16(%0), 64*0(%2), 8*4(%1))
+ DCT_8_INV_ROW_MMI(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
+ DCT_8_INV_ROW_MMI(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
+ DCT_8_INV_ROW_MMI(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
+ //# Process the columns (4 at a time)
+ DCT_8_INV_COL(0(%0), 0(%0))
+ DCT_8_INV_COL(8(%0), 8(%0))
+ ::"r"(block),"r"(rounder_0),"r"(tab_i_04_mmi),"r"(tg_1_16)
+ : "$10"
+ );
+}
+
+void ff_xvid_idct_put_mmi(uint8_t *dest, int32_t line_size, int16_t *block)
+{
+ ff_xvid_idct_mmi(block);
+ ff_put_pixels_clamped_mmi(block, dest, line_size);
+}
+
+void ff_xvid_idct_add_mmi(uint8_t *dest, int32_t line_size, int16_t *block)
+{
+ ff_xvid_idct_mmi(block);
+ ff_add_pixels_clamped_mmi(block, dest, line_size);
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_init_mips.c b/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_init_mips.c
new file mode 100644
index 00000000000..c1d82cc30c7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_init_mips.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * 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 "xvididct_mips.h"
+
+#if HAVE_MMI
+static av_cold void xvid_idct_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ if (!high_bit_depth) {
+ if (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_XVID) {
+ c->idct_put = ff_xvid_idct_put_mmi;
+ c->idct_add = ff_xvid_idct_add_mmi;
+ c->idct = ff_xvid_idct_mmi;
+ c->perm_type = FF_IDCT_PERM_NONE;
+ }
+ }
+}
+#endif /* HAVE_MMI */
+
+av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+#if HAVE_MMI
+ xvid_idct_init_mmi(c, avctx, high_bit_depth);
+#endif /* HAVE_MMI */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_mips.h b/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_mips.h
new file mode 100644
index 00000000000..0768aaa26fb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/xvididct_mips.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MIPS_XVIDIDCT_MIPS_H
+#define AVCODEC_MIPS_XVIDIDCT_MIPS_H
+
+#include "libavcodec/xvididct.h"
+
+void ff_xvid_idct_mmi(int16_t *block);
+void ff_xvid_idct_put_mmi(uint8_t *dest, int32_t line_size, int16_t *block);
+void ff_xvid_idct_add_mmi(uint8_t *dest, int32_t line_size, int16_t *block);
+
+#endif /* AVCODEC_MIPS_XVIDIDCT_MIPS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpega_dump_header_bsf.c b/chromium/third_party/ffmpeg/libavcodec/mjpega_dump_header_bsf.c
index 87829fae8f1..d6d41e6bbb4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpega_dump_header_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpega_dump_header_bsf.c
@@ -44,7 +44,7 @@ static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *av
}
*poutbuf_size = 0;
- *poutbuf = av_malloc(buf_size + 44 + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = av_malloc(buf_size + 44 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
poutbufp = *poutbuf;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c b/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
index 8ac60c22a11..a858707d545 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegbdec.c
@@ -166,7 +166,7 @@ AVCodec ff_mjpegb_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
.decode = mjpegb_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
index 1ce332833d8..1a86b7bc315 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
@@ -288,9 +288,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
height = get_bits(&s->gb, 16);
width = get_bits(&s->gb, 16);
- if (s->avctx->codec_id == AV_CODEC_ID_AMV && (height&15))
- avpriv_request_sample(s->avctx, "non mod 16 height AMV\n");
-
// HACK for odd_height.mov
if (s->interlaced && s->width == width && s->height == height + 1)
height= s->height;
@@ -345,6 +342,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
i, h_count[i], v_count[i],
s->component_id[i], s->quant_index[i]);
}
+ if ( nb_components == 4
+ && s->component_id[0] == 'C' - 1
+ && s->component_id[1] == 'M' - 1
+ && s->component_id[2] == 'Y' - 1
+ && s->component_id[3] == 'K' - 1)
+ s->adobe_transform = 0;
if (s->ls && (s->h_max > 1 || s->v_max > 1)) {
avpriv_report_missing_feature(s->avctx, "Subsampling in JPEG-LS");
@@ -367,6 +370,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* test interlaced mode */
if (s->first_picture &&
+ (s->multiscope != 2 || s->avctx->time_base.den >= 25 * s->avctx->time_base.num) &&
s->org_height != 0 &&
s->height < ((s->org_height * 3) / 4)) {
s->interlaced = 1;
@@ -671,6 +675,7 @@ static int decode_block(MJpegDecodeContext *s, int16_t *block, int component,
return AVERROR_INVALIDDATA;
}
val = val * quant_matrix[0] + s->last_dc[component];
+ val = FFMIN(val, 32767);
s->last_dc[component] = val;
block[0] = val;
/* AC coefs */
@@ -718,7 +723,7 @@ static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
av_log(s->avctx, AV_LOG_ERROR, "error dc\n");
return AVERROR_INVALIDDATA;
}
- val = (val * quant_matrix[0] << Al) + s->last_dc[component];
+ val = (val * (quant_matrix[0] << Al)) + s->last_dc[component];
s->last_dc[component] = val;
block[0] = val;
return 0;
@@ -761,14 +766,14 @@ static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block,
if (i >= se) {
if (i == se) {
j = s->scantable.permutated[se];
- block[j] = level * quant_matrix[j] << Al;
+ block[j] = level * (quant_matrix[j] << Al);
break;
}
av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);
return AVERROR_INVALIDDATA;
}
j = s->scantable.permutated[i];
- block[j] = level * quant_matrix[j] << Al;
+ block[j] = level * (quant_matrix[j] << Al);
} else {
if (run == 0xF) {// ZRL - skip 15 coefficients
i += 15;
@@ -847,7 +852,7 @@ static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block,
ZERO_RUN;
j = s->scantable.permutated[i];
val--;
- block[j] = ((quant_matrix[j]^val) - val) << Al;
+ block[j] = ((quant_matrix[j] << Al) ^ val) - val;
if (i == se) {
if (i > *last_nnz)
*last_nnz = i;
@@ -990,7 +995,14 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
skip_bits(&s->gb, 16); /* skip RSTn */
}
}
- if (s->nb_components == 4) {
+ if (s->rct && s->nb_components == 4) {
+ for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
+ ptr[4*mb_x + 2] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200) >> 2);
+ ptr[4*mb_x + 1] = buffer[mb_x][1] + ptr[4*mb_x + 2];
+ ptr[4*mb_x + 3] = buffer[mb_x][2] + ptr[4*mb_x + 2];
+ ptr[4*mb_x + 0] = buffer[mb_x][3];
+ }
+ } else if (s->nb_components == 4) {
for(i=0; i<nb_components; i++) {
int c= s->comp_index[i];
if (s->bits <= 8) {
@@ -1830,6 +1842,8 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) && s->avctx->codec_tag) ||
(!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
s->flipped = 1;
+ else if (!strcmp(cbuf, "MULTISCOPE II"))
+ s->multiscope = 2;
av_free(cbuf);
}
@@ -1901,7 +1915,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
*unescaped_buf_ptr = s->buffer;
*unescaped_buf_size = dst - s->buffer;
memset(s->buffer + *unescaped_buf_size, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %"PTRDIFF_SPECIFIER" bytes\n",
(buf_end - *buf_ptr) - (dst - s->buffer));
@@ -1946,7 +1960,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
*unescaped_buf_ptr = dst;
*unescaped_buf_size = (bit_count + 7) >> 3;
memset(s->buffer + *unescaped_buf_size, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
} else {
*unescaped_buf_ptr = *buf_ptr;
*unescaped_buf_size = buf_end - *buf_ptr;
@@ -2055,6 +2069,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
goto fail;
break;
case SOF3:
+ s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1;
s->ls = 0;
s->progressive = 0;
@@ -2062,6 +2077,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
goto fail;
break;
case SOF48:
+ s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1;
s->ls = 1;
s->progressive = 0;
@@ -2149,7 +2165,7 @@ fail:
return ret;
the_end:
- is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step_minus1;
+ is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step > 1;
if (AV_RB32(s->upscale_h)) {
int p;
@@ -2192,11 +2208,13 @@ the_end:
}
} else if (s->upscale_h[p] == 2) {
if (is16bit) {
- ((uint16_t*)line)[w - 1] =
- ((uint16_t*)line)[w - 2] = ((uint16_t*)line)[(w - 1) / 3];
+ ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 3];
+ if (w > 1)
+ ((uint16_t*)line)[w - 2] = ((uint16_t*)line)[w - 1];
} else {
- line[w - 1] =
- line[w - 2] = line[(w - 1) / 3];
+ line[w - 1] = line[(w - 1) / 3];
+ if (w > 1)
+ line[w - 2] = line[w - 1];
}
for (index = w - 3; index > 0; index--) {
line[index] = (line[index / 3] + line[(index + 1) / 3] + line[(index + 2) / 3] + 1) / 3;
@@ -2396,7 +2414,7 @@ AVCodec ff_mjpeg_decoder = {
.close = ff_mjpeg_decode_end,
.decode = ff_mjpeg_decode_frame,
.flush = decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.priv_class = &mjpegdec_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
@@ -2413,7 +2431,7 @@ AVCodec ff_thp_decoder = {
.close = ff_mjpeg_decode_end,
.decode = ff_mjpeg_decode_frame,
.flush = decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
index 28d3e4aa7d4..fb811294a14 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.h
@@ -114,6 +114,7 @@ typedef struct MJpegDecodeContext {
int buggy_avid;
int cs_itu601;
int interlace_polarity;
+ int multiscope;
int mjpb_skiptosod;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
index c3ede0728d7..f15de58c2c0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegenc.c
@@ -224,9 +224,11 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift);
+#if FF_API_EMU_EDGE
//CODEC_FLAG_EMU_EDGE have to be cleared
if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
return AVERROR(EINVAL);
+#endif
if ((avctx->height & 15) && avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
av_log(avctx, AV_LOG_ERROR,
@@ -269,7 +271,7 @@ AVCodec ff_mjpeg_encoder = {
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE
},
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.c b/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.c
index daa5b6924d3..d1d4cfb40a9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.c
@@ -135,7 +135,7 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
}
/* comment */
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
put_marker(p, COM);
flush_put_bits(p);
ptr = put_bits_ptr(p);
@@ -145,9 +145,10 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
AV_WB16(ptr, size);
}
- if (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
+ if (((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUV444P) && avctx->color_range != AVCOL_RANGE_JPEG)
+ || avctx->color_range == AVCOL_RANGE_MPEG) {
put_marker(p, COM);
flush_put_bits(p);
ptr = put_bits_ptr(p);
@@ -158,7 +159,7 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
}
}
-void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3])
+void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4])
{
int chroma_h_shift, chroma_v_shift;
@@ -170,7 +171,8 @@ void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3
|| avctx->pix_fmt == AV_PIX_FMT_BGR24)) {
vsample[0] = hsample[0] =
vsample[1] = hsample[1] =
- vsample[2] = hsample[2] = 1;
+ vsample[2] = hsample[2] =
+ vsample[3] = hsample[3] = 1;
} else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P) {
vsample[0] = vsample[1] = vsample[2] = 2;
hsample[0] = hsample[1] = hsample[2] = 1;
@@ -190,8 +192,9 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
uint16_t chroma_intra_matrix[64])
{
const int lossless = avctx->codec_id != AV_CODEC_ID_MJPEG && avctx->codec_id != AV_CODEC_ID_AMV;
- int hsample[3], vsample[3];
+ int hsample[4], vsample[4];
int i;
+ int components = 3 + (avctx->pix_fmt == AV_PIX_FMT_BGRA);
int chroma_matrix = !!memcmp(luma_intra_matrix,
chroma_intra_matrix,
sizeof(luma_intra_matrix[0])*64);
@@ -222,7 +225,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
put_bits(pb, 8, 8); /* 8 bits/component */
put_bits(pb, 16, avctx->height);
put_bits(pb, 16, avctx->width);
- put_bits(pb, 8, 3); /* 3 components */
+ put_bits(pb, 8, components); /* 3 or 4 components */
/* Y component */
put_bits(pb, 8, 1); /* component number */
@@ -242,10 +245,17 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
put_bits(pb, 4, vsample[2]); /* V factor */
put_bits(pb, 8, lossless ? 0 : chroma_matrix); /* select matrix */
+ if (components == 4) {
+ put_bits(pb, 8, 4); /* component number */
+ put_bits(pb, 4, hsample[3]); /* H factor */
+ put_bits(pb, 4, vsample[3]); /* V factor */
+ put_bits(pb, 8, 0); /* select matrix */
+ }
+
/* scan header */
put_marker(pb, SOS);
- put_bits(pb, 16, 12); /* length */
- put_bits(pb, 8, 3); /* 3 components */
+ put_bits(pb, 16, 6 + 2*components); /* length */
+ put_bits(pb, 8, components); /* 3 components */
/* Y component */
put_bits(pb, 8, 1); /* index */
@@ -262,6 +272,13 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
put_bits(pb, 4, 1); /* DC huffman table index */
put_bits(pb, 4, lossless ? 0 : 1); /* AC huffman table index */
+ if (components == 4) {
+ /* Alpha component */
+ put_bits(pb, 8, 4); /* index */
+ put_bits(pb, 4, 0); /* DC huffman table index */
+ put_bits(pb, 4, 0); /* AC huffman table index */
+ }
+
put_bits(pb, 8, lossless ? avctx->prediction_method + 1 : 0); /* Ss (not used) */
switch (avctx->codec_id) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.h b/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.h
index 87f150550db..924cb362626 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegenc_common.h
@@ -35,7 +35,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits);
void ff_mjpeg_escape_FF(PutBitContext *pb, int start);
int ff_mjpeg_encode_stuffing(MpegEncContext *s);
-void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3]);
+void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4]);
void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
uint8_t *huff_size, uint16_t *huff_code);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
index deaa844fc03..23601c86331 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
@@ -357,15 +357,6 @@ static int mlp_parse(AVCodecParserContext *s,
if(!avctx->channels || !avctx->channel_layout) {
if (mh.stream_type == 0xbb) {
/* MLP stream */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
- mh.num_substreams > 1) {
- avctx->channels = 2;
- avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if (avctx->request_channel_layout &&
(avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
avctx->request_channel_layout &&
@@ -378,20 +369,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
} else { /* mh.stream_type == 0xba */
/* TrueHD stream */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
- mh.num_substreams > 1) {
- avctx->channels = 2;
- avctx->channel_layout = AV_CH_LAYOUT_STEREO;
- } else if (avctx->request_channels > 0 &&
- avctx->request_channels <= mh.channels_thd_stream1) {
- avctx->channels = mh.channels_thd_stream1;
- avctx->channel_layout = mh.channel_layout_thd_stream1;
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
- if (avctx->request_channel_layout &&
+ if (avctx->request_channel_layout &&
(avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
avctx->request_channel_layout &&
mh.num_substreams > 1) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
index 490d107e780..b2d1e2f715e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
@@ -533,19 +533,6 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
s->max_channel = max_channel;
s->max_matrix_channel = max_matrix_channel;
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
- if (m->avctx->request_channels > 0 &&
- m->avctx->request_channels <= s->max_channel + 1 &&
- m->max_decoded_substream > substr) {
- av_log(m->avctx, AV_LOG_DEBUG,
- "Extracting %d-channel downmix from substream %d. "
- "Further substreams will be skipped.\n",
- s->max_channel + 1, substr);
- m->max_decoded_substream = substr;
-FF_ENABLE_DEPRECATION_WARNINGS
- } else
-#endif
if (m->avctx->request_channel_layout && (s->ch_layout & m->avctx->request_channel_layout) ==
m->avctx->request_channel_layout && m->max_decoded_substream > substr) {
av_log(m->avctx, AV_LOG_DEBUG,
@@ -1314,7 +1301,7 @@ AVCodec ff_mlp_decoder = {
.priv_data_size = sizeof(MLPDecodeContext),
.init = mlp_decode_init,
.decode = read_access_unit,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_TRUEHD_DECODER
@@ -1326,6 +1313,6 @@ AVCodec ff_truehd_decoder = {
.priv_data_size = sizeof(MLPDecodeContext),
.init = mlp_decode_init,
.decode = read_access_unit,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif /* CONFIG_TRUEHD_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mmaldec.c b/chromium/third_party/ffmpeg/libavcodec/mmaldec.c
index aa46621d06b..a41a1b67be3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mmaldec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mmaldec.c
@@ -26,6 +26,7 @@
#include <bcm_host.h>
#include <interface/mmal/mmal.h>
+#include <interface/mmal/mmal_parameters_video.h>
#include <interface/mmal/util/mmal_util.h>
#include <interface/mmal/util/mmal_util_params.h>
#include <interface/mmal/util/mmal_default_components.h>
@@ -277,6 +278,9 @@ static int ffmal_update_format(AVCodecContext *avctx)
if ((status = mmal_port_parameter_set_uint32(decoder->output[0], MMAL_PARAMETER_EXTRA_BUFFERS, ctx->extra_buffers)))
goto fail;
+ if ((status = mmal_port_parameter_set_boolean(decoder->output[0], MMAL_PARAMETER_VIDEO_INTERPOLATE_TIMESTAMPS, 0)))
+ goto fail;
+
if (avctx->pix_fmt == AV_PIX_FMT_MMAL) {
format_out->encoding = MMAL_ENCODING_OPAQUE;
} else {
@@ -361,10 +365,8 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
ret = AVERROR(ENOSYS);
goto fail;
}
- av_bitstream_filter_filter(ctx->bsfc, avctx, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
- }
-
- if (avctx->extradata_size) {
+ av_bitstream_filter_filter(ctx->bsfc, avctx, "private_spspps_buf", &dummy_p, &dummy_int, NULL, 0, 0);
+ } else if (avctx->extradata_size) {
if ((status = mmal_format_extradata_alloc(format_in, avctx->extradata_size)))
goto fail;
format_in->extradata_size = avctx->extradata_size;
@@ -447,13 +449,11 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt)
uint8_t *start;
int ret = 0;
- ctx->packets_sent++;
-
if (avpkt->size) {
if (ctx->bsfc) {
uint8_t *tmp_data;
int tmp_size;
- if ((ret = av_bitstream_filter_filter(ctx->bsfc, avctx, NULL,
+ if ((ret = av_bitstream_filter_filter(ctx->bsfc, avctx, "private_spspps_buf",
&tmp_data, &tmp_size,
avpkt->data, avpkt->size,
avpkt->flags & AV_PKT_FLAG_KEY)) < 0)
@@ -474,6 +474,14 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt)
}
size = buf->size;
data = buf->data;
+ ctx->packets_sent++;
+ } else {
+ if (!ctx->packets_sent) {
+ // Short-cut the flush logic to avoid upsetting MMAL.
+ ctx->eos_sent = 1;
+ ctx->eos_received = 1;
+ goto done;
+ }
}
start = data;
@@ -611,10 +619,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame,
}
}
- if (buffer->pts != MMAL_TIME_UNKNOWN) {
- frame->pkt_pts = buffer->pts;
- frame->pts = buffer->pts;
- }
+ frame->pkt_pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE : buffer->pts;
+ frame->pkt_dts = AV_NOPTS_VALUE;
done:
return ret;
@@ -643,13 +649,23 @@ static int ffmmal_read_frame(AVCodecContext *avctx, AVFrame *frame, int *got_fra
// excessive buffering.
// We also wait if we sent eos, but didn't receive it yet (think of decoding
// stream with a very low number of frames).
- if (ctx->frames_output || ctx->packets_sent > MAX_DELAYED_FRAMES || ctx->eos_sent) {
- buffer = mmal_queue_wait(ctx->queue_decoded_frames);
+ if (ctx->frames_output || ctx->packets_sent > MAX_DELAYED_FRAMES ||
+ (ctx->packets_sent && ctx->eos_sent)) {
+ // MMAL will ignore broken input packets, which means the frame we
+ // expect here may never arrive. Dealing with this correctly is
+ // complicated, so here's a hack to avoid that it freezes forever
+ // in this unlikely situation.
+ buffer = mmal_queue_timedwait(ctx->queue_decoded_frames, 100);
+ if (!buffer) {
+ av_log(avctx, AV_LOG_ERROR, "Did not get output frame from MMAL.\n");
+ ret = AVERROR_UNKNOWN;
+ goto done;
+ }
} else {
buffer = mmal_queue_get(ctx->queue_decoded_frames);
+ if (!buffer)
+ goto done;
}
- if (!buffer)
- goto done;
ctx->eos_received |= !!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_EOS);
if (ctx->eos_received)
@@ -771,7 +787,8 @@ AVCodec ff_h264_mmal_decoder = {
.decode = ffmmal_decode,
.flush = ffmmal_flush,
.priv_class = &ffmmaldec_class,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL,
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE},
diff --git a/chromium/third_party/ffmpeg/libavcodec/mmvideo.c b/chromium/third_party/ffmpeg/libavcodec/mmvideo.c
index 8b04965d59a..04de6bb4c84 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mmvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mmvideo.c
@@ -247,5 +247,5 @@ AVCodec ff_mmvideo_decoder = {
.init = mm_decode_init,
.close = mm_decode_end,
.decode = mm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion-test.c b/chromium/third_party/ffmpeg/libavcodec/motion-test.c
index 7cfe41cf6e6..ebcf4aafa4c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion-test.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motion-test.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
printf("ffmpeg motion test\n");
ctx = avcodec_alloc_context3(NULL);
- ctx->flags |= CODEC_FLAG_BITEXACT;
+ ctx->flags |= AV_CODEC_FLAG_BITEXACT;
av_force_cpu_flags(0);
memset(&cctx, 0, sizeof(cctx));
ff_me_cmp_init(&cctx, ctx);
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion_est.c b/chromium/third_party/ffmpeg/libavcodec/motion_est.c
index 96aa9ac84e8..9f71568efd0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion_est.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motion_est.c
@@ -99,7 +99,7 @@ static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3
}
static int get_flags(MotionEstContext *c, int direct, int chroma){
- return ((c->avctx->flags&CODEC_FLAG_QPEL) ? FLAG_QPEL : 0)
+ return ((c->avctx->flags&AV_CODEC_FLAG_QPEL) ? FLAG_QPEL : 0)
+ (direct ? FLAG_DIRECT : 0)
+ (chroma ? FLAG_CHROMA : 0);
}
@@ -183,8 +183,8 @@ static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int
const int stride= c->stride;
const int uvstride= c->uvstride;
const int dxy= subx + (suby<<(1+qpel)); //FIXME log2_subpel?
- const int hx= subx + (x<<(1+qpel));
- const int hy= suby + (y<<(1+qpel));
+ const int hx= subx + x*(1<<(1+qpel));
+ const int hy= suby + y*(1<<(1+qpel));
uint8_t * const * const ref= c->ref[ref_index];
uint8_t * const * const src= c->src[src_index];
int d;
@@ -312,11 +312,26 @@ int ff_init_me(MpegEncContext *s){
av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n");
return -1;
}
+
+#if FF_API_MOTION_EST
//special case of snow is needed because snow uses its own iterative ME code
- if(s->me_method!=ME_ZERO && s->me_method!=ME_EPZS && s->me_method!=ME_X1 && s->avctx->codec_id != AV_CODEC_ID_SNOW){
- av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size\n");
- return -1;
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (s->motion_est == FF_ME_EPZS) {
+ if (s->me_method == ME_ZERO)
+ s->motion_est = FF_ME_ZERO;
+ else if (s->me_method == ME_EPZS)
+ s->motion_est = FF_ME_EPZS;
+ else if (s->me_method == ME_X1)
+ s->motion_est = FF_ME_XONE;
+ else if (s->avctx->codec_id != AV_CODEC_ID_SNOW) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "me_method is only allowed to be set to zero and epzs; "
+ "for hex,umh,full and others see dia_size\n");
+ return -1;
+ }
}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
c->avctx= s->avctx;
@@ -337,7 +352,7 @@ int ff_init_me(MpegEncContext *s){
c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp &FF_CMP_CHROMA);
/*FIXME s->no_rounding b_type*/
- if (s->avctx->flags & CODEC_FLAG_QPEL) {
+ if (s->avctx->flags & AV_CODEC_FLAG_QPEL) {
c->sub_motion_search= qpel_motion_search;
c->qpel_avg = s->qdsp.avg_qpel_pixels_tab;
if (s->no_rounding)
@@ -426,13 +441,13 @@ static int sad_hpel_motion_search(MpegEncContext * s,
my > ymin && my < ymax) {
int dx=0, dy=0;
int d, pen_x, pen_y;
- const int index= (my<<ME_MAP_SHIFT) + mx;
+ const int index= my*(1<<ME_MAP_SHIFT) + mx;
const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)];
const int r= score_map[(index+ 1 )&(ME_MAP_SIZE-1)];
const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
- mx<<=1;
- my<<=1;
+ mx += mx;
+ my += my;
pen_x= pred_x + mx;
@@ -490,8 +505,8 @@ static int sad_hpel_motion_search(MpegEncContext * s,
my+=dy;
}else{
- mx<<=1;
- my<<=1;
+ mx += mx;
+ my += my;
}
*mx_ptr = mx;
@@ -891,7 +906,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
{
MotionEstContext * const c= &s->me;
uint8_t *pix, *ppix;
- int sum, mx, my, dmin;
+ int sum, mx = 0, my = 0, dmin = 0;
int varc; ///< the variance of the block (sum of squared (p[y][x]-average))
int vard; ///< sum of squared differences with the estimated motion vector
int P[10][2];
@@ -923,52 +938,43 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
c->mb_var_sum_temp += (varc+128)>>8;
- switch(s->me_method) {
- case ME_ZERO:
- default:
- mx = 0;
- my = 0;
- dmin = 0;
- break;
- case ME_X1:
- case ME_EPZS:
- {
- const int mot_stride = s->b8_stride;
- const int mot_xy = s->block_index[0];
-
- P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
- P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
-
- if(!s->first_slice_line) {
- P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0];
- P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1];
- P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0];
- P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1];
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
+ if (s->motion_est != FF_ME_ZERO) {
+ const int mot_stride = s->b8_stride;
+ const int mot_xy = s->block_index[0];
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
+ P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
+ P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
- if(s->out_format == FMT_H263){
- c->pred_x = P_MEDIAN[0];
- c->pred_y = P_MEDIAN[1];
- }else { /* mpeg1 at least */
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- }
- }else{
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- }
+ if (P_LEFT[0] > (c->xmax << shift))
+ P_LEFT[0] = c->xmax << shift;
+
+ if (!s->first_slice_line) {
+ P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0];
+ P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1];
+ P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0];
+ P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1];
+ if (P_TOP[1] > (c->ymax << shift))
+ P_TOP[1] = c->ymax << shift;
+ if (P_TOPRIGHT[0] < (c->xmin << shift))
+ P_TOPRIGHT[0] = c->xmin << shift;
+ if (P_TOPRIGHT[1] > (c->ymax << shift))
+ P_TOPRIGHT[1] = c->ymax << shift;
+
+ P_MEDIAN[0] = mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
+ P_MEDIAN[1] = mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
+ if (s->out_format == FMT_H263) {
+ c->pred_x = P_MEDIAN[0];
+ c->pred_y = P_MEDIAN[1];
+ } else { /* mpeg1 at least */
+ c->pred_x = P_LEFT[0];
+ c->pred_y = P_LEFT[1];
+ }
+ } else {
+ c->pred_x = P_LEFT[0];
+ c->pred_y = P_LEFT[1];
}
dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
-
- break;
}
/* At this point (mx,my) are full-pell and the relative displacement */
@@ -997,7 +1003,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
mx <<=shift;
my <<=shift;
}
- if ((s->avctx->flags & CODEC_FLAG_4MV)
+ if ((s->avctx->flags & AV_CODEC_FLAG_4MV)
&& !c->skip && varc>50<<8 && vard>10<<8){
if(h263_mv4_search(s, mx, my, shift) < INT_MAX)
mb_type|=CANDIDATE_MB_TYPE_INTER4V;
@@ -1005,7 +1011,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
set_p_mv_tables(s, mx, my, 0);
}else
set_p_mv_tables(s, mx, my, 1);
- if ((s->avctx->flags & CODEC_FLAG_INTERLACED_ME)
+ if ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
&& !c->skip){ //FIXME varc/d checks
if(interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0) < INT_MAX)
mb_type |= CANDIDATE_MB_TYPE_INTER_I;
@@ -1018,7 +1024,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
- if ((s->avctx->flags & CODEC_FLAG_4MV)
+ if ((s->avctx->flags & AV_CODEC_FLAG_4MV)
&& !c->skip && varc>50<<8 && vard>10<<8){
int dmin4= h263_mv4_search(s, mx, my, shift);
if(dmin4 < dmin){
@@ -1026,7 +1032,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
dmin=dmin4;
}
}
- if ((s->avctx->flags & CODEC_FLAG_INTERLACED_ME)
+ if ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
&& !c->skip){ //FIXME varc/d checks
int dmin_i= interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0);
if(dmin_i < dmin){
@@ -1128,7 +1134,7 @@ static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
int16_t (*mv_table)[2], int ref_index, int f_code)
{
MotionEstContext * const c= &s->me;
- int mx, my, dmin;
+ int mx = 0, my = 0, dmin = 0;
int P[10][2];
const int shift= 1+s->quarter_sample;
const int mot_stride = s->mb_stride;
@@ -1143,15 +1149,7 @@ static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
get_limits(s, 16*mb_x, 16*mb_y);
- switch(s->me_method) {
- case ME_ZERO:
- default:
- mx = 0;
- my = 0;
- dmin = 0;
- break;
- case ME_X1:
- case ME_EPZS:
+ if (s->motion_est != FF_ME_ZERO) {
P_LEFT[0] = mv_table[mot_xy - 1][0];
P_LEFT[1] = mv_table[mot_xy - 1][1];
@@ -1180,8 +1178,6 @@ static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
}
dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
-
- break;
}
dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16);
@@ -1554,7 +1550,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
ff_dlog(s, "%d %d %d %d\n", dmin, fmin, bmin, fbmin);
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
//FIXME mb type penalty
c->skip=0;
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
@@ -1620,7 +1616,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
/* find best f_code for ME which do unlimited searches */
int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
{
- if(s->me_method>=ME_EPZS){
+ if (s->motion_est != FF_ME_ZERO) {
int score[8];
int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
uint8_t * fcode_tab= s->fcode_tab;
@@ -1685,7 +1681,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
- if (s->avctx->flags & CODEC_FLAG_4MV) {
+ if (s->avctx->flags & AV_CODEC_FLAG_4MV) {
const int wrap= s->b8_stride;
/* clip / convert to intra 8x8 type MVs */
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion_est.h b/chromium/third_party/ffmpeg/libavcodec/motion_est.h
index 199ae8da905..e09f705eeec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion_est.h
+++ b/chromium/third_party/ffmpeg/libavcodec/motion_est.h
@@ -31,6 +31,10 @@ struct MpegEncContext;
#define MAX_MV 4096
+#define FF_ME_ZERO 0
+#define FF_ME_EPZS 1
+#define FF_ME_XONE 2
+
/**
* Motion estimation context.
*/
diff --git a/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c b/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
index ae2cbdea4d8..25bab9ddfb6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motion_est_template.c
@@ -358,8 +358,8 @@ static int qpel_motion_search(MpegEncContext * s,
#define CHECK_MV(x,y)\
{\
- const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
- const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
+ const unsigned key = ((unsigned)(y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
+ const int index= (((unsigned)(y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
av_assert2((x) >= xmin);\
av_assert2((x) <= xmax);\
av_assert2((y) >= ymin);\
@@ -368,7 +368,7 @@ static int qpel_motion_search(MpegEncContext * s,
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
map[index]= key;\
score_map[index]= d;\
- d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
+ d += (mv_penalty[((x)*(1<<shift))-pred_x] + mv_penalty[((y)*(1<<shift))-pred_y])*penalty_factor;\
COPY3_IF_LT(dmin, d, best[0], x, best[1], y)\
}\
}
@@ -384,13 +384,13 @@ static int qpel_motion_search(MpegEncContext * s,
#define CHECK_MV_DIR(x,y,new_dir)\
{\
- const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
- const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
+ const unsigned key = ((unsigned)(y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
+ const int index= (((unsigned)(y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
if(map[index]!=key){\
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
map[index]= key;\
score_map[index]= d;\
- d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
+ d += (mv_penalty[(int)((unsigned)(x)<<shift)-pred_x] + mv_penalty[(int)((unsigned)(y)<<shift)-pred_y])*penalty_factor;\
if(d<dmin){\
best[0]=x;\
best[1]=y;\
@@ -426,8 +426,8 @@ static av_always_inline int small_diamond_search(MpegEncContext * s, int *best,
chroma_cmpf = s->mecc.me_cmp[size + 1];
{ /* ensure that the best point is in the MAP as h/qpel refinement needs it */
- const unsigned key = (best[1]<<ME_MAP_MV_BITS) + best[0] + map_generation;
- const int index= ((best[1]<<ME_MAP_SHIFT) + best[0])&(ME_MAP_SIZE-1);
+ const unsigned key = ((unsigned)best[1]<<ME_MAP_MV_BITS) + best[0] + map_generation;
+ const int index= (((unsigned)best[1]<<ME_MAP_SHIFT) + best[0])&(ME_MAP_SIZE-1);
if(map[index]!=key){ //this will be executed only very rarey
score_map[index]= cmp(s, best[0], best[1], 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[index]= key;
diff --git a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
index 84517f990a9..a88b837b3ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
@@ -351,5 +351,5 @@ AVCodec ff_motionpixels_decoder = {
.init = mp_decode_init,
.close = mp_decode_end,
.decode = mp_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c b/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
index 4820b263882..8ee7a3a42df 100644
--- a/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
@@ -28,7 +28,7 @@ static int text2movsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, co
const uint8_t *buf, int buf_size, int keyframe){
if (buf_size > 0xffff) return 0;
*poutbuf_size = buf_size + 2;
- *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = av_malloc(*poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
AV_WB16(*poutbuf, buf_size);
@@ -46,7 +46,7 @@ static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, co
const uint8_t *buf, int buf_size, int keyframe){
if (buf_size < 2) return 0;
*poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
- *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = av_malloc(*poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
memcpy(*poutbuf, buf + 2, *poutbuf_size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/movtextdec.c b/chromium/third_party/ffmpeg/libavcodec/movtextdec.c
index 8dda5cea0d6..257d5986f54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/movtextdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/movtextdec.c
@@ -27,24 +27,359 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
-#define STYLE_FLAG_BOLD 1
-#define STYLE_FLAG_ITALIC 2
-#define STYLE_FLAG_UNDERLINE 4
+#define STYLE_FLAG_BOLD (1<<0)
+#define STYLE_FLAG_ITALIC (1<<1)
+#define STYLE_FLAG_UNDERLINE (1<<2)
+
+#define BOX_SIZE_INITIAL 40
+
+#define STYL_BOX (1<<0)
+#define HLIT_BOX (1<<1)
+#define HCLR_BOX (1<<2)
+#define TWRP_BOX (1<<3)
+
+#define BOTTOM_LEFT 1
+#define BOTTOM_CENTER 2
+#define BOTTOM_RIGHT 3
+#define MIDDLE_LEFT 4
+#define MIDDLE_CENTER 5
+#define MIDDLE_RIGHT 6
+#define TOP_LEFT 7
+#define TOP_CENTER 8
+#define TOP_RIGHT 9
+
+typedef struct {
+ char *font;
+ int fontsize;
+ int color;
+ int back_color;
+ int bold;
+ int italic;
+ int underline;
+ int alignment;
+} MovTextDefault;
+
+typedef struct {
+ uint16_t fontID;
+ char *font;
+} FontRecord;
+
+typedef struct {
+ uint16_t style_start;
+ uint16_t style_end;
+ uint8_t style_flag;
+ uint8_t fontsize;
+ uint16_t style_fontID;
+} StyleBox;
+
+typedef struct {
+ uint16_t hlit_start;
+ uint16_t hlit_end;
+} HighlightBox;
+
+typedef struct {
+ uint8_t hlit_color[4];
+} HilightcolorBox;
+
+typedef struct {
+ uint8_t wrap_flag;
+} TextWrapBox;
+
+typedef struct {
+ StyleBox **s;
+ StyleBox *s_temp;
+ HighlightBox h;
+ HilightcolorBox c;
+ FontRecord **ftab;
+ FontRecord *ftab_temp;
+ TextWrapBox w;
+ MovTextDefault d;
+ uint8_t box_flags;
+ uint16_t style_entries, ftab_entries;
+ uint64_t tracksize;
+ int size_var;
+ int count_s, count_f;
+} MovTextContext;
+
+typedef struct {
+ uint32_t type;
+ size_t base_size;
+ int (*decode)(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt);
+} Box;
+
+static void mov_text_cleanup(MovTextContext *m)
+{
+ int i;
+ if (m->box_flags & STYL_BOX) {
+ for(i = 0; i < m->count_s; i++) {
+ av_freep(&m->s[i]);
+ }
+ av_freep(&m->s);
+ }
+}
+
+static void mov_text_cleanup_ftab(MovTextContext *m)
+{
+ int i;
+ if (m->ftab_temp)
+ av_freep(&m->ftab_temp->font);
+ av_freep(&m->ftab_temp);
+ if (m->ftab) {
+ for(i = 0; i < m->count_f; i++) {
+ av_freep(&m->ftab[i]->font);
+ av_freep(&m->ftab[i]);
+ }
+ }
+ av_freep(&m->ftab);
+}
+
+static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
+{
+ uint8_t *tx3g_ptr = avctx->extradata;
+ int i, box_size, font_length;
+ int8_t v_align, h_align;
+ int style_fontID;
+ StyleBox s_default;
+
+ m->count_f = 0;
+ m->ftab_entries = 0;
+ box_size = BOX_SIZE_INITIAL; /* Size till ftab_entries */
+ if (avctx->extradata_size < box_size)
+ return -1;
+
+ // Display Flags
+ tx3g_ptr += 4;
+ // Alignment
+ h_align = *tx3g_ptr++;
+ v_align = *tx3g_ptr++;
+ if (h_align == 0) {
+ if (v_align == 0)
+ m->d.alignment = TOP_LEFT;
+ if (v_align == 1)
+ m->d.alignment = MIDDLE_LEFT;
+ if (v_align == -1)
+ m->d.alignment = BOTTOM_LEFT;
+ }
+ if (h_align == 1) {
+ if (v_align == 0)
+ m->d.alignment = TOP_CENTER;
+ if (v_align == 1)
+ m->d.alignment = MIDDLE_CENTER;
+ if (v_align == -1)
+ m->d.alignment = BOTTOM_CENTER;
+ }
+ if (h_align == -1) {
+ if (v_align == 0)
+ m->d.alignment = TOP_RIGHT;
+ if (v_align == 1)
+ m->d.alignment = MIDDLE_RIGHT;
+ if (v_align == -1)
+ m->d.alignment = BOTTOM_RIGHT;
+ }
+ // Background Color
+ m->d.back_color = AV_RB24(tx3g_ptr);
+ tx3g_ptr += 4;
+ // BoxRecord
+ tx3g_ptr += 8;
+ // StyleRecord
+ tx3g_ptr += 4;
+ // fontID
+ style_fontID = AV_RB16(tx3g_ptr);
+ tx3g_ptr += 2;
+ // face-style-flags
+ s_default.style_flag = *tx3g_ptr++;
+ m->d.bold = s_default.style_flag & STYLE_FLAG_BOLD;
+ m->d.italic = s_default.style_flag & STYLE_FLAG_ITALIC;
+ m->d.underline = s_default.style_flag & STYLE_FLAG_UNDERLINE;
+ // fontsize
+ m->d.fontsize = *tx3g_ptr++;
+ // Primary color
+ m->d.color = AV_RB24(tx3g_ptr);
+ tx3g_ptr += 4;
+ // FontRecord
+ // FontRecord Size
+ tx3g_ptr += 4;
+ // ftab
+ tx3g_ptr += 4;
+
+ m->ftab_entries = AV_RB16(tx3g_ptr);
+ tx3g_ptr += 2;
+
+ for (i = 0; i < m->ftab_entries; i++) {
+
+ box_size += 3;
+ if (avctx->extradata_size < box_size) {
+ mov_text_cleanup_ftab(m);
+ m->ftab_entries = 0;
+ return -1;
+ }
+ m->ftab_temp = av_mallocz(sizeof(*m->ftab_temp));
+ if (!m->ftab_temp) {
+ mov_text_cleanup_ftab(m);
+ return AVERROR(ENOMEM);
+ }
+ m->ftab_temp->fontID = AV_RB16(tx3g_ptr);
+ tx3g_ptr += 2;
+ font_length = *tx3g_ptr++;
+
+ box_size = box_size + font_length;
+ if (avctx->extradata_size < box_size) {
+ mov_text_cleanup_ftab(m);
+ m->ftab_entries = 0;
+ return -1;
+ }
+ m->ftab_temp->font = av_malloc(font_length + 1);
+ if (!m->ftab_temp->font) {
+ mov_text_cleanup_ftab(m);
+ return AVERROR(ENOMEM);
+ }
+ memcpy(m->ftab_temp->font, tx3g_ptr, font_length);
+ m->ftab_temp->font[font_length] = '\0';
+ av_dynarray_add(&m->ftab, &m->count_f, m->ftab_temp);
+ if (!m->ftab) {
+ mov_text_cleanup_ftab(m);
+ return AVERROR(ENOMEM);
+ }
+ m->ftab_temp = NULL;
+ tx3g_ptr = tx3g_ptr + font_length;
+ }
+ for (i = 0; i < m->ftab_entries; i++) {
+ if (style_fontID == m->ftab[i]->fontID)
+ m->d.font = m->ftab[i]->font;
+ }
+ return 0;
+}
+
+static int decode_twrp(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
+{
+ m->box_flags |= TWRP_BOX;
+ m->w.wrap_flag = *tsmb++;
+ return 0;
+}
+
+static int decode_hlit(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
+{
+ m->box_flags |= HLIT_BOX;
+ m->h.hlit_start = AV_RB16(tsmb);
+ tsmb += 2;
+ m->h.hlit_end = AV_RB16(tsmb);
+ tsmb += 2;
+ return 0;
+}
+
+static int decode_hclr(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
+{
+ m->box_flags |= HCLR_BOX;
+ memcpy(m->c.hlit_color, tsmb, 4);
+ tsmb += 4;
+ return 0;
+}
+
+static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
+{
+ int i;
+ m->style_entries = AV_RB16(tsmb);
+ tsmb += 2;
+ // A single style record is of length 12 bytes.
+ if (m->tracksize + m->size_var + 2 + m->style_entries * 12 > avpkt->size)
+ return -1;
+
+ m->box_flags |= STYL_BOX;
+ for(i = 0; i < m->style_entries; i++) {
+ m->s_temp = av_malloc(sizeof(*m->s_temp));
+ if (!m->s_temp) {
+ mov_text_cleanup(m);
+ return AVERROR(ENOMEM);
+ }
+ m->s_temp->style_start = AV_RB16(tsmb);
+ tsmb += 2;
+ m->s_temp->style_end = AV_RB16(tsmb);
+ tsmb += 2;
+ m->s_temp->style_fontID = AV_RB16(tsmb);
+ tsmb += 2;
+ m->s_temp->style_flag = AV_RB8(tsmb);
+ tsmb++;
+ m->s_temp->fontsize = AV_RB8(tsmb);
+ av_dynarray_add(&m->s, &m->count_s, m->s_temp);
+ if(!m->s) {
+ mov_text_cleanup(m);
+ return AVERROR(ENOMEM);
+ }
+ tsmb++;
+ // text-color-rgba
+ tsmb += 4;
+ }
+ return 0;
+}
+
+static const Box box_types[] = {
+ { MKBETAG('s','t','y','l'), 2, decode_styl },
+ { MKBETAG('h','l','i','t'), 4, decode_hlit },
+ { MKBETAG('h','c','l','r'), 4, decode_hclr },
+ { MKBETAG('t','w','r','p'), 1, decode_twrp }
+};
+
+const static size_t box_count = FF_ARRAY_ELEMS(box_types);
static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
- char **style_start, char **style_end,
- uint8_t **style_flags, int style_entries)
+ MovTextContext *m)
{
int i = 0;
+ int j = 0;
+ int text_pos = 0;
+
+ if (text < text_end && m->box_flags & TWRP_BOX) {
+ if (m->w.wrap_flag == 1) {
+ av_bprintf(buf, "{\\q1}"); /* End of line wrap */
+ } else {
+ av_bprintf(buf, "{\\q2}"); /* No wrap */
+ }
+ }
+
while (text < text_end) {
- for (i = 0; i < style_entries; i++) {
- if (*style_flags[i] && text == style_start[i]) {
- if (*style_flags[i] & STYLE_FLAG_BOLD)
- av_bprintf(buf, "{\\b1}");
- if (*style_flags[i] & STYLE_FLAG_ITALIC)
- av_bprintf(buf, "{\\i1}");
- if (*style_flags[i] & STYLE_FLAG_UNDERLINE)
- av_bprintf(buf, "{\\u1}");
+ if (m->box_flags & STYL_BOX) {
+ for (i = 0; i < m->style_entries; i++) {
+ if (m->s[i]->style_flag && text_pos == m->s[i]->style_end) {
+ av_bprintf(buf, "{\\r}");
+ }
+ }
+ for (i = 0; i < m->style_entries; i++) {
+ if (m->s[i]->style_flag && text_pos == m->s[i]->style_start) {
+ if (m->s[i]->style_flag & STYLE_FLAG_BOLD)
+ av_bprintf(buf, "{\\b1}");
+ if (m->s[i]->style_flag & STYLE_FLAG_ITALIC)
+ av_bprintf(buf, "{\\i1}");
+ if (m->s[i]->style_flag & STYLE_FLAG_UNDERLINE)
+ av_bprintf(buf, "{\\u1}");
+ av_bprintf(buf, "{\\fs%d}", m->s[i]->fontsize);
+ for (j = 0; j < m->ftab_entries; j++) {
+ if (m->s[i]->style_fontID == m->ftab[j]->fontID)
+ av_bprintf(buf, "{\\fn%s}", m->ftab[j]->font);
+ }
+ }
+ }
+ }
+ if (m->box_flags & HLIT_BOX) {
+ if (text_pos == m->h.hlit_start) {
+ /* If hclr box is present, set the secondary color to the color
+ * specified. Otherwise, set primary color to white and secondary
+ * color to black. These colors will come from TextSampleModifier
+ * boxes in future and inverse video technique for highlight will
+ * be implemented.
+ */
+ if (m->box_flags & HCLR_BOX) {
+ av_bprintf(buf, "{\\2c&H%02x%02x%02x&}", m->c.hlit_color[2],
+ m->c.hlit_color[1], m->c.hlit_color[0]);
+ } else {
+ av_bprintf(buf, "{\\1c&H000000&}{\\2c&HFFFFFF&}");
+ }
+ }
+ if (text_pos == m->h.hlit_end) {
+ if (m->box_flags & HCLR_BOX) {
+ av_bprintf(buf, "{\\2c&H000000&}");
+ } else {
+ av_bprintf(buf, "{\\1c&HFFFFFF&}{\\2c&H000000&}");
+ }
}
}
@@ -58,18 +393,8 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
av_bprint_chars(buf, *text, 1);
break;
}
-
- for (i = 0; i < style_entries; i++) {
- if (*style_flags[i] && text == style_end[i]) {
- if (*style_flags[i] & STYLE_FLAG_BOLD)
- av_bprintf(buf, "{\\b0}");
- if (*style_flags[i] & STYLE_FLAG_ITALIC)
- av_bprintf(buf, "{\\i0}");
- if (*style_flags[i] & STYLE_FLAG_UNDERLINE)
- av_bprintf(buf, "{\\u0}");
- }
- }
text++;
+ text_pos++;
}
return 0;
@@ -82,27 +407,29 @@ static int mov_text_init(AVCodecContext *avctx) {
* it's very common to find files where the default style is broken
* and respecting it results in a worse experience than ignoring it.
*/
- return ff_ass_subtitle_header_default(avctx);
+ int ret;
+ MovTextContext *m = avctx->priv_data;
+ ret = mov_text_tx3g(avctx, m);
+ if (ret == 0) {
+ return ff_ass_subtitle_header(avctx, m->d.font, m->d.fontsize, m->d.color,
+ m->d.back_color, m->d.bold, m->d.italic,
+ m->d.underline, m->d.alignment);
+ } else
+ return ff_ass_subtitle_header_default(avctx);
}
static int mov_text_decode_frame(AVCodecContext *avctx,
void *data, int *got_sub_ptr, AVPacket *avpkt)
{
AVSubtitle *sub = data;
+ MovTextContext *m = avctx->priv_data;
int ret, ts_start, ts_end;
AVBPrint buf;
char *ptr = avpkt->data;
char *end;
- //char *ptr_temp;
- int text_length, tsmb_type, style_entries;
- uint64_t tsmb_size, tracksize;
- char **style_start = { 0, };
- char **style_end = { 0, };
- uint8_t **style_flags = { 0, };
+ int text_length, tsmb_type, ret_tsmb;
+ uint64_t tsmb_size;
const uint8_t *tsmb;
- int index, i, size_var;
- uint8_t *flag;
- char *style_pos;
if (!ptr || avpkt->size < 2)
return AVERROR_INVALIDDATA;
@@ -134,76 +461,49 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
(AVRational){1,100});
tsmb_size = 0;
- tracksize = 2 + text_length;
+ m->tracksize = 2 + text_length;
+ m->style_entries = 0;
+ m->box_flags = 0;
+ m->count_s = 0;
// Note that the spec recommends lines be no longer than 2048 characters.
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
if (text_length + 2 != avpkt->size) {
- while (tracksize + 8 <= avpkt->size) {
+ while (m->tracksize + 8 <= avpkt->size) {
// A box is a minimum of 8 bytes.
- tsmb = ptr + tracksize - 2;
+ tsmb = ptr + m->tracksize - 2;
tsmb_size = AV_RB32(tsmb);
tsmb += 4;
tsmb_type = AV_RB32(tsmb);
tsmb += 4;
if (tsmb_size == 1) {
- if (tracksize + 16 > avpkt->size)
+ if (m->tracksize + 16 > avpkt->size)
break;
tsmb_size = AV_RB64(tsmb);
tsmb += 8;
- size_var = 18;
+ m->size_var = 16;
} else
- size_var = 10;
- //size_var is equal to 10 or 18 depending on the size of box
+ m->size_var = 8;
+ //size_var is equal to 8 or 16 depending on the size of box
- if (tracksize + tsmb_size > avpkt->size)
+ if (m->tracksize + tsmb_size > avpkt->size)
break;
- if (tsmb_type == MKBETAG('s','t','y','l')) {
- if (tracksize + size_var > avpkt->size)
- break;
- style_entries = AV_RB16(tsmb);
- tsmb += 2;
-
- // A single style record is of length 12 bytes.
- if (tracksize + size_var + style_entries * 12 > avpkt->size)
- break;
-
- for(i = 0; i < style_entries; i++) {
- style_pos = ptr + AV_RB16(tsmb);
- index = i;
- av_dynarray_add(&style_start, &index, style_pos);
- tsmb += 2;
- style_pos = ptr + AV_RB16(tsmb);
- index = i;
- av_dynarray_add(&style_end, &index, style_pos);
- tsmb += 2;
- // fontID = AV_RB16(tsmb);
- tsmb += 2;
- flag = av_malloc(1);
- if (!flag)
- return AVERROR(ENOMEM);
- *flag = AV_RB8(tsmb);
- index = i;
- av_dynarray_add(&style_flags, &index, flag);
- //fontsize=AV_RB8(tsmb);
- tsmb += 2;
- // text-color-rgba
- tsmb += 4;
+ for (size_t i = 0; i < box_count; i++) {
+ if (tsmb_type == box_types[i].type) {
+ if (m->tracksize + m->size_var + box_types[i].base_size > avpkt->size)
+ break;
+ ret_tsmb = box_types[i].decode(tsmb, m, avpkt);
+ if (ret_tsmb == -1)
+ break;
}
- text_to_ass(&buf, ptr, end, style_start, style_end, style_flags, style_entries);
-
- for(i = 0; i < style_entries; i++) {
- av_freep(&style_flags[i]);
- }
- av_freep(&style_start);
- av_freep(&style_end);
- av_freep(&style_flags);
}
- tracksize = tracksize + tsmb_size;
+ m->tracksize = m->tracksize + tsmb_size;
}
+ text_to_ass(&buf, ptr, end, m);
+ mov_text_cleanup(m);
} else
- text_to_ass(&buf, ptr, end, NULL, NULL, 0, 0);
+ text_to_ass(&buf, ptr, end, m);
ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end - ts_start);
av_bprint_finalize(&buf, NULL);
@@ -213,11 +513,20 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
return avpkt->size;
}
+static int mov_text_decode_close(AVCodecContext *avctx)
+{
+ MovTextContext *m = avctx->priv_data;
+ mov_text_cleanup_ftab(m);
+ return 0;
+}
+
AVCodec ff_movtext_decoder = {
.name = "mov_text",
.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_MOV_TEXT,
+ .priv_data_size = sizeof(MovTextContext),
.init = mov_text_init,
.decode = mov_text_decode_frame,
+ .close = mov_text_decode_close,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/movtextenc.c b/chromium/third_party/ffmpeg/libavcodec/movtextenc.c
index 1b8f454f8b9..6d42d5f351d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/movtextenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/movtextenc.c
@@ -24,16 +24,130 @@
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+#include "libavutil/common.h"
#include "ass_split.h"
#include "ass.h"
+#define STYLE_FLAG_BOLD (1<<0)
+#define STYLE_FLAG_ITALIC (1<<1)
+#define STYLE_FLAG_UNDERLINE (1<<2)
+#define STYLE_RECORD_SIZE 12
+#define SIZE_ADD 10
+
+#define STYL_BOX (1<<0)
+#define HLIT_BOX (1<<1)
+#define HCLR_BOX (1<<2)
+
+#define av_bprint_append_any(buf, data, size) av_bprint_append_data(buf, ((const char*)data), size)
+
+typedef struct {
+ uint16_t style_start;
+ uint16_t style_end;
+ uint8_t style_flag;
+} StyleBox;
+
+typedef struct {
+ uint16_t start;
+ uint16_t end;
+} HighlightBox;
+
+typedef struct {
+ uint32_t color;
+} HilightcolorBox;
+
typedef struct {
ASSSplitContext *ass_ctx;
- char buffer[2048];
- char *ptr;
- char *end;
+ AVBPrint buffer;
+ StyleBox **style_attributes;
+ StyleBox *style_attributes_temp;
+ HighlightBox hlit;
+ HilightcolorBox hclr;
+ int count;
+ uint8_t box_flags;
+ uint16_t style_entries;
+ uint16_t style_fontID;
+ uint8_t style_fontsize;
+ uint32_t style_color;
+ uint16_t text_pos;
} MovTextContext;
+typedef struct {
+ uint32_t type;
+ void (*encode)(MovTextContext *s, uint32_t tsmb_type);
+} Box;
+
+static void mov_text_cleanup(MovTextContext *s)
+{
+ int j;
+ if (s->box_flags & STYL_BOX) {
+ for (j = 0; j < s->count; j++) {
+ av_freep(&s->style_attributes[j]);
+ }
+ av_freep(&s->style_attributes);
+ }
+}
+
+static void encode_styl(MovTextContext *s, uint32_t tsmb_type)
+{
+ int j;
+ uint32_t tsmb_size;
+ if (s->box_flags & STYL_BOX) {
+ tsmb_size = s->count * STYLE_RECORD_SIZE + SIZE_ADD;
+ tsmb_size = AV_RB32(&tsmb_size);
+ s->style_entries = AV_RB16(&s->count);
+ s->style_fontID = 0x00 | 0x01<<8;
+ s->style_fontsize = 0x12;
+ s->style_color = MKTAG(0xFF, 0xFF, 0xFF, 0xFF);
+ /*The above three attributes are hard coded for now
+ but will come from ASS style in the future*/
+ av_bprint_append_any(&s->buffer, &tsmb_size, 4);
+ av_bprint_append_any(&s->buffer, &tsmb_type, 4);
+ av_bprint_append_any(&s->buffer, &s->style_entries, 2);
+ for (j = 0; j < s->count; j++) {
+ av_bprint_append_any(&s->buffer, &s->style_attributes[j]->style_start, 2);
+ av_bprint_append_any(&s->buffer, &s->style_attributes[j]->style_end, 2);
+ av_bprint_append_any(&s->buffer, &s->style_fontID, 2);
+ av_bprint_append_any(&s->buffer, &s->style_attributes[j]->style_flag, 1);
+ av_bprint_append_any(&s->buffer, &s->style_fontsize, 1);
+ av_bprint_append_any(&s->buffer, &s->style_color, 4);
+ }
+ mov_text_cleanup(s);
+ }
+}
+
+static void encode_hlit(MovTextContext *s, uint32_t tsmb_type)
+{
+ uint32_t tsmb_size;
+ if (s->box_flags & HLIT_BOX) {
+ tsmb_size = 12;
+ tsmb_size = AV_RB32(&tsmb_size);
+ av_bprint_append_any(&s->buffer, &tsmb_size, 4);
+ av_bprint_append_any(&s->buffer, &tsmb_type, 4);
+ av_bprint_append_any(&s->buffer, &s->hlit.start, 2);
+ av_bprint_append_any(&s->buffer, &s->hlit.end, 2);
+ }
+}
+
+static void encode_hclr(MovTextContext *s, uint32_t tsmb_type)
+{
+ uint32_t tsmb_size;
+ if (s->box_flags & HCLR_BOX) {
+ tsmb_size = 12;
+ tsmb_size = AV_RB32(&tsmb_size);
+ av_bprint_append_any(&s->buffer, &tsmb_size, 4);
+ av_bprint_append_any(&s->buffer, &tsmb_type, 4);
+ av_bprint_append_any(&s->buffer, &s->hclr.color, 4);
+ }
+}
+
+static const Box box_types[] = {
+ { MKTAG('s','t','y','l'), encode_styl },
+ { MKTAG('h','l','i','t'), encode_hlit },
+ { MKTAG('h','c','l','r'), encode_hclr },
+};
+
+const static size_t box_count = FF_ARRAY_ELEMS(box_types);
static av_cold int mov_text_encode_init(AVCodecContext *avctx)
{
@@ -75,36 +189,134 @@ static av_cold int mov_text_encode_init(AVCodecContext *avctx)
MovTextContext *s = avctx->priv_data;
avctx->extradata_size = sizeof text_sample_entry;
- avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
+ av_bprint_init(&s->buffer, 0, AV_BPRINT_SIZE_UNLIMITED);
+
memcpy(avctx->extradata, text_sample_entry, avctx->extradata_size);
s->ass_ctx = ff_ass_split(avctx->subtitle_header);
return s->ass_ctx ? 0 : AVERROR_INVALIDDATA;
}
+static void mov_text_style_cb(void *priv, const char style, int close)
+{
+ MovTextContext *s = priv;
+ if (!close) {
+ if (!(s->box_flags & STYL_BOX)) { //first style entry
+
+ s->style_attributes_temp = av_malloc(sizeof(*s->style_attributes_temp));
+
+ if (!s->style_attributes_temp) {
+ av_bprint_clear(&s->buffer);
+ s->box_flags &= ~STYL_BOX;
+ return;
+ }
+
+ s->style_attributes_temp->style_flag = 0;
+ s->style_attributes_temp->style_start = AV_RB16(&s->text_pos);
+ } else {
+ if (s->style_attributes_temp->style_flag) { //break the style record here and start a new one
+ s->style_attributes_temp->style_end = AV_RB16(&s->text_pos);
+ av_dynarray_add(&s->style_attributes, &s->count, s->style_attributes_temp);
+ s->style_attributes_temp = av_malloc(sizeof(*s->style_attributes_temp));
+ if (!s->style_attributes_temp) {
+ mov_text_cleanup(s);
+ av_bprint_clear(&s->buffer);
+ s->box_flags &= ~STYL_BOX;
+ return;
+ }
+
+ s->style_attributes_temp->style_flag = s->style_attributes[s->count - 1]->style_flag;
+ s->style_attributes_temp->style_start = AV_RB16(&s->text_pos);
+ } else {
+ s->style_attributes_temp->style_flag = 0;
+ s->style_attributes_temp->style_start = AV_RB16(&s->text_pos);
+ }
+ }
+ switch (style){
+ case 'b':
+ s->style_attributes_temp->style_flag |= STYLE_FLAG_BOLD;
+ break;
+ case 'i':
+ s->style_attributes_temp->style_flag |= STYLE_FLAG_ITALIC;
+ break;
+ case 'u':
+ s->style_attributes_temp->style_flag |= STYLE_FLAG_UNDERLINE;
+ break;
+ }
+ } else {
+ s->style_attributes_temp->style_end = AV_RB16(&s->text_pos);
+ av_dynarray_add(&s->style_attributes, &s->count, s->style_attributes_temp);
+
+ s->style_attributes_temp = av_malloc(sizeof(*s->style_attributes_temp));
+
+ if (!s->style_attributes_temp) {
+ mov_text_cleanup(s);
+ av_bprint_clear(&s->buffer);
+ s->box_flags &= ~STYL_BOX;
+ return;
+ }
+
+ s->style_attributes_temp->style_flag = s->style_attributes[s->count - 1]->style_flag;
+ switch (style){
+ case 'b':
+ s->style_attributes_temp->style_flag &= ~STYLE_FLAG_BOLD;
+ break;
+ case 'i':
+ s->style_attributes_temp->style_flag &= ~STYLE_FLAG_ITALIC;
+ break;
+ case 'u':
+ s->style_attributes_temp->style_flag &= ~STYLE_FLAG_UNDERLINE;
+ break;
+ }
+ if (s->style_attributes_temp->style_flag) { //start of new style record
+ s->style_attributes_temp->style_start = AV_RB16(&s->text_pos);
+ }
+ }
+ s->box_flags |= STYL_BOX;
+}
+
+static void mov_text_color_cb(void *priv, unsigned int color, unsigned int color_id)
+{
+ MovTextContext *s = priv;
+ if (color_id == 2) { //secondary color changes
+ if (s->box_flags & HLIT_BOX) { //close tag
+ s->hlit.end = AV_RB16(&s->text_pos);
+ } else {
+ s->box_flags |= HCLR_BOX;
+ s->box_flags |= HLIT_BOX;
+ s->hlit.start = AV_RB16(&s->text_pos);
+ s->hclr.color = color | (0xFF << 24); //set alpha value to FF
+ }
+ }
+ /* If there are more than one secondary color changes in ASS, take start of
+ first section and end of last section. Movtext allows only one
+ highlight box per sample.
+ */
+}
+
static void mov_text_text_cb(void *priv, const char *text, int len)
{
MovTextContext *s = priv;
- av_assert0(s->end >= s->ptr);
- av_strlcpy(s->ptr, text, FFMIN(s->end - s->ptr, len + 1));
- s->ptr += FFMIN(s->end - s->ptr, len);
+ av_bprint_append_data(&s->buffer, text, len);
+ s->text_pos += len;
}
static void mov_text_new_line_cb(void *priv, int forced)
{
MovTextContext *s = priv;
- av_assert0(s->end >= s->ptr);
- av_strlcpy(s->ptr, "\n", FFMIN(s->end - s->ptr, 2));
- if (s->end > s->ptr)
- s->ptr++;
+ av_bprint_append_data(&s->buffer, "\n", 1);
+ s->text_pos += 1;
}
static const ASSCodesCallbacks mov_text_callbacks = {
.text = mov_text_text_cb,
.new_line = mov_text_new_line_cb,
+ .style = mov_text_style_cb,
+ .color = mov_text_color_cb,
};
static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
@@ -112,11 +324,13 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
{
MovTextContext *s = avctx->priv_data;
ASSDialog *dialog;
- int i, len, num;
-
- s->ptr = s->buffer;
- s->end = s->ptr + sizeof(s->buffer);
+ int i, num, length;
+ size_t j;
+ s->text_pos = 0;
+ s->count = 0;
+ s->box_flags = 0;
+ s->style_entries = 0;
for (i = 0; i < sub->num_rects; i++) {
if (sub->rects[i]->type != SUBTITLE_ASS) {
@@ -128,28 +342,44 @@ static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf,
for (; dialog && num--; dialog++) {
ff_ass_split_override_codes(&mov_text_callbacks, s, dialog->text);
}
- }
- if (s->ptr == s->buffer)
- return 0;
+ for (j = 0; j < box_count; j++) {
+ box_types[j].encode(s, box_types[j].type);
+ }
+ }
- AV_WB16(buf, strlen(s->buffer));
+ AV_WB16(buf, s->text_pos);
buf += 2;
- len = av_strlcpy(buf, s->buffer, bufsize - 2);
+ if (!av_bprint_is_complete(&s->buffer)) {
+ length = AVERROR(ENOMEM);
+ goto exit;
+ }
+
+ if (!s->buffer.len) {
+ length = 0;
+ goto exit;
+ }
- if (len > bufsize-3) {
+ if (s->buffer.len > bufsize - 3) {
av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
- return AVERROR(EINVAL);
+ length = AVERROR(EINVAL);
+ goto exit;
}
- return len + 2;
+ memcpy(buf, s->buffer.str, s->buffer.len);
+ length = s->buffer.len + 2;
+
+exit:
+ av_bprint_clear(&s->buffer);
+ return length;
}
static int mov_text_encode_close(AVCodecContext *avctx)
{
MovTextContext *s = avctx->priv_data;
ff_ass_split_free(s->ass_ctx);
+ av_bprint_finalize(&s->buffer, NULL);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mp3_header_decompress_bsf.c b/chromium/third_party/ffmpeg/libavcodec/mp3_header_decompress_bsf.c
index df455322dfb..95c0b5b7695 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mp3_header_decompress_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mp3_header_decompress_bsf.c
@@ -71,8 +71,8 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext
header |= (frame_size == buf_size + 4)<<16; //FIXME actually set a correct crc instead of 0
*poutbuf_size= frame_size;
- *poutbuf= av_malloc(frame_size + FF_INPUT_BUFFER_PADDING_SIZE);
- memcpy(*poutbuf + frame_size - buf_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf= av_malloc(frame_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ memcpy(*poutbuf + frame_size - buf_size, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if(avctx->channels==2){
uint8_t *p= *poutbuf + frame_size - buf_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpc7.c b/chromium/third_party/ffmpeg/libavcodec/mpc7.c
index 0f1e34a8f4e..d38b22a2b3c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpc7.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpc7.c
@@ -337,7 +337,7 @@ AVCodec ff_mpc7_decoder = {
.close = mpc7_decode_close,
.decode = mpc7_decode_frame,
.flush = mpc7_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpc8.c b/chromium/third_party/ffmpeg/libavcodec/mpc8.c
index 29c65f9ef54..a8feb6c4ce6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpc8.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpc8.c
@@ -440,7 +440,7 @@ AVCodec ff_mpc8_decoder = {
.init = mpc8_decode_init,
.decode = mpc8_decode_frame,
.flush = mpc8_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c b/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
index af5583fa8e4..92f2f277e69 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg12dec.c
@@ -843,7 +843,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks
if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- if (s->avctx->flags2 & CODEC_FLAG2_FAST) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_FAST) {
for (i = 0; i < 6; i++)
mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i);
} else {
@@ -1063,7 +1063,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
ff_xvmc_pack_pblocks(s, cbp);
if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- if (s->avctx->flags2 & CODEC_FLAG2_FAST) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_FAST) {
for (i = 0; i < 6; i++) {
if (cbp & 32)
mpeg2_fast_decode_block_non_intra(s, *s->pblocks[i], i);
@@ -1085,7 +1085,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
}
}
} else {
- if (s->avctx->flags2 & CODEC_FLAG2_FAST) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_FAST) {
for (i = 0; i < 6; i++) {
if (cbp & 32)
mpeg1_fast_decode_block_inter(s, *s->pblocks[i], i);
@@ -1185,8 +1185,10 @@ static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG1_XVMC_HWACCEL
AV_PIX_FMT_XVMC,
#endif
-#if CONFIG_MPEG1_VDPAU_HWACCEL
+#if CONFIG_MPEG1_VDPAU_DECODER && FF_API_VDPAU
AV_PIX_FMT_VDPAU_MPEG1,
+#endif
+#if CONFIG_MPEG1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
AV_PIX_FMT_YUV420P,
@@ -1197,8 +1199,10 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG2_XVMC_HWACCEL
AV_PIX_FMT_XVMC,
#endif
-#if CONFIG_MPEG2_VDPAU_HWACCEL
+#if CONFIG_MPEG_VDPAU_DECODER && FF_API_VDPAU
AV_PIX_FMT_VDPAU_MPEG2,
+#endif
+#if CONFIG_MPEG2_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
#if CONFIG_MPEG2_DXVA2_HWACCEL
@@ -1208,7 +1212,10 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
AV_PIX_FMT_D3D11VA_VLD,
#endif
#if CONFIG_MPEG2_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI_VLD,
+ AV_PIX_FMT_VAAPI,
+#endif
+#if CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL
+ AV_PIX_FMT_VIDEOTOOLBOX,
#endif
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE
@@ -1224,9 +1231,11 @@ static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = {
AV_PIX_FMT_NONE
};
+#if FF_API_VDPAU
static inline int uses_vdpau(AVCodecContext *avctx) {
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
}
+#endif
static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
{
@@ -1234,7 +1243,7 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
MpegEncContext *s = &s1->mpeg_enc_ctx;
const enum AVPixelFormat *pix_fmts;
- if (CONFIG_GRAY && (avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY))
return AV_PIX_FMT_GRAY8;
if (s->chroma_format < 2)
@@ -1252,7 +1261,11 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
{
// until then pix_fmt may be changed right after codec init
- if (avctx->hwaccel || uses_vdpau(avctx))
+ if (avctx->hwaccel
+#if FF_API_VDPAU
+ || uses_vdpau(avctx)
+#endif
+ )
if (avctx->idct_algo == FF_IDCT_AUTO)
avctx->idct_algo = FF_IDCT_SIMPLE;
@@ -1262,7 +1275,9 @@ static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
s->pack_pblocks = 1;
#if FF_API_XVMC
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->xvmc_acceleration = 2;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_XVMC */
}
}
@@ -1380,6 +1395,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
case 1: avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; break;
case 2:
case 3: avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; break;
+ default: av_assert0(0);
}
} // MPEG-2
@@ -1462,17 +1478,23 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
s->avctx->level = get_bits(&s->gb, 4);
s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
+
+ if (!s->chroma_format) {
+ s->chroma_format = 1;
+ av_log(s->avctx, AV_LOG_WARNING, "Chroma format invalid\n");
+ }
+
horiz_size_ext = get_bits(&s->gb, 2);
vert_size_ext = get_bits(&s->gb, 2);
s->width |= (horiz_size_ext << 12);
s->height |= (vert_size_ext << 12);
bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */
- s->bit_rate += (bit_rate_ext << 18) * 400;
+ s->bit_rate += (bit_rate_ext << 18) * 400LL;
check_marker(&s->gb, "after bit rate extension");
s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10;
s->low_delay = get_bits1(&s->gb);
- if (s->avctx->flags & CODEC_FLAG_LOW_DELAY)
+ if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
s->low_delay = 1;
s1->frame_rate_ext.num = get_bits(&s->gb, 2) + 1;
@@ -1483,7 +1505,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG,
- "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%d\n",
+ "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"PRId64"\n",
s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format,
s->avctx->rc_buffer_size, s->bit_rate);
}
@@ -1684,6 +1706,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
if (sd)
memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
av_freep(&s1->a53_caption);
+ avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
}
if (s1->has_stereo3d) {
@@ -1718,9 +1741,11 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
if (s->avctx->hwaccel &&
(s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
- if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
+ if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) {
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode first field\n");
+ return ret;
+ }
}
for (i = 0; i < 4; i++) {
@@ -1937,7 +1962,6 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
// area, we detect this here instead of running into the end expecting
// more data
if (s->mb_y >= ((s->height + 15) >> 4) &&
- s->progressive_frame &&
!s->progressive_sequence &&
get_bits_left(&s->gb) <= 8 &&
get_bits_left(&s->gb) >= 0 &&
@@ -2078,9 +2102,12 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
return 0;
if (s->avctx->hwaccel) {
- if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
+ int ret = s->avctx->hwaccel->end_frame(s->avctx);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode picture\n");
+ return ret;
+ }
}
/* end of slice reached */
@@ -2147,12 +2174,10 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
"frame_rate_index %d is invalid\n", s->frame_rate_index);
s->frame_rate_index = 1;
}
- s->bit_rate = get_bits(&s->gb, 18) * 400;
+ s->bit_rate = get_bits(&s->gb, 18) * 400LL;
if (check_marker(&s->gb, "in sequence header") == 0) {
return AVERROR_INVALIDDATA;
}
- s->width = width;
- s->height = height;
s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16;
skip_bits(&s->gb, 1);
@@ -2184,6 +2209,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
+ s->width = width;
+ s->height = height;
+
/* We set MPEG-2 parameters so that it emulates MPEG-1. */
s->progressive_sequence = 1;
s->progressive_frame = 1;
@@ -2195,11 +2223,11 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
s->out_format = FMT_MPEG1;
s->swap_uv = 0; // AFAIK VCR2 does not have SEQ_HEADER
- if (s->avctx->flags & CODEC_FLAG_LOW_DELAY)
+ if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
s->low_delay = 1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d, aspect_ratio_info: %d \n",
+ av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n",
s->avctx->rc_buffer_size, s->bit_rate, s->aspect_ratio_info);
return 0;
@@ -2444,9 +2472,11 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
s2->er.error_count += s2->thread_context[i]->er.error_count;
}
+#if FF_API_VDPAU
if ((CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER)
&& uses_vdpau(avctx))
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
+#endif
ret = slice_end(avctx, picture);
if (ret < 0)
@@ -2648,7 +2678,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
}
}
}
- if (s2->pict_type == AV_PICTURE_TYPE_I || (s2->avctx->flags2 & CODEC_FLAG2_SHOW_ALL))
+ if (s2->pict_type == AV_PICTURE_TYPE_I || (s2->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL))
s->sync = 1;
if (!s2->next_picture_ptr) {
/* Skip P-frames if we do not have a reference frame or
@@ -2695,10 +2725,12 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
return AVERROR_INVALIDDATA;
}
+#if FF_API_VDPAU
if (uses_vdpau(avctx)) {
s->slice_count++;
break;
}
+#endif
if (HAVE_THREADS &&
(avctx->active_thread_type & FF_THREAD_SLICE) &&
@@ -2769,7 +2801,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
- if (s2->avctx->flags & CODEC_FLAG_TRUNCATED) {
+ if (s2->avctx->flags & AV_CODEC_FLAG_TRUNCATED) {
int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
buf_size, NULL);
@@ -2847,9 +2879,9 @@ AVCodec ff_mpeg1video_decoder = {
.init = mpeg_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
- CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_SLICE_THREADS,
.flush = flush,
.max_lowres = 3,
.update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context)
@@ -2864,9 +2896,9 @@ AVCodec ff_mpeg2video_decoder = {
.init = mpeg_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
- CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_SLICE_THREADS,
.flush = flush,
.max_lowres = 3,
.profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
@@ -2882,13 +2914,14 @@ AVCodec ff_mpegvideo_decoder = {
.init = mpeg_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.flush = flush,
.max_lowres = 3,
};
#if FF_API_XVMC
#if CONFIG_MPEG_XVMC_DECODER
+FF_DISABLE_DEPRECATION_WARNINGS
static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
{
if (avctx->active_thread_type & FF_THREAD_SLICE)
@@ -2915,15 +2948,16 @@ AVCodec ff_mpeg_xvmc_decoder = {
.init = mpeg_mc_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL |
+ AV_CODEC_CAP_DELAY,
.flush = flush,
};
-
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
#endif /* FF_API_XVMC */
-#if CONFIG_MPEG_VDPAU_DECODER
+#if CONFIG_MPEG_VDPAU_DECODER && FF_API_VDPAU
AVCodec ff_mpeg_vdpau_decoder = {
.name = "mpegvideo_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU acceleration)"),
@@ -2933,13 +2967,13 @@ AVCodec ff_mpeg_vdpau_decoder = {
.init = mpeg_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED |
- CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_TRUNCATED |
+ AV_CODEC_CAP_HWACCEL_VDPAU | AV_CODEC_CAP_DELAY,
.flush = flush,
};
#endif
-#if CONFIG_MPEG1_VDPAU_DECODER
+#if CONFIG_MPEG1_VDPAU_DECODER && FF_API_VDPAU
AVCodec ff_mpeg1_vdpau_decoder = {
.name = "mpeg1video_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
@@ -2949,8 +2983,8 @@ AVCodec ff_mpeg1_vdpau_decoder = {
.init = mpeg_decode_init,
.close = mpeg_decode_end,
.decode = mpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED |
- CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_TRUNCATED |
+ AV_CODEC_CAP_HWACCEL_VDPAU | AV_CODEC_CAP_DELAY,
.flush = flush,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c b/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
index d131e482850..6f871170589 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg12enc.c
@@ -42,9 +42,10 @@
#include "mpegutils.h"
#include "mpegvideo.h"
-
-static const uint8_t inv_non_linear_qscale[] = {
+static const int8_t inv_non_linear_qscale[] = {
0, 2, 4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ -1,17,-1,18,-1,19, -1, 20, -1, 21, -1, 22, -1,
+ 23,-1,24,-1,-1,-1
};
static const uint8_t svcd_scan_offset_placeholder[] = {
@@ -205,7 +206,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
}
- s->drop_frame_timecode = s->drop_frame_timecode || !!(avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE);
+ s->drop_frame_timecode = s->drop_frame_timecode || !!(avctx->flags2 & AV_CODEC_FLAG2_DROP_FRAME_TIMECODE);
if (s->drop_frame_timecode)
s->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME;
if (s->drop_frame_timecode && s->frame_rate_index != 4) {
@@ -384,7 +385,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
put_bits(&s->pb, 6, (uint32_t)((time_code % fps)));
- put_bits(&s->pb, 1, !!(s->avctx->flags & CODEC_FLAG_CLOSED_GOP) || s->intra_only || !s->gop_picture_number);
+ put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) || s->intra_only || !s->gop_picture_number);
put_bits(&s->pb, 1, 0); // broken link
}
}
@@ -402,8 +403,9 @@ static inline void encode_mb_skip_run(MpegEncContext *s, int run)
static av_always_inline void put_qscale(MpegEncContext *s)
{
if (s->q_scale_type) {
- av_assert2(s->qscale >= 1 && s->qscale <= 12);
- put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]);
+ int qp = inv_non_linear_qscale[s->qscale];
+ av_assert2(s->qscale >= 1 && qp > 0);
+ put_bits(&s->pb, 5, qp);
} else {
put_bits(&s->pb, 5, s->qscale);
}
@@ -1155,7 +1157,7 @@ AVCodec ff_mpeg1video_encoder = {
.supported_framerates = ff_mpeg12_frame_rate_tab + 1,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.priv_class = &mpeg1_class,
};
@@ -1172,6 +1174,6 @@ AVCodec ff_mpeg2video_encoder = {
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P,
AV_PIX_FMT_NONE },
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.priv_class = &mpeg2_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c
index e85ea08b082..df49d3f4074 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c
@@ -73,11 +73,11 @@ static void scan_buffer(const uint8_t *buf, int buf_size,
/* allocate new buffer and copy size bytes from src */
static uint8_t *create_new_buffer(const uint8_t *src, int size) {
- uint8_t *dst = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ uint8_t *dst = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (dst) {
memcpy(dst, src, size);
- memset(dst + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(dst + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
return dst;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
index 0c1b7dfe9a0..c7e730c93ee 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4videodec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "error_resilience.h"
#include "idctdsp.h"
@@ -1352,6 +1353,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
else
s->mcsel = 0;
cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
+ if (cbpy < 0) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "P cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
+ return AVERROR_INVALIDDATA;
+ }
cbp = (cbpc & 3) | (cbpy << 2);
if (dquant)
@@ -2221,7 +2227,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* pict type: I = 0 , P = 1 */
if (s->pict_type == AV_PICTURE_TYPE_B && s->low_delay &&
- ctx->vol_control_parameters == 0 && !(s->avctx->flags & CODEC_FLAG_LOW_DELAY)) {
+ ctx->vol_control_parameters == 0 && !(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)) {
av_log(s->avctx, AV_LOG_ERROR, "low_delay flag set incorrectly, clearing it\n");
s->low_delay = 0;
}
@@ -2313,9 +2319,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
pts = ROUNDED_DIV(s->time, s->avctx->framerate.den);
else
pts = AV_NOPTS_VALUE;
- if (s->avctx->debug&FF_DEBUG_PTS)
- av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n",
- pts);
+ ff_dlog(s->avctx, "MPEG4 PTS: %"PRId64"\n", pts);
check_marker(gb, "before vop_coded");
@@ -2600,7 +2604,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
}
end:
- if (s->avctx->flags & CODEC_FLAG_LOW_DELAY)
+ if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
s->low_delay = 1;
s->avctx->has_b_frames = !s->low_delay;
@@ -2663,7 +2667,7 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
if (!ctx->showed_packed_warning) {
av_log(s->avctx, AV_LOG_INFO, "Video uses a non-standard and "
"wasteful way to store B-frames ('packed B-frames'). "
- "Consider using the mpeg4_unpack_bframes bitstream filter to fix it.\n");
+ "Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.\n");
ctx->showed_packed_warning = 1;
}
av_fast_padded_malloc(&s->bitstream_buffer,
@@ -2750,8 +2754,8 @@ static const AVProfile mpeg4_video_profiles[] = {
};
static const AVOption mpeg4_options[] = {
- {"quarter_sample", "1/4 subpel MC", offsetof(MpegEncContext, quarter_sample), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
- {"divx_packed", "divx style packed b frames", offsetof(MpegEncContext, divx_packed), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
+ {"quarter_sample", "1/4 subpel MC", offsetof(MpegEncContext, quarter_sample), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
+ {"divx_packed", "divx style packed b frames", offsetof(MpegEncContext, divx_packed), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
{NULL}
};
@@ -2771,9 +2775,9 @@ AVCodec ff_mpeg4_decoder = {
.init = decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
- CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_FRAME_THREADS,
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
@@ -2783,7 +2787,7 @@ AVCodec ff_mpeg4_decoder = {
};
-#if CONFIG_MPEG4_VDPAU_DECODER
+#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
static const AVClass mpeg4_vdpau_class = {
"MPEG4 Video VDPAU Decoder",
av_default_item_name,
@@ -2800,8 +2804,8 @@ AVCodec ff_mpeg4_vdpau_decoder = {
.init = decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
- CODEC_CAP_HWACCEL_VDPAU,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_HWACCEL_VDPAU,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_MPEG4,
AV_PIX_FMT_NONE },
.priv_class = &mpeg4_vdpau_class,
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c b/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
index bca294ebd87..ffa08beb872 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg4videoenc.c
@@ -430,7 +430,7 @@ static inline void mpeg4_encode_blocks(MpegEncContext *s, int16_t block[6][64],
int i;
if (scan_table) {
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT) {
for (i = 0; i < 6; i++)
skip_put_bits(&s->pb,
mpeg4_get_block_length(s, block[i], i,
@@ -442,7 +442,7 @@ static inline void mpeg4_encode_blocks(MpegEncContext *s, int16_t block[6][64],
intra_dc[i], scan_table[i], dc_pb, ac_pb);
}
} else {
- if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT) {
for (i = 0; i < 6; i++)
skip_put_bits(&s->pb,
mpeg4_get_block_length(s, block[i], i, 0,
@@ -507,7 +507,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
PutBitContext *const pb2 = s->data_partitioning ? &s->pb2 : &s->pb;
PutBitContext *const tex_pb = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_B ? &s->tex_pb : &s->pb;
PutBitContext *const dc_pb = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_I ? &s->pb2 : &s->pb;
- const int interleaved_stats = (s->avctx->flags & CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
+ const int interleaved_stats = (s->avctx->flags & AV_CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
if (!s->mb_intra) {
int i, cbp;
@@ -832,7 +832,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
for (i = 0; i < 6; i++)
dc_diff[i] = ff_mpeg4_pred_dc(s, i, block[i][0], &dir[i], 1);
- if (s->avctx->flags & CODEC_FLAG_AC_PRED) {
+ if (s->avctx->flags & AV_CODEC_FLAG_AC_PRED) {
s->ac_pred = decide_ac_pred(s, block, dir, scan_table, zigzag_last_index);
} else {
for (i = 0; i < 6; i++)
@@ -932,7 +932,7 @@ static void mpeg4_encode_gop_header(MpegEncContext *s)
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 6, seconds);
- put_bits(&s->pb, 1, !!(s->avctx->flags & CODEC_FLAG_CLOSED_GOP));
+ put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP));
put_bits(&s->pb, 1, 0); // broken link == NO
ff_mpeg4_stuffing(&s->pb);
@@ -1078,7 +1078,7 @@ static void mpeg4_encode_vol_header(MpegEncContext *s,
ff_mpeg4_stuffing(&s->pb);
/* user data */
- if (!(s->avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, 0x1B2); /* user_data */
avpriv_put_string(&s->pb, LIBAVCODEC_IDENT, 0);
@@ -1092,7 +1092,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
int time_div, time_mod;
if (s->pict_type == AV_PICTURE_TYPE_I) {
- if (!(s->avctx->flags & CODEC_FLAG_GLOBAL_HEADER)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)) {
if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) // HACK, the reference sw is buggy
mpeg4_encode_visual_object_header(s);
if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number == 0) // HACK, the reference sw is buggy
@@ -1325,7 +1325,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
- if (s->avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
s->avctx->extradata = av_malloc(1024);
init_put_bits(&s->pb, s->avctx->extradata, 1024);
@@ -1417,6 +1417,6 @@ AVCodec ff_mpeg4_encoder = {
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS,
.priv_class = &mpeg4enc_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
index 58098d89f02..7849fed649b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c
@@ -23,7 +23,7 @@
#include "parser.h"
#include "mpegaudiodecheader.h"
#include "libavutil/common.h"
-
+#include "libavformat/id3v1.h" // for ID3v1_TAG_SIZE
typedef struct MpegAudioParseContext {
ParseContext pc;
@@ -49,6 +49,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
uint32_t state= pc->state;
int i;
int next= END_NOT_FOUND;
+ int flush = !buf_size;
for(i=0; i<buf_size; ){
if(s->frame_size){
@@ -113,6 +114,12 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
return buf_size;
}
+ if (flush && buf_size >= ID3v1_TAG_SIZE && memcmp(buf, "TAG", 3) == 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return next;
+ }
+
*poutbuf = buf;
*poutbuf_size = buf_size;
return next;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_fixed.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_fixed.c
index 904c88561d6..9421ffbe948 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_fixed.c
@@ -47,7 +47,7 @@ AVCodec ff_mp1_decoder = {
.priv_data_size = sizeof(MPADecodeContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S16,
@@ -63,7 +63,7 @@ AVCodec ff_mp2_decoder = {
.priv_data_size = sizeof(MPADecodeContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S16,
@@ -79,7 +79,7 @@ AVCodec ff_mp3_decoder = {
.priv_data_size = sizeof(MPADecodeContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S16,
@@ -95,7 +95,7 @@ AVCodec ff_mp3adu_decoder = {
.priv_data_size = sizeof(MPADecodeContext),
.init = decode_init,
.decode = decode_frame_adu,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S16,
@@ -112,7 +112,7 @@ AVCodec ff_mp3on4_decoder = {
.init = decode_init_mp3on4,
.close = decode_close_mp3on4,
.decode = decode_frame_mp3on4,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush_mp3on4,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_float.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_float.c
index f432c832967..ddfa5e0daaa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_float.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_float.c
@@ -48,7 +48,7 @@ AVCodec ff_mp1float_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_FLT,
@@ -65,7 +65,7 @@ AVCodec ff_mp2float_decoder = {
.init = decode_init,
.decode = decode_frame,
.close = decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_FLT,
@@ -82,7 +82,7 @@ AVCodec ff_mp3float_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_FLT,
@@ -99,7 +99,7 @@ AVCodec ff_mp3adufloat_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame_adu,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_FLT,
@@ -116,7 +116,7 @@ AVCodec ff_mp3on4float_decoder = {
.init = decode_init_mp3on4,
.close = decode_close_mp3on4,
.decode = decode_frame_mp3on4,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = flush_mp3on4,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
index 1cc5ac47f44..b7b9dbdfee0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudiodec_template.c
@@ -429,7 +429,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx;
#if USE_FLOATS
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
#endif
@@ -1686,7 +1686,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
if (!avctx->bit_rate)
avctx->bit_rate = s->bit_rate;
- if (s->frame_size <= 0 || s->frame_size > buf_size) {
+ if (s->frame_size <= 0) {
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
return AVERROR_INVALIDDATA;
} else if (s->frame_size < buf_size) {
@@ -1893,6 +1893,7 @@ static av_cold int decode_init_mp3on4(AVCodecContext * avctx)
s->mp3decctx[i]->adu_mode = 1;
s->mp3decctx[i]->avctx = avctx;
s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp;
+ s->mp3decctx[i]->fdsp = s->mp3decctx[0]->fdsp;
}
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
index 5a0897f0367..ce93cc7c6d2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudioenc_template.c
@@ -763,7 +763,7 @@ static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
compute_bit_allocation(s, smr, bit_alloc, &padding);
- if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE, 0)) < 0)
return ret;
init_put_bits(&s->pb, avpkt->data, avpkt->size);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegpicture.c b/chromium/third_party/ffmpeg/libavcodec/mpegpicture.c
index 92f8eadcfa9..bb822b6c096 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegpicture.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegpicture.c
@@ -58,7 +58,11 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me,
{
int alloc_size = FFALIGN(FFABS(linesize) + 64, 32);
- if (avctx->hwaccel || avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ if (avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
return 0;
if (linesize < 24) {
@@ -199,7 +203,7 @@ static int alloc_picture_tables(AVCodecContext *avctx, Picture *pic, int encodin
}
if (out_format == FMT_H263 || encoding || avctx->debug_mv ||
- (avctx->flags2 & CODEC_FLAG2_EXPORT_MVS)) {
+ (avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS)) {
int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t);
int ref_index_size = 4 * mb_array_size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegutils.h b/chromium/third_party/ffmpeg/libavcodec/mpegutils.h
index 37cc391c233..6ac5cef4fda 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegutils.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegutils.h
@@ -132,4 +132,4 @@ void ff_draw_horiz_band(AVCodecContext *avctx, AVFrame *cur, AVFrame *last,
int y, int h, int picture_structure, int first_field,
int low_delay);
-#endif /* AVCODEC_PICTTYPE_H */
+#endif /* AVCODEC_MPEGUTILS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
index a3ff7460e90..eacebc26606 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.c
@@ -297,7 +297,7 @@ static av_cold int dct_init(MpegEncContext *s)
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c;
s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c;
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c;
- if (s->avctx->flags & CODEC_FLAG_BITEXACT)
+ if (s->avctx->flags & AV_CODEC_FLAG_BITEXACT)
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
@@ -312,6 +312,8 @@ static av_cold int dct_init(MpegEncContext *s)
ff_mpv_common_init_ppc(s);
if (ARCH_X86)
ff_mpv_common_init_x86(s);
+ if (ARCH_MIPS)
+ ff_mpv_common_init_mips(s);
return 0;
}
@@ -522,7 +524,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
if(s->picture)
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
- if (s1->picture[i].f->buf[0] &&
+ if (s1->picture && s1->picture[i].f->buf[0] &&
(ret = ff_mpeg_ref_picture(s->avctx, &s->picture[i], &s1->picture[i])) < 0)
return ret;
}
@@ -571,7 +573,7 @@ do {\
if (s1->bitstream_buffer) {
if (s1->bitstream_buffer_size +
- FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size) {
+ AV_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size) {
av_fast_malloc(&s->bitstream_buffer,
&s->allocated_bitstream_buffer_size,
s1->allocated_bitstream_buffer_size);
@@ -584,7 +586,7 @@ do {\
memcpy(s->bitstream_buffer, s1->bitstream_buffer,
s1->bitstream_buffer_size);
memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
}
// linesize dependend scratch buffer allocation
@@ -729,7 +731,7 @@ static int init_context_frame(MpegEncContext *s)
}
if (s->codec_id == AV_CODEC_ID_MPEG4 ||
- (s->avctx->flags & CODEC_FLAG_INTERLACED_ME)) {
+ (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
/* interlaced direct mode decoding tables */
for (i = 0; i < 2; i++) {
int j, k;
@@ -783,6 +785,82 @@ fail:
return AVERROR(ENOMEM);
}
+static void clear_context(MpegEncContext *s)
+{
+ int i, j, k;
+
+ memset(&s->next_picture, 0, sizeof(s->next_picture));
+ memset(&s->last_picture, 0, sizeof(s->last_picture));
+ memset(&s->current_picture, 0, sizeof(s->current_picture));
+ memset(&s->new_picture, 0, sizeof(s->new_picture));
+
+ memset(s->thread_context, 0, sizeof(s->thread_context));
+
+ s->me.map = NULL;
+ s->me.score_map = NULL;
+ s->dct_error_sum = NULL;
+ s->block = NULL;
+ s->blocks = NULL;
+ memset(s->pblocks, 0, sizeof(s->pblocks));
+ s->ac_val_base = NULL;
+ s->ac_val[0] =
+ s->ac_val[1] =
+ s->ac_val[2] =NULL;
+ s->sc.edge_emu_buffer = NULL;
+ s->me.scratchpad = NULL;
+ s->me.temp =
+ s->sc.rd_scratchpad =
+ s->sc.b_scratchpad =
+ s->sc.obmc_scratchpad = NULL;
+
+ s->parse_context.buffer = NULL;
+ s->parse_context.buffer_size = 0;
+ s->bitstream_buffer = NULL;
+ s->allocated_bitstream_buffer_size = 0;
+ s->picture = NULL;
+ s->mb_type = NULL;
+ s->p_mv_table_base = NULL;
+ s->b_forw_mv_table_base = NULL;
+ s->b_back_mv_table_base = NULL;
+ s->b_bidir_forw_mv_table_base = NULL;
+ s->b_bidir_back_mv_table_base = NULL;
+ s->b_direct_mv_table_base = NULL;
+ s->p_mv_table = NULL;
+ s->b_forw_mv_table = NULL;
+ s->b_back_mv_table = NULL;
+ s->b_bidir_forw_mv_table = NULL;
+ s->b_bidir_back_mv_table = NULL;
+ s->b_direct_mv_table = NULL;
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 2; j++) {
+ for (k = 0; k < 2; k++) {
+ s->b_field_mv_table_base[i][j][k] = NULL;
+ s->b_field_mv_table[i][j][k] = NULL;
+ }
+ s->b_field_select_table[i][j] = NULL;
+ s->p_field_mv_table_base[i][j] = NULL;
+ s->p_field_mv_table[i][j] = NULL;
+ }
+ s->p_field_select_table[i] = NULL;
+ }
+
+ s->dc_val_base = NULL;
+ s->coded_block_base = NULL;
+ s->mbintra_table = NULL;
+ s->cbp_table = NULL;
+ s->pred_dir_table = NULL;
+
+ s->mbskip_table = NULL;
+
+ s->er.error_status_table = NULL;
+ s->er.er_temp_buffer = NULL;
+ s->mb_index2xy = NULL;
+ s->lambda_table = NULL;
+
+ s->cplx_tab = NULL;
+ s->bits_tab = NULL;
+}
+
/**
* init common structure for both encoder and decoder.
* this assumes that some variables like width/height are already set
@@ -794,6 +872,8 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
s->avctx->active_thread_type & FF_THREAD_SLICE) ?
s->avctx->thread_count : 1;
+ clear_context(s);
+
if (s->encoding && s->avctx->slices)
nb_slices = s->avctx->slices;
@@ -838,10 +918,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
if (!s->picture[i].f)
goto fail;
}
- memset(&s->next_picture, 0, sizeof(s->next_picture));
- memset(&s->last_picture, 0, sizeof(s->last_picture));
- memset(&s->current_picture, 0, sizeof(s->current_picture));
- memset(&s->new_picture, 0, sizeof(s->new_picture));
s->next_picture.f = av_frame_alloc();
if (!s->next_picture.f)
goto fail;
@@ -1031,6 +1107,9 @@ void ff_mpv_common_end(MpegEncContext *s)
{
int i;
+ if (!s)
+ return ;
+
if (s->slice_context_count > 1) {
for (i = 0; i < s->slice_context_count; i++) {
free_duplicate_context(s->thread_context[i]);
@@ -1122,9 +1201,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
if (&s->picture[i] != s->last_picture_ptr &&
&s->picture[i] != s->next_picture_ptr &&
s->picture[i].reference && !s->picture[i].needs_realloc) {
- if (!(avctx->active_thread_type & FF_THREAD_FRAME))
- av_log(avctx, AV_LOG_ERROR,
- "releasing zombie picture\n");
ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
}
}
@@ -1175,7 +1251,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME;
s->current_picture_ptr->f->pict_type = s->pict_type;
- // if (s->avctx->flags && CODEC_FLAG_QSCALE)
+ // if (s->avctx->flags && AV_CODEC_FLAG_QSCALE)
// s->current_picture_ptr->quality = s->new_picture_ptr->quality;
s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
@@ -1228,7 +1304,11 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return -1;
}
- if (!avctx->hwaccel && !(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
+ if (!avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ && !(avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ ) {
for(i=0; i<avctx->height; i++)
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
0x80, avctx->width);
@@ -1489,7 +1569,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
int *low_delay,
int mb_width, int mb_height, int mb_stride, int quarter_sample)
{
- if ((avctx->flags2 & CODEC_FLAG2_EXPORT_MVS) && mbtype_table && motion_val[0]) {
+ if ((avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) && mbtype_table && motion_val[0]) {
const int shift = 1 + quarter_sample;
const int mv_sample_log2 = avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_SVQ3 ? 2 : 1;
const int mv_stride = (mb_width << mv_sample_log2) +
@@ -1573,7 +1653,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
/* TODO: export all the following to make them accessible for users (and filters) */
if (avctx->hwaccel || !mbtype_table
- || (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU))
+#if FF_API_CAP_VDPAU
+ || (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ )
return;
@@ -2017,7 +2100,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
src_x, src_y << field_based, h_edge_pos,
v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize;
uint8_t *vbuf =ubuf + 9 * s->uvlinesize;
s->vdsp.emulated_edge_mc(ubuf, ptr_cb,
@@ -2052,7 +2135,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
sy = (sy << 2) >> lowres;
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
uvsx = (uvsx << 2) >> lowres;
uvsy = (uvsy << 2) >> lowres;
@@ -2172,7 +2255,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
my += s->mv[dir][i][1];
}
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture,
pix_op, mx, my);
break;
@@ -2412,7 +2495,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
s->mbintra_table[mb_xy]=1;
- if ((s->avctx->flags & CODEC_FLAG_PSNR) || s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor ||
+ if ((s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor ||
!(s->encoding && (s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) &&
s->avctx->mb_decision != FF_MB_DECISION_RD)) { // FIXME precalc
uint8_t *dest_y, *dest_cb, *dest_cr;
@@ -2515,7 +2598,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
add_dequant_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if (s->chroma_y_shift){
add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
@@ -2534,7 +2617,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize);
add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){//Chroma420
add_dct(s, block[4], 4, dest_cb, uvlinesize);
add_dct(s, block[5], 5, dest_cr, uvlinesize);
@@ -2567,7 +2650,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
put_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){
put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
@@ -2586,7 +2669,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
s->idsp.idct_put(dest_y + dct_offset, dct_linesize, block[2]);
s->idsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
if(s->chroma_y_shift){
s->idsp.idct_put(dest_cb, uvlinesize, block[4]);
s->idsp.idct_put(dest_cr, uvlinesize, block[5]);
@@ -2612,7 +2695,7 @@ void mpv_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
skip_idct:
if(!readable){
s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
index 13be43d0472..b47a4f38aa9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo.h
@@ -39,6 +39,7 @@
#include "h263dsp.h"
#include "hpeldsp.h"
#include "idctdsp.h"
+#include "internal.h"
#include "me_cmp.h"
#include "motion_est.h"
#include "mpegpicture.h"
@@ -106,7 +107,7 @@ typedef struct MpegEncContext {
int width, height;///< picture size. must be a multiple of 16
int gop_size;
int intra_only; ///< if true, only intra pictures are generated
- int bit_rate; ///< wanted bit rate
+ int64_t bit_rate; ///< wanted bit rate
enum OutputFormat out_format; ///< output format
int h263_pred; ///< use mpeg4/h263 ac/dc predictions
int pb_frame; ///< PB frame mode (0 = none, 1 = base, 2 = improved)
@@ -261,7 +262,10 @@ typedef struct MpegEncContext {
int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced b-frame encoding
uint8_t (*p_field_select_table[2]);
uint8_t (*b_field_select_table[2][2]);
+#if FF_API_MOTION_EST
int me_method; ///< ME algorithm
+#endif
+ int motion_est; ///< ME algorithm
int mv_dir;
#define MV_DIR_FORWARD 1
#define MV_DIR_BACKWARD 2
@@ -372,6 +376,7 @@ typedef struct MpegEncContext {
uint8_t *mb_info_ptr;
int mb_info_size;
int ehc_mode;
+ int rc_strategy;
/* H.263+ specific */
int umvplus; ///< == H263+ && unrestricted_mv
@@ -534,6 +539,7 @@ typedef struct MpegEncContext {
float rc_buffer_aggressivity;
float border_masking;
int lmin, lmax;
+ int vbv_ignore_qmax;
char *rc_eq;
@@ -593,6 +599,13 @@ typedef struct MpegEncContext {
{"border_mask", "increase the quantizer for macroblocks close to borders", FF_MPV_OFFSET(border_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, FF_MPV_OPT_FLAGS}, \
{"lmin", "minimum Lagrange factor (VBR)", FF_MPV_OFFSET(lmin), AV_OPT_TYPE_INT, {.i64 = 2*FF_QP2LAMBDA }, 0, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"lmax", "maximum Lagrange factor (VBR)", FF_MPV_OFFSET(lmax), AV_OPT_TYPE_INT, {.i64 = 31*FF_QP2LAMBDA }, 0, INT_MAX, FF_MPV_OPT_FLAGS }, \
+{"ibias", "intra quant bias", FF_MPV_OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
+{"pbias", "inter quant bias", FF_MPV_OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
+{"rc_strategy", "ratecontrol method", FF_MPV_OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
+{"motion_est", "motion estimation algorithm", FF_MPV_OFFSET(motion_est), AV_OPT_TYPE_INT, {.i64 = FF_ME_EPZS }, FF_ME_ZERO, FF_ME_XONE, FF_MPV_OPT_FLAGS, "motion_est" }, \
+{ "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
+{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
+{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
extern const AVOption ff_mpv_generic_options[];
@@ -611,6 +624,7 @@ void ff_mpv_common_init_axp(MpegEncContext *s);
void ff_mpv_common_init_neon(MpegEncContext *s);
void ff_mpv_common_init_ppc(MpegEncContext *s);
void ff_mpv_common_init_x86(MpegEncContext *s);
+void ff_mpv_common_init_mips(MpegEncContext *s);
int ff_mpv_common_frame_size_change(MpegEncContext *s);
void ff_mpv_common_end(MpegEncContext *s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
index e729d36aa26..b04fa39bc79 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_enc.c
@@ -22,6 +22,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/*
+ * non linear quantizers with large QPs and VBV with restrictive qmin fixes sponsored by NOA GmbH
+ */
+
/**
* @file
* The simplest mpeg encoder (well, it was the simplest!).
@@ -163,9 +167,30 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
static inline void update_qscale(MpegEncContext *s)
{
- s->qscale = (s->lambda * 139 + FF_LAMBDA_SCALE * 64) >>
- (FF_LAMBDA_SHIFT + 7);
- s->qscale = av_clip(s->qscale, s->avctx->qmin, s->avctx->qmax);
+ if (s->q_scale_type == 1) {
+ int i;
+ int bestdiff=INT_MAX;
+ int best = 1;
+ static const uint8_t non_linear_qscale[] = {
+ 1,2,3,4,5,6,7,8,9,10,11,12,14,16,18,20,24,26,28
+ };
+
+ for (i = 0 ; i<FF_ARRAY_ELEMS(non_linear_qscale); i++) {
+ int diff = FFABS((non_linear_qscale[i]<<(FF_LAMBDA_SHIFT + 7)) - (int)s->lambda * 139);
+ if (non_linear_qscale[i] < s->avctx->qmin ||
+ (non_linear_qscale[i] > s->avctx->qmax && !s->vbv_ignore_qmax))
+ continue;
+ if (diff < bestdiff) {
+ bestdiff = diff;
+ best = non_linear_qscale[i];
+ }
+ }
+ s->qscale = best;
+ } else {
+ s->qscale = (s->lambda * 139 + FF_LAMBDA_SCALE * 64) >>
+ (FF_LAMBDA_SHIFT + 7);
+ s->qscale = av_clip(s->qscale, s->avctx->qmin, s->vbv_ignore_qmax ? 31 : s->avctx->qmax);
+ }
s->lambda2 = (s->lambda * s->lambda + FF_LAMBDA_SCALE / 2) >>
FF_LAMBDA_SHIFT;
@@ -339,7 +364,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
s->max_b_frames = avctx->max_b_frames;
s->codec_id = avctx->codec->id;
s->strict_std_compliance = avctx->strict_std_compliance;
- s->quarter_sample = (avctx->flags & CODEC_FLAG_QPEL) != 0;
+ s->quarter_sample = (avctx->flags & AV_CODEC_FLAG_QPEL) != 0;
s->mpeg_quant = avctx->mpeg_quant;
s->rtp_mode = !!avctx->rtp_payload_size;
s->intra_dc_precision = avctx->intra_dc_precision;
@@ -370,10 +395,14 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
s->intra_only = 0;
}
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
s->me_method = avctx->me_method;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
/* Fixed QSCALE */
- s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE);
+ s->fixed_qscale = !!(avctx->flags & AV_CODEC_FLAG_QSCALE);
#if FF_API_MPV_OPT
FF_DISABLE_DEPRECATION_WARNINGS
@@ -391,7 +420,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
(s->mpv_flags & FF_MPV_FLAG_QP_RD)) &&
!s->fixed_qscale;
- s->loop_filter = !!(s->avctx->flags & CODEC_FLAG_LOOP_FILTER);
+ s->loop_filter = !!(s->avctx->flags & AV_CODEC_FLAG_LOOP_FILTER);
if (avctx->rc_max_rate && !avctx->rc_buffer_size) {
switch(avctx->codec_id) {
@@ -472,7 +501,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
"specified vbv buffer is too large for the given bitrate!\n");
}
- if ((s->avctx->flags & CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
+ if ((s->avctx->flags & AV_CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
s->codec_id != AV_CODEC_ID_H263 && s->codec_id != AV_CODEC_ID_H263P &&
s->codec_id != AV_CODEC_ID_FLV1) {
av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
@@ -565,7 +594,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
return -1;
}
- if ((s->avctx->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
+ if ((s->avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME)) &&
s->codec_id != AV_CODEC_ID_MPEG4 && s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
return -1;
@@ -591,14 +620,14 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
}
if (s->avctx->scenechange_threshold < 1000000000 &&
- (s->avctx->flags & CODEC_FLAG_CLOSED_GOP)) {
+ (s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) {
av_log(avctx, AV_LOG_ERROR,
"closed gop with scene change detection are not supported yet, "
"set threshold to 1000000000\n");
return -1;
}
- if (s->avctx->flags & CODEC_FLAG_LOW_DELAY) {
+ if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) {
if (s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
av_log(avctx, AV_LOG_ERROR,
"low delay forcing is only available for mpeg2\n");
@@ -612,9 +641,9 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
}
if (s->q_scale_type == 1) {
- if (avctx->qmax > 12) {
+ if (avctx->qmax > 28) {
av_log(avctx, AV_LOG_ERROR,
- "non linear quant only supports qmax <= 12 currently\n");
+ "non linear quant only supports qmax <= 28 currently\n");
return -1;
}
}
@@ -648,7 +677,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
return -1;
}
- if (avctx->b_frame_strategy && (avctx->flags & CODEC_FLAG_PASS2)) {
+ if (avctx->b_frame_strategy && (avctx->flags & AV_CODEC_FLAG_PASS2)) {
av_log(avctx, AV_LOG_INFO,
"notice: b_frame_strategy only affects the first pass\n");
avctx->b_frame_strategy = 0;
@@ -677,10 +706,16 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
+#if FF_API_QUANT_BIAS
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (s->intra_quant_bias == FF_DEFAULT_QUANT_BIAS &&
+ avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
s->intra_quant_bias = avctx->intra_quant_bias;
- if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
+ if (s->inter_quant_bias == FF_DEFAULT_QUANT_BIAS &&
+ avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
s->inter_quant_bias = avctx->inter_quant_bias;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias);
@@ -698,12 +733,12 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
switch (avctx->codec->id) {
case AV_CODEC_ID_MPEG1VIDEO:
s->out_format = FMT_MPEG1;
- s->low_delay = !!(s->avctx->flags & CODEC_FLAG_LOW_DELAY);
+ s->low_delay = !!(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY);
avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1);
break;
case AV_CODEC_ID_MPEG2VIDEO:
s->out_format = FMT_MPEG1;
- s->low_delay = !!(s->avctx->flags & CODEC_FLAG_LOW_DELAY);
+ s->low_delay = !!(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY);
avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1);
s->rtp_mode = 1;
break;
@@ -752,9 +787,9 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
s->out_format = FMT_H263;
s->h263_plus = 1;
/* Fx */
- s->h263_aic = (avctx->flags & CODEC_FLAG_AC_PRED) ? 1 : 0;
+ s->h263_aic = (avctx->flags & AV_CODEC_FLAG_AC_PRED) ? 1 : 0;
s->modified_quant = s->h263_aic;
- s->loop_filter = (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1 : 0;
+ s->loop_filter = (avctx->flags & AV_CODEC_FLAG_LOOP_FILTER) ? 1 : 0;
s->unrestricted_mv = s->obmc || s->loop_filter || s->umvplus;
/* /Fx */
@@ -836,8 +871,8 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
s->encoding = 1;
s->progressive_frame =
- s->progressive_sequence = !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT |
- CODEC_FLAG_INTERLACED_ME) ||
+ s->progressive_sequence = !(avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT |
+ AV_CODEC_FLAG_INTERLACED_ME) ||
s->alternate_scan);
/* init */
@@ -851,8 +886,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
ff_pixblockdsp_init(&s->pdsp, avctx);
ff_qpeldsp_init(&s->qdsp);
- s->avctx->coded_frame = s->current_picture.f;
-
if (s->msmpeg4_version) {
FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_stats,
2 * 2 * (MAX_LEVEL + 1) *
@@ -1306,8 +1339,8 @@ static int estimate_best_b_count(MpegEncContext *s)
c->width = s->width >> scale;
c->height = s->height >> scale;
- c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR;
- c->flags |= s->avctx->flags & CODEC_FLAG_QPEL;
+ c->flags = AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR;
+ c->flags |= s->avctx->flags & AV_CODEC_FLAG_QPEL;
c->mb_decision = s->avctx->mb_decision;
c->me_cmp = s->avctx->me_cmp;
c->mb_cmp = s->avctx->mb_cmp;
@@ -1431,7 +1464,7 @@ static int select_input_picture(MpegEncContext *s)
} else {
int b_frames;
- if (s->avctx->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
for (i = 0; i < s->max_b_frames + 1; i++) {
int pict_num = s->input_picture[0]->f->display_picture_number + i;
@@ -1500,13 +1533,13 @@ static int select_input_picture(MpegEncContext *s)
s->gop_size > s->picture_in_gop_number) {
b_frames = s->gop_size - s->picture_in_gop_number - 1;
} else {
- if (s->avctx->flags & CODEC_FLAG_CLOSED_GOP)
+ if (s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)
b_frames = 0;
s->input_picture[b_frames]->f->pict_type = AV_PICTURE_TYPE_I;
}
}
- if ((s->avctx->flags & CODEC_FLAG_CLOSED_GOP) && b_frames &&
+ if ((s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) && b_frames &&
s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_I)
b_frames--;
@@ -1613,8 +1646,11 @@ static void frame_end(MpegEncContext *s)
if (s->pict_type!= AV_PICTURE_TYPE_B)
s->last_non_b_pict_type = s->pict_type;
- s->avctx->coded_frame = s->current_picture_ptr->f;
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
static void update_noise_reduction(MpegEncContext *s)
@@ -1717,6 +1753,8 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
int i, stuffing_count, ret;
int context_count = s->slice_context_count;
+ s->vbv_ignore_qmax = 0;
+
s->picture_in_gop_number++;
if (load_input_picture(s, pic_arg) < 0)
@@ -1729,10 +1767,10 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
/* output? */
if (s->new_picture.f->data[0]) {
int growing_buffer = context_count == 1 && !pkt->data && !s->data_partitioning;
- int pkt_size = growing_buffer ? FFMAX(s->mb_width*s->mb_height*64+10000, avctx->internal->byte_buffer_size) - FF_INPUT_BUFFER_PADDING_SIZE
+ int pkt_size = growing_buffer ? FFMAX(s->mb_width*s->mb_height*64+10000, avctx->internal->byte_buffer_size) - AV_INPUT_BUFFER_PADDING_SIZE
:
s->mb_width*s->mb_height*(MAX_MB_BYTES+100)+10000;
- if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0)
return ret;
if (s->mb_info) {
s->mb_info_ptr = av_packet_new_side_data(pkt,
@@ -1813,6 +1851,7 @@ vbv_retry:
PutBitContext *pb = &s->thread_context[i]->pb;
init_put_bits(pb, pb->buf, pb->buf_end - pb->buf);
}
+ s->vbv_ignore_qmax = 1;
av_log(s->avctx, AV_LOG_VERBOSE, "reencoding frame due to VBV\n");
goto vbv_retry;
}
@@ -1820,7 +1859,7 @@ vbv_retry:
av_assert0(s->avctx->rc_max_rate);
}
- if (s->avctx->flags & CODEC_FLAG_PASS1)
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
for (i = 0; i < 4; i++) {
@@ -1829,8 +1868,12 @@ vbv_retry:
s->current_picture.error[i];
avctx->error[i] += s->current_picture_ptr->f->error[i];
}
+ ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality,
+ s->current_picture_ptr->f->error,
+ (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0,
+ s->pict_type);
- if (s->avctx->flags & CODEC_FLAG_PASS1)
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS1)
assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits +
avctx->i_tex_bits + avctx->p_tex_bits ==
put_bits_count(&s->pb));
@@ -2132,7 +2175,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
}
if (s->mb_intra) {
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
int progressive_score, interlaced_score;
s->interlaced_dct = 0;
@@ -2163,7 +2206,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
s->pdsp.get_pixels(s->block[2], ptr_y + dct_offset, wrap_y);
s->pdsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y);
- if (s->avctx->flags & CODEC_FLAG_GRAY) {
+ if (s->avctx->flags & AV_CODEC_FLAG_GRAY) {
skip_dct[4] = 1;
skip_dct[5] = 1;
} else {
@@ -2211,7 +2254,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
op_pix, op_qpix);
}
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
int progressive_score, interlaced_score;
s->interlaced_dct = 0;
@@ -2249,7 +2292,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
s->pdsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8,
dest_y + dct_offset + 8, wrap_y);
- if (s->avctx->flags & CODEC_FLAG_GRAY) {
+ if (s->avctx->flags & AV_CODEC_FLAG_GRAY) {
skip_dct[4] = 1;
skip_dct[5] = 1;
} else {
@@ -2359,7 +2402,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
}
}
- if ((s->avctx->flags & CODEC_FLAG_GRAY) && s->mb_intra) {
+ if ((s->avctx->flags & AV_CODEC_FLAG_GRAY) && s->mb_intra) {
s->block_last_index[4] =
s->block_last_index[5] = 0;
s->block[4][0] =
@@ -2683,7 +2726,7 @@ static void write_slice_end(MpegEncContext *s){
avpriv_align_put_bits(&s->pb);
flush_put_bits(&s->pb);
- if ((s->avctx->flags & CODEC_FLAG_PASS1) && !s->partitioned_frame)
+ if ((s->avctx->flags & AV_CODEC_FLAG_PASS1) && !s->partitioned_frame)
s->misc_bits+= get_bits_diff(s);
}
@@ -2936,7 +2979,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
break;
}
- if (s->avctx->flags & CODEC_FLAG_PASS1) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS1) {
int bits= put_bits_count(&s->pb);
s->misc_bits+= bits - s->last_bits;
s->last_bits= bits;
@@ -3356,7 +3399,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->p_mv_table[xy][1]=0;
}
- if (s->avctx->flags & CODEC_FLAG_PSNR) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PSNR) {
int w= 16;
int h= 16;
@@ -3521,11 +3564,11 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->no_rounding ^= 1;
}
- if (s->avctx->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
if (estimate_qp(s,1) < 0)
return -1;
ff_get_2pass_fcode(s);
- } else if (!(s->avctx->flags & CODEC_FLAG_QSCALE)) {
+ } else if (!(s->avctx->flags & AV_CODEC_FLAG_QSCALE)) {
if(s->pict_type==AV_PICTURE_TYPE_B)
s->lambda= s->last_lambda_for[s->pict_type];
else
@@ -3592,7 +3635,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
if(s->pict_type==AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
int a,b;
a= ff_get_best_fcode(s, s->p_field_mv_table[0][0], CANDIDATE_MB_TYPE_INTER_I); //FIXME field_select
b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I);
@@ -3601,7 +3644,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
ff_fix_long_p_mvs(s);
ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
int j;
for(i=0; i<2; i++){
for(j=0; j<2; j++)
@@ -3626,7 +3669,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
ff_fix_long_mvs(s, NULL, 0, s->b_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BACKWARD, 1);
ff_fix_long_mvs(s, NULL, 0, s->b_bidir_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_BIDIR, 1);
ff_fix_long_mvs(s, NULL, 0, s->b_bidir_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BIDIR, 1);
- if (s->avctx->flags & CODEC_FLAG_INTERLACED_ME) {
+ if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
int dir, j;
for(dir=0; dir<2; dir++){
for(i=0; i<2; i++){
@@ -3647,7 +3690,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
if (s->qscale < 3 && s->max_qcoeff <= 128 &&
s->pict_type == AV_PICTURE_TYPE_I &&
- !(s->avctx->flags & CODEC_FLAG_QSCALE))
+ !(s->avctx->flags & AV_CODEC_FLAG_QSCALE))
s->qscale= 3; //reduce clipping problems
if (s->out_format == FMT_MJPEG) {
@@ -4559,12 +4602,12 @@ int ff_dct_quantize_c(MpegEncContext *s,
start_i = 1;
last_non_zero = 0;
qmat = n < 4 ? s->q_intra_matrix[qscale] : s->q_chroma_intra_matrix[qscale];
- bias= s->intra_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
+ bias= s->intra_quant_bias*(1<<(QMAT_SHIFT - QUANT_BIAS_SHIFT));
} else {
start_i = 0;
last_non_zero = -1;
qmat = s->q_inter_matrix[qscale];
- bias= s->inter_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
+ bias= s->inter_quant_bias*(1<<(QMAT_SHIFT - QUANT_BIAS_SHIFT));
}
threshold1= (1<<QMAT_SHIFT) - bias - 1;
threshold2= (threshold1<<1);
@@ -4662,7 +4705,7 @@ AVCodec ff_h263p_encoder = {
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .capabilities = CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &h263p_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
index f1956f0e73e..51ba435231f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_motion.c
@@ -88,7 +88,7 @@ static void gmc1_motion(MpegEncContext *s,
}
}
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
motion_x = s->sprite_offset[1][0];
@@ -165,7 +165,7 @@ static void gmc_motion(MpegEncContext *s,
a + 1, (1 << (2 * a + 1)) - s->no_rounding,
s->h_edge_pos, s->v_edge_pos);
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
ox = s->sprite_offset[1][0] + s->sprite_delta[0][0] * s->mb_x * 8 +
@@ -324,7 +324,7 @@ void mpeg_motion_internal(MpegEncContext *s,
src_x, src_y,
s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize;
uint8_t *vbuf = ubuf + 9 * s->uvlinesize;
uvsrc_y = (unsigned)uvsrc_y << field_based;
@@ -359,7 +359,7 @@ void mpeg_motion_internal(MpegEncContext *s,
pix_op[0][dxy](dest_y, ptr_y, linesize, h);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
pix_op[s->chroma_x_shift][uvdxy]
(dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
pix_op[s->chroma_x_shift][uvdxy]
@@ -547,7 +547,7 @@ static inline void qpel_motion(MpegEncContext *s,
src_x, src_y << field_based,
s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize;
uint8_t *vbuf = ubuf + 9 * s->uvlinesize;
s->vdsp.emulated_edge_mc(ubuf, ptr_cb,
@@ -584,7 +584,7 @@ static inline void qpel_motion(MpegEncContext *s,
qpix_op[1][dxy](dest_y, ptr_y, linesize);
qpix_op[1][dxy](dest_y + 8, ptr_y + 8, linesize);
}
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
pix_op[1][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> 1);
pix_op[1][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> 1);
}
@@ -740,7 +740,7 @@ static inline void apply_obmc(MpegEncContext *s,
mx += mv[0][0];
my += mv[0][1];
}
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
chroma_4mv_motion(s, dest_cb, dest_cr,
ref_picture, pix_op[1],
mx, my);
@@ -813,7 +813,7 @@ static inline void apply_8x8(MpegEncContext *s,
}
}
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
chroma_4mv_motion(s, dest_cb, dest_cr,
ref_picture, pix_op[1], mx, my);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_parser.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_parser.c
index cbea9b6cec4..1f74bfb86bc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_parser.c
@@ -47,6 +47,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
int set_dim_ret = 0;
int bit_rate = 0;
int vbv_delay = 0;
+ int chroma_format;
+ enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
//FIXME replace the crap with get_bits()
s->repeat_pict = 0;
@@ -70,6 +72,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
set_dim_ret = ff_set_dimensions(avctx, pc->width, pc->height);
did_set_size=1;
}
+ pix_fmt = AV_PIX_FMT_YUV420P;
frame_rate_index = buf[3] & 0xf;
pc->frame_rate = avctx->framerate = ff_mpeg12_frame_rate_tab[frame_rate_index];
bit_rate = (buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6);
@@ -91,6 +94,13 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
pc->progressive_sequence = buf[1] & (1 << 3);
avctx->has_b_frames= !(buf[5] >> 7);
+ chroma_format = (buf[1] >> 1) & 3;
+ switch (chroma_format) {
+ case 1: pix_fmt = AV_PIX_FMT_YUV420P; break;
+ case 2: pix_fmt = AV_PIX_FMT_YUV422P; break;
+ case 3: pix_fmt = AV_PIX_FMT_YUV444P; break;
+ }
+
pc->width = (pc->width & 0xFFF) | (horiz_size_ext << 12);
pc->height = (pc->height& 0xFFF) | ( vert_size_ext << 12);
bit_rate = (bit_rate&0x3FFFF) | (bit_rate_ext << 18);
@@ -149,12 +159,19 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n");
if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) {
- avctx->rc_max_rate = 400*bit_rate;
+ avctx->rc_max_rate = 400LL*bit_rate;
}
if (bit_rate &&
((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) {
- avctx->bit_rate = 400*bit_rate;
+ avctx->bit_rate = 400LL*bit_rate;
}
+
+ if (pix_fmt != AV_PIX_FMT_NONE) {
+ s->format = pix_fmt;
+ s->width = s->coded_width = pc->width;
+ s->height = s->coded_height = pc->height;
+ }
+
#if FF_API_AVCTX_TIMEBASE
if (avctx->framerate.num)
avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
index 10475e0559b..b469c4e26f2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideo_xvmc.c
@@ -298,7 +298,7 @@ static void ff_xvmc_decode_mb(struct MpegEncContext *s)
cbp++;
}
- if (s->avctx->flags & CODEC_FLAG_GRAY) {
+ if (s->avctx->flags & AV_CODEC_FLAG_GRAY) {
if (s->mb_intra) { // intra frames are always full chroma blocks
for (i = 4; i < blocks_per_mb; i++) {
memset(s->pblocks[i], 0, sizeof(*s->pblocks[i])); // so we need to clear them
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.c b/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.c
index 860c2d85742..d6caf4ac1c7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.c
@@ -176,4 +176,6 @@ av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c,
ff_mpegvideoencdsp_init_ppc(c, avctx);
if (ARCH_X86)
ff_mpegvideoencdsp_init_x86(c, avctx);
+ if (ARCH_MIPS)
+ ff_mpegvideoencdsp_init_mips(c, avctx);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.h b/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.h
index e12f4c6a39a..33f0282fcc3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mpegvideoencdsp.h
@@ -52,5 +52,7 @@ void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c,
AVCodecContext *avctx);
void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
AVCodecContext *avctx);
+void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c,
+ AVCodecContext *avctx);
#endif /* AVCODEC_MPEGVIDEOENCDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mqcenc.c b/chromium/third_party/ffmpeg/libavcodec/mqcenc.c
index b82752750ea..7c9e1a0df96 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mqcenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mqcenc.c
@@ -121,7 +121,6 @@ int ff_mqc_flush(MqcState *mqc)
int ff_mqc_flush_to(MqcState *mqc, uint8_t *dst, int *dst_len)
{
- int len;
MqcState mqc2 = *mqc;
mqc2.bpstart=
mqc2.bp = dst;
diff --git a/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c b/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
index 2feb2beb21c..aaadd9c0735 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msmpeg4dec.c
@@ -541,7 +541,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
s->no_rounding = 0;
}
}
- ff_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+ ff_dlog(s->avctx, "%d %"PRId64" %d %d %d\n", s->pict_type, s->bit_rate,
s->inter_intra_pred, s->width, s->height);
s->esc3_level_length= 0;
@@ -924,7 +924,7 @@ AVCodec ff_msmpeg4v1_decoder = {
.init = ff_msmpeg4_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
@@ -941,7 +941,7 @@ AVCodec ff_msmpeg4v2_decoder = {
.init = ff_msmpeg4_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
@@ -958,7 +958,7 @@ AVCodec ff_msmpeg4v3_decoder = {
.init = ff_msmpeg4_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
@@ -975,7 +975,7 @@ AVCodec ff_wmv1_decoder = {
.init = ff_msmpeg4_decode_init,
.close = ff_h263_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/msmpeg4enc.c b/chromium/third_party/ffmpeg/libavcodec/msmpeg4enc.c
index e138f087a28..e1ade248a3e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msmpeg4enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msmpeg4enc.c
@@ -240,7 +240,7 @@ void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
s->per_mb_rl_table = 0;
if(s->msmpeg4_version==4)
s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
- ff_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+ ff_dlog(s, "%d %"PRId64" %d %d %d\n", s->pict_type, s->bit_rate,
s->inter_intra_pred, s->width, s->height);
if (s->pict_type == AV_PICTURE_TYPE_I) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/msrle.c b/chromium/third_party/ffmpeg/libavcodec/msrle.c
index 260ad807ea6..df9f795b66d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msrle.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msrle.c
@@ -166,5 +166,5 @@ AVCodec ff_msrle_decoder = {
.init = msrle_decode_init,
.close = msrle_decode_end,
.decode = msrle_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss1.c b/chromium/third_party/ffmpeg/libavcodec/mss1.c
index 2eb67df6b8d..a579d9d9a44 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss1.c
@@ -224,5 +224,5 @@ AVCodec ff_mss1_decoder = {
.init = mss1_decode_init,
.close = mss1_decode_end,
.decode = mss1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss2.c b/chromium/third_party/ffmpeg/libavcodec/mss2.c
index f57685d7b1a..74e52af6cd8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss2.c
@@ -52,9 +52,9 @@ static void arith2_normalise(ArithCoder *c)
c->value ^= 0x8000;
c->low ^= 0x8000;
}
- c->high = c->high << 8 & 0xFFFFFF | 0xFF;
- c->value = c->value << 8 & 0xFFFFFF | bytestream2_get_byte(c->gbc.gB);
- c->low = c->low << 8 & 0xFFFFFF;
+ c->high = (uint16_t)c->high << 8 | 0xFF;
+ c->value = (uint16_t)c->value << 8 | bytestream2_get_byte(c->gbc.gB);
+ c->low = (uint16_t)c->low << 8;
}
}
@@ -477,7 +477,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
- av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
+ av_assert0(AV_INPUT_BUFFER_PADDING_SIZE >=
ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
@@ -849,5 +849,5 @@ AVCodec ff_mss2_decoder = {
.init = mss2_decode_init,
.close = mss2_decode_end,
.decode = mss2_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss3.c b/chromium/third_party/ffmpeg/libavcodec/mss3.c
index 075685b902d..01941967a59 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss3.c
@@ -869,5 +869,5 @@ AVCodec ff_msa1_decoder = {
.init = mss3_decode_init,
.close = mss3_decode_end,
.decode = mss3_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss4.c b/chromium/third_party/ffmpeg/libavcodec/mss4.c
index 00c31dda15d..9639fc820e2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss4.c
@@ -679,5 +679,5 @@ AVCodec ff_mts2_decoder = {
.init = mss4_decode_init,
.close = mss4_decode_end,
.decode = mss4_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/msvideo1.c b/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
index 88397beb002..891675fcb0b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msvideo1.c
@@ -346,5 +346,5 @@ AVCodec ff_msvideo1_decoder = {
.init = msvideo1_decode_init,
.close = msvideo1_decode_end,
.decode = msvideo1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c b/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
index 5e6cdfa3f81..b6ae92b2ac7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/msvideo1enc.c
@@ -76,7 +76,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int skips = 0;
int quality = 24;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*9 + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width*avctx->height*9 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
dst= buf= pkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mvcdec.c b/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
index 69f0ee259cf..74f279a6662 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mvcdec.c
@@ -274,7 +274,7 @@ AVCodec ff_mvc1_decoder = {
.init = mvc_decode_init,
.close = mvc_decode_end,
.decode = mvc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -288,6 +288,6 @@ AVCodec ff_mvc2_decoder = {
.init = mvc_decode_init,
.close = mvc_decode_end,
.decode = mvc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c b/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
index 05c74eed2bb..2e3ebe6e70e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mxpegdec.c
@@ -343,7 +343,7 @@ AVCodec ff_mxpeg_decoder = {
.init = mxpeg_decode_init,
.close = mxpeg_decode_end,
.decode = mxpeg_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/nellymoserdec.c b/chromium/third_party/ffmpeg/libavcodec/nellymoserdec.c
index d5a69ed0def..5f18593c9c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nellymoserdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nellymoserdec.c
@@ -121,7 +121,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
av_lfg_init(&s->random_state, 0);
ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
@@ -205,7 +205,7 @@ AVCodec ff_nellymoser_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_tag,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c b/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
index 7c77ff74e06..d7368d07e0e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nellymoserenc.c
@@ -171,7 +171,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->avctx = avctx;
if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)
goto error;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp) {
ret = AVERROR(ENOMEM);
goto error;
@@ -397,7 +397,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s->last_frame = 1;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN, 0)) < 0)
return ret;
encode_block(s, avpkt->data, avpkt->size);
@@ -418,7 +418,7 @@ AVCodec ff_nellymoser_encoder = {
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/noise_bsf.c b/chromium/third_party/ffmpeg/libavcodec/noise_bsf.c
index 4f609de7bfa..556ad5c5495 100644
--- a/chromium/third_party/ffmpeg/libavcodec/noise_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/noise_bsf.c
@@ -35,11 +35,11 @@ static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const ch
if(amount <= 0)
return AVERROR(EINVAL);
- *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf= av_malloc(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
- memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ memcpy(*poutbuf, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
for(i=0; i<buf_size; i++){
(*state) += (*poutbuf)[i] + 1;
if(*state % amount == 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/nuv.c b/chromium/third_party/ffmpeg/libavcodec/nuv.c
index e0cec529076..f3270cb19d9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nuv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nuv.c
@@ -124,7 +124,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height,
if (width != c->width || height != c->height) {
// also reserve space for a possible additional header
int buf_size = height * width * 3 / 2
- + FFMAX(AV_LZO_OUTPUT_PADDING, FF_INPUT_BUFFER_PADDING_SIZE)
+ + FFMAX(AV_LZO_OUTPUT_PADDING, AV_INPUT_BUFFER_PADDING_SIZE)
+ RTJPEG_HEADER_SIZE;
if (buf_size > INT_MAX/8)
return -1;
@@ -208,15 +208,15 @@ retry:
buf = &buf[12];
buf_size -= 12;
if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) {
- int outlen = c->decomp_size - FFMAX(FF_INPUT_BUFFER_PADDING_SIZE, AV_LZO_OUTPUT_PADDING);
+ int outlen = c->decomp_size - FFMAX(AV_INPUT_BUFFER_PADDING_SIZE, AV_LZO_OUTPUT_PADDING);
int inlen = buf_size;
if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen)) {
av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
return AVERROR_INVALIDDATA;
}
buf = c->decomp_buf;
- buf_size = c->decomp_size - FFMAX(FF_INPUT_BUFFER_PADDING_SIZE, AV_LZO_OUTPUT_PADDING) - outlen;
- memset(c->decomp_buf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ buf_size = c->decomp_size - FFMAX(AV_INPUT_BUFFER_PADDING_SIZE, AV_LZO_OUTPUT_PADDING) - outlen;
+ memset(c->decomp_buf + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
if (c->codec_frameheader) {
int w, h, q;
@@ -347,5 +347,5 @@ AVCodec ff_nuv_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/nvenc.c b/chromium/third_party/ffmpeg/libavcodec/nvenc.c
index a5652c545ad..18bcd96f096 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nvenc.c
@@ -93,7 +93,7 @@ typedef struct NvencData
union {
int64_t timestamp;
NvencOutputSurface *surface;
- };
+ } u;
} NvencData;
typedef struct NvencDataList
@@ -163,6 +163,7 @@ typedef struct NvencContext
int cbr;
int twopass;
int gpu;
+ int buffer_delay;
} NvencContext;
static const NvencValuePair nvenc_h264_level_pairs[] = {
@@ -296,7 +297,7 @@ static int data_queue_enqueue(NvencDataList* queue, NvencData *data)
static int out_surf_queue_enqueue(NvencDataList* queue, NvencOutputSurface* surface)
{
NvencData data;
- data.surface = surface;
+ data.u.surface = surface;
return data_queue_enqueue(queue, &data);
}
@@ -308,13 +309,13 @@ static NvencOutputSurface* out_surf_queue_dequeue(NvencDataList* queue)
if (!res)
return NULL;
- return res->surface;
+ return res->u.surface;
}
static int timestamp_queue_enqueue(NvencDataList* queue, int64_t timestamp)
{
NvencData data;
- data.timestamp = timestamp;
+ data.u.timestamp = timestamp;
return data_queue_enqueue(queue, &data);
}
@@ -326,7 +327,7 @@ static int64_t timestamp_queue_dequeue(NvencDataList* queue)
if (!res)
return AV_NOPTS_VALUE;
- return res->timestamp;
+ return res->u.timestamp;
}
#define CHECK_LOAD_FUNC(t, f, s) \
@@ -401,13 +402,13 @@ static av_cold int nvenc_check_cuda(AVCodecContext *avctx)
switch (avctx->codec->id) {
case AV_CODEC_ID_H264:
- target_smver = 0x30;
+ target_smver = avctx->pix_fmt == AV_PIX_FMT_YUV444P ? 0x52 : 0x30;
break;
case AV_CODEC_ID_H265:
target_smver = 0x52;
break;
default:
- av_log(avctx, AV_LOG_FATAL, "nvenc: Unknown codec name\n");
+ av_log(avctx, AV_LOG_FATAL, "Unknown codec name\n");
goto error;
}
@@ -552,8 +553,10 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
int surfaceCount = 0;
int i, num_mbs;
int isLL = 0;
+ int lossless = 0;
int res = 0;
int dw, dh;
+ int qp_inter_p;
NvencContext *ctx = avctx->priv_data;
NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs;
@@ -562,12 +565,6 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
if (!nvenc_dyload_nvenc(avctx))
return AVERROR_EXTERNAL;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- res = AVERROR(ENOMEM);
- goto error;
- }
-
ctx->last_dts = AV_NOPTS_VALUE;
ctx->encode_config.version = NV_ENC_CONFIG_VER;
@@ -584,7 +581,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
}
ctx->cu_context = NULL;
- cu_res = dl_fn->cu_ctx_create(&ctx->cu_context, 0, dl_fn->nvenc_devices[ctx->gpu]);
+ cu_res = dl_fn->cu_ctx_create(&ctx->cu_context, 4, dl_fn->nvenc_devices[ctx->gpu]); // CU_CTX_SCHED_BLOCKING_SYNC=4, avoid CPU spins
if (cu_res != CUDA_SUCCESS) {
av_log(avctx, AV_LOG_FATAL, "Failed creating CUDA context for NVENC: 0x%x\n", (int)cu_res);
@@ -606,16 +603,25 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
nv_status = p_nvenc->nvEncOpenEncodeSessionEx(&encode_session_params, &ctx->nvencoder);
if (nv_status != NV_ENC_SUCCESS) {
ctx->nvencoder = NULL;
- av_log(avctx, AV_LOG_FATAL, "OpenEncodeSessionEx failed: 0x%x - invalid license key?\n", (int)nv_status);
+ av_log(avctx, AV_LOG_FATAL, "OpenEncodeSessionEx failed: 0x%x\n", (int)nv_status);
res = AVERROR_EXTERNAL;
goto error;
}
if (ctx->preset) {
- if (!strcmp(ctx->preset, "hp")) {
+ if (!strcmp(ctx->preset, "slow")) {
+ encoder_preset = NV_ENC_PRESET_HQ_GUID;
+ ctx->twopass = 1;
+ } else if (!strcmp(ctx->preset, "medium")) {
+ encoder_preset = NV_ENC_PRESET_HQ_GUID;
+ ctx->twopass = 0;
+ } else if (!strcmp(ctx->preset, "fast")) {
encoder_preset = NV_ENC_PRESET_HP_GUID;
+ ctx->twopass = 0;
} else if (!strcmp(ctx->preset, "hq")) {
encoder_preset = NV_ENC_PRESET_HQ_GUID;
+ } else if (!strcmp(ctx->preset, "hp")) {
+ encoder_preset = NV_ENC_PRESET_HP_GUID;
} else if (!strcmp(ctx->preset, "bd")) {
encoder_preset = NV_ENC_PRESET_BD_GUID;
} else if (!strcmp(ctx->preset, "ll")) {
@@ -627,15 +633,25 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
} else if (!strcmp(ctx->preset, "llhq")) {
encoder_preset = NV_ENC_PRESET_LOW_LATENCY_HQ_GUID;
isLL = 1;
+ } else if (!strcmp(ctx->preset, "lossless")) {
+ encoder_preset = NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID;
+ lossless = 1;
+ } else if (!strcmp(ctx->preset, "losslesshp")) {
+ encoder_preset = NV_ENC_PRESET_LOSSLESS_HP_GUID;
+ lossless = 1;
} else if (!strcmp(ctx->preset, "default")) {
encoder_preset = NV_ENC_PRESET_DEFAULT_GUID;
} else {
- av_log(avctx, AV_LOG_FATAL, "Preset \"%s\" is unknown! Supported presets: hp, hq, bd, ll, llhp, llhq, default\n", ctx->preset);
+ av_log(avctx, AV_LOG_FATAL, "Preset \"%s\" is unknown! Supported presets: slow, medium, high, hp, hq, bd, ll, llhp, llhq, lossless, losslesshp, default\n", ctx->preset);
res = AVERROR(EINVAL);
goto error;
}
}
+ if (ctx->twopass < 0) {
+ ctx->twopass = isLL;
+ }
+
switch (avctx->codec->id) {
case AV_CODEC_ID_H264:
codec = NV_ENC_CODEC_H264_GUID;
@@ -644,7 +660,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
codec = NV_ENC_CODEC_HEVC_GUID;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "nvenc: Unknown codec name\n");
+ av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n");
res = AVERROR(EINVAL);
goto error;
}
@@ -691,6 +707,9 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
num_mbs = ((avctx->width + 15) >> 4) * ((avctx->height + 15) >> 4);
ctx->max_surface_count = (num_mbs >= 8160) ? 32 : 48;
+ if (ctx->buffer_delay >= ctx->max_surface_count)
+ ctx->buffer_delay = ctx->max_surface_count - 1;
+
ctx->init_encode_params.enableEncodeAsync = 0;
ctx->init_encode_params.enablePTD = 1;
@@ -723,6 +742,8 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
switch (avctx->codec->id) {
case AV_CODEC_ID_H264:
ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod = avctx->gop_size;
+ ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalPFrames = 1;
+ ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalBFrames = 1;
break;
case AV_CODEC_ID_H265:
ctx->encode_config.encodeCodecConfig.hevcConfig.idrPeriod = avctx->gop_size;
@@ -753,21 +774,27 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
if (avctx->rc_max_rate > 0)
ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
- if (ctx->cbr) {
+ if (lossless) {
+ if (avctx->codec->id == AV_CODEC_ID_H264)
+ ctx->encode_config.encodeCodecConfig.h264Config.qpPrimeYZeroTransformBypassFlag = 1;
+
+ ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CONSTQP;
+ ctx->encode_config.rcParams.constQP.qpInterB = 0;
+ ctx->encode_config.rcParams.constQP.qpInterP = 0;
+ ctx->encode_config.rcParams.constQP.qpIntra = 0;
+
+ avctx->qmin = -1;
+ avctx->qmax = -1;
+ } else if (ctx->cbr) {
if (!ctx->twopass) {
ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CBR;
- } else if (ctx->twopass == 1 || isLL) {
+ } else {
ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_2_PASS_QUALITY;
if (avctx->codec->id == AV_CODEC_ID_H264) {
ctx->encode_config.encodeCodecConfig.h264Config.adaptiveTransformMode = NV_ENC_H264_ADAPTIVE_TRANSFORM_ENABLE;
ctx->encode_config.encodeCodecConfig.h264Config.fmoMode = NV_ENC_H264_FMO_DISABLE;
}
-
- if (!isLL)
- av_log(avctx, AV_LOG_WARNING, "Twopass mode is only known to work with low latency (ll, llhq, llhp) presets.\n");
- } else {
- ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CBR;
}
} else if (avctx->global_quality > 0) {
ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_CONSTQP;
@@ -777,25 +804,58 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
avctx->qmin = -1;
avctx->qmax = -1;
- } else if (avctx->qmin >= 0 && avctx->qmax >= 0) {
- ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR;
+ } else {
+ if (avctx->qmin >= 0 && avctx->qmax >= 0) {
+ ctx->encode_config.rcParams.enableMinQP = 1;
+ ctx->encode_config.rcParams.enableMaxQP = 1;
+
+ ctx->encode_config.rcParams.minQP.qpInterB = avctx->qmin;
+ ctx->encode_config.rcParams.minQP.qpInterP = avctx->qmin;
+ ctx->encode_config.rcParams.minQP.qpIntra = avctx->qmin;
+
+ ctx->encode_config.rcParams.maxQP.qpInterB = avctx->qmax;
+ ctx->encode_config.rcParams.maxQP.qpInterP = avctx->qmax;
+ ctx->encode_config.rcParams.maxQP.qpIntra = avctx->qmax;
+
+ qp_inter_p = (avctx->qmax + 3 * avctx->qmin) / 4; // biased towards Qmin
+
+ if (ctx->twopass) {
+ ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_2_PASS_VBR;
+ if (avctx->codec->id == AV_CODEC_ID_H264) {
+ ctx->encode_config.encodeCodecConfig.h264Config.adaptiveTransformMode = NV_ENC_H264_ADAPTIVE_TRANSFORM_ENABLE;
+ ctx->encode_config.encodeCodecConfig.h264Config.fmoMode = NV_ENC_H264_FMO_DISABLE;
+ }
+ } else {
+ ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR_MINQP;
+ }
+ } else {
+ qp_inter_p = 26; // default to 26
- ctx->encode_config.rcParams.enableMinQP = 1;
- ctx->encode_config.rcParams.enableMaxQP = 1;
+ if (ctx->twopass) {
+ ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_2_PASS_VBR;
+ } else {
+ ctx->encode_config.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR;
+ }
+ }
- ctx->encode_config.rcParams.minQP.qpInterB = avctx->qmin;
- ctx->encode_config.rcParams.minQP.qpInterP = avctx->qmin;
- ctx->encode_config.rcParams.minQP.qpIntra = avctx->qmin;
+ ctx->encode_config.rcParams.enableInitialRCQP = 1;
+ ctx->encode_config.rcParams.initialRCQP.qpInterP = qp_inter_p;
- ctx->encode_config.rcParams.maxQP.qpInterB = avctx->qmax;
- ctx->encode_config.rcParams.maxQP.qpInterP = avctx->qmax;
- ctx->encode_config.rcParams.maxQP.qpIntra = avctx->qmax;
+ if(avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) {
+ ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p * fabs(avctx->i_quant_factor);
+ ctx->encode_config.rcParams.initialRCQP.qpIntra += qp_inter_p * avctx->i_quant_offset;
+ ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p * fabs(avctx->b_quant_factor);
+ ctx->encode_config.rcParams.initialRCQP.qpInterB += qp_inter_p * avctx->b_quant_offset;
+ } else {
+ ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p;
+ ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p;
+ }
}
if (avctx->rc_buffer_size > 0)
ctx->encode_config.rcParams.vbvBufferSize = avctx->rc_buffer_size;
- if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
ctx->encode_config.frameFieldMode = NV_ENC_PARAMS_FRAME_FIELD_MODE_FIELD;
} else {
ctx->encode_config.frameFieldMode = NV_ENC_PARAMS_FRAME_FIELD_MODE_FRAME;
@@ -812,11 +872,14 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
- ctx->encode_config.encodeCodecConfig.h264Config.disableSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
- ctx->encode_config.encodeCodecConfig.h264Config.repeatSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
+ ctx->encode_config.encodeCodecConfig.h264Config.disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
+ ctx->encode_config.encodeCodecConfig.h264Config.repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
if (!ctx->profile) {
switch (avctx->profile) {
+ case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+ ctx->encode_config.profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
+ break;
case FF_PROFILE_H264_BASELINE:
ctx->encode_config.profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID;
break;
@@ -842,6 +905,9 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
} else if (!strcmp(ctx->profile, "baseline")) {
ctx->encode_config.profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID;
avctx->profile = FF_PROFILE_H264_BASELINE;
+ } else if (!strcmp(ctx->profile, "high444p")) {
+ ctx->encode_config.profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
+ avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE;
} else {
av_log(avctx, AV_LOG_FATAL, "Profile \"%s\" is unknown! Supported profiles: high, main, baseline\n", ctx->profile);
res = AVERROR(EINVAL);
@@ -849,6 +915,8 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
}
}
+ ctx->encode_config.encodeCodecConfig.h264Config.chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1;
+
if (ctx->level) {
res = input_string_to_uint32(avctx, nvenc_h264_level_pairs, ctx->level, &ctx->encode_config.encodeCodecConfig.h264Config.level);
@@ -862,8 +930,8 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
break;
case AV_CODEC_ID_H265:
- ctx->encode_config.encodeCodecConfig.hevcConfig.disableSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
- ctx->encode_config.encodeCodecConfig.hevcConfig.repeatSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
+ ctx->encode_config.encodeCodecConfig.hevcConfig.disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
+ ctx->encode_config.encodeCodecConfig.hevcConfig.repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
/* No other profile is supported in the current SDK version 5 */
ctx->encode_config.profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
@@ -978,7 +1046,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
ctx->output_surfaces[surfaceCount].busy = 0;
}
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
uint32_t outSize = 0;
char tmpHeader[256];
NV_ENC_SEQUENCE_PARAM_PAYLOAD payload = { 0 };
@@ -995,7 +1063,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
}
avctx->extradata_size = outSize;
- avctx->extradata = av_mallocz(outSize + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(outSize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
res = AVERROR(ENOMEM);
@@ -1027,8 +1095,6 @@ error:
if (ctx->cu_context)
dl_fn->cu_ctx_destroy(ctx->cu_context);
- av_frame_free(&avctx->coded_frame);
-
nvenc_unload_nvenc(avctx);
ctx->nvencoder = NULL;
@@ -1062,12 +1128,10 @@ static av_cold int nvenc_encode_close(AVCodecContext *avctx)
nvenc_unload_nvenc(avctx);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
-static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, AVFrame *coded_frame, NvencOutputSurface *tmpoutsurf)
+static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencOutputSurface *tmpoutsurf)
{
NvencContext *ctx = avctx->priv_data;
NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs;
@@ -1087,7 +1151,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, AVFrame
slice_mode_data = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "nvenc: Unknown codec name\n");
+ av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n");
res = AVERROR(EINVAL);
goto error;
}
@@ -1109,7 +1173,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, AVFrame
goto error;
}
- if (res = ff_alloc_packet2(avctx, pkt, lock_params.bitstreamSizeInBytes)) {
+ if (res = ff_alloc_packet2(avctx, pkt, lock_params.bitstreamSizeInBytes,0)) {
p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface);
goto error;
}
@@ -1123,6 +1187,8 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, AVFrame
switch (lock_params.pictureType) {
case NV_ENC_PIC_TYPE_IDR:
pkt->flags |= AV_PKT_FLAG_KEY;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
case NV_ENC_PIC_TYPE_I:
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
break;
@@ -1140,6 +1206,8 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, AVFrame
av_log(avctx, AV_LOG_ERROR, "Please report this error and include as much information on how to reproduce it as possible.\n");
res = AVERROR_EXTERNAL;
goto error;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
pkt->pts = lock_params.outputTimeStamp;
@@ -1285,7 +1353,7 @@ static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pic_params.outputBitstream = ctx->output_surfaces[i].output_surface;
pic_params.completionEvent = 0;
- if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
if (frame->top_field_first) {
pic_params.pictureStruct = NV_ENC_PIC_STRUCT_FIELD_TOP_BOTTOM;
} else {
@@ -1308,7 +1376,7 @@ static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pic_params.codecPicParams.hevcPicParams.sliceModeData = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "nvenc: Unknown codec name\n");
+ av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n");
return AVERROR(EINVAL);
}
@@ -1355,10 +1423,10 @@ static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
- if (ctx->output_surface_ready_queue.count) {
+ if (ctx->output_surface_ready_queue.count && (!frame || ctx->output_surface_ready_queue.count + ctx->output_surface_queue.count >= ctx->buffer_delay)) {
tmpoutsurf = out_surf_queue_dequeue(&ctx->output_surface_ready_queue);
- res = process_output_surface(avctx, pkt, avctx->coded_frame, tmpoutsurf);
+ res = process_output_surface(avctx, pkt, tmpoutsurf);
if (res)
return res;
@@ -1378,19 +1446,21 @@ static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static const enum AVPixelFormat pix_fmts_nvenc[] = {
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NV12,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NONE
};
#define OFFSET(x) offsetof(NvencContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "preset", "Set the encoding preset (one of hq, hp, bd, ll, llhq, llhp, default)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "hq" }, 0, 0, VE },
+ { "preset", "Set the encoding preset (one of slow = hq 2pass, medium = hq, fast = hp, hq, hp, bd, ll, llhq, llhp, default)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "hq" }, 0, 0, VE },
{ "profile", "Set the encoding profile (high, main or baseline)", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "level", "Set the encoding level restriction (auto, 1.0, 1.0b, 1.1, 1.2, ..., 4.2, 5.0, 5.1)", OFFSET(level), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "tier", "Set the encoding tier (main or high)", OFFSET(tier), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
- { "cbr", "Use cbr encoding mode", OFFSET(cbr), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
- { "2pass", "Use 2pass cbr encoding mode (low latency mode only)", OFFSET(twopass), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE },
+ { "cbr", "Use cbr encoding mode", OFFSET(cbr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+ { "2pass", "Use 2pass encoding mode", OFFSET(twopass), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
{ "gpu", "Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.", OFFSET(gpu), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "delay", "Delays frame output by the given amount of frames.", OFFSET(buffer_delay), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 0, INT_MAX, VE },
{ NULL }
};
@@ -1414,14 +1484,14 @@ static const AVClass nvenc_class = {
AVCodec ff_nvenc_encoder = {
.name = "nvenc",
- .long_name = NULL_IF_CONFIG_SMALL("Nvidia NVENC h264 encoder"),
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC h264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.priv_data_size = sizeof(NvencContext),
.init = nvenc_encode_init,
.encode2 = nvenc_encode_frame,
.close = nvenc_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.priv_class = &nvenc_class,
.defaults = nvenc_defaults,
.pix_fmts = pix_fmts_nvenc,
@@ -1439,14 +1509,14 @@ static const AVClass nvenc_h264_class = {
AVCodec ff_nvenc_h264_encoder = {
.name = "nvenc_h264",
- .long_name = NULL_IF_CONFIG_SMALL("Nvidia NVENC h264 encoder"),
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC h264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.priv_data_size = sizeof(NvencContext),
.init = nvenc_encode_init,
.encode2 = nvenc_encode_frame,
.close = nvenc_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.priv_class = &nvenc_h264_class,
.defaults = nvenc_defaults,
.pix_fmts = pix_fmts_nvenc,
@@ -1463,14 +1533,14 @@ static const AVClass nvenc_hevc_class = {
AVCodec ff_nvenc_hevc_encoder = {
.name = "nvenc_hevc",
- .long_name = NULL_IF_CONFIG_SMALL("Nvidia NVENC hevc encoder"),
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC hevc encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H265,
.priv_data_size = sizeof(NvencContext),
.init = nvenc_encode_init,
.encode2 = nvenc_encode_frame,
.close = nvenc_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.priv_class = &nvenc_hevc_class,
.defaults = nvenc_defaults,
.pix_fmts = pix_fmts_nvenc,
diff --git a/chromium/third_party/ffmpeg/libavcodec/old_codec_ids.h b/chromium/third_party/ffmpeg/libavcodec/old_codec_ids.h
deleted file mode 100644
index c7aa0e0a126..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/old_codec_ids.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_OLD_CODEC_IDS_H
-#define AVCODEC_OLD_CODEC_IDS_H
-
-/*
- * This header exists to prevent new codec IDs from being accidentally added to
- * the deprecated list.
- * Do not include it directly. It will be removed on next major bump
- *
- * Do not add new items to this list. Use the AVCodecID enum instead.
- */
-
- CODEC_ID_NONE = AV_CODEC_ID_NONE,
-
- /* video codecs */
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-#if FF_API_XVMC
- CODEC_ID_MPEG2VIDEO_XVMC,
-#endif
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_DXA,
- CODEC_ID_DNXHD,
- CODEC_ID_THP,
- CODEC_ID_SGI,
- CODEC_ID_C93,
- CODEC_ID_BETHSOFTVID,
- CODEC_ID_PTX,
- CODEC_ID_TXD,
- CODEC_ID_VP6A,
- CODEC_ID_AMV,
- CODEC_ID_VB,
- CODEC_ID_PCX,
- CODEC_ID_SUNRAST,
- CODEC_ID_INDEO4,
- CODEC_ID_INDEO5,
- CODEC_ID_MIMIC,
- CODEC_ID_RL2,
- CODEC_ID_ESCAPE124,
- CODEC_ID_DIRAC,
- CODEC_ID_BFI,
- CODEC_ID_CMV,
- CODEC_ID_MOTIONPIXELS,
- CODEC_ID_TGV,
- CODEC_ID_TGQ,
- CODEC_ID_TQI,
- CODEC_ID_AURA,
- CODEC_ID_AURA2,
- CODEC_ID_V210X,
- CODEC_ID_TMV,
- CODEC_ID_V210,
- CODEC_ID_DPX,
- CODEC_ID_MAD,
- CODEC_ID_FRWU,
- CODEC_ID_FLASHSV2,
- CODEC_ID_CDGRAPHICS,
- CODEC_ID_R210,
- CODEC_ID_ANM,
- CODEC_ID_BINKVIDEO,
- CODEC_ID_IFF_ILBM,
- CODEC_ID_IFF_BYTERUN1,
- CODEC_ID_KGV1,
- CODEC_ID_YOP,
- CODEC_ID_VP8,
- CODEC_ID_PICTOR,
- CODEC_ID_ANSI,
- CODEC_ID_A64_MULTI,
- CODEC_ID_A64_MULTI5,
- CODEC_ID_R10K,
- CODEC_ID_MXPEG,
- CODEC_ID_LAGARITH,
- CODEC_ID_PRORES,
- CODEC_ID_JV,
- CODEC_ID_DFA,
- CODEC_ID_WMV3IMAGE,
- CODEC_ID_VC1IMAGE,
- CODEC_ID_UTVIDEO,
- CODEC_ID_BMV_VIDEO,
- CODEC_ID_VBLE,
- CODEC_ID_DXTORY,
- CODEC_ID_V410,
- CODEC_ID_XWD,
- CODEC_ID_CDXL,
- CODEC_ID_XBM,
- CODEC_ID_ZEROCODEC,
- CODEC_ID_MSS1,
- CODEC_ID_MSA1,
- CODEC_ID_TSCC2,
- CODEC_ID_MTS2,
- CODEC_ID_CLLC,
- CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
- CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
- CODEC_ID_EXR = MKBETAG('0','E','X','R'),
- CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
-
- CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
- CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
- CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
- CODEC_ID_V308 = MKBETAG('V','3','0','8'),
- CODEC_ID_V408 = MKBETAG('V','4','0','8'),
- CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
- CODEC_ID_SANM = MKBETAG('S','A','N','M'),
- CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
- CODEC_ID_SNOW = AV_CODEC_ID_SNOW,
-
- /* various PCM "codecs" */
- CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
- CODEC_ID_PCM_S16LE = 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
- CODEC_ID_PCM_ZORK,
- CODEC_ID_PCM_S16LE_PLANAR,
- CODEC_ID_PCM_DVD,
- CODEC_ID_PCM_F32BE,
- CODEC_ID_PCM_F32LE,
- CODEC_ID_PCM_F64BE,
- CODEC_ID_PCM_F64LE,
- CODEC_ID_PCM_BLURAY,
- CODEC_ID_PCM_LXF,
- CODEC_ID_S302M,
- CODEC_ID_PCM_S8_PLANAR,
-
- /* various ADPCM codecs */
- CODEC_ID_ADPCM_IMA_QT = 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
- CODEC_ID_ADPCM_THP,
- CODEC_ID_ADPCM_IMA_AMV,
- CODEC_ID_ADPCM_EA_R1,
- CODEC_ID_ADPCM_EA_R3,
- CODEC_ID_ADPCM_EA_R2,
- CODEC_ID_ADPCM_IMA_EA_SEAD,
- CODEC_ID_ADPCM_IMA_EA_EACS,
- CODEC_ID_ADPCM_EA_XAS,
- CODEC_ID_ADPCM_EA_MAXIS_XA,
- CODEC_ID_ADPCM_IMA_ISS,
- CODEC_ID_ADPCM_G722,
- CODEC_ID_ADPCM_IMA_APC,
- CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
-
- /* AMR */
- CODEC_ID_AMR_NB = 0x12000,
- CODEC_ID_AMR_WB,
-
- /* RealAudio codecs*/
- CODEC_ID_RA_144 = 0x13000,
- CODEC_ID_RA_288,
-
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM = 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
-
- /* audio codecs */
- CODEC_ID_MP2 = 0x15000,
- CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
- CODEC_ID_AAC,
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM, ///< as in Berlin toast format
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
- CODEC_ID_MLP,
- CODEC_ID_GSM_MS, /* as found in WAV */
- CODEC_ID_ATRAC3,
- CODEC_ID_VOXWARE,
- CODEC_ID_APE,
- CODEC_ID_NELLYMOSER,
- CODEC_ID_MUSEPACK8,
- CODEC_ID_SPEEX,
- CODEC_ID_WMAVOICE,
- CODEC_ID_WMAPRO,
- CODEC_ID_WMALOSSLESS,
- CODEC_ID_ATRAC3P,
- CODEC_ID_EAC3,
- CODEC_ID_SIPR,
- CODEC_ID_MP1,
- CODEC_ID_TWINVQ,
- CODEC_ID_TRUEHD,
- CODEC_ID_MP4ALS,
- CODEC_ID_ATRAC1,
- CODEC_ID_BINKAUDIO_RDFT,
- CODEC_ID_BINKAUDIO_DCT,
- CODEC_ID_AAC_LATM,
- CODEC_ID_QDMC,
- CODEC_ID_CELT,
- CODEC_ID_G723_1,
- CODEC_ID_G729,
- CODEC_ID_8SVX_EXP,
- CODEC_ID_8SVX_FIB,
- CODEC_ID_BMV_AUDIO,
- CODEC_ID_RALF,
- CODEC_ID_IAC,
- CODEC_ID_ILBC,
- CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
- CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
- CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
- CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
- CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
-
- /* subtitle codecs */
- CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
- CODEC_ID_DVD_SUBTITLE = 0x17000,
- CODEC_ID_DVB_SUBTITLE,
- CODEC_ID_TEXT, ///< raw UTF-8 text
- CODEC_ID_XSUB,
- CODEC_ID_SSA,
- CODEC_ID_MOV_TEXT,
- CODEC_ID_HDMV_PGS_SUBTITLE,
- CODEC_ID_DVB_TELETEXT,
- CODEC_ID_SRT,
- CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
- CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
- CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
- CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
- CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
- CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
-
- /* other specific kind of codecs (generally used for attachments) */
- CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
- CODEC_ID_TTF = 0x18000,
- CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
- CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
- CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
- CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
-
- CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
-
- CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
- * stream (only used by libavformat) */
- CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
- * stream (only used by libavformat) */
- CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
-
-#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/on2avc.c b/chromium/third_party/ffmpeg/libavcodec/on2avc.c
index 7e4b9a40421..15f4dd1c66e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/on2avc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/on2avc.c
@@ -951,7 +951,7 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
ff_fft_init(&c->fft256, 7, 0);
ff_fft_init(&c->fft512, 8, 1);
ff_fft_init(&c->fft1024, 9, 1);
- c->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!c->fdsp)
return AVERROR(ENOMEM);
@@ -1016,7 +1016,7 @@ AVCodec ff_on2avc_decoder = {
.init = on2avc_decode_init,
.decode = on2avc_decode_frame,
.close = on2avc_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/options.c b/chromium/third_party/ffmpeg/libavcodec/options.c
index 17dca080604..ea2563b571f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/options.c
+++ b/chromium/third_party/ffmpeg/libavcodec/options.c
@@ -33,7 +33,9 @@
#include <float.h> /* FLT_MIN, FLT_MAX */
#include <string.h>
+FF_DISABLE_DEPRECATION_WARNINGS
#include "options_table.h"
+FF_ENABLE_DEPRECATION_WARNINGS
static const char* context_to_name(void* ptr) {
AVCodecContext *avc= ptr;
@@ -211,7 +213,11 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
dest->slice_offset = NULL;
dest->hwaccel = NULL;
dest->internal = NULL;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
dest->coded_frame = NULL;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
/* reallocate values that should be allocated separately */
dest->extradata = NULL;
@@ -230,7 +236,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
memset(((uint8_t *) dest->obj) + size, 0, pad); \
}
alloc_and_copy_or_fail(extradata, src->extradata_size,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
dest->extradata_size = src->extradata_size;
alloc_and_copy_or_fail(intra_matrix, 64 * sizeof(int16_t), 0);
alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
@@ -316,7 +322,6 @@ 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);
- ctx->coded_frame = av_frame_alloc();
return 0;
}
@@ -324,7 +329,6 @@ static int dummy_close(AVCodecContext *ctx)
{
av_freep(&ctx->extradata);
ctx->extradata_size = 0;
- av_frame_free(&ctx->coded_frame);
return 0;
}
@@ -368,7 +372,7 @@ static const AVClass dummy_v2_class = {
};
/* codec with options */
-AVCodec dummy_v1_encoder = {
+static AVCodec dummy_v1_encoder = {
.name = "dummy_v1_codec",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_NONE - 1,
@@ -380,7 +384,7 @@ AVCodec dummy_v1_encoder = {
};
/* codec with options, different class */
-AVCodec dummy_v2_encoder = {
+static AVCodec dummy_v2_encoder = {
.name = "dummy_v2_codec",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_NONE - 2,
@@ -392,7 +396,7 @@ AVCodec dummy_v2_encoder = {
};
/* codec with priv data, but no class */
-AVCodec dummy_v3_encoder = {
+static AVCodec dummy_v3_encoder = {
.name = "dummy_v3_codec",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_NONE - 3,
@@ -403,7 +407,7 @@ AVCodec dummy_v3_encoder = {
};
/* codec without priv data */
-AVCodec dummy_v4_encoder = {
+static AVCodec dummy_v4_encoder = {
.name = "dummy_v4_codec",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_NONE - 4,
diff --git a/chromium/third_party/ffmpeg/libavcodec/options_table.h b/chromium/third_party/ffmpeg/libavcodec/options_table.h
index a906864dcdd..d6a5c69ac4b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/options_table.h
+++ b/chromium/third_party/ffmpeg/libavcodec/options_table.h
@@ -49,11 +49,11 @@ static const AVOption avcodec_options[] = {
"to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.",
OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E},
{"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, UINT_MAX, V|A|S|E|D, "flags"},
-{"unaligned", "allow decoders to produce unaligned output", 0, AV_OPT_TYPE_CONST, { .i64 = CODEC_FLAG_UNALIGNED }, INT_MIN, INT_MAX, V | D, "flags" },
-{"mv4", "use four motion vectors per macroblock (MPEG-4)", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"},
-{"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
-{"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
-{"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
+{"unaligned", "allow decoders to produce unaligned output", 0, AV_OPT_TYPE_CONST, { .i64 = AV_CODEC_FLAG_UNALIGNED }, INT_MIN, INT_MAX, V | D, "flags" },
+{"mv4", "use four motion vectors per macroblock (MPEG-4)", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"},
+{"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
+{"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
+{"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
#if FF_API_GMC
{"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
#endif
@@ -63,33 +63,34 @@ static const AVOption avcodec_options[] = {
#if FF_API_INPUT_PRESERVED
{"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
#endif
-{"pass1", "use internal 2-pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
-{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
-{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
+{"pass1", "use internal 2-pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
+{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
+{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
#if FF_API_EMU_EDGE
{"emu_edge", "do not draw edges", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
#endif
-{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
-{"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
+{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
+{"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
#if FF_API_NORMALIZE_AQP
{"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
#endif
-{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
-{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
-{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
-{"bitexact", "use only bitexact functions (except (I)DCT)", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
-{"aic", "H.263 advanced intra coding / MPEG-4 AC prediction", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
-{"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"},
-{"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
-{"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, "flags"},
-{"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"ignorecrop", "ignore cropping information from sps", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
-{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"},
-{"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
-{"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, "flags2"},
-{"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, V|D, "flags2"},
+{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
+{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
+{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
+{"bitexact", "use only bitexact functions (except (I)DCT)", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
+{"aic", "H.263 advanced intra coding / MPEG-4 AC prediction", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
+{"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"},
+{"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
+{"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, "flags"},
+{"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
+{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
+{"ignorecrop", "ignore cropping information from sps", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
+{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
+{"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"},
+{"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
+{"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, "flags2"},
+{"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, V|D, "flags2"},
+#if FF_API_MOTION_EST
{"me_method", "set motion estimation method", OFFSET(me_method), AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
{"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
{"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
@@ -103,6 +104,7 @@ static const AVOption avcodec_options[] = {
{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
{"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" },
+#endif
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
@@ -120,7 +122,9 @@ static const AVOption avcodec_options[] = {
{"qdiff", "maximum difference between the quantizer scales (VBR)", OFFSET(max_qdiff), AV_OPT_TYPE_INT, {.i64 = 3 }, INT_MIN, INT_MAX, V|E},
{"bf", "set maximum number of B frames between non-B-frames", OFFSET(max_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, -1, INT_MAX, V|E},
{"b_qfactor", "QP factor between P- and B-frames", OFFSET(b_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
+#if FF_API_RC_STRATEGY
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
+#endif
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
{"ps", "RTP payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
@@ -197,9 +201,7 @@ static const AVOption avcodec_options[] = {
{"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E, "dct"},
{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
{"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
-#if FF_API_UNUSED_MEMBERS
{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
-#endif /* FF_API_UNUSED_MEMBERS */
{"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
{"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
@@ -253,6 +255,7 @@ static const AVOption avcodec_options[] = {
{"mv", "motion vector", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MV }, INT_MIN, INT_MAX, V|D, "debug"},
#endif
{"dct_coeff", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_DCT_COEFF }, INT_MIN, INT_MAX, V|D, "debug"},
+{"green_metadata", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_GREEN_MD }, INT_MIN, INT_MAX, V|D, "debug"},
{"skip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_SKIP }, INT_MIN, INT_MAX, V|D, "debug"},
{"startcode", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_STARTCODE }, INT_MIN, INT_MAX, V|D, "debug"},
#if FF_API_UNUSED_MEMBERS
@@ -299,10 +302,14 @@ static const AVOption avcodec_options[] = {
{"chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_CHROMA }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"subq", "sub-pel motion estimation quality", OFFSET(me_subpel_quality), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E},
+#if FF_API_AFD
{"dtg_active_format", NULL, OFFSET(dtg_active_format), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+#endif
{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
+#if FF_API_QUANT_BIAS
{"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
{"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
+#endif
{"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
{"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"},
{"vlc", "variable length coder / Huffman coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"},
@@ -335,7 +342,7 @@ static const AVOption avcodec_options[] = {
#if FF_API_ERROR_RATE
{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
#endif
-{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
+{"threads", "set the number of threads", OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
#if FF_API_MPV_OPT
{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
@@ -404,9 +411,6 @@ static const AVOption avcodec_options[] = {
{"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
{"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
{"timecode_frame_start", "GOP timecode frame start number, in non-drop-frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = -1 }, -1, INT64_MAX, V|E},
-#if FF_API_REQUEST_CHANNELS
-{"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D},
-#endif
{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
{"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"},
{"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"},
@@ -414,14 +418,15 @@ static const AVOption avcodec_options[] = {
{"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), AV_OPT_TYPE_FLOAT, {.dbl = 3 }, 0.0, FLT_MAX, V|E},
{"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, INT_MAX, A|V|E|D},
{"color_primaries", "color primaries", OFFSET(color_primaries), AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D, "color_primaries_type"},
-{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"bt470m", "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"bt470bg", "BT.470 BG", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smpte170m", "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE170M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smpte240m", "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE240M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"film", "Film", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"bt2020", "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"bt470m", "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"bt470bg", "BT.470 BG", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte170m", "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE170M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte240m", "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE240M }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"film", "Film", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"bt2020", "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
{"color_trc", "color transfer characteristics", OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, "color_trc_type"},
{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT709 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -437,6 +442,8 @@ static const AVOption avcodec_options[] = {
{"iec61966_2_1", "IEC 61966-2-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084", "SMPTE ST 2084", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTEST2084 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
{"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
@@ -461,7 +468,7 @@ static const AVOption avcodec_options[] = {
{"bottomleft", "Bottom-left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOMLEFT }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"},
{"bottom", "Bottom", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOM }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"},
{"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX },
-{"slices", "number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E},
+{"slices", "set the number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E},
{"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.i64 = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|A|E|D, "thread_type"},
{"slice", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
{"frame", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
@@ -482,9 +489,11 @@ static const AVOption avcodec_options[] = {
{"do_nothing", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_DO_NOTHING}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
{"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"},
-{"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|D },
-{"side_data_only_packets", NULL, OFFSET(side_data_only_packets), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, A|V|E },
-{"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, V|D },
+{"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, A|V|D },
+#if FF_API_SIDEDATA_ONLY_PKT
+{"side_data_only_packets", NULL, OFFSET(side_data_only_packets), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, A|V|E },
+#endif
+{"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, V|D },
{"field_order", "Field order", OFFSET(field_order), AV_OPT_TYPE_INT, {.i64 = AV_FIELD_UNKNOWN }, 0, 5, V|D|E, "field_order" },
{"progressive", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_PROGRESSIVE }, 0, 0, V|D|E, "field_order" },
{"tt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TT }, 0, 0, V|D|E, "field_order" },
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus.h b/chromium/third_party/ffmpeg/libavcodec/opus.h
index 92bb28a371d..3a7ea9f5048 100644
--- a/chromium/third_party/ffmpeg/libavcodec/opus.h
+++ b/chromium/third_party/ffmpeg/libavcodec/opus.h
@@ -173,6 +173,16 @@ typedef struct ChannelMap {
typedef struct OpusContext {
OpusStreamContext *streams;
+
+ /* current output buffers for each streams */
+ float **out;
+ int *out_size;
+ /* Buffers for synchronizing the streams when they have different
+ * resampling delays */
+ AVAudioFifo **sync_buffers;
+ /* number of decoded samples for each stream */
+ int *decoded_samples;
+
int nb_streams;
int nb_stereo_streams;
diff --git a/chromium/third_party/ffmpeg/libavcodec/opus_celt.c b/chromium/third_party/ffmpeg/libavcodec/opus_celt.c
index 42623d91639..9911de3848f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/opus_celt.c
+++ b/chromium/third_party/ffmpeg/libavcodec/opus_celt.c
@@ -2209,7 +2209,7 @@ int ff_celt_init(AVCodecContext *avctx, CeltContext **ps, int output_channels)
goto fail;
}
- s->dsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->dsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->dsp) {
ret = AVERROR(ENOMEM);
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavcodec/opusdec.c b/chromium/third_party/ffmpeg/libavcodec/opusdec.c
index 2ee3f2ad36f..f07f502d186 100644
--- a/chromium/third_party/ffmpeg/libavcodec/opusdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/opusdec.c
@@ -364,12 +364,17 @@ static int opus_decode_frame(OpusStreamContext *s, const uint8_t *data, int size
static int opus_decode_subpacket(OpusStreamContext *s,
const uint8_t *buf, int buf_size,
+ float **out, int out_size,
int nb_samples)
{
int output_samples = 0;
int flush_needed = 0;
int i, j, ret;
+ s->out[0] = out[0];
+ s->out[1] = out[1];
+ s->out_size = out_size;
+
/* check if we need to flush the resampler */
if (swr_is_initialized(s->swr)) {
if (buf) {
@@ -447,15 +452,17 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int coded_samples = 0;
- int decoded_samples = 0;
- int i, ret;
+ int decoded_samples = INT_MAX;
int delayed_samples = 0;
+ int i, ret;
+ /* calculate the number of delayed samples */
for (i = 0; i < c->nb_streams; i++) {
OpusStreamContext *s = &c->streams[i];
s->out[0] =
s->out[1] = NULL;
- delayed_samples = FFMAX(delayed_samples, s->delayed_samples);
+ delayed_samples = FFMAX(delayed_samples,
+ s->delayed_samples + av_audio_fifo_size(c->sync_buffers[i]));
}
/* decode the header of the first sub-packet to find out the sample count */
@@ -484,14 +491,43 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
return ret;
frame->nb_samples = 0;
+ memset(c->out, 0, c->nb_streams * 2 * sizeof(*c->out));
for (i = 0; i < avctx->channels; i++) {
ChannelMap *map = &c->channel_maps[i];
if (!map->copy)
- c->streams[map->stream_idx].out[map->channel_idx] = (float*)frame->extended_data[i];
+ c->out[2 * map->stream_idx + map->channel_idx] = (float*)frame->extended_data[i];
}
- for (i = 0; i < c->nb_streams; i++)
- c->streams[i].out_size = frame->linesize[0];
+ /* read the data from the sync buffers */
+ for (i = 0; i < c->nb_streams; i++) {
+ float **out = c->out + 2 * i;
+ int sync_size = av_audio_fifo_size(c->sync_buffers[i]);
+
+ float sync_dummy[32];
+ int out_dummy = (!out[0]) | ((!out[1]) << 1);
+
+ if (!out[0])
+ out[0] = sync_dummy;
+ if (!out[1])
+ out[1] = sync_dummy;
+ if (out_dummy && sync_size > FF_ARRAY_ELEMS(sync_dummy))
+ return AVERROR_BUG;
+
+ ret = av_audio_fifo_read(c->sync_buffers[i], (void**)out, sync_size);
+ if (ret < 0)
+ return ret;
+
+ if (out_dummy & 1)
+ out[0] = NULL;
+ else
+ out[0] += ret;
+ if (out_dummy & 2)
+ out[1] = NULL;
+ else
+ out[1] += ret;
+
+ c->out_size[i] = frame->linesize[0] - ret * sizeof(float);
+ }
/* decode each sub-packet */
for (i = 0; i < c->nb_streams; i++) {
@@ -512,20 +548,31 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
s->silk_samplerate = get_silk_samplerate(s->packet.config);
}
- ret = opus_decode_subpacket(&c->streams[i], buf,
- s->packet.data_size, coded_samples);
+ ret = opus_decode_subpacket(&c->streams[i], buf, s->packet.data_size,
+ c->out + 2 * i, c->out_size[i], coded_samples);
if (ret < 0)
return ret;
- if (decoded_samples && ret != decoded_samples) {
- av_log(avctx, AV_LOG_ERROR, "Different numbers of decoded samples "
- "in a multi-channel stream\n");
- return AVERROR_INVALIDDATA;
- }
- decoded_samples = ret;
+ c->decoded_samples[i] = ret;
+ decoded_samples = FFMIN(decoded_samples, ret);
+
buf += s->packet.packet_size;
buf_size -= s->packet.packet_size;
}
+ /* buffer the extra samples */
+ for (i = 0; i < c->nb_streams; i++) {
+ int buffer_samples = c->decoded_samples[i] - decoded_samples;
+ if (buffer_samples) {
+ float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0],
+ c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] };
+ buf[0] += buffer_samples;
+ buf[1] += buffer_samples;
+ ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples);
+ if (ret < 0)
+ return ret;
+ }
+ }
+
for (i = 0; i < avctx->channels; i++) {
ChannelMap *map = &c->channel_maps[i];
@@ -566,6 +613,8 @@ static av_cold void opus_decode_flush(AVCodecContext *ctx)
av_audio_fifo_drain(s->celt_delay, av_audio_fifo_size(s->celt_delay));
swr_close(s->swr);
+ av_audio_fifo_drain(c->sync_buffers[i], av_audio_fifo_size(c->sync_buffers[i]));
+
ff_silk_flush(s->silk);
ff_celt_flush(s->celt);
}
@@ -590,6 +639,16 @@ static av_cold int opus_decode_close(AVCodecContext *avctx)
}
av_freep(&c->streams);
+
+ if (c->sync_buffers) {
+ for (i = 0; i < c->nb_streams; i++)
+ av_audio_fifo_free(c->sync_buffers[i]);
+ }
+ av_freep(&c->sync_buffers);
+ av_freep(&c->decoded_samples);
+ av_freep(&c->out);
+ av_freep(&c->out_size);
+
c->nb_streams = 0;
av_freep(&c->channel_maps);
@@ -617,7 +676,11 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
/* allocate and init each independent decoder */
c->streams = av_mallocz_array(c->nb_streams, sizeof(*c->streams));
- if (!c->streams) {
+ c->out = av_mallocz_array(c->nb_streams, 2 * sizeof(*c->out));
+ c->out_size = av_mallocz_array(c->nb_streams, sizeof(*c->out_size));
+ c->sync_buffers = av_mallocz_array(c->nb_streams, sizeof(*c->sync_buffers));
+ c->decoded_samples = av_mallocz_array(c->nb_streams, sizeof(*c->decoded_samples));
+ if (!c->streams || !c->sync_buffers || !c->decoded_samples || !c->out || !c->out_size) {
c->nb_streams = 0;
ret = AVERROR(ENOMEM);
goto fail;
@@ -665,6 +728,13 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
ret = AVERROR(ENOMEM);
goto fail;
}
+
+ c->sync_buffers[i] = av_audio_fifo_alloc(avctx->sample_fmt,
+ s->output_channels, 32);
+ if (!c->sync_buffers[i]) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
}
return 0;
@@ -683,5 +753,5 @@ AVCodec ff_opus_decoder = {
.close = opus_decode_close,
.decode = opus_decode_packet,
.flush = opus_decode_flush,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pafaudio.c b/chromium/third_party/ffmpeg/libavcodec/pafaudio.c
index aaaef5e9c84..12f473ae0ac 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pafaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pafaudio.c
@@ -78,5 +78,5 @@ AVCodec ff_paf_audio_decoder = {
.id = AV_CODEC_ID_PAF_AUDIO,
.init = paf_audio_init,
.decode = paf_audio_decode,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pafvideo.c b/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
index a27afed56d0..cab3129f8f3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
@@ -393,5 +393,5 @@ AVCodec ff_paf_video_decoder = {
.init = paf_video_init,
.close = paf_video_close,
.decode = paf_video_decode,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pamenc.c b/chromium/third_party/ffmpeg/libavcodec/pamenc.c
index 7a51fe62b3c..50c9fcb4046 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pamenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pamenc.c
@@ -91,7 +91,7 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return -1;
}
- if ((ret = ff_alloc_packet2(avctx, pkt, n*h + 200)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, n*h + 200, 0)) < 0)
return ret;
bytestream_start =
@@ -129,29 +129,22 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int pam_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}
-static av_cold int pam_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_pam_encoder = {
.name = "pam",
.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PAM,
.init = pam_encode_init,
- .close = pam_encode_close,
.encode2 = pam_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
diff --git a/chromium/third_party/ffmpeg/libavcodec/parser.c b/chromium/third_party/ffmpeg/libavcodec/parser.c
index 1ef207f524f..f5bfa249d97 100644
--- a/chromium/third_party/ffmpeg/libavcodec/parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/parser.c
@@ -134,7 +134,7 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
int64_t pts, int64_t dts, int64_t pos)
{
int index, i;
- uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t dummy_buf[AV_INPUT_BUFFER_PADDING_SIZE];
if (!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
s->next_frame_offset =
@@ -188,8 +188,8 @@ int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
const uint8_t *buf, int buf_size, int keyframe)
{
if (s && s->parser->split) {
- if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER ||
- avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) {
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER ||
+ avctx->flags2 & AV_CODEC_FLAG2_LOCAL_HEADER) {
int i = s->parser->split(avctx, buf, buf_size);
buf += i;
buf_size -= i;
@@ -200,17 +200,17 @@ int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
*poutbuf = (uint8_t *) buf;
*poutbuf_size = buf_size;
if (avctx->extradata) {
- if (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) {
+ if (keyframe && (avctx->flags2 & AV_CODEC_FLAG2_LOCAL_HEADER)) {
int size = buf_size + avctx->extradata_size;
*poutbuf_size = size;
- *poutbuf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ *poutbuf = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
memcpy(*poutbuf + avctx->extradata_size, buf,
- buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
return 1;
}
}
@@ -252,10 +252,10 @@ int ff_combine_frame(ParseContext *pc, int next,
if (next == END_NOT_FOUND) {
void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
*buf_size + pc->index +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!new_buffer) {
- av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", *buf_size + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
+ av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", *buf_size + pc->index + AV_INPUT_BUFFER_PADDING_SIZE);
pc->index = 0;
return AVERROR(ENOMEM);
}
@@ -272,17 +272,17 @@ int ff_combine_frame(ParseContext *pc, int next,
if (pc->index) {
void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
next + pc->index +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!new_buffer) {
- av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
+ av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", next + pc->index + AV_INPUT_BUFFER_PADDING_SIZE);
pc->overread_index =
pc->index = 0;
return AVERROR(ENOMEM);
}
pc->buffer = new_buffer;
- if (next > -FF_INPUT_BUFFER_PADDING_SIZE)
+ if (next > -AV_INPUT_BUFFER_PADDING_SIZE)
memcpy(&pc->buffer[pc->index], *buf,
- next + FF_INPUT_BUFFER_PADDING_SIZE);
+ next + AV_INPUT_BUFFER_PADDING_SIZE);
pc->index = 0;
*buf = pc->buffer;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcm-bluray.c b/chromium/third_party/ffmpeg/libavcodec/pcm-bluray.c
index 5819e5371c3..e7f9ee44a19 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcm-bluray.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcm-bluray.c
@@ -307,7 +307,7 @@ AVCodec ff_pcm_bluray_decoder = {
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_PCM_BLURAY,
.decode = pcm_bluray_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
},
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c b/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
index e729cb64ede..985a19bdb19 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcm-dvd.c
@@ -311,7 +311,7 @@ AVCodec ff_pcm_dvd_decoder = {
.init = pcm_dvd_decode_init,
.decode = pcm_dvd_decode_frame,
.close = pcm_dvd_decode_uninit,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcm.c b/chromium/third_party/ffmpeg/libavcodec/pcm.c
index 0a4ad0b9d93..2cb5a360d61 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcm.c
@@ -97,7 +97,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
n = frame->nb_samples * avctx->channels;
samples = (const short *)frame->data[0];
- if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size, n * sample_size)) < 0)
return ret;
dst = avpkt->data;
@@ -501,7 +501,7 @@ AVCodec ff_ ## name_ ## _encoder = { \
.id = AV_CODEC_ID_ ## id_, \
.init = pcm_encode_init, \
.encode2 = pcm_encode_frame, \
- .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE, \
+ .capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \
.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
AV_SAMPLE_FMT_NONE }, \
}
@@ -523,7 +523,7 @@ AVCodec ff_ ## name_ ## _decoder = { \
.priv_data_size = sizeof(PCMDecode), \
.init = pcm_decode_init, \
.decode = pcm_decode_frame, \
- .capabilities = CODEC_CAP_DR1, \
+ .capabilities = AV_CODEC_CAP_DR1, \
.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
AV_SAMPLE_FMT_NONE }, \
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcx.c b/chromium/third_party/ffmpeg/libavcodec/pcx.c
index 6487aa573b1..1d3ee8d96a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcx.c
@@ -143,7 +143,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ptr = p->data[0];
stride = p->linesize[0];
- scanline = av_malloc(bytes_per_scanline + FF_INPUT_BUFFER_PADDING_SIZE);
+ scanline = av_malloc(bytes_per_scanline + AV_INPUT_BUFFER_PADDING_SIZE);
if (!scanline)
return AVERROR(ENOMEM);
@@ -239,5 +239,5 @@ AVCodec ff_pcx_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PCX,
.decode = pcx_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pcxenc.c b/chromium/third_party/ffmpeg/libavcodec/pcxenc.c
index a718428d7a2..f0ffedfa56e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pcxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pcxenc.c
@@ -35,22 +35,16 @@ static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
static av_cold int pcx_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}
-static av_cold int pcx_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
/**
* PCX run-length encoder
* @param dst output buffer
@@ -151,7 +145,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
line_bytes = (line_bytes + 1) & ~1;
max_pkt_size = 128 + avctx->height * 2 * line_bytes * nplanes + (pal ? 256*3 + 1 : 0);
- if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size, 0)) < 0)
return ret;
buf = pkt->data;
buf_end = pkt->data + pkt->size;
@@ -216,7 +210,6 @@ AVCodec ff_pcx_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PCX,
.init = pcx_encode_init,
- .close = pcx_encode_close,
.encode2 = pcx_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_RGB24,
diff --git a/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c b/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
index 0d307f53022..50fc5b6e647 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pgssubdec.c
@@ -675,7 +675,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
#define OFFSET(x) offsetof(PGSSubContext, x)
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- {"forced_subs_only", "Only show forced subtitles", OFFSET(forced_subs_only), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, SD},
+ {"forced_subs_only", "Only show forced subtitles", OFFSET(forced_subs_only), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, SD},
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pictordec.c b/chromium/third_party/ffmpeg/libavcodec/pictordec.c
index 1bc51bcf24f..ff6eb7f4fc9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pictordec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pictordec.c
@@ -263,5 +263,5 @@ AVCodec ff_pictor_decoder = {
.id = AV_CODEC_ID_PICTOR,
.priv_data_size = sizeof(PicContext),
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.c b/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.c
index ebde68b6a48..322e1dd1110 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.c
@@ -79,4 +79,6 @@ av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
ff_pixblockdsp_init_ppc(c, avctx, high_bit_depth);
if (ARCH_X86)
ff_pixblockdsp_init_x86(c, avctx, high_bit_depth);
+ if (ARCH_MIPS)
+ ff_pixblockdsp_init_mips(c, avctx, high_bit_depth);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.h b/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.h
index d4b85903412..79ed86c3a6c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/pixblockdsp.h
@@ -42,5 +42,7 @@ void ff_pixblockdsp_init_ppc(PixblockDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_pixblockdsp_init_x86(PixblockDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
+void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
#endif /* AVCODEC_PIXBLOCKDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngdec.c b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
index ceda383209a..ee11f1249a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
@@ -21,6 +21,7 @@
//#define DEBUG
+#include "libavutil/avassert.h"
#include "libavutil/bprint.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
@@ -59,6 +60,7 @@ typedef struct PNGDecContext {
int bits_per_pixel;
int bpp;
int has_trns;
+ uint8_t transparent_color_be[6];
uint8_t *image_buf;
int image_linesize;
@@ -542,18 +544,18 @@ static int decode_ihdr_chunk(AVCodecContext *avctx, PNGDecContext *s,
return AVERROR_INVALIDDATA;
}
- s->width = bytestream2_get_be32(&s->gb);
- s->height = bytestream2_get_be32(&s->gb);
+ if (s->state & PNG_IHDR) {
+ av_log(avctx, AV_LOG_ERROR, "Multiple IHDR\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ s->width = s->cur_w = bytestream2_get_be32(&s->gb);
+ s->height = s->cur_h = bytestream2_get_be32(&s->gb);
if (av_image_check_size(s->width, s->height, 0, avctx)) {
- s->width = s->height = 0;
+ s->cur_w = s->cur_h = s->width = s->height = 0;
av_log(avctx, AV_LOG_ERROR, "Invalid image size\n");
return AVERROR_INVALIDDATA;
}
- if (s->cur_w == 0 && s->cur_h == 0) {
- // Only set cur_w/h if update_thread_context() has not set it
- s->cur_w = s->width;
- s->cur_h = s->height;
- }
s->bit_depth = bytestream2_get_byte(&s->gb);
s->color_type = bytestream2_get_byte(&s->gb);
s->compression_type = bytestream2_get_byte(&s->gb);
@@ -590,6 +592,7 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
uint32_t length, AVFrame *p)
{
int ret;
+ size_t byte_depth = s->bit_depth > 8 ? 2 : 1;
if (!(s->state & PNG_IHDR)) {
av_log(avctx, AV_LOG_ERROR, "IDAT without IHDR\n");
@@ -641,8 +644,38 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
return AVERROR_INVALIDDATA;
}
+ if (s->has_trns && s->color_type != PNG_COLOR_TYPE_PALETTE) {
+ switch (avctx->pix_fmt) {
+ case AV_PIX_FMT_RGB24:
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
+ break;
+
+ case AV_PIX_FMT_RGB48BE:
+ avctx->pix_fmt = AV_PIX_FMT_RGBA64BE;
+ break;
+
+ case AV_PIX_FMT_GRAY8:
+ avctx->pix_fmt = AV_PIX_FMT_YA8;
+ break;
+
+ case AV_PIX_FMT_GRAY16BE:
+ avctx->pix_fmt = AV_PIX_FMT_YA16BE;
+ break;
+
+ default:
+ av_assert0(0);
+ }
+
+ s->bpp += byte_depth;
+ }
+
if ((ret = ff_thread_get_buffer(avctx, &s->picture, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
+ if (avctx->codec_id == AV_CODEC_ID_APNG && s->last_dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
+ ff_thread_release_buffer(avctx, &s->previous_picture);
+ if ((ret = ff_thread_get_buffer(avctx, &s->previous_picture, AV_GET_BUFFER_FLAG_REF)) < 0)
+ return ret;
+ }
ff_thread_finish_setup(avctx);
p->pict_type = AV_PICTURE_TYPE_I;
@@ -686,9 +719,21 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
s->zstream.avail_out = s->crow_size;
s->zstream.next_out = s->crow_buf;
}
+
s->state |= PNG_IDAT;
- if ((ret = png_decode_idat(s, length)) < 0)
+
+ /* set image to non-transparent bpp while decompressing */
+ if (s->has_trns && s->color_type != PNG_COLOR_TYPE_PALETTE)
+ s->bpp -= byte_depth;
+
+ ret = png_decode_idat(s, length);
+
+ if (s->has_trns && s->color_type != PNG_COLOR_TYPE_PALETTE)
+ s->bpp += byte_depth;
+
+ if (ret < 0)
return ret;
+
bytestream2_skip(&s->gb, 4); /* crc */
return 0;
@@ -722,17 +767,33 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s,
{
int v, i;
- /* read the transparency. XXX: Only palette mode supported */
- if (s->color_type != PNG_COLOR_TYPE_PALETTE ||
- length > 256 ||
- !(s->state & PNG_PLTE))
+ if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
+ if (length > 256 || !(s->state & PNG_PLTE))
+ return AVERROR_INVALIDDATA;
+
+ for (i = 0; i < length; i++) {
+ v = bytestream2_get_byte(&s->gb);
+ s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
+ }
+ } else if (s->color_type == PNG_COLOR_TYPE_GRAY || s->color_type == PNG_COLOR_TYPE_RGB) {
+ if ((s->color_type == PNG_COLOR_TYPE_GRAY && length != 2) ||
+ (s->color_type == PNG_COLOR_TYPE_RGB && length != 6))
+ return AVERROR_INVALIDDATA;
+
+ for (i = 0; i < length / 2; i++) {
+ /* only use the least significant bits */
+ v = bytestream2_get_be16(&s->gb) & ((1 << s->bit_depth) - 1);
+
+ if (s->bit_depth > 8)
+ AV_WB16(&s->transparent_color_be[2 * i], v);
+ else
+ s->transparent_color_be[i] = v;
+ }
+ } else {
return AVERROR_INVALIDDATA;
- for (i = 0; i < length; i++) {
- v = bytestream2_get_byte(&s->gb);
- s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
}
- bytestream2_skip(&s->gb, 4); /* crc */
+ bytestream2_skip(&s->gb, 4); /* crc */
s->has_trns = 1;
return 0;
@@ -815,10 +876,16 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
uint32_t length)
{
uint32_t sequence_number;
+ int cur_w, cur_h, x_offset, y_offset, dispose_op, blend_op;
if (length != 26)
return AVERROR_INVALIDDATA;
+ if (!(s->state & PNG_IHDR)) {
+ av_log(avctx, AV_LOG_ERROR, "fctl before IHDR\n");
+ return AVERROR_INVALIDDATA;
+ }
+
s->last_w = s->cur_w;
s->last_h = s->cur_h;
s->last_x_offset = s->x_offset;
@@ -826,32 +893,32 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
s->last_dispose_op = s->dispose_op;
sequence_number = bytestream2_get_be32(&s->gb);
- s->cur_w = bytestream2_get_be32(&s->gb);
- s->cur_h = bytestream2_get_be32(&s->gb);
- s->x_offset = bytestream2_get_be32(&s->gb);
- s->y_offset = bytestream2_get_be32(&s->gb);
+ cur_w = bytestream2_get_be32(&s->gb);
+ cur_h = bytestream2_get_be32(&s->gb);
+ x_offset = bytestream2_get_be32(&s->gb);
+ y_offset = bytestream2_get_be32(&s->gb);
bytestream2_skip(&s->gb, 4); /* delay_num (2), delay_den (2) */
- s->dispose_op = bytestream2_get_byte(&s->gb);
- s->blend_op = bytestream2_get_byte(&s->gb);
+ dispose_op = bytestream2_get_byte(&s->gb);
+ blend_op = bytestream2_get_byte(&s->gb);
bytestream2_skip(&s->gb, 4); /* crc */
if (sequence_number == 0 &&
- (s->cur_w != s->width ||
- s->cur_h != s->height ||
- s->x_offset != 0 ||
- s->y_offset != 0) ||
- s->cur_w <= 0 || s->cur_h <= 0 ||
- s->x_offset < 0 || s->y_offset < 0 ||
- s->cur_w > s->width - s->x_offset|| s->cur_h > s->height - s->y_offset)
+ (cur_w != s->width ||
+ cur_h != s->height ||
+ x_offset != 0 ||
+ y_offset != 0) ||
+ cur_w <= 0 || cur_h <= 0 ||
+ x_offset < 0 || y_offset < 0 ||
+ cur_w > s->width - x_offset|| cur_h > s->height - y_offset)
return AVERROR_INVALIDDATA;
- if (sequence_number == 0 && s->dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
+ if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
// No previous frame to revert to for the first frame
// Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND
- s->dispose_op = APNG_DISPOSE_OP_BACKGROUND;
+ dispose_op = APNG_DISPOSE_OP_BACKGROUND;
}
- if (s->dispose_op == APNG_BLEND_OP_OVER && !s->has_trns && (
+ if (blend_op == APNG_BLEND_OP_OVER && !s->has_trns && (
avctx->pix_fmt == AV_PIX_FMT_RGB24 ||
avctx->pix_fmt == AV_PIX_FMT_RGB48BE ||
avctx->pix_fmt == AV_PIX_FMT_PAL8 ||
@@ -859,10 +926,17 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
avctx->pix_fmt == AV_PIX_FMT_GRAY16BE ||
avctx->pix_fmt == AV_PIX_FMT_MONOBLACK
)) {
- // APNG_DISPOSE_OP_OVER is the same as APNG_DISPOSE_OP_SOURCE when there is no alpha channel
- s->dispose_op = APNG_BLEND_OP_SOURCE;
+ // APNG_BLEND_OP_OVER is the same as APNG_BLEND_OP_SOURCE when there is no alpha channel
+ blend_op = APNG_BLEND_OP_SOURCE;
}
+ s->cur_w = cur_w;
+ s->cur_h = cur_h;
+ s->x_offset = x_offset;
+ s->y_offset = y_offset;
+ s->dispose_op = dispose_op;
+ s->blend_op = blend_op;
+
return 0;
}
@@ -904,20 +978,20 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
return AVERROR_PATCHWELCOME;
}
- // Copy the previous frame to the buffer
- ff_thread_await_progress(&s->last_picture, INT_MAX, 0);
- memcpy(buffer, s->last_picture.f->data[0], s->image_linesize * s->height);
-
// Do the disposal operation specified by the last frame on the frame
- if (s->last_dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
- for (y = s->last_y_offset; y < s->last_y_offset + s->last_h; ++y)
- memset(buffer + s->image_linesize * y + s->bpp * s->last_x_offset, 0, s->bpp * s->last_w);
- } else if (s->last_dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
+ if (s->last_dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
+ ff_thread_await_progress(&s->last_picture, INT_MAX, 0);
+ memcpy(buffer, s->last_picture.f->data[0], s->image_linesize * s->height);
+
+ if (s->last_dispose_op == APNG_DISPOSE_OP_BACKGROUND)
+ for (y = s->last_y_offset; y < s->last_y_offset + s->last_h; ++y)
+ memset(buffer + s->image_linesize * y + s->bpp * s->last_x_offset, 0, s->bpp * s->last_w);
+
+ memcpy(s->previous_picture.f->data[0], buffer, s->image_linesize * s->height);
+ ff_thread_report_progress(&s->previous_picture, INT_MAX, 0);
+ } else {
ff_thread_await_progress(&s->previous_picture, INT_MAX, 0);
- for (y = s->last_y_offset; y < s->last_y_offset + s->last_h; ++y) {
- size_t row_start = s->image_linesize * y + s->bpp * s->last_x_offset;
- memcpy(buffer + row_start, s->previous_picture.f->data[0] + row_start, s->bpp * s->last_w);
- }
+ memcpy(buffer, s->previous_picture.f->data[0], s->image_linesize * s->height);
}
// Perform blending
@@ -1104,6 +1178,29 @@ exit_loop:
if (s->bits_per_pixel <= 4)
handle_small_bpp(s, p);
+ /* apply transparency if needed */
+ if (s->has_trns && s->color_type != PNG_COLOR_TYPE_PALETTE) {
+ size_t byte_depth = s->bit_depth > 8 ? 2 : 1;
+ size_t raw_bpp = s->bpp - byte_depth;
+ unsigned x, y;
+
+ for (y = 0; y < s->height; ++y) {
+ uint8_t *row = &s->image_buf[s->image_linesize * y];
+
+ /* since we're updating in-place, we have to go from right to left */
+ for (x = s->width; x > 0; --x) {
+ uint8_t *pixel = &row[s->bpp * (x - 1)];
+ memmove(pixel, &row[raw_bpp * (x - 1)], raw_bpp);
+
+ if (!memcmp(pixel, s->transparent_color_be, raw_bpp)) {
+ memset(&pixel[raw_bpp], 0, byte_depth);
+ } else {
+ memset(&pixel[raw_bpp], 0xff, byte_depth);
+ }
+ }
+ }
+ }
+
/* handle p-frames only if a predecessor frame is available */
if (s->last_picture.f->data[0]) {
if ( !(avpkt->flags & AV_PKT_FLAG_KEY) && avctx->codec_tag != AV_RL32("MPNG")
@@ -1153,7 +1250,7 @@ static int decode_frame_png(AVCodecContext *avctx,
sig = bytestream2_get_be64(&s->gb);
if (sig != PNGSIG &&
sig != MNGSIG) {
- av_log(avctx, AV_LOG_ERROR, "Invalid PNG signature (%d).\n", buf_size);
+ av_log(avctx, AV_LOG_ERROR, "Invalid PNG signature 0x%08"PRIX64".\n", sig);
return AVERROR_INVALIDDATA;
}
@@ -1193,13 +1290,9 @@ static int decode_frame_apng(AVCodecContext *avctx,
PNGDecContext *const s = avctx->priv_data;
int ret;
AVFrame *p;
- ThreadFrame tmp;
- ff_thread_release_buffer(avctx, &s->previous_picture);
- tmp = s->previous_picture;
- s->previous_picture = s->last_picture;
- s->last_picture = s->picture;
- s->picture = tmp;
+ ff_thread_release_buffer(avctx, &s->last_picture);
+ FFSWAP(ThreadFrame, s->picture, s->last_picture);
p = s->picture.f;
if (!(s->state & PNG_IHDR)) {
@@ -1259,15 +1352,35 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
(ret = ff_thread_ref_frame(&pdst->picture, &psrc->picture)) < 0)
return ret;
if (CONFIG_APNG_DECODER && dst->codec_id == AV_CODEC_ID_APNG) {
+ pdst->width = psrc->width;
+ pdst->height = psrc->height;
+ pdst->bit_depth = psrc->bit_depth;
+ pdst->color_type = psrc->color_type;
+ pdst->compression_type = psrc->compression_type;
+ pdst->interlace_type = psrc->interlace_type;
+ pdst->filter_type = psrc->filter_type;
pdst->cur_w = psrc->cur_w;
pdst->cur_h = psrc->cur_h;
pdst->x_offset = psrc->x_offset;
pdst->y_offset = psrc->y_offset;
+ pdst->has_trns = psrc->has_trns;
+ memcpy(pdst->transparent_color_be, psrc->transparent_color_be, sizeof(pdst->transparent_color_be));
+
pdst->dispose_op = psrc->dispose_op;
+ memcpy(pdst->palette, psrc->palette, sizeof(pdst->palette));
+
+ pdst->state |= psrc->state & (PNG_IHDR | PNG_PLTE);
+
ff_thread_release_buffer(dst, &pdst->last_picture);
- if (psrc->last_picture.f->data[0])
- return ff_thread_ref_frame(&pdst->last_picture, &psrc->last_picture);
+ if (psrc->last_picture.f->data[0] &&
+ (ret = ff_thread_ref_frame(&pdst->last_picture, &psrc->last_picture)) < 0)
+ return ret;
+
+ ff_thread_release_buffer(dst, &pdst->previous_picture);
+ if (psrc->previous_picture.f->data[0] &&
+ (ret = ff_thread_ref_frame(&pdst->previous_picture, &psrc->previous_picture)) < 0)
+ return ret;
}
return 0;
@@ -1330,7 +1443,7 @@ AVCodec ff_apng_decoder = {
.decode = decode_frame_apng,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(png_dec_init),
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
};
#endif
@@ -1346,6 +1459,6 @@ AVCodec ff_png_decoder = {
.decode = decode_frame_png,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(png_dec_init),
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngdsp.h b/chromium/third_party/ffmpeg/libavcodec/pngdsp.h
index fbc1a508e7d..5475d0d9433 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/pngdsp.h
@@ -37,4 +37,4 @@ typedef struct PNGDSPContext {
void ff_pngdsp_init(PNGDSPContext *dsp);
void ff_pngdsp_init_x86(PNGDSPContext *dsp);
-#endif /* AVCDODEC_PNGDSP_H */
+#endif /* AVCODEC_PNGDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngenc.c b/chromium/third_party/ffmpeg/libavcodec/pngenc.c
index 7a9d0b0f793..f6ad830cd9c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngenc.c
@@ -36,6 +36,14 @@
#define IOBUF_SIZE 4096
+typedef struct APNGFctlChunk {
+ uint32_t sequence_number;
+ uint32_t width, height;
+ uint32_t x_offset, y_offset;
+ uint16_t delay_num, delay_den;
+ uint8_t dispose_op, blend_op;
+} APNGFctlChunk;
+
typedef struct PNGEncContext {
AVClass *class;
HuffYUVEncDSPContext hdsp;
@@ -59,6 +67,12 @@ typedef struct PNGEncContext {
// APNG
uint32_t palette_checksum; // Used to ensure a single unique palette
uint32_t sequence_number;
+
+ AVFrame *prev_frame;
+ AVFrame *last_frame;
+ APNGFctlChunk last_frame_fctl;
+ uint8_t *last_frame_packet;
+ size_t last_frame_packet_size;
} PNGEncContext;
static void png_get_interlaced_row(uint8_t *dst, int row_size,
@@ -403,7 +417,7 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
uint8_t *progressive_buf = NULL;
uint8_t *top_buf = NULL;
- row_size = (avctx->width * s->bits_per_pixel + 7) >> 3;
+ row_size = (pict->width * s->bits_per_pixel + 7) >> 3;
crow_base = av_malloc((row_size + 32) << (s->filter_type == PNG_FILTER_VALUE_MIXED));
if (!crow_base) {
@@ -430,16 +444,16 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
for (pass = 0; pass < NB_PASSES; pass++) {
/* NOTE: a pass is completely omitted if no pixels would be
* output */
- pass_row_size = ff_png_pass_row_size(pass, s->bits_per_pixel, avctx->width);
+ pass_row_size = ff_png_pass_row_size(pass, s->bits_per_pixel, pict->width);
if (pass_row_size > 0) {
top = NULL;
- for (y = 0; y < avctx->height; y++)
+ for (y = 0; y < pict->height; y++)
if ((ff_png_pass_ymask[pass] << (y & 7)) & 0x80) {
ptr = p->data[0] + y * p->linesize[0];
FFSWAP(uint8_t *, progressive_buf, top_buf);
png_get_interlaced_row(progressive_buf, pass_row_size,
s->bits_per_pixel, pass,
- ptr, avctx->width);
+ ptr, pict->width);
crow = png_choose_filter(s, crow_buf, progressive_buf,
top, pass_row_size, s->bits_per_pixel >> 3);
png_write_row(avctx, crow, pass_row_size + 1);
@@ -449,7 +463,7 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
}
} else {
top = NULL;
- for (y = 0; y < avctx->height; y++) {
+ for (y = 0; y < pict->height; y++) {
ptr = p->data[0] + y * p->linesize[0];
crow = png_choose_filter(s, crow_buf, ptr, top,
row_size, s->bits_per_pixel >> 3);
@@ -495,14 +509,14 @@ static int encode_png(AVCodecContext *avctx, AVPacket *pkt,
enc_row_size = deflateBound(&s->zstream, (avctx->width * s->bits_per_pixel + 7) >> 3);
max_packet_size =
- FF_MIN_BUFFER_SIZE + // headers
+ AV_INPUT_BUFFER_MIN_SIZE + // headers
avctx->height * (
enc_row_size +
12 * (((int64_t)enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) // IDAT * ceil(enc_row_size / IOBUF_SIZE)
);
if (max_packet_size > INT_MAX)
return AVERROR(ENOMEM);
- ret = ff_alloc_packet2(avctx, pkt, max_packet_size);
+ ret = ff_alloc_packet2(avctx, pkt, max_packet_size, 0);
if (ret < 0)
return ret;
@@ -530,6 +544,272 @@ static int encode_png(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
+static int apng_do_inverse_blend(AVFrame *output, const AVFrame *input,
+ APNGFctlChunk *fctl_chunk, uint8_t bpp)
+{
+ // output: background, input: foreground
+ // output the image such that when blended with the background, will produce the foreground
+
+ unsigned int x, y;
+ unsigned int leftmost_x = input->width;
+ unsigned int rightmost_x = 0;
+ unsigned int topmost_y = input->height;
+ unsigned int bottommost_y = 0;
+ const uint8_t *input_data = input->data[0];
+ uint8_t *output_data = output->data[0];
+ ptrdiff_t input_linesize = input->linesize[0];
+ ptrdiff_t output_linesize = output->linesize[0];
+
+ // Find bounding box of changes
+ for (y = 0; y < input->height; ++y) {
+ for (x = 0; x < input->width; ++x) {
+ if (!memcmp(input_data + bpp * x, output_data + bpp * x, bpp))
+ continue;
+
+ if (x < leftmost_x)
+ leftmost_x = x;
+ if (x >= rightmost_x)
+ rightmost_x = x + 1;
+ if (y < topmost_y)
+ topmost_y = y;
+ if (y >= bottommost_y)
+ bottommost_y = y + 1;
+ }
+
+ input_data += input_linesize;
+ output_data += output_linesize;
+ }
+
+ if (leftmost_x == input->width && rightmost_x == 0) {
+ // Empty frame
+ // APNG does not support empty frames, so we make it a 1x1 frame
+ leftmost_x = topmost_y = 0;
+ rightmost_x = bottommost_y = 1;
+ }
+
+ // Do actual inverse blending
+ if (fctl_chunk->blend_op == APNG_BLEND_OP_SOURCE) {
+ output_data = output->data[0];
+ for (y = topmost_y; y < bottommost_y; ++y) {
+ memcpy(output_data,
+ input->data[0] + input_linesize * y + bpp * leftmost_x,
+ bpp * (rightmost_x - leftmost_x));
+ output_data += output_linesize;
+ }
+ } else { // APNG_BLEND_OP_OVER
+ size_t transparent_palette_index;
+ uint32_t *palette;
+
+ switch (input->format) {
+ case AV_PIX_FMT_RGBA64BE:
+ case AV_PIX_FMT_YA16BE:
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_GRAY8A:
+ break;
+
+ case AV_PIX_FMT_PAL8:
+ palette = (uint32_t*)input->data[1];
+ for (transparent_palette_index = 0; transparent_palette_index < 256; ++transparent_palette_index)
+ if (palette[transparent_palette_index] >> 24 == 0)
+ break;
+ break;
+
+ default:
+ // No alpha, so blending not possible
+ return -1;
+ }
+
+ for (y = topmost_y; y < bottommost_y; ++y) {
+ uint8_t *foreground = input->data[0] + input_linesize * y + bpp * leftmost_x;
+ uint8_t *background = output->data[0] + output_linesize * y + bpp * leftmost_x;
+ output_data = output->data[0] + output_linesize * (y - topmost_y);
+ for (x = leftmost_x; x < rightmost_x; ++x, foreground += bpp, background += bpp, output_data += bpp) {
+ if (!memcmp(foreground, background, bpp)) {
+ if (input->format == AV_PIX_FMT_PAL8) {
+ if (transparent_palette_index == 256) {
+ // Need fully transparent colour, but none exists
+ return -1;
+ }
+
+ *output_data = transparent_palette_index;
+ } else {
+ memset(output_data, 0, bpp);
+ }
+ continue;
+ }
+
+ // Check for special alpha values, since full inverse
+ // alpha-on-alpha blending is rarely possible, and when
+ // possible, doesn't compress much better than
+ // APNG_BLEND_OP_SOURCE blending
+ switch (input->format) {
+ case AV_PIX_FMT_RGBA64BE:
+ if (((uint16_t*)foreground)[3] == 0xffff ||
+ ((uint16_t*)background)[3] == 0)
+ break;
+ return -1;
+
+ case AV_PIX_FMT_YA16BE:
+ if (((uint16_t*)foreground)[1] == 0xffff ||
+ ((uint16_t*)background)[1] == 0)
+ break;
+ return -1;
+
+ case AV_PIX_FMT_RGBA:
+ if (foreground[3] == 0xff || background[3] == 0)
+ break;
+ return -1;
+
+ case AV_PIX_FMT_GRAY8A:
+ if (foreground[1] == 0xff || background[1] == 0)
+ break;
+ return -1;
+
+ case AV_PIX_FMT_PAL8:
+ if (palette[*foreground] >> 24 == 0xff ||
+ palette[*background] >> 24 == 0)
+ break;
+ return -1;
+ }
+
+ memmove(output_data, foreground, bpp);
+ }
+ }
+ }
+
+ output->width = rightmost_x - leftmost_x;
+ output->height = bottommost_y - topmost_y;
+ fctl_chunk->width = output->width;
+ fctl_chunk->height = output->height;
+ fctl_chunk->x_offset = leftmost_x;
+ fctl_chunk->y_offset = topmost_y;
+
+ return 0;
+}
+
+static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
+ APNGFctlChunk *best_fctl_chunk, APNGFctlChunk *best_last_fctl_chunk)
+{
+ PNGEncContext *s = avctx->priv_data;
+ int ret;
+ unsigned int y;
+ AVFrame* diffFrame;
+ uint8_t bpp = (s->bits_per_pixel + 7) >> 3;
+ uint8_t *original_bytestream, *original_bytestream_end;
+ uint8_t *temp_bytestream = 0, *temp_bytestream_end;
+ uint32_t best_sequence_number;
+ uint8_t *best_bytestream;
+ size_t best_bytestream_size = SIZE_MAX;
+ APNGFctlChunk last_fctl_chunk = *best_last_fctl_chunk;
+ APNGFctlChunk fctl_chunk = *best_fctl_chunk;
+
+ if (avctx->frame_number == 0) {
+ best_fctl_chunk->width = pict->width;
+ best_fctl_chunk->height = pict->height;
+ best_fctl_chunk->x_offset = 0;
+ best_fctl_chunk->y_offset = 0;
+ best_fctl_chunk->blend_op = APNG_BLEND_OP_SOURCE;
+ return encode_frame(avctx, pict);
+ }
+
+ diffFrame = av_frame_alloc();
+ if (!diffFrame)
+ return AVERROR(ENOMEM);
+
+ diffFrame->format = pict->format;
+ diffFrame->width = pict->width;
+ diffFrame->height = pict->height;
+ if ((ret = av_frame_get_buffer(diffFrame, 32)) < 0)
+ goto fail;
+
+ original_bytestream = s->bytestream;
+ 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;
+ }
+
+ for (last_fctl_chunk.dispose_op = 0; last_fctl_chunk.dispose_op < 3; ++last_fctl_chunk.dispose_op) {
+ // 0: APNG_DISPOSE_OP_NONE
+ // 1: APNG_DISPOSE_OP_BACKGROUND
+ // 2: APNG_DISPOSE_OP_PREVIOUS
+
+ for (fctl_chunk.blend_op = 0; fctl_chunk.blend_op < 2; ++fctl_chunk.blend_op) {
+ // 0: APNG_BLEND_OP_SOURCE
+ // 1: APNG_BLEND_OP_OVER
+
+ uint32_t original_sequence_number = s->sequence_number, sequence_number;
+ uint8_t *bytestream_start = s->bytestream;
+ size_t bytestream_size;
+
+ // Do disposal
+ if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
+ memcpy(diffFrame->data[0], s->last_frame->data[0],
+ s->last_frame->linesize[0] * s->last_frame->height);
+
+ if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
+ for (y = last_fctl_chunk.y_offset; y < last_fctl_chunk.y_offset + last_fctl_chunk.height; ++y) {
+ size_t row_start = s->last_frame->linesize[0] * y + bpp * last_fctl_chunk.x_offset;
+ memset(diffFrame->data[0] + row_start, 0, bpp * last_fctl_chunk.width);
+ }
+ }
+ } else {
+ if (!s->prev_frame)
+ continue;
+
+ memcpy(diffFrame->data[0], s->prev_frame->data[0],
+ s->prev_frame->linesize[0] * s->prev_frame->height);
+ }
+
+ // Do inverse blending
+ if (apng_do_inverse_blend(diffFrame, pict, &fctl_chunk, bpp) < 0)
+ continue;
+
+ // Do encoding
+ ret = encode_frame(avctx, diffFrame);
+ sequence_number = s->sequence_number;
+ s->sequence_number = original_sequence_number;
+ bytestream_size = s->bytestream - bytestream_start;
+ s->bytestream = bytestream_start;
+ if (ret < 0)
+ goto fail;
+
+ if (bytestream_size < best_bytestream_size) {
+ *best_fctl_chunk = fctl_chunk;
+ *best_last_fctl_chunk = last_fctl_chunk;
+
+ best_sequence_number = sequence_number;
+ best_bytestream = s->bytestream;
+ best_bytestream_size = bytestream_size;
+
+ if (best_bytestream == original_bytestream) {
+ s->bytestream = temp_bytestream;
+ s->bytestream_end = temp_bytestream_end;
+ } else {
+ s->bytestream = original_bytestream;
+ s->bytestream_end = original_bytestream_end;
+ }
+ }
+ }
+ }
+
+ s->sequence_number = best_sequence_number;
+ s->bytestream = original_bytestream + best_bytestream_size;
+ s->bytestream_end = original_bytestream_end;
+ if (best_bytestream != original_bytestream)
+ memcpy(original_bytestream, best_bytestream, best_bytestream_size);
+
+ ret = 0;
+
+fail:
+ av_freep(&temp_bytestream);
+ av_frame_free(&diffFrame);
+ return ret;
+}
+
static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
@@ -537,9 +817,9 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
int ret;
int enc_row_size;
size_t max_packet_size;
- uint8_t buf[26];
+ APNGFctlChunk fctl_chunk;
- if (avctx->codec_id == AV_CODEC_ID_APNG && s->color_type == PNG_COLOR_TYPE_PALETTE) {
+ if (pict && avctx->codec_id == AV_CODEC_ID_APNG && s->color_type == PNG_COLOR_TYPE_PALETTE) {
uint32_t checksum = ~av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), ~0U, pict->data[1], 256 * sizeof(uint32_t));
if (avctx->frame_number == 0) {
@@ -553,54 +833,118 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
enc_row_size = deflateBound(&s->zstream, (avctx->width * s->bits_per_pixel + 7) >> 3);
max_packet_size =
- FF_MIN_BUFFER_SIZE + // headers
+ AV_INPUT_BUFFER_MIN_SIZE + // headers
avctx->height * (
enc_row_size +
(4 + 12) * (((int64_t)enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) // fdAT * ceil(enc_row_size / IOBUF_SIZE)
);
if (max_packet_size > INT_MAX)
return AVERROR(ENOMEM);
- ret = ff_alloc_packet2(avctx, pkt, max_packet_size);
- if (ret < 0)
- return ret;
-
- s->bytestream_start =
- s->bytestream = pkt->data;
- s->bytestream_end = pkt->data + pkt->size;
if (avctx->frame_number == 0) {
+ s->bytestream = avctx->extradata = av_malloc(FF_MIN_BUFFER_SIZE);
+ if (!avctx->extradata)
+ return AVERROR(ENOMEM);
+
ret = encode_headers(avctx, pict);
if (ret < 0)
return ret;
- avctx->extradata = av_malloc(s->bytestream - s->bytestream_start);
- if (!avctx->extradata)
+ avctx->extradata_size = s->bytestream - avctx->extradata;
+
+ s->last_frame_packet = av_malloc(max_packet_size);
+ if (!s->last_frame_packet)
return AVERROR(ENOMEM);
- avctx->extradata_size = s->bytestream - s->bytestream_start;
- memcpy(avctx->extradata, s->bytestream_start, s->bytestream - s->bytestream_start);
+ } else if (s->last_frame) {
+ ret = ff_alloc_packet2(avctx, pkt, max_packet_size, 0);
+ if (ret < 0)
+ return ret;
- s->bytestream = s->bytestream_start;
+ memcpy(pkt->data, s->last_frame_packet, s->last_frame_packet_size);
+ pkt->size = s->last_frame_packet_size;
+ pkt->pts = pkt->dts = s->last_frame->pts;
}
- AV_WB32(buf, s->sequence_number);
- AV_WB32(buf + 4, avctx->width);
- AV_WB32(buf + 8, avctx->height);
- AV_WB32(buf + 12, 0); // x offset
- AV_WB32(buf + 16, 0); // y offset
- AV_WB16(buf + 20, 0); // delay numerator (filled in during muxing)
- AV_WB16(buf + 22, 0); // delay denominator
- buf[24] = APNG_DISPOSE_OP_BACKGROUND;
- buf[25] = APNG_BLEND_OP_SOURCE;
- png_write_chunk(&s->bytestream, MKTAG('f', 'c', 'T', 'L'), buf, 26);
- ++s->sequence_number;
+ if (pict) {
+ s->bytestream_start =
+ s->bytestream = s->last_frame_packet;
+ s->bytestream_end = s->bytestream + max_packet_size;
- ret = encode_frame(avctx, pict);
- if (ret < 0)
- return ret;
+ // We're encoding the frame first, so we have to do a bit of shuffling around
+ // to have the image data write to the correct place in the buffer
+ fctl_chunk.sequence_number = s->sequence_number;
+ ++s->sequence_number;
+ s->bytestream += 26 + 12;
- pkt->size = s->bytestream - s->bytestream_start;
- pkt->flags |= AV_PKT_FLAG_KEY;
- *got_packet = 1;
+ ret = apng_encode_frame(avctx, pict, &fctl_chunk, &s->last_frame_fctl);
+ if (ret < 0)
+ return ret;
+
+ fctl_chunk.delay_num = 0; // delay filled in during muxing
+ fctl_chunk.delay_den = 0;
+ } else {
+ s->last_frame_fctl.dispose_op = APNG_DISPOSE_OP_NONE;
+ }
+
+ if (s->last_frame) {
+ uint8_t* last_fctl_chunk_start = pkt->data;
+ uint8_t buf[26];
+
+ AV_WB32(buf + 0, s->last_frame_fctl.sequence_number);
+ AV_WB32(buf + 4, s->last_frame_fctl.width);
+ AV_WB32(buf + 8, s->last_frame_fctl.height);
+ AV_WB32(buf + 12, s->last_frame_fctl.x_offset);
+ AV_WB32(buf + 16, s->last_frame_fctl.y_offset);
+ AV_WB16(buf + 20, s->last_frame_fctl.delay_num);
+ AV_WB16(buf + 22, s->last_frame_fctl.delay_den);
+ buf[24] = s->last_frame_fctl.dispose_op;
+ buf[25] = s->last_frame_fctl.blend_op;
+ png_write_chunk(&last_fctl_chunk_start, MKTAG('f', 'c', 'T', 'L'), buf, 26);
+
+ *got_packet = 1;
+ }
+
+ if (pict) {
+ if (!s->last_frame) {
+ s->last_frame = av_frame_alloc();
+ if (!s->last_frame)
+ return AVERROR(ENOMEM);
+ } else if (s->last_frame_fctl.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
+ if (!s->prev_frame) {
+ s->prev_frame = av_frame_alloc();
+ if (!s->prev_frame)
+ return AVERROR(ENOMEM);
+
+ s->prev_frame->format = pict->format;
+ s->prev_frame->width = pict->width;
+ s->prev_frame->height = pict->height;
+ if ((ret = av_frame_get_buffer(s->prev_frame, 32)) < 0)
+ return ret;
+ }
+
+ // Do disposal, but not blending
+ memcpy(s->prev_frame->data[0], s->last_frame->data[0],
+ s->last_frame->linesize[0] * s->last_frame->height);
+ if (s->last_frame_fctl.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
+ uint32_t y;
+ uint8_t bpp = (s->bits_per_pixel + 7) >> 3;
+ for (y = s->last_frame_fctl.y_offset; y < s->last_frame_fctl.y_offset + s->last_frame_fctl.height; ++y) {
+ size_t row_start = s->last_frame->linesize[0] * y + bpp * s->last_frame_fctl.x_offset;
+ memset(s->prev_frame->data[0] + row_start, 0, bpp * s->last_frame_fctl.width);
+ }
+ }
+ }
+
+ av_frame_unref(s->last_frame);
+ ret = av_frame_ref(s->last_frame, (AVFrame*)pict);
+ if (ret < 0)
+ return ret;
+
+ s->last_frame_fctl = fctl_chunk;
+ s->last_frame_packet_size = s->bytestream - s->bytestream_start;
+ } else {
+ av_frame_free(&s->last_frame);
+ }
return 0;
}
@@ -627,12 +971,12 @@ static av_cold int png_enc_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = 8;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ff_huffyuvencdsp_init(&s->hdsp);
@@ -649,7 +993,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx)
s->dpm = s->dpi * 10000 / 254;
}
- s->is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
+ s->is_progressive = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGBA64BE:
s->bit_depth = 16;
@@ -713,7 +1057,9 @@ static av_cold int png_enc_close(AVCodecContext *avctx)
PNGEncContext *s = avctx->priv_data;
deflateEnd(&s->zstream);
- av_frame_free(&avctx->coded_frame);
+ av_frame_free(&s->last_frame);
+ av_frame_free(&s->prev_frame);
+ av_freep(&s->last_frame_packet);
return 0;
}
@@ -748,7 +1094,7 @@ AVCodec ff_png_encoder = {
.init = png_enc_init,
.close = png_enc_close,
.encode2 = encode_png,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE,
@@ -769,6 +1115,7 @@ AVCodec ff_apng_encoder = {
.init = png_enc_init,
.close = png_enc_close,
.encode2 = encode_apng,
+ .capabilities = CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE,
diff --git a/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c b/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
index 2a9e3e1cba6..a5eb81f5f60 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
@@ -55,7 +55,7 @@ retry:
goto retry;
}
#if 0
- if (pc->index && pc->index * 2 + FF_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
+ if (pc->index && pc->index * 2 + AV_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
memcpy(pc->buffer + pc->index, buf, pc->index);
pc->index += pc->index;
buf += pc->index;
diff --git a/chromium/third_party/ffmpeg/libavcodec/pnmdec.c b/chromium/third_party/ffmpeg/libavcodec/pnmdec.c
index e6345006747..d4261a4530e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pnmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pnmdec.c
@@ -265,7 +265,7 @@ AVCodec ff_pgm_decoder = {
.id = AV_CODEC_ID_PGM,
.priv_data_size = sizeof(PNMContext),
.decode = pnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -277,7 +277,7 @@ AVCodec ff_pgmyuv_decoder = {
.id = AV_CODEC_ID_PGMYUV,
.priv_data_size = sizeof(PNMContext),
.decode = pnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -289,7 +289,7 @@ AVCodec ff_ppm_decoder = {
.id = AV_CODEC_ID_PPM,
.priv_data_size = sizeof(PNMContext),
.decode = pnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -301,7 +301,7 @@ AVCodec ff_pbm_decoder = {
.id = AV_CODEC_ID_PBM,
.priv_data_size = sizeof(PNMContext),
.decode = pnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
@@ -313,6 +313,6 @@ AVCodec ff_pam_decoder = {
.id = AV_CODEC_ID_PAM,
.priv_data_size = sizeof(PNMContext),
.decode = pnm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/pnmenc.c b/chromium/third_party/ffmpeg/libavcodec/pnmenc.c
index e6c3635e7b9..b3eb5d90d3e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pnmenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pnmenc.c
@@ -32,7 +32,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if ((ret = ff_alloc_packet2(avctx, pkt, avpicture_get_size(avctx->pix_fmt,
avctx->width,
- avctx->height) + 200)) < 0)
+ avctx->height) + 200, 0)) < 0)
return ret;
bytestream_start =
@@ -83,7 +83,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
"P%c\n%d %d\n", c, avctx->width, h1);
bytestream += strlen(bytestream);
if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
- int maxdepth = (1 << (av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1)) - 1;
+ int maxdepth = (1 << av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth) - 1;
snprintf(bytestream, bytestream_end - bytestream,
"%d\n", maxdepth);
bytestream += strlen(bytestream);
@@ -120,22 +120,16 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int pnm_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}
-static av_cold int pnm_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
#if CONFIG_PGM_ENCODER
AVCodec ff_pgm_encoder = {
.name = "pgm",
@@ -143,7 +137,6 @@ AVCodec ff_pgm_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PGM,
.init = pnm_encode_init,
- .close = pnm_encode_close,
.encode2 = pnm_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
@@ -158,7 +151,6 @@ AVCodec ff_pgmyuv_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PGMYUV,
.init = pnm_encode_init,
- .close = pnm_encode_close,
.encode2 = pnm_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE
@@ -173,7 +165,6 @@ AVCodec ff_ppm_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PPM,
.init = pnm_encode_init,
- .close = pnm_encode_close,
.encode2 = pnm_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
@@ -188,7 +179,6 @@ AVCodec ff_pbm_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PBM,
.init = pnm_encode_init,
- .close = pnm_encode_close,
.encode2 = pnm_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
AV_PIX_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile b/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
index 30d04b846a4..bd4f427895a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/Makefile
@@ -20,6 +20,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += ppc/mpegvideoencdsp.o
OBJS-$(CONFIG_PIXBLOCKDSP) += ppc/pixblockdsp.o
OBJS-$(CONFIG_VIDEODSP) += ppc/videodsp_ppc.o
OBJS-$(CONFIG_VP3DSP) += ppc/vp3dsp_altivec.o
+OBJS-$(CONFIG_VP8DSP) += ppc/vp8dsp_altivec.o
# decoders/encoders
OBJS-$(CONFIG_LLAUDDSP) += ppc/lossless_audiodsp_altivec.o
@@ -27,4 +28,3 @@ OBJS-$(CONFIG_SVQ1_ENCODER) += ppc/svq1enc_altivec.o
OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o
OBJS-$(CONFIG_VORBIS_DECODER) += ppc/vorbisdsp_altivec.o
OBJS-$(CONFIG_VP7_DECODER) += ppc/vp8dsp_altivec.o
-OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/ppc/idctdsp.c b/chromium/third_party/ffmpeg/libavcodec/ppc/idctdsp.c
index ea56a709487..80e71fdaf0e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ppc/idctdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ppc/idctdsp.c
@@ -261,7 +261,7 @@ av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
return;
if (!high_bit_depth && avctx->lowres == 0) {
- if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & CODEC_FLAG_BITEXACT)) ||
+ if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
(avctx->idct_algo == FF_IDCT_ALTIVEC)) {
c->idct = idct_altivec;
c->idct_add = idct_add_altivec;
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresdec2.c b/chromium/third_party/ffmpeg/libavcodec/proresdec2.c
index a1d497f0498..932f85f73b3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresdec2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresdec2.c
@@ -28,6 +28,7 @@
#define LONG_BITSTREAM_READER
+#include "libavutil/internal.h"
#include "avcodec.h"
#include "get_bits.h"
#include "idctdsp.h"
@@ -70,14 +71,14 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
const uint8_t *ptr;
hdr_size = AV_RB16(buf);
- av_dlog(avctx, "header size %d\n", hdr_size);
+ ff_dlog(avctx, "header size %d\n", hdr_size);
if (hdr_size > data_size) {
av_log(avctx, AV_LOG_ERROR, "error, wrong header size\n");
return AVERROR_INVALIDDATA;
}
version = AV_RB16(buf + 2);
- av_dlog(avctx, "%.4s version %d\n", buf+4, version);
+ ff_dlog(avctx, "%.4s version %d\n", buf+4, version);
if (version > 1) {
av_log(avctx, AV_LOG_ERROR, "unsupported version: %d\n", version);
return AVERROR_PATCHWELCOME;
@@ -100,7 +101,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
}
if (avctx->skip_alpha) ctx->alpha_info = 0;
- av_dlog(avctx, "frame type %d\n", ctx->frame_type);
+ ff_dlog(avctx, "frame type %d\n", ctx->frame_type);
if (ctx->frame_type == 0) {
ctx->scan = ctx->progressive_scan; // permuted
@@ -118,7 +119,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
ptr = buf + 20;
flags = buf[19];
- av_dlog(avctx, "flags %x\n", flags);
+ ff_dlog(avctx, "flags %x\n", flags);
if (flags & 2) {
if(buf + data_size - ptr < 64) {
@@ -574,7 +575,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
if (ret < 0)
return ret;
- if (!(avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_GRAY)) {
ret = decode_slice_chroma(avctx, slice, (uint16_t*)dest_u, chroma_stride,
buf + y_data_size, u_data_size,
qmat_chroma_scaled, log2_chroma_blocks_per_mb);
@@ -686,5 +687,5 @@ AVCodec ff_prores_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresdec_lgpl.c b/chromium/third_party/ffmpeg/libavcodec/proresdec_lgpl.c
index 4bdf3924612..9e5674eccc7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresdec_lgpl.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresdec_lgpl.c
@@ -780,5 +780,5 @@ AVCodec ff_prores_lgpl_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c b/chromium/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c
index 48eb44ec167..0516066163a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c
@@ -323,7 +323,7 @@ static av_always_inline unsigned encode_slice_data(AVCodecContext *avctx,
*y_data_size = encode_slice_plane(avctx, mb_count, dest_y, luma_stride,
buf, data_size, ctx->qmat_luma[qp - 1], 0);
- if (!(avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_GRAY)) {
*u_data_size = encode_slice_plane(avctx, mb_count, dest_u,
chroma_stride, buf + *y_data_size, data_size - *y_data_size,
ctx->qmat_chroma[qp - 1], 1);
@@ -491,10 +491,10 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int header_size = 148;
uint8_t *buf;
int pic_size, ret;
- int frame_size = FFALIGN(avctx->width, 16) * FFALIGN(avctx->height, 16)*16 + 500 + FF_MIN_BUFFER_SIZE; //FIXME choose tighter limit
+ int frame_size = FFALIGN(avctx->width, 16) * FFALIGN(avctx->height, 16)*16 + 500 + AV_INPUT_BUFFER_MIN_SIZE; //FIXME choose tighter limit
- if ((ret = ff_alloc_packet2(avctx, pkt, frame_size + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, frame_size + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
buf = pkt->data;
@@ -590,19 +590,12 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
return 0;
}
static av_cold int prores_encode_close(AVCodecContext *avctx)
{
ProresContext* ctx = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
av_freep(&ctx->fill_y);
return 0;
@@ -618,7 +611,7 @@ AVCodec ff_prores_aw_encoder = {
.close = prores_encode_close,
.encode2 = prores_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE},
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.profiles = profiles
};
@@ -632,6 +625,6 @@ AVCodec ff_prores_encoder = {
.close = prores_encode_close,
.encode2 = prores_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE},
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.profiles = profiles
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c b/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
index 18413681f67..3bc1d5d7722 100644
--- a/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
+++ b/chromium/third_party/ffmpeg/libavcodec/proresenc_kostya.c
@@ -199,6 +199,7 @@ typedef struct ProresContext {
int linesize, int16_t *block);
FDCTDSPContext fdsp;
+ const AVFrame *pic;
int mb_width, mb_height;
int mbs_per_slice;
int num_chroma_blocks, chroma_factor;
@@ -745,7 +746,7 @@ static int estimate_alpha_plane(ProresContext *ctx, int *error,
return bits;
}
-static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
+static int find_slice_quant(AVCodecContext *avctx,
int trellis_node, int x, int y, int mbs_per_slice,
ProresThreadData *td)
{
@@ -767,7 +768,7 @@ static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
if (ctx->pictures_per_frame == 1)
line_add = 0;
else
- line_add = ctx->cur_picture_idx ^ !pic->top_field_first;
+ line_add = ctx->cur_picture_idx ^ !ctx->pic->top_field_first;
mbs = x + mbs_per_slice;
for (i = 0; i < ctx->num_planes; i++) {
@@ -787,9 +788,9 @@ static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
pwidth = avctx->width >> 1;
}
- linesize[i] = pic->linesize[i] * ctx->pictures_per_frame;
- src = (const uint16_t*)(pic->data[i] + yp * linesize[i] +
- line_add * pic->linesize[i]) + xp;
+ linesize[i] = ctx->pic->linesize[i] * ctx->pictures_per_frame;
+ src = (const uint16_t *)(ctx->pic->data[i] + yp * linesize[i] +
+ line_add * ctx->pic->linesize[i]) + xp;
if (i < 3) {
get_slice_data(ctx, src, linesize[i], xp, yp,
@@ -912,7 +913,7 @@ static int find_quant_thread(AVCodecContext *avctx, void *arg,
for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
while (ctx->mb_width - x < mbs_per_slice)
mbs_per_slice >>= 1;
- q = find_slice_quant(avctx, arg,
+ q = find_slice_quant(avctx,
(mb + 1) * TRELLIS_WIDTH, x, y,
mbs_per_slice, td);
}
@@ -940,9 +941,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int max_slice_size = (ctx->frame_size_upper_bound - 200) / (ctx->pictures_per_frame * ctx->slices_per_picture + 1);
uint8_t frame_flags;
+ ctx->pic = pic;
pkt_size = ctx->frame_size_upper_bound;
- if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
orig_buf = pkt->data;
@@ -961,7 +963,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_be16 (&buf, avctx->height);
frame_flags = ctx->chroma_factor << 6;
- if (avctx->flags & CODEC_FLAG_INTERLACED_DCT)
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT)
frame_flags |= pic->top_field_first ? 0x04 : 0x08;
bytestream_put_byte (&buf, frame_flags);
@@ -1090,8 +1092,6 @@ static av_cold int encode_close(AVCodecContext *avctx)
ProresContext *ctx = avctx->priv_data;
int i;
- av_frame_free(&avctx->coded_frame);
-
if (ctx->tdata) {
for (i = 0; i < avctx->thread_count; i++)
av_freep(&ctx->tdata[i].nodes);
@@ -1122,14 +1122,15 @@ static av_cold int encode_init(AVCodecContext *avctx)
int mps;
int i, j;
int min_quant, max_quant;
- int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
+ int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
avctx->bits_per_raw_sample = 10;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
ctx->fdct = prores_fdct;
ctx->scantable = interlaced ? ff_prores_interlaced_scan
@@ -1346,7 +1347,7 @@ AVCodec ff_prores_ks_encoder = {
.init = encode_init,
.close = encode_close,
.encode2 = encode_frame,
- .capabilities = CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE
diff --git a/chromium/third_party/ffmpeg/libavcodec/psymodel.h b/chromium/third_party/ffmpeg/libavcodec/psymodel.h
index 75261ba4be5..e9be1f6fa5c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/psymodel.h
+++ b/chromium/third_party/ffmpeg/libavcodec/psymodel.h
@@ -38,8 +38,7 @@ typedef struct FFPsyBand {
int bits;
float energy;
float threshold;
- float distortion;
- float perceptual_weight;
+ float spread; /* Energy spread over the band */
} FFPsyBand;
/**
@@ -67,6 +66,7 @@ typedef struct FFPsyWindowInfo {
int window_shape; ///< window shape (sine/KBD/whatever)
int num_windows; ///< number of windows in a frame
int grouping[8]; ///< window grouping (for e.g. AAC)
+ float clipping[8]; ///< maximum absolute normalized intensity in the given window for clip avoidance
int *window_sizes; ///< sequence of window sizes inside one frame (for eg. WMA)
} FFPsyWindowInfo;
diff --git a/chromium/third_party/ffmpeg/libavcodec/pthread.c b/chromium/third_party/ffmpeg/libavcodec/pthread.c
index 407ca2e271e..572471586d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pthread.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pthread.c
@@ -45,18 +45,18 @@
*/
static void validate_thread_parameters(AVCodecContext *avctx)
{
- int frame_threading_supported = (avctx->codec->capabilities & CODEC_CAP_FRAME_THREADS)
- && !(avctx->flags & CODEC_FLAG_TRUNCATED)
- && !(avctx->flags & CODEC_FLAG_LOW_DELAY)
- && !(avctx->flags2 & CODEC_FLAG2_CHUNKS);
+ int frame_threading_supported = (avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)
+ && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED)
+ && !(avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
+ && !(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS);
if (avctx->thread_count == 1) {
avctx->active_thread_type = 0;
} else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
avctx->active_thread_type = FF_THREAD_FRAME;
- } else if (avctx->codec->capabilities & CODEC_CAP_SLICE_THREADS &&
+ } else if (avctx->codec->capabilities & AV_CODEC_CAP_SLICE_THREADS &&
avctx->thread_type & FF_THREAD_SLICE) {
avctx->active_thread_type = FF_THREAD_SLICE;
- } else if (!(avctx->codec->capabilities & CODEC_CAP_AUTO_THREADS)) {
+ } else if (!(avctx->codec->capabilities & AV_CODEC_CAP_AUTO_THREADS)) {
avctx->thread_count = 1;
avctx->active_thread_type = 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c b/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
index a3fd1fff758..c89b4ca2e08 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pthread_frame.c
@@ -122,13 +122,8 @@ typedef struct FrameThreadContext {
int die; ///< Set when threads should exit.
} FrameThreadContext;
-#if FF_API_GET_BUFFER
-#define THREAD_SAFE_CALLBACKS(avctx) \
-((avctx)->thread_safe_callbacks || (!(avctx)->get_buffer && (avctx)->get_buffer2 == avcodec_default_get_buffer2))
-#else
#define THREAD_SAFE_CALLBACKS(avctx) \
((avctx)->thread_safe_callbacks || (avctx)->get_buffer2 == avcodec_default_get_buffer2)
-#endif
/**
* Codec worker thread.
@@ -242,7 +237,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (for_user) {
dst->delay = src->thread_count - 1;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
dst->coded_frame = src->coded_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
} else {
if (dst->codec->update_thread_context)
err = dst->codec->update_thread_context(dst, src);
@@ -265,12 +264,6 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
dst->draw_horiz_band= src->draw_horiz_band;
dst->get_buffer2 = src->get_buffer2;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
- dst->get_buffer = src->get_buffer;
- dst->release_buffer = src->release_buffer;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
dst->opaque = src->opaque;
dst->debug = src->debug;
@@ -327,7 +320,8 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
PerThreadContext *prev_thread = fctx->prev_thread;
const AVCodec *codec = p->avctx->codec;
- if (!avpkt->size && !(codec->capabilities & CODEC_CAP_DELAY)) return 0;
+ if (!avpkt->size && !(codec->capabilities & AV_CODEC_CAP_DELAY))
+ return 0;
pthread_mutex_lock(&p->mutex);
@@ -362,14 +356,9 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
* and it calls back to the client here.
*/
-FF_DISABLE_DEPRECATION_WARNINGS
if (!p->avctx->thread_safe_callbacks && (
p->avctx->get_format != avcodec_default_get_format ||
-#if FF_API_GET_BUFFER
- p->avctx->get_buffer ||
-#endif
p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
-FF_ENABLE_DEPRECATION_WARNINGS
while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) {
int call_done = 1;
pthread_mutex_lock(&p->progress_mutex);
@@ -454,6 +443,9 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
*got_picture_ptr = p->got_frame;
picture->pkt_dts = p->avpkt.dts;
+ if (p->result < 0)
+ err = p->result;
+
/*
* A later call with avkpt->size == 0 may loop over all threads,
* including this one, searching for a frame to return before being
@@ -471,6 +463,14 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
fctx->next_finished = finished;
+ /*
+ * When no frame was found while flushing, but an error occurred in
+ * any thread, return it instead of 0.
+ * Otherwise the error can get lost.
+ */
+ if (!avpkt->size && !*got_picture_ptr)
+ return err;
+
/* return the size of the consumed packet if no error occurred */
return (p->result >= 0) ? avpkt->size : p->result;
}
@@ -572,7 +572,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
pthread_join(p->thread, NULL);
p->thread_init=0;
- if (codec->close)
+ if (codec->close && p->avctx)
codec->close(p->avctx);
release_delayed_buffers(p);
@@ -590,12 +590,13 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
av_packet_unref(&p->avpkt);
av_freep(&p->released_buffers);
- if (i) {
+ if (i && p->avctx) {
av_freep(&p->avctx->priv_data);
av_freep(&p->avctx->slice_offset);
}
- av_freep(&p->avctx->internal);
+ if (p->avctx)
+ av_freep(&p->avctx->internal);
av_freep(&p->avctx);
}
@@ -678,6 +679,7 @@ int ff_frame_thread_init(AVCodecContext *avctx)
copy->internal = av_malloc(sizeof(AVCodecInternal));
if (!copy->internal) {
+ copy->priv_data = NULL;
err = AVERROR(ENOMEM);
goto error;
}
@@ -790,13 +792,8 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int
}
pthread_mutex_lock(&p->parent->buffer_mutex);
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->thread_safe_callbacks || (
-#if FF_API_GET_BUFFER
- !avctx->get_buffer &&
-#endif
- avctx->get_buffer2 == avcodec_default_get_buffer2)) {
-FF_ENABLE_DEPRECATION_WARNINGS
+ if (avctx->thread_safe_callbacks ||
+ avctx->get_buffer2 == avcodec_default_get_buffer2) {
err = ff_get_buffer(avctx, f->f, flags);
} else {
pthread_mutex_lock(&p->progress_mutex);
@@ -815,7 +812,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (!THREAD_SAFE_CALLBACKS(avctx) && !avctx->codec->update_thread_context)
ff_thread_finish_setup(avctx);
-
if (err)
av_buffer_unref(&f->progress);
@@ -863,15 +859,9 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
PerThreadContext *p = avctx->internal->thread_ctx;
FrameThreadContext *fctx;
AVFrame *dst, *tmp;
-FF_DISABLE_DEPRECATION_WARNINGS
int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
avctx->thread_safe_callbacks ||
- (
-#if FF_API_GET_BUFFER
- !avctx->get_buffer &&
-#endif
- avctx->get_buffer2 == avcodec_default_get_buffer2);
-FF_ENABLE_DEPRECATION_WARNINGS
+ avctx->get_buffer2 == avcodec_default_get_buffer2;
if (!f->f || !f->f->buf[0])
return;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ptx.c b/chromium/third_party/ffmpeg/libavcodec/ptx.c
index 8c3abd7ddbf..42147f4afce 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ptx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ptx.c
@@ -88,5 +88,5 @@ AVCodec ff_ptx_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_PTX,
.decode = ptx_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c b/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
index 22564edb7a4..adb3e82359e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qcelpdec.c
@@ -797,6 +797,6 @@ AVCodec ff_qcelp_decoder = {
.id = AV_CODEC_ID_QCELP,
.init = qcelp_decode_init,
.decode = qcelp_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(QCELPContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qdm2.c b/chromium/third_party/ffmpeg/libavcodec/qdm2.c
index a02c5e536c4..0b6dcd68233 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qdm2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qdm2.c
@@ -1888,5 +1888,5 @@ AVCodec ff_qdm2_decoder = {
.init = qdm2_decode_init,
.close = qdm2_decode_close,
.decode = qdm2_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qdrw.c b/chromium/third_party/ffmpeg/libavcodec/qdrw.c
index 838f836516f..0a31b416609 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qdrw.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qdrw.c
@@ -339,5 +339,5 @@ AVCodec ff_qdraw_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_QDRAW,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qpeg.c b/chromium/third_party/ffmpeg/libavcodec/qpeg.c
index 71f322b8287..9eaf9b8054b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qpeg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qpeg.c
@@ -351,5 +351,5 @@ AVCodec ff_qpeg_decoder = {
.close = decode_end,
.decode = decode_frame,
.flush = decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qpeldsp.c b/chromium/third_party/ffmpeg/libavcodec/qpeldsp.c
index 1c0ec637d0b..6e52b336577 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qpeldsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qpeldsp.c
@@ -811,4 +811,6 @@ av_cold void ff_qpeldsp_init(QpelDSPContext *c)
if (ARCH_X86)
ff_qpeldsp_init_x86(c);
+ if (ARCH_MIPS)
+ ff_qpeldsp_init_mips(c);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/qpeldsp.h b/chromium/third_party/ffmpeg/libavcodec/qpeldsp.h
index b51420a6a24..91019eda9c5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qpeldsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qpeldsp.h
@@ -78,5 +78,6 @@ typedef struct QpelDSPContext {
void ff_qpeldsp_init(QpelDSPContext *c);
void ff_qpeldsp_init_x86(QpelDSPContext *c);
+void ff_qpeldsp_init_mips(QpelDSPContext *c);
#endif /* AVCODEC_QPELDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsv.c b/chromium/third_party/ffmpeg/libavcodec/qsv.c
index 31be9d1fa3c..4c8e6b01a99 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsv.c
@@ -19,7 +19,12 @@
*/
#include <mfx/mfxvideo.h>
+#include <mfx/mfxplugin.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "avcodec.h"
@@ -30,6 +35,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
switch (codec_id) {
case AV_CODEC_ID_H264:
return MFX_CODEC_AVC;
+#if QSV_VERSION_ATLEAST(1, 8)
+ case AV_CODEC_ID_HEVC:
+ return MFX_CODEC_HEVC;
+#endif
case AV_CODEC_ID_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO:
return MFX_CODEC_MPEG2;
@@ -76,8 +85,91 @@ int ff_qsv_error(int mfx_err)
return AVERROR_UNKNOWN;
}
}
+static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs)
+{
+ // this code is only required for Linux. It searches for a valid
+ // display handle. First in /dev/dri/renderD then in /dev/dri/card
+#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
+ // VAAPI display handle
+ int ret = 0;
+ VADisplay va_dpy = NULL;
+ VAStatus va_res = VA_STATUS_SUCCESS;
+ int major_version = 0, minor_version = 0;
+ int fd = -1;
+ char adapterpath[256];
+ int adapter_num;
+
+ qs->fd_display = -1;
+ qs->va_display = NULL;
+
+ //search for valid graphics device
+ for (adapter_num = 0;adapter_num < 6;adapter_num++) {
+
+ if (adapter_num<3) {
+ snprintf(adapterpath,sizeof(adapterpath),
+ "/dev/dri/renderD%d", adapter_num+128);
+ } else {
+ snprintf(adapterpath,sizeof(adapterpath),
+ "/dev/dri/card%d", adapter_num-3);
+ }
+
+ fd = open(adapterpath, O_RDWR);
+ if (fd < 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "mfx init: %s fd open failed\n", adapterpath);
+ continue;
+ }
+
+ va_dpy = vaGetDisplayDRM(fd);
+ if (!va_dpy) {
+ av_log(avctx, AV_LOG_ERROR,
+ "mfx init: %s vaGetDisplayDRM failed\n", adapterpath);
+ close(fd);
+ continue;
+ }
-int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session)
+ va_res = vaInitialize(va_dpy, &major_version, &minor_version);
+ if (VA_STATUS_SUCCESS != va_res) {
+ av_log(avctx, AV_LOG_ERROR,
+ "mfx init: %s vaInitialize failed\n", adapterpath);
+ close(fd);
+ fd = -1;
+ continue;
+ } else {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "mfx initialization: %s vaInitialize successful\n",adapterpath);
+ qs->fd_display = fd;
+ qs->va_display = va_dpy;
+ ret = MFXVideoCORE_SetHandle(qs->session,
+ (mfxHandleType)MFX_HANDLE_VA_DISPLAY, (mfxHDL)va_dpy);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Error %d during set display handle\n", ret);
+ return ff_qsv_error(ret);
+ }
+ break;
+ }
+ }
+#endif //AVCODEC_QSV_LINUX_SESSION_HANDLE
+ return 0;
+}
+/**
+ * @brief Initialize a MSDK session
+ *
+ * Media SDK is based on sessions, so this is the prerequisite
+ * initialization for HW acceleration. For Windows the session is
+ * complete and ready to use, for Linux a display handle is
+ * required. For releases of Media Server Studio >= 2015 R4 the
+ * render nodes interface is preferred (/dev/dri/renderD).
+ * Using Media Server Studio 2015 R4 or newer is recommended
+ * but the older /dev/dri/card interface is also searched
+ * for broader compatibility.
+ *
+ * @param avctx ffmpeg metadata for this codec context
+ * @param session the MSDK session used
+ */
+int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
+ const char *load_plugins)
{
mfxIMPL impl = MFX_IMPL_AUTO_ANY;
mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } };
@@ -85,13 +177,17 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session)
const char *desc;
int ret;
- ret = MFXInit(impl, &ver, session);
+ ret = MFXInit(impl, &ver, &qs->session);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error initializing an internal MFX session\n");
return ff_qsv_error(ret);
}
- MFXQueryIMPL(*session, &impl);
+ ret = ff_qsv_set_display_handle(avctx, qs);
+ if (ret < 0)
+ return ret;
+
+ MFXQueryIMPL(qs->session, &impl);
switch (MFX_IMPL_BASETYPE(impl)) {
case MFX_IMPL_SOFTWARE:
@@ -107,9 +203,67 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session)
desc = "unknown";
}
+ if (load_plugins && *load_plugins) {
+ while (*load_plugins) {
+ mfxPluginUID uid;
+ int i, err = 0;
+
+ char *plugin = av_get_token(&load_plugins, ":");
+ if (!plugin)
+ return AVERROR(ENOMEM);
+ if (strlen(plugin) != 2 * sizeof(uid.Data)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid plugin UID length\n");
+ err = AVERROR(EINVAL);
+ goto load_plugin_fail;
+ }
+
+ for (i = 0; i < sizeof(uid.Data); i++) {
+ err = sscanf(plugin + 2 * i, "%2hhx", uid.Data + i);
+ if (err != 1) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid plugin UID\n");
+ err = AVERROR(EINVAL);
+ goto load_plugin_fail;
+ }
+
+ }
+
+ ret = MFXVideoUSER_Load(qs->session, &uid, 1);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Could not load the requested plugin: %s\n",
+ plugin);
+ err = ff_qsv_error(ret);
+ goto load_plugin_fail;
+ }
+
+load_plugin_fail:
+ av_freep(&plugin);
+ if (err < 0)
+ return err;
+ }
+ }
+
av_log(avctx, AV_LOG_VERBOSE,
"Initialized an internal MFX session using %s implementation\n",
desc);
return 0;
}
+
+int ff_qsv_close_internal_session(QSVSession *qs)
+{
+ if (qs->session) {
+ MFXClose(qs->session);
+ qs->session = NULL;
+ }
+#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
+ if (qs->va_display) {
+ vaTerminate(qs->va_display);
+ qs->va_display = NULL;
+ }
+ if (qs->fd_display > 0) {
+ close(qs->fd_display);
+ qs->fd_display = -1;
+ }
+#endif
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h b/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
index 86fca5fd8c3..b9ad199e338 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
@@ -21,24 +21,53 @@
#ifndef AVCODEC_QSV_INTERNAL_H
#define AVCODEC_QSV_INTERNAL_H
+#if CONFIG_VAAPI
+#define AVCODEC_QSV_LINUX_SESSION_HANDLE
+#endif //CONFIG_VAAPI
+
+#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
+#include <stdio.h>
+#include <string.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <va/va.h>
+#include <va/va_drm.h>
+#endif
+
#include <mfx/mfxvideo.h>
#include "libavutil/frame.h"
#define QSV_VERSION_MAJOR 1
-#define QSV_VERSION_MINOR 1
+#define QSV_VERSION_MINOR 9
#define ASYNC_DEPTH_DEFAULT 4 // internal parallelism
+#define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
+ (MFX_VERSION_MAJOR > (MAJOR) || \
+ MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
+
typedef struct QSVFrame {
AVFrame *frame;
mfxFrameSurface1 *surface;
mfxFrameSurface1 surface_internal;
+ int queued;
+
struct QSVFrame *next;
} QSVFrame;
+typedef struct QSVSession {
+ mfxSession session;
+#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
+ int fd_display;
+ VADisplay va_display;
+#endif
+} QSVSession;
+
/**
* Convert a libmfx error code into a ffmpeg error code.
*/
@@ -46,6 +75,8 @@ int ff_qsv_error(int mfx_err);
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id);
-int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session);
+int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
+ const char *load_plugins);
+int ff_qsv_close_internal_session(QSVSession *qs);
#endif /* AVCODEC_QSV_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
index 47709b50f4e..00990badb10 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
@@ -34,6 +34,7 @@
#include "avcodec.h"
#include "internal.h"
+#include "qsv.h"
#include "qsv_internal.h"
#include "qsvdec.h"
@@ -48,65 +49,116 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format)
}
}
-static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession session)
+int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
{
- if (!session) {
- if (!q->internal_session) {
- int ret = ff_qsv_init_internal_session(avctx, &q->internal_session);
+ mfxVideoParam param = { { 0 } };
+ mfxBitstream bs = { { { 0 } } };
+ int ret;
+ enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
+ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_NONE };
+
+ q->iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
+ if (!q->session) {
+ if (avctx->hwaccel_context) {
+ AVQSVContext *qsv = avctx->hwaccel_context;
+
+ q->session = qsv->session;
+ q->iopattern = qsv->iopattern;
+ q->ext_buffers = qsv->ext_buffers;
+ q->nb_ext_buffers = qsv->nb_ext_buffers;
+ }
+ if (!q->session) {
+ ret = ff_qsv_init_internal_session(avctx, &q->internal_qs,
+ q->load_plugins);
if (ret < 0)
return ret;
- }
- q->session = q->internal_session;
- } else {
- q->session = session;
+ q->session = q->internal_qs.session;
+ }
}
- /* make sure the decoder is uninitialized */
- MFXVideoDECODE_Close(q->session);
-
- return 0;
-}
-
-int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession session)
-{
- mfxVideoParam param = { { 0 } };
- int ret;
+ if (avpkt->size) {
+ bs.Data = avpkt->data;
+ bs.DataLength = avpkt->size;
+ bs.MaxLength = bs.DataLength;
+ bs.TimeStamp = avpkt->pts;
+ } else
+ return AVERROR_INVALIDDATA;
- ret = qsv_init_session(avctx, q, session);
+ ret = ff_qsv_codec_id_to_mfx(avctx->codec_id);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error initializing an MFX session\n");
+ av_log(avctx, AV_LOG_ERROR, "Unsupported codec_id %08x\n", avctx->codec_id);
return ret;
}
+ param.mfx.CodecId = ret;
- ret = ff_qsv_codec_id_to_mfx(avctx->codec_id);
- if (ret < 0)
- return ret;
-
- param.mfx.CodecId = ret;
- param.mfx.CodecProfile = avctx->profile;
- param.mfx.CodecLevel = avctx->level;
-
- param.mfx.FrameInfo.BitDepthLuma = 8;
- param.mfx.FrameInfo.BitDepthChroma = 8;
- param.mfx.FrameInfo.Shift = 0;
- param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
- param.mfx.FrameInfo.Width = avctx->coded_width;
- param.mfx.FrameInfo.Height = avctx->coded_height;
- param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
-
+ ret = MFXVideoDECODE_DecodeHeader(q->session, &bs, &param);
+ if (MFX_ERR_MORE_DATA==ret) {
+ /* this code means that header not found so we return packet size to skip
+ a current packet
+ */
+ return avpkt->size;
+ } else if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Decode header error %d\n", ret);
+ return ff_qsv_error(ret);
+ }
param.IOPattern = q->iopattern;
param.AsyncDepth = q->async_depth;
param.ExtParam = q->ext_buffers;
param.NumExtParam = q->nb_ext_buffers;
+ param.mfx.FrameInfo.BitDepthLuma = 8;
+ param.mfx.FrameInfo.BitDepthChroma = 8;
ret = MFXVideoDECODE_Init(q->session, &param);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error initializing the MFX video decoder\n");
+ if (MFX_ERR_INVALID_VIDEO_PARAM==ret) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Error initializing the MFX video decoder, unsupported video\n");
+ } else {
+ av_log(avctx, AV_LOG_ERROR,
+ "Error initializing the MFX video decoder %d\n", ret);
+ }
return ff_qsv_error(ret);
}
+ ret = ff_get_format(avctx, pix_fmts);
+ if (ret < 0)
+ return ret;
+
+ avctx->pix_fmt = ret;
+ avctx->profile = param.mfx.CodecProfile;
+ avctx->level = param.mfx.CodecLevel;
+ avctx->coded_width = param.mfx.FrameInfo.Width;
+ avctx->coded_height = param.mfx.FrameInfo.Height;
+ avctx->width = param.mfx.FrameInfo.CropW - param.mfx.FrameInfo.CropX;
+ avctx->height = param.mfx.FrameInfo.CropH - param.mfx.FrameInfo.CropY;
+
+ /* maximum decoder latency should be not exceed max DPB size for h.264 and
+ HEVC which is 16 for both cases.
+ So weare pre-allocating fifo big enough for 17 elements:
+ */
+ if (!q->async_fifo) {
+ q->async_fifo = av_fifo_alloc((1 + 16) *
+ (sizeof(mfxSyncPoint) + sizeof(QSVFrame*)));
+ if (!q->async_fifo)
+ return AVERROR(ENOMEM);
+ }
+
+ if (!q->input_fifo) {
+ q->input_fifo = av_fifo_alloc(1024*16);
+ if (!q->input_fifo)
+ return AVERROR(ENOMEM);
+ }
+
+ if (!q->pkt_fifo) {
+ q->pkt_fifo = av_fifo_alloc( sizeof(AVPacket) * (1 + 16) );
+ if (!q->pkt_fifo)
+ return AVERROR(ENOMEM);
+ }
+ q->engine_ready = 1;
+
return 0;
}
@@ -142,7 +194,7 @@ static void qsv_clear_unused_frames(QSVContext *q)
{
QSVFrame *cur = q->work_frames;
while (cur) {
- if (cur->surface && !cur->surface->Data.Locked) {
+ if (cur->surface && !cur->surface->Data.Locked && !cur->queued) {
cur->surface = NULL;
av_frame_unref(cur->frame);
}
@@ -191,70 +243,187 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
return 0;
}
-static AVFrame *find_frame(QSVContext *q, mfxFrameSurface1 *surf)
+static QSVFrame *find_frame(QSVContext *q, mfxFrameSurface1 *surf)
{
QSVFrame *cur = q->work_frames;
while (cur) {
if (surf == cur->surface)
- return cur->frame;
+ return cur;
cur = cur->next;
}
return NULL;
}
-int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
+/* This function uses for 'smart' releasing of consumed data
+ from the input bitstream fifo.
+ Since the input fifo mapped to mfxBitstream which does not understand
+ a wrapping of data over fifo end, we should also to relocate a possible
+ data rest to fifo begin. If rest of data is absent then we just reset fifo's
+ pointers to initial positions.
+ NOTE the case when fifo does contain unconsumed data is rare and typical
+ amount of such data is 1..4 bytes.
+*/
+static void qsv_fifo_relocate(AVFifoBuffer *f, int bytes_to_free)
+{
+ int data_size;
+ int data_rest = 0;
+
+ av_fifo_drain(f, bytes_to_free);
+
+ data_size = av_fifo_size(f);
+ if (data_size > 0) {
+ if (f->buffer!=f->rptr) {
+ if ( (f->end - f->rptr) < data_size) {
+ data_rest = data_size - (f->end - f->rptr);
+ data_size-=data_rest;
+ memmove(f->buffer+data_size, f->buffer, data_rest);
+ }
+ memmove(f->buffer, f->rptr, data_size);
+ data_size+= data_rest;
+ }
+ }
+ f->rptr = f->buffer;
+ f->wptr = f->buffer + data_size;
+ f->wndx = data_size;
+ f->rndx = 0;
+}
+
+
+static void close_decoder(QSVContext *q)
+{
+ QSVFrame *cur;
+
+ MFXVideoDECODE_Close(q->session);
+
+ cur = q->work_frames;
+ while (cur) {
+ q->work_frames = cur->next;
+ av_frame_free(&cur->frame);
+ av_freep(&cur);
+ cur = q->work_frames;
+ }
+
+ q->engine_ready = 0;
+ q->reinit_pending = 0;
+}
+
+static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q,
AVFrame *frame, int *got_frame,
AVPacket *avpkt)
{
+ QSVFrame *out_frame;
mfxFrameSurface1 *insurf;
mfxFrameSurface1 *outsurf;
mfxSyncPoint sync;
mfxBitstream bs = { { { 0 } } };
int ret;
+ int n_out_frames;
+ int buffered = 0;
+ int flush = !avpkt->size || q->reinit_pending;
- if (avpkt->size) {
- bs.Data = avpkt->data;
- bs.DataLength = avpkt->size;
+ if (!q->engine_ready) {
+ ret = ff_qsv_decode_init(avctx, q, avpkt);
+ if (ret)
+ return ret;
+ }
+
+ if (!flush) {
+ if (av_fifo_size(q->input_fifo)) {
+ /* we have got rest of previous packet into buffer */
+ if (av_fifo_space(q->input_fifo) < avpkt->size) {
+ ret = av_fifo_grow(q->input_fifo, avpkt->size);
+ if (ret < 0)
+ return ret;
+ }
+ av_fifo_generic_write(q->input_fifo, avpkt->data, avpkt->size, NULL);
+ bs.Data = q->input_fifo->rptr;
+ bs.DataLength = av_fifo_size(q->input_fifo);
+ buffered = 1;
+ } else {
+ bs.Data = avpkt->data;
+ bs.DataLength = avpkt->size;
+ }
bs.MaxLength = bs.DataLength;
bs.TimeStamp = avpkt->pts;
}
- do {
+ while (1) {
ret = get_surface(avctx, q, &insurf);
if (ret < 0)
return ret;
+ do {
+ ret = MFXVideoDECODE_DecodeFrameAsync(q->session, flush ? NULL : &bs,
+ insurf, &outsurf, &sync);
+ if (ret != MFX_WRN_DEVICE_BUSY)
+ break;
+ av_usleep(500);
+ } while (1);
+
+ if (MFX_WRN_VIDEO_PARAM_CHANGED==ret) {
+ /* TODO: handle here minor sequence header changing */
+ } else if (MFX_ERR_INCOMPATIBLE_VIDEO_PARAM==ret) {
+ av_fifo_reset(q->input_fifo);
+ flush = q->reinit_pending = 1;
+ continue;
+ }
+
+ if (sync) {
+ QSVFrame *out_frame = find_frame(q, outsurf);
- ret = MFXVideoDECODE_DecodeFrameAsync(q->session, avpkt->size ? &bs : NULL,
- insurf, &outsurf, &sync);
- if (ret == MFX_WRN_DEVICE_BUSY)
- av_usleep(1);
+ if (!out_frame) {
+ av_log(avctx, AV_LOG_ERROR,
+ "The returned surface does not correspond to any frame\n");
+ return AVERROR_BUG;
+ }
- } while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_ERR_MORE_SURFACE);
+ out_frame->queued = 1;
+ av_fifo_generic_write(q->async_fifo, &out_frame, sizeof(out_frame), NULL);
+ av_fifo_generic_write(q->async_fifo, &sync, sizeof(sync), NULL);
- if (ret != MFX_ERR_NONE &&
- ret != MFX_ERR_MORE_DATA &&
- ret != MFX_WRN_VIDEO_PARAM_CHANGED &&
- ret != MFX_ERR_MORE_SURFACE) {
- av_log(avctx, AV_LOG_ERROR, "Error during QSV decoding.\n");
+ continue;
+ }
+ if (MFX_ERR_MORE_SURFACE != ret && ret < 0)
+ break;
+ }
+
+ /* make sure we do not enter an infinite loop if the SDK
+ * did not consume any data and did not return anything */
+ if (!sync && !bs.DataOffset && !flush) {
+ av_log(avctx, AV_LOG_WARNING, "A decode call did not consume any data\n");
+ bs.DataOffset = avpkt->size;
+ }
+
+ if (buffered) {
+ qsv_fifo_relocate(q->input_fifo, bs.DataOffset);
+ } else if (bs.DataOffset!=avpkt->size) {
+ /* some data of packet was not consumed. store it to local buffer */
+ av_fifo_generic_write(q->input_fifo, avpkt->data+bs.DataOffset,
+ avpkt->size - bs.DataOffset, NULL);
+ }
+
+ if (MFX_ERR_MORE_DATA!=ret && ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error %d during QSV decoding.\n", ret);
return ff_qsv_error(ret);
}
+ n_out_frames = av_fifo_size(q->async_fifo) / (sizeof(out_frame)+sizeof(sync));
- if (sync) {
+ if (n_out_frames > q->async_depth || (flush && n_out_frames) ) {
AVFrame *src_frame;
+ av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL);
+ av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
+ out_frame->queued = 0;
+
MFXVideoCORE_SyncOperation(q->session, sync, 60000);
- src_frame = find_frame(q, outsurf);
- if (!src_frame) {
- av_log(avctx, AV_LOG_ERROR,
- "The returned surface does not correspond to any frame\n");
- return AVERROR_BUG;
- }
+ src_frame = out_frame->frame;
ret = av_frame_ref(frame, src_frame);
if (ret < 0)
return ret;
+ outsurf = out_frame->surface;
+
frame->pkt_pts = frame->pts = outsurf->Data.TimeStamp;
frame->repeat_pict =
@@ -269,22 +438,147 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
*got_frame = 1;
}
- return bs.DataOffset;
+ return avpkt->size;
}
+/*
+ This function inserts a packet at fifo front.
+*/
+static void qsv_packet_push_front(QSVContext *q, AVPacket *avpkt)
+{
+ int fifo_size = av_fifo_size(q->pkt_fifo);
+ if (!fifo_size) {
+ /* easy case fifo is empty */
+ av_fifo_generic_write(q->pkt_fifo, avpkt, sizeof(*avpkt), NULL);
+ } else {
+ /* realloc necessary */
+ AVPacket pkt;
+ AVFifoBuffer *fifo = av_fifo_alloc(fifo_size+av_fifo_space(q->pkt_fifo));
-int ff_qsv_decode_close(QSVContext *q)
+ av_fifo_generic_write(fifo, avpkt, sizeof(*avpkt), NULL);
+
+ while (av_fifo_size(q->pkt_fifo)) {
+ av_fifo_generic_read(q->pkt_fifo, &pkt, sizeof(pkt), NULL);
+ av_fifo_generic_write(fifo, &pkt, sizeof(pkt), NULL);
+ }
+ av_fifo_free(q->pkt_fifo);
+ q->pkt_fifo = fifo;
+ }
+}
+int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
+ AVFrame *frame, int *got_frame,
+ AVPacket *avpkt)
{
- QSVFrame *cur = q->work_frames;
+ AVPacket pkt_ref = { 0 };
+ int ret = 0;
- while (cur) {
- q->work_frames = cur->next;
- av_frame_free(&cur->frame);
- av_freep(&cur);
+ if (q->pkt_fifo && av_fifo_size(q->pkt_fifo) >= sizeof(AVPacket)) {
+ /* we already have got some buffered packets. so add new to tail */
+ ret = av_packet_ref(&pkt_ref, avpkt);
+ if (ret < 0)
+ return ret;
+ av_fifo_generic_write(q->pkt_fifo, &pkt_ref, sizeof(pkt_ref), NULL);
+ }
+ if (q->reinit_pending) {
+ ret = do_qsv_decode(avctx, q, frame, got_frame, avpkt);
+
+ if (!*got_frame) {
+ /* Flushing complete, no more frames */
+ close_decoder(q);
+ //return ff_qsv_decode(avctx, q, frame, got_frame, avpkt);
+ }
+ }
+ if (!q->reinit_pending) {
+ if (q->pkt_fifo && av_fifo_size(q->pkt_fifo) >= sizeof(AVPacket)) {
+ /* process buffered packets */
+ while (!*got_frame && av_fifo_size(q->pkt_fifo) >= sizeof(AVPacket)) {
+ av_fifo_generic_read(q->pkt_fifo, &pkt_ref, sizeof(pkt_ref), NULL);
+ ret = do_qsv_decode(avctx, q, frame, got_frame, &pkt_ref);
+ if (q->reinit_pending) {
+ /*
+ A rare case: new reinit pending when buffering existing.
+ We should to return the pkt_ref back to same place of fifo
+ */
+ qsv_packet_push_front(q, &pkt_ref);
+ } else {
+ av_packet_unref(&pkt_ref);
+ }
+ }
+ } else {
+ /* general decoding */
+ ret = do_qsv_decode(avctx, q, frame, got_frame, avpkt);
+ if (q->reinit_pending) {
+ ret = av_packet_ref(&pkt_ref, avpkt);
+ if (ret < 0)
+ return ret;
+ av_fifo_generic_write(q->pkt_fifo, &pkt_ref, sizeof(pkt_ref), NULL);
+ }
+ }
+ }
+
+ return ret;
+}
+/*
+ This function resets decoder and corresponded buffers before seek operation
+*/
+void ff_qsv_decode_reset(AVCodecContext *avctx, QSVContext *q)
+{
+ QSVFrame *cur;
+ AVPacket pkt;
+ int ret = 0;
+ mfxVideoParam param = { { 0 } };
+
+ if (q->reinit_pending) {
+ close_decoder(q);
+ } else if (q->engine_ready) {
+ ret = MFXVideoDECODE_GetVideoParam(q->session, &param);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "MFX decode get param error %d\n", ret);
+ }
+
+ ret = MFXVideoDECODE_Reset(q->session, &param);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "MFX decode reset error %d\n", ret);
+ }
+
+ /* Free all frames*/
cur = q->work_frames;
+ while (cur) {
+ q->work_frames = cur->next;
+ av_frame_free(&cur->frame);
+ av_freep(&cur);
+ cur = q->work_frames;
+ }
}
- if (q->internal_session)
- MFXClose(q->internal_session);
+ /* Reset output surfaces */
+ av_fifo_reset(q->async_fifo);
+
+ /* Reset input packets fifo */
+ while (av_fifo_size(q->pkt_fifo)) {
+ av_fifo_generic_read(q->pkt_fifo, &pkt, sizeof(pkt), NULL);
+ av_packet_unref(&pkt);
+ }
+
+ /* Reset input bitstream fifo */
+ av_fifo_reset(q->input_fifo);
+}
+
+int ff_qsv_decode_close(QSVContext *q)
+{
+ close_decoder(q);
+
+ q->session = NULL;
+
+ ff_qsv_close_internal_session(&q->internal_qs);
+
+ av_fifo_free(q->async_fifo);
+ q->async_fifo = NULL;
+
+ av_fifo_free(q->input_fifo);
+ q->input_fifo = NULL;
+
+ av_fifo_free(q->pkt_fifo);
+ q->pkt_fifo = NULL;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec.h b/chromium/third_party/ffmpeg/libavcodec/qsvdec.h
index 373cc72b2a7..2b989c259a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvdec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec.h
@@ -28,6 +28,7 @@
#include <mfx/mfxvideo.h>
+#include "libavutil/fifo.h"
#include "libavutil/frame.h"
#include "libavutil/pixfmt.h"
@@ -40,29 +41,51 @@ typedef struct QSVContext {
// the session we allocated internally, in case the caller did not provide
// one
- mfxSession internal_session;
+ QSVSession internal_qs;
/**
* a linked list of frames currently being used by QSV
*/
QSVFrame *work_frames;
+ AVFifoBuffer *async_fifo;
+ AVFifoBuffer *input_fifo;
+
+ // we should to buffer input packets at some cases
+ // else it is not possible to handle dynamic stream changes correctly
+ // this fifo uses for input packets buffering
+ AVFifoBuffer *pkt_fifo;
+
+ // this flag indicates that header parsed,
+ // decoder instance created and ready to general decoding
+ int engine_ready;
+
+ // we can not just re-init decoder if different sequence header arrived
+ // we should to deliver all buffered frames but we can not decode new packets
+ // this time. So when reinit_pending is non-zero we flushing decoder and
+ // accumulate new arrived packets into pkt_fifo
+ int reinit_pending;
+
// options set by the caller
int async_depth;
int iopattern;
+ char *load_plugins;
+
mfxExtBuffer **ext_buffers;
int nb_ext_buffers;
} QSVContext;
int ff_qsv_map_pixfmt(enum AVPixelFormat format);
-int ff_qsv_decode_init(AVCodecContext *s, QSVContext *q, mfxSession session);
+int ff_qsv_decode_init(AVCodecContext *s, QSVContext *q, AVPacket *avpkt);
int ff_qsv_decode(AVCodecContext *s, QSVContext *q,
AVFrame *frame, int *got_frame,
AVPacket *avpkt);
+void ff_qsv_decode_reset(AVCodecContext *avctx, QSVContext *q);
+
int ff_qsv_decode_close(QSVContext *q);
#endif /* AVCODEC_QSVDEC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec_h264.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec_h264.c
deleted file mode 100644
index 7eb7a6c134c..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/qsvdec_h264.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Intel MediaSDK QSV based H.264 decoder
- *
- * copyright (c) 2013 Luca Barbato
- * copyright (c) 2015 Anton Khirnov
- *
- * 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 <string.h>
-
-#include <mfx/mfxvideo.h>
-
-#include "libavutil/common.h"
-#include "libavutil/fifo.h"
-#include "libavutil/opt.h"
-
-#include "avcodec.h"
-#include "internal.h"
-#include "qsv_internal.h"
-#include "qsvdec.h"
-#include "qsv.h"
-
-typedef struct QSVH264Context {
- AVClass *class;
- QSVContext qsv;
-
- // the internal parser and codec context for parsing the data
- AVCodecParserContext *parser;
- AVCodecContext *avctx_internal;
- enum AVPixelFormat orig_pix_fmt;
-
- // the filter for converting to Annex B
- AVBitStreamFilterContext *bsf;
-
- AVFifoBuffer *packet_fifo;
-
- AVPacket input_ref;
- AVPacket pkt_filtered;
- uint8_t *filtered_data;
-} QSVH264Context;
-
-static void qsv_clear_buffers(QSVH264Context *s)
-{
- AVPacket pkt;
- while (av_fifo_size(s->packet_fifo) >= sizeof(pkt)) {
- av_fifo_generic_read(s->packet_fifo, &pkt, sizeof(pkt), NULL);
- av_packet_unref(&pkt);
- }
-
- if (s->filtered_data != s->input_ref.data)
- av_freep(&s->filtered_data);
- s->filtered_data = NULL;
- av_packet_unref(&s->input_ref);
-}
-
-static av_cold int qsv_decode_close(AVCodecContext *avctx)
-{
- QSVH264Context *s = avctx->priv_data;
-
- ff_qsv_decode_close(&s->qsv);
-
- qsv_clear_buffers(s);
-
- av_fifo_free(s->packet_fifo);
-
- av_bitstream_filter_close(s->bsf);
- av_parser_close(s->parser);
- avcodec_free_context(&s->avctx_internal);
-
- return 0;
-}
-
-static av_cold int qsv_decode_init(AVCodecContext *avctx)
-{
- QSVH264Context *s = avctx->priv_data;
- int ret;
-
- s->orig_pix_fmt = AV_PIX_FMT_NONE;
-
- s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
- if (!s->packet_fifo) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- s->bsf = av_bitstream_filter_init("h264_mp4toannexb");
- if (!s->bsf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- s->avctx_internal = avcodec_alloc_context3(NULL);
- if (!s->avctx_internal) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- if (avctx->extradata) {
- s->avctx_internal->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!s->avctx_internal->extradata) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- memcpy(s->avctx_internal->extradata, avctx->extradata,
- avctx->extradata_size);
- s->avctx_internal->extradata_size = avctx->extradata_size;
- }
-
- s->parser = av_parser_init(AV_CODEC_ID_H264);
- if (!s->parser) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- s->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
-
- s->qsv.iopattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
-
- return 0;
-fail:
- qsv_decode_close(avctx);
- return ret;
-}
-
-static int qsv_process_data(AVCodecContext *avctx, AVFrame *frame,
- int *got_frame, AVPacket *pkt)
-{
- QSVH264Context *s = avctx->priv_data;
- uint8_t *dummy_data;
- int dummy_size;
- int ret;
-
- /* we assume the packets are already split properly and want
- * just the codec parameters here */
- av_parser_parse2(s->parser, s->avctx_internal,
- &dummy_data, &dummy_size,
- pkt->data, pkt->size, pkt->pts, pkt->dts,
- pkt->pos);
-
- /* TODO: flush delayed frames on reinit */
- if (s->parser->format != s->orig_pix_fmt ||
- s->parser->coded_width != avctx->coded_width ||
- s->parser->coded_height != avctx->coded_height) {
- mfxSession session = NULL;
-
- enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
- AV_PIX_FMT_NONE,
- AV_PIX_FMT_NONE };
- enum AVPixelFormat qsv_format;
-
- qsv_format = ff_qsv_map_pixfmt(s->parser->format);
- if (qsv_format < 0) {
- av_log(avctx, AV_LOG_ERROR,
- "Only 8-bit YUV420 streams are supported.\n");
- ret = AVERROR(ENOSYS);
- goto reinit_fail;
- }
-
- s->orig_pix_fmt = s->parser->format;
- avctx->pix_fmt = pix_fmts[1] = qsv_format;
- avctx->width = s->parser->width;
- avctx->height = s->parser->height;
- avctx->coded_width = s->parser->coded_width;
- avctx->coded_height = s->parser->coded_height;
- avctx->level = s->avctx_internal->level;
- avctx->profile = s->avctx_internal->profile;
-
- ret = ff_get_format(avctx, pix_fmts);
- if (ret < 0)
- goto reinit_fail;
-
- avctx->pix_fmt = ret;
-
- if (avctx->hwaccel_context) {
- AVQSVContext *user_ctx = avctx->hwaccel_context;
- session = user_ctx->session;
- s->qsv.iopattern = user_ctx->iopattern;
- s->qsv.ext_buffers = user_ctx->ext_buffers;
- s->qsv.nb_ext_buffers = user_ctx->nb_ext_buffers;
- }
-
- ret = ff_qsv_decode_init(avctx, &s->qsv, session);
- if (ret < 0)
- goto reinit_fail;
- }
-
- return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, &s->pkt_filtered);
-
-reinit_fail:
- s->orig_pix_fmt = s->parser->format = avctx->pix_fmt = AV_PIX_FMT_NONE;
- return ret;
-}
-
-static int qsv_decode_frame(AVCodecContext *avctx, void *data,
- int *got_frame, AVPacket *avpkt)
-{
- QSVH264Context *s = avctx->priv_data;
- AVFrame *frame = data;
- int ret;
-
- /* buffer the input packet */
- if (avpkt->size) {
- AVPacket input_ref = { 0 };
-
- if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) {
- ret = av_fifo_realloc2(s->packet_fifo,
- av_fifo_size(s->packet_fifo) + sizeof(input_ref));
- if (ret < 0)
- return ret;
- }
-
- ret = av_packet_ref(&input_ref, avpkt);
- if (ret < 0)
- return ret;
- av_fifo_generic_write(s->packet_fifo, &input_ref, sizeof(input_ref), NULL);
- }
-
- /* process buffered data */
- while (!*got_frame) {
- /* prepare the input data -- convert to Annex B if needed */
- if (s->pkt_filtered.size <= 0) {
- int size;
-
- /* no more data */
- if (av_fifo_size(s->packet_fifo) < sizeof(AVPacket))
- return avpkt->size ? avpkt->size : ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
-
- if (s->filtered_data != s->input_ref.data)
- av_freep(&s->filtered_data);
- s->filtered_data = NULL;
- av_packet_unref(&s->input_ref);
-
- av_fifo_generic_read(s->packet_fifo, &s->input_ref, sizeof(s->input_ref), NULL);
- ret = av_bitstream_filter_filter(s->bsf, avctx, NULL,
- &s->filtered_data, &size,
- s->input_ref.data, s->input_ref.size, 0);
- if (ret < 0) {
- s->filtered_data = s->input_ref.data;
- size = s->input_ref.size;
- }
- s->pkt_filtered = s->input_ref;
- s->pkt_filtered.data = s->filtered_data;
- s->pkt_filtered.size = size;
- }
-
- ret = qsv_process_data(avctx, frame, got_frame, &s->pkt_filtered);
- if (ret < 0)
- return ret;
-
- s->pkt_filtered.size -= ret;
- s->pkt_filtered.data += ret;
- }
-
- return avpkt->size;
-}
-
-static void qsv_decode_flush(AVCodecContext *avctx)
-{
- QSVH264Context *s = avctx->priv_data;
-
- qsv_clear_buffers(s);
- s->orig_pix_fmt = AV_PIX_FMT_NONE;
-}
-
-AVHWAccel ff_h264_qsv_hwaccel = {
- .name = "h264_qsv",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H264,
- .pix_fmt = AV_PIX_FMT_QSV,
-};
-
-#define OFFSET(x) offsetof(QSVH264Context, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
- { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
- { NULL },
-};
-
-static const AVClass class = {
- .class_name = "h264_qsv",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_h264_qsv_decoder = {
- .name = "h264_qsv",
- .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"),
- .priv_data_size = sizeof(QSVH264Context),
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_H264,
- .init = qsv_decode_init,
- .decode = qsv_decode_frame,
- .flush = qsv_decode_flush,
- .close = qsv_decode_close,
- .capabilities = CODEC_CAP_DELAY,
- .priv_class = &class,
-};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec_h2645.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec_h2645.c
new file mode 100644
index 00000000000..2d787225b10
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec_h2645.c
@@ -0,0 +1,222 @@
+/*
+ * Intel MediaSDK QSV based H.264 / HEVC decoder
+ *
+ * copyright (c) 2013 Luca Barbato
+ * copyright (c) 2015 Anton Khirnov
+ *
+ * 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 <string.h>
+
+#include <mfx/mfxvideo.h>
+
+#include "libavutil/common.h"
+#include "libavutil/fifo.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "internal.h"
+#include "qsvdec.h"
+
+enum LoadPlugin {
+ LOAD_PLUGIN_NONE,
+ LOAD_PLUGIN_HEVC_SW,
+};
+
+typedef struct QSVH2645Context {
+ AVClass *class;
+ QSVContext qsv;
+
+ int load_plugin;
+
+ // the filter for converting to Annex B
+ AVBitStreamFilterContext *bsf;
+
+} QSVH2645Context;
+
+static av_cold int qsv_decode_close(AVCodecContext *avctx)
+{
+ QSVH2645Context *s = avctx->priv_data;
+
+ ff_qsv_decode_close(&s->qsv);
+
+ av_bitstream_filter_close(s->bsf);
+
+ return 0;
+}
+
+static av_cold int qsv_decode_init(AVCodecContext *avctx)
+{
+ QSVH2645Context *s = avctx->priv_data;
+ int ret;
+
+ if (avctx->codec_id == AV_CODEC_ID_HEVC && s->load_plugin != LOAD_PLUGIN_NONE) {
+ static const char *uid_hevcenc_sw = "15dd936825ad475ea34e35f3f54217a6";
+
+ if (s->qsv.load_plugins[0]) {
+ av_log(avctx, AV_LOG_WARNING,
+ "load_plugins is not empty, but load_plugin is not set to 'none'."
+ "The load_plugin value will be ignored.\n");
+ } else {
+ av_freep(&s->qsv.load_plugins);
+ s->qsv.load_plugins = av_strdup(uid_hevcenc_sw);
+ if (!s->qsv.load_plugins)
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ if (avctx->codec_id == AV_CODEC_ID_H264)
+ s->bsf = av_bitstream_filter_init("h264_mp4toannexb");
+ else
+ s->bsf = av_bitstream_filter_init("hevc_mp4toannexb");
+ if (!s->bsf) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ return 0;
+fail:
+ qsv_decode_close(avctx);
+ return ret;
+}
+
+static int qsv_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ QSVH2645Context *s = avctx->priv_data;
+ AVFrame *frame = data;
+ int ret;
+ uint8_t *p_filtered = NULL;
+ int n_filtered = NULL;
+ AVPacket pkt_filtered = { 0 };
+
+ if (avpkt->size) {
+ if (avpkt->size > 3 && !avpkt->data[0] &&
+ !avpkt->data[1] && !avpkt->data[2] && 1==avpkt->data[3]) {
+ /* we already have annex-b prefix */
+ return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
+
+ } else {
+ /* no annex-b prefix. try to restore: */
+ ret = av_bitstream_filter_filter(s->bsf, avctx, "private_spspps_buf",
+ &p_filtered, &n_filtered,
+ avpkt->data, avpkt->size, 0);
+ if (ret>=0) {
+ pkt_filtered.pts = avpkt->pts;
+ pkt_filtered.data = p_filtered;
+ pkt_filtered.size = n_filtered;
+
+ ret = ff_qsv_decode(avctx, &s->qsv, frame, got_frame, &pkt_filtered);
+
+ if (p_filtered != avpkt->data)
+ av_free(p_filtered);
+ return ret > 0 ? avpkt->size : ret;
+ }
+ }
+ }
+
+ return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
+}
+
+static void qsv_decode_flush(AVCodecContext *avctx)
+{
+ QSVH2645Context *s = avctx->priv_data;
+ ff_qsv_decode_reset(avctx, &s->qsv);
+}
+
+#define OFFSET(x) offsetof(QSVH2645Context, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+
+#if CONFIG_HEVC_QSV_DECODER
+AVHWAccel ff_hevc_qsv_hwaccel = {
+ .name = "hevc_qsv",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .pix_fmt = AV_PIX_FMT_QSV,
+};
+
+static const AVOption hevc_options[] = {
+ { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
+
+ { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_SW }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_SW, VD, "load_plugin" },
+ { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VD, "load_plugin" },
+ { "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VD, "load_plugin" },
+
+ { "load_plugins", "A :-separate list of hexadecimal plugin UIDs to load in an internal session",
+ OFFSET(qsv.load_plugins), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD },
+ { NULL },
+};
+
+static const AVClass hevc_class = {
+ .class_name = "hevc_qsv",
+ .item_name = av_default_item_name,
+ .option = hevc_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_hevc_qsv_decoder = {
+ .name = "hevc_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("HEVC (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVH2645Context),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .init = qsv_decode_init,
+ .decode = qsv_decode_frame,
+ .flush = qsv_decode_flush,
+ .close = qsv_decode_close,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
+ .priv_class = &hevc_class,
+};
+#endif
+
+#if CONFIG_H264_QSV_DECODER
+AVHWAccel ff_h264_qsv_hwaccel = {
+ .name = "h264_qsv",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .pix_fmt = AV_PIX_FMT_QSV,
+};
+
+static const AVOption options[] = {
+ { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "h264_qsv",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_h264_qsv_decoder = {
+ .name = "h264_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVH2645Context),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .init = qsv_decode_init,
+ .decode = qsv_decode_frame,
+ .flush = qsv_decode_flush,
+ .close = qsv_decode_close,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
+ .priv_class = &class,
+};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec_mpeg2.c
new file mode 100644
index 00000000000..36fd3b07d24
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec_mpeg2.c
@@ -0,0 +1,97 @@
+/*
+ * Intel MediaSDK QSV based MPEG2 video decoder
+ *
+ * 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 <string.h>
+
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "qsvdec.h"
+
+typedef struct QSVMPEG2Context {
+ AVClass *class;
+ QSVContext qsv;
+} QSVMPEG2Context;
+
+static av_cold int qsv_decode_close(AVCodecContext *avctx)
+{
+ QSVMPEG2Context *s = avctx->priv_data;
+
+ ff_qsv_decode_close(&s->qsv);
+
+ return 0;
+}
+
+static av_cold int qsv_decode_init(AVCodecContext *avctx)
+{
+ return 0;
+}
+
+static int qsv_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ QSVMPEG2Context *s = avctx->priv_data;
+ AVFrame *frame = data;
+
+ return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
+}
+
+static void qsv_decode_flush(AVCodecContext *avctx)
+{
+ QSVMPEG2Context *s = avctx->priv_data;
+ ff_qsv_decode_reset(avctx, &s->qsv);
+}
+
+AVHWAccel ff_mpeg2_qsv_hwaccel = {
+ .name = "mpeg2_qsv",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .pix_fmt = AV_PIX_FMT_QSV,
+};
+
+#define OFFSET(x) offsetof(QSVMPEG2Context, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+ { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "mpeg2_qsv",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_mpeg2_qsv_decoder = {
+ .name = "mpeg2_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVMPEG2Context),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .init = qsv_decode_init,
+ .decode = qsv_decode_frame,
+ .flush = qsv_decode_flush,
+ .close = qsv_decode_close,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
+ .priv_class = &class,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec_vc1.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec_vc1.c
new file mode 100644
index 00000000000..3311d90f0f5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec_vc1.c
@@ -0,0 +1,94 @@
+/*
+ * Intel MediaSDK QSV based VC-1 video decoder
+ *
+ * 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 <string.h>
+
+#include "libavutil/common.h"
+#include "libavutil/fifo.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "qsvdec.h"
+
+typedef struct QSVVC1Context {
+ AVClass *class;
+ QSVContext qsv;
+} QSVVC1Context;
+
+
+static av_cold int qsv_decode_close(AVCodecContext *avctx)
+{
+ QSVVC1Context *s = avctx->priv_data;
+
+ ff_qsv_decode_close(&s->qsv);
+
+ return 0;
+}
+
+static int qsv_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame, AVPacket *avpkt)
+{
+ QSVVC1Context *s = avctx->priv_data;
+ AVFrame *frame = data;
+
+ return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
+}
+
+static void qsv_decode_flush(AVCodecContext *avctx)
+{
+ QSVVC1Context *s = avctx->priv_data;
+ ff_qsv_decode_reset(avctx, &s->qsv);
+}
+
+AVHWAccel ff_vc1_qsv_hwaccel = {
+ .name = "vc1_qsv",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VC1,
+ .pix_fmt = AV_PIX_FMT_QSV,
+};
+
+#define OFFSET(x) offsetof(QSVVC1Context, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+ { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "vc1_qsv",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_vc1_qsv_decoder = {
+ .name = "vc1_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("VC-1 video (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVVC1Context),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VC1,
+ .init = NULL,
+ .decode = qsv_decode_frame,
+ .flush = qsv_decode_flush,
+ .close = qsv_decode_close,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .priv_class = &class,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc.c b/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
index bcf3d73c589..1aeab03d04d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
@@ -49,6 +49,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
return AVERROR_BUG;
q->param.mfx.CodecId = ret;
+ q->width_align = avctx->codec_id == AV_CODEC_ID_HEVC ? 32 : 16;
+
if (avctx->level > 0)
q->param.mfx.CodecLevel = avctx->level;
@@ -56,7 +58,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
q->param.mfx.TargetUsage = q->preset;
q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size);
q->param.mfx.GopRefDist = FFMAX(-1, avctx->max_b_frames) + 1;
- q->param.mfx.GopOptFlag = avctx->flags & CODEC_FLAG_CLOSED_GOP ?
+ q->param.mfx.GopOptFlag = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ?
MFX_GOP_CLOSED : 0;
q->param.mfx.IdrInterval = q->idr_interval;
q->param.mfx.NumSlice = avctx->slices;
@@ -65,18 +67,30 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
q->param.mfx.BufferSizeInKB = 0;
q->param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
- q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, 16);
- q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 32);
q->param.mfx.FrameInfo.CropX = 0;
q->param.mfx.FrameInfo.CropY = 0;
q->param.mfx.FrameInfo.CropW = avctx->width;
q->param.mfx.FrameInfo.CropH = avctx->height;
q->param.mfx.FrameInfo.AspectRatioW = avctx->sample_aspect_ratio.num;
q->param.mfx.FrameInfo.AspectRatioH = avctx->sample_aspect_ratio.den;
- q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
q->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
q->param.mfx.FrameInfo.BitDepthLuma = 8;
q->param.mfx.FrameInfo.BitDepthChroma = 8;
+ q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
+
+ if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
+ /* A true field layout (TFF or BFF) is not important here,
+ it will specified later during frame encoding. But it is important
+ to specify is frame progressive or not because allowed heigh alignment
+ does depend by this.
+ */
+ q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
+ q->height_align = 32;
+ } else {
+ q->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
+ q->height_align = 16;
+ }
+ q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, q->height_align);
if (avctx->framerate.den > 0 && avctx->framerate.num > 0) {
q->param.mfx.FrameInfo.FrameRateExtN = avctx->framerate.num;
@@ -86,15 +100,23 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
q->param.mfx.FrameInfo.FrameRateExtD = avctx->time_base.num;
}
- if (avctx->flags & CODEC_FLAG_QSCALE) {
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
q->param.mfx.RateControlMethod = MFX_RATECONTROL_CQP;
ratecontrol_desc = "constant quantization parameter (CQP)";
} else if (avctx->rc_max_rate == avctx->bit_rate) {
q->param.mfx.RateControlMethod = MFX_RATECONTROL_CBR;
ratecontrol_desc = "constant bitrate (CBR)";
} else if (!avctx->rc_max_rate) {
- q->param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
- ratecontrol_desc = "average variable bitrate (AVBR)";
+#if QSV_VERSION_ATLEAST(1,7)
+ if (q->look_ahead) {
+ q->param.mfx.RateControlMethod = MFX_RATECONTROL_LA;
+ ratecontrol_desc = "lookahead (LA)";
+ } else
+#endif
+ {
+ q->param.mfx.RateControlMethod = MFX_RATECONTROL_AVBR;
+ ratecontrol_desc = "average variable bitrate (AVBR)";
+ }
} else {
q->param.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
ratecontrol_desc = "variable bitrate (VBR)";
@@ -107,7 +129,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
case MFX_RATECONTROL_VBR:
q->param.mfx.InitialDelayInKB = avctx->rc_initial_buffer_occupancy / 1000;
q->param.mfx.TargetKbps = avctx->bit_rate / 1000;
- q->param.mfx.MaxKbps = avctx->bit_rate / 1000;
+ q->param.mfx.MaxKbps = avctx->rc_max_rate / 1000;
break;
case MFX_RATECONTROL_CQP:
quant = avctx->global_quality / FF_QP2LAMBDA;
@@ -118,21 +140,47 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
break;
case MFX_RATECONTROL_AVBR:
+#if QSV_VERSION_ATLEAST(1,7)
+ case MFX_RATECONTROL_LA:
+#endif
q->param.mfx.TargetKbps = avctx->bit_rate / 1000;
q->param.mfx.Convergence = q->avbr_convergence;
q->param.mfx.Accuracy = q->avbr_accuracy;
break;
}
- q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
- q->extco.Header.BufferSz = sizeof(q->extco);
- q->extco.CAVLC = avctx->coder_type == FF_CODER_TYPE_VLC ?
- MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
-
- q->extparam[0] = (mfxExtBuffer *)&q->extco;
-
- q->param.ExtParam = q->extparam;
- q->param.NumExtParam = FF_ARRAY_ELEMS(q->extparam);
+ // the HEVC encoder plugin currently fails if coding options
+ // are provided
+ if (avctx->codec_id != AV_CODEC_ID_HEVC) {
+ q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
+ q->extco.Header.BufferSz = sizeof(q->extco);
+ q->extco.CAVLC = avctx->coder_type == FF_CODER_TYPE_VLC ?
+ MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
+
+ q->extco.PicTimingSEI = q->pic_timing_sei ?
+ MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
+
+ q->extparam[0] = (mfxExtBuffer *)&q->extco;
+
+#if QSV_VERSION_ATLEAST(1,6)
+ q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
+ q->extco2.Header.BufferSz = sizeof(q->extco2);
+
+#if QSV_VERSION_ATLEAST(1,7)
+ // valid value range is from 10 to 100 inclusive
+ // to instruct the encoder to use the default value this should be set to zero
+ q->extco2.LookAheadDepth = q->look_ahead_depth != 0 ? FFMAX(10, q->look_ahead_depth) : 0;
+#endif
+#if QSV_VERSION_ATLEAST(1,8)
+ q->extco2.LookAheadDS = q->look_ahead_downsampling;
+#endif
+
+ q->extparam[1] = (mfxExtBuffer *)&q->extco2;
+
+#endif
+ q->param.ExtParam = q->extparam;
+ q->param.NumExtParam = FF_ARRAY_ELEMS(q->extparam);
+ }
return 0;
}
@@ -153,6 +201,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
(mfxExtBuffer*)&extradata,
};
+ int need_pps = avctx->codec_id != AV_CODEC_ID_MPEG2VIDEO;
int ret;
q->param.ExtParam = ext_buffers;
@@ -164,20 +213,21 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
q->packet_size = q->param.mfx.BufferSizeInKB * 1000;
- if (!extradata.SPSBufSize || !extradata.PPSBufSize) {
+ if (!extradata.SPSBufSize || (need_pps && !extradata.PPSBufSize)) {
av_log(avctx, AV_LOG_ERROR, "No extradata returned from libmfx.\n");
return AVERROR_UNKNOWN;
}
- avctx->extradata = av_malloc(extradata.SPSBufSize + extradata.PPSBufSize +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(extradata.SPSBufSize + need_pps * extradata.PPSBufSize +
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
memcpy(avctx->extradata, sps_buf, extradata.SPSBufSize);
- memcpy(avctx->extradata + extradata.SPSBufSize, pps_buf, extradata.PPSBufSize);
- avctx->extradata_size = extradata.SPSBufSize + extradata.PPSBufSize;
- memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ if (need_pps)
+ memcpy(avctx->extradata + extradata.SPSBufSize, pps_buf, extradata.PPSBufSize);
+ avctx->extradata_size = extradata.SPSBufSize + need_pps * extradata.PPSBufSize;
+ memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
return 0;
}
@@ -189,6 +239,11 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
q->param.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
q->param.AsyncDepth = q->async_depth;
+ q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
+ (sizeof(AVPacket) + sizeof(mfxSyncPoint) + sizeof(mfxBitstream*)));
+ if (!q->async_fifo)
+ return AVERROR(ENOMEM);
+
if (avctx->hwaccel_context) {
AVQSVContext *qsv = avctx->hwaccel_context;
@@ -197,11 +252,12 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
}
if (!q->session) {
- ret = ff_qsv_init_internal_session(avctx, &q->internal_session);
+ ret = ff_qsv_init_internal_session(avctx, &q->internal_qs,
+ q->load_plugins);
if (ret < 0)
return ret;
- q->session = q->internal_session;
+ q->session = q->internal_qs.session;
}
ret = init_video_param(avctx, q);
@@ -215,7 +271,9 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
}
ret = MFXVideoENCODE_Init(q->session, &q->param);
- if (ret < 0) {
+ if (MFX_WRN_PARTIAL_ACCELERATION==ret) {
+ av_log(avctx, AV_LOG_WARNING, "Encoder will work with partial HW acceleration\n");
+ } else if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error initializing the encoder\n");
return ff_qsv_error(ret);
}
@@ -226,10 +284,6 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
return ret;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
q->avctx = avctx;
return 0;
@@ -301,9 +355,10 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
}
/* make a copy if the input is not padded as libmfx requires */
- if (frame->height & 31 || frame->linesize[0] & 15) {
- qf->frame->height = FFALIGN(frame->height, 32);
- qf->frame->width = FFALIGN(frame->width, 16);
+ if ( frame->height & (q->height_align - 1) ||
+ frame->linesize[0] & (q->width_align - 1)) {
+ qf->frame->height = FFALIGN(frame->height, q->height_align);
+ qf->frame->width = FFALIGN(frame->width, q->width_align);
ret = ff_get_buffer(q->avctx, qf->frame, AV_GET_BUFFER_FLAG_REF);
if (ret < 0)
@@ -362,7 +417,8 @@ static void print_interlace_msg(AVCodecContext *avctx, QSVEncContext *q)
int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
AVPacket *pkt, const AVFrame *frame, int *got_packet)
{
- mfxBitstream bs = { { { 0 } } };
+ AVPacket new_pkt = { 0 };
+ mfxBitstream *bs;
mfxFrameSurface1 *surf = NULL;
mfxSyncPoint sync = NULL;
@@ -376,43 +432,100 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
}
}
- ret = ff_alloc_packet(pkt, q->packet_size);
+ ret = av_new_packet(&new_pkt, q->packet_size);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error allocating the output packet\n");
return ret;
}
- bs.Data = pkt->data;
- bs.MaxLength = pkt->size;
- do {
- ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, &bs, &sync);
- if (ret == MFX_WRN_DEVICE_BUSY)
- av_usleep(1);
- } while (ret > 0);
+ bs = av_mallocz(sizeof(*bs));
+ if (!bs) {
+ av_packet_unref(&new_pkt);
+ return AVERROR(ENOMEM);
+ }
+ bs->Data = new_pkt.data;
+ bs->MaxLength = new_pkt.size;
- if (ret < 0)
- return (ret == MFX_ERR_MORE_DATA) ? 0 : ff_qsv_error(ret);
+ do {
+ ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, &sync);
+ if (ret == MFX_WRN_DEVICE_BUSY) {
+ av_usleep(500);
+ continue;
+ }
+ break;
+ } while ( 1 );
- if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame->interlaced_frame)
- print_interlace_msg(avctx, q);
+ if (ret < 0) {
+ av_packet_unref(&new_pkt);
+ av_freep(&bs);
+ if (ret == MFX_ERR_MORE_DATA)
+ return 0;
+ av_log(avctx, AV_LOG_ERROR, "EncodeFrameAsync returned %d\n", ret);
+ return ff_qsv_error(ret);
+ }
+ if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM) {
+ if (frame->interlaced_frame)
+ print_interlace_msg(avctx, q);
+ else
+ av_log(avctx, AV_LOG_WARNING,
+ "EncodeFrameAsync returned 'incompatible param' code\n");
+ }
if (sync) {
+ av_fifo_generic_write(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL);
+ av_fifo_generic_write(q->async_fifo, &sync, sizeof(sync), NULL);
+ av_fifo_generic_write(q->async_fifo, &bs, sizeof(bs), NULL);
+ } else {
+ av_packet_unref(&new_pkt);
+ av_freep(&bs);
+ }
+
+ if (!av_fifo_space(q->async_fifo) ||
+ (!frame && av_fifo_size(q->async_fifo))) {
+ av_fifo_generic_read(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL);
+ av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
+ av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL);
+
MFXVideoCORE_SyncOperation(q->session, sync, 60000);
- if (bs.FrameType & MFX_FRAMETYPE_I || bs.FrameType & MFX_FRAMETYPE_xI)
+ new_pkt.dts = av_rescale_q(bs->DecodeTimeStamp, (AVRational){1, 90000}, avctx->time_base);
+ new_pkt.pts = av_rescale_q(bs->TimeStamp, (AVRational){1, 90000}, avctx->time_base);
+ new_pkt.size = bs->DataLength;
+
+ if (bs->FrameType & MFX_FRAMETYPE_IDR ||
+ bs->FrameType & MFX_FRAMETYPE_xIDR)
+ new_pkt.flags |= AV_PKT_FLAG_KEY;
+
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType & MFX_FRAMETYPE_xI)
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
- else if (bs.FrameType & MFX_FRAMETYPE_P || bs.FrameType & MFX_FRAMETYPE_xP)
+ else if (bs->FrameType & MFX_FRAMETYPE_P || bs->FrameType & MFX_FRAMETYPE_xP)
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
- else if (bs.FrameType & MFX_FRAMETYPE_B || bs.FrameType & MFX_FRAMETYPE_xB)
+ else if (bs->FrameType & MFX_FRAMETYPE_B || bs->FrameType & MFX_FRAMETYPE_xB)
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ av_freep(&bs);
+
+ if (pkt->data) {
+ if (pkt->size < new_pkt.size) {
+ av_log(avctx, AV_LOG_ERROR, "Submitted buffer not large enough: %d < %d\n",
+ pkt->size, new_pkt.size);
+ av_packet_unref(&new_pkt);
+ return AVERROR(EINVAL);
+ }
- pkt->dts = av_rescale_q(bs.DecodeTimeStamp, (AVRational){1, 90000}, avctx->time_base);
- pkt->pts = av_rescale_q(bs.TimeStamp, (AVRational){1, 90000}, avctx->time_base);
- pkt->size = bs.DataLength;
+ memcpy(pkt->data, new_pkt.data, new_pkt.size);
+ pkt->size = new_pkt.size;
- if (bs.FrameType & MFX_FRAMETYPE_IDR ||
- bs.FrameType & MFX_FRAMETYPE_xIDR)
- pkt->flags |= AV_PKT_FLAG_KEY;
+ ret = av_packet_copy_props(pkt, &new_pkt);
+ av_packet_unref(&new_pkt);
+ if (ret < 0)
+ return ret;
+ } else
+ *pkt = new_pkt;
*got_packet = 1;
}
@@ -425,10 +538,9 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
QSVFrame *cur;
MFXVideoENCODE_Close(q->session);
- if (q->internal_session)
- MFXClose(q->internal_session);
- q->session = NULL;
- q->internal_session = NULL;
+ q->session = NULL;
+
+ ff_qsv_close_internal_session(&q->internal_qs);
cur = q->work_frames;
while (cur) {
@@ -438,7 +550,20 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
cur = q->work_frames;
}
- av_frame_free(&avctx->coded_frame);
+ while (q->async_fifo && av_fifo_size(q->async_fifo)) {
+ AVPacket pkt;
+ mfxSyncPoint sync;
+ mfxBitstream *bs;
+
+ av_fifo_generic_read(q->async_fifo, &pkt, sizeof(pkt), NULL);
+ av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
+ av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL);
+
+ av_freep(&bs);
+ av_packet_unref(&pkt);
+ }
+ av_fifo_free(q->async_fifo);
+ q->async_fifo = NULL;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc.h b/chromium/third_party/ffmpeg/libavcodec/qsvenc.h
index 9f7f8ccfa5b..2a21f8217d1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc.h
@@ -29,6 +29,7 @@
#include <mfx/mfxvideo.h>
#include "libavutil/avutil.h"
+#include "libavutil/fifo.h"
#include "avcodec.h"
#include "qsv_internal.h"
@@ -39,15 +40,24 @@ typedef struct QSVEncContext {
QSVFrame *work_frames;
mfxSession session;
- mfxSession internal_session;
+ QSVSession internal_qs;
int packet_size;
+ int width_align;
+ int height_align;
mfxVideoParam param;
mfxFrameAllocRequest req;
mfxExtCodingOption extco;
+#if QSV_VERSION_ATLEAST(1,6)
+ mfxExtCodingOption2 extco2;
+ mfxExtBuffer *extparam[2];
+#else
mfxExtBuffer *extparam[1];
+#endif
+
+ AVFifoBuffer *async_fifo;
// options set by the caller
int async_depth;
@@ -56,6 +66,12 @@ typedef struct QSVEncContext {
int preset;
int avbr_accuracy;
int avbr_convergence;
+ int pic_timing_sei;
+ int look_ahead;
+ int look_ahead_depth;
+ int look_ahead_downsampling;
+
+ char *load_plugins;
} QSVEncContext;
int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q);
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc_h264.c b/chromium/third_party/ffmpeg/libavcodec/qsvenc_h264.c
index d0b9b03f2e4..b569efe7ada 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvenc_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc_h264.c
@@ -69,6 +69,19 @@ static const AVOption options[] = {
{ "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "avbr_convergence", "Convergence of the AVBR ratecontrol", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "pic_timing_sei", "Insert picture timing SEI with pic_struct_syntax element", OFFSET(qsv.pic_timing_sei), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+
+#if QSV_VERSION_ATLEAST(1,7)
+ { "look_ahead", "Use VBR algorithm with look ahead", OFFSET(qsv.look_ahead), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+ { "look_ahead_depth", "Depth of look ahead in number frames", OFFSET(qsv.look_ahead_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, VE },
+#endif
+
+#if QSV_VERSION_ATLEAST(1,8)
+ { "look_ahead_downsampling", NULL, OFFSET(qsv.look_ahead_downsampling), AV_OPT_TYPE_INT, { .i64 = MFX_LOOKAHEAD_DS_UNKNOWN }, MFX_LOOKAHEAD_DS_UNKNOWN, MFX_LOOKAHEAD_DS_2x, VE, "look_ahead_downsampling" },
+ { "unknown" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_UNKNOWN }, INT_MIN, INT_MAX, VE, "look_ahead_downsampling" },
+ { "off" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_OFF }, INT_MIN, INT_MAX, VE, "look_ahead_downsampling" },
+ { "2x" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_2x }, INT_MIN, INT_MAX, VE, "look_ahead_downsampling" },
+#endif
{ "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" },
{ "unknown" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
@@ -76,10 +89,14 @@ static const AVOption options[] = {
{ "main" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
{ "high" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
- { "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, 0, 7, VE, "preset" },
- { "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" },
- { "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, "preset" },
- { "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" },
+ { "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, MFX_TARGETUSAGE_BEST_QUALITY, MFX_TARGETUSAGE_BEST_SPEED, VE, "preset" },
+ { "veryfast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "faster", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_6 }, INT_MIN, INT_MAX, VE, "preset" },
+ { "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_5 }, INT_MIN, INT_MAX, VE, "preset" },
+ { "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_3 }, INT_MIN, INT_MAX, VE, "preset" },
+ { "slower", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_2 }, INT_MIN, INT_MAX, VE, "preset" },
+ { "veryslow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" },
{ NULL },
};
@@ -112,7 +129,7 @@ AVCodec ff_h264_qsv_encoder = {
.init = qsv_enc_init,
.encode2 = qsv_enc_frame,
.close = qsv_enc_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc_hevc.c b/chromium/third_party/ffmpeg/libavcodec/qsvenc_hevc.c
new file mode 100644
index 00000000000..d1f1b172c3e
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc_hevc.c
@@ -0,0 +1,272 @@
+/*
+ * Intel MediaSDK QSV based HEVC encoder
+ *
+ * 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 <sys/types.h>
+
+#include <mfx/mfxvideo.h>
+
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "bytestream.h"
+#include "get_bits.h"
+#include "hevc.h"
+#include "internal.h"
+#include "qsv.h"
+#include "qsv_internal.h"
+#include "qsvenc.h"
+
+enum LoadPlugin {
+ LOAD_PLUGIN_NONE,
+ LOAD_PLUGIN_HEVC_SW,
+ LOAD_PLUGIN_HEVC_HW,
+};
+
+typedef struct QSVHEVCEncContext {
+ AVClass *class;
+ QSVEncContext qsv;
+ int load_plugin;
+} QSVHEVCEncContext;
+
+static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx)
+{
+ GetByteContext gbc;
+ PutByteContext pbc;
+
+ GetBitContext gb;
+ HEVCNAL sps_nal = { NULL };
+ HEVCSPS sps = { 0 };
+ HEVCVPS vps = { 0 };
+ uint8_t vps_buf[128], vps_rbsp_buf[128];
+ uint8_t *new_extradata;
+ unsigned int sps_id;
+ int ret, i, type, vps_size;
+
+ if (!avctx->extradata_size) {
+ av_log(avctx, AV_LOG_ERROR, "No extradata returned from libmfx\n");
+ return AVERROR_UNKNOWN;
+ }
+
+ /* parse the SPS */
+ ret = ff_hevc_extract_rbsp(NULL, avctx->extradata + 4, avctx->extradata_size - 4, &sps_nal);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error unescaping the SPS buffer\n");
+ return ret;
+ }
+
+ ret = init_get_bits8(&gb, sps_nal.data, sps_nal.size);
+ if (ret < 0) {
+ av_freep(&sps_nal.rbsp_buffer);
+ return ret;
+ }
+
+ get_bits(&gb, 1);
+ type = get_bits(&gb, 6);
+ if (type != NAL_SPS) {
+ av_log(avctx, AV_LOG_ERROR, "Unexpected NAL type in the extradata: %d\n",
+ type);
+ av_freep(&sps_nal.rbsp_buffer);
+ return AVERROR_INVALIDDATA;
+ }
+ get_bits(&gb, 9);
+
+ ret = ff_hevc_parse_sps(&sps, &gb, &sps_id, 0, NULL, avctx);
+ av_freep(&sps_nal.rbsp_buffer);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error parsing the SPS\n");
+ return ret;
+ }
+
+ /* generate the VPS */
+ vps.vps_max_layers = 1;
+ vps.vps_max_sub_layers = sps.max_sub_layers;
+ memcpy(&vps.ptl, &sps.ptl, sizeof(vps.ptl));
+ vps.vps_sub_layer_ordering_info_present_flag = 1;
+ for (i = 0; i < MAX_SUB_LAYERS; i++) {
+ vps.vps_max_dec_pic_buffering[i] = sps.temporal_layer[i].max_dec_pic_buffering;
+ vps.vps_num_reorder_pics[i] = sps.temporal_layer[i].num_reorder_pics;
+ vps.vps_max_latency_increase[i] = sps.temporal_layer[i].max_latency_increase;
+ }
+
+ vps.vps_num_layer_sets = 1;
+ vps.vps_timing_info_present_flag = sps.vui.vui_timing_info_present_flag;
+ vps.vps_num_units_in_tick = sps.vui.vui_num_units_in_tick;
+ vps.vps_time_scale = sps.vui.vui_time_scale;
+ vps.vps_poc_proportional_to_timing_flag = sps.vui.vui_poc_proportional_to_timing_flag;
+ vps.vps_num_ticks_poc_diff_one = sps.vui.vui_num_ticks_poc_diff_one_minus1 + 1;
+
+ /* generate the encoded RBSP form of the VPS */
+ ret = ff_hevc_encode_nal_vps(&vps, sps.vps_id, vps_rbsp_buf, sizeof(vps_rbsp_buf));
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error writing the VPS\n");
+ return ret;
+ }
+
+ /* escape and add the startcode */
+ bytestream2_init(&gbc, vps_rbsp_buf, ret);
+ bytestream2_init_writer(&pbc, vps_buf, sizeof(vps_buf));
+
+ bytestream2_put_be32(&pbc, 1); // startcode
+ bytestream2_put_byte(&pbc, NAL_VPS << 1); // NAL
+ bytestream2_put_byte(&pbc, 1); // header
+
+ while (bytestream2_get_bytes_left(&gbc)) {
+ uint32_t b = bytestream2_peek_be24(&gbc);
+ if (b <= 3) {
+ bytestream2_put_be24(&pbc, 3);
+ bytestream2_skip(&gbc, 2);
+ } else
+ bytestream2_put_byte(&pbc, bytestream2_get_byte(&gbc));
+ }
+
+ vps_size = bytestream2_tell_p(&pbc);
+ new_extradata = av_mallocz(vps_size + avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!new_extradata)
+ return AVERROR(ENOMEM);
+ memcpy(new_extradata, vps_buf, vps_size);
+ memcpy(new_extradata + vps_size, avctx->extradata, avctx->extradata_size);
+
+ av_freep(&avctx->extradata);
+ avctx->extradata = new_extradata;
+ avctx->extradata_size += vps_size;
+
+ return 0;
+}
+
+static av_cold int qsv_enc_init(AVCodecContext *avctx)
+{
+ QSVHEVCEncContext *q = avctx->priv_data;
+ int ret;
+
+ if (q->load_plugin != LOAD_PLUGIN_NONE) {
+ static const char *uid_hevcenc_sw = "2fca99749fdb49aeb121a5b63ef568f7";
+ static const char *uid_hevcenc_hw = "6fadc791a0c2eb479ab6dcd5ea9da347";
+
+ if (q->qsv.load_plugins[0]) {
+ av_log(avctx, AV_LOG_WARNING,
+ "load_plugins is not empty, but load_plugin is not set to 'none'."
+ "The load_plugin value will be ignored.\n");
+ } else {
+ av_freep(&q->qsv.load_plugins);
+
+ if (q->load_plugin == LOAD_PLUGIN_HEVC_SW)
+ q->qsv.load_plugins = av_strdup(uid_hevcenc_sw);
+ else
+ q->qsv.load_plugins = av_strdup(uid_hevcenc_hw);
+
+ if (!q->qsv.load_plugins)
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ ret = ff_qsv_enc_init(avctx, &q->qsv);
+ if (ret < 0)
+ return ret;
+
+ ret = generate_fake_vps(&q->qsv, avctx);
+ if (ret < 0) {
+ ff_qsv_enc_close(avctx, &q->qsv);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int qsv_enc_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ QSVHEVCEncContext *q = avctx->priv_data;
+
+ return ff_qsv_encode(avctx, &q->qsv, pkt, frame, got_packet);
+}
+
+static av_cold int qsv_enc_close(AVCodecContext *avctx)
+{
+ QSVHEVCEncContext *q = avctx->priv_data;
+
+ return ff_qsv_enc_close(avctx, &q->qsv);
+}
+
+#define OFFSET(x) offsetof(QSVHEVCEncContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VE },
+ { "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "avbr_convergence", "Convergence of the AVBR ratecontrol", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+
+ { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_SW }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VE, "load_plugin" },
+ { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VE, "load_plugin" },
+ { "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VE, "load_plugin" },
+ { "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VE, "load_plugin" },
+
+ { "load_plugins", "A :-separate list of hexadecimal plugin UIDs to load in an internal session",
+ OFFSET(qsv.load_plugins), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VE },
+
+ { "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" },
+ { "unknown", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main10", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAIN10 }, INT_MIN, INT_MAX, VE, "profile" },
+ { "mainsp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAINSP }, INT_MIN, INT_MAX, VE, "profile" },
+
+ { "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, 0, 7, VE, "preset" },
+ { "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" },
+
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "hevc_qsv encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVCodecDefault qsv_enc_defaults[] = {
+ { "b", "1M" },
+ { "refs", "0" },
+ // same as the x264 default
+ { "g", "250" },
+ { "bf", "3" },
+
+ { "flags", "+cgop" },
+ { NULL },
+};
+
+AVCodec ff_hevc_qsv_encoder = {
+ .name = "hevc_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("HEVC (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVHEVCEncContext),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .init = qsv_enc_init,
+ .encode2 = qsv_enc_frame,
+ .close = qsv_enc_close,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_QSV,
+ AV_PIX_FMT_NONE },
+ .priv_class = &class,
+ .defaults = qsv_enc_defaults,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/qsvenc_mpeg2.c
new file mode 100644
index 00000000000..6b28bfd1abb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc_mpeg2.c
@@ -0,0 +1,117 @@
+/*
+ * Intel MediaSDK QSV based MPEG-2 encoder
+ *
+ * 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 <sys/types.h>
+
+#include <mfx/mfxvideo.h>
+
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "avcodec.h"
+#include "internal.h"
+#include "qsv.h"
+#include "qsv_internal.h"
+#include "qsvenc.h"
+
+typedef struct QSVMpeg2EncContext {
+ AVClass *class;
+ QSVEncContext qsv;
+} QSVMpeg2EncContext;
+
+static av_cold int qsv_enc_init(AVCodecContext *avctx)
+{
+ QSVMpeg2EncContext *q = avctx->priv_data;
+
+ return ff_qsv_enc_init(avctx, &q->qsv);
+}
+
+static int qsv_enc_frame(AVCodecContext *avctx, AVPacket *pkt,
+ const AVFrame *frame, int *got_packet)
+{
+ QSVMpeg2EncContext *q = avctx->priv_data;
+
+ return ff_qsv_encode(avctx, &q->qsv, pkt, frame, got_packet);
+}
+
+static av_cold int qsv_enc_close(AVCodecContext *avctx)
+{
+ QSVMpeg2EncContext *q = avctx->priv_data;
+
+ return ff_qsv_enc_close(avctx, &q->qsv);
+}
+
+#define OFFSET(x) offsetof(QSVMpeg2EncContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VE },
+ { "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "avbr_convergence", "Convergence of the AVBR ratecontrol", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+
+ { "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" },
+ { "unknown", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "simple", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_MPEG2_SIMPLE }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_MPEG2_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_MPEG2_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
+
+ { "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, 0, 7, VE, "preset" },
+ { "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, "preset" },
+ { "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" },
+
+ { NULL },
+};
+
+static const AVClass class = {
+ .class_name = "mpeg2_qsv encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+static const AVCodecDefault qsv_enc_defaults[] = {
+ { "b", "1M" },
+ { "refs", "0" },
+ // same as the x264 default
+ { "g", "250" },
+ { "bf", "3" },
+
+ { "flags", "+cgop" },
+ { NULL },
+};
+
+AVCodec ff_mpeg2_qsv_encoder = {
+ .name = "mpeg2_qsv",
+ .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick Sync Video acceleration)"),
+ .priv_data_size = sizeof(QSVMpeg2EncContext),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .init = qsv_enc_init,
+ .encode2 = qsv_enc_frame,
+ .close = qsv_enc_close,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_QSV,
+ AV_PIX_FMT_NONE },
+ .priv_class = &class,
+ .defaults = qsv_enc_defaults,
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qtrle.c b/chromium/third_party/ffmpeg/libavcodec/qtrle.c
index b3676437826..1fcf5b3c79e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qtrle.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qtrle.c
@@ -523,5 +523,5 @@ AVCodec ff_qtrle_decoder = {
.init = qtrle_decode_init,
.close = qtrle_decode_end,
.decode = qtrle_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c b/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
index d723188413a..590c39dceab 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qtrleenc.c
@@ -58,14 +58,15 @@ typedef struct QtrleEncContext {
* Will contain at ith position the number of consecutive pixels equal to the previous
* frame starting from pixel i */
uint8_t* skip_table;
+
+ /** Encoded frame is a key frame */
+ int key_frame;
} QtrleEncContext;
static av_cold int qtrle_encode_end(AVCodecContext *avctx)
{
QtrleEncContext *s = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
-
avpicture_free(&s->previous_frame);
av_free(s->rlecode_table);
av_free(s->length_table);
@@ -125,12 +126,6 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
+ s->avctx->height*2 /* skip code+rle end */
+ s->logical_width/MAX_RLE_BULK + 1 /* rle codes */;
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- qtrle_encode_end(avctx);
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -219,7 +214,7 @@ static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, ui
}
}
- if (!s->avctx->coded_frame->key_frame && !memcmp(this_line, prev_line, s->pixel_size))
+ if (!s->key_frame && !memcmp(this_line, prev_line, s->pixel_size))
skipcount = FFMIN(skipcount + 1, MAX_RLE_SKIP);
else
skipcount = 0;
@@ -330,7 +325,7 @@ static int encode_frame(QtrleEncContext *s, const AVFrame *p, uint8_t *buf)
int end_line = s->avctx->height;
uint8_t *orig_buf = buf;
- if (!s->avctx->coded_frame->key_frame) {
+ if (!s->key_frame) {
unsigned line_size = s->logical_width * s->pixel_size;
for (start_line = 0; start_line < s->avctx->height; start_line++)
if (memcmp(p->data[0] + start_line*p->linesize[0],
@@ -368,20 +363,20 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
QtrleEncContext * const s = avctx->priv_data;
- AVFrame * const p = avctx->coded_frame;
+ enum AVPictureType pict_type;
int ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size, 0)) < 0)
return ret;
if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
/* I-Frame */
- p->pict_type = AV_PICTURE_TYPE_I;
- p->key_frame = 1;
+ pict_type = AV_PICTURE_TYPE_I;
+ s->key_frame = 1;
} else {
/* P-Frame */
- p->pict_type = AV_PICTURE_TYPE_P;
- p->key_frame = 0;
+ pict_type = AV_PICTURE_TYPE_P;
+ s->key_frame = 0;
}
pkt->size = encode_frame(s, pict, pkt->data);
@@ -390,7 +385,14 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
av_picture_copy(&s->previous_frame, (const AVPicture *)pict,
avctx->pix_fmt, avctx->width, avctx->height);
- if (p->key_frame)
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->key_frame = s->key_frame;
+ avctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ if (s->key_frame)
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/r210dec.c b/chromium/third_party/ffmpeg/libavcodec/r210dec.c
index fc9e7e5ce58..9c868cd11cd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/r210dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/r210dec.c
@@ -103,7 +103,7 @@ AVCodec ff_r210_decoder = {
.id = AV_CODEC_ID_R210,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_R10K_DECODER
@@ -114,7 +114,7 @@ AVCodec ff_r10k_decoder = {
.id = AV_CODEC_ID_R10K,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_AVRP_DECODER
@@ -125,6 +125,6 @@ AVCodec ff_avrp_decoder = {
.id = AV_CODEC_ID_AVRP,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/r210enc.c b/chromium/third_party/ffmpeg/libavcodec/r210enc.c
index b7d5a07deb5..65b3c069fcb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/r210enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/r210enc.c
@@ -24,16 +24,6 @@
#include "internal.h"
#include "bytestream.h"
-static av_cold int encode_init(AVCodecContext *avctx)
-{
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
- return 0;
-}
-
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic, int *got_packet)
{
@@ -44,11 +34,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *src_line;
uint8_t *dst;
- if ((ret = ff_alloc_packet2(avctx, pkt, 4 * aligned_width * avctx->height)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, 4 * aligned_width * avctx->height, 0)) < 0)
return ret;
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
src_line = pic->data[0];
dst = pkt->data;
@@ -78,12 +66,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
-
- return 0;
-}
#if CONFIG_R210_ENCODER
AVCodec ff_r210_encoder = {
@@ -91,10 +73,9 @@ AVCodec ff_r210_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_R210,
- .init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
#endif
#if CONFIG_R10K_ENCODER
@@ -103,10 +84,9 @@ AVCodec ff_r10k_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_R10K,
- .init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
#endif
#if CONFIG_AVRP_ENCODER
@@ -115,9 +95,8 @@ AVCodec ff_avrp_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_AVRP,
- .init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144dec.c b/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
index 29c78229bb4..3eed17c0dae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144dec.c
@@ -134,5 +134,5 @@ AVCodec ff_ra_144_decoder = {
.priv_data_size = sizeof(RA144Context),
.init = ra144_decode_init,
.decode = ra144_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra144enc.c b/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
index 3ad3f4ea96e..32755d2204b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra144enc.c
@@ -447,7 +447,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (ractx->last_frame)
return 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, FRAME_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FRAME_SIZE, 0)) < 0)
return ret;
/**
@@ -551,7 +551,7 @@ AVCodec ff_ra_144_encoder = {
.init = ra144_encode_init,
.encode2 = ra144_encode_frame,
.close = ra144_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = (const int[]){ 8000, 0 },
diff --git a/chromium/third_party/ffmpeg/libavcodec/ra288.c b/chromium/third_party/ffmpeg/libavcodec/ra288.c
index 189d5c51f8a..8f5a7f2289c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ra288.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ra288.c
@@ -81,7 +81,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
return AVERROR_PATCHWELCOME;
}
- ractx->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ ractx->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!ractx->fdsp)
return AVERROR(ENOMEM);
@@ -207,14 +207,16 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
return AVERROR_INVALIDDATA;
}
+ ret = init_get_bits8(&gb, buf, avctx->block_align);
+ if (ret < 0)
+ return ret;
+
/* get output buffer */
frame->nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
out = (float *)frame->data[0];
- init_get_bits8(&gb, buf, avctx->block_align);
-
for (i=0; i < RA288_BLOCKS_PER_FRAME; i++) {
float gain = amptable[get_bits(&gb, 3)];
int cb_coef = get_bits(&gb, 6 + (i&1));
@@ -247,5 +249,5 @@ AVCodec ff_ra_288_decoder = {
.init = ra288_decode_init,
.decode = ra288_decode_frame,
.close = ra288_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ralf.c b/chromium/third_party/ffmpeg/libavcodec/ralf.c
index 8a319ac8248..8cd9f88dc0e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ralf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ralf.c
@@ -530,7 +530,7 @@ AVCodec ff_ralf_decoder = {
.close = decode_close,
.decode = decode_frame,
.flush = decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
index c6a51a24861..308e34ee18d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ratecontrol.c
@@ -26,6 +26,8 @@
*/
#include "libavutil/attributes.h"
+#include "libavutil/internal.h"
+
#include "avcodec.h"
#include "internal.h"
#include "ratecontrol.h"
@@ -144,6 +146,13 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
return res;
}
+#if FF_API_RC_STRATEGY
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (!s->rc_strategy)
+ s->rc_strategy = s->avctx->rc_strategy;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
for (i = 0; i < 5; i++) {
rcc->pred[i].coeff = FF_QP2LAMBDA * 7.0;
rcc->pred[i].count = 1.0;
@@ -161,7 +170,7 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
if (!rcc->buffer_index)
rcc->buffer_index = s->avctx->rc_buffer_size * 3 / 4;
- if (s->avctx->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
int i;
char *p;
@@ -229,7 +238,7 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
}
// FIXME maybe move to end
- if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) {
+ if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1) {
#if CONFIG_LIBXVID
return ff_xvid_rate_control_init(s);
#else
@@ -240,7 +249,7 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
}
}
- if (!(s->avctx->flags & CODEC_FLAG_PASS2)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_PASS2)) {
rcc->short_term_qsum = 0.001;
rcc->short_term_qcount = 0.001;
@@ -309,7 +318,7 @@ av_cold void ff_rate_control_uninit(MpegEncContext *s)
av_freep(&rcc->entry);
#if CONFIG_LIBXVID
- if ((s->avctx->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
+ if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1)
ff_xvid_rate_control_uninit(s);
#endif
}
@@ -762,8 +771,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
emms_c();
#if CONFIG_LIBXVID
- if ((s->avctx->flags & CODEC_FLAG_PASS2) &&
- s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
+ if ((s->avctx->flags & AV_CODEC_FLAG_PASS2) && s->rc_strategy == 1)
return ff_xvid_rate_estimate_qscale(s, dry_run);
#endif
@@ -782,7 +790,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
s->frame_bits - s->stuffing_bits);
}
- if (s->avctx->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
av_assert0(picture_number >= 0);
if (picture_number >= rcc->num_entries) {
av_log(s, AV_LOG_ERROR, "Input is longer than 2-pass log file\n");
@@ -816,7 +824,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
var = pict_type == AV_PICTURE_TYPE_I ? pic->mb_var_sum : pic->mc_mb_var_sum;
short_term_q = 0; /* avoid warning */
- if (s->avctx->flags & CODEC_FLAG_PASS2) {
+ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
if (pict_type != AV_PICTURE_TYPE_I)
av_assert0(pict_type == rce->new_pict_type);
@@ -882,7 +890,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
if (s->avctx->debug & FF_DEBUG_RC) {
av_log(s->avctx, AV_LOG_DEBUG,
"%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f "
- "size:%d var:%"PRId64"/%"PRId64" br:%d fps:%d\n",
+ "size:%d var:%"PRId64"/%"PRId64" br:%"PRId64" fps:%d\n",
av_get_picture_type_char(pict_type),
qmin, q, qmax, picture_number,
(int)wanted_bits / 1000, (int)s->total_bits / 1000,
@@ -1049,9 +1057,9 @@ static int init_pass2(MpegEncContext *s)
}
av_assert0(toobig <= 40);
av_log(s->avctx, AV_LOG_DEBUG,
- "[lavc rc] requested bitrate: %d bps expected bitrate: %d bps\n",
+ "[lavc rc] requested bitrate: %"PRId64" bps expected bitrate: %"PRId64" bps\n",
s->bit_rate,
- (int)(expected_bits / ((double)all_available_bits / s->bit_rate)));
+ (int64_t)(expected_bits / ((double)all_available_bits / s->bit_rate)));
av_log(s->avctx, AV_LOG_DEBUG,
"[lavc rc] estimated target average qp: %.3f\n",
(float)qscale_sum / rcc->num_entries);
diff --git a/chromium/third_party/ffmpeg/libavcodec/rawdec.c b/chromium/third_party/ffmpeg/libavcodec/rawdec.c
index 647dfa9a0a5..d8d77fceedc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rawdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rawdec.c
@@ -372,5 +372,5 @@ AVCodec ff_rawvideo_decoder = {
.close = raw_close_decoder,
.decode = raw_decode,
.priv_class = &rawdec_class,
- .capabilities = CODEC_CAP_PARAM_CHANGE,
+ .capabilities = AV_CODEC_CAP_PARAM_CHANGE,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rawenc.c b/chromium/third_party/ffmpeg/libavcodec/rawenc.c
index d7923931bb8..c23225fe60d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rawenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rawenc.c
@@ -35,11 +35,11 @@ static av_cold int raw_encode_init(AVCodecContext *avctx)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
if(!avctx->codec_tag)
avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
@@ -49,21 +49,21 @@ static av_cold int raw_encode_init(AVCodecContext *avctx)
static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
- int ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+ int ret = avpicture_get_size(frame->format, frame->width, frame->height);
if (ret < 0)
return ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, ret)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, ret, ret)) < 0)
return ret;
- if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width,
- avctx->height, pkt->data, pkt->size)) < 0)
+ if ((ret = avpicture_layout((const AVPicture *)frame, frame->format, frame->width,
+ frame->height, pkt->data, pkt->size)) < 0)
return ret;
if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 &&
- avctx->pix_fmt == AV_PIX_FMT_YUYV422) {
+ frame->format == AV_PIX_FMT_YUYV422) {
int x;
- for(x = 1; x < avctx->height*avctx->width*2; x += 2)
+ for(x = 1; x < frame->height*frame->width*2; x += 2)
pkt->data[x] ^= 0x80;
}
pkt->flags |= AV_PKT_FLAG_KEY;
@@ -71,18 +71,11 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int raw_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_rawvideo_encoder = {
.name = "rawvideo",
.long_name = NULL_IF_CONFIG_SMALL("raw video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_RAWVIDEO,
.init = raw_encode_init,
- .close = raw_encode_close,
.encode2 = raw_encode,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/remove_extradata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/remove_extradata_bsf.c
index e880b958093..6bb3576ceaa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/remove_extradata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/remove_extradata_bsf.c
@@ -33,7 +33,8 @@ static int remove_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avct
s= bsfc->parser;
if(s && s->parser->split){
- if( (((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) && cmd=='a')
+ if( (((avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ||
+ (avctx->flags2 & AV_CODEC_FLAG2_LOCAL_HEADER)) && cmd == 'a')
||(!keyframe && cmd=='k')
||(cmd=='e' || !cmd)
){
diff --git a/chromium/third_party/ffmpeg/libavcodec/resample.c b/chromium/third_party/ffmpeg/libavcodec/resample.c
index c45aa16cd1d..0f5ee84942c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/resample.c
+++ b/chromium/third_party/ffmpeg/libavcodec/resample.c
@@ -33,6 +33,7 @@
#include "libavutil/samplefmt.h"
#if FF_API_AVCODEC_RESAMPLE
+FF_DISABLE_DEPRECATION_WARNINGS
#define MAX_CHANNELS 8
@@ -440,4 +441,5 @@ void audio_resample_close(ReSampleContext *s)
av_free(s);
}
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/reverse.c b/chromium/third_party/ffmpeg/libavcodec/reverse.c
new file mode 100644
index 00000000000..440badaf34d
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/reverse.c
@@ -0,0 +1 @@
+#include "libavutil/reverse.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/rl2.c b/chromium/third_party/ffmpeg/libavcodec/rl2.c
index eaf31b63a0b..6662979c52c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rl2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rl2.c
@@ -222,5 +222,5 @@ AVCodec ff_rl2_decoder = {
.init = rl2_decode_init,
.close = rl2_decode_end,
.decode = rl2_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqaudioenc.c b/chromium/third_party/ffmpeg/libavcodec/roqaudioenc.c
index c373ccca479..5154604be8f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqaudioenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/roqaudioenc.c
@@ -160,7 +160,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
else
data_size = avctx->channels * avctx->frame_size;
- if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size, 0)) < 0)
return ret;
out = avpkt->data;
@@ -198,7 +198,7 @@ AVCodec ff_roq_dpcm_encoder = {
.init = roq_dpcm_encode_init,
.encode2 = roq_dpcm_encode_frame,
.close = roq_dpcm_encode_close,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c b/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
index b716e258ee3..68ef160ecff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/roqvideodec.c
@@ -244,5 +244,5 @@ AVCodec ff_roq_decoder = {
.init = roq_decode_init,
.close = roq_decode_end,
.decode = roq_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c b/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
index 89879e81b31..b6ed1f98358 100644
--- a/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/roqvideoenc.c
@@ -960,9 +960,6 @@ static int roq_encode_video(RoqContext *enc)
reconstruct_and_encode_image(enc, tempData, enc->width, enc->height,
enc->width*enc->height/64);
- av_frame_unref(enc->avctx->coded_frame);
- av_frame_ref(enc->avctx->coded_frame, enc->current_frame);
-
/* Rotate frame history */
FFSWAP(AVFrame *, enc->current_frame, enc->last_frame);
FFSWAP(motion_vect *, enc->last_motion4, enc->this_motion4);
@@ -982,7 +979,6 @@ static av_cold int roq_encode_end(AVCodecContext *avctx)
av_frame_free(&enc->current_frame);
av_frame_free(&enc->last_frame);
- av_frame_free(&enc->avctx->coded_frame);
av_freep(&enc->tmpData);
av_freep(&enc->this_motion4);
@@ -1023,8 +1019,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->last_frame = av_frame_alloc();
enc->current_frame = av_frame_alloc();
- avctx->coded_frame = av_frame_alloc();
- if (!enc->last_frame || !enc->current_frame || !avctx->coded_frame) {
+ if (!enc->last_frame || !enc->current_frame) {
roq_encode_end(avctx);
return AVERROR(ENOMEM);
}
@@ -1095,7 +1090,7 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* 138 bits max per 8x8 block +
* 256 codebooks*(6 bytes 2x2 + 4 bytes 4x4) + 8 bytes frame header */
size = ((enc->width * enc->height / 64) * 138 + 7) / 8 + 256 * (6 + 4) + 8;
- if ((ret = ff_alloc_packet2(avctx, pkt, size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, size, 0)) < 0)
return ret;
enc->out_buf = pkt->data;
@@ -1132,7 +1127,7 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
#define OFFSET(x) offsetof(RoqContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "quake3_compat", "Whether to respect known limitations in Quake 3 decoder", OFFSET(quake3_compat), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+ { "quake3_compat", "Whether to respect known limitations in Quake 3 decoder", OFFSET(quake3_compat), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rpza.c b/chromium/third_party/ffmpeg/libavcodec/rpza.c
index 732b09ac948..5faf562f8a4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rpza.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rpza.c
@@ -280,5 +280,5 @@ AVCodec ff_rpza_decoder = {
.init = rpza_decode_init,
.close = rpza_decode_end,
.decode = rpza_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv10.c b/chromium/third_party/ffmpeg/libavcodec/rv10.c
index 833e4941206..b56bb5881f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv10.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv10.c
@@ -797,7 +797,7 @@ AVCodec ff_rv10_decoder = {
.init = rv10_decode_init,
.close = rv10_decode_end,
.decode = rv10_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
@@ -814,7 +814,7 @@ AVCodec ff_rv20_decoder = {
.init = rv10_decode_init,
.close = rv10_decode_end,
.decode = rv10_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = (const enum AVPixelFormat[]) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv30.c b/chromium/third_party/ffmpeg/libavcodec/rv30.c
index 1483107c665..3b9868cd5ec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv30.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv30.c
@@ -67,6 +67,9 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
w = r->s.avctx->extradata[6 + rpr*2] << 2;
h = r->s.avctx->extradata[7 + rpr*2] << 2;
+ } else {
+ w = r->orig_width;
+ h = r->orig_height;
}
si->width = w;
si->height = h;
@@ -259,6 +262,9 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
RV34DecContext *r = avctx->priv_data;
int ret;
+ r->orig_width = avctx->coded_width;
+ r->orig_height = avctx->coded_height;
+
if (avctx->extradata_size < 2) {
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return AVERROR(EINVAL);
@@ -291,8 +297,8 @@ AVCodec ff_rv30_decoder = {
.init = rv30_decode_init,
.close = ff_rv34_decode_end,
.decode = ff_rv34_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_FRAME_THREADS,
.flush = ff_mpeg_flush,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv34.c b/chromium/third_party/ffmpeg/libavcodec/rv34.c
index c109a9e0038..51e0f4014f5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv34.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv34.c
@@ -1534,7 +1534,14 @@ int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
if (avctx->internal->is_copy) {
r->tmp_b_block_base = NULL;
+ r->cbp_chroma = NULL;
+ r->cbp_luma = NULL;
+ r->deblock_coefs = NULL;
+ r->intra_types_hist = NULL;
+ r->mb_type = NULL;
+
ff_mpv_idct_init(&r->s);
+
if ((err = ff_mpv_common_init(&r->s)) < 0)
return err;
if ((err = rv34_decoder_alloc(r)) < 0) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv34.h b/chromium/third_party/ffmpeg/libavcodec/rv34.h
index 870164c6e5d..e2f40c8e5a7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv34.h
+++ b/chromium/third_party/ffmpeg/libavcodec/rv34.h
@@ -109,6 +109,8 @@ typedef struct RV34DecContext{
int weight1, weight2; ///< B frame distance fractions (0.14) used in motion compensation
int mv_weight1, mv_weight2;
+ int orig_width, orig_height;
+
uint16_t *cbp_luma; ///< CBP values for luma subblocks
uint8_t *cbp_chroma; ///< CBP values for chroma subblocks
uint16_t *deblock_coefs; ///< deblock coefficients for each macroblock
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv40.c b/chromium/third_party/ffmpeg/libavcodec/rv40.c
index e9cd1109283..3ff1554d3c6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv40.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv40.c
@@ -574,8 +574,8 @@ AVCodec ff_rv40_decoder = {
.init = rv40_decode_init,
.close = ff_rv34_decode_end,
.decode = ff_rv34_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
- CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_FRAME_THREADS,
.flush = ff_mpeg_flush,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/s302m.c b/chromium/third_party/ffmpeg/libavcodec/s302m.c
index 5cf9eb5b1d8..ccfb5913a00 100644
--- a/chromium/third_party/ffmpeg/libavcodec/s302m.c
+++ b/chromium/third_party/ffmpeg/libavcodec/s302m.c
@@ -85,10 +85,6 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
case 8:
avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX;
}
- avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_raw_sample + 4) +
- 32 * (48000 / (buf_size * 8 /
- (avctx->channels *
- (avctx->bits_per_raw_sample + 4))));
return frame_size;
}
@@ -117,6 +113,8 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
+ avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_raw_sample + 4) +
+ 32 * 48000 / frame->nb_samples;
buf_size = (frame->nb_samples * avctx->channels / 2) * block_size;
if (avctx->bits_per_raw_sample == 24) {
@@ -205,11 +203,11 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_DECODING_PARAM
static const AVOption s302m_options[] = {
- {"non_pcm_mode", "Chooses what to do with NON-PCM", offsetof(S302Context, non_pcm_mode), FF_OPT_TYPE_INT, {.i64 = 3}, 0, 3, FLAGS, "non_pcm_mode"},
- {"copy" , "Pass NON-PCM through unchanged" , 0, FF_OPT_TYPE_CONST, {.i64 = 0}, 0, 3, FLAGS, "non_pcm_mode"},
- {"drop" , "Drop NON-PCM" , 0, FF_OPT_TYPE_CONST, {.i64 = 1}, 0, 3, FLAGS, "non_pcm_mode"},
- {"decode_copy" , "Decode if possible else passthrough", 0, FF_OPT_TYPE_CONST, {.i64 = 2}, 0, 3, FLAGS, "non_pcm_mode"},
- {"decode_drop" , "Decode if possible else drop" , 0, FF_OPT_TYPE_CONST, {.i64 = 3}, 0, 3, FLAGS, "non_pcm_mode"},
+ {"non_pcm_mode", "Chooses what to do with NON-PCM", offsetof(S302Context, non_pcm_mode), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 3, FLAGS, "non_pcm_mode"},
+ {"copy" , "Pass NON-PCM through unchanged" , 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 3, FLAGS, "non_pcm_mode"},
+ {"drop" , "Drop NON-PCM" , 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 3, FLAGS, "non_pcm_mode"},
+ {"decode_copy" , "Decode if possible else passthrough", 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 3, FLAGS, "non_pcm_mode"},
+ {"decode_drop" , "Decode if possible else drop" , 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 3, FLAGS, "non_pcm_mode"},
{NULL}
};
@@ -227,6 +225,6 @@ AVCodec ff_s302m_decoder = {
.id = AV_CODEC_ID_S302M,
.priv_data_size = sizeof(S302Context),
.decode = s302m_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &s302m_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/s302menc.c b/chromium/third_party/ffmpeg/libavcodec/s302menc.c
index e738f09d19c..fbaa845aaad 100644
--- a/chromium/third_party/ffmpeg/libavcodec/s302menc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/s302menc.c
@@ -78,7 +78,7 @@ static int s302m_encode2_frame(AVCodecContext *avctx, AVPacket *avpkt,
uint8_t *o;
PutBitContext pb;
- if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size, 0)) < 0)
return ret;
o = avpkt->data;
@@ -173,6 +173,6 @@ AVCodec ff_s302m_encoder = {
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
- .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE | CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE | AV_CODEC_CAP_EXPERIMENTAL,
.supported_samplerates = (const int[]) { 48000, 0 },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/s3tc.c b/chromium/third_party/ffmpeg/libavcodec/s3tc.c
deleted file mode 100644
index a422874d173..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/s3tc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * S3 Texture Compression (S3TC) decoding functions
- * Copyright (c) 2007 by Ivo van Poorten
- *
- * see also: http://wiki.multimedia.cx/index.php?title=S3TC
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "s3tc.h"
-
-static inline void dxt1_decode_pixels(GetByteContext *gb, uint32_t *d,
- unsigned int w, unsigned int h,
- unsigned int qstride, unsigned int flag,
- uint64_t alpha) {
- unsigned int x, y, c0, c1, a = (!flag * 255u) << 24;
- unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3;
- uint32_t colors[4], pixels;
-
- c0 = bytestream2_get_le16(gb);
- c1 = bytestream2_get_le16(gb);
-
- rb0 = (c0<<3 | c0<<8) & 0xf800f8;
- rb1 = (c1<<3 | c1<<8) & 0xf800f8;
- rb0 += (rb0>>5) & 0x070007;
- rb1 += (rb1>>5) & 0x070007;
- g0 = (c0 <<5) & 0x00fc00;
- g1 = (c1 <<5) & 0x00fc00;
- g0 += (g0 >>6) & 0x000300;
- g1 += (g1 >>6) & 0x000300;
-
- colors[0] = rb0 + g0 + a;
- colors[1] = rb1 + g1 + a;
-
- if (c0 > c1 || flag) {
- rb2 = (((2*rb0+rb1) * 21) >> 6) & 0xff00ff;
- rb3 = (((2*rb1+rb0) * 21) >> 6) & 0xff00ff;
- g2 = (((2*g0 +g1 ) * 21) >> 6) & 0x00ff00;
- g3 = (((2*g1 +g0 ) * 21) >> 6) & 0x00ff00;
- colors[3] = rb3 + g3 + a;
- } else {
- rb2 = ((rb0+rb1) >> 1) & 0xff00ff;
- g2 = ((g0 +g1 ) >> 1) & 0x00ff00;
- colors[3] = 0;
- }
-
- colors[2] = rb2 + g2 + a;
-
- pixels = bytestream2_get_le32(gb);
- for (y=0; y<h; y++) {
- for (x=0; x<w; x++) {
- a = (alpha & 0x0f) << 28;
- a += a >> 4;
- d[x] = a + colors[pixels&3];
- pixels >>= 2;
- alpha >>= 4;
- }
- for (; x<4; x++) {
- pixels >>= 2;
- alpha >>= 4;
- }
- d += qstride;
- }
-}
-
-void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst,
- const unsigned int w, const unsigned int h,
- const unsigned int stride) {
- unsigned int x, y, qstride = stride/4;
- uint32_t *d = (uint32_t *) dst;
-
- for (y=0; y < h; y += 4, d += stride-w)
- for (x = 0; x < w; d += FFMIN(4, w-x), x += 4)
- dxt1_decode_pixels(gb, d, FFMIN(4, w-x), FFMIN(4, h-y), qstride, 0, 0LL);
-}
-
-void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst,
- const unsigned int w, const unsigned int h,
- const unsigned int stride) {
- unsigned int x, y, qstride = stride/4;
- uint32_t *d = (uint32_t *) dst;
-
- for (y=0; y < h; y += 4, d += stride-w)
- for (x = 0; x < w; d += FFMIN(4, w-x), x += 4)
- dxt1_decode_pixels(gb, d, FFMIN(4, w-x), FFMIN(4, h-y), qstride, 1, bytestream2_get_le64(gb));
-}
diff --git a/chromium/third_party/ffmpeg/libavcodec/s3tc.h b/chromium/third_party/ffmpeg/libavcodec/s3tc.h
deleted file mode 100644
index 2d77b3abe34..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/s3tc.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * S3 Texture Compression (S3TC) decoding functions
- * Copyright (c) 2007 by Ivo van Poorten
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_S3TC_H
-#define AVCODEC_S3TC_H
-
-#include <stdint.h>
-
-#include "bytestream.h"
-
-#define FF_S3TC_DXT1 0x31545844
-#define FF_S3TC_DXT3 0x33545844
-
-/**
- * Decode DXT1 encoded data to RGB32
- * @param gb GetByteContext
- * @param dst destination buffer
- * @param w width of output image
- * @param h height of output image
- * @param stride line size of output image
- */
-void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst,
- const unsigned int w, const unsigned int h,
- const unsigned int stride);
-/**
- * Decode DXT3 encoded data to RGB32
- * @param gb GetByteContext
- * @param dst destination buffer
- * @param w width of output image
- * @param h height of output image
- * @param stride line size of output image
- */
-void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst,
- const unsigned int w, const unsigned int h,
- const unsigned int stride);
-
-#endif /* AVCODEC_S3TC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/samidec.c b/chromium/third_party/ffmpeg/libavcodec/samidec.c
index 47850e21266..95f35abd42f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/samidec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/samidec.c
@@ -27,10 +27,13 @@
#include "ass.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
+#include "htmlsubtitles.h"
typedef struct {
AVBPrint source;
AVBPrint content;
+ AVBPrint encoded_source;
+ AVBPrint encoded_content;
AVBPrint full;
} SAMIContext;
@@ -41,8 +44,12 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
char *tag = NULL;
char *dupsrc = av_strdup(src);
char *p = dupsrc;
+ AVBPrint *dst_content = &sami->encoded_content;
+ AVBPrint *dst_source = &sami->encoded_source;
+ av_bprint_clear(&sami->encoded_content);
av_bprint_clear(&sami->content);
+ av_bprint_clear(&sami->encoded_source);
for (;;) {
char *saveptr = NULL;
int prev_chr_is_space = 0;
@@ -82,8 +89,9 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
if (*p == '<') {
if (!av_strncasecmp(p, "<P", 2) && (p[2] == '>' || av_isspace(p[2])))
break;
- if (!av_strncasecmp(p, "<BR", 3))
- av_bprintf(dst, "\\N");
+ }
+ if (!av_strncasecmp(p, "<BR", 3)) {
+ av_bprintf(dst, "\\N");
p++;
while (*p && *p != '>')
p++;
@@ -103,9 +111,12 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
}
av_bprint_clear(&sami->full);
- if (sami->source.len)
- av_bprintf(&sami->full, "{\\i1}%s{\\i0}\\N", sami->source.str);
- av_bprintf(&sami->full, "%s", sami->content.str);
+ if (sami->source.len) {
+ ff_htmlmarkup_to_ass(avctx, dst_source, sami->source.str);
+ av_bprintf(&sami->full, "{\\i1}%s{\\i0}\\N", sami->encoded_source.str);
+ }
+ ff_htmlmarkup_to_ass(avctx, dst_content, sami->content.str);
+ av_bprintf(&sami->full, "%s", sami->encoded_content.str);
end:
av_free(dupsrc);
@@ -136,6 +147,8 @@ static av_cold int sami_init(AVCodecContext *avctx)
SAMIContext *sami = avctx->priv_data;
av_bprint_init(&sami->source, 0, 2048);
av_bprint_init(&sami->content, 0, 2048);
+ av_bprint_init(&sami->encoded_source, 0, 2048);
+ av_bprint_init(&sami->encoded_content, 0, 2048);
av_bprint_init(&sami->full, 0, 2048);
return ff_ass_subtitle_header_default(avctx);
}
@@ -145,6 +158,8 @@ static av_cold int sami_close(AVCodecContext *avctx)
SAMIContext *sami = avctx->priv_data;
av_bprint_finalize(&sami->source, NULL);
av_bprint_finalize(&sami->content, NULL);
+ av_bprint_finalize(&sami->encoded_source, NULL);
+ av_bprint_finalize(&sami->encoded_content, NULL);
av_bprint_finalize(&sami->full, NULL);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sanm.c b/chromium/third_party/ffmpeg/libavcodec/sanm.c
index 9e5ec5400e4..1aa002b6a5c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sanm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sanm.c
@@ -457,6 +457,7 @@ static void destroy_buffers(SANMVideoContext *ctx)
ctx->frm0_size =
ctx->frm1_size =
ctx->frm2_size = 0;
+ init_sizes(ctx, 0, 0);
}
static av_cold int init_buffers(SANMVideoContext *ctx)
@@ -1524,5 +1525,5 @@ AVCodec ff_sanm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbr.h b/chromium/third_party/ffmpeg/libavcodec/sbr.h
index e28fccda092..66a88a28988 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sbr.h
+++ b/chromium/third_party/ffmpeg/libavcodec/sbr.h
@@ -66,9 +66,9 @@ typedef struct SBRData {
*/
unsigned bs_frame_class;
unsigned bs_add_harmonic_flag;
- unsigned bs_num_env;
+ AAC_SIGNE bs_num_env;
uint8_t bs_freq_res[7];
- unsigned bs_num_noise;
+ AAC_SIGNE bs_num_noise;
uint8_t bs_df_env[5];
uint8_t bs_df_noise[2];
uint8_t bs_invf_mode[2][5];
@@ -80,25 +80,25 @@ typedef struct SBRData {
* @name State variables
* @{
*/
- DECLARE_ALIGNED(32, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE];
- DECLARE_ALIGNED(32, float, analysis_filterbank_samples) [1312];
+ DECLARE_ALIGNED(32, INTFLOAT, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE];
+ DECLARE_ALIGNED(32, INTFLOAT, analysis_filterbank_samples) [1312];
int synthesis_filterbank_samples_offset;
///l_APrev and l_A
int e_a[2];
///Chirp factors
- float bw_array[5];
+ INTFLOAT bw_array[5];
///QMF values of the original signal
- float W[2][32][32][2];
+ INTFLOAT W[2][32][32][2];
///QMF output of the HF adjustor
int Ypos;
- DECLARE_ALIGNED(16, float, Y)[2][38][64][2];
- DECLARE_ALIGNED(16, float, g_temp)[42][48];
- float q_temp[42][48];
+ DECLARE_ALIGNED(16, INTFLOAT, Y)[2][38][64][2];
+ DECLARE_ALIGNED(16, AAC_FLOAT, g_temp)[42][48];
+ AAC_FLOAT q_temp[42][48];
uint8_t s_indexmapped[8][48];
///Envelope scalefactors
- float env_facs[6][48];
+ AAC_FLOAT env_facs[6][48];
///Noise scalefactors
- float noise_facs[3][5];
+ AAC_FLOAT noise_facs[3][5];
///Envelope time borders
uint8_t t_env[8];
///Envelope time border of the last envelope of the previous frame
@@ -117,18 +117,18 @@ typedef struct SpectralBandReplication SpectralBandReplication;
*/
typedef struct AACSBRContext {
int (*sbr_lf_gen)(AACContext *ac, SpectralBandReplication *sbr,
- float X_low[32][40][2], const float W[2][32][32][2],
+ INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2],
int buf_idx);
- void (*sbr_hf_assemble)(float Y1[38][64][2],
- const float X_high[64][40][2],
+ void (*sbr_hf_assemble)(INTFLOAT Y1[38][64][2],
+ const INTFLOAT X_high[64][40][2],
SpectralBandReplication *sbr, SBRData *ch_data,
const int e_a[2]);
- int (*sbr_x_gen)(SpectralBandReplication *sbr, float X[2][38][64],
- const float Y0[38][64][2], const float Y1[38][64][2],
- const float X_low[32][40][2], int ch);
+ int (*sbr_x_gen)(SpectralBandReplication *sbr, INTFLOAT X[2][38][64],
+ const INTFLOAT Y0[38][64][2], const INTFLOAT Y1[38][64][2],
+ const INTFLOAT X_low[32][40][2], int ch);
void (*sbr_hf_inverse_filter)(SBRDSPContext *dsp,
- float (*alpha0)[2], float (*alpha1)[2],
- const float X_low[32][40][2], int k0);
+ INTFLOAT (*alpha0)[2], INTFLOAT (*alpha1)[2],
+ const INTFLOAT X_low[32][40][2], int k0);
} AACSBRContext;
/**
@@ -137,6 +137,7 @@ typedef struct AACSBRContext {
struct SpectralBandReplication {
int sample_rate;
int start;
+ int id_aac;
int reset;
SpectrumParameters spectrum_params;
int bs_amp_res_header;
@@ -150,23 +151,23 @@ struct SpectralBandReplication {
unsigned bs_smoothing_mode;
/** @} */
unsigned bs_coupling;
- unsigned k[5]; ///< k0, k1, k2
+ AAC_SIGNE k[5]; ///< k0, k1, k2
///kx', and kx respectively, kx is the first QMF subband where SBR is used.
///kx' is its value from the previous frame
- unsigned kx[2];
+ AAC_SIGNE kx[2];
///M' and M respectively, M is the number of QMF subbands that use SBR.
- unsigned m[2];
+ AAC_SIGNE m[2];
unsigned kx_and_m_pushed;
///The number of frequency bands in f_master
- unsigned n_master;
+ AAC_SIGNE n_master;
SBRData data[2];
PSContext ps;
///N_Low and N_High respectively, the number of frequency bands for low and high resolution
- unsigned n[2];
+ AAC_SIGNE n[2];
///Number of noise floor bands
- unsigned n_q;
+ AAC_SIGNE n_q;
///Number of limiter bands
- unsigned n_lim;
+ AAC_SIGNE n_lim;
///The master QMF frequency grouping
uint16_t f_master[49];
///Frequency borders for low resolution SBR
@@ -177,33 +178,33 @@ struct SpectralBandReplication {
uint16_t f_tablenoise[6];
///Frequency borders for the limiter
uint16_t f_tablelim[30];
- unsigned num_patches;
+ AAC_SIGNE num_patches;
uint8_t patch_num_subbands[6];
uint8_t patch_start_subband[6];
///QMF low frequency input to the HF generator
- DECLARE_ALIGNED(16, float, X_low)[32][40][2];
+ DECLARE_ALIGNED(16, INTFLOAT, X_low)[32][40][2];
///QMF output of the HF generator
- DECLARE_ALIGNED(16, float, X_high)[64][40][2];
+ DECLARE_ALIGNED(16, INTFLOAT, X_high)[64][40][2];
///QMF values of the reconstructed signal
- DECLARE_ALIGNED(16, float, X)[2][2][38][64];
+ DECLARE_ALIGNED(16, INTFLOAT, X)[2][2][38][64];
///Zeroth coefficient used to filter the subband signals
- DECLARE_ALIGNED(16, float, alpha0)[64][2];
+ DECLARE_ALIGNED(16, INTFLOAT, alpha0)[64][2];
///First coefficient used to filter the subband signals
- DECLARE_ALIGNED(16, float, alpha1)[64][2];
+ DECLARE_ALIGNED(16, INTFLOAT, alpha1)[64][2];
///Dequantized envelope scalefactors, remapped
- float e_origmapped[7][48];
+ AAC_FLOAT e_origmapped[7][48];
///Dequantized noise scalefactors, remapped
- float q_mapped[7][48];
+ AAC_FLOAT q_mapped[7][48];
///Sinusoidal presence, remapped
uint8_t s_mapped[7][48];
///Estimated envelope
- float e_curr[7][48];
+ AAC_FLOAT e_curr[7][48];
///Amplitude adjusted noise scalefactors
- float q_m[7][48];
+ AAC_FLOAT q_m[7][48];
///Sinusoidal levels
- float s_m[7][48];
- float gain[7][48];
- DECLARE_ALIGNED(32, float, qmf_filter_scratch)[5][64];
+ AAC_FLOAT s_m[7][48];
+ AAC_FLOAT gain[7][48];
+ DECLARE_ALIGNED(32, INTFLOAT, qmf_filter_scratch)[5][64];
FFTContext mdct_ana;
FFTContext mdct;
SBRDSPContext dsp;
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
index e4f053b1076..cc432b6534c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.c
@@ -20,20 +20,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define USE_FIXED 0
+
+#include "aac.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/intfloat.h"
#include "sbrdsp.h"
-static void sbr_sum64x5_c(float *z)
-{
- int k;
- for (k = 0; k < 64; k++) {
- float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
- z[k] = f;
- }
-}
-
static float sbr_sum_square_c(float (*x)[2], int n)
{
float sum0 = 0.0f, sum1 = 0.0f;
@@ -101,16 +95,6 @@ static void sbr_qmf_deint_neg_c(float *v, const float *src)
}
}
-static void sbr_qmf_deint_bfly_c(float *v, const float *src0, const float *src1)
-{
- int i;
- for (i = 0; i < 64; i++) {
- v[ i] = src0[i] - src1[63 - i];
- v[127 - i] = src0[i] + src1[63 - i];
- }
-}
-
-
#if 0
/* This code is slower because it multiplies memory accesses.
* It is left for educational purposes and because it may offer
@@ -238,58 +222,4 @@ static av_always_inline void sbr_hf_apply_noise(float (*Y)[2],
}
}
-static void sbr_hf_apply_noise_0(float (*Y)[2], const float *s_m,
- const float *q_filt, int noise,
- int kx, int m_max)
-{
- sbr_hf_apply_noise(Y, s_m, q_filt, noise, 1.0, 0.0, m_max);
-}
-
-static void sbr_hf_apply_noise_1(float (*Y)[2], const float *s_m,
- const float *q_filt, int noise,
- int kx, int m_max)
-{
- float phi_sign = 1 - 2 * (kx & 1);
- sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, phi_sign, m_max);
-}
-
-static void sbr_hf_apply_noise_2(float (*Y)[2], const float *s_m,
- const float *q_filt, int noise,
- int kx, int m_max)
-{
- sbr_hf_apply_noise(Y, s_m, q_filt, noise, -1.0, 0.0, m_max);
-}
-
-static void sbr_hf_apply_noise_3(float (*Y)[2], const float *s_m,
- const float *q_filt, int noise,
- int kx, int m_max)
-{
- float phi_sign = 1 - 2 * (kx & 1);
- sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, -phi_sign, m_max);
-}
-
-av_cold void ff_sbrdsp_init(SBRDSPContext *s)
-{
- s->sum64x5 = sbr_sum64x5_c;
- s->sum_square = sbr_sum_square_c;
- s->neg_odd_64 = sbr_neg_odd_64_c;
- s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
- s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
- s->qmf_deint_neg = sbr_qmf_deint_neg_c;
- s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
- s->autocorrelate = sbr_autocorrelate_c;
- s->hf_gen = sbr_hf_gen_c;
- s->hf_g_filt = sbr_hf_g_filt_c;
-
- s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
- s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
- s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
- s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
-
- if (ARCH_ARM)
- ff_sbrdsp_init_arm(s);
- if (ARCH_X86)
- ff_sbrdsp_init_x86(s);
- if (ARCH_MIPS)
- ff_sbrdsp_init_mips(s);
-}
+#include "sbrdsp_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.h b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.h
index 1c1bcdfa90d..66852de6182 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sbrdsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/sbrdsp.h
@@ -22,29 +22,31 @@
#define AVCODEC_SBRDSP_H
#include <stdint.h>
+#include "aac_defines.h"
+#include "libavutil/softfloat.h"
typedef struct SBRDSPContext {
- void (*sum64x5)(float *z);
- float (*sum_square)(float (*x)[2], int n);
- void (*neg_odd_64)(float *x);
- void (*qmf_pre_shuffle)(float *z);
- void (*qmf_post_shuffle)(float W[32][2], const float *z);
- void (*qmf_deint_neg)(float *v, const float *src);
- void (*qmf_deint_bfly)(float *v, const float *src0, const float *src1);
- void (*autocorrelate)(const float x[40][2], float phi[3][2][2]);
- void (*hf_gen)(float (*X_high)[2], const float (*X_low)[2],
- const float alpha0[2], const float alpha1[2],
- float bw, int start, int end);
- void (*hf_g_filt)(float (*Y)[2], const float (*X_high)[40][2],
- const float *g_filt, int m_max, intptr_t ixh);
- void (*hf_apply_noise[4])(float (*Y)[2], const float *s_m,
- const float *q_filt, int noise,
+ void (*sum64x5)(INTFLOAT *z);
+ AAC_FLOAT (*sum_square)(INTFLOAT (*x)[2], int n);
+ void (*neg_odd_64)(INTFLOAT *x);
+ void (*qmf_pre_shuffle)(INTFLOAT *z);
+ void (*qmf_post_shuffle)(INTFLOAT W[32][2], const INTFLOAT *z);
+ void (*qmf_deint_neg)(INTFLOAT *v, const INTFLOAT *src);
+ void (*qmf_deint_bfly)(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1);
+ void (*autocorrelate)(const INTFLOAT x[40][2], AAC_FLOAT phi[3][2][2]);
+ void (*hf_gen)(INTFLOAT (*X_high)[2], const INTFLOAT (*X_low)[2],
+ const INTFLOAT alpha0[2], const INTFLOAT alpha1[2],
+ INTFLOAT bw, int start, int end);
+ void (*hf_g_filt)(INTFLOAT (*Y)[2], const INTFLOAT (*X_high)[40][2],
+ const AAC_FLOAT *g_filt, int m_max, intptr_t ixh);
+ void (*hf_apply_noise[4])(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
+ const AAC_FLOAT *q_filt, int noise,
int kx, int m_max);
} SBRDSPContext;
-extern const float ff_sbr_noise_table[][2];
+extern const INTFLOAT AAC_RENAME(ff_sbr_noise_table)[][2];
-void ff_sbrdsp_init(SBRDSPContext *s);
+void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s);
void ff_sbrdsp_init_arm(SBRDSPContext *s);
void ff_sbrdsp_init_x86(SBRDSPContext *s);
void ff_sbrdsp_init_mips(SBRDSPContext *s);
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbrdsp_fixed.c b/chromium/third_party/ffmpeg/libavcodec/sbrdsp_fixed.c
new file mode 100644
index 00000000000..5b7b7a6f9ba
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sbrdsp_fixed.c
@@ -0,0 +1,286 @@
+/*
+ * AAC Spectral Band Replication decoding functions
+ * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
+ * Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Note: Rounding-to-nearest used unless otherwise stated
+ *
+ */
+
+#define USE_FIXED 1
+
+#include "aac.h"
+#include "config.h"
+#include "libavutil/attributes.h"
+#include "libavutil/intfloat.h"
+#include "sbrdsp.h"
+
+static SoftFloat sbr_sum_square_c(int (*x)[2], int n)
+{
+ SoftFloat ret;
+ int64_t accu = 0;
+ int i, nz, round;
+
+ for (i = 0; i < n; i += 2) {
+ accu += (int64_t)x[i + 0][0] * x[i + 0][0];
+ accu += (int64_t)x[i + 0][1] * x[i + 0][1];
+ accu += (int64_t)x[i + 1][0] * x[i + 1][0];
+ accu += (int64_t)x[i + 1][1] * x[i + 1][1];
+ }
+
+ i = (int)(accu >> 32);
+ if (i == 0) {
+ nz = 1;
+ } else {
+ nz = 0;
+ while (FFABS(i) < 0x40000000) {
+ i <<= 1;
+ nz++;
+ }
+ nz = 32 - nz;
+ }
+
+ round = 1 << (nz-1);
+ i = (int)((accu + round) >> nz);
+ i >>= 1;
+ ret = av_int2sf(i, 15 - nz);
+
+ return ret;
+}
+
+static void sbr_neg_odd_64_c(int *x)
+{
+ int i;
+ for (i = 1; i < 64; i += 2)
+ x[i] = -x[i];
+}
+
+static void sbr_qmf_pre_shuffle_c(int *z)
+{
+ int k;
+ z[64] = z[0];
+ z[65] = z[1];
+ for (k = 1; k < 32; k++) {
+ z[64+2*k ] = -z[64 - k];
+ z[64+2*k+1] = z[ k + 1];
+ }
+}
+
+static void sbr_qmf_post_shuffle_c(int W[32][2], const int *z)
+{
+ int k;
+ for (k = 0; k < 32; k++) {
+ W[k][0] = -z[63-k];
+ W[k][1] = z[k];
+ }
+}
+
+static void sbr_qmf_deint_neg_c(int *v, const int *src)
+{
+ int i;
+ for (i = 0; i < 32; i++) {
+ v[ i] = ( src[63 - 2*i ] + 0x10) >> 5;
+ v[63 - i] = (-src[63 - 2*i - 1] + 0x10) >> 5;
+ }
+}
+
+static av_always_inline SoftFloat autocorr_calc(int64_t accu)
+{
+ int nz, mant, expo, round;
+ int i = (int)(accu >> 32);
+ if (i == 0) {
+ nz = 1;
+ } else {
+ nz = 0;
+ while (FFABS(i) < 0x40000000) {
+ i <<= 1;
+ nz++;
+ }
+ nz = 32-nz;
+ }
+
+ round = 1 << (nz-1);
+ mant = (int)((accu + round) >> nz);
+ mant = (mant + 0x40)>>7;
+ mant <<= 6;
+ expo = nz + 15;
+ return av_int2sf(mant, 30 - expo);
+}
+
+static av_always_inline void autocorrelate(const int x[40][2], SoftFloat phi[3][2][2], int lag)
+{
+ int i;
+ int64_t real_sum, imag_sum;
+ int64_t accu_re = 0, accu_im = 0;
+
+ if (lag) {
+ for (i = 1; i < 38; i++) {
+ accu_re += (int64_t)x[i][0] * x[i+lag][0];
+ accu_re += (int64_t)x[i][1] * x[i+lag][1];
+ accu_im += (int64_t)x[i][0] * x[i+lag][1];
+ accu_im -= (int64_t)x[i][1] * x[i+lag][0];
+ }
+
+ real_sum = accu_re;
+ imag_sum = accu_im;
+
+ accu_re += (int64_t)x[ 0][0] * x[lag][0];
+ accu_re += (int64_t)x[ 0][1] * x[lag][1];
+ accu_im += (int64_t)x[ 0][0] * x[lag][1];
+ accu_im -= (int64_t)x[ 0][1] * x[lag][0];
+
+ phi[2-lag][1][0] = autocorr_calc(accu_re);
+ phi[2-lag][1][1] = autocorr_calc(accu_im);
+
+ if (lag == 1) {
+ accu_re = real_sum;
+ accu_im = imag_sum;
+ accu_re += (int64_t)x[38][0] * x[39][0];
+ accu_re += (int64_t)x[38][1] * x[39][1];
+ accu_im += (int64_t)x[38][0] * x[39][1];
+ accu_im -= (int64_t)x[38][1] * x[39][0];
+
+ phi[0][0][0] = autocorr_calc(accu_re);
+ phi[0][0][1] = autocorr_calc(accu_im);
+ }
+ } else {
+ for (i = 1; i < 38; i++) {
+ accu_re += (int64_t)x[i][0] * x[i][0];
+ accu_re += (int64_t)x[i][1] * x[i][1];
+ }
+ real_sum = accu_re;
+ accu_re += (int64_t)x[ 0][0] * x[ 0][0];
+ accu_re += (int64_t)x[ 0][1] * x[ 0][1];
+
+ phi[2][1][0] = autocorr_calc(accu_re);
+
+ accu_re = real_sum;
+ accu_re += (int64_t)x[38][0] * x[38][0];
+ accu_re += (int64_t)x[38][1] * x[38][1];
+
+ phi[1][0][0] = autocorr_calc(accu_re);
+ }
+}
+
+static void sbr_autocorrelate_c(const int x[40][2], SoftFloat phi[3][2][2])
+{
+ autocorrelate(x, phi, 0);
+ autocorrelate(x, phi, 1);
+ autocorrelate(x, phi, 2);
+}
+
+static void sbr_hf_gen_c(int (*X_high)[2], const int (*X_low)[2],
+ const int alpha0[2], const int alpha1[2],
+ int bw, int start, int end)
+{
+ int alpha[4];
+ int i;
+ int64_t accu;
+
+ accu = (int64_t)alpha0[0] * bw;
+ alpha[2] = (int)((accu + 0x40000000) >> 31);
+ accu = (int64_t)alpha0[1] * bw;
+ alpha[3] = (int)((accu + 0x40000000) >> 31);
+ accu = (int64_t)bw * bw;
+ bw = (int)((accu + 0x40000000) >> 31);
+ accu = (int64_t)alpha1[0] * bw;
+ alpha[0] = (int)((accu + 0x40000000) >> 31);
+ accu = (int64_t)alpha1[1] * bw;
+ alpha[1] = (int)((accu + 0x40000000) >> 31);
+
+ for (i = start; i < end; i++) {
+ accu = (int64_t)X_low[i][0] * 0x20000000;
+ accu += (int64_t)X_low[i - 2][0] * alpha[0];
+ accu -= (int64_t)X_low[i - 2][1] * alpha[1];
+ accu += (int64_t)X_low[i - 1][0] * alpha[2];
+ accu -= (int64_t)X_low[i - 1][1] * alpha[3];
+ X_high[i][0] = (int)((accu + 0x10000000) >> 29);
+
+ accu = (int64_t)X_low[i][1] * 0x20000000;
+ accu += (int64_t)X_low[i - 2][1] * alpha[0];
+ accu += (int64_t)X_low[i - 2][0] * alpha[1];
+ accu += (int64_t)X_low[i - 1][1] * alpha[2];
+ accu += (int64_t)X_low[i - 1][0] * alpha[3];
+ X_high[i][1] = (int)((accu + 0x10000000) >> 29);
+ }
+}
+
+static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2],
+ const SoftFloat *g_filt, int m_max, intptr_t ixh)
+{
+ int m, r;
+ int64_t accu;
+
+ for (m = 0; m < m_max; m++) {
+ r = 1 << (22-g_filt[m].exp);
+ accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
+ Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));
+
+ accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
+ Y[m][1] = (int)((accu + r) >> (23-g_filt[m].exp));
+ }
+}
+
+static av_always_inline void sbr_hf_apply_noise(int (*Y)[2],
+ const SoftFloat *s_m,
+ const SoftFloat *q_filt,
+ int noise,
+ int phi_sign0,
+ int phi_sign1,
+ int m_max)
+{
+ int m;
+
+ for (m = 0; m < m_max; m++) {
+ int y0 = Y[m][0];
+ int y1 = Y[m][1];
+ noise = (noise + 1) & 0x1ff;
+ if (s_m[m].mant) {
+ int shift, round;
+
+ shift = 22 - s_m[m].exp;
+ if (shift < 30) {
+ round = 1 << (shift-1);
+ y0 += (s_m[m].mant * phi_sign0 + round) >> shift;
+ y1 += (s_m[m].mant * phi_sign1 + round) >> shift;
+ }
+ } else {
+ int shift, round, tmp;
+ int64_t accu;
+
+ shift = 22 - q_filt[m].exp;
+ if (shift < 30) {
+ round = 1 << (shift-1);
+
+ accu = (int64_t)q_filt[m].mant * ff_sbr_noise_table_fixed[noise][0];
+ tmp = (int)((accu + 0x40000000) >> 31);
+ y0 += (tmp + round) >> shift;
+
+ accu = (int64_t)q_filt[m].mant * ff_sbr_noise_table_fixed[noise][1];
+ tmp = (int)((accu + 0x40000000) >> 31);
+ y1 += (tmp + round) >> shift;
+ }
+ }
+ Y[m][0] = y0;
+ Y[m][1] = y1;
+ phi_sign1 = -phi_sign1;
+ }
+}
+
+#include "sbrdsp_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sbrdsp_template.c b/chromium/third_party/ffmpeg/libavcodec/sbrdsp_template.c
new file mode 100644
index 00000000000..b649dfd7ee7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sbrdsp_template.c
@@ -0,0 +1,97 @@
+/*
+ * AAC Spectral Band Replication decoding functions
+ * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
+ * Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+static void sbr_sum64x5_c(INTFLOAT *z)
+{
+ int k;
+ for (k = 0; k < 64; k++) {
+ INTFLOAT f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
+ z[k] = f;
+ }
+}
+
+static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1)
+{
+ int i;
+ for (i = 0; i < 64; i++) {
+ v[ i] = AAC_SRA_R((src0[i] - src1[63 - i]), 5);
+ v[127 - i] = AAC_SRA_R((src0[i] + src1[63 - i]), 5);
+ }
+}
+
+static void sbr_hf_apply_noise_0(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
+ const AAC_FLOAT *q_filt, int noise,
+ int kx, int m_max)
+{
+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)1.0, (INTFLOAT)0.0, m_max);
+}
+
+static void sbr_hf_apply_noise_1(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
+ const AAC_FLOAT *q_filt, int noise,
+ int kx, int m_max)
+{
+ INTFLOAT phi_sign = 1 - 2 * (kx & 1);
+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)0.0, phi_sign, m_max);
+}
+
+static void sbr_hf_apply_noise_2(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
+ const AAC_FLOAT *q_filt, int noise,
+ int kx, int m_max)
+{
+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)-1.0, (INTFLOAT)0.0, m_max);
+}
+
+static void sbr_hf_apply_noise_3(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m,
+ const AAC_FLOAT *q_filt, int noise,
+ int kx, int m_max)
+{
+ INTFLOAT phi_sign = 1 - 2 * (kx & 1);
+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, (INTFLOAT)0.0, -phi_sign, m_max);
+}
+
+av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s)
+{
+ s->sum64x5 = sbr_sum64x5_c;
+ s->sum_square = sbr_sum_square_c;
+ s->neg_odd_64 = sbr_neg_odd_64_c;
+ s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
+ s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
+ s->qmf_deint_neg = sbr_qmf_deint_neg_c;
+ s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
+ s->autocorrelate = sbr_autocorrelate_c;
+ s->hf_gen = sbr_hf_gen_c;
+ s->hf_g_filt = sbr_hf_g_filt_c;
+
+ s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
+ s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
+ s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
+ s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
+
+#if !USE_FIXED
+ if (ARCH_ARM)
+ ff_sbrdsp_init_arm(s);
+ if (ARCH_X86)
+ ff_sbrdsp_init_x86(s);
+ if (ARCH_MIPS)
+ ff_sbrdsp_init_mips(s);
+#endif /* !USE_FIXED */
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgidec.c b/chromium/third_party/ffmpeg/libavcodec/sgidec.c
index 3ddbf77bc89..02ad1e11654 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgidec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgidec.c
@@ -296,5 +296,5 @@ AVCodec ff_sgi_decoder = {
.priv_data_size = sizeof(SgiState),
.decode = decode_frame,
.init = sgi_decode_init,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgienc.c b/chromium/third_party/ffmpeg/libavcodec/sgienc.c
index 2f45eb39849..28cec8625fd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgienc.c
@@ -37,10 +37,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
return 0;
}
@@ -54,8 +50,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
unsigned int bytes_per_channel, pixmax, put_be;
unsigned char *end_buf;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
width = avctx->width;
height = avctx->height;
@@ -114,7 +114,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
else // assume ff_rl_encode() produces at most 2x size of input
length += tablesize * 2 + depth * height * (2 * width + 1);
- if ((ret = ff_alloc_packet2(avctx, pkt, bytes_per_channel * length)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, bytes_per_channel * length, 0)) < 0)
return ret;
buf = pkt->data;
end_buf = pkt->data + pkt->size;
@@ -206,12 +206,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_sgi_encoder = {
.name = "sgi",
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
@@ -219,7 +213,6 @@ AVCodec ff_sgi_encoder = {
.id = AV_CODEC_ID_SGI,
.init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,
diff --git a/chromium/third_party/ffmpeg/libavcodec/sgirledec.c b/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
index 69d012e8e46..e7b281ac316 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sgirledec.c
@@ -156,5 +156,5 @@ AVCodec ff_sgirle_decoder = {
.init = sgirle_decode_init,
.close = sgirle_decode_end,
.decode = sgirle_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/shorten.c b/chromium/third_party/ffmpeg/libavcodec/shorten.c
index db2e3c5febb..0f5be96eb7f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/shorten.c
+++ b/chromium/third_party/ffmpeg/libavcodec/shorten.c
@@ -431,7 +431,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
void *tmp_ptr;
s->max_framesize = 8192; // should hopefully be enough for the first header
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
- s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
+ s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);
@@ -445,7 +445,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
buf_size = FFMIN(buf_size, s->max_framesize - s->bitstream_size);
input_buf_size = buf_size;
- if (s->bitstream_index + s->bitstream_size + buf_size + FF_INPUT_BUFFER_PADDING_SIZE >
+ if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE >
s->allocated_bitstream_size) {
memmove(s->bitstream, &s->bitstream[s->bitstream_index],
s->bitstream_size);
@@ -466,7 +466,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
}
}
/* init and position bitstream reader */
- init_get_bits(&s->gb, buf, buf_size * 8);
+ if ((ret = init_get_bits8(&s->gb, buf, buf_size)) < 0)
+ return ret;
skip_bits(&s->gb, s->bitindex);
/* process header or next subblock */
@@ -679,7 +680,7 @@ AVCodec ff_shorten_decoder = {
.init = shorten_decode_init,
.close = shorten_decode_close,
.decode = shorten_decode_frame,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin.c b/chromium/third_party/ffmpeg/libavcodec/sinewin.c
index 1fa0e953f01..4532dc73543 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sinewin.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin.c
@@ -16,5 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define USE_FIXED 0
#include "sinewin.h"
#include "sinewin_tablegen.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin.h b/chromium/third_party/ffmpeg/libavcodec/sinewin.h
index 2268fd52f42..27c107ce594 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sinewin.h
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin.h
@@ -23,6 +23,7 @@
#include "config.h"
#include "libavutil/mem.h"
+#include "libavcodec/aac_defines.h"
#if CONFIG_HARDCODED_TABLES
# define SINETABLE_CONST const
@@ -30,20 +31,24 @@
# define SINETABLE_CONST
#endif
+#ifndef USE_FIXED
+#define USE_FIXED 0
+#endif
+
#define SINETABLE(size) \
- SINETABLE_CONST DECLARE_ALIGNED(32, float, ff_sine_##size)[size]
+ SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size]
/**
* Generate a sine window.
* @param window pointer to half window
* @param n size of half window
*/
-void ff_sine_window_init(float *window, int n);
+void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n);
/**
* initialize the specified entry of ff_sine_windows
*/
-void ff_init_ff_sine_windows(int index);
+void AAC_RENAME(ff_init_ff_sine_windows)(int index);
extern SINETABLE( 32);
extern SINETABLE( 64);
@@ -55,6 +60,6 @@ extern SINETABLE(2048);
extern SINETABLE(4096);
extern SINETABLE(8192);
-extern SINETABLE_CONST float * const ff_sine_windows[14];
+extern SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[14];
#endif /* AVCODEC_SINEWIN_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed.c b/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed.c
new file mode 100644
index 00000000000..27ead29e8e0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed.c
@@ -0,0 +1,21 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+#include "sinewin.h"
+#include "sinewin_tablegen.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed_tablegen.c
new file mode 100644
index 00000000000..977e6f3cbfa
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin_fixed_tablegen.c
@@ -0,0 +1,24 @@
+/*
+ * Generate a header file for hardcoded sine windows
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define USE_FIXED 1
+#include "sinewin_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.c b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.c
index 561ae3ea1dd..dd602668eef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.c
@@ -20,27 +20,5 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#define SINETABLE_CONST
-#define SINETABLE(size) \
- float ff_sine_##size[size]
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#include "sinewin_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
- int i;
-
- write_fileheader();
-
- for (i = 5; i <= 13; i++) {
- ff_init_ff_sine_windows(i);
- printf("SINETABLE(%4i) = {\n", 1 << i);
- write_float_array(ff_sine_windows[i], 1 << i);
- printf("};\n");
- }
-
- return 0;
-}
+#define USE_FIXED 0
+#include "sinewin_tablegen_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.h b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.h
index 2b9c4f2393e..4432135f19f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.h
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen.h
@@ -27,6 +27,7 @@
// do not use libavutil/libm.h since this is compiled both
// for the host and the target and config.h is only valid for the target
#include <math.h>
+#include "libavcodec/aac_defines.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h"
@@ -41,26 +42,37 @@ SINETABLE(2048);
SINETABLE(4096);
SINETABLE(8192);
#else
+#if USE_FIXED
+#include "libavcodec/sinewin_fixed_tables.h"
+#else
#include "libavcodec/sinewin_tables.h"
#endif
+#endif
+
+#if USE_FIXED
+#define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5)
+#else
+#define SIN_FIX(a) a
+#endif
-SINETABLE_CONST float * const ff_sine_windows[] = {
+SINETABLE_CONST INTFLOAT * const AAC_RENAME(ff_sine_windows)[] = {
NULL, NULL, NULL, NULL, NULL, // unused
- ff_sine_32 , ff_sine_64 ,
- ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096, ff_sine_8192
+ AAC_RENAME(ff_sine_32) , AAC_RENAME(ff_sine_64), AAC_RENAME(ff_sine_128),
+ AAC_RENAME(ff_sine_256), AAC_RENAME(ff_sine_512), AAC_RENAME(ff_sine_1024),
+ AAC_RENAME(ff_sine_2048), AAC_RENAME(ff_sine_4096), AAC_RENAME(ff_sine_8192)
};
// Generate a sine window.
-av_cold void ff_sine_window_init(float *window, int n) {
+av_cold void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n) {
int i;
for(i = 0; i < n; i++)
- window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
+ window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n))));
}
-av_cold void ff_init_ff_sine_windows(int index) {
- assert(index >= 0 && index < FF_ARRAY_ELEMS(ff_sine_windows));
+av_cold void AAC_RENAME(ff_init_ff_sine_windows)(int index) {
+ assert(index >= 0 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows)));
#if !CONFIG_HARDCODED_TABLES
- ff_sine_window_init(ff_sine_windows[index], 1 << index);
+ AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index);
#endif
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen_template.c b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen_template.c
new file mode 100644
index 00000000000..43ce1ba82e8
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/sinewin_tablegen_template.c
@@ -0,0 +1,54 @@
+/*
+ * Generate a header file for hardcoded sine windows
+ *
+ * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdlib.h>
+#include "libavcodec/aac_defines.h"
+#define CONFIG_HARDCODED_TABLES 0
+
+#if USE_FIXED
+#define WRITE_FUNC write_int32_t_array
+#else
+#define WRITE_FUNC write_float_array
+#endif
+
+#define SINETABLE_CONST
+#define SINETABLE(size) \
+ INTFLOAT AAC_RENAME(ff_sine_##size)[size]
+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#include "sinewin_tablegen.h"
+#include "tableprint.h"
+
+int main(void)
+{
+ int i;
+
+ write_fileheader();
+
+ for (i = 5; i <= 13; i++) {
+ AAC_RENAME(ff_init_ff_sine_windows)(i);
+ printf("SINETABLE(%4i) = {\n", 1 << i);
+ WRITE_FUNC(AAC_RENAME(ff_sine_windows)[i], 1 << i);
+ printf("};\n");
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/sipr.c b/chromium/third_party/ffmpeg/libavcodec/sipr.c
index af1edf50b87..eb8b471263b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sipr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sipr.c
@@ -570,5 +570,5 @@ AVCodec ff_sipr_decoder = {
.priv_data_size = sizeof(SiprContext),
.init = sipr_decoder_init,
.decode = sipr_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/smacker.c b/chromium/third_party/ffmpeg/libavcodec/smacker.c
index b5538c74948..b2fc29b138d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/smacker.c
+++ b/chromium/third_party/ffmpeg/libavcodec/smacker.c
@@ -316,7 +316,9 @@ static int decode_header_trees(SmackVContext *smk) {
full_size = AV_RL32(smk->avctx->extradata + 8);
type_size = AV_RL32(smk->avctx->extradata + 12);
- init_get_bits8(&gb, smk->avctx->extradata + 16, smk->avctx->extradata_size - 16);
+ ret = init_get_bits8(&gb, smk->avctx->extradata + 16, smk->avctx->extradata_size - 16);
+ if (ret < 0)
+ return ret;
if(!get_bits1(&gb)) {
av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
@@ -813,7 +815,7 @@ AVCodec ff_smacker_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
AVCodec ff_smackaud_decoder = {
@@ -823,5 +825,5 @@ AVCodec ff_smackaud_decoder = {
.id = AV_CODEC_ID_SMACKAUDIO,
.init = smka_decode_init,
.decode = smka_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/smc.c b/chromium/third_party/ffmpeg/libavcodec/smc.c
index 131300a5955..a423c455cc4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/smc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/smc.c
@@ -472,5 +472,5 @@ AVCodec ff_smc_decoder = {
.init = smc_decode_init,
.close = smc_decode_end,
.decode = smc_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/snappy.c b/chromium/third_party/ffmpeg/libavcodec/snappy.c
new file mode 100644
index 00000000000..7900b0f9785
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/snappy.c
@@ -0,0 +1,183 @@
+/*
+ * Snappy decompression algorithm
+ * Copyright (c) 2015 Luca Barbato
+ *
+ * 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/mem.h"
+
+#include "bytestream.h"
+#include "snappy.h"
+
+enum {
+ SNAPPY_LITERAL,
+ SNAPPY_COPY_1,
+ SNAPPY_COPY_2,
+ SNAPPY_COPY_4,
+};
+
+static int64_t bytestream2_get_levarint(GetByteContext *gb)
+{
+ uint64_t val = 0;
+ int shift = 0;
+ int tmp;
+
+ do {
+ tmp = bytestream2_get_byte(gb);
+ val |= (tmp & 127) << shift;
+ shift += 7;
+ } while (tmp & 128);
+
+ return val;
+}
+
+static int snappy_literal(GetByteContext *gb, uint8_t *p, int size, int val)
+{
+ unsigned int len = 1;
+
+ switch (val) {
+ case 63:
+ len += bytestream2_get_le32(gb);
+ break;
+ case 62:
+ len += bytestream2_get_le24(gb);
+ break;
+ case 61:
+ len += bytestream2_get_le16(gb);
+ break;
+ case 60:
+ len += bytestream2_get_byte(gb);
+ break;
+ default: // val < 60
+ len += val;
+ }
+
+ if (size < len)
+ return AVERROR_INVALIDDATA;
+
+ bytestream2_get_buffer(gb, p, len);
+
+ return len;
+}
+
+static int snappy_copy(uint8_t *start, uint8_t *p, int size,
+ unsigned int off, int len)
+{
+ uint8_t *q;
+ int i;
+ if (off > p - start || size < len)
+ return AVERROR_INVALIDDATA;
+
+ q = p - off;
+
+ for (i = 0; i < len; i++)
+ p[i] = q[i];
+
+ return len;
+}
+
+static int snappy_copy1(GetByteContext *gb, uint8_t *start, uint8_t *p,
+ int size, int val)
+{
+ int len = 4 + (val & 0x7);
+ unsigned int off = bytestream2_get_byte(gb) | (val & 0x38) << 5;
+
+ return snappy_copy(start, p, size, off, len);
+}
+
+static int snappy_copy2(GetByteContext *gb, uint8_t *start, uint8_t *p,
+ int size, int val)
+{
+ int len = 1 + val;
+ unsigned int off = bytestream2_get_le16(gb);
+
+ return snappy_copy(start, p, size, off, len);
+}
+
+static int snappy_copy4(GetByteContext *gb, uint8_t *start, uint8_t *p,
+ int size, int val)
+{
+ int len = 1 + val;
+ unsigned int off = bytestream2_get_le32(gb);
+
+ return snappy_copy(start, p, size, off, len);
+}
+
+static int64_t decode_len(GetByteContext *gb)
+{
+ int64_t len = bytestream2_get_levarint(gb);
+
+ if (len < 0 || len > UINT_MAX)
+ return AVERROR_INVALIDDATA;
+
+ return len;
+}
+
+int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb)
+{
+ int pos = bytestream2_get_bytes_left(gb);
+ int64_t len = decode_len(gb);
+
+ bytestream2_seek(gb, -pos, SEEK_END);
+
+ return len;
+}
+
+int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size)
+{
+ int64_t len = decode_len(gb);
+ int ret = 0;
+ uint8_t *p;
+
+ if (len < 0)
+ return len;
+
+ if (len > *size)
+ return AVERROR_BUFFER_TOO_SMALL;
+
+ *size = len;
+ p = buf;
+
+ while (bytestream2_get_bytes_left(gb) > 0) {
+ uint8_t s = bytestream2_get_byte(gb);
+ int val = s >> 2;
+
+ switch (s & 0x03) {
+ case SNAPPY_LITERAL:
+ ret = snappy_literal(gb, p, len, val);
+ break;
+ case SNAPPY_COPY_1:
+ ret = snappy_copy1(gb, buf, p, len, val);
+ break;
+ case SNAPPY_COPY_2:
+ ret = snappy_copy2(gb, buf, p, len, val);
+ break;
+ case SNAPPY_COPY_4:
+ ret = snappy_copy4(gb, buf, p, len, val);
+ break;
+ }
+
+ if (ret < 0)
+ return ret;
+
+ p += ret;
+ len -= ret;
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/snappy.h b/chromium/third_party/ffmpeg/libavcodec/snappy.h
new file mode 100644
index 00000000000..a65cb3aa1bd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/snappy.h
@@ -0,0 +1,60 @@
+/*
+ * Snappy module
+ * Copyright (c) Luca Barbato
+ *
+ * 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
+ * Snappy decompression
+ *
+ * Snappy is a compression/decompression algorithm that does not aim for
+ * maximum compression, but rather for very high speeds and reasonable
+ * compression.
+ *
+ * http://en.wikipedia.org/wiki/Snappy_%28software%29
+ */
+
+#ifndef AVCODEC_SNAPPY_H
+#define AVCODEC_SNAPPY_H
+
+#include <stdint.h>
+
+#include "bytestream.h"
+
+/**
+ * Get the uncompressed length of an input buffer compressed using the Snappy
+ * algorithm. The GetByteContext is not advanced.
+ *
+ * @param gb input GetByteContext.
+ * @return A positive length on success, AVERROR otherwise.
+ */
+ int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb);
+
+/**
+ * Decompress an input buffer using Snappy algorithm.
+ *
+ * @param gb input GetByteContext.
+ * @param buf input buffer pointer.
+ * @param size input/output on input, the size of buffer, on output, the size
+ * of the uncompressed data.
+ * @return 0 if success, AVERROR otherwise.
+ */
+int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size);
+
+#endif /* AVCODEC_SNAPPY_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/snow.h b/chromium/third_party/ffmpeg/libavcodec/snow.h
index 95e07cd0aef..a09b6221e48 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snow.h
+++ b/chromium/third_party/ffmpeg/libavcodec/snow.h
@@ -176,6 +176,8 @@ typedef struct SnowContext{
int memc_only;
int no_bitstream;
int intra_penalty;
+ int motion_est;
+ int iterative_dia_size;
MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to eventually make the motion estimation independent of MpegEncContext, so this will be removed then (FIXME/XXX)
@@ -304,6 +306,8 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
BlockNode *lb= lt+b_stride;
BlockNode *rb= lb+1;
uint8_t *block[4];
+ // When src_stride is large enough, it is possible to interleave the blocks.
+ // Otherwise the blocks are written sequentially in the tmp buffer.
int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
uint8_t *tmp = s->scratchbuf;
uint8_t *ptmp;
@@ -347,8 +351,6 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
if(b_w<=0 || b_h<=0) return;
- av_assert2(src_stride > 2*MB_SIZE + 5);
-
if(!sliced && offset_dst)
dst += src_x + src_y*dst_stride;
dst8+= src_x + src_y*src_stride;
diff --git a/chromium/third_party/ffmpeg/libavcodec/snowdec.c b/chromium/third_party/ffmpeg/libavcodec/snowdec.c
index e12cb21fcdf..1b288dd8138 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snowdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snowdec.c
@@ -477,7 +477,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
);
av_assert0(!s->avmv);
- if (s->avctx->flags2 & CODEC_FLAG2_EXPORT_MVS) {
+ if (s->avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) {
s->avmv = av_malloc_array(s->b_width * s->b_height, sizeof(AVMotionVector) << (s->block_max_depth*2));
}
s->avmv_index = 0;
@@ -642,7 +642,7 @@ AVCodec ff_snow_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
+ .capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/snowenc.c b/chromium/third_party/ffmpeg/libavcodec/snowenc.c
index bd5c0fde15f..5e5dc35e862 100644
--- a/chromium/third_party/ffmpeg/libavcodec/snowenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/snowenc.c
@@ -32,6 +32,8 @@
#include "mpegvideo.h"
#include "h263.h"
+#define FF_ME_ITER 50
+
static av_cold int encode_init(AVCodecContext *avctx)
{
SnowContext *s = avctx->priv_data;
@@ -39,16 +41,22 @@ static av_cold int encode_init(AVCodecContext *avctx)
int i;
if(avctx->prediction_method == DWT_97
- && (avctx->flags & CODEC_FLAG_QSCALE)
+ && (avctx->flags & AV_CODEC_FLAG_QSCALE)
&& avctx->global_quality == 0){
av_log(avctx, AV_LOG_ERROR, "The 9/7 wavelet is incompatible with lossless mode.\n");
return -1;
}
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->me_method == ME_ITER)
+ s->motion_est = FF_ME_ITER;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->spatial_decomposition_type= avctx->prediction_method; //FIXME add decorrelator type r transform_type
- s->mv_scale = (avctx->flags & CODEC_FLAG_QPEL) ? 2 : 4;
- s->block_max_depth= (avctx->flags & CODEC_FLAG_4MV ) ? 1 : 0;
+ s->mv_scale = (avctx->flags & AV_CODEC_FLAG_QPEL) ? 2 : 4;
+ s->block_max_depth= (avctx->flags & AV_CODEC_FLAG_4MV ) ? 1 : 0;
for(plane_index=0; plane_index<3; plane_index++){
s->plane[plane_index].diag_mc= 1;
@@ -83,18 +91,18 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->max_ref_frames = av_clip(avctx->refs, 1, MAX_REF_FRAMES);
- if(avctx->flags&CODEC_FLAG_PASS1){
+ if(avctx->flags&AV_CODEC_FLAG_PASS1){
if(!avctx->stats_out)
avctx->stats_out = av_mallocz(256);
if (!avctx->stats_out)
return AVERROR(ENOMEM);
}
- if((avctx->flags&CODEC_FLAG_PASS2) || !(avctx->flags&CODEC_FLAG_QSCALE)){
+ if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&CODEC_FLAG_QSCALE)){
if(ff_rate_control_init(&s->m) < 0)
return -1;
}
- s->pass1_rc= !(avctx->flags & (CODEC_FLAG_QSCALE|CODEC_FLAG_PASS2));
+ s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|CODEC_FLAG_PASS2));
switch(avctx->pix_fmt){
case AV_PIX_FMT_YUV444P:
@@ -122,14 +130,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp);
s->input_picture = av_frame_alloc();
- avctx->coded_frame = av_frame_alloc();
- if (!s->input_picture || !avctx->coded_frame)
+ if (!s->input_picture)
return AVERROR(ENOMEM);
if ((ret = ff_snow_get_buffer(s, s->input_picture)) < 0)
return ret;
- if(s->avctx->me_method == ME_ITER){
+ if(s->motion_est == FF_ME_ITER){
int size= s->b_width * s->b_height << 2*s->block_max_depth;
for(i=0; i<s->max_ref_frames; i++){
s->ref_mvs[i]= av_mallocz_array(size, sizeof(int16_t[2]));
@@ -242,7 +249,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
s->input_picture->data[2] + ((x*block_w)>>s->chroma_h_shift) + ((y*uvstride*block_w)>>s->chroma_v_shift)};
int P[10][2];
int16_t last_mv[3][2];
- int qpel= !!(s->avctx->flags & CODEC_FLAG_QPEL); //unused
+ int qpel= !!(s->avctx->flags & AV_CODEC_FLAG_QPEL); //unused
const int shift= 1+qpel;
MotionEstContext *c= &s->m.me;
int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
@@ -1113,8 +1120,9 @@ static void iterative_me(SnowContext *s){
do{
int newx = block->mx;
int newy = block->my;
+ int dia_size = s->iterative_dia_size ? s->iterative_dia_size : FFMAX(s->avctx->dia_size, 1);
dia_change=0;
- for(i=0; i<FFMAX(s->avctx->dia_size, 1); i++){
+ for(i=0; i < dia_size; i++){
for(j=0; j<i; j++){
dia_change |= check_block_inter(s, mb_x, mb_y, newx+4*(i-j), newy+(4*j), obmc_edged, &best_rd);
dia_change |= check_block_inter(s, mb_x, mb_y, newx-4*(i-j), newy-(4*j), obmc_edged, &best_rd);
@@ -1207,7 +1215,7 @@ static void encode_blocks(SnowContext *s, int search){
int w= s->b_width;
int h= s->b_height;
- if(s->avctx->me_method == ME_ITER && !s->keyframe && search)
+ if(s->motion_est == FF_ME_ITER && !s->keyframe && search)
iterative_me(s);
for(y=0; y<h; y++){
@@ -1216,7 +1224,7 @@ static void encode_blocks(SnowContext *s, int search){
return;
}
for(x=0; x<w; x++){
- if(s->avctx->me_method == ME_ITER || !search)
+ if(s->motion_est == FF_ME_ITER || !search)
encode_q_branch2(s, 0, x, y);
else
encode_q_branch (s, 0, x, y);
@@ -1556,7 +1564,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t rc_header_bak[sizeof(s->header_state)];
uint8_t rc_block_bak[sizeof(s->block_state)];
- if ((ret = ff_alloc_packet2(avctx, pkt, s->b_width*s->b_height*MB_SIZE*MB_SIZE*3 + FF_MIN_BUFFER_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->b_width*s->b_height*MB_SIZE*MB_SIZE*3 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
ff_init_range_encoder(c, pkt->data, pkt->size);
@@ -1579,10 +1587,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->new_picture = pict;
s->m.picture_number= avctx->frame_number;
- if(avctx->flags&CODEC_FLAG_PASS2){
+ if(avctx->flags&AV_CODEC_FLAG_PASS2){
s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_number].new_pict_type;
s->keyframe = pic->pict_type == AV_PICTURE_TYPE_I;
- if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
+ if(!(avctx->flags&AV_CODEC_FLAG_QSCALE)) {
pic->quality = ff_rate_estimate_qscale(&s->m, 0);
if (pic->quality < 0)
return -1;
@@ -1598,12 +1606,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->qlog = qscale2qlog(pic->quality);
s->lambda = pic->quality * 3/2;
}
- if (s->qlog < 0 || (!pic->quality && (avctx->flags & CODEC_FLAG_QSCALE))) {
+ if (s->qlog < 0 || (!pic->quality && (avctx->flags & AV_CODEC_FLAG_QSCALE))) {
s->qlog= LOSSLESS_QLOG;
s->lambda = 0;
}//else keep previous frame's qlog until after motion estimation
- if (s->current_picture->data[0] && !(s->avctx->flags&CODEC_FLAG_EMU_EDGE)) {
+ if (s->current_picture->data[0]
+#if FF_API_EMU_EDGE
+ && !(s->avctx->flags&CODEC_FLAG_EMU_EDGE)
+#endif
+ ) {
int w = s->avctx->width;
int h = s->avctx->height;
@@ -1651,10 +1663,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->m.b8_stride= 2*s->m.mb_width+1;
s->m.f_code=1;
s->m.pict_type = pic->pict_type;
+#if FF_API_MOTION_EST
s->m.me_method= s->avctx->me_method;
+#endif
+ s->m.motion_est= s->motion_est;
s->m.me.scene_change_score=0;
s->m.me.dia_size = avctx->dia_size;
- s->m.quarter_sample= (s->avctx->flags & CODEC_FLAG_QPEL)!=0;
+ s->m.quarter_sample= (s->avctx->flags & AV_CODEC_FLAG_QPEL)!=0;
s->m.out_format= FMT_H263;
s->m.unrestricted_mv= 1;
@@ -1723,7 +1738,7 @@ redo_frame:
if( plane_index==0
&& pic->pict_type == AV_PICTURE_TYPE_P
- && !(avctx->flags&CODEC_FLAG_PASS2)
+ && !(avctx->flags&AV_CODEC_FLAG_PASS2)
&& s->m.me.scene_change_score > s->avctx->scenechange_threshold){
ff_init_range_encoder(c, pkt->data, pkt->size);
ff_build_rac_states(c, (1LL<<32)/20, 256-8);
@@ -1809,7 +1824,7 @@ redo_frame:
predict_plane(s, s->spatial_idwt_buffer, plane_index, 1);
}
}
- if(s->avctx->flags&CODEC_FLAG_PSNR){
+ if(s->avctx->flags&AV_CODEC_FLAG_PSNR){
int64_t error= 0;
if(pict->data[plane_index]) //FIXME gray hack
@@ -1841,7 +1856,7 @@ redo_frame:
if(s->pass1_rc)
if (ff_rate_estimate_qscale(&s->m, 0) < 0)
return -1;
- if(avctx->flags&CODEC_FLAG_PASS1)
+ if(avctx->flags&AV_CODEC_FLAG_PASS1)
ff_write_pass1_stats(&s->m);
s->m.last_pict_type = s->m.pict_type;
avctx->frame_bits = s->m.frame_bits;
@@ -1851,8 +1866,13 @@ redo_frame:
emms_c();
+ ff_side_data_set_encoder_stats(pkt, s->current_picture->quality,
+ s->current_picture->error,
+ (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0,
+ s->current_picture->pict_type);
+
pkt->size = ff_rac_terminate(c);
- if (avctx->coded_frame->key_frame)
+ if (s->current_picture->key_frame)
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
@@ -1866,7 +1886,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
ff_snow_common_end(s);
ff_rate_control_uninit(&s->m);
av_frame_free(&s->input_picture);
- av_frame_free(&avctx->coded_frame);
av_freep(&avctx->stats_out);
return 0;
@@ -1876,9 +1895,11 @@ static av_cold int encode_end(AVCodecContext *avctx)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
FF_MPV_COMMON_OPTS
+ { "iter", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ITER }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" },
{ "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ "no_bitstream", "Skip final bitstream writeout.", OFFSET(no_bitstream), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ "intra_penalty", "Penalty for intra blocks in block decission", OFFSET(intra_penalty), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "iterative_dia_size", "Dia size for the iterative ME", OFFSET(iterative_dia_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sonic.c b/chromium/third_party/ffmpeg/libavcodec/sonic.c
index c5076f9d8eb..4ec7d89fde3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sonic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sonic.c
@@ -727,7 +727,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const short *samples = (const int16_t*)frame->data[0];
uint8_t state[32];
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size * 5 + 1000)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size * 5 + 1000, 0)) < 0)
return ret;
ff_init_range_encoder(&c, avpkt->data, avpkt->size);
@@ -858,6 +858,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
SonicContext *s = avctx->priv_data;
GetBitContext gb;
int i;
+ int ret;
s->channels = avctx->channels;
s->samplerate = avctx->sample_rate;
@@ -868,7 +869,9 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ if (ret < 0)
+ return ret;
s->version = get_bits(&gb, 2);
if (s->version >= 2) {
@@ -1081,7 +1084,7 @@ AVCodec ff_sonic_decoder = {
.init = sonic_decode_init,
.close = sonic_decode_close,
.decode = sonic_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
};
#endif /* CONFIG_SONIC_DECODER */
@@ -1095,7 +1098,7 @@ AVCodec ff_sonic_encoder = {
.init = sonic_encode_init,
.encode2 = sonic_encode_frame,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
- .capabilities = CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_EXPERIMENTAL,
.close = sonic_encode_close,
};
#endif
@@ -1110,7 +1113,7 @@ AVCodec ff_sonic_ls_encoder = {
.init = sonic_encode_init,
.encode2 = sonic_encode_frame,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
- .capabilities = CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_EXPERIMENTAL,
.close = sonic_encode_close,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c b/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
index 3e49c59e06c..815f9ad50ea 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sp5xdec.c
@@ -104,7 +104,7 @@ AVCodec ff_sp5x_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
.decode = sp5x_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -120,6 +120,7 @@ AVCodec ff_amv_decoder = {
.close = ff_mjpeg_decode_end,
.decode = sp5x_decode_frame,
.max_lowres = 3,
+ .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/srtdec.c b/chromium/third_party/ffmpeg/libavcodec/srtdec.c
index ed3af95063b..dd6bc9d1044 100644
--- a/chromium/third_party/ffmpeg/libavcodec/srtdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/srtdec.c
@@ -25,46 +25,11 @@
#include "libavutil/parseutils.h"
#include "avcodec.h"
#include "ass.h"
-
-static int html_color_parse(AVCodecContext *avctx, const char *str)
-{
- uint8_t rgba[4];
- if (av_parse_color(rgba, str, strcspn(str, "\" >"), avctx) < 0)
- return -1;
- return rgba[0] | rgba[1] << 8 | rgba[2] << 16;
-}
-
-enum {
- PARAM_UNKNOWN = -1,
- PARAM_SIZE,
- PARAM_COLOR,
- PARAM_FACE,
- PARAM_NUMBER
-};
-
-typedef struct SrtStack {
- char tag[128];
- char param[PARAM_NUMBER][128];
-} SrtStack;
-
-static void rstrip_spaces_buf(AVBPrint *buf)
-{
- while (buf->len > 0 && buf->str[buf->len - 1] == ' ')
- buf->str[--buf->len] = 0;
-}
+#include "htmlsubtitles.h"
static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
const char *in, int x1, int y1, int x2, int y2)
{
- char *param, buffer[128], tmp[128];
- int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0;
- SrtStack stack[16];
-
- stack[0].tag[0] = 0;
- strcpy(stack[0].param[PARAM_SIZE], "{\\fs}");
- strcpy(stack[0].param[PARAM_COLOR], "{\\c}");
- strcpy(stack[0].param[PARAM_FACE], "{\\fn}");
-
if (x1 >= 0 && y1 >= 0) {
/* XXX: here we rescale coordinate assuming they are in DVD resolution
* (720x480) since we don't have anything better */
@@ -84,117 +49,7 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
}
}
- for (; !end && *in; in++) {
- switch (*in) {
- case '\r':
- break;
- case '\n':
- if (line_start) {
- end = 1;
- break;
- }
- rstrip_spaces_buf(dst);
- av_bprintf(dst, "\\N");
- line_start = 1;
- break;
- case ' ':
- if (!line_start)
- av_bprint_chars(dst, *in, 1);
- break;
- case '{': /* skip all {\xxx} substrings except for {\an%d}
- and all microdvd like styles such as {Y:xxx} */
- len = 0;
- an += sscanf(in, "{\\an%*1u}%n", &len) >= 0 && len > 0;
- if ((an != 1 && (len = 0, sscanf(in, "{\\%*[^}]}%n", &len) >= 0 && len > 0)) ||
- (len = 0, sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n", &len) >= 0 && len > 0)) {
- in += len - 1;
- } else
- av_bprint_chars(dst, *in, 1);
- break;
- case '<':
- tag_close = in[1] == '/';
- len = 0;
- if (sscanf(in+tag_close+1, "%127[^>]>%n", buffer, &len) >= 1 && len > 0) {
- if ((param = strchr(buffer, ' ')))
- *param++ = 0;
- if ((!tag_close && sptr < FF_ARRAY_ELEMS(stack)) ||
- ( tag_close && sptr > 0 && !strcmp(stack[sptr-1].tag, buffer))) {
- int i, j, unknown = 0;
- in += len + tag_close;
- if (!tag_close)
- memset(stack+sptr, 0, sizeof(*stack));
- if (!strcmp(buffer, "font")) {
- if (tag_close) {
- for (i=PARAM_NUMBER-1; i>=0; i--)
- if (stack[sptr-1].param[i][0])
- for (j=sptr-2; j>=0; j--)
- if (stack[j].param[i][0]) {
- av_bprintf(dst, "%s", stack[j].param[i]);
- break;
- }
- } else {
- while (param) {
- if (!strncmp(param, "size=", 5)) {
- unsigned font_size;
- param += 5 + (param[5] == '"');
- if (sscanf(param, "%u", &font_size) == 1) {
- snprintf(stack[sptr].param[PARAM_SIZE],
- sizeof(stack[0].param[PARAM_SIZE]),
- "{\\fs%u}", font_size);
- }
- } else if (!strncmp(param, "color=", 6)) {
- param += 6 + (param[6] == '"');
- snprintf(stack[sptr].param[PARAM_COLOR],
- sizeof(stack[0].param[PARAM_COLOR]),
- "{\\c&H%X&}",
- html_color_parse(avctx, param));
- } else if (!strncmp(param, "face=", 5)) {
- param += 5 + (param[5] == '"');
- len = strcspn(param,
- param[-1] == '"' ? "\"" :" ");
- av_strlcpy(tmp, param,
- FFMIN(sizeof(tmp), len+1));
- param += len;
- snprintf(stack[sptr].param[PARAM_FACE],
- sizeof(stack[0].param[PARAM_FACE]),
- "{\\fn%s}", tmp);
- }
- if ((param = strchr(param, ' ')))
- param++;
- }
- for (i=0; i<PARAM_NUMBER; i++)
- if (stack[sptr].param[i][0])
- av_bprintf(dst, "%s", stack[sptr].param[i]);
- }
- } else if (!buffer[1] && strspn(buffer, "bisu") == 1) {
- av_bprintf(dst, "{\\%c%d}", buffer[0], !tag_close);
- } else {
- unknown = 1;
- snprintf(tmp, sizeof(tmp), "</%s>", buffer);
- }
- if (tag_close) {
- sptr--;
- } else if (unknown && !strstr(in, tmp)) {
- in -= len + tag_close;
- av_bprint_chars(dst, *in, 1);
- } else
- av_strlcpy(stack[sptr++].tag, buffer,
- sizeof(stack[0].tag));
- break;
- }
- }
- default:
- av_bprint_chars(dst, *in, 1);
- break;
- }
- if (*in != ' ' && *in != '\r' && *in != '\n')
- line_start = 0;
- }
-
- while (dst->len >= 2 && !strncmp(&dst->str[dst->len - 2], "\\N", 2))
- dst->len -= 2;
- dst->str[dst->len] = 0;
- rstrip_spaces_buf(dst);
+ ff_htmlmarkup_to_ass(avctx, dst, in);
}
static int srt_decode_frame(AVCodecContext *avctx,
diff --git a/chromium/third_party/ffmpeg/libavcodec/startcode.c b/chromium/third_party/ffmpeg/libavcodec/startcode.c
index 940bbb71074..9efdffe8c66 100644
--- a/chromium/third_party/ffmpeg/libavcodec/startcode.c
+++ b/chromium/third_party/ffmpeg/libavcodec/startcode.c
@@ -33,7 +33,7 @@ int ff_startcode_find_candidate_c(const uint8_t *buf, int size)
int i = 0;
#if HAVE_FAST_UNALIGNED
/* we check i < size instead of i + 3 / 7 because it is
- * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
+ * simpler and there must be AV_INPUT_BUFFER_PADDING_SIZE
* bytes at the end.
*/
#if HAVE_FAST_64BIT
diff --git a/chromium/third_party/ffmpeg/libavcodec/sunrast.c b/chromium/third_party/ffmpeg/libavcodec/sunrast.c
index 3fbec1dfbfe..25e11f6cd21 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sunrast.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sunrast.c
@@ -211,5 +211,5 @@ AVCodec ff_sunrast_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SUNRAST,
.decode = sunrast_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/sunrastenc.c b/chromium/third_party/ffmpeg/libavcodec/sunrastenc.c
index cff8c85c3fc..d83a42dd0f0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sunrastenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sunrastenc.c
@@ -181,7 +181,7 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
SUNRASTContext *s = avctx->priv_data;
int ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, s->size, 0)) < 0)
return ret;
bytestream2_init_writer(&s->p, avpkt->data, avpkt->size);
@@ -199,12 +199,6 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return 0;
}
-static av_cold int sunrast_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
static const AVCodecDefault sunrast_defaults[] = {
{ "coder", "rle" },
{ NULL },
@@ -217,7 +211,6 @@ AVCodec ff_sunrast_encoder = {
.id = AV_CODEC_ID_SUNRAST,
.priv_data_size = sizeof(SUNRASTContext),
.init = sunrast_encode_init,
- .close = sunrast_encode_close,
.encode2 = sunrast_encode_frame,
.defaults = sunrast_defaults,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24,
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq1dec.c b/chromium/third_party/ffmpeg/libavcodec/svq1dec.c
index 21d4acf87dc..dca99fae4c4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq1dec.c
@@ -618,9 +618,12 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
uint8_t *current;
int result, i, x, y, width, height;
svq1_pmv *pmv;
+ int ret;
/* initialize bit buffer */
- init_get_bits8(&s->gb, buf, buf_size);
+ ret = init_get_bits8(&s->gb, buf, buf_size);
+ if (ret < 0)
+ return ret;
/* decode frame header */
s->frame_code = get_bits(&s->gb, 22);
@@ -685,7 +688,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
width = FFALIGN(s->width, 16);
height = FFALIGN(s->height, 16);
} else {
- if (avctx->flags & CODEC_FLAG_GRAY)
+ if (avctx->flags & AV_CODEC_FLAG_GRAY)
break;
width = FFALIGN(s->width / 4, 16);
height = FFALIGN(s->height / 4, 16);
@@ -839,7 +842,7 @@ AVCodec ff_svq1_decoder = {
.init = svq1_decode_init,
.close = svq1_decode_end,
.decode = svq1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = svq1_flush,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
AV_PIX_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq1enc.c b/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
index 56031451de7..1e1745e7b10 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq1enc.c
@@ -246,14 +246,13 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
unsigned char *decoded_plane,
int width, int height, int src_stride, int stride)
{
- const AVFrame *f = s->avctx->coded_frame;
int x, y;
int i;
int block_width, block_height;
int level;
int threshold[6];
uint8_t *src = s->scratchbuf + stride * 32;
- const int lambda = (f->quality * f->quality) >>
+ const int lambda = (s->quality * s->quality) >>
(2 * FF_LAMBDA_SHIFT);
/* figure out the acceptable level thresholds in advance */
@@ -264,7 +263,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
block_width = (width + 15) / 16;
block_height = (height + 15) / 16;
- if (f->pict_type == AV_PICTURE_TYPE_P) {
+ if (s->pict_type == AV_PICTURE_TYPE_P) {
s->m.avctx = s->avctx;
s->m.current_picture_ptr = &s->m.current_picture;
s->m.last_picture_ptr = &s->m.last_picture;
@@ -280,12 +279,25 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
s->m.mb_stride = s->m.mb_width + 1;
s->m.b8_stride = 2 * s->m.mb_width + 1;
s->m.f_code = 1;
- s->m.pict_type = f->pict_type;
+ s->m.pict_type = s->pict_type;
+#if FF_API_MOTION_EST
+FF_DISABLE_DEPRECATION_WARNINGS
s->m.me_method = s->avctx->me_method;
+ if (s->motion_est == FF_ME_EPZS) {
+ if (s->avctx->me_method == ME_ZERO)
+ s->motion_est = FF_ME_ZERO;
+ else if (s->avctx->me_method == ME_EPZS)
+ s->motion_est = FF_ME_EPZS;
+ else if (s->avctx->me_method == ME_X1)
+ s->motion_est = FF_ME_XONE;
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ s->m.motion_est = s->motion_est;
s->m.me.scene_change_score = 0;
// s->m.out_format = FMT_H263;
// s->m.unrestricted_mv = 1;
- s->m.lambda = f->quality;
+ s->m.lambda = s->quality;
s->m.qscale = s->m.lambda * 139 +
FF_LAMBDA_SCALE * 64 >>
FF_LAMBDA_SHIFT + 7;
@@ -378,13 +390,13 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
s->m.mb_x = x;
init_block_index(&s->m);
- if (f->pict_type == AV_PICTURE_TYPE_I ||
+ if (s->pict_type == AV_PICTURE_TYPE_I ||
(s->m.mb_type[x + y * s->m.mb_stride] &
CANDIDATE_MB_TYPE_INTRA)) {
for (i = 0; i < 6; i++)
init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i],
7 * 32);
- if (f->pict_type == AV_PICTURE_TYPE_P) {
+ if (s->pict_type == AV_PICTURE_TYPE_P) {
const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA];
put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
score[0] = vlc[1] * lambda;
@@ -400,7 +412,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
best = 0;
- if (f->pict_type == AV_PICTURE_TYPE_P) {
+ if (s->pict_type == AV_PICTURE_TYPE_P) {
const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER];
int mx, my, pred_x, pred_y, dxy;
int16_t *motion_ptr;
@@ -505,7 +517,6 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
av_frame_free(&s->current_picture);
av_frame_free(&s->last_picture);
- av_frame_free(&avctx->coded_frame);
return 0;
}
@@ -515,14 +526,18 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
SVQ1EncContext *const s = avctx->priv_data;
int ret;
+ if (avctx->width >= 4096 || avctx->height >= 4096) {
+ av_log(avctx, AV_LOG_ERROR, "Dimensions too large, maximum is 4095x4095\n");
+ return AVERROR(EINVAL);
+ }
+
ff_hpeldsp_init(&s->hdsp, avctx->flags);
ff_me_cmp_init(&s->mecc, avctx);
ff_mpegvideoencdsp_init(&s->m.mpvencdsp, avctx);
- avctx->coded_frame = av_frame_alloc();
s->current_picture = av_frame_alloc();
s->last_picture = av_frame_alloc();
- if (!avctx->coded_frame || !s->current_picture || !s->last_picture) {
+ if (!s->current_picture || !s->last_picture) {
svq1_encode_end(avctx);
return AVERROR(ENOMEM);
}
@@ -576,11 +591,10 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
SVQ1EncContext *const s = avctx->priv_data;
- AVFrame *const p = avctx->coded_frame;
int i, ret;
if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width * s->y_block_height *
- MAX_MB_BYTES*3 + FF_MIN_BUFFER_SIZE)) < 0)
+ MAX_MB_BYTES*3 + AV_INPUT_BUFFER_MIN_SIZE, 0)) < 0)
return ret;
if (avctx->pix_fmt != AV_PIX_FMT_YUV410P) {
@@ -608,12 +622,22 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits(&s->pb, pkt->data, pkt->size);
- p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ?
- AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
- p->key_frame = p->pict_type == AV_PICTURE_TYPE_I;
- p->quality = pict->quality;
+ if (avctx->gop_size && (avctx->frame_number % avctx->gop_size))
+ s->pict_type = AV_PICTURE_TYPE_P;
+ else
+ s->pict_type = AV_PICTURE_TYPE_I;
+ s->quality = pict->quality;
+
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = s->pict_type;
+ avctx->coded_frame->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
+ ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type);
- svq1_write_header(s, p->pict_type);
+ svq1_write_header(s, s->pict_type);
for (i = 0; i < 3; i++)
if (svq1_encode_plane(s, i,
pict->data[i],
@@ -639,19 +663,38 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
flush_put_bits(&s->pb);
pkt->size = put_bits_count(&s->pb) / 8;
- if (p->pict_type == AV_PICTURE_TYPE_I)
+ if (s->pict_type == AV_PICTURE_TYPE_I)
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
return 0;
}
+#define OFFSET(x) offsetof(struct SVQ1EncContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "motion-est", "Motion estimation algorithm", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = FF_ME_EPZS }, FF_ME_ZERO, FF_ME_XONE, VE, "motion-est"},
+ { "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
+ { "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
+ { "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
+
+ { NULL },
+};
+
+static const AVClass svq1enc_class = {
+ .class_name = "svq1enc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_svq1_encoder = {
.name = "svq1",
.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SVQ1,
.priv_data_size = sizeof(SVQ1EncContext),
+ .priv_class = &svq1enc_class,
.init = svq1_encode_init,
.encode2 = svq1_encode_frame,
.close = svq1_encode_end,
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq1enc.h b/chromium/third_party/ffmpeg/libavcodec/svq1enc.h
index 8e748851174..37f05a0460b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq1enc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/svq1enc.h
@@ -44,6 +44,10 @@ typedef struct SVQ1EncContext {
PutBitContext pb;
GetBitContext gb;
+ /* Some compression statistics */
+ enum AVPictureType pict_type;
+ int quality;
+
/* why ooh why this sick breadth first order,
* everything is slower and more complex */
PutBitContext reorder_pb[6];
@@ -70,6 +74,8 @@ typedef struct SVQ1EncContext {
uint8_t *scratchbuf;
+ int motion_est;
+
int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
intptr_t size);
} SVQ1EncContext;
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq3.c b/chromium/third_party/ffmpeg/libavcodec/svq3.c
index 0683b0dbfcd..57205c6ad11 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq3.c
@@ -339,7 +339,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
: s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, sl->linesize,
height);
- if (!(h->flags & CODEC_FLAG_GRAY)) {
+ if (!(h->flags & AV_CODEC_FLAG_GRAY)) {
mx = mx + (mx < (int) x) >> 1;
my = my + (my < (int) y) >> 1;
width = width >> 1;
@@ -1414,9 +1414,9 @@ AVCodec ff_svq3_decoder = {
.init = svq3_decode_init,
.close = svq3_decode_end,
.decode = svq3_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND |
- CODEC_CAP_DR1 |
- CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND |
+ AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_NONE},
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tableprint.h b/chromium/third_party/ffmpeg/libavcodec/tableprint.h
index 667985f6d7f..6f61c7124bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tableprint.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tableprint.h
@@ -64,6 +64,7 @@ void write_int8_t_array (const int8_t *, int);
void write_uint8_t_array (const uint8_t *, int);
void write_uint16_t_array (const uint16_t *, int);
void write_uint32_t_array (const uint32_t *, int);
+void write_int32_t_array (const int32_t *, int);
void write_float_array (const float *, int);
void write_int8_t_2d_array (const void *, int, int);
void write_uint8_t_2d_array (const void *, int, int);
@@ -116,6 +117,7 @@ WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15)
WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7)
WRITE_1D_FUNC(int16_t, "%5"PRIi16, 7)
WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7)
+WRITE_1D_FUNC(int32_t, "0x%08"PRIx32, 7)
WRITE_1D_FUNC(float, "%.18e", 3)
WRITE_2D_FUNC(int8_t)
diff --git a/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h b/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
index 33a9c0e756e..675251a8366 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
@@ -38,6 +38,7 @@
#include "tableprint.h"
#include "get_bits.h"
#include "mathtables.c"
+#include "libavutil/reverse.c"
#include "bitstream.c"
#define REPLACE_DEFINE2(type) write_##type##_array
diff --git a/chromium/third_party/ffmpeg/libavcodec/takdec.c b/chromium/third_party/ffmpeg/libavcodec/takdec.c
index 42250303762..2acdb924c39 100644
--- a/chromium/third_party/ffmpeg/libavcodec/takdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/takdec.c
@@ -947,7 +947,7 @@ AVCodec ff_tak_decoder = {
.decode = tak_decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/targa.c b/chromium/third_party/ffmpeg/libavcodec/targa.c
index b0c9b55f333..215c0f51f66 100644
--- a/chromium/third_party/ffmpeg/libavcodec/targa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/targa.c
@@ -303,5 +303,5 @@ AVCodec ff_targa_decoder = {
.id = AV_CODEC_ID_TARGA,
.priv_data_size = sizeof(TargaContext),
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/targa_y216dec.c b/chromium/third_party/ffmpeg/libavcodec/targa_y216dec.c
index 5f4eeaaad28..21b3d35d672 100644
--- a/chromium/third_party/ffmpeg/libavcodec/targa_y216dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/targa_y216dec.c
@@ -79,5 +79,5 @@ AVCodec ff_targa_y216_decoder = {
.id = AV_CODEC_ID_TARGA_Y216,
.init = y216_decode_init,
.decode = y216_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/targaenc.c b/chromium/third_party/ffmpeg/libavcodec/targaenc.c
index d4483ec398b..de8163a5f05 100644
--- a/chromium/third_party/ffmpeg/libavcodec/targaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/targaenc.c
@@ -85,7 +85,7 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return AVERROR(EINVAL);
}
picsize = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
- if ((ret = ff_alloc_packet2(avctx, pkt, picsize + 45)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, picsize + 45, 0)) < 0)
return ret;
/* zero out the header and only set applicable fields */
@@ -172,29 +172,22 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int targa_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}
-static av_cold int targa_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
- return 0;
-}
-
AVCodec ff_targa_encoder = {
.name = "targa",
.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_TARGA,
.init = targa_encode_init,
- .close = targa_encode_close,
.encode2 = targa_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,
diff --git a/chromium/third_party/ffmpeg/libavcodec/tdsc.c b/chromium/third_party/ffmpeg/libavcodec/tdsc.c
index 8f0ebe7c3f0..63cd44341d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tdsc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tdsc.c
@@ -621,7 +621,7 @@ AVCodec ff_tdsc_decoder = {
.decode = tdsc_decode_frame,
.close = tdsc_close,
.priv_data_size = sizeof(TDSCContext),
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/textdec.c b/chromium/third_party/ffmpeg/libavcodec/textdec.c
index c9f02a2a4cb..a6c8722c1d5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/textdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/textdec.c
@@ -37,7 +37,7 @@ typedef struct {
#define OFFSET(x) offsetof(TextContext, x)
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- { "keep_ass_markup", "Set if ASS tags must be escaped", OFFSET(keep_ass_markup), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags=SD },
+ { "keep_ass_markup", "Set if ASS tags must be escaped", OFFSET(keep_ass_markup), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags=SD },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/texturedsp.c b/chromium/third_party/ffmpeg/libavcodec/texturedsp.c
new file mode 100644
index 00000000000..19aa3538213
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/texturedsp.c
@@ -0,0 +1,610 @@
+/*
+ * Texture block decompression
+ * Copyright (C) 2009 Benjamin Dobell, Glass Echidna
+ * Copyright (C) 2012 Matthäus G. "Anteru" Chajdas (http://anteru.net)
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * 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 <stddef.h>
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
+#include "texturedsp.h"
+
+#define RGBA(r, g, b, a) ((r) | ((g) << 8) | ((b) << 16) | ((a) << 24))
+
+static av_always_inline void extract_color(uint32_t colors[4],
+ uint16_t color0,
+ uint16_t color1,
+ int dxtn, int alpha)
+{
+ int tmp;
+ uint8_t r0, g0, b0, r1, g1, b1;
+ uint8_t a = dxtn ? 0 : 255;
+
+ tmp = (color0 >> 11) * 255 + 16;
+ r0 = (uint8_t) ((tmp / 32 + tmp) / 32);
+ tmp = ((color0 & 0x07E0) >> 5) * 255 + 32;
+ g0 = (uint8_t) ((tmp / 64 + tmp) / 64);
+ tmp = (color0 & 0x001F) * 255 + 16;
+ b0 = (uint8_t) ((tmp / 32 + tmp) / 32);
+
+ tmp = (color1 >> 11) * 255 + 16;
+ r1 = (uint8_t) ((tmp / 32 + tmp) / 32);
+ tmp = ((color1 & 0x07E0) >> 5) * 255 + 32;
+ g1 = (uint8_t) ((tmp / 64 + tmp) / 64);
+ tmp = (color1 & 0x001F) * 255 + 16;
+ b1 = (uint8_t) ((tmp / 32 + tmp) / 32);
+
+ if (dxtn || color0 > color1) {
+ colors[0] = RGBA(r0, g0, b0, a);
+ colors[1] = RGBA(r1, g1, b1, a);
+ colors[2] = RGBA((2 * r0 + r1) / 3,
+ (2 * g0 + g1) / 3,
+ (2 * b0 + b1) / 3,
+ a);
+ colors[3] = RGBA((2 * r1 + r0) / 3,
+ (2 * g1 + g0) / 3,
+ (2 * b1 + b0) / 3,
+ a);
+ } else {
+ colors[0] = RGBA(r0, g0, b0, a);
+ colors[1] = RGBA(r1, g1, b1, a);
+ colors[2] = RGBA((r0 + r1) / 2,
+ (g0 + g1) / 2,
+ (b0 + b1) / 2,
+ a);
+ colors[3] = RGBA(0, 0, 0, alpha);
+ }
+}
+
+static inline void dxt1_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block, uint8_t alpha)
+{
+ int x, y;
+ uint32_t colors[4];
+ uint16_t color0 = AV_RL16(block + 0);
+ uint16_t color1 = AV_RL16(block + 2);
+ uint32_t code = AV_RL32(block + 4);
+
+ extract_color(colors, color0, color1, 0, alpha);
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ uint32_t pixel = colors[code & 3];
+ code >>= 2;
+ AV_WL32(dst + x * 4, pixel);
+ }
+ dst += stride;
+ }
+}
+
+/**
+ * Decompress one block of a DXT1 texture and store the resulting
+ * RGBA pixels in 'dst'. Alpha component is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt1_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ dxt1_block_internal(dst, stride, block, 255);
+
+ return 8;
+}
+
+/**
+ * Decompress one block of a DXT1 with 1-bit alpha texture and store
+ * the resulting RGBA pixels in 'dst'. Alpha is either fully opaque or
+ * fully transparent.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt1a_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ dxt1_block_internal(dst, stride, block, 0);
+
+ return 8;
+}
+
+static inline void dxt3_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block)
+{
+ int x, y;
+ uint32_t colors[4];
+ uint16_t color0 = AV_RL16(block + 8);
+ uint16_t color1 = AV_RL16(block + 10);
+ uint32_t code = AV_RL32(block + 12);
+
+ extract_color(colors, color0, color1, 1, 0);
+
+ for (y = 0; y < 4; y++) {
+ const uint16_t alpha_code = AV_RL16(block + 2 * y);
+ uint8_t alpha_values[4];
+
+ alpha_values[0] = ((alpha_code >> 0) & 0x0F) * 17;
+ alpha_values[1] = ((alpha_code >> 4) & 0x0F) * 17;
+ alpha_values[2] = ((alpha_code >> 8) & 0x0F) * 17;
+ alpha_values[3] = ((alpha_code >> 12) & 0x0F) * 17;
+
+ for (x = 0; x < 4; x++) {
+ uint8_t alpha = alpha_values[x];
+ uint32_t pixel = colors[code & 3] | (alpha << 24);
+ code >>= 2;
+
+ AV_WL32(dst + x * 4, pixel);
+ }
+ dst += stride;
+ }
+}
+
+/** Convert a premultiplied alpha pixel to a straigth alpha pixel. */
+static av_always_inline void premult2straight(uint8_t *src)
+{
+ int r = src[0];
+ int g = src[1];
+ int b = src[2];
+ int a = src[3]; /* unchanged */
+
+ src[0] = (uint8_t) r * a / 255;
+ src[1] = (uint8_t) g * a / 255;
+ src[2] = (uint8_t) b * a / 255;
+}
+
+/**
+ * Decompress one block of a DXT2 texture and store the resulting
+ * RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt2_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+
+ dxt3_block_internal(dst, stride, block);
+
+ /* This format is DXT3, but returns premultiplied alpha. It needs to be
+ * converted because it's what lavc outputs (and swscale expects). */
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ premult2straight(dst + x * 4 + y * stride);
+
+ return 16;
+}
+
+/**
+ * Decompress one block of a DXT3 texture and store the resulting
+ * RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt3_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ dxt3_block_internal(dst, stride, block);
+
+ return 16;
+}
+
+/**
+ * Decompress a BC 16x3 index block stored as
+ * h g f e
+ * d c b a
+ * p o n m
+ * l k j i
+ *
+ * Bits packed as
+ * | h | g | f | e | d | c | b | a | // Entry
+ * |765 432 107 654 321 076 543 210| // Bit
+ * |0000000000111111111112222222222| // Byte
+ *
+ * into 16 8-bit indices.
+ */
+static void decompress_indices(uint8_t *dst, const uint8_t *src)
+{
+ int block, i;
+
+ for (block = 0; block < 2; block++) {
+ int tmp = AV_RL24(src);
+
+ /* Unpack 8x3 bit from last 3 byte block */
+ for (i = 0; i < 8; i++)
+ dst[i] = (tmp >> (i * 3)) & 0x7;
+
+ src += 3;
+ dst += 8;
+ }
+}
+
+static inline void dxt5_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block)
+{
+ int x, y;
+ uint32_t colors[4];
+ uint8_t alpha_indices[16];
+ uint16_t color0 = AV_RL16(block + 8);
+ uint16_t color1 = AV_RL16(block + 10);
+ uint32_t code = AV_RL32(block + 12);
+ uint8_t alpha0 = *(block);
+ uint8_t alpha1 = *(block + 1);
+
+ decompress_indices(alpha_indices, block + 2);
+
+ extract_color(colors, color0, color1, 1, 0);
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int alpha_code = alpha_indices[x + y * 4];
+ uint32_t pixel;
+ uint8_t alpha;
+
+ if (alpha_code == 0) {
+ alpha = alpha0;
+ } else if (alpha_code == 1) {
+ alpha = alpha1;
+ } else {
+ if (alpha0 > alpha1) {
+ alpha = (uint8_t) (((8 - alpha_code) * alpha0 +
+ (alpha_code - 1) * alpha1) / 7);
+ } else {
+ if (alpha_code == 6) {
+ alpha = 0;
+ } else if (alpha_code == 7) {
+ alpha = 255;
+ } else {
+ alpha = (uint8_t) (((6 - alpha_code) * alpha0 +
+ (alpha_code - 1) * alpha1) / 5);
+ }
+ }
+ }
+ pixel = colors[code & 3] | (alpha << 24);
+ code >>= 2;
+ AV_WL32(dst + x * 4, pixel);
+ }
+ dst += stride;
+ }
+}
+
+/**
+ * Decompress one block of a DXT4 texture and store the resulting
+ * RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt4_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+
+ dxt5_block_internal(dst, stride, block);
+
+ /* This format is DXT5, but returns premultiplied alpha. It needs to be
+ * converted because it's what lavc outputs (and swscale expects). */
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ premult2straight(dst + x * 4 + y * stride);
+
+ return 16;
+}
+
+/**
+ * Decompress one block of a DXT5 texture and store the resulting
+ * RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt5_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ dxt5_block_internal(dst, stride, block);
+
+ return 16;
+}
+
+/**
+ * Convert a YCoCg buffer to RGBA.
+ *
+ * @param src input buffer.
+ * @param scaled variant with scaled chroma components and opaque alpha.
+ */
+static av_always_inline void ycocg2rgba(uint8_t *src, int scaled)
+{
+ int r = src[0];
+ int g = src[1];
+ int b = src[2];
+ int a = src[3];
+
+ int s = scaled ? (b >> 3) + 1 : 1;
+ int y = a;
+ int co = (r - 128) / s;
+ int cg = (g - 128) / s;
+
+ src[0] = av_clip_uint8(y + co - cg);
+ src[1] = av_clip_uint8(y + cg);
+ src[2] = av_clip_uint8(y - co - cg);
+ src[3] = scaled ? 255 : b;
+}
+
+/**
+ * Decompress one block of a DXT5 texture with classic YCoCg and store
+ * the resulting RGBA pixels in 'dst'. Alpha component is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt5y_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+
+ /* This format is basically DXT5, with luma stored in alpha.
+ * Run a normal decompress and then reorder the components. */
+ dxt5_block_internal(dst, stride, block);
+
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ ycocg2rgba(dst + x * 4 + y * stride, 0);
+
+ return 16;
+}
+
+/**
+ * Decompress one block of a DXT5 texture with scaled YCoCg and store
+ * the resulting RGBA pixels in 'dst'. Alpha component is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxt5ys_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+
+ /* This format is basically DXT5, with luma stored in alpha.
+ * Run a normal decompress and then reorder the components. */
+ dxt5_block_internal(dst, stride, block);
+
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ ycocg2rgba(dst + x * 4 + y * stride, 1);
+
+ return 16;
+}
+
+static inline void rgtc_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block,
+ const int *color_tab)
+{
+ uint8_t indices[16];
+ int x, y;
+
+ decompress_indices(indices, block + 2);
+
+ /* Only one or two channels are stored at most, since it only used to
+ * compress specular (black and white) or normal (red and green) maps.
+ * Although the standard says to zero out unused components, many
+ * implementations fill all of them with the same value. */
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int i = indices[x + y * 4];
+ /* Interval expansion from [-1 1] or [0 1] to [0 255]. */
+ int c = color_tab[i];
+ uint32_t pixel = RGBA(c, c, c, 255U);
+ AV_WL32(dst + x * 4 + y * stride, pixel);
+ }
+ }
+}
+
+static inline void rgtc1_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block, int sign)
+{
+ int color_table[8];
+ int r0, r1;
+
+ if (sign) {
+ /* signed data is in [-128 127] so just offset it to unsigned
+ * and it can be treated exactly the same */
+ r0 = ((int8_t) block[0]) + 128;
+ r1 = ((int8_t) block[1]) + 128;
+ } else {
+ r0 = block[0];
+ r1 = block[1];
+ }
+
+ color_table[0] = r0;
+ color_table[1] = r1;
+
+ if (r0 > r1) {
+ /* 6 interpolated color values */
+ color_table[2] = (6 * r0 + 1 * r1) / 7; // bit code 010
+ color_table[3] = (5 * r0 + 2 * r1) / 7; // bit code 011
+ color_table[4] = (4 * r0 + 3 * r1) / 7; // bit code 100
+ color_table[5] = (3 * r0 + 4 * r1) / 7; // bit code 101
+ color_table[6] = (2 * r0 + 5 * r1) / 7; // bit code 110
+ color_table[7] = (1 * r0 + 6 * r1) / 7; // bit code 111
+ } else {
+ /* 4 interpolated color values */
+ color_table[2] = (4 * r0 + 1 * r1) / 5; // bit code 010
+ color_table[3] = (3 * r0 + 2 * r1) / 5; // bit code 011
+ color_table[4] = (2 * r0 + 3 * r1) / 5; // bit code 100
+ color_table[5] = (1 * r0 + 4 * r1) / 5; // bit code 101
+ color_table[6] = 0; /* min range */ // bit code 110
+ color_table[7] = 255; /* max range */ // bit code 111
+ }
+
+ rgtc_block_internal(dst, stride, block, color_table);
+}
+
+/**
+ * Decompress one block of a RGRC1 texture with signed components
+ * and store the resulting RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int rgtc1s_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ rgtc1_block_internal(dst, stride, block, 1);
+
+ return 8;
+}
+
+/**
+ * Decompress one block of a RGRC1 texture with unsigned components
+ * and store the resulting RGBA pixels in 'dst'.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int rgtc1u_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ rgtc1_block_internal(dst, stride, block, 0);
+
+ return 8;
+}
+
+static inline void rgtc2_block_internal(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *block, int sign)
+{
+ /* 4x4 block containing 4 component pixels. */
+ uint8_t c0[4 * 4 * 4];
+ uint8_t c1[4 * 4 * 4];
+ int x, y;
+
+ /* Decompress the two channels separately and interleave them afterwards. */
+ rgtc1_block_internal(c0, 16, block, sign);
+ rgtc1_block_internal(c1, 16, block + 8, sign);
+
+ /* B is rebuilt exactly like a normal map. */
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ uint8_t *p = dst + x * 4 + y * stride;
+ int r = c0[x * 4 + y * 16];
+ int g = c1[x * 4 + y * 16];
+ int b = 127;
+
+ int d = (255 * 255 - r * r - g * g) / 2;
+ if (d > 0)
+ b = rint(sqrtf(d));
+
+ p[0] = r;
+ p[1] = g;
+ p[2] = b;
+ p[3] = 255;
+ }
+ }
+}
+
+/**
+ * Decompress one block of a RGRC2 texture with signed components
+ * and store the resulting RGBA pixels in 'dst'. Alpha is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int rgtc2s_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ rgtc2_block_internal(dst, stride, block, 1);
+
+ return 16;
+}
+
+/**
+ * Decompress one block of a RGRC2 texture with unsigned components
+ * and store the resulting RGBA pixels in 'dst'. Alpha is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int rgtc2u_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ rgtc2_block_internal(dst, stride, block, 0);
+
+ return 16;
+}
+
+/**
+ * Decompress one block of a 3Dc texture with unsigned components
+ * and store the resulting RGBA pixels in 'dst'. Alpha is fully opaque.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to decompress.
+ * @return how much texture data has been consumed.
+ */
+static int dxn3dc_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+ rgtc2_block_internal(dst, stride, block, 0);
+
+ /* This is the 3Dc variant of RGTC2, with swapped R and G. */
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ uint8_t *p = dst + x * 4 + y * stride;
+ FFSWAP(uint8_t, p[0], p[1]);
+ }
+ }
+
+ return 16;
+}
+
+av_cold void ff_texturedsp_init(TextureDSPContext *c)
+{
+ c->dxt1_block = dxt1_block;
+ c->dxt1a_block = dxt1a_block;
+ c->dxt2_block = dxt2_block;
+ c->dxt3_block = dxt3_block;
+ c->dxt4_block = dxt4_block;
+ c->dxt5_block = dxt5_block;
+ c->dxt5y_block = dxt5y_block;
+ c->dxt5ys_block = dxt5ys_block;
+ c->rgtc1s_block = rgtc1s_block;
+ c->rgtc1u_block = rgtc1u_block;
+ c->rgtc2s_block = rgtc2s_block;
+ c->rgtc2u_block = rgtc2u_block;
+ c->dxn3dc_block = dxn3dc_block;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/texturedsp.h b/chromium/third_party/ffmpeg/libavcodec/texturedsp.h
new file mode 100644
index 00000000000..26f3b6473fc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/texturedsp.h
@@ -0,0 +1,64 @@
+/*
+ * Texture block module
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Texture block (4x4) module
+ *
+ * References:
+ * https://www.opengl.org/wiki/S3_Texture_Compression
+ * https://www.opengl.org/wiki/Red_Green_Texture_Compression
+ * https://msdn.microsoft.com/en-us/library/bb694531%28v=vs.85%29.aspx
+ *
+ * All functions return how much data has been written or read.
+ *
+ * Pixel input or output format is always AV_PIX_FMT_RGBA.
+ */
+
+#ifndef AVCODEC_TEXTUREDSP_H
+#define AVCODEC_TEXTUREDSP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define TEXTURE_BLOCK_W 4
+#define TEXTURE_BLOCK_H 4
+
+typedef struct TextureDSPContext {
+ int (*dxt1_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt1a_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt2_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt3_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt4_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt5_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt5y_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxt5ys_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*rgtc1s_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*rgtc1u_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*rgtc2s_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*rgtc2u_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*dxn3dc_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+} TextureDSPContext;
+
+void ff_texturedsp_init(TextureDSPContext *c);
+void ff_texturedspenc_init(TextureDSPContext *c);
+
+#endif /* AVCODEC_TEXTUREDSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/texturedspenc.c b/chromium/third_party/ffmpeg/libavcodec/texturedspenc.c
new file mode 100644
index 00000000000..5bd07771e7c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/texturedspenc.c
@@ -0,0 +1,659 @@
+/*
+ * Texture block compression
+ * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
+ * Based on public domain code by Fabian Giesen, Sean Barrett and Yann Collet.
+ *
+ * This file is part of FFmpeg
+ *
+ * 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 <stddef.h>
+#include <stdint.h>
+
+#include "libavutil/attributes.h"
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+
+#include "texturedsp.h"
+
+const static uint8_t expand5[32] = {
+ 0, 8, 16, 24, 33, 41, 49, 57, 66, 74, 82, 90,
+ 99, 107, 115, 123, 132, 140, 148, 156, 165, 173, 181, 189,
+ 198, 206, 214, 222, 231, 239, 247, 255,
+};
+
+const static uint8_t expand6[64] = {
+ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44,
+ 48, 52, 56, 60, 65, 69, 73, 77, 81, 85, 89, 93,
+ 97, 101, 105, 109, 113, 117, 121, 125, 130, 134, 138, 142,
+ 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190,
+ 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239,
+ 243, 247, 251, 255,
+};
+
+const static uint8_t match5[256][2] = {
+ { 0, 0 }, { 0, 0 }, { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 },
+ { 1, 0 }, { 1, 1 }, { 1, 1 }, { 2, 0 }, { 2, 0 }, { 0, 4 },
+ { 2, 1 }, { 2, 1 }, { 2, 1 }, { 3, 0 }, { 3, 0 }, { 3, 0 },
+ { 3, 1 }, { 1, 5 }, { 3, 2 }, { 3, 2 }, { 4, 0 }, { 4, 0 },
+ { 4, 1 }, { 4, 1 }, { 4, 2 }, { 4, 2 }, { 4, 2 }, { 3, 5 },
+ { 5, 1 }, { 5, 1 }, { 5, 2 }, { 4, 4 }, { 5, 3 }, { 5, 3 },
+ { 5, 3 }, { 6, 2 }, { 6, 2 }, { 6, 2 }, { 6, 3 }, { 5, 5 },
+ { 6, 4 }, { 6, 4 }, { 4, 8 }, { 7, 3 }, { 7, 3 }, { 7, 3 },
+ { 7, 4 }, { 7, 4 }, { 7, 4 }, { 7, 5 }, { 5, 9 }, { 7, 6 },
+ { 7, 6 }, { 8, 4 }, { 8, 4 }, { 8, 5 }, { 8, 5 }, { 8, 6 },
+ { 8, 6 }, { 8, 6 }, { 7, 9 }, { 9, 5 }, { 9, 5 }, { 9, 6 },
+ { 8, 8 }, { 9, 7 }, { 9, 7 }, { 9, 7 }, { 10, 6 }, { 10, 6 },
+ { 10, 6 }, { 10, 7 }, { 9, 9 }, { 10, 8 }, { 10, 8 }, { 8, 12 },
+ { 11, 7 }, { 11, 7 }, { 11, 7 }, { 11, 8 }, { 11, 8 }, { 11, 8 },
+ { 11, 9 }, { 9, 13 }, { 11, 10 }, { 11, 10 }, { 12, 8 }, { 12, 8 },
+ { 12, 9 }, { 12, 9 }, { 12, 10 }, { 12, 10 }, { 12, 10 }, { 11, 13 },
+ { 13, 9 }, { 13, 9 }, { 13, 10 }, { 12, 12 }, { 13, 11 }, { 13, 11 },
+ { 13, 11 }, { 14, 10 }, { 14, 10 }, { 14, 10 }, { 14, 11 }, { 13, 13 },
+ { 14, 12 }, { 14, 12 }, { 12, 16 }, { 15, 11 }, { 15, 11 }, { 15, 11 },
+ { 15, 12 }, { 15, 12 }, { 15, 12 }, { 15, 13 }, { 13, 17 }, { 15, 14 },
+ { 15, 14 }, { 16, 12 }, { 16, 12 }, { 16, 13 }, { 16, 13 }, { 16, 14 },
+ { 16, 14 }, { 16, 14 }, { 15, 17 }, { 17, 13 }, { 17, 13 }, { 17, 14 },
+ { 16, 16 }, { 17, 15 }, { 17, 15 }, { 17, 15 }, { 18, 14 }, { 18, 14 },
+ { 18, 14 }, { 18, 15 }, { 17, 17 }, { 18, 16 }, { 18, 16 }, { 16, 20 },
+ { 19, 15 }, { 19, 15 }, { 19, 15 }, { 19, 16 }, { 19, 16 }, { 19, 16 },
+ { 19, 17 }, { 17, 21 }, { 19, 18 }, { 19, 18 }, { 20, 16 }, { 20, 16 },
+ { 20, 17 }, { 20, 17 }, { 20, 18 }, { 20, 18 }, { 20, 18 }, { 19, 21 },
+ { 21, 17 }, { 21, 17 }, { 21, 18 }, { 20, 20 }, { 21, 19 }, { 21, 19 },
+ { 21, 19 }, { 22, 18 }, { 22, 18 }, { 22, 18 }, { 22, 19 }, { 21, 21 },
+ { 22, 20 }, { 22, 20 }, { 20, 24 }, { 23, 19 }, { 23, 19 }, { 23, 19 },
+ { 23, 20 }, { 23, 20 }, { 23, 20 }, { 23, 21 }, { 21, 25 }, { 23, 22 },
+ { 23, 22 }, { 24, 20 }, { 24, 20 }, { 24, 21 }, { 24, 21 }, { 24, 22 },
+ { 24, 22 }, { 24, 22 }, { 23, 25 }, { 25, 21 }, { 25, 21 }, { 25, 22 },
+ { 24, 24 }, { 25, 23 }, { 25, 23 }, { 25, 23 }, { 26, 22 }, { 26, 22 },
+ { 26, 22 }, { 26, 23 }, { 25, 25 }, { 26, 24 }, { 26, 24 }, { 24, 28 },
+ { 27, 23 }, { 27, 23 }, { 27, 23 }, { 27, 24 }, { 27, 24 }, { 27, 24 },
+ { 27, 25 }, { 25, 29 }, { 27, 26 }, { 27, 26 }, { 28, 24 }, { 28, 24 },
+ { 28, 25 }, { 28, 25 }, { 28, 26 }, { 28, 26 }, { 28, 26 }, { 27, 29 },
+ { 29, 25 }, { 29, 25 }, { 29, 26 }, { 28, 28 }, { 29, 27 }, { 29, 27 },
+ { 29, 27 }, { 30, 26 }, { 30, 26 }, { 30, 26 }, { 30, 27 }, { 29, 29 },
+ { 30, 28 }, { 30, 28 }, { 30, 28 }, { 31, 27 }, { 31, 27 }, { 31, 27 },
+ { 31, 28 }, { 31, 28 }, { 31, 28 }, { 31, 29 }, { 31, 29 }, { 31, 30 },
+ { 31, 30 }, { 31, 30 }, { 31, 31 }, { 31, 31 },
+};
+
+const static uint8_t match6[256][2] = {
+ { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 0 }, { 1, 1 }, { 2, 0 },
+ { 2, 1 }, { 3, 0 }, { 3, 0 }, { 3, 1 }, { 4, 0 }, { 4, 0 },
+ { 4, 1 }, { 5, 0 }, { 5, 1 }, { 6, 0 }, { 6, 0 }, { 6, 1 },
+ { 7, 0 }, { 7, 0 }, { 7, 1 }, { 8, 0 }, { 8, 1 }, { 8, 1 },
+ { 8, 2 }, { 9, 1 }, { 9, 2 }, { 9, 2 }, { 9, 3 }, { 10, 2 },
+ { 10, 3 }, { 10, 3 }, { 10, 4 }, { 11, 3 }, { 11, 4 }, { 11, 4 },
+ { 11, 5 }, { 12, 4 }, { 12, 5 }, { 12, 5 }, { 12, 6 }, { 13, 5 },
+ { 13, 6 }, { 8, 16 }, { 13, 7 }, { 14, 6 }, { 14, 7 }, { 9, 17 },
+ { 14, 8 }, { 15, 7 }, { 15, 8 }, { 11, 16 }, { 15, 9 }, { 15, 10 },
+ { 16, 8 }, { 16, 9 }, { 16, 10 }, { 15, 13 }, { 17, 9 }, { 17, 10 },
+ { 17, 11 }, { 15, 16 }, { 18, 10 }, { 18, 11 }, { 18, 12 }, { 16, 16 },
+ { 19, 11 }, { 19, 12 }, { 19, 13 }, { 17, 17 }, { 20, 12 }, { 20, 13 },
+ { 20, 14 }, { 19, 16 }, { 21, 13 }, { 21, 14 }, { 21, 15 }, { 20, 17 },
+ { 22, 14 }, { 22, 15 }, { 25, 10 }, { 22, 16 }, { 23, 15 }, { 23, 16 },
+ { 26, 11 }, { 23, 17 }, { 24, 16 }, { 24, 17 }, { 27, 12 }, { 24, 18 },
+ { 25, 17 }, { 25, 18 }, { 28, 13 }, { 25, 19 }, { 26, 18 }, { 26, 19 },
+ { 29, 14 }, { 26, 20 }, { 27, 19 }, { 27, 20 }, { 30, 15 }, { 27, 21 },
+ { 28, 20 }, { 28, 21 }, { 28, 21 }, { 28, 22 }, { 29, 21 }, { 29, 22 },
+ { 24, 32 }, { 29, 23 }, { 30, 22 }, { 30, 23 }, { 25, 33 }, { 30, 24 },
+ { 31, 23 }, { 31, 24 }, { 27, 32 }, { 31, 25 }, { 31, 26 }, { 32, 24 },
+ { 32, 25 }, { 32, 26 }, { 31, 29 }, { 33, 25 }, { 33, 26 }, { 33, 27 },
+ { 31, 32 }, { 34, 26 }, { 34, 27 }, { 34, 28 }, { 32, 32 }, { 35, 27 },
+ { 35, 28 }, { 35, 29 }, { 33, 33 }, { 36, 28 }, { 36, 29 }, { 36, 30 },
+ { 35, 32 }, { 37, 29 }, { 37, 30 }, { 37, 31 }, { 36, 33 }, { 38, 30 },
+ { 38, 31 }, { 41, 26 }, { 38, 32 }, { 39, 31 }, { 39, 32 }, { 42, 27 },
+ { 39, 33 }, { 40, 32 }, { 40, 33 }, { 43, 28 }, { 40, 34 }, { 41, 33 },
+ { 41, 34 }, { 44, 29 }, { 41, 35 }, { 42, 34 }, { 42, 35 }, { 45, 30 },
+ { 42, 36 }, { 43, 35 }, { 43, 36 }, { 46, 31 }, { 43, 37 }, { 44, 36 },
+ { 44, 37 }, { 44, 37 }, { 44, 38 }, { 45, 37 }, { 45, 38 }, { 40, 48 },
+ { 45, 39 }, { 46, 38 }, { 46, 39 }, { 41, 49 }, { 46, 40 }, { 47, 39 },
+ { 47, 40 }, { 43, 48 }, { 47, 41 }, { 47, 42 }, { 48, 40 }, { 48, 41 },
+ { 48, 42 }, { 47, 45 }, { 49, 41 }, { 49, 42 }, { 49, 43 }, { 47, 48 },
+ { 50, 42 }, { 50, 43 }, { 50, 44 }, { 48, 48 }, { 51, 43 }, { 51, 44 },
+ { 51, 45 }, { 49, 49 }, { 52, 44 }, { 52, 45 }, { 52, 46 }, { 51, 48 },
+ { 53, 45 }, { 53, 46 }, { 53, 47 }, { 52, 49 }, { 54, 46 }, { 54, 47 },
+ { 57, 42 }, { 54, 48 }, { 55, 47 }, { 55, 48 }, { 58, 43 }, { 55, 49 },
+ { 56, 48 }, { 56, 49 }, { 59, 44 }, { 56, 50 }, { 57, 49 }, { 57, 50 },
+ { 60, 45 }, { 57, 51 }, { 58, 50 }, { 58, 51 }, { 61, 46 }, { 58, 52 },
+ { 59, 51 }, { 59, 52 }, { 62, 47 }, { 59, 53 }, { 60, 52 }, { 60, 53 },
+ { 60, 53 }, { 60, 54 }, { 61, 53 }, { 61, 54 }, { 61, 54 }, { 61, 55 },
+ { 62, 54 }, { 62, 55 }, { 62, 55 }, { 62, 56 }, { 63, 55 }, { 63, 56 },
+ { 63, 56 }, { 63, 57 }, { 63, 58 }, { 63, 59 }, { 63, 59 }, { 63, 60 },
+ { 63, 61 }, { 63, 62 }, { 63, 62 }, { 63, 63 },
+};
+
+/* Multiplication over 8 bit emulation */
+#define mul8(a, b) (((a) * (b) + 128 + (((a) * (b) + 128) >> 8)) >> 8)
+
+/* Conversion from rgb24 to rgb565 */
+#define rgb2rgb565(r, g, b) \
+ ((mul8(r, 31) << 11) | (mul8(g, 63) << 5) | (mul8(b, 31) << 0))
+
+/* Linear interpolation at 1/3 point between a and b */
+#define lerp13(a, b) ((2 * (a) + (b)) / 3)
+
+/* Linear interpolation on an RGB pixel */
+static inline void lerp13rgb(uint8_t *out, uint8_t *p1, uint8_t *p2)
+{
+ out[0] = lerp13(p1[0], p2[0]);
+ out[1] = lerp13(p1[1], p2[1]);
+ out[2] = lerp13(p1[2], p2[2]);
+}
+
+/* Conversion from rgb565 to rgb24 */
+static inline void rgb5652rgb(uint8_t *out, uint16_t v)
+{
+ int rv = (v & 0xf800) >> 11;
+ int gv = (v & 0x07e0) >> 5;
+ int bv = (v & 0x001f) >> 0;
+
+ out[0] = expand5[rv];
+ out[1] = expand6[gv];
+ out[2] = expand5[bv];
+ out[3] = 0;
+}
+
+/* Color matching function */
+static unsigned int match_colors(const uint8_t *block, ptrdiff_t stride,
+ uint16_t c0, uint16_t c1)
+{
+ uint32_t mask = 0;
+ int dirr, dirg, dirb;
+ int dots[16];
+ int stops[4];
+ int x, y, k = 0;
+ int c0_point, half_point, c3_point;
+ uint8_t color[16];
+ const int indexMap[8] = {
+ 0 << 30, 2 << 30, 0 << 30, 2 << 30,
+ 3 << 30, 3 << 30, 1 << 30, 1 << 30,
+ };
+
+ /* Fill color and compute direction for each component */
+ rgb5652rgb(color + 0, c0);
+ rgb5652rgb(color + 4, c1);
+ lerp13rgb(color + 8, color + 0, color + 4);
+ lerp13rgb(color + 12, color + 4, color + 0);
+
+ dirr = color[0 * 4 + 0] - color[1 * 4 + 0];
+ dirg = color[0 * 4 + 1] - color[1 * 4 + 1];
+ dirb = color[0 * 4 + 2] - color[1 * 4 + 2];
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++)
+ dots[k++] = block[0 + x * 4 + y * stride] * dirr +
+ block[1 + x * 4 + y * stride] * dirg +
+ block[2 + x * 4 + y * stride] * dirb;
+
+ stops[y] = color[0 + y * 4] * dirr +
+ color[1 + y * 4] * dirg +
+ color[2 + y * 4] * dirb;
+ }
+
+ /* Think of the colors as arranged on a line; project point onto that line,
+ * then choose next color out of available ones. we compute the crossover
+ * points for 'best color in top half'/'best in bottom half' and then
+ * the same inside that subinterval.
+ *
+ * Relying on this 1d approximation isn't always optimal in terms of
+ * euclidean distance, but it's very close and a lot faster.
+ *
+ * http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html */
+ c0_point = (stops[1] + stops[3]) >> 1;
+ half_point = (stops[3] + stops[2]) >> 1;
+ c3_point = (stops[2] + stops[0]) >> 1;
+
+ for (x = 0; x < 16; x++) {
+ int dot = dots[x];
+ int bits = (dot < half_point ? 4 : 0) |
+ (dot < c0_point ? 2 : 0) |
+ (dot < c3_point ? 1 : 0);
+
+ mask >>= 2;
+ mask |= indexMap[bits];
+ }
+
+ return mask;
+}
+
+/* Color optimization function */
+static void optimize_colors(const uint8_t *block, ptrdiff_t stride,
+ uint16_t *pmax16, uint16_t *pmin16)
+{
+ const uint8_t *minp;
+ const uint8_t *maxp;
+ const int iter_power = 4;
+ double magn;
+ int v_r, v_g, v_b;
+ float covf[6], vfr, vfg, vfb;
+ int mind, maxd;
+ int cov[6] = { 0 };
+ int mu[3], min[3], max[3];
+ int ch, iter, x, y;
+
+ /* Determine color distribution */
+ for (ch = 0; ch < 3; ch++) {
+ const uint8_t *bp = &block[ch];
+ int muv, minv, maxv;
+
+ muv = minv = maxv = bp[0];
+ for (y = 0; y < 4; y++) {
+ for (x = 4; x < 4; x += 4) {
+ muv += bp[x * 4 + y * stride];
+ if (bp[x] < minv)
+ minv = bp[x * 4 + y * stride];
+ else if (bp[x] > maxv)
+ maxv = bp[x * 4 + y * stride];
+ }
+ }
+
+ mu[ch] = (muv + 8) >> 4;
+ min[ch] = minv;
+ max[ch] = maxv;
+ }
+
+ /* Determine covariance matrix */
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int r = block[x * 4 + stride * y + 0] - mu[0];
+ int g = block[x * 4 + stride * y + 1] - mu[1];
+ int b = block[x * 4 + stride * y + 2] - mu[2];
+
+ cov[0] += r * r;
+ cov[1] += r * g;
+ cov[2] += r * b;
+ cov[3] += g * g;
+ cov[4] += g * b;
+ cov[5] += b * b;
+ }
+ }
+
+ /* Convert covariance matrix to float, find principal axis via power iter */
+ for (x = 0; x < 6; x++)
+ covf[x] = cov[x] / 255.0f;
+
+ vfr = (float) (max[0] - min[0]);
+ vfg = (float) (max[1] - min[1]);
+ vfb = (float) (max[2] - min[2]);
+
+ for (iter = 0; iter < iter_power; iter++) {
+ float r = vfr * covf[0] + vfg * covf[1] + vfb * covf[2];
+ float g = vfr * covf[1] + vfg * covf[3] + vfb * covf[4];
+ float b = vfr * covf[2] + vfg * covf[4] + vfb * covf[5];
+
+ vfr = r;
+ vfg = g;
+ vfb = b;
+ }
+
+ magn = fabs(vfr);
+ if (fabs(vfg) > magn)
+ magn = fabs(vfg);
+ if (fabs(vfb) > magn)
+ magn = fabs(vfb);
+
+ /* if magnitudo is too small, default to luminance */
+ if (magn < 4.0f) {
+ /* JPEG YCbCr luma coefs, scaled by 1000 */
+ v_r = 299;
+ v_g = 587;
+ v_b = 114;
+ } else {
+ magn = 512.0 / magn;
+ v_r = (int) (vfr * magn);
+ v_g = (int) (vfg * magn);
+ v_b = (int) (vfb * magn);
+ }
+
+ /* Pick colors at extreme points */
+ mind = maxd = block[0] * v_r + block[1] * v_g + block[2] * v_b;
+ minp = maxp = block;
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int dot = block[x * 4 + y * stride + 0] * v_r +
+ block[x * 4 + y * stride + 1] * v_g +
+ block[x * 4 + y * stride + 2] * v_b;
+
+ if (dot < mind) {
+ mind = dot;
+ minp = block + x * 4 + y * stride;
+ } else if (dot > maxd) {
+ maxd = dot;
+ maxp = block + x * 4 + y * stride;
+ }
+ }
+ }
+
+ *pmax16 = rgb2rgb565(maxp[0], maxp[1], maxp[2]);
+ *pmin16 = rgb2rgb565(minp[0], minp[1], minp[2]);
+}
+
+/* Try to optimize colors to suit block contents better, by solving
+ * a least squares system via normal equations + Cramer's rule. */
+static int refine_colors(const uint8_t *block, ptrdiff_t stride,
+ uint16_t *pmax16, uint16_t *pmin16, uint32_t mask)
+{
+ uint32_t cm = mask;
+ uint16_t oldMin = *pmin16;
+ uint16_t oldMax = *pmax16;
+ uint16_t min16, max16;
+ int x, y;
+
+ /* Additional magic to save a lot of multiplies in the accumulating loop.
+ * The tables contain precomputed products of weights for least squares
+ * system, accumulated inside one 32-bit register */
+ const int w1tab[4] = { 3, 0, 2, 1 };
+ const int prods[4] = { 0x090000, 0x000900, 0x040102, 0x010402 };
+
+ /* Check if all pixels have the same index */
+ if ((mask ^ (mask << 2)) < 4) {
+ /* If so, linear system would be singular; solve using optimal
+ * single-color match on average color. */
+ int r = 8, g = 8, b = 8;
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ r += block[0 + x * 4 + y * stride];
+ g += block[1 + x * 4 + y * stride];
+ b += block[2 + x * 4 + y * stride];
+ }
+ }
+
+ r >>= 4;
+ g >>= 4;
+ b >>= 4;
+
+ max16 = (match5[r][0] << 11) | (match6[g][0] << 5) | match5[b][0];
+ min16 = (match5[r][1] << 11) | (match6[g][1] << 5) | match5[b][1];
+ } else {
+ float fr, fg, fb;
+ int at1_r = 0, at1_g = 0, at1_b = 0;
+ int at2_r = 0, at2_g = 0, at2_b = 0;
+ int akku = 0;
+ int xx, xy, yy;
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int step = cm & 3;
+ int w1 = w1tab[step];
+ int r = block[0 + x * 4 + y * stride];
+ int g = block[1 + x * 4 + y * stride];
+ int b = block[2 + x * 4 + y * stride];
+
+ akku += prods[step];
+ at1_r += w1 * r;
+ at1_g += w1 * g;
+ at1_b += w1 * b;
+ at2_r += r;
+ at2_g += g;
+ at2_b += b;
+
+ cm >>= 2;
+ }
+ }
+
+ at2_r = 3 * at2_r - at1_r;
+ at2_g = 3 * at2_g - at1_g;
+ at2_b = 3 * at2_b - at1_b;
+
+ /* Extract solutions and decide solvability */
+ xx = akku >> 16;
+ yy = (akku >> 8) & 0xFF;
+ xy = (akku >> 0) & 0xFF;
+
+ fr = 3.0f * 31.0f / 255.0f / (xx * yy - xy * xy);
+ fg = fr * 63.0f / 31.0f;
+ fb = fr;
+
+ /* Solve */
+ max16 = av_clip_uintp2((at1_r * yy - at2_r * xy) * fr + 0.5f, 5) << 11;
+ max16 |= av_clip_uintp2((at1_g * yy - at2_g * xy) * fg + 0.5f, 6) << 5;
+ max16 |= av_clip_uintp2((at1_b * yy - at2_b * xy) * fb + 0.5f, 5) << 0;
+
+ min16 = av_clip_uintp2((at2_r * xx - at1_r * xy) * fr + 0.5f, 5) << 11;
+ min16 |= av_clip_uintp2((at2_g * xx - at1_g * xy) * fg + 0.5f, 6) << 5;
+ min16 |= av_clip_uintp2((at2_b * xx - at1_b * xy) * fb + 0.5f, 5) << 0;
+ }
+
+ *pmin16 = min16;
+ *pmax16 = max16;
+ return oldMin != min16 || oldMax != max16;
+}
+
+/* Check if input block is a constant color */
+static int constant_color(const uint8_t *block, ptrdiff_t stride)
+{
+ int x, y;
+ uint32_t first = AV_RL32(block);
+
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ if (first != AV_RL32(block + x * 4 + y * stride))
+ return 0;
+ return 1;
+}
+
+/* Main color compression function */
+static void compress_color(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ uint32_t mask;
+ uint16_t max16, min16;
+ int constant = constant_color(block, stride);
+
+ /* Constant color will load values from tables */
+ if (constant) {
+ int r = block[0];
+ int g = block[1];
+ int b = block[2];
+ mask = 0xAAAAAAAA;
+ max16 = (match5[r][0] << 11) | (match6[g][0] << 5) | match5[b][0];
+ min16 = (match5[r][1] << 11) | (match6[g][1] << 5) | match5[b][1];
+ } else {
+ int refine;
+
+ /* Otherwise find pca and map along principal axis */
+ optimize_colors(block, stride, &max16, &min16);
+ if (max16 != min16)
+ mask = match_colors(block, stride, max16, min16);
+ else
+ mask = 0;
+
+ /* One pass refinement */
+ refine = refine_colors(block, stride, &max16, &min16, mask);
+ if (refine) {
+ if (max16 != min16)
+ mask = match_colors(block, stride, max16, min16);
+ else
+ mask = 0;
+ }
+ }
+
+ /* Finally write the color block */
+ if (max16 < min16) {
+ FFSWAP(uint16_t, min16, max16);
+ mask ^= 0x55555555;
+ }
+
+ AV_WL16(dst + 0, max16);
+ AV_WL16(dst + 2, min16);
+ AV_WL32(dst + 4, mask);
+}
+
+/* Alpha compression function */
+static void compress_alpha(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+ int dist, bias, dist4, dist2;
+ int mn, mx;
+ int bits = 0;
+ int mask = 0;
+
+ memset(dst, 0, 8);
+
+ /* Find min/max color */
+ mn = mx = block[3];
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int val = block[3 + x * 4 + y * stride];
+ if (val < mn)
+ mn = val;
+ else if (val > mx)
+ mx = val;
+ }
+ }
+
+ /* Encode them */
+ dst[0] = (uint8_t) mx;
+ dst[1] = (uint8_t) mn;
+ dst += 2;
+
+ /* Mono-alpha shortcut */
+ if (mn == mx)
+ return;
+
+ /* Determine bias and emit color indices.
+ * Given the choice of mx/mn, these indices are optimal:
+ * fgiesen.wordpress.com/2009/12/15/dxt5-alpha-block-index-determination */
+ dist = mx - mn;
+
+ dist4 = dist * 4;
+ dist2 = dist * 2;
+ if (dist < 8)
+ bias = dist - 1 - mn * 7;
+ else
+ bias = dist / 2 + 2 - mn * 7;
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int alp = block[3 + x * 4 + y * stride] * 7 + bias;
+ int ind, tmp;
+
+ /* This is a "linear scale" lerp factor between 0 (val=min)
+ * and 7 (val=max) to select index. */
+ tmp = (alp >= dist4) ? -1 : 0;
+ ind = tmp & 4;
+ alp -= dist4 & tmp;
+ tmp = (alp >= dist2) ? -1 : 0;
+ ind += tmp & 2;
+ alp -= dist2 & tmp;
+ ind += (alp >= dist);
+
+ /* Turn linear scale into DXT index (0/1 are extreme points) */
+ ind = -ind & 7;
+ ind ^= (2 > ind);
+
+ /* Write index */
+ mask |= ind << bits;
+ bits += 3;
+ if (bits >= 8) {
+ *dst++ = mask;
+ mask >>= 8;
+ bits -= 8;
+ }
+ }
+ }
+}
+
+/**
+ * Convert a RGBA buffer to unscaled YCoCg.
+ * Scale is usually introduced to avoid banding over a certain range of colors,
+ * but this version of the algorithm does not introduce it as much as other
+ * implementations, allowing for a simpler and faster conversion.
+ */
+static void rgba2ycocg(uint8_t *dst, const uint8_t *pixel)
+{
+ int r = pixel[0];
+ int g = (pixel[1] + 1) >> 1;
+ int b = pixel[2];
+ int t = (2 + r + b) >> 2;
+
+ int y = av_clip_uint8(g + t);
+ int co = av_clip_uint8(128 + ((r - b + 1) >> 1));
+ int cg = av_clip_uint8(128 + g - t);
+
+ dst[0] = (uint8_t) co;
+ dst[1] = (uint8_t) cg;
+ dst[2] = 0;
+ dst[3] = (uint8_t) y;
+}
+
+/**
+ * Compress one block of RGBA pixels in a DXT1 texture and store the
+ * resulting bytes in 'dst'. Alpha is not preserved.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to compress.
+ * @return how much texture data has been written.
+ */
+static int dxt1_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ compress_color(dst, stride, block);
+
+ return 8;
+}
+
+/**
+ * Compress one block of RGBA pixels in a DXT5 texture and store the
+ * resulting bytes in 'dst'. Alpha is preserved.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to compress.
+ * @return how much texture data has been written.
+ */
+static int dxt5_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ compress_alpha(dst, stride, block);
+ compress_color(dst + 8, stride, block);
+
+ return 16;
+}
+
+/**
+ * Compress one block of RGBA pixels in a DXT5-YCoCg texture and store the
+ * resulting bytes in 'dst'. Alpha is not preserved.
+ *
+ * @param dst output buffer.
+ * @param stride scanline in bytes.
+ * @param block block to compress.
+ * @return how much texture data has been written.
+ */
+static int dxt5ys_block(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
+{
+ int x, y;
+ uint8_t reorder[64];
+
+ /* Reorder the components and then run a normal DXT5 compression. */
+ for (y = 0; y < 4; y++)
+ for (x = 0; x < 4; x++)
+ rgba2ycocg(reorder + x * 4 + y * 16, block + x * 4 + y * stride);
+
+ compress_alpha(dst + 0, 16, reorder);
+ compress_color(dst + 8, 16, reorder);
+
+ return 16;
+}
+
+av_cold void ff_texturedspenc_init(TextureDSPContext *c)
+{
+ c->dxt1_block = dxt1_block;
+ c->dxt5_block = dxt5_block;
+ c->dxt5ys_block = dxt5ys_block;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiertexseqv.c b/chromium/third_party/ffmpeg/libavcodec/tiertexseqv.c
index 7c62208dc5b..df12ee38096 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiertexseqv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiertexseqv.c
@@ -265,5 +265,5 @@ AVCodec ff_tiertexseqvideo_decoder = {
.init = seqvideo_decode_init,
.close = seqvideo_decode_end,
.decode = seqvideo_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff.c b/chromium/third_party/ffmpeg/libavcodec/tiff.c
index 7a7f9b748d1..d5c6398a17c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff.c
@@ -453,25 +453,21 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
int i, ret = 0;
int line;
uint8_t *src2 = av_malloc((unsigned)size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!src2) {
av_log(s->avctx, AV_LOG_ERROR,
"Error allocating temporary buffer\n");
return AVERROR(ENOMEM);
}
- if (s->fax_opts & 2) {
- avpriv_request_sample(s->avctx, "Uncompressed fax mode");
- av_free(src2);
- return AVERROR_PATCHWELCOME;
- }
+
if (!s->fill_order) {
memcpy(src2, src, size);
} else {
for (i = 0; i < size; i++)
src2[i] = ff_reverse[src[i]];
}
- memset(src2 + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(src2 + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride,
s->compr, s->fax_opts);
if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8)
@@ -1388,5 +1384,5 @@ AVCodec ff_tiff_decoder = {
.close = tiff_end,
.decode = decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(tiff_init),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiffenc.c b/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
index 2cdac0b213b..3d37d2e0849 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiffenc.c
@@ -311,7 +311,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
for (i = 0; i < s->bpp_tab_size; i++)
- bpp_tab[i] = desc->comp[i].depth_minus1 + 1;
+ bpp_tab[i] = desc->comp[i].depth;
if (s->compr == TIFF_DEFLATE ||
s->compr == TIFF_ADOBE_DEFLATE ||
@@ -329,9 +329,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp *
s->subsampling[0] * s->subsampling[1] + 7) >> 3;
packet_size = avctx->height * bytes_per_row * 2 +
- avctx->height * 4 + FF_MIN_BUFFER_SIZE;
+ avctx->height * 4 + AV_INPUT_BUFFER_MIN_SIZE;
- if ((ret = ff_alloc_packet2(avctx, pkt, packet_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, packet_size, 0)) < 0)
return ret;
ptr = pkt->data;
s->buf_start = pkt->data;
@@ -475,7 +475,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ADD_ENTRY(s, TIFF_YRES, TIFF_RATIONAL, 1, res);
ADD_ENTRY1(s, TIFF_RES_UNIT, TIFF_SHORT, 2);
- if (!(avctx->flags & CODEC_FLAG_BITEXACT))
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
ADD_ENTRY(s, TIFF_SOFTWARE_NAME, TIFF_STRING,
strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);
@@ -521,13 +521,12 @@ fail:
static av_cold int encode_init(AVCodecContext *avctx)
{
TiffEncoderContext *s = avctx->priv_data;
-
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->avctx = avctx;
return 0;
@@ -537,7 +536,6 @@ static av_cold int encode_close(AVCodecContext *avctx)
{
TiffEncoderContext *s = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
av_freep(&s->strip_sizes);
av_freep(&s->strip_offsets);
av_freep(&s->yuv_line);
@@ -574,7 +572,7 @@ AVCodec ff_tiff_encoder = {
.priv_data_size = sizeof(TiffEncoderContext),
.init = encode_init,
.close = encode_close,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8,
diff --git a/chromium/third_party/ffmpeg/libavcodec/tmv.c b/chromium/third_party/ffmpeg/libavcodec/tmv.c
index e525a735f6e..b738fcb1037 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tmv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tmv.c
@@ -93,5 +93,5 @@ AVCodec ff_tmv_decoder = {
.id = AV_CODEC_ID_TMV,
.init = tmv_decode_init,
.decode = tmv_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/truemotion1.c b/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
index 660ecf5413e..b8d0de46865 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truemotion1.c
@@ -215,7 +215,7 @@ static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
b = cdt[p2];
r = cdt[p1] << 11;
lo = b + r;
- return (lo + (lo << 16)) << 1;
+ return (lo + (lo * (1 << 16))) * 2;
}
static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
@@ -224,7 +224,7 @@ static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
lo = ydt[p1];
hi = ydt[p2];
- return (lo + (hi << 8) + (hi << 16)) << 1;
+ return (lo + (hi * (1 << 8)) + (hi * (1 << 16))) * 2;
}
static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
@@ -232,8 +232,8 @@ static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
int r, b;
b = cdt[p2];
- r = cdt[p1]<<16;
- return (b+r) << 1;
+ r = cdt[p1] * (1 << 16);
+ return (b+r) * 2;
}
static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table)
@@ -396,12 +396,16 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
}
if (compression_types[header.compression].algorithm == ALGO_RGB24H) {
- new_pix_fmt = AV_PIX_FMT_RGB32;
+ new_pix_fmt = AV_PIX_FMT_0RGB32;
width_shift = 1;
} else
new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well
s->w >>= width_shift;
+ if (s->w & 1) {
+ avpriv_request_sample(s->avctx, "Frame with odd width");
+ return AVERROR_PATCHWELCOME;
+ }
if (s->w != s->avctx->width || s->h != s->avctx->height ||
new_pix_fmt != s->avctx->pix_fmt) {
@@ -912,5 +916,5 @@ AVCodec ff_truemotion1_decoder = {
.init = truemotion1_decode_init,
.close = truemotion1_decode_end,
.decode = truemotion1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
index f70c79c38fa..75373a095b9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
@@ -1023,5 +1023,5 @@ AVCodec ff_truemotion2_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/truespeech.c b/chromium/third_party/ffmpeg/libavcodec/truespeech.c
index f9e860250f6..d4ddfcbf9c1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truespeech.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truespeech.c
@@ -362,5 +362,5 @@ AVCodec ff_truespeech_decoder = {
.priv_data_size = sizeof(TSContext),
.init = truespeech_decode_init,
.decode = truespeech_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tscc.c b/chromium/third_party/ffmpeg/libavcodec/tscc.c
index f9b325b68d1..6b5e275ace8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tscc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tscc.c
@@ -184,5 +184,5 @@ AVCodec ff_tscc_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tscc2.c b/chromium/third_party/ffmpeg/libavcodec/tscc2.c
index 92210f7d394..9bb7ab3ba38 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tscc2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tscc2.c
@@ -384,5 +384,5 @@ AVCodec ff_tscc2_decoder = {
.init = tscc2_decode_init,
.close = tscc2_decode_end,
.decode = tscc2_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tta.c b/chromium/third_party/ffmpeg/libavcodec/tta.c
index 01584d957e1..1e2e9c4ef4c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tta.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tta.c
@@ -123,6 +123,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
TTAContext *s = avctx->priv_data;
GetBitContext gb;
int total_frames;
+ int ret;
s->avctx = avctx;
@@ -131,7 +132,10 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
return AVERROR_INVALIDDATA;
s->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
- init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ if (ret < 0)
+ return ret;
+
if (show_bits_long(&gb, 32) == AV_RL32("TTA1")) {
/* signature */
skip_bits_long(&gb, 32);
@@ -425,6 +429,6 @@ AVCodec ff_tta_decoder = {
.close = tta_decode_close,
.decode = tta_decode_frame,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.priv_class = &tta_decoder_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ttaenc.c b/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
index ccd41a90c9a..0df1fcb6aa4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ttaenc.c
@@ -116,7 +116,7 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
PutBitContext pb;
int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps, 0)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
@@ -224,7 +224,7 @@ AVCodec ff_tta_encoder = {
.init = tta_encode_init,
.close = tta_encode_close,
.encode2 = tta_encode_frame,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_LOSSLESS,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_LOSSLESS,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8,
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_S32,
diff --git a/chromium/third_party/ffmpeg/libavcodec/twinvq.c b/chromium/third_party/ffmpeg/libavcodec/twinvq.c
index 4c289b0c92a..7b2e19e536b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/twinvq.c
+++ b/chromium/third_party/ffmpeg/libavcodec/twinvq.c
@@ -789,7 +789,7 @@ av_cold int ff_twinvq_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- tctx->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ tctx->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!tctx->fdsp) {
ff_twinvq_decode_close(avctx);
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/twinvq.h b/chromium/third_party/ffmpeg/libavcodec/twinvq.h
index 206eeaaf831..228a4894e2d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/twinvq.h
+++ b/chromium/third_party/ffmpeg/libavcodec/twinvq.h
@@ -200,4 +200,4 @@ int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data,
int ff_twinvq_decode_close(AVCodecContext *avctx);
int ff_twinvq_decode_init(AVCodecContext *avctx);
-#endif /* AVCODEC_TWINVQ_DATA_H */
+#endif /* AVCODEC_TWINVQ_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/twinvqdec.c b/chromium/third_party/ffmpeg/libavcodec/twinvqdec.c
index 3ea4dfa1361..5f4dd350a02 100644
--- a/chromium/third_party/ffmpeg/libavcodec/twinvqdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/twinvqdec.c
@@ -422,7 +422,7 @@ AVCodec ff_twinvq_decoder = {
.init = twinvq_decode_init,
.close = ff_twinvq_decode_close,
.decode = ff_twinvq_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/txd.c b/chromium/third_party/ffmpeg/libavcodec/txd.c
index d2884ad1c62..0c95faaf890 100644
--- a/chromium/third_party/ffmpeg/libavcodec/txd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/txd.c
@@ -26,18 +26,25 @@
#include "bytestream.h"
#include "avcodec.h"
#include "internal.h"
-#include "s3tc.h"
+#include "texturedsp.h"
+
+#define TXD_DXT1 0x31545844
+#define TXD_DXT3 0x33545844
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt) {
GetByteContext gb;
+ TextureDSPContext dxtc;
AVFrame * const p = data;
unsigned int version, w, h, d3d_format, depth, stride, flags;
unsigned int y, v;
uint8_t *ptr;
uint32_t *pal;
+ int i, j;
int ret;
+ ff_texturedsp_init(&dxtc);
+
bytestream2_init(&gb, avpkt->data, avpkt->size);
version = bytestream2_get_le32(&gb);
bytestream2_skip(&gb, 72);
@@ -57,7 +64,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_PAL8;
} else if (depth == 16 || depth == 32) {
- avctx->pix_fmt = AV_PIX_FMT_RGB32;
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
} else {
av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);
return AVERROR_PATCHWELCOME;
@@ -66,6 +73,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
return ret;
+ avctx->coded_width = FFALIGN(w, 4);
+ avctx->coded_height = FFALIGN(h, 4);
+
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;
@@ -93,15 +103,27 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case 0:
if (!(flags & 1))
goto unsupported;
- case FF_S3TC_DXT1:
+ case TXD_DXT1:
if (bytestream2_get_bytes_left(&gb) < FF_CEIL_RSHIFT(w, 2) * FF_CEIL_RSHIFT(h, 2) * 8)
return AVERROR_INVALIDDATA;
- ff_decode_dxt1(&gb, ptr, w, h, stride);
+ for (j = 0; j < avctx->height; j += 4) {
+ for (i = 0; i < avctx->width; i += 4) {
+ uint8_t *p = ptr + i * 4 + j * stride;
+ int step = dxtc.dxt1_block(p, stride, gb.buffer);
+ bytestream2_skip(&gb, step);
+ }
+ }
break;
- case FF_S3TC_DXT3:
+ case TXD_DXT3:
if (bytestream2_get_bytes_left(&gb) < FF_CEIL_RSHIFT(w, 2) * FF_CEIL_RSHIFT(h, 2) * 16)
return AVERROR_INVALIDDATA;
- ff_decode_dxt3(&gb, ptr, w, h, stride);
+ for (j = 0; j < avctx->height; j += 4) {
+ for (i = 0; i < avctx->width; i += 4) {
+ uint8_t *p = ptr + i * 4 + j * stride;
+ int step = dxtc.dxt3_block(p, stride, gb.buffer);
+ bytestream2_skip(&gb, step);
+ }
+ }
break;
default:
goto unsupported;
@@ -137,5 +159,5 @@ AVCodec ff_txd_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_TXD,
.decode = txd_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ulti.c b/chromium/third_party/ffmpeg/libavcodec/ulti.c
index d14603a2cd3..e6f43749811 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ulti.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ulti.c
@@ -424,5 +424,5 @@ AVCodec ff_ulti_decoder = {
.init = ulti_decode_init,
.close = ulti_decode_end,
.decode = ulti_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/utils.c b/chromium/third_party/ffmpeg/libavcodec/utils.c
index a444a5ead8e..3e4cea531af 100755
--- a/chromium/third_party/ffmpeg/libavcodec/utils.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utils.c
@@ -36,6 +36,7 @@
#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
@@ -122,42 +123,28 @@ static int volatile entangled_thread_counter = 0;
static void *codec_mutex;
static void *avformat_mutex;
-static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
-{
- void **p = ptr;
- if (min_size <= *size && *p)
- return 0;
- min_size = FFMAX(17 * min_size / 16 + 32, min_size);
- av_free(*p);
- *p = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
- if (!*p)
- min_size = 0;
- *size = min_size;
- return 1;
-}
-
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
{
uint8_t **p = ptr;
- if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_freep(p);
*size = 0;
return;
}
- if (!ff_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))
- memset(*p + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!ff_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE, 1))
+ memset(*p + min_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
{
uint8_t **p = ptr;
- if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_freep(p);
*size = 0;
return;
}
- if (!ff_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE, 1))
- memset(*p, 0, min_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!ff_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE, 1))
+ memset(*p, 0, min_size + AV_INPUT_BUFFER_PADDING_SIZE);
}
/* encoder management */
@@ -428,11 +415,18 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*width = FFALIGN(*width, w_align);
*height = FFALIGN(*height, h_align);
- if (s->codec_id == AV_CODEC_ID_H264 || s->lowres)
+ if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) {
// some of the optimized chroma MC reads one line too much
// which is also done in mpeg decoders with lowres > 0
*height += 2;
+ // H.264 uses edge emulation for out of frame motion vectors, for this
+ // it requires a temporary area large enough to hold a 21x21 block,
+ // increasing witdth ensure that the temporary area is large enough,
+ // the next rounded up width is 32
+ *width = FFMAX(*width, 32);
+ }
+
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;
}
@@ -706,7 +700,7 @@ void avpriv_color_frame(AVFrame *frame, const int c[4])
int bytes = is_chroma ? FF_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width;
int height = is_chroma ? FF_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height;
for (y = 0; y < height; y++) {
- if (desc->comp[0].depth_minus1 >= 8) {
+ if (desc->comp[0].depth >= 9) {
for (x = 0; x<bytes; x++)
((uint16_t*)dst)[x] = c[p];
}else
@@ -723,12 +717,6 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
if ((ret = update_frame_pool(avctx, frame)) < 0)
return ret;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
- frame->type = FF_BUFFER_TYPE_INTERNAL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
switch (avctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
return video_get_buffer(avctx, frame);
@@ -739,6 +727,18 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
+static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame)
+{
+ int size;
+ const uint8_t *side_metadata;
+
+ AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
+
+ side_metadata = av_packet_get_side_data(avpkt,
+ AV_PKT_DATA_STRINGS_METADATA, &size);
+ return av_packet_unpack_dictionary(side_metadata, size, frame_md);
+}
+
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
{
AVPacket *pkt = avctx->internal->pkt;
@@ -772,6 +772,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
memcpy(frame_sd->data, packet_sd, size);
}
}
+ add_metadata_from_side_data(pkt, frame);
} else {
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_pkt_pos (frame, -1);
@@ -836,35 +837,6 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
return 0;
}
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
-{
- return avcodec_default_get_buffer2(avctx, frame, 0);
-}
-
-typedef struct CompatReleaseBufPriv {
- AVCodecContext avctx;
- AVFrame frame;
- uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
-} CompatReleaseBufPriv;
-
-static void compat_free_buffer(void *opaque, uint8_t *data)
-{
- CompatReleaseBufPriv *priv = opaque;
- if (priv->avctx.release_buffer)
- priv->avctx.release_buffer(&priv->avctx, &priv->frame);
- av_freep(&priv);
-}
-
-static void compat_release_buffer(void *opaque, uint8_t *data)
-{
- AVBufferRef *buf = opaque;
- av_buffer_unref(&buf);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
return ff_init_buffer_info(avctx, frame);
@@ -892,8 +864,6 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
ret = ff_decode_frame_props(avctx, frame);
if (ret < 0)
return ret;
- if ((ret = ff_init_buffer_info(avctx, frame)) < 0)
- return ret;
if (hwaccel) {
if (hwaccel->alloc_frame) {
@@ -903,124 +873,6 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
} else
avctx->sw_pix_fmt = avctx->pix_fmt;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
- /*
- * Wrap an old get_buffer()-allocated buffer in a bunch of AVBuffers.
- * We wrap each plane in its own AVBuffer. Each of those has a reference to
- * a dummy AVBuffer as its private data, unreffing it on free.
- * When all the planes are freed, the dummy buffer's free callback calls
- * release_buffer().
- */
- if (avctx->get_buffer) {
- CompatReleaseBufPriv *priv = NULL;
- AVBufferRef *dummy_buf = NULL;
- int planes, i, ret;
-
- if (flags & AV_GET_BUFFER_FLAG_REF)
- frame->reference = 1;
-
- ret = avctx->get_buffer(avctx, frame);
- if (ret < 0)
- return ret;
-
- /* return if the buffers are already set up
- * this would happen e.g. when a custom get_buffer() calls
- * avcodec_default_get_buffer
- */
- if (frame->buf[0])
- goto end0;
-
- priv = av_mallocz(sizeof(*priv));
- if (!priv) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- priv->avctx = *avctx;
- priv->frame = *frame;
-
- dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, priv, 0);
- if (!dummy_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
-#define WRAP_PLANE(ref_out, data, data_size) \
-do { \
- AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf); \
- if (!dummy_ref) { \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
- ref_out = av_buffer_create(data, data_size, compat_release_buffer, \
- dummy_ref, 0); \
- if (!ref_out) { \
- av_buffer_unref(&dummy_ref); \
- av_frame_unref(frame); \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
-} while (0)
-
- if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-
- planes = av_pix_fmt_count_planes(frame->format);
- /* workaround for AVHWAccel plane count of 0, buf[0] is used as
- check for allocated buffers: make libavcodec happy */
- if (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
- planes = 1;
- if (!desc || planes <= 0) {
- ret = AVERROR(EINVAL);
- goto fail;
- }
-
- for (i = 0; i < planes; i++) {
- int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
- int plane_size = (frame->height >> v_shift) * frame->linesize[i];
-
- WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
- }
- } else {
- int planar = av_sample_fmt_is_planar(frame->format);
- planes = planar ? avctx->channels : 1;
-
- if (planes > FF_ARRAY_ELEMS(frame->buf)) {
- frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_malloc_array(sizeof(*frame->extended_buf),
- frame->nb_extended_buf);
- if (!frame->extended_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- }
-
- for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
- WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
-
- for (i = 0; i < frame->nb_extended_buf; i++)
- WRAP_PLANE(frame->extended_buf[i],
- frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
- frame->linesize[0]);
- }
-
- av_buffer_unref(&dummy_buf);
-
-end0:
- frame->width = avctx->width;
- frame->height = avctx->height;
-
- return 0;
-
-fail:
- avctx->release_buffer(avctx, frame);
- av_freep(&priv);
- av_buffer_unref(&dummy_buf);
- return ret;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
ret = avctx->get_buffer2(avctx, frame, flags);
end:
@@ -1087,21 +939,6 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
return ret;
}
-#if FF_API_GET_BUFFER
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
-{
- av_assert0(s->codec_type == AVMEDIA_TYPE_VIDEO);
-
- av_frame_unref(pic);
-}
-
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
-{
- av_assert0(0);
- return AVERROR_BUG;
-}
-#endif
-
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
{
int i;
@@ -1176,6 +1013,13 @@ static int setup_hwaccel(AVCodecContext *avctx,
return AVERROR(ENOENT);
}
+ if (hwa->capabilities & HWACCEL_CODEC_CAP_EXPERIMENTAL &&
+ avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
+ av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n",
+ hwa->name);
+ return AVERROR_PATCHWELCOME;
+ }
+
if (hwa->priv_data_size) {
avctx->internal->hwaccel_priv_data = av_mallocz(hwa->priv_data_size);
if (!avctx->internal->hwaccel_priv_data)
@@ -1231,8 +1075,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
- if (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+#if FF_API_CAP_VDPAU
+ if (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
break;
+#endif
if (!setup_hwaccel(avctx, ret, desc->name))
break;
@@ -1250,37 +1096,17 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
return ret;
}
-#if FF_API_AVFRAME_LAVC
-void avcodec_get_frame_defaults(AVFrame *frame)
-{
-#if LIBAVCODEC_VERSION_MAJOR >= 55
- // extended_data should explicitly be freed when needed, this code is unsafe currently
- // also this is not compatible to the <55 ABI/API
- if (frame->extended_data != frame->data && 0)
- av_freep(&frame->extended_data);
-#endif
-
- memset(frame, 0, sizeof(AVFrame));
- av_frame_unref(frame);
-}
-
-AVFrame *avcodec_alloc_frame(void)
-{
- return av_frame_alloc();
-}
-
-void avcodec_free_frame(AVFrame **frame)
-{
- av_frame_free(frame);
-}
-#endif
-
MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
MAKE_ACCESSORS(AVCodecContext, codec, int, seek_preroll)
MAKE_ACCESSORS(AVCodecContext, codec, uint16_t*, chroma_intra_matrix)
+unsigned av_codec_get_codec_properties(const AVCodecContext *codec)
+{
+ return codec->properties;
+}
+
int av_codec_get_max_lowres(const AVCodec *codec)
{
return codec->max_lowres;
@@ -1401,9 +1227,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
- // only call ff_set_dimensions() for non H.264/VP6F codecs so as not to overwrite previously setup dimensions
+ // only call ff_set_dimensions() for non H.264/VP6F/DXV codecs so as not to overwrite previously setup dimensions
if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height &&
- (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F))) {
+ (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F || avctx->codec_id == AV_CODEC_ID_DXV))) {
if (avctx->coded_width && avctx->coded_height)
ret = ff_set_dimensions(avctx, avctx->coded_width, avctx->coded_height);
else if (avctx->width && avctx->height)
@@ -1454,7 +1280,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avctx->frame_number = 0;
avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
- if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder";
AVCodec *codec2;
@@ -1463,7 +1289,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
"add '-strict %d' if you want to use it.\n",
codec_string, codec->name, FF_COMPLIANCE_EXPERIMENTAL);
codec2 = av_codec_is_encoder(codec) ? avcodec_find_encoder(codec->id) : avcodec_find_decoder(codec->id);
- if (!(codec2->capabilities & CODEC_CAP_EXPERIMENTAL))
+ if (!(codec2->capabilities & AV_CODEC_CAP_EXPERIMENTAL))
av_log(avctx, AV_LOG_ERROR, "Alternatively use the non experimental %s '%s'.\n",
codec_string, codec2->name);
ret = AVERROR_EXPERIMENTAL;
@@ -1494,7 +1320,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
- if (!HAVE_THREADS && !(codec->capabilities & CODEC_CAP_AUTO_THREADS))
+ if (!HAVE_THREADS && !(codec->capabilities & AV_CODEC_CAP_AUTO_THREADS))
avctx->thread_count = 1;
if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
@@ -1512,6 +1338,15 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (av_codec_is_encoder(avctx->codec)) {
int i;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame) {
+ ret = AVERROR(ENOMEM);
+ goto free_and_end;
+ }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
if (avctx->codec->sample_fmts) {
for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) {
if (avctx->sample_fmt == avctx->codec->sample_fmts[i])
@@ -1564,6 +1399,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
+ if (avctx->sample_rate < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n",
+ avctx->sample_rate);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if (avctx->codec->channel_layouts) {
if (!avctx->channel_layout) {
av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n");
@@ -1594,6 +1435,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
} else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
+ if (avctx->channels < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Specified number of channels %d is not supported\n",
+ avctx->channels);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if (avctx->width <= 0 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "dimensions not set\n");
@@ -1615,7 +1462,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avctx->pts_correction_last_pts =
avctx->pts_correction_last_dts = INT64_MIN;
- if ( !CONFIG_GRAY && avctx->flags & CODEC_FLAG_GRAY
+ if ( !CONFIG_GRAY && avctx->flags & AV_CODEC_FLAG_GRAY
&& avctx->codec_descriptor->type == AVMEDIA_TYPE_VIDEO)
av_log(avctx, AV_LOG_WARNING,
"gray decoding requested but not enabled at configuration time\n");
@@ -1722,6 +1569,12 @@ free_and_end:
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ av_frame_free(&avctx->coded_frame);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
av_dict_free(&tmp);
av_freep(&avctx->priv_data);
if (avctx->internal) {
@@ -1733,39 +1586,29 @@ free_and_end:
goto end;
}
-int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
+int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
{
if (avpkt->size < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid negative user packet size %d\n", avpkt->size);
return AVERROR(EINVAL);
}
- if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (size < 0 || size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_log(avctx, AV_LOG_ERROR, "Invalid minimum required packet size %"PRId64" (max allowed is %d)\n",
- size, INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE);
+ size, INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE);
return AVERROR(EINVAL);
}
- if (avctx) {
+ if (avctx && 2*min_size < size) { // FIXME The factor needs to be finetuned
av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
if (!avpkt->data || avpkt->size < size) {
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
avpkt->data = avctx->internal->byte_buffer;
avpkt->size = avctx->internal->byte_buffer_size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
}
if (avpkt->data) {
AVBufferRef *buf = avpkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- void *destruct = avpkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avpkt->size < size) {
av_log(avctx, AV_LOG_ERROR, "User packet is too small (%d < %"PRId64")\n", avpkt->size, size);
@@ -1773,11 +1616,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
av_init_packet(avpkt);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
avpkt->buf = buf;
avpkt->size = size;
return 0;
@@ -1791,7 +1629,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
int ff_alloc_packet(AVPacket *avpkt, int size)
{
- return ff_alloc_packet2(NULL, avpkt, size);
+ return ff_alloc_packet2(NULL, avpkt, size, 0);
}
/**
@@ -1847,7 +1685,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
*got_packet_ptr = 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
return 0;
@@ -1882,13 +1720,13 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
/* check for valid frame size */
if (frame) {
- if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
+ if (avctx->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME) {
if (frame->nb_samples > avctx->frame_size) {
av_log(avctx, AV_LOG_ERROR, "more samples than frame size (avcodec_encode_audio2)\n");
ret = AVERROR(EINVAL);
goto end;
}
- } else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
+ } else if (!(avctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) {
if (frame->nb_samples < avctx->frame_size &&
!avctx->internal->last_audio_frame) {
ret = pad_last_frame(avctx, &padded_frame, frame);
@@ -1907,10 +1745,12 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
}
+ av_assert0(avctx->codec->encode2);
+
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
if (!ret) {
if (*got_packet_ptr) {
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) {
if (avpkt->pts == AV_NOPTS_VALUE)
avpkt->pts = frame->pts;
if (!avpkt->duration)
@@ -1934,11 +1774,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = user_pkt.destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -1948,7 +1783,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!ret) {
if (needs_realloc && avpkt->data) {
- ret = av_buffer_realloc(&avpkt->buf, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ret = av_buffer_realloc(&avpkt->buf, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret >= 0)
avpkt->data = avpkt->buf->data;
}
@@ -1978,126 +1813,6 @@ end:
return ret;
}
-#if FF_API_OLD_ENCODE_AUDIO
-int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const short *samples)
-{
- AVPacket pkt;
- AVFrame *frame;
- int ret, samples_size, got_packet;
-
- av_init_packet(&pkt);
- pkt.data = buf;
- pkt.size = buf_size;
-
- if (samples) {
- frame = av_frame_alloc();
- if (!frame)
- return AVERROR(ENOMEM);
-
- if (avctx->frame_size) {
- frame->nb_samples = avctx->frame_size;
- } else {
- /* if frame_size is not set, the number of samples must be
- * calculated from the buffer size */
- int64_t nb_samples;
- if (!av_get_bits_per_sample(avctx->codec_id)) {
- av_log(avctx, AV_LOG_ERROR, "avcodec_encode_audio() does not "
- "support this codec\n");
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
- nb_samples = (int64_t)buf_size * 8 /
- (av_get_bits_per_sample(avctx->codec_id) *
- avctx->channels);
- if (nb_samples >= INT_MAX) {
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
- frame->nb_samples = nb_samples;
- }
-
- /* it is assumed that the samples buffer is large enough based on the
- * relevant parameters */
- samples_size = av_samples_get_buffer_size(NULL, avctx->channels,
- frame->nb_samples,
- avctx->sample_fmt, 1);
- if ((ret = avcodec_fill_audio_frame(frame, avctx->channels,
- avctx->sample_fmt,
- (const uint8_t *)samples,
- samples_size, 1)) < 0) {
- av_frame_free(&frame);
- return ret;
- }
-
- /* fabricate frame pts from sample count.
- * this is needed because the avcodec_encode_audio() API does not have
- * a way for the user to provide pts */
- if (avctx->sample_rate && avctx->time_base.num)
- frame->pts = ff_samples_to_time_base(avctx,
- avctx->internal->sample_count);
- else
- frame->pts = AV_NOPTS_VALUE;
- avctx->internal->sample_count += frame->nb_samples;
- } else {
- frame = NULL;
- }
-
- got_packet = 0;
- ret = avcodec_encode_audio2(avctx, &pkt, frame, &got_packet);
- if (!ret && got_packet && avctx->coded_frame) {
- avctx->coded_frame->pts = pkt.pts;
- avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
- }
- /* free any side data since we cannot return it */
- av_packet_free_side_data(&pkt);
-
- if (frame && frame->extended_data != frame->data)
- av_freep(&frame->extended_data);
-
- av_frame_free(&frame);
- return ret ? ret : pkt.size;
-}
-
-#endif
-
-#if FF_API_OLD_ENCODE_VIDEO
-int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVFrame *pict)
-{
- AVPacket pkt;
- int ret, got_packet = 0;
-
- if (buf_size < FF_MIN_BUFFER_SIZE) {
- av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
- return -1;
- }
-
- av_init_packet(&pkt);
- pkt.data = buf;
- pkt.size = buf_size;
-
- ret = avcodec_encode_video2(avctx, &pkt, pict, &got_packet);
- if (!ret && got_packet && avctx->coded_frame) {
- avctx->coded_frame->pts = pkt.pts;
- avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
- }
-
- /* free any side data since we cannot return it */
- if (pkt.side_data_elems > 0) {
- int i;
- for (i = 0; i < pkt.side_data_elems; i++)
- av_free(pkt.side_data[i].data);
- av_freep(&pkt.side_data);
- pkt.side_data_elems = 0;
- }
-
- return ret ? ret : pkt.size;
-}
-
-#endif
-
int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
AVPacket *avpkt,
const AVFrame *frame,
@@ -2113,10 +1828,10 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
avctx->internal->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))
return ff_thread_video_encode_frame(avctx, avpkt, frame, got_packet_ptr);
- if ((avctx->flags&CODEC_FLAG_PASS1) && avctx->stats_out)
+ if ((avctx->flags&AV_CODEC_FLAG_PASS1) && avctx->stats_out)
avctx->stats_out[0] = '\0';
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
avpkt->size = 0;
@@ -2148,11 +1863,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- avpkt->destruct = user_pkt.destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
@@ -2163,11 +1873,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!ret) {
if (!*got_packet_ptr)
avpkt->size = 0;
- else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
+ else if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))
avpkt->pts = avpkt->dts = frame->pts;
if (needs_realloc && avpkt->data) {
- ret = av_buffer_realloc(&avpkt->buf, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ ret = av_buffer_realloc(&avpkt->buf, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret >= 0)
avpkt->data = avpkt->buf->data;
}
@@ -2177,8 +1887,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (ret < 0 || !*got_packet_ptr)
av_free_packet(avpkt);
- else
- av_packet_merge_side_data(avpkt);
emms_c();
return ret;
@@ -2239,12 +1947,13 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
int size = 0, ret;
const uint8_t *data;
uint32_t flags;
+ int64_t val;
data = av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, &size);
if (!data)
return 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_PARAM_CHANGE)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE)) {
av_log(avctx, AV_LOG_ERROR, "This decoder does not support parameter "
"changes, but PARAM_CHANGE side data was sent to it.\n");
return AVERROR(EINVAL);
@@ -2259,7 +1968,12 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
if (size < 4)
goto fail;
- avctx->channels = bytestream_get_le32(&data);
+ val = bytestream_get_le32(&data);
+ if (val <= 0 || val > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid channel count");
+ return AVERROR_INVALIDDATA;
+ }
+ avctx->channels = val;
size -= 4;
}
if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
@@ -2271,7 +1985,12 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
if (size < 4)
goto fail;
- avctx->sample_rate = bytestream_get_le32(&data);
+ val = bytestream_get_le32(&data);
+ if (val <= 0 || val > INT_MAX) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid sample rate");
+ return AVERROR_INVALIDDATA;
+ }
+ avctx->sample_rate = val;
size -= 4;
}
if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
@@ -2291,18 +2010,6 @@ fail:
return AVERROR_INVALIDDATA;
}
-static int add_metadata_from_side_data(AVCodecContext *avctx, AVFrame *frame)
-{
- int size;
- const uint8_t *side_metadata;
-
- AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
-
- side_metadata = av_packet_get_side_data(avctx->internal->pkt,
- AV_PKT_DATA_STRINGS_METADATA, &size);
- return av_packet_unpack_dictionary(side_metadata, size, frame_md);
-}
-
static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame)
{
int ret;
@@ -2371,7 +2078,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
av_frame_unref(picture);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size ||
+ (avctx->active_thread_type & FF_THREAD_FRAME)) {
int did_split = av_packet_split_side_data(&tmp);
ret = apply_param_change(avctx, &tmp);
if (ret < 0) {
@@ -2387,21 +2095,21 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
else {
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
&tmp);
- picture->pkt_dts = avpkt->dts;
+ if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
+ picture->pkt_dts = avpkt->dts;
if(!avctx->has_b_frames){
av_frame_set_pkt_pos(picture, avpkt->pos);
}
//FIXME these should be under if(!avctx->has_b_frames)
/* get_buffer is supposed to set frame parameters */
- if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DR1)) {
if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (!picture->width) picture->width = avctx->width;
if (!picture->height) picture->height = avctx->height;
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt;
}
}
- add_metadata_from_side_data(avctx, picture);
fail:
emms_c(); //needed to avoid an emms_c() call before every return;
@@ -2442,59 +2150,6 @@ fail:
return ret;
}
-#if FF_API_OLD_DECODE_AUDIO
-int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- AVPacket *avpkt)
-{
- AVFrame *frame = av_frame_alloc();
- int ret, got_frame = 0;
-
- if (!frame)
- return AVERROR(ENOMEM);
- if (avctx->get_buffer != avcodec_default_get_buffer) {
- av_log(avctx, AV_LOG_ERROR, "Custom get_buffer() for use with"
- "avcodec_decode_audio3() detected. Overriding with avcodec_default_get_buffer\n");
- av_log(avctx, AV_LOG_ERROR, "Please port your application to "
- "avcodec_decode_audio4()\n");
- avctx->get_buffer = avcodec_default_get_buffer;
- avctx->release_buffer = avcodec_default_release_buffer;
- }
-
- ret = avcodec_decode_audio4(avctx, frame, &got_frame, avpkt);
-
- if (ret >= 0 && got_frame) {
- int ch, plane_size;
- int planar = av_sample_fmt_is_planar(avctx->sample_fmt);
- int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels,
- frame->nb_samples,
- avctx->sample_fmt, 1);
- if (*frame_size_ptr < data_size) {
- av_log(avctx, AV_LOG_ERROR, "output buffer size is too small for "
- "the current frame (%d < %d)\n", *frame_size_ptr, data_size);
- av_frame_free(&frame);
- return AVERROR(EINVAL);
- }
-
- memcpy(samples, frame->extended_data[0], plane_size);
-
- if (planar && avctx->channels > 1) {
- uint8_t *out = ((uint8_t *)samples) + plane_size;
- for (ch = 1; ch < avctx->channels; ch++) {
- memcpy(out, frame->extended_data[ch], plane_size);
- out += plane_size;
- }
- }
- *frame_size_ptr = data_size;
- } else {
- *frame_size_ptr = 0;
- }
- av_frame_free(&frame);
- return ret;
-}
-
-#endif
-
int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
AVFrame *frame,
int *got_frame_ptr,
@@ -2518,7 +2173,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
av_frame_unref(frame);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
uint8_t *side;
int side_size;
uint32_t discard_padding = 0;
@@ -2543,7 +2198,6 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
frame->pkt_dts = avpkt->dts;
}
if (ret >= 0 && *got_frame_ptr) {
- add_metadata_from_side_data(avctx, frame);
avctx->frame_number++;
av_frame_set_best_effort_timestamp(frame,
guess_correct_pts(avctx,
@@ -2569,7 +2223,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
discard_reason = AV_RL8(side + 9);
}
if (avctx->internal->skip_samples && *got_frame_ptr &&
- !(avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL)) {
+ !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
if(frame->nb_samples <= avctx->internal->skip_samples){
*got_frame_ptr = 0;
avctx->internal->skip_samples -= frame->nb_samples;
@@ -2599,7 +2253,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
}
if (discard_padding > 0 && discard_padding <= frame->nb_samples && *got_frame_ptr &&
- !(avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL)) {
+ !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
if (discard_padding == frame->nb_samples) {
*got_frame_ptr = 0;
} else {
@@ -2618,7 +2272,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
}
}
- if ((avctx->flags2 & CODEC_FLAG2_SKIP_MANUAL) && *got_frame_ptr) {
+ if ((avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL) && *got_frame_ptr) {
AVFrameSideData *fside = av_frame_new_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES, 10);
if (fside) {
AV_WL32(fside->data, avctx->internal->skip_samples);
@@ -2671,7 +2325,7 @@ static int recode_subtitle(AVCodecContext *avctx,
inb = inpkt->data;
inl = inpkt->size;
- if (inl >= INT_MAX / UTF8_MAX_BYTES - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (inl >= INT_MAX / UTF8_MAX_BYTES - AV_INPUT_BUFFER_PADDING_SIZE) {
av_log(avctx, AV_LOG_ERROR, "Subtitles packet is too big for recoding\n");
ret = AVERROR(ENOMEM);
goto end;
@@ -2747,7 +2401,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
*got_sub_ptr = 0;
get_subtitle_defaults(sub);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
AVPacket pkt_recoded;
AVPacket tmp = *avpkt;
int did_split = av_packet_split_side_data(&tmp);
@@ -2760,7 +2414,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
* remaining bytes should have already been filled with zeros by the
* original packet allocation anyway. */
memset(tmp.data + tmp.size, 0,
- FFMIN(avpkt->size - tmp.size, FF_INPUT_BUFFER_PADDING_SIZE));
+ FFMIN(avpkt->size - tmp.size, AV_INPUT_BUFFER_PADDING_SIZE));
}
pkt_recoded = tmp;
@@ -2856,7 +2510,6 @@ av_cold int avcodec_close(AVCodecContext *avctx)
ff_thread_free(avctx);
if (avctx->codec && avctx->codec->close)
avctx->codec->close(avctx);
- avctx->coded_frame = NULL;
avctx->internal->byte_buffer_size = 0;
av_freep(&avctx->internal->byte_buffer);
av_frame_free(&avctx->internal->to_free);
@@ -2875,8 +2528,14 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
av_freep(&avctx->priv_data);
- if (av_codec_is_encoder(avctx->codec))
+ if (av_codec_is_encoder(avctx->codec)) {
av_freep(&avctx->extradata);
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ av_frame_free(&avctx->coded_frame);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ }
avctx->codec = NULL;
avctx->active_thread_type = 0;
@@ -2888,25 +2547,6 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
switch(id){
//This is for future deprecatec codec ids, its empty since
//last major bump but will fill up again over time, please don't remove it
-// case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
- case AV_CODEC_ID_BRENDER_PIX_DEPRECATED : return AV_CODEC_ID_BRENDER_PIX;
- case AV_CODEC_ID_OPUS_DEPRECATED : return AV_CODEC_ID_OPUS;
- case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
- case AV_CODEC_ID_PAF_AUDIO_DEPRECATED : return AV_CODEC_ID_PAF_AUDIO;
- case AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S24LE_PLANAR;
- case AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED : return AV_CODEC_ID_PCM_S32LE_PLANAR;
- case AV_CODEC_ID_ADPCM_VIMA_DEPRECATED : return AV_CODEC_ID_ADPCM_VIMA;
- case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
- case AV_CODEC_ID_EXR_DEPRECATED : return AV_CODEC_ID_EXR;
- case AV_CODEC_ID_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
- case AV_CODEC_ID_PAF_VIDEO_DEPRECATED : return AV_CODEC_ID_PAF_VIDEO;
- case AV_CODEC_ID_WEBP_DEPRECATED : return AV_CODEC_ID_WEBP;
- case AV_CODEC_ID_HEVC_DEPRECATED : return AV_CODEC_ID_HEVC;
- case AV_CODEC_ID_MVC1_DEPRECATED : return AV_CODEC_ID_MVC1;
- case AV_CODEC_ID_MVC2_DEPRECATED : return AV_CODEC_ID_MVC2;
- case AV_CODEC_ID_SANM_DEPRECATED : return AV_CODEC_ID_SANM;
- case AV_CODEC_ID_SGIRLE_DEPRECATED : return AV_CODEC_ID_SGIRLE;
- case AV_CODEC_ID_VP7_DEPRECATED : return AV_CODEC_ID_VP7;
default : return id;
}
}
@@ -2919,7 +2559,7 @@ static AVCodec *find_encdec(enum AVCodecID id, int encoder)
while (p) {
if ((encoder ? av_codec_is_encoder(p) : av_codec_is_decoder(p)) &&
p->id == id) {
- if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
+ if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
experimental = p;
} else
return p;
@@ -3066,7 +2706,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
"%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
av_get_pix_fmt_name(enc->pix_fmt));
if (enc->bits_per_raw_sample && enc->pix_fmt != AV_PIX_FMT_NONE &&
- enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1)
+ enc->bits_per_raw_sample < av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth)
av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
av_strlcatf(detail, sizeof(detail), "%s, ",
@@ -3131,6 +2771,13 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (encode) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", q=%d-%d", enc->qmin, enc->qmax);
+ } else {
+ if (enc->properties & FF_CODEC_PROPERTY_CLOSED_CAPTIONS)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ ", Closed Captions");
+ if (enc->properties & FF_CODEC_PROPERTY_LOSSLESS)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ ", lossless");
}
break;
case AVMEDIA_TYPE_AUDIO:
@@ -3168,10 +2815,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
return;
}
if (encode) {
- if (enc->flags & CODEC_FLAG_PASS1)
+ if (enc->flags & AV_CODEC_FLAG_PASS1)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", pass 1");
- if (enc->flags & CODEC_FLAG_PASS2)
+ if (enc->flags & AV_CODEC_FLAG_PASS2)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", pass 2");
}
@@ -3207,11 +2854,6 @@ unsigned avcodec_version(void)
av_assert0(AV_CODEC_ID_SRT==94216);
av_assert0(LIBAVCODEC_VERSION_MICRO >= 100);
- av_assert0(CODEC_ID_CLLC == AV_CODEC_ID_CLLC);
- av_assert0(CODEC_ID_PCM_S8_PLANAR == AV_CODEC_ID_PCM_S8_PLANAR);
- av_assert0(CODEC_ID_ADPCM_IMA_APC == AV_CODEC_ID_ADPCM_IMA_APC);
- av_assert0(CODEC_ID_ILBC == AV_CODEC_ID_ILBC);
- av_assert0(CODEC_ID_SRT == AV_CODEC_ID_SRT);
return LIBAVCODEC_VERSION_INT;
}
@@ -3431,6 +3073,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
case AV_CODEC_ID_ADPCM_IMA_AMV:
return (frame_bytes - 8) * 2 / ch;
case AV_CODEC_ID_ADPCM_THP:
+ case AV_CODEC_ID_ADPCM_THP_LE:
if (avctx->extradata)
return frame_bytes * 14 / (8 * ch);
break;
@@ -3802,7 +3445,7 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
/* Note: the string is NUL terminated (so extradata can be read as a
* string), but the ending character is not accounted in the size (in
* binary formats you are likely not supposed to mux that character). When
- * extradata is copied, it is also padded with FF_INPUT_BUFFER_PADDING_SIZE
+ * extradata is copied, it is also padded with AV_INPUT_BUFFER_PADDING_SIZE
* zeros. */
avctx->extradata_size = buf->len;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/utvideodec.c b/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
index 3a3c46e0bc6..760d9e5a7fb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utvideodec.c
@@ -143,7 +143,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
memcpy(c->slice_bits, src + slice_data_start + c->slices * 4,
slice_size);
- memset(c->slice_bits + slice_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(c->slice_bits + slice_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
c->bdsp.bswap_buf((uint32_t *) c->slice_bits,
(uint32_t *) c->slice_bits,
(slice_data_end - slice_data_start + 3) >> 2);
@@ -385,7 +385,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
- max_slice_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ max_slice_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!c->slice_bits) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
@@ -559,5 +559,5 @@ AVCodec ff_utvideo_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c b/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
index 99791ba1a9a..b8e1cc33e58 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utvideoenc.c
@@ -48,7 +48,6 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx)
UtvideoContext *c = avctx->priv_data;
int i;
- av_frame_free(&avctx->coded_frame);
av_freep(&c->slice_bits);
for (i = 0; i < 4; i++)
av_freep(&c->slice_buffer[i]);
@@ -154,19 +153,11 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- utvideo_encode_close(avctx);
- return AVERROR(ENOMEM);
- }
-
/* extradata size is 4 * 32bit */
avctx->extradata_size = 16;
avctx->extradata = av_mallocz(avctx->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n");
@@ -176,7 +167,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
for (i = 0; i < c->planes; i++) {
c->slice_buffer[i] = av_malloc(c->slice_stride * (avctx->height + 2) +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!c->slice_buffer[i]) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n");
utvideo_encode_close(avctx);
@@ -545,7 +536,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Allocate a new packet if needed, and set it to the pointer dst */
ret = ff_alloc_packet2(avctx, pkt, (256 + 4 * c->slices + width * height) *
- c->planes + 4);
+ c->planes + 4, 0);
if (ret < 0)
return ret;
@@ -622,8 +613,12 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
* At least currently Ut Video is IDR only.
* Set flags accordingly.
*/
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->size = bytestream2_tell_p(&pb);
pkt->flags |= AV_PKT_FLAG_KEY;
@@ -643,7 +638,7 @@ AVCodec ff_utvideo_encoder = {
.init = utvideo_encode_init,
.encode2 = utvideo_encode_frame,
.close = utvideo_encode_close,
- .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
+ .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210dec.c b/chromium/third_party/ffmpeg/libavcodec/v210dec.c
index f1e968d9a44..12d5d5407f9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v210dec.c
@@ -160,7 +160,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
#define V210DEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static const AVOption v210dec_options[] = {
- {"custom_stride", "Custom V210 stride", offsetof(V210DecContext, custom_stride), FF_OPT_TYPE_INT,
+ {"custom_stride", "Custom V210 stride", offsetof(V210DecContext, custom_stride), AV_OPT_TYPE_INT,
{.i64 = 0}, INT_MIN, INT_MAX, V210DEC_FLAGS},
{NULL}
};
@@ -180,6 +180,6 @@ AVCodec ff_v210_decoder = {
.priv_data_size = sizeof(V210DecContext),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.priv_class = &v210dec_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210enc.c b/chromium/third_party/ffmpeg/libavcodec/v210enc.c
index 2e0fd43b4e4..061224885f1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v210enc.c
@@ -82,6 +82,15 @@ static void v210_planar_pack_10_c(const uint16_t *y, const uint16_t *u,
}
}
+av_cold void ff_v210enc_init(V210EncContext *s)
+{
+ s->pack_line_8 = v210_planar_pack_8_c;
+ s->pack_line_10 = v210_planar_pack_10_c;
+
+ if (ARCH_X86)
+ ff_v210enc_init_x86(s);
+}
+
static av_cold int encode_init(AVCodecContext *avctx)
{
V210EncContext *s = avctx->priv_data;
@@ -91,17 +100,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
- s->pack_line_8 = v210_planar_pack_8_c;
- s->pack_line_10 = v210_planar_pack_10_c;
-
- if (ARCH_X86)
- ff_v210enc_init_x86(s);
+ ff_v210enc_init(s);
return 0;
}
@@ -116,7 +121,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int h, w, ret;
uint8_t *dst;
- ret = ff_alloc_packet(pkt, avctx->height * stride);
+ ret = ff_alloc_packet2(avctx, pkt, avctx->height * stride, avctx->height * stride);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
return ret;
@@ -213,13 +218,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
-
- return 0;
-}
-
AVCodec ff_v210_encoder = {
.name = "v210",
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
@@ -228,6 +226,5 @@ AVCodec ff_v210_encoder = {
.priv_data_size = sizeof(V210EncContext),
.init = encode_init,
.encode2 = encode_frame,
- .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210enc.h b/chromium/third_party/ffmpeg/libavcodec/v210enc.h
index 9179d7353e8..a2054270d3d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210enc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/v210enc.h
@@ -30,6 +30,8 @@ typedef struct V210EncContext {
const uint16_t *v, uint8_t *dst, ptrdiff_t width);
} V210EncContext;
+void ff_v210enc_init(V210EncContext *s);
+
void ff_v210enc_init_x86(V210EncContext *s);
#endif /* AVCODEC_V210ENC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210x.c b/chromium/third_party/ffmpeg/libavcodec/v210x.c
index 6330715793c..f6a453aabf6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210x.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v210x.c
@@ -127,5 +127,5 @@ AVCodec ff_v210x_decoder = {
.id = AV_CODEC_ID_V210X,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v308dec.c b/chromium/third_party/ffmpeg/libavcodec/v308dec.c
index 1d31f0a9c7e..dd53fbded49 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v308dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v308dec.c
@@ -79,5 +79,5 @@ AVCodec ff_v308_decoder = {
.id = AV_CODEC_ID_V308,
.init = v308_decode_init,
.decode = v308_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v308enc.c b/chromium/third_party/ffmpeg/libavcodec/v308enc.c
index 408784b0440..b60a72cee6a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v308enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v308enc.c
@@ -31,13 +31,6 @@ static av_cold int v308_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -48,13 +41,10 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *y, *u, *v;
int i, j, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 3)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 3, 0)) < 0)
return ret;
dst = pkt->data;
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
y = pic->data[0];
u = pic->data[1];
v = pic->data[2];
@@ -77,8 +67,6 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int v308_encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -91,4 +79,5 @@ AVCodec ff_v308_encoder = {
.encode2 = v308_encode_frame,
.close = v308_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v408dec.c b/chromium/third_party/ffmpeg/libavcodec/v408dec.c
index be442faae1e..acff95d6bb9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v408dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v408dec.c
@@ -87,7 +87,7 @@ AVCodec ff_ayuv_decoder = {
.id = AV_CODEC_ID_AYUV,
.init = v408_decode_init,
.decode = v408_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
#if CONFIG_V408_DECODER
@@ -98,6 +98,6 @@ AVCodec ff_v408_decoder = {
.id = AV_CODEC_ID_V408,
.init = v408_decode_init,
.decode = v408_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/v408enc.c b/chromium/third_party/ffmpeg/libavcodec/v408enc.c
index cdb2efaf7a0..f37f360b73f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v408enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v408enc.c
@@ -26,12 +26,6 @@
static av_cold int v408_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
return 0;
}
@@ -43,13 +37,10 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *y, *u, *v, *a;
int i, j, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4, 0)) < 0)
return ret;
dst = pkt->data;
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
y = pic->data[0];
u = pic->data[1];
v = pic->data[2];
@@ -82,8 +73,6 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int v408_encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -97,6 +86,7 @@ AVCodec ff_ayuv_encoder = {
.encode2 = v408_encode_frame,
.close = v408_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
#endif
#if CONFIG_V408_ENCODER
@@ -109,5 +99,6 @@ AVCodec ff_v408_encoder = {
.encode2 = v408_encode_frame,
.close = v408_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/v410dec.c b/chromium/third_party/ffmpeg/libavcodec/v410dec.c
index e7a9c0e1098..48fab682735 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v410dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v410dec.c
@@ -94,5 +94,5 @@ AVCodec ff_v410_decoder = {
.id = AV_CODEC_ID_V410,
.init = v410_decode_init,
.decode = v410_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/v410enc.c b/chromium/third_party/ffmpeg/libavcodec/v410enc.c
index f2f7d7349bd..f35ff759639 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v410enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v410enc.c
@@ -32,13 +32,6 @@ static av_cold int v410_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -50,12 +43,17 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint32_t val;
int i, j, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4,
+ avctx->width * avctx->height * 4)) < 0)
return ret;
dst = pkt->data;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->key_frame = 1;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
y = (uint16_t *)pic->data[0];
u = (uint16_t *)pic->data[1];
@@ -79,13 +77,6 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int v410_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
-
- return 0;
-}
-
AVCodec ff_v410_encoder = {
.name = "v410",
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),
@@ -93,6 +84,5 @@ AVCodec ff_v410_encoder = {
.id = AV_CODEC_ID_V410,
.init = v410_encode_init,
.encode2 = v410_encode_frame,
- .close = v410_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi.c b/chromium/third_party/ffmpeg/libavcodec/vaapi.c
index 6ac22e64fac..c081bb57f88 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi.c
@@ -21,7 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "h264.h"
+#include "libavutil/log.h"
#include "vaapi_internal.h"
/**
@@ -34,30 +34,56 @@ static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int
{
unsigned int i;
for (i = 0; i < n_buffers; i++) {
- if (buffers[i]) {
+ if (buffers[i] != VA_INVALID_ID) {
vaDestroyBuffer(display, buffers[i]);
- buffers[i] = 0;
+ buffers[i] = VA_INVALID_ID;
}
}
}
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
+int ff_vaapi_context_init(AVCodecContext *avctx)
+{
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
+ const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
+
+ if (!user_vactx) {
+ av_log(avctx, AV_LOG_ERROR, "Hardware acceleration context (hwaccel_context) does not exist.\n");
+ return AVERROR(ENOSYS);
+ }
+
+ vactx->display = user_vactx->display;
+ vactx->config_id = user_vactx->config_id;
+ vactx->context_id = user_vactx->context_id;
+
+ vactx->pic_param_buf_id = VA_INVALID_ID;
+ vactx->iq_matrix_buf_id = VA_INVALID_ID;
+ vactx->bitplane_buf_id = VA_INVALID_ID;
+
+ return 0;
+}
+
+int ff_vaapi_context_fini(AVCodecContext *avctx)
+{
+ return 0;
+}
+
+int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface)
{
VABufferID va_buffers[3];
unsigned int n_va_buffers = 0;
- if (!vactx->pic_param_buf_id)
+ if (vactx->pic_param_buf_id == VA_INVALID_ID)
return 0;
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
- if (vactx->iq_matrix_buf_id) {
+ if (vactx->iq_matrix_buf_id != VA_INVALID_ID) {
vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
va_buffers[n_va_buffers++] = vactx->iq_matrix_buf_id;
}
- if (vactx->bitplane_buf_id) {
+ if (vactx->bitplane_buf_id != VA_INVALID_ID) {
vaUnmapBuffer(vactx->display, vactx->bitplane_buf_id);
va_buffers[n_va_buffers++] = vactx->bitplane_buf_id;
}
@@ -81,7 +107,7 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
return 0;
}
-int ff_vaapi_commit_slices(struct vaapi_context *vactx)
+int ff_vaapi_commit_slices(FFVAContext *vactx)
{
VABufferID *slice_buf_ids;
VABufferID slice_param_buf_id, slice_data_buf_id;
@@ -97,7 +123,7 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
return -1;
vactx->slice_buf_ids = slice_buf_ids;
- slice_param_buf_id = 0;
+ slice_param_buf_id = VA_INVALID_ID;
if (vaCreateBuffer(vactx->display, vactx->context_id,
VASliceParameterBufferType,
vactx->slice_param_size,
@@ -106,7 +132,7 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
return -1;
vactx->slice_count = 0;
- slice_data_buf_id = 0;
+ slice_data_buf_id = VA_INVALID_ID;
if (vaCreateBuffer(vactx->display, vactx->context_id,
VASliceDataBufferType,
vactx->slice_data_size,
@@ -121,11 +147,11 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
return 0;
}
-static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned int size, uint32_t *buf_id)
+static void *alloc_buffer(FFVAContext *vactx, int type, unsigned int size, uint32_t *buf_id)
{
void *data = NULL;
- *buf_id = 0;
+ *buf_id = VA_INVALID_ID;
if (vaCreateBuffer(vactx->display, vactx->context_id,
type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS)
vaMapBuffer(vactx->display, *buf_id, &data);
@@ -133,22 +159,22 @@ static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned int si
return data;
}
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size)
{
return alloc_buffer(vactx, VAPictureParameterBufferType, size, &vactx->pic_param_buf_id);
}
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size)
{
return alloc_buffer(vactx, VAIQMatrixBufferType, size, &vactx->iq_matrix_buf_id);
}
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
+uint8_t *ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size)
{
return alloc_buffer(vactx, VABitPlaneBufferType, size, &vactx->bitplane_buf_id);
}
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size)
+VASliceParameterBufferBase *ff_vaapi_alloc_slice(FFVAContext *vactx, const uint8_t *buffer, uint32_t size)
{
uint8_t *slice_params;
VASliceParameterBufferBase *slice_param;
@@ -181,7 +207,7 @@ VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, co
void ff_vaapi_common_end_frame(AVCodecContext *avctx)
{
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
ff_dlog(avctx, "ff_vaapi_common_end_frame()\n");
@@ -202,7 +228,7 @@ void ff_vaapi_common_end_frame(AVCodecContext *avctx)
CONFIG_VC1_VAAPI_HWACCEL || CONFIG_WMV3_VAAPI_HWACCEL
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
{
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
MpegEncContext *s = avctx->priv_data;
int ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi.h b/chromium/third_party/ffmpeg/libavcodec/vaapi.h
index 815a27e226c..7a29f6f8811 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi.h
@@ -31,6 +31,8 @@
*/
#include <stdint.h>
+#include "libavutil/attributes.h"
+#include "version.h"
/**
* @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
@@ -72,12 +74,14 @@ struct vaapi_context {
*/
uint32_t context_id;
+#if FF_API_VAAPI_CONTEXT
/**
* VAPictureParameterBuffer ID
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
uint32_t pic_param_buf_id;
/**
@@ -86,6 +90,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
uint32_t iq_matrix_buf_id;
/**
@@ -94,6 +99,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
uint32_t bitplane_buf_id;
/**
@@ -102,6 +108,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
uint32_t *slice_buf_ids;
/**
@@ -110,6 +117,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
unsigned int n_slice_buf_ids;
/**
@@ -118,6 +126,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
unsigned int slice_buf_ids_alloc;
/**
@@ -126,6 +135,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
void *slice_params;
/**
@@ -134,6 +144,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
unsigned int slice_param_size;
/**
@@ -142,6 +153,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
unsigned int slice_params_alloc;
/**
@@ -150,6 +162,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
unsigned int slice_count;
/**
@@ -157,6 +170,7 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
const uint8_t *slice_data;
/**
@@ -165,7 +179,9 @@ struct vaapi_context {
* - encoding: unused
* - decoding: Set by libavcodec
*/
+ attribute_deprecated
uint32_t slice_data_size;
+#endif
};
/* @} */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
index eef3c29ab5a..ded2cb3d491 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_h264.c
@@ -162,7 +162,8 @@ static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32],
unsigned int i, n = 0;
for (i = 0; i < ref_count; i++)
if (ref_list[i].reference)
- fill_vaapi_pic(&RefPicList[n++], ref_list[i].parent, 0);
+ fill_vaapi_pic(&RefPicList[n++], ref_list[i].parent,
+ ref_list[i].reference);
for (; n < 32; n++)
init_vaapi_pic(&RefPicList[n]);
@@ -226,7 +227,7 @@ static int vaapi_h264_start_frame(AVCodecContext *avctx,
av_unused uint32_t size)
{
H264Context * const h = avctx->priv_data;
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VAPictureParameterBufferH264 *pic_param;
VAIQMatrixBufferH264 *iq_matrix;
@@ -291,7 +292,7 @@ static int vaapi_h264_start_frame(AVCodecContext *avctx,
/** End a hardware decoding based frame. */
static int vaapi_h264_end_frame(AVCodecContext *avctx)
{
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
H264Context * const h = avctx->priv_data;
H264SliceContext *sl = &h->slice_ctx[0];
int ret;
@@ -317,6 +318,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer,
uint32_t size)
{
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
H264Context * const h = avctx->priv_data;
H264SliceContext *sl = &h->slice_ctx[0];
VASliceParameterBufferH264 *slice_param;
@@ -325,7 +327,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
buffer, size);
/* Fill in VASliceParameterBufferH264. */
- slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
+ slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
slice_param->slice_data_bit_offset = get_bits_count(&sl->gb) + 8; /* bit buffer started beyond nal_unit_type */
@@ -358,8 +360,11 @@ AVHWAccel ff_h264_vaapi_hwaccel = {
.name = "h264_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_h264_start_frame,
.end_frame = vaapi_h264_end_frame,
.decode_slice = vaapi_h264_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_hevc.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_hevc.c
new file mode 100644
index 00000000000..762511f6e57
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_hevc.c
@@ -0,0 +1,490 @@
+/*
+ * HEVC HW decode acceleration through VA API
+ *
+ * Copyright (C) 2015 Timo Rothenpieler <timo@rothenpieler.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "vaapi_internal.h"
+#include "hevc.h"
+#include "mpegutils.h"
+
+/**
+ * @file
+ * This file implements the glue code between FFmpeg's and VA API's
+ * structures for HEVC decoding.
+ */
+
+typedef struct vaapi_hevc_frame_data {
+ VAPictureParameterBufferHEVC *pic_param;
+ VASliceParameterBufferHEVC *last_slice_param;
+} vaapi_hevc_frame_data;
+
+/**
+ * Initialize an empty VA API picture.
+ *
+ * VA API requires a fixed-size reference picture array.
+ */
+static void init_vaapi_pic(VAPictureHEVC *va_pic)
+{
+ va_pic->picture_id = VA_INVALID_ID;
+ va_pic->flags = VA_PICTURE_HEVC_INVALID;
+ va_pic->pic_order_cnt = 0;
+}
+
+static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame *pic, int rps_type)
+{
+ va_pic->picture_id = ff_vaapi_get_surface_id(pic->frame);
+ va_pic->pic_order_cnt = pic->poc;
+ va_pic->flags = rps_type;
+
+ if (pic->flags & HEVC_FRAME_FLAG_LONG_REF)
+ va_pic->flags |= VA_PICTURE_HEVC_LONG_TERM_REFERENCE;
+
+ if (pic->frame->interlaced_frame) {
+ va_pic->flags |= VA_PICTURE_HEVC_FIELD_PIC;
+
+ if (!pic->frame->top_field_first) {
+ va_pic->flags |= VA_PICTURE_HEVC_BOTTOM_FIELD;
+ }
+ }
+}
+
+static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic)
+{
+ VASurfaceID pic_surf = ff_vaapi_get_surface_id(pic->frame);
+ int i;
+
+ for (i = 0; i < h->rps[ST_CURR_BEF].nb_refs; ++i) {
+ if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_BEF].ref[i]->frame))
+ return VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE;
+ }
+
+ for (i = 0; i < h->rps[ST_CURR_AFT].nb_refs; ++i) {
+ if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_AFT].ref[i]->frame))
+ return VA_PICTURE_HEVC_RPS_ST_CURR_AFTER;
+ }
+
+ for (i = 0; i < h->rps[LT_CURR].nb_refs; ++i) {
+ if (pic_surf == ff_vaapi_get_surface_id(h->rps[LT_CURR].ref[i]->frame))
+ return VA_PICTURE_HEVC_RPS_LT_CURR;
+ }
+
+ return 0;
+}
+
+static void fill_vaapi_ReferenceFrames(const HEVCContext *h, VAPictureParameterBufferHEVC *pp)
+{
+ const HEVCFrame *current_picture = h->ref;
+ int i, j, rps_type;
+
+ for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->ReferenceFrames); i++) {
+ const HEVCFrame *frame = NULL;
+
+ while (!frame && j < FF_ARRAY_ELEMS(h->DPB)) {
+ if (&h->DPB[j] != current_picture && (h->DPB[j].flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)))
+ frame = &h->DPB[j];
+ j++;
+ }
+
+ init_vaapi_pic(&pp->ReferenceFrames[i]);
+
+ if (frame) {
+ rps_type = find_frame_rps_type(h, frame);
+ fill_vaapi_pic(&pp->ReferenceFrames[i], frame, rps_type);
+ }
+ }
+}
+
+static uint8_t get_ref_pic_index(const HEVCContext *h, const HEVCFrame *frame)
+{
+ vaapi_hevc_frame_data *frame_data = h->ref->hwaccel_picture_private;
+ VAPictureParameterBufferHEVC *pp = frame_data->pic_param;
+ uint8_t i;
+
+ if (!frame)
+ return 0xff;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(pp->ReferenceFrames); ++i) {
+ VASurfaceID pid = pp->ReferenceFrames[i].picture_id;
+ int poc = pp->ReferenceFrames[i].pic_order_cnt;
+ if (pid != VA_INVALID_ID && pid == ff_vaapi_get_surface_id(frame->frame) && poc == frame->poc)
+ return i;
+ }
+
+ return 0xff;
+}
+
+static void fill_picture_parameters(const HEVCContext *h, VAPictureParameterBufferHEVC *pp)
+{
+ int i;
+
+ pp->pic_fields.value = 0;
+ pp->slice_parsing_fields.value = 0;
+
+ fill_vaapi_pic(&pp->CurrPic, h->ref, 0);
+ fill_vaapi_ReferenceFrames(h, pp);
+
+ pp->pic_width_in_luma_samples = h->ps.sps->width;
+ pp->pic_height_in_luma_samples = h->ps.sps->height;
+
+ pp->log2_min_luma_coding_block_size_minus3 = h->ps.sps->log2_min_cb_size - 3;
+
+ pp->pic_fields.bits.chroma_format_idc = h->ps.sps->chroma_format_idc;
+
+ pp->sps_max_dec_pic_buffering_minus1 = h->ps.sps->temporal_layer[h->ps.sps->max_sub_layers - 1].max_dec_pic_buffering - 1;
+ pp->log2_diff_max_min_luma_coding_block_size = h->ps.sps->log2_diff_max_min_coding_block_size;
+ pp->log2_min_transform_block_size_minus2 = h->ps.sps->log2_min_tb_size - 2;
+ pp->log2_diff_max_min_transform_block_size = h->ps.sps->log2_max_trafo_size - h->ps.sps->log2_min_tb_size;
+ pp->max_transform_hierarchy_depth_inter = h->ps.sps->max_transform_hierarchy_depth_inter;
+ pp->max_transform_hierarchy_depth_intra = h->ps.sps->max_transform_hierarchy_depth_intra;
+ pp->num_short_term_ref_pic_sets = h->ps.sps->nb_st_rps;
+ pp->num_long_term_ref_pic_sps = h->ps.sps->num_long_term_ref_pics_sps;
+
+ pp->num_ref_idx_l0_default_active_minus1 = h->ps.pps->num_ref_idx_l0_default_active - 1;
+ pp->num_ref_idx_l1_default_active_minus1 = h->ps.pps->num_ref_idx_l1_default_active - 1;
+ pp->init_qp_minus26 = h->ps.pps->pic_init_qp_minus26;
+
+ pp->pps_cb_qp_offset = h->ps.pps->cb_qp_offset;
+ pp->pps_cr_qp_offset = h->ps.pps->cr_qp_offset;
+
+ pp->pic_fields.bits.tiles_enabled_flag = h->ps.pps->tiles_enabled_flag;
+ pp->pic_fields.bits.separate_colour_plane_flag = h->ps.sps->separate_colour_plane_flag;
+ pp->pic_fields.bits.pcm_enabled_flag = h->ps.sps->pcm_enabled_flag;
+ pp->pic_fields.bits.scaling_list_enabled_flag = h->ps.sps->scaling_list_enable_flag;
+ pp->pic_fields.bits.transform_skip_enabled_flag = h->ps.pps->transform_skip_enabled_flag;
+ pp->pic_fields.bits.amp_enabled_flag = h->ps.sps->amp_enabled_flag;
+ pp->pic_fields.bits.strong_intra_smoothing_enabled_flag = h->ps.sps->sps_strong_intra_smoothing_enable_flag;
+ pp->pic_fields.bits.sign_data_hiding_enabled_flag = h->ps.pps->sign_data_hiding_flag;
+ pp->pic_fields.bits.constrained_intra_pred_flag = h->ps.pps->constrained_intra_pred_flag;
+ pp->pic_fields.bits.cu_qp_delta_enabled_flag = h->ps.pps->cu_qp_delta_enabled_flag;
+ pp->pic_fields.bits.weighted_pred_flag = h->ps.pps->weighted_pred_flag;
+ pp->pic_fields.bits.weighted_bipred_flag = h->ps.pps->weighted_bipred_flag;
+ pp->pic_fields.bits.transquant_bypass_enabled_flag = h->ps.pps->transquant_bypass_enable_flag;
+ pp->pic_fields.bits.entropy_coding_sync_enabled_flag = h->ps.pps->entropy_coding_sync_enabled_flag;
+ pp->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag = h->ps.pps->seq_loop_filter_across_slices_enabled_flag;
+ pp->pic_fields.bits.loop_filter_across_tiles_enabled_flag = h->ps.pps->loop_filter_across_tiles_enabled_flag;
+
+ pp->pic_fields.bits.pcm_loop_filter_disabled_flag = h->ps.sps->pcm.loop_filter_disable_flag;
+ pp->pcm_sample_bit_depth_luma_minus1 = h->ps.sps->pcm.bit_depth - 1;
+ pp->pcm_sample_bit_depth_chroma_minus1 = h->ps.sps->pcm.bit_depth_chroma - 1;
+ pp->log2_min_pcm_luma_coding_block_size_minus3 = h->ps.sps->pcm.log2_min_pcm_cb_size - 3;
+ pp->log2_diff_max_min_pcm_luma_coding_block_size = h->ps.sps->pcm.log2_max_pcm_cb_size - h->ps.sps->pcm.log2_min_pcm_cb_size;
+
+ memset(pp->column_width_minus1, 0, sizeof(pp->column_width_minus1));
+ memset(pp->row_height_minus1, 0, sizeof(pp->row_height_minus1));
+
+ if (h->ps.pps->tiles_enabled_flag) {
+ pp->num_tile_columns_minus1 = h->ps.pps->num_tile_columns - 1;
+ pp->num_tile_rows_minus1 = h->ps.pps->num_tile_rows - 1;
+
+ for (i = 0; i < h->ps.pps->num_tile_columns; i++)
+ pp->column_width_minus1[i] = h->ps.pps->column_width[i] - 1;
+
+ for (i = 0; i < h->ps.pps->num_tile_rows; i++)
+ pp->row_height_minus1[i] = h->ps.pps->row_height[i] - 1;
+ }
+
+ pp->diff_cu_qp_delta_depth = h->ps.pps->diff_cu_qp_delta_depth;
+ pp->pps_beta_offset_div2 = h->ps.pps->beta_offset / 2;
+ pp->pps_tc_offset_div2 = h->ps.pps->tc_offset / 2;
+ pp->log2_parallel_merge_level_minus2 = h->ps.pps->log2_parallel_merge_level - 2;
+
+ /* Diffrent chroma/luma bit depths are currently not supported by ffmpeg. */
+ pp->bit_depth_luma_minus8 = h->ps.sps->bit_depth - 8;
+ pp->bit_depth_chroma_minus8 = h->ps.sps->bit_depth - 8;
+
+ pp->slice_parsing_fields.bits.lists_modification_present_flag = h->ps.pps->lists_modification_present_flag;
+ pp->slice_parsing_fields.bits.long_term_ref_pics_present_flag = h->ps.sps->long_term_ref_pics_present_flag;
+ pp->slice_parsing_fields.bits.sps_temporal_mvp_enabled_flag = h->ps.sps->sps_temporal_mvp_enabled_flag;
+ pp->slice_parsing_fields.bits.cabac_init_present_flag = h->ps.pps->cabac_init_present_flag;
+ pp->slice_parsing_fields.bits.output_flag_present_flag = h->ps.pps->output_flag_present_flag;
+ pp->slice_parsing_fields.bits.dependent_slice_segments_enabled_flag = h->ps.pps->dependent_slice_segments_enabled_flag;
+ pp->slice_parsing_fields.bits.pps_slice_chroma_qp_offsets_present_flag = h->ps.pps->pic_slice_level_chroma_qp_offsets_present_flag;
+ pp->slice_parsing_fields.bits.sample_adaptive_offset_enabled_flag = h->ps.sps->sao_enabled;
+ pp->slice_parsing_fields.bits.deblocking_filter_override_enabled_flag = h->ps.pps->deblocking_filter_override_enabled_flag;
+ pp->slice_parsing_fields.bits.pps_disable_deblocking_filter_flag = h->ps.pps->disable_dbf;
+ pp->slice_parsing_fields.bits.slice_segment_header_extension_present_flag = h->ps.pps->slice_header_extension_present_flag;
+
+ pp->log2_max_pic_order_cnt_lsb_minus4 = h->ps.sps->log2_max_poc_lsb - 4;
+ pp->num_extra_slice_header_bits = h->ps.pps->num_extra_slice_header_bits;
+
+ if (h->nal_unit_type >= NAL_BLA_W_LP && h->nal_unit_type <= NAL_CRA_NUT) {
+ pp->slice_parsing_fields.bits.RapPicFlag = 1;
+ } else {
+ pp->slice_parsing_fields.bits.RapPicFlag = 0;
+ }
+
+ if (IS_IDR(h)) {
+ pp->slice_parsing_fields.bits.IdrPicFlag = 1;
+ } else {
+ pp->slice_parsing_fields.bits.IdrPicFlag = 0;
+ }
+
+ if (IS_IRAP(h)) {
+ pp->slice_parsing_fields.bits.IntraPicFlag = 1;
+ } else {
+ pp->slice_parsing_fields.bits.IntraPicFlag = 0;
+ }
+
+ if (h->sh.short_term_ref_pic_set_sps_flag == 0 && h->sh.short_term_rps) {
+ pp->st_rps_bits = h->sh.short_term_ref_pic_set_size;
+ } else {
+ pp->st_rps_bits = 0;
+ }
+
+ /* TODO */
+ pp->pic_fields.bits.NoPicReorderingFlag = 0;
+ pp->pic_fields.bits.NoBiPredFlag = 0;
+}
+
+
+/** Initialize and start decoding a frame with VA API. */
+static int vaapi_hevc_start_frame(AVCodecContext *avctx,
+ av_unused const uint8_t *buffer,
+ av_unused uint32_t size)
+{
+ HEVCContext * const h = avctx->priv_data;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
+ vaapi_hevc_frame_data *frame_data = h->ref->hwaccel_picture_private;
+ VAPictureParameterBufferHEVC *pic_param;
+ VAIQMatrixBufferHEVC *iq_matrix;
+ ScalingList const * scaling_list;
+ int i, j, pos;
+
+ ff_dlog(avctx, "vaapi_hevc_start_frame()\n");
+
+ vactx->slice_param_size = sizeof(VASliceParameterBufferHEVC);
+
+ /* Fill in VAPictureParameterBufferHEVC. */
+ pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferHEVC));
+ if (!pic_param)
+ return -1;
+ fill_picture_parameters(h, pic_param);
+ frame_data->pic_param = pic_param;
+
+ /* Fill in VAIQMatrixBufferHEVC. */
+ if (h->ps.pps->scaling_list_data_present_flag) {
+ scaling_list = &h->ps.pps->scaling_list;
+ } else if (h->ps.sps->scaling_list_enable_flag) {
+ scaling_list = &h->ps.sps->scaling_list;
+ } else {
+ return 0;
+ }
+
+ iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferHEVC));
+ if (!iq_matrix)
+ return -1;
+
+ for (i = 0; i < 6; ++i) {
+ for (j = 0; j < 16; ++j) {
+ pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j];
+ iq_matrix->ScalingList4x4[i][j] = scaling_list->sl[0][i][pos];
+ }
+ for (j = 0; j < 64; ++j) {
+ pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j];
+ iq_matrix->ScalingList8x8[i][j] = scaling_list->sl[1][i][pos];
+ iq_matrix->ScalingList16x16[i][j] = scaling_list->sl[2][i][pos];
+ if (i < 2) {
+ iq_matrix->ScalingList32x32[i][j] = scaling_list->sl[3][i * 3][pos];
+ }
+ }
+ iq_matrix->ScalingListDC16x16[i] = scaling_list->sl_dc[0][i];
+ if (i < 2) {
+ iq_matrix->ScalingListDC32x32[i] = scaling_list->sl_dc[1][i * 3];
+ }
+ }
+
+ return 0;
+}
+
+/** End a hardware decoding based frame. */
+static int vaapi_hevc_end_frame(AVCodecContext *avctx)
+{
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
+ HEVCContext * const h = avctx->priv_data;
+ vaapi_hevc_frame_data *frame_data = h->ref->hwaccel_picture_private;
+ int ret;
+
+ ff_dlog(avctx, "vaapi_hevc_end_frame()\n");
+
+ frame_data->last_slice_param->LongSliceFlags.fields.LastSliceOfPic = 1;
+
+ ret = ff_vaapi_commit_slices(vactx);
+ if (ret < 0)
+ goto finish;
+
+ ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(h->ref->frame));
+ if (ret < 0)
+ goto finish;
+
+finish:
+ ff_vaapi_common_end_frame(avctx);
+ return ret;
+}
+
+static int fill_pred_weight_table(HEVCContext * const h,
+ VASliceParameterBufferHEVC *slice_param,
+ SliceHeader * const sh)
+{
+ int i;
+
+ memset(slice_param->delta_luma_weight_l0, 0, sizeof(slice_param->delta_luma_weight_l0));
+ memset(slice_param->delta_luma_weight_l1, 0, sizeof(slice_param->delta_luma_weight_l1));
+ memset(slice_param->luma_offset_l0, 0, sizeof(slice_param->luma_offset_l0));
+ memset(slice_param->luma_offset_l1, 0, sizeof(slice_param->luma_offset_l1));
+ memset(slice_param->delta_chroma_weight_l0, 0, sizeof(slice_param->delta_chroma_weight_l0));
+ memset(slice_param->delta_chroma_weight_l1, 0, sizeof(slice_param->delta_chroma_weight_l1));
+ memset(slice_param->ChromaOffsetL0, 0, sizeof(slice_param->ChromaOffsetL0));
+ memset(slice_param->ChromaOffsetL1, 0, sizeof(slice_param->ChromaOffsetL1));
+
+ slice_param->delta_chroma_log2_weight_denom = 0;
+ slice_param->luma_log2_weight_denom = 0;
+
+ if ( sh->slice_type == I_SLICE
+ || (sh->slice_type == P_SLICE && !h->ps.pps->weighted_pred_flag)
+ || (sh->slice_type == B_SLICE && !h->ps.pps->weighted_bipred_flag)) {
+ return 0;
+ }
+
+ slice_param->luma_log2_weight_denom = sh->luma_log2_weight_denom;
+
+ if (h->ps.sps->chroma_format_idc) {
+ slice_param->delta_chroma_log2_weight_denom = sh->chroma_log2_weight_denom - sh->luma_log2_weight_denom;
+ }
+
+ for (i = 0; i < 15 && i < sh->nb_refs[L0]; ++i) {
+ slice_param->delta_luma_weight_l0[i] = sh->luma_weight_l0[i] - (1 << sh->luma_log2_weight_denom);
+ slice_param->luma_offset_l0[i] = sh->luma_offset_l0[i];
+ slice_param->delta_chroma_weight_l0[i][0] = sh->chroma_weight_l0[i][0] - (1 << sh->chroma_log2_weight_denom);
+ slice_param->delta_chroma_weight_l0[i][1] = sh->chroma_weight_l0[i][1] - (1 << sh->chroma_log2_weight_denom);
+ slice_param->ChromaOffsetL0[i][0] = sh->chroma_offset_l0[i][0];
+ slice_param->ChromaOffsetL0[i][1] = sh->chroma_offset_l0[i][1];
+ }
+
+ if (sh->slice_type == B_SLICE) {
+ for (i = 0; i < 15 && i < sh->nb_refs[L1]; ++i) {
+ slice_param->delta_luma_weight_l1[i] = sh->luma_weight_l1[i] - (1 << sh->luma_log2_weight_denom);
+ slice_param->luma_offset_l1[i] = sh->luma_offset_l1[i];
+ slice_param->delta_chroma_weight_l1[i][0] = sh->chroma_weight_l1[i][0] - (1 << sh->chroma_log2_weight_denom);
+ slice_param->delta_chroma_weight_l1[i][1] = sh->chroma_weight_l1[i][1] - (1 << sh->chroma_log2_weight_denom);
+ slice_param->ChromaOffsetL1[i][0] = sh->chroma_offset_l1[i][0];
+ slice_param->ChromaOffsetL1[i][1] = sh->chroma_offset_l1[i][1];
+ }
+ }
+
+ return 0;
+}
+
+/** Decode the given hevc slice with VA API. */
+static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
+ HEVCContext * const h = avctx->priv_data;
+ vaapi_hevc_frame_data *frame_data = h->ref->hwaccel_picture_private;
+ SliceHeader * const sh = &h->sh;
+ VASliceParameterBufferHEVC *slice_param;
+ int i, list_idx;
+ uint8_t nb_list = sh->slice_type == B_SLICE ? 2 : 1;
+
+ if (sh->slice_type == I_SLICE)
+ nb_list = 0;
+
+ ff_dlog(avctx, "vaapi_hevc_decode_slice(): buffer %p, size %d\n", buffer, size);
+
+ /* Fill in VASliceParameterBufferH264. */
+ slice_param = (VASliceParameterBufferHEVC *)ff_vaapi_alloc_slice(vactx, buffer, size);
+ if (!slice_param)
+ return -1;
+
+ frame_data->last_slice_param = slice_param;
+
+ /* The base structure changed, so this has to be re-set in order to be valid on every byte order. */
+ slice_param->slice_data_flag = VA_SLICE_DATA_FLAG_ALL;
+
+ /* Add 1 to the bits count here to account for the byte_alignment bit, which allways is at least one bit and not accounted for otherwise. */
+ slice_param->slice_data_byte_offset = (get_bits_count(&h->HEVClc->gb) + 1 + 7) / 8;
+
+ slice_param->slice_segment_address = sh->slice_segment_addr;
+
+ slice_param->LongSliceFlags.value = 0;
+ slice_param->LongSliceFlags.fields.dependent_slice_segment_flag = sh->dependent_slice_segment_flag;
+ slice_param->LongSliceFlags.fields.slice_type = sh->slice_type;
+ slice_param->LongSliceFlags.fields.color_plane_id = sh->colour_plane_id;
+ slice_param->LongSliceFlags.fields.mvd_l1_zero_flag = sh->mvd_l1_zero_flag;
+ slice_param->LongSliceFlags.fields.cabac_init_flag = sh->cabac_init_flag;
+ slice_param->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag = sh->slice_temporal_mvp_enabled_flag;
+ slice_param->LongSliceFlags.fields.slice_deblocking_filter_disabled_flag = sh->disable_deblocking_filter_flag;
+ slice_param->LongSliceFlags.fields.collocated_from_l0_flag = sh->collocated_list == L0 ? 1 : 0;
+ slice_param->LongSliceFlags.fields.slice_loop_filter_across_slices_enabled_flag = sh->slice_loop_filter_across_slices_enabled_flag;
+
+ slice_param->LongSliceFlags.fields.slice_sao_luma_flag = sh->slice_sample_adaptive_offset_flag[0];
+ if (h->ps.sps->chroma_format_idc) {
+ slice_param->LongSliceFlags.fields.slice_sao_chroma_flag = sh->slice_sample_adaptive_offset_flag[1];
+ }
+
+ if (sh->slice_temporal_mvp_enabled_flag) {
+ slice_param->collocated_ref_idx = sh->collocated_ref_idx;
+ } else {
+ slice_param->collocated_ref_idx = 0xFF;
+ }
+
+ slice_param->slice_qp_delta = sh->slice_qp_delta;
+ slice_param->slice_cb_qp_offset = sh->slice_cb_qp_offset;
+ slice_param->slice_cr_qp_offset = sh->slice_cr_qp_offset;
+ slice_param->slice_beta_offset_div2 = sh->beta_offset / 2;
+ slice_param->slice_tc_offset_div2 = sh->tc_offset / 2;
+
+ if (sh->slice_type == I_SLICE) {
+ slice_param->five_minus_max_num_merge_cand = 0;
+ } else {
+ slice_param->five_minus_max_num_merge_cand = 5 - sh->max_num_merge_cand;
+ }
+
+ slice_param->num_ref_idx_l0_active_minus1 = sh->nb_refs[L0] ? sh->nb_refs[L0] - 1 : 0;
+ slice_param->num_ref_idx_l1_active_minus1 = sh->nb_refs[L1] ? sh->nb_refs[L1] - 1 : 0;
+
+ memset(slice_param->RefPicList, 0xFF, sizeof(slice_param->RefPicList));
+
+ /* h->ref->refPicList is updated befor calling each slice */
+ for (list_idx = 0; list_idx < nb_list; ++list_idx) {
+ RefPicList *rpl = &h->ref->refPicList[list_idx];
+
+ for (i = 0; i < rpl->nb_refs; ++i) {
+ slice_param->RefPicList[list_idx][i] = get_ref_pic_index(h, rpl->ref[i]);
+ }
+ }
+
+ return fill_pred_weight_table(h, slice_param, sh);
+}
+
+AVHWAccel ff_hevc_vaapi_hwaccel = {
+ .name = "hevc_vaapi",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
+ .start_frame = vaapi_hevc_start_frame,
+ .end_frame = vaapi_hevc_end_frame,
+ .decode_slice = vaapi_hevc_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
+ .frame_priv_data_size = sizeof(vaapi_hevc_frame_data),
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h b/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
index 918c718d14b..29f46ab4300 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_internal.h
@@ -35,23 +35,53 @@
* @{
*/
+typedef struct {
+ VADisplay display; ///< Windowing system dependent handle
+ VAConfigID config_id; ///< Configuration ID
+ VAContextID context_id; ///< Context ID (video decode pipeline)
+ VABufferID pic_param_buf_id; ///< Picture parameter buffer
+ VABufferID iq_matrix_buf_id; ///< Inverse quantiser matrix buffer
+ VABufferID bitplane_buf_id; ///< Bitplane buffer (for VC-1 decoding)
+ VABufferID *slice_buf_ids; ///< Slice parameter/data buffers
+ unsigned int n_slice_buf_ids; ///< Number of effective slice buffers
+ unsigned int slice_buf_ids_alloc; ///< Number of allocated slice buffers
+ void *slice_params; ///< Pointer to slice parameter buffers
+ unsigned int slice_param_size; ///< Size of a slice parameter element
+ unsigned int slice_params_alloc; ///< Number of allocated slice parameters
+ unsigned int slice_count; ///< Number of slices currently filled in
+ const uint8_t *slice_data; ///< Pointer to slice data buffer base
+ unsigned int slice_data_size; ///< Current size of slice data
+} FFVAContext;
+
+/** Extract vaapi_context from an AVCodecContext */
+static inline FFVAContext *ff_vaapi_get_context(AVCodecContext *avctx)
+{
+ return avctx->internal->hwaccel_priv_data;
+}
+
/** Extract VASurfaceID from an AVFrame */
static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
{
return (uintptr_t)pic->data[3];
}
+/** Common AVHWAccel.init() implementation */
+int ff_vaapi_context_init(AVCodecContext *avctx);
+
+/** Common AVHWAccel.uninit() implementation */
+int ff_vaapi_context_fini(AVCodecContext *avctx);
+
/** Common AVHWAccel.end_frame() implementation */
void ff_vaapi_common_end_frame(AVCodecContext *avctx);
/** Allocate a new picture parameter buffer */
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size);
+void *ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size);
/** Allocate a new IQ matrix buffer */
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size);
+void *ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size);
/** Allocate a new bit-plane buffer */
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size);
+uint8_t *ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size);
/**
* Allocate a new slice descriptor for the input slice.
@@ -61,11 +91,11 @@ uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size);
* @param size the size of the slice in bytes
* @return the newly allocated slice parameter
*/
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size);
+VASliceParameterBufferBase *ff_vaapi_alloc_slice(FFVAContext *vactx, const uint8_t *buffer, uint32_t size);
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx);
-int ff_vaapi_commit_slices(struct vaapi_context *vactx);
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface);
+int ff_vaapi_commit_slices(FFVAContext *vactx);
+int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface);
/* @} */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
index 87fab89880f..a3deab124b8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c
@@ -40,7 +40,7 @@ static inline int mpeg2_get_is_frame_start(MpegEncContext *s)
static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
{
struct MpegEncContext * const s = avctx->priv_data;
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VAPictureParameterBufferMPEG2 *pic_param;
VAIQMatrixBufferMPEG2 *iq_matrix;
int i;
@@ -103,6 +103,7 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
{
MpegEncContext * const s = avctx->priv_data;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VASliceParameterBufferMPEG2 *slice_param;
GetBitContext gb;
uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;
@@ -123,7 +124,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
macroblock_offset = get_bits_count(&gb);
/* Fill in VASliceParameterBufferMPEG2 */
- slice_param = (VASliceParameterBufferMPEG2 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
+ slice_param = (VASliceParameterBufferMPEG2 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
slice_param->macroblock_offset = macroblock_offset;
@@ -138,8 +139,11 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = {
.name = "mpeg2_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_mpeg2_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_mpeg2_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
index 9b283f78655..426bef26467 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c
@@ -45,7 +45,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
{
Mpeg4DecContext *ctx = avctx->priv_data;
MpegEncContext * const s = &ctx->m;
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VAPictureParameterBufferMPEG4 *pic_param;
VAIQMatrixBufferMPEG4 *iq_matrix;
int i;
@@ -121,12 +121,13 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
{
MpegEncContext * const s = avctx->priv_data;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VASliceParameterBufferMPEG4 *slice_param;
ff_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
/* Fill in VASliceParameterBufferMPEG4 */
- slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
+ slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
slice_param->macroblock_offset = get_bits_count(&s->gb) % 8;
@@ -141,10 +142,13 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
.name = "mpeg4_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG4,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_mpeg4_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_mpeg4_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
#endif
@@ -153,9 +157,12 @@ AVHWAccel ff_h263_vaapi_hwaccel = {
.name = "h263_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H263,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_mpeg4_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_mpeg4_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
index 7ef9f2a08d7..5ded5dba896 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_vc1.c
@@ -148,7 +148,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
{
VC1Context * const v = avctx->priv_data;
MpegEncContext * const s = &v->s;
- struct vaapi_context * const vactx = avctx->hwaccel_context;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VAPictureParameterBufferVC1 *pic_param;
ff_dlog(avctx, "vaapi_vc1_start_frame()\n");
@@ -315,6 +315,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
{
VC1Context * const v = avctx->priv_data;
MpegEncContext * const s = &v->s;
+ FFVAContext * const vactx = ff_vaapi_get_context(avctx);
VASliceParameterBufferVC1 *slice_param;
ff_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
@@ -326,7 +327,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
}
/* Fill in VASliceParameterBufferVC1 */
- slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
+ slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(vactx, buffer, size);
if (!slice_param)
return -1;
slice_param->macroblock_offset = get_bits_count(&s->gb);
@@ -339,10 +340,13 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
.name = "wmv3_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_vc1_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_vc1_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
#endif
@@ -350,8 +354,11 @@ AVHWAccel ff_vc1_vaapi_hwaccel = {
.name = "vc1_vaapi",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,
- .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
+ .pix_fmt = AV_PIX_FMT_VAAPI,
.start_frame = vaapi_vc1_start_frame,
.end_frame = ff_vaapi_mpeg_end_frame,
.decode_slice = vaapi_vc1_decode_slice,
+ .init = ff_vaapi_context_init,
+ .uninit = ff_vaapi_context_fini,
+ .priv_data_size = sizeof(FFVAContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vb.c b/chromium/third_party/ffmpeg/libavcodec/vb.c
index 41ee42eca59..560165adc7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vb.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vb.c
@@ -279,5 +279,5 @@ AVCodec ff_vb_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vble.c b/chromium/third_party/ffmpeg/libavcodec/vble.c
index e7331b19b5c..30b77cecf6f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vble.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vble.c
@@ -155,7 +155,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
vble_restore_plane(ctx, pic, &gb, 0, offset, avctx->width, avctx->height);
/* Chroma */
- if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
offset += avctx->width * avctx->height;
vble_restore_plane(ctx, pic, &gb, 1, offset, width_uv, height_uv);
@@ -210,5 +210,5 @@ AVCodec ff_vble_decoder = {
.init = vble_decode_init,
.close = vble_decode_close,
.decode = vble_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1_block.c b/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
index 3541ba787e3..255ba1da70a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
@@ -99,7 +99,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],
s->dest[0] - v_dist * s->linesize - 8,
stride_y);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize - 8,
s->uvlinesize);
@@ -126,7 +126,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],
s->dest[0] - v_dist * s->linesize + 8,
stride_y);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize,
s->uvlinesize);
@@ -961,7 +961,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
q2 = s->current_picture.qscale_table[mb_pos - 1];
if (!dc_pred_dir && a_avail && mb_pos >= s->mb_stride)
q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
- if ( dc_pred_dir && n == 1)
+ if (dc_pred_dir && n == 1)
q2 = q1;
if (!dc_pred_dir && n == 2)
q2 = q1;
@@ -1327,7 +1327,7 @@ static int vc1_decode_p_mb(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (v->rangeredfrm)
@@ -1348,7 +1348,7 @@ static int vc1_decode_p_mb(VC1Context *v)
} else if (val) {
pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block,
s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize,
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY), &block_tt);
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY), &block_tt);
block_cbp |= pat << (i << 2);
if (!v->ttmbf && ttmb < 8)
ttmb = -1;
@@ -1438,7 +1438,7 @@ static int vc1_decode_p_mb(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (v->rangeredfrm)
@@ -1460,7 +1460,7 @@ static int vc1_decode_p_mb(VC1Context *v)
pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : s->linesize,
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY),
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY),
&block_tt);
block_cbp |= pat << (i << 2);
if (!v->ttmbf && ttmb < 8)
@@ -1586,7 +1586,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (i < 4) {
@@ -1673,7 +1673,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : (s->linesize << fieldtx),
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY), &block_tt);
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY), &block_tt);
block_cbp |= pat << (i << 2);
if (!v->ttmbf && ttmb < 8)
ttmb = -1;
@@ -1752,7 +1752,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
@@ -1806,7 +1806,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : s->linesize,
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY),
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY),
&block_tt);
block_cbp |= pat << (i << 2);
if (!v->ttmbf && ttmb < 8)
@@ -1953,7 +1953,7 @@ static void vc1_decode_b_mb(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (v->rangeredfrm)
@@ -1967,7 +1967,7 @@ static void vc1_decode_b_mb(VC1Context *v)
vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : s->linesize,
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY), NULL);
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY), NULL);
if (!v->ttmbf && ttmb < 8)
ttmb = -1;
first_block = 0;
@@ -2028,7 +2028,7 @@ static void vc1_decode_b_mb_intfi(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && (i > 3) && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (v->rangeredfrm)
@@ -2126,7 +2126,7 @@ static void vc1_decode_b_mb_intfi(VC1Context *v)
vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : s->linesize,
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY), NULL);
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY), NULL);
if (!v->ttmbf && ttmb < 8)
ttmb = -1;
first_block = 0;
@@ -2251,7 +2251,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
vc1_decode_intra_block(v, s->block[i], i, val, mquant,
(i & 4) ? v->codingset2 : v->codingset);
- if (CONFIG_GRAY && i > 3 && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && i > 3 && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
if (i < 4) {
@@ -2417,7 +2417,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
first_block, s->dest[dst_idx] + off,
(i & 4) ? s->uvlinesize : (s->linesize << fieldtx),
- CONFIG_GRAY && (i & 4) && (s->avctx->flags & CODEC_FLAG_GRAY), &block_tt);
+ CONFIG_GRAY && (i & 4) && (s->avctx->flags & AV_CODEC_FLAG_GRAY), &block_tt);
block_cbp |= pat << (i << 2);
if (!v->ttmbf && ttmb < 8)
ttmb = -1;
@@ -2560,7 +2560,7 @@ static void vc1_decode_i_blocks(VC1Context *v)
vc1_decode_i_block(v, s->block[k], k, val, (k < 4) ? v->codingset : v->codingset2);
- if (CONFIG_GRAY && k > 3 && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && k > 3 && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(s->block[k]);
if (v->pq >= 9 && v->overlap) {
@@ -2584,7 +2584,7 @@ static void vc1_decode_i_blocks(VC1Context *v)
if (s->mb_x) {
v->vc1dsp.vc1_h_overlap(s->dest[0], s->linesize);
v->vc1dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_h_overlap(s->dest[1], s->uvlinesize);
v->vc1dsp.vc1_h_overlap(s->dest[2], s->uvlinesize);
}
@@ -2594,7 +2594,7 @@ static void vc1_decode_i_blocks(VC1Context *v)
if (!s->first_slice_line) {
v->vc1dsp.vc1_v_overlap(s->dest[0], s->linesize);
v->vc1dsp.vc1_v_overlap(s->dest[0] + 8, s->linesize);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_v_overlap(s->dest[1], s->uvlinesize);
v->vc1dsp.vc1_v_overlap(s->dest[2], s->uvlinesize);
}
@@ -2692,7 +2692,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
if (v->fieldtx_is_raw)
v->fieldtx_plane[mb_pos] = get_bits1(&v->s.gb);
cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
- if ( v->acpred_is_raw)
+ if (v->acpred_is_raw)
v->s.ac_pred = get_bits1(&v->s.gb);
else
v->s.ac_pred = v->acpred_plane[mb_pos];
@@ -2723,7 +2723,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
vc1_decode_i_block_adv(v, block[k], k, val,
(k < 4) ? v->codingset : v->codingset2, mquant);
- if (CONFIG_GRAY && k > 3 && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && k > 3 && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
v->vc1dsp.vc1_inv_trans_8x8(block[k]);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1_loopfilter.c b/chromium/third_party/ffmpeg/libavcodec/vc1_loopfilter.c
index ad0945ff3af..025776bac9c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1_loopfilter.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1_loopfilter.c
@@ -40,7 +40,7 @@ void ff_vc1_loop_filter_iblk(VC1Context *v, int pq)
if (s->mb_x)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1], s->uvlinesize, pq);
if (s->mb_x)
@@ -52,7 +52,7 @@ void ff_vc1_loop_filter_iblk(VC1Context *v, int pq)
if (s->mb_y == s->end_mb_y - 1) {
if (s->mb_x) {
v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq);
v->vc1dsp.vc1_h_loop_filter8(s->dest[2], s->uvlinesize, pq);
}
@@ -76,7 +76,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if (s->mb_x >= 2)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 16, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 8, s->linesize, pq);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize - 8, s->uvlinesize, pq);
if (s->mb_x >= 2) {
@@ -94,7 +94,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if (s->mb_x)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize + 8, s->linesize, pq);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
if (s->mb_x >= 2) {
@@ -110,7 +110,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if (s->mb_x >= 2)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 8, s->linesize, pq);
- if (s->mb_x >= 2 && (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))) {
+ if (s->mb_x >= 2 && (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))) {
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize - 8, s->uvlinesize, pq);
}
@@ -121,7 +121,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if (s->mb_x)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq);
- if (s->mb_x && (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY))) {
+ if (s->mb_x && (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY))) {
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
}
@@ -155,7 +155,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v->block[v->cur_blk_idx][0]);
v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][3],
v->block[v->cur_blk_idx][2]);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][4],
v->block[v->cur_blk_idx][4]);
v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][5],
@@ -174,7 +174,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v->block[v->cur_blk_idx][0]);
v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][3],
v->block[v->cur_blk_idx][1]);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][4],
v->block[v->cur_blk_idx][4]);
v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][5],
@@ -194,7 +194,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v->block[v->left_blk_idx][0]);
v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][3],
v->block[v->left_blk_idx][1]);
- if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][4],
v->block[v->left_blk_idx][4]);
v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][5],
@@ -336,7 +336,7 @@ void ff_vc1_apply_p_loop_filter(VC1Context *v)
{
MpegEncContext *s = &v->s;
int i;
- int block_count = CONFIG_GRAY && (s->avctx->flags & CODEC_FLAG_GRAY) ? 4 : 6;
+ int block_count = CONFIG_GRAY && (s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 4 : 6;
for (i = 0; i < block_count; i++) {
vc1_apply_p_v_loop_filter(v, i);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1_mc.c b/chromium/third_party/ffmpeg/libavcodec/vc1_mc.c
index 535824339e2..4467646e73d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1_mc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1_mc.c
@@ -270,7 +270,7 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
}
/* for grayscale we should not try to read from unknown area */
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY) {
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) {
srcU = s->sc.edge_emu_buffer + 18 * s->linesize;
srcV = s->sc.edge_emu_buffer + 18 * s->linesize;
}
@@ -332,7 +332,7 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
s->hdsp.put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
}
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
/* Chroma MC always uses qpel bilinear */
uvmx = (uvmx & 3) << 1;
@@ -518,7 +518,7 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir)
if (!v->field_mode && !v->s.last_picture.f->data[0])
return;
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
/* calculate chroma MV vector from four luma MVs */
@@ -655,7 +655,7 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
int use_ic;
uint8_t (*lutuv)[256];
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
for (i = 0; i < 4; i++) {
@@ -801,7 +801,7 @@ void ff_vc1_interp_mc(VC1Context *v)
}
/* for grayscale we should not try to read from unknown area */
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY) {
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) {
srcU = s->sc.edge_emu_buffer + 18 * s->linesize;
srcV = s->sc.edge_emu_buffer + 18 * s->linesize;
}
@@ -865,7 +865,7 @@ void ff_vc1_interp_mc(VC1Context *v)
s->hdsp.avg_no_rnd_pixels_tab[dxy](s->dest[0], srcY, s->linesize, 16);
}
- if (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY)
+ if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
/* Chroma MC always uses qpel blilinear */
uvmx = (uvmx & 3) << 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1dec.c b/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
index 3fa39a579ed..acd29bcd2b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1dec.c
@@ -191,7 +191,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
}
alpha = av_clip_uint16(sd->coefs[1][6]);
- for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY ? 1 : 3); plane++) {
+ for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY ? 1 : 3); plane++) {
int width = v->output_width>>!!plane;
for (row = 0; row < v->output_height>>!!plane; row++) {
@@ -283,7 +283,7 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
if (!s->current_picture.f || !s->current_picture.f->data[0]) {
av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
- return -1;
+ return AVERROR_UNKNOWN;
}
if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) {
@@ -312,7 +312,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
wrong but it looks better than doing nothing. */
if (f && f->data[0])
- for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & CODEC_FLAG_GRAY ? 1 : 3); plane++)
+ for (plane = 0; plane < (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY ? 1 : 3); plane++)
for (i = 0; i < v->sprite_height>>!!plane; i++)
memset(f->data[plane] + i * f->linesize[plane],
plane ? 128 : 0, f->linesize[plane]);
@@ -428,30 +428,10 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (!avctx->extradata_size || !avctx->extradata)
return -1;
- if (!CONFIG_GRAY || !(avctx->flags & CODEC_FLAG_GRAY))
- avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
- else {
- avctx->pix_fmt = AV_PIX_FMT_GRAY8;
- if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
- avctx->color_range = AVCOL_RANGE_MPEG;
- }
v->s.avctx = avctx;
if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
- // ensure static VLC tables are initialized
- if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
- return ret;
- if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
- return ret;
- // Hack to ensure the above functions will be called
- // again once we know all necessary settings.
- // That this is necessary might indicate a bug.
- ff_vc1_decode_end(avctx);
-
- ff_blockdsp_init(&s->bdsp, avctx);
- ff_h264chroma_init(&v->h264chroma, 8);
- ff_qpeldsp_init(&s->qdsp);
if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
int count = 0;
@@ -469,7 +449,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
count = avctx->extradata_size*8 - get_bits_count(&gb);
if (count > 0) {
av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",
- count, get_bits(&gb, count));
+ count, get_bits_long(&gb, FFMIN(count, 32)));
} else if (count < 0) {
av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
}
@@ -486,7 +466,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
return -1;
}
- buf2 = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buf2 = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf2)
return AVERROR(ENOMEM);
@@ -524,14 +504,38 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
}
- v->sprite_output_frame = av_frame_alloc();
- if (!v->sprite_output_frame)
- return AVERROR(ENOMEM);
-
avctx->profile = v->profile;
if (v->profile == PROFILE_ADVANCED)
avctx->level = v->level;
+ if (!CONFIG_GRAY || !(avctx->flags & AV_CODEC_FLAG_GRAY))
+ avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
+ else {
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
+ if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
+ avctx->color_range = AVCOL_RANGE_MPEG;
+ }
+
+ // ensure static VLC tables are initialized
+ if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
+ return ret;
+ if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
+ return ret;
+ // Hack to ensure the above functions will be called
+ // again once we know all necessary settings.
+ // That this is necessary might indicate a bug.
+ ff_vc1_decode_end(avctx);
+
+ ff_blockdsp_init(&s->bdsp, avctx);
+ ff_h264chroma_init(&v->h264chroma, 8);
+ ff_qpeldsp_init(&s->qdsp);
+
+ // Must happen after calling ff_vc1_decode_end
+ // to avoid de-allocating the sprite_output_frame
+ v->sprite_output_frame = av_frame_alloc();
+ if (!v->sprite_output_frame)
+ return AVERROR(ENOMEM);
+
avctx->has_b_frames = !!avctx->max_b_frames;
if (v->color_prim == 1 || v->color_prim == 5 || v->color_prim == 6)
@@ -630,7 +634,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->second_field = 0;
- if(s->avctx->flags & CODEC_FLAG_LOW_DELAY)
+ if(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)
s->low_delay = 1;
/* no supplementary picture */
@@ -647,17 +651,19 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
- if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) {
+#if FF_API_CAP_VDPAU
+ if (s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) {
if (v->profile < PROFILE_ADVANCED)
avctx->pix_fmt = AV_PIX_FMT_VDPAU_WMV3;
else
avctx->pix_fmt = AV_PIX_FMT_VDPAU_VC1;
}
+#endif
//for advanced profile we may need to parse and unescape data
if (avctx->codec_id == AV_CODEC_ID_VC1 || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
int buf_size2 = 0;
- buf2 = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buf2 = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf2)
return AVERROR(ENOMEM);
@@ -672,23 +678,33 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (size <= 0) continue;
switch (AV_RB32(start)) {
case VC1_CODE_FRAME:
- if (avctx->hwaccel ||
- s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ if (avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
buf_start = start;
buf_size2 = vc1_unescape_buffer(start + 4, size, buf2);
break;
case VC1_CODE_FIELD: {
int buf_size3;
- if (avctx->hwaccel ||
- s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ if (avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
buf_start_second_field = start;
tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
- if (!tmp)
+ if (!tmp) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
slices = tmp;
- slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!slices[n_slices].buf)
+ slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!slices[n_slices].buf) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
buf_size3 = vc1_unescape_buffer(start + 4, size,
slices[n_slices].buf);
init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
@@ -708,12 +724,16 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
case VC1_CODE_SLICE: {
int buf_size3;
tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
- if (!tmp)
+ if (!tmp) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
slices = tmp;
- slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!slices[n_slices].buf)
+ slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!slices[n_slices].buf) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
buf_size3 = vc1_unescape_buffer(start + 4, size,
slices[n_slices].buf);
init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
@@ -731,18 +751,26 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
divider = find_next_marker(buf, buf + buf_size);
if ((divider == (buf + buf_size)) || AV_RB32(divider) != VC1_CODE_FIELD) {
av_log(avctx, AV_LOG_ERROR, "Error in WVC1 interlaced frame\n");
+ ret = AVERROR_INVALIDDATA;
goto err;
} else { // found field marker, unescape second field
- if (avctx->hwaccel ||
- s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ if (avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
buf_start_second_field = divider;
tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
- if (!tmp)
+ if (!tmp) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
slices = tmp;
- slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!slices[n_slices].buf)
+ slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!slices[n_slices].buf) {
+ ret = AVERROR(ENOMEM);
goto err;
+ }
buf_size3 = vc1_unescape_buffer(divider + 4, buf + buf_size - divider - 4, slices[n_slices].buf);
init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
buf_size3 << 3);
@@ -783,9 +811,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
if (!s->context_initialized) {
- if (ff_msmpeg4_decode_init(avctx) < 0)
+ if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
goto err;
- if (ff_vc1_decode_init_alloc_tables(v) < 0) {
+ if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0) {
ff_mpv_common_end(s);
goto err;
}
@@ -793,8 +821,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->low_delay = !avctx->has_b_frames || v->res_sprite;
if (v->profile == PROFILE_ADVANCED) {
- if(avctx->coded_width<=1 || avctx->coded_height<=1)
+ if(avctx->coded_width<=1 || avctx->coded_height<=1) {
+ ret = AVERROR_INVALIDDATA;
goto err;
+ }
s->h_edge_pos = avctx->coded_width;
s->v_edge_pos = avctx->coded_height;
}
@@ -804,11 +834,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->pic_header_flag = 0;
v->first_pic_header_flag = 1;
if (v->profile < PROFILE_ADVANCED) {
- if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
+ if ((ret = ff_vc1_parse_frame_header(v, &s->gb)) < 0) {
goto err;
}
} else {
- if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
+ if ((ret = ff_vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
goto err;
}
}
@@ -820,11 +850,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if ((avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE)
&& s->pict_type != AV_PICTURE_TYPE_I) {
av_log(v->s.avctx, AV_LOG_ERROR, "Sprite decoder: expected I-frame\n");
+ ret = AVERROR_INVALIDDATA;
goto err;
}
if ((s->mb_height >> v->field_mode) == 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "image too short\n");
+ ret = AVERROR_INVALIDDATA;
goto err;
}
@@ -850,7 +882,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->next_p_frame_damaged = 0;
}
- if (ff_mpv_frame_start(s, avctx) < 0) {
+ if ((ret = ff_mpv_frame_start(s, avctx)) < 0) {
goto err;
}
@@ -873,23 +905,26 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
+#if FF_API_CAP_VDPAU
if ((CONFIG_VC1_VDPAU_DECODER)
- &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) {
+ &&s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) {
if (v->field_mode && buf_start_second_field) {
ff_vdpau_vc1_decode_picture(s, buf_start, buf_start_second_field - buf_start);
ff_vdpau_vc1_decode_picture(s, buf_start_second_field, (buf + buf_size) - buf_start_second_field);
} else {
ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start);
}
- } else if (avctx->hwaccel) {
+ } else
+#endif
+ if (avctx->hwaccel) {
if (v->field_mode && buf_start_second_field) {
// decode first field
s->picture_structure = PICT_BOTTOM_FIELD - v->tff;
- if (avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start) < 0)
+ if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start)) < 0)
goto err;
- if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start) < 0)
+ if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start)) < 0)
goto err;
- if (avctx->hwaccel->end_frame(avctx) < 0)
+ if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
goto err;
// decode second field
@@ -899,23 +934,24 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->pic_header_flag = 0;
if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
av_log(avctx, AV_LOG_ERROR, "parsing header for second field failed");
+ ret = AVERROR_INVALIDDATA;
goto err;
}
v->s.current_picture_ptr->f->pict_type = v->s.pict_type;
- if (avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field) < 0)
+ if ((ret = avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0)
goto err;
- if (avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field) < 0)
+ if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0)
goto err;
- if (avctx->hwaccel->end_frame(avctx) < 0)
+ if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
goto err;
} else {
s->picture_structure = PICT_FRAME;
- if (avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
+ if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start)) < 0)
goto err;
- if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
+ if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start)) < 0)
goto err;
- if (avctx->hwaccel->end_frame(avctx) < 0)
+ if ((ret = avctx->hwaccel->end_frame(avctx)) < 0)
goto err;
}
} else {
@@ -958,6 +994,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (v->field_mode && i == n_slices1 + 2) {
if ((header_ret = ff_vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "Field header damaged\n");
+ ret = AVERROR_INVALIDDATA;
if (avctx->err_recognition & AV_EF_EXPLODE)
goto err;
continue;
@@ -966,6 +1003,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->pic_header_flag = 1;
if ((header_ret = ff_vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
+ ret = AVERROR_INVALIDDATA;
if (avctx->err_recognition & AV_EF_EXPLODE)
goto err;
continue;
@@ -1012,8 +1050,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
get_bits_count(&s->gb), s->gb.size_in_bits);
// if (get_bits_count(&s->gb) > buf_size * 8)
// return -1;
- if(s->er.error_occurred && s->pict_type == AV_PICTURE_TYPE_B)
+ if(s->er.error_occurred && s->pict_type == AV_PICTURE_TYPE_B) {
+ ret = AVERROR_INVALIDDATA;
goto err;
+ }
if (!v->field_mode)
ff_er_frame_end(&s->er);
}
@@ -1027,7 +1067,7 @@ image:
if (avctx->skip_frame >= AVDISCARD_NONREF)
goto end;
#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
- if (vc1_decode_sprites(v, &s->gb))
+ if ((ret = vc1_decode_sprites(v, &s->gb)) < 0)
goto err;
#endif
if ((ret = av_frame_ref(pict, v->sprite_output_frame)) < 0)
@@ -1059,7 +1099,7 @@ err:
for (i = 0; i < n_slices; i++)
av_free(slices[i].buf);
av_free(slices);
- return -1;
+ return ret;
}
@@ -1079,7 +1119,7 @@ static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
AV_PIX_FMT_D3D11VA_VLD,
#endif
#if CONFIG_VC1_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI_VLD,
+ AV_PIX_FMT_VAAPI,
#endif
#if CONFIG_VC1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
@@ -1098,7 +1138,7 @@ AVCodec ff_vc1_decoder = {
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.flush = ff_mpeg_flush,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
.profiles = NULL_IF_CONFIG_SMALL(profiles)
};
@@ -1114,13 +1154,13 @@ AVCodec ff_wmv3_decoder = {
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
.flush = ff_mpeg_flush,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
.profiles = NULL_IF_CONFIG_SMALL(profiles)
};
#endif
-#if CONFIG_WMV3_VDPAU_DECODER
+#if CONFIG_WMV3_VDPAU_DECODER && FF_API_VDPAU
AVCodec ff_wmv3_vdpau_decoder = {
.name = "wmv3_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"),
@@ -1130,13 +1170,13 @@ AVCodec ff_wmv3_vdpau_decoder = {
.init = vc1_decode_init,
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HWACCEL_VDPAU,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_WMV3, AV_PIX_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles)
};
#endif
-#if CONFIG_VC1_VDPAU_DECODER
+#if CONFIG_VC1_VDPAU_DECODER && FF_API_VDPAU
AVCodec ff_vc1_vdpau_decoder = {
.name = "vc1_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"),
@@ -1146,7 +1186,7 @@ AVCodec ff_vc1_vdpau_decoder = {
.init = vc1_decode_init,
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HWACCEL_VDPAU,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_VC1, AV_PIX_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles)
};
@@ -1162,7 +1202,7 @@ AVCodec ff_wmv3image_decoder = {
.init = vc1_decode_init,
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = vc1_sprite_flush,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
@@ -1181,7 +1221,7 @@ AVCodec ff_vc1image_decoder = {
.init = vc1_decode_init,
.close = ff_vc1_decode_end,
.decode = vc1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = vc1_sprite_flush,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_YUV420P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vcr1.c b/chromium/third_party/ffmpeg/libavcodec/vcr1.c
index f8281ea05a2..28a5eec7d1c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vcr1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vcr1.c
@@ -129,5 +129,5 @@ AVCodec ff_vcr1_decoder = {
.priv_data_size = sizeof(VCR1Context),
.init = vcr1_decode_init,
.decode = vcr1_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda.c b/chromium/third_party/ffmpeg/libavcodec/vda.c
index 5867cae1206..4670140c761 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vda.c
@@ -21,7 +21,7 @@
#include "libavutil/mem.h"
#include "vda.h"
-#include "vda_internal.h"
+#include "vda_vt_internal.h"
#if CONFIG_H264_VDA_HWACCEL
AVVDAContext *av_vda_alloc_context(void)
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_h264.c b/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
index 4d2274d649e..8c526c07549 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_h264.c
@@ -32,20 +32,7 @@ struct vda_buffer {
CVPixelBufferRef cv_buffer;
};
#include "internal.h"
-#include "vda_internal.h"
-
-typedef struct VDAContext {
- // The current bitstream buffer.
- uint8_t *bitstream;
-
- // The current size of the bitstream.
- int bitstream_size;
-
- // The reference size used for fast reallocation.
- int allocated_size;
-
- CVImageBufferRef frame;
-} VDAContext;
+#include "vda_vt_internal.h"
/* Decoder callback that adds the vda frame to the queue in display order. */
static void vda_decoder_callback(void *vda_hw_ctx,
@@ -68,7 +55,7 @@ static void vda_decoder_callback(void *vda_hw_ctx,
vda_ctx->cv_buffer = CVPixelBufferRetain(image_buffer);
}
-static int vda_sync_decode(VDAContext *ctx, struct vda_context *vda_ctx)
+static int vda_sync_decode(VTContext *ctx, struct vda_context *vda_ctx)
{
OSStatus status;
CFDataRef coded_frame;
@@ -93,7 +80,7 @@ static int vda_old_h264_start_frame(AVCodecContext *avctx,
av_unused const uint8_t *buffer,
av_unused uint32_t size)
{
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ VTContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
if (!vda_ctx->decoder)
@@ -108,7 +95,7 @@ static int vda_old_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer,
uint32_t size)
{
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ VTContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
void *tmp;
@@ -141,7 +128,7 @@ static void vda_h264_release_buffer(void *opaque, uint8_t *data)
static int vda_old_h264_end_frame(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ VTContext *vda = avctx->internal->hwaccel_priv_data;
struct vda_context *vda_ctx = avctx->hwaccel_context;
AVFrame *frame = h->cur_pic_ptr->f;
struct vda_buffer *context;
@@ -271,17 +258,6 @@ int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
return status;
}
-static int vda_h264_uninit(AVCodecContext *avctx)
-{
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
- if (vda) {
- av_freep(&vda->bitstream);
- if (vda->frame)
- CVPixelBufferRelease(vda->frame);
- }
- return 0;
-}
-
AVHWAccel ff_h264_vda_old_hwaccel = {
.name = "h264_vda",
.type = AVMEDIA_TYPE_VIDEO,
@@ -290,8 +266,8 @@ AVHWAccel ff_h264_vda_old_hwaccel = {
.start_frame = vda_old_h264_start_frame,
.decode_slice = vda_old_h264_decode_slice,
.end_frame = vda_old_h264_end_frame,
- .uninit = vda_h264_uninit,
- .priv_data_size = sizeof(VDAContext),
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
};
void ff_vda_output_callback(void *opaque,
@@ -301,7 +277,7 @@ void ff_vda_output_callback(void *opaque,
CVImageBufferRef image_buffer)
{
AVCodecContext *ctx = opaque;
- VDAContext *vda = ctx->internal->hwaccel_priv_data;
+ VTContext *vda = ctx->internal->hwaccel_priv_data;
if (vda->frame) {
@@ -315,65 +291,10 @@ void ff_vda_output_callback(void *opaque,
vda->frame = CVPixelBufferRetain(image_buffer);
}
-static int vda_h264_start_frame(AVCodecContext *avctx,
- const uint8_t *buffer,
- uint32_t size)
-{
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
- H264Context *h = avctx->priv_data;
-
- if (h->is_avc == 1) {
- void *tmp;
- vda->bitstream_size = 0;
- tmp = av_fast_realloc(vda->bitstream,
- &vda->allocated_size,
- size);
- vda->bitstream = tmp;
- memcpy(vda->bitstream, buffer, size);
- vda->bitstream_size = size;
- } else {
- vda->bitstream_size = 0;
- }
- return 0;
-}
-
-static int vda_h264_decode_slice(AVCodecContext *avctx,
- const uint8_t *buffer,
- uint32_t size)
-{
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
- H264Context *h = avctx->priv_data;
- void *tmp;
-
- if (h->is_avc == 1)
- return 0;
-
- tmp = av_fast_realloc(vda->bitstream,
- &vda->allocated_size,
- vda->bitstream_size + size + 4);
- if (!tmp)
- return AVERROR(ENOMEM);
-
- vda->bitstream = tmp;
-
- AV_WB32(vda->bitstream + vda->bitstream_size, size);
- memcpy(vda->bitstream + vda->bitstream_size + 4, buffer, size);
-
- vda->bitstream_size += size + 4;
-
- return 0;
-}
-
-static void release_buffer(void *opaque, uint8_t *data)
-{
- CVImageBufferRef frame = (CVImageBufferRef)data;
- CVPixelBufferRelease(frame);
-}
-
static int vda_h264_end_frame(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
- VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ VTContext *vda = avctx->internal->hwaccel_priv_data;
AVVDAContext *vda_ctx = avctx->hwaccel_context;
AVFrame *frame = h->cur_pic_ptr->f;
uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames
@@ -403,19 +324,7 @@ static int vda_h264_end_frame(AVCodecContext *avctx)
return AVERROR_UNKNOWN;
}
- av_buffer_unref(&frame->buf[0]);
-
- frame->buf[0] = av_buffer_create((uint8_t*)vda->frame,
- sizeof(vda->frame),
- release_buffer, NULL,
- AV_BUFFER_FLAG_READONLY);
- if (!frame->buf)
- return AVERROR(ENOMEM);
-
- frame->data[3] = (uint8_t*)vda->frame;
- vda->frame = NULL;
-
- return 0;
+ return ff_videotoolbox_buffer_create(vda, frame);
}
int ff_vda_default_init(AVCodecContext *avctx)
@@ -434,26 +343,7 @@ int ff_vda_default_init(AVCodecContext *avctx)
// kCVPixelFormatType_420YpCbCr8Planar;
- /* Each VCL NAL in the bitstream sent to the decoder
- * is preceded by a 4 bytes length header.
- * Change the avcC atom header if needed, to signal headers of 4 bytes. */
- if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {
- uint8_t *rw_extradata;
-
- if (!(rw_extradata = av_malloc(avctx->extradata_size)))
- return AVERROR(ENOMEM);
-
- memcpy(rw_extradata, avctx->extradata, avctx->extradata_size);
-
- rw_extradata[4] |= 0x03;
-
- avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, avctx->extradata_size);
-
- av_freep(&rw_extradata);
- } else {
- avc_data = CFDataCreate(kCFAllocatorDefault,
- avctx->extradata, avctx->extradata_size);
- }
+ avc_data = ff_videotoolbox_avcc_extradata_create(avctx);
config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
4,
@@ -521,27 +411,15 @@ int ff_vda_default_init(AVCodecContext *avctx)
}
}
-static int vda_h264_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
-{
- frame->width = avctx->width;
- frame->height = avctx->height;
- frame->format = avctx->pix_fmt;
- frame->buf[0] = av_buffer_alloc(1);
-
- if (!frame->buf[0])
- return AVERROR(ENOMEM);
- return 0;
-}
-
AVHWAccel ff_h264_vda_hwaccel = {
.name = "h264_vda",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.pix_fmt = AV_PIX_FMT_VDA,
- .alloc_frame = vda_h264_alloc_frame,
- .start_frame = vda_h264_start_frame,
- .decode_slice = vda_h264_decode_slice,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = ff_videotoolbox_h264_start_frame,
+ .decode_slice = ff_videotoolbox_h264_decode_slice,
.end_frame = vda_h264_end_frame,
- .uninit = vda_h264_uninit,
- .priv_data_size = sizeof(VDAContext),
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c b/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
index c00e7e4e155..a092693dbcc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_h264_dec.c
@@ -62,9 +62,6 @@ typedef struct {
void *hwaccel_context;
enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
-#if FF_API_GET_BUFFER
- int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-#endif
} VDADecoderContext;
static enum AVPixelFormat get_format(struct AVCodecContext *avctx,
@@ -108,10 +105,6 @@ static inline void set_context(AVCodecContext *avctx)
avctx->get_format = get_format;
ctx->get_buffer2 = avctx->get_buffer2;
avctx->get_buffer2 = get_buffer2;
-#if FF_API_GET_BUFFER
- ctx->get_buffer = avctx->get_buffer;
- avctx->get_buffer = NULL;
-#endif
}
static inline void restore_context(AVCodecContext *avctx)
@@ -120,9 +113,6 @@ static inline void restore_context(AVCodecContext *avctx)
avctx->hwaccel_context = ctx->hwaccel_context;
avctx->get_format = ctx->get_format;
avctx->get_buffer2 = ctx->get_buffer2;
-#if FF_API_GET_BUFFER
- avctx->get_buffer = ctx->get_buffer;
-#endif
}
static int vdadec_decode(AVCodecContext *avctx,
@@ -267,7 +257,7 @@ AVCodec ff_h264_vda_decoder = {
.init = vdadec_init,
.close = vdadec_close,
.decode = vdadec_decode,
- .capabilities = CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY,
.flush = vdadec_flush,
.long_name = NULL_IF_CONFIG_SMALL("H.264 (VDA acceleration)"),
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vda_vt_internal.h b/chromium/third_party/ffmpeg/libavcodec/vda_vt_internal.h
new file mode 100644
index 00000000000..9ff63ccc52f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vda_vt_internal.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDA_VT_INTERNAL_H
+#define AVCODEC_VDA_VT_INTERNAL_H
+
+void ff_vda_output_callback(void *vda_hw_ctx,
+ CFDictionaryRef user_info,
+ OSStatus status,
+ uint32_t infoFlags,
+ CVImageBufferRef image_buffer);
+
+int ff_vda_default_init(AVCodecContext *avctx);
+void ff_vda_default_free(AVCodecContext *avctx);
+
+typedef struct VTContext {
+ // The current bitstream buffer.
+ uint8_t *bitstream;
+
+ // The current size of the bitstream.
+ int bitstream_size;
+
+ // The reference size used for fast reallocation.
+ int allocated_size;
+
+ // The core video buffer
+ CVImageBufferRef frame;
+} VTContext;
+
+int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame);
+int ff_videotoolbox_uninit(AVCodecContext *avctx);
+int ff_videotoolbox_buffer_create(VTContext *vtctx, AVFrame *frame);
+int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size);
+int ff_videotoolbox_h264_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size);
+CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx);
+#endif /* AVCODEC_VDA_VT_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau.c b/chromium/third_party/ffmpeg/libavcodec/vdpau.c
index 62d99601c75..b5304664d67 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau.c
@@ -358,6 +358,25 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
/* Obsolete non-hwaccel VDPAU support below... */
+#if FF_API_VDPAU
+void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
+{
+ struct vdpau_render_state *render = (struct vdpau_render_state*)data;
+ assert(render);
+
+ render->bitstream_buffers= av_fast_realloc(
+ render->bitstream_buffers,
+ &render->bitstream_buffers_allocated,
+ sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
+ );
+
+ render->bitstream_buffers[render->bitstream_buffers_used].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf;
+ render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size;
+ render->bitstream_buffers_used++;
+}
+
+#if CONFIG_H264_VDPAU_DECODER
void ff_vdpau_h264_set_reference_frames(H264Context *h)
{
struct vdpau_render_state *render, *render_ref;
@@ -426,24 +445,6 @@ void ff_vdpau_h264_set_reference_frames(H264Context *h)
}
}
-void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
-{
- struct vdpau_render_state *render = (struct vdpau_render_state*)data;
- assert(render);
-
- render->bitstream_buffers= av_fast_realloc(
- render->bitstream_buffers,
- &render->bitstream_buffers_allocated,
- sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
- );
-
- render->bitstream_buffers[render->bitstream_buffers_used].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
- render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf;
- render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size;
- render->bitstream_buffers_used++;
-}
-
-#if CONFIG_H264_VDPAU_DECODER
void ff_vdpau_h264_picture_start(H264Context *h)
{
struct vdpau_render_state *render;
@@ -692,6 +693,7 @@ void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *ctx, const uint8_t *buf,
render->bitstream_buffers_used = 0;
}
#endif /* CONFIG_MPEG4_VDPAU_DECODER */
+#endif /* FF_API_VDPAU */
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau.h b/chromium/third_party/ffmpeg/libavcodec/vdpau.h
index a42ca013f20..17cc2631b34 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau.h
@@ -231,10 +231,8 @@ struct vdpau_render_state {
int state; ///< Holds FF_VDPAU_STATE_* values.
-#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
/** picture parameter information for all supported codecs */
union AVVDPAUPictureInfo info;
-#endif
/** Describe size/location of the compressed video data.
Set to 0 when freeing bitstream_buffers. */
@@ -242,11 +240,6 @@ struct vdpau_render_state {
int bitstream_buffers_used;
/** The user is responsible for freeing this buffer using av_freep(). */
VdpBitstreamBuffer *bitstream_buffers;
-
-#if !AV_HAVE_INCOMPATIBLE_LIBAV_ABI
- /** picture parameter information for all supported codecs */
- union AVVDPAUPictureInfo info;
-#endif
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c
new file mode 100644
index 00000000000..3c1dc5f223c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c
@@ -0,0 +1,437 @@
+/*
+ * MPEG-H Part 2 / HEVC / H.265 HW decode acceleration through VDPAU
+ *
+ * Copyright (c) 2013 Philip Langdale
+ *
+ * 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 <vdpau/vdpau.h>
+
+#include "avcodec.h"
+#include "internal.h"
+#include "hevc.h"
+#include "vdpau.h"
+#include "vdpau_internal.h"
+
+static int vdpau_hevc_start_frame(AVCodecContext *avctx,
+ const uint8_t *buffer, uint32_t size)
+{
+ HEVCContext *h = avctx->priv_data;
+ HEVCFrame *pic = h->ref;
+ struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
+
+ VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;
+
+ const HEVCSPS *sps = h->ps.sps;
+ const HEVCPPS *pps = h->ps.pps;
+ const SliceHeader *sh = &h->sh;
+ const ScalingList *sl = pps->scaling_list_data_present_flag ?
+ &pps->scaling_list : &sps->scaling_list;
+
+ /* init VdpPictureInfoHEVC */
+
+ /* SPS */
+ info->chroma_format_idc = sps->chroma_format_idc;
+ info->separate_colour_plane_flag = sps->separate_colour_plane_flag;
+ info->pic_width_in_luma_samples = sps->width;
+ info->pic_height_in_luma_samples = sps->height;
+ info->bit_depth_luma_minus8 = sps->bit_depth - 8;
+ info->bit_depth_chroma_minus8 = sps->bit_depth - 8;
+ info->log2_max_pic_order_cnt_lsb_minus4 = sps->log2_max_poc_lsb - 4;
+ /** Provides the value corresponding to the nuh_temporal_id of the frame
+ to be decoded. */
+ info->sps_max_dec_pic_buffering_minus1 = sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering - 1;
+ info->log2_min_luma_coding_block_size_minus3 = sps->log2_min_cb_size - 3;
+ info->log2_diff_max_min_luma_coding_block_size = sps->log2_diff_max_min_coding_block_size;
+ info->log2_min_transform_block_size_minus2 = sps->log2_min_tb_size - 2;
+ info->log2_diff_max_min_transform_block_size = sps->log2_max_trafo_size - sps->log2_min_tb_size;
+ info->max_transform_hierarchy_depth_inter = sps->max_transform_hierarchy_depth_inter;
+ info->max_transform_hierarchy_depth_intra = sps->max_transform_hierarchy_depth_intra;
+ info->scaling_list_enabled_flag = sps->scaling_list_enable_flag;
+ /** Scaling lists, in diagonal order, to be used for this frame. */
+ for (size_t i = 0; i < 6; i++) {
+ for (size_t j = 0; j < 16; j++) {
+ /** Scaling List for 4x4 quantization matrix,
+ indexed as ScalingList4x4[matrixId][i]. */
+ uint8_t pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j];
+ info->ScalingList4x4[i][j] = sl->sl[0][i][pos];
+ }
+ for (size_t j = 0; j < 64; j++) {
+ uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j];
+ /** Scaling List for 8x8 quantization matrix,
+ indexed as ScalingList8x8[matrixId][i]. */
+ info->ScalingList8x8[i][j] = sl->sl[1][i][pos];
+ /** Scaling List for 16x16 quantization matrix,
+ indexed as ScalingList16x16[matrixId][i]. */
+ info->ScalingList16x16[i][j] = sl->sl[2][i][pos];
+ if (i < 2) {
+ /** Scaling List for 32x32 quantization matrix,
+ indexed as ScalingList32x32[matrixId][i]. */
+ info->ScalingList32x32[i][j] = sl->sl[3][i * 3][pos];
+ }
+ }
+ /** Scaling List DC Coefficients for 16x16,
+ indexed as ScalingListDCCoeff16x16[matrixId]. */
+ info->ScalingListDCCoeff16x16[i] = sl->sl_dc[0][i];
+ if (i < 2) {
+ /** Scaling List DC Coefficients for 32x32,
+ indexed as ScalingListDCCoeff32x32[matrixId]. */
+ info->ScalingListDCCoeff32x32[i] = sl->sl_dc[1][i * 3];
+ }
+ }
+ info->amp_enabled_flag = sps->amp_enabled_flag;
+ info->sample_adaptive_offset_enabled_flag = sps->sao_enabled;
+ info->pcm_enabled_flag = sps->pcm_enabled_flag;
+ if (info->pcm_enabled_flag) {
+ /** Only needs to be set if pcm_enabled_flag is set. Ignored otherwise. */
+ info->pcm_sample_bit_depth_luma_minus1 = sps->pcm.bit_depth - 1;
+ /** Only needs to be set if pcm_enabled_flag is set. Ignored otherwise. */
+ info->pcm_sample_bit_depth_chroma_minus1 = sps->pcm.bit_depth_chroma - 1;
+ /** Only needs to be set if pcm_enabled_flag is set. Ignored otherwise. */
+ info->log2_min_pcm_luma_coding_block_size_minus3 = sps->pcm.log2_min_pcm_cb_size - 3;
+ /** Only needs to be set if pcm_enabled_flag is set. Ignored otherwise. */
+ info->log2_diff_max_min_pcm_luma_coding_block_size = sps->pcm.log2_max_pcm_cb_size - sps->pcm.log2_min_pcm_cb_size;
+ /** Only needs to be set if pcm_enabled_flag is set. Ignored otherwise. */
+ info->pcm_loop_filter_disabled_flag = sps->pcm.loop_filter_disable_flag;
+ }
+ /** Per spec, when zero, assume short_term_ref_pic_set_sps_flag
+ is also zero. */
+ info->num_short_term_ref_pic_sets = sps->nb_st_rps;
+ info->long_term_ref_pics_present_flag = sps->long_term_ref_pics_present_flag;
+ /** Only needed if long_term_ref_pics_present_flag is set. Ignored
+ otherwise. */
+ info->num_long_term_ref_pics_sps = sps->num_long_term_ref_pics_sps;
+ info->sps_temporal_mvp_enabled_flag = sps->sps_temporal_mvp_enabled_flag;
+ info->strong_intra_smoothing_enabled_flag = sps->sps_strong_intra_smoothing_enable_flag;
+ /** @} */
+
+ /** \name HEVC Picture Parameter Set
+ *
+ * Copies of the HEVC Picture Parameter Set bitstream fields.
+ * @{ */
+ info->dependent_slice_segments_enabled_flag = pps->dependent_slice_segments_enabled_flag;
+ info->output_flag_present_flag = pps->output_flag_present_flag;
+ info->num_extra_slice_header_bits = pps->num_extra_slice_header_bits;
+ info->sign_data_hiding_enabled_flag = pps->sign_data_hiding_flag;
+ info->cabac_init_present_flag = pps->cabac_init_present_flag;
+ info->num_ref_idx_l0_default_active_minus1 = pps->num_ref_idx_l0_default_active - 1;
+ info->num_ref_idx_l1_default_active_minus1 = pps->num_ref_idx_l1_default_active - 1;
+ info->init_qp_minus26 = pps->pic_init_qp_minus26;
+ info->constrained_intra_pred_flag = pps->constrained_intra_pred_flag;
+ info->transform_skip_enabled_flag = pps->transform_skip_enabled_flag;
+ info->cu_qp_delta_enabled_flag = pps->cu_qp_delta_enabled_flag;
+ /** Only needed if cu_qp_delta_enabled_flag is set. Ignored otherwise. */
+ info->diff_cu_qp_delta_depth = pps->diff_cu_qp_delta_depth;
+ info->pps_cb_qp_offset = pps->cb_qp_offset;
+ info->pps_cr_qp_offset = pps->cr_qp_offset;
+ info->pps_slice_chroma_qp_offsets_present_flag = pps->pic_slice_level_chroma_qp_offsets_present_flag;
+ info->weighted_pred_flag = pps->weighted_pred_flag;
+ info->weighted_bipred_flag = pps->weighted_bipred_flag;
+ info->transquant_bypass_enabled_flag = pps->transquant_bypass_enable_flag;
+ info->tiles_enabled_flag = pps->tiles_enabled_flag;
+ info->entropy_coding_sync_enabled_flag = pps->entropy_coding_sync_enabled_flag;
+ if (info->tiles_enabled_flag) {
+ /** Only valid if tiles_enabled_flag is set. Ignored otherwise. */
+ info->num_tile_columns_minus1 = pps->num_tile_columns - 1;
+ /** Only valid if tiles_enabled_flag is set. Ignored otherwise. */
+ info->num_tile_rows_minus1 = pps->num_tile_rows - 1;
+ /** Only valid if tiles_enabled_flag is set. Ignored otherwise. */
+ info->uniform_spacing_flag = pps->uniform_spacing_flag;
+ /** Only need to set 0..num_tile_columns_minus1. The struct
+ definition reserves up to the maximum of 20. Invalid values are
+ ignored. */
+ for (ssize_t i = 0; i < pps->num_tile_columns; i++) {
+ info->column_width_minus1[i] = pps->column_width[i] - 1;
+ }
+ /** Only need to set 0..num_tile_rows_minus1. The struct
+ definition reserves up to the maximum of 22. Invalid values are
+ ignored.*/
+ for (ssize_t i = 0; i < pps->num_tile_rows; i++) {
+ info->row_height_minus1[i] = pps->row_height[i] - 1;
+ }
+ /** Only needed if tiles_enabled_flag is set. Invalid values are
+ ignored. */
+ info->loop_filter_across_tiles_enabled_flag = pps->loop_filter_across_tiles_enabled_flag;
+ }
+ info->pps_loop_filter_across_slices_enabled_flag = pps->seq_loop_filter_across_slices_enabled_flag;
+ info->deblocking_filter_control_present_flag = pps->deblocking_filter_control_present_flag;
+ /** Only valid if deblocking_filter_control_present_flag is set. Ignored
+ otherwise. */
+ info->deblocking_filter_override_enabled_flag = pps->deblocking_filter_override_enabled_flag;
+ /** Only valid if deblocking_filter_control_present_flag is set. Ignored
+ otherwise. */
+ info->pps_deblocking_filter_disabled_flag = pps->disable_dbf;
+ /** Only valid if deblocking_filter_control_present_flag is set and
+ pps_deblocking_filter_disabled_flag is not set. Ignored otherwise.*/
+ info->pps_beta_offset_div2 = pps->beta_offset / 2;
+ /** Only valid if deblocking_filter_control_present_flag is set and
+ pps_deblocking_filter_disabled_flag is not set. Ignored otherwise. */
+ info->pps_tc_offset_div2 = pps->tc_offset / 2;
+ info->lists_modification_present_flag = pps->lists_modification_present_flag;
+ info->log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2;
+ info->slice_segment_header_extension_present_flag = pps->slice_header_extension_present_flag;
+
+ /** \name HEVC Slice Segment Header
+ *
+ * Copies of the HEVC Slice Segment Header bitstream fields and calculated
+ * values detailed in the specification.
+ * @{ */
+ /** Set to 1 if nal_unit_type is equal to IDR_W_RADL or IDR_N_LP.
+ Set to zero otherwise. */
+ info->IDRPicFlag = IS_IDR(h);
+ /** Set to 1 if nal_unit_type in the range of BLA_W_LP to
+ RSV_IRAP_VCL23, inclusive. Set to zero otherwise.*/
+ info->RAPPicFlag = IS_IRAP(h);
+ /** See section 7.4.7.1 of the specification. */
+ info->CurrRpsIdx = sps->nb_st_rps;
+ if (sh->short_term_ref_pic_set_sps_flag == 1) {
+ for (size_t i = 0; i < sps->nb_st_rps; i++) {
+ if (sh->short_term_rps == &sps->st_rps[i]) {
+ info->CurrRpsIdx = i;
+ break;
+ }
+ }
+ }
+ /** See section 7.4.7.2 of the specification. */
+ info->NumPocTotalCurr = ff_hevc_frame_nb_refs(h);
+ if (sh->short_term_ref_pic_set_sps_flag == 0 && sh->short_term_rps) {
+ /** Corresponds to specification field, NumDeltaPocs[RefRpsIdx].
+ Only applicable when short_term_ref_pic_set_sps_flag == 0.
+ Implementations will ignore this value in other cases. See 7.4.8. */
+ info->NumDeltaPocsOfRefRpsIdx = sh->short_term_rps->rps_idx_num_delta_pocs;
+ }
+ /** Section 7.6.3.1 of the H.265/HEVC Specification defines the syntax of
+ the slice_segment_header. This header contains information that
+ some VDPAU implementations may choose to skip. The VDPAU API
+ requires client applications to track the number of bits used in the
+ slice header for structures associated with short term and long term
+ reference pictures. First, VDPAU requires the number of bits used by
+ the short_term_ref_pic_set array in the slice_segment_header. */
+ info->NumShortTermPictureSliceHeaderBits = sh->short_term_ref_pic_set_size;
+ /** Second, VDPAU requires the number of bits used for long term reference
+ pictures in the slice_segment_header. This is equal to the number
+ of bits used for the contents of the block beginning with
+ "if(long_term_ref_pics_present_flag)". */
+ info->NumLongTermPictureSliceHeaderBits = sh->long_term_ref_pic_set_size;
+ /** @} */
+
+ /** Slice Decoding Process - Picture Order Count */
+ /** The value of PicOrderCntVal of the picture in the access unit
+ containing the SEI message. The picture being decoded. */
+ info->CurrPicOrderCntVal = h->poc;
+
+ /** Slice Decoding Process - Reference Picture Sets */
+ for (size_t i = 0; i < 16; i++) {
+ info->RefPics[i] = VDP_INVALID_HANDLE;
+ info->PicOrderCntVal[i] = 0;
+ info->IsLongTerm[i] = 0;
+ }
+ for (size_t i = 0, j = 0; i < FF_ARRAY_ELEMS(h->DPB); i++) {
+ const HEVCFrame *frame = &h->DPB[i];
+ if (frame != h->ref && (frame->flags & (HEVC_FRAME_FLAG_LONG_REF |
+ HEVC_FRAME_FLAG_SHORT_REF))) {
+ if (j > 16) {
+ av_log(avctx, AV_LOG_WARNING,
+ "VDPAU only supports up to 16 references in the DPB. "
+ "This frame may not be decoded correctly.\n");
+ break;
+ }
+ /** Array of video reference surfaces.
+ Set any unused positions to VDP_INVALID_HANDLE. */
+ info->RefPics[j] = ff_vdpau_get_surface_id(frame->frame);
+ /** Array of picture order counts. These correspond to positions
+ in the RefPics array. */
+ info->PicOrderCntVal[j] = frame->poc;
+ /** Array used to specify whether a particular RefPic is
+ a long term reference. A value of "1" indicates a long-term
+ reference. */
+ // XXX: Setting this caused glitches in the nvidia implementation
+ // Always setting it to zero, produces correct results
+ //info->IsLongTerm[j] = frame->flags & HEVC_FRAME_FLAG_LONG_REF;
+ info->IsLongTerm[j] = 0;
+ j++;
+ }
+ }
+ /** Copy of specification field, see Section 8.3.2 of the
+ H.265/HEVC Specification. */
+ info->NumPocStCurrBefore = h->rps[ST_CURR_BEF].nb_refs;
+ if (info->NumPocStCurrBefore > 8) {
+ av_log(avctx, AV_LOG_WARNING,
+ "VDPAU only supports up to 8 references in StCurrBefore. "
+ "This frame may not be decoded correctly.\n");
+ info->NumPocStCurrBefore = 8;
+ }
+ /** Copy of specification field, see Section 8.3.2 of the
+ H.265/HEVC Specification. */
+ info->NumPocStCurrAfter = h->rps[ST_CURR_AFT].nb_refs;
+ if (info->NumPocStCurrAfter > 8) {
+ av_log(avctx, AV_LOG_WARNING,
+ "VDPAU only supports up to 8 references in StCurrAfter. "
+ "This frame may not be decoded correctly.\n");
+ info->NumPocStCurrAfter = 8;
+ }
+ /** Copy of specification field, see Section 8.3.2 of the
+ H.265/HEVC Specification. */
+ info->NumPocLtCurr = h->rps[LT_CURR].nb_refs;
+ if (info->NumPocLtCurr > 8) {
+ av_log(avctx, AV_LOG_WARNING,
+ "VDPAU only supports up to 8 references in LtCurr. "
+ "This frame may not be decoded correctly.\n");
+ info->NumPocLtCurr = 8;
+ }
+ /** Reference Picture Set list, one of the short-term RPS. These
+ correspond to positions in the RefPics array. */
+ for (ssize_t i = 0, j = 0; i < h->rps[ST_CURR_BEF].nb_refs; i++) {
+ HEVCFrame *frame = h->rps[ST_CURR_BEF].ref[i];
+ if (frame) {
+ uint8_t found = 0;
+ uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
+ for (size_t k = 0; k < 16; k++) {
+ if (id == info->RefPics[k]) {
+ info->RefPicSetStCurrBefore[j] = k;
+ j++;
+ found = 1;
+ break;
+ }
+ }
+ if (!found) {
+ av_log(avctx, AV_LOG_WARNING, "missing surface: %p\n",
+ (void *)id);
+ }
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "missing STR Before frame: %zd\n", i);
+ }
+ }
+ /** Reference Picture Set list, one of the short-term RPS. These
+ correspond to positions in the RefPics array. */
+ for (ssize_t i = 0, j = 0; i < h->rps[ST_CURR_AFT].nb_refs; i++) {
+ HEVCFrame *frame = h->rps[ST_CURR_AFT].ref[i];
+ if (frame) {
+ uint8_t found = 0;
+ uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
+ for (size_t k = 0; k < 16; k++) {
+ if (id == info->RefPics[k]) {
+ info->RefPicSetStCurrAfter[j] = k;
+ j++;
+ found = 1;
+ break;
+ }
+ }
+ if (!found) {
+ av_log(avctx, AV_LOG_WARNING, "missing surface: %p\n",
+ (void *)id);
+ }
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "missing STR After frame: %zd\n", i);
+ }
+ }
+ /** Reference Picture Set list, one of the long-term RPS. These
+ correspond to positions in the RefPics array. */
+ for (ssize_t i = 0, j = 0; i < h->rps[LT_CURR].nb_refs; i++) {
+ HEVCFrame *frame = h->rps[LT_CURR].ref[i];
+ if (frame) {
+ uint8_t found = 0;
+ uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
+ for (size_t k = 0; k < 16; k++) {
+ if (id == info->RefPics[k]) {
+ info->RefPicSetLtCurr[j] = k;
+ j++;
+ found = 1;
+ break;
+ }
+ }
+ if (!found) {
+ av_log(avctx, AV_LOG_WARNING, "missing surface: %p\n",
+ (void *)id);
+ }
+ } else {
+ av_log(avctx, AV_LOG_WARNING, "missing LTR frame: %zd\n", i);
+ }
+ }
+
+ return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
+}
+
+static const uint8_t start_code_prefix[3] = { 0x00, 0x00, 0x01 };
+
+static int vdpau_hevc_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer, uint32_t size)
+{
+ HEVCContext *h = avctx->priv_data;
+ struct vdpau_picture_context *pic_ctx = h->ref->hwaccel_picture_private;
+ int val;
+
+ val = ff_vdpau_add_buffer(pic_ctx, start_code_prefix, 3);
+ if (val)
+ return val;
+
+ val = ff_vdpau_add_buffer(pic_ctx, buffer, size);
+ if (val)
+ return val;
+
+ return 0;
+}
+
+static int vdpau_hevc_end_frame(AVCodecContext *avctx)
+{
+ HEVCContext *h = avctx->priv_data;
+ struct vdpau_picture_context *pic_ctx = h->ref->hwaccel_picture_private;
+ int val;
+
+ val = ff_vdpau_common_end_frame(avctx, h->ref->frame, pic_ctx);
+ if (val < 0)
+ return val;
+
+ return 0;
+}
+
+static int vdpau_hevc_init(AVCodecContext *avctx)
+{
+ VdpDecoderProfile profile;
+ uint32_t level = avctx->level;
+
+ switch (avctx->profile) {
+ case FF_PROFILE_HEVC_MAIN:
+ profile = VDP_DECODER_PROFILE_HEVC_MAIN;
+ break;
+ case FF_PROFILE_HEVC_MAIN_10:
+ profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
+ break;
+ case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
+ profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
+ break;
+ default:
+ return AVERROR(ENOTSUP);
+ }
+
+ return ff_vdpau_common_init(avctx, profile, level);
+}
+
+AVHWAccel ff_hevc_vdpau_hwaccel = {
+ .name = "hevc_vdpau",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .pix_fmt = AV_PIX_FMT_VDPAU,
+ .start_frame = vdpau_hevc_start_frame,
+ .end_frame = vdpau_hevc_end_frame,
+ .decode_slice = vdpau_hevc_decode_slice,
+ .frame_priv_data_size = sizeof(struct vdpau_picture_context),
+ .init = vdpau_hevc_init,
+ .uninit = ff_vdpau_common_uninit,
+ .priv_data_size = sizeof(VDPAUContext),
+};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
index 6f762e41db3..8a63733546b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
@@ -50,6 +50,9 @@ union VDPAUPictureInfo {
#ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
VdpPictureInfoH264Predictive h264_predictive;
#endif
+#ifdef VDP_DECODER_PROFILE_HEVC_MAIN
+ VdpPictureInfoHEVC hevc;
+#endif
};
#include "vdpau.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/version.h b/chromium/third_party/ffmpeg/libavcodec/version.h
index 74a1b3048e0..d233c712cfe 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 56
-#define LIBAVCODEC_VERSION_MINOR 41
+#define LIBAVCODEC_VERSION_MAJOR 57
+#define LIBAVCODEC_VERSION_MINOR 1
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -46,141 +46,115 @@
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
+ *
+ * @note, when bumping the major version it is recommended to manually
+ * disable each FF_API_* in its own commit instead of disabling them all
+ * at once through the bump. This improves the git bisect-ability of the change.
*/
#ifndef FF_API_VIMA_DECODER
-#define FF_API_VIMA_DECODER (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_REQUEST_CHANNELS
-#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_OLD_DECODE_AUDIO
-#define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_OLD_ENCODE_AUDIO
-#define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_OLD_ENCODE_VIDEO
-#define FF_API_OLD_ENCODE_VIDEO (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_CODEC_ID
-#define FF_API_CODEC_ID (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_VIMA_DECODER (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AUDIO_CONVERT
-#define FF_API_AUDIO_CONVERT (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_AUDIO_CONVERT (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AVCODEC_RESAMPLE
#define FF_API_AVCODEC_RESAMPLE FF_API_AUDIO_CONVERT
#endif
-#ifndef FF_API_DEINTERLACE
-#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_DESTRUCT_PACKET
-#define FF_API_DESTRUCT_PACKET (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_GET_BUFFER
-#define FF_API_GET_BUFFER (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
#ifndef FF_API_MISSING_SAMPLE
-#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_LOWRES
-#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_BUFS_VDPAU
-#define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_VOXWARE
-#define FF_API_VOXWARE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_VOXWARE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_SET_DIMENSIONS
-#define FF_API_SET_DIMENSIONS (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_SET_DIMENSIONS (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_DEBUG_MV
-#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AC_VLC
-#define FF_API_AC_VLC (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_AC_VLC (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_OLD_MSMPEG4
-#define FF_API_OLD_MSMPEG4 (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_OLD_MSMPEG4 (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_ASPECT_EXTENDED
-#define FF_API_ASPECT_EXTENDED (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_THREAD_OPAQUE
-#define FF_API_THREAD_OPAQUE (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_CODEC_PKT
-#define FF_API_CODEC_PKT (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_ASPECT_EXTENDED (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_ARCH_ALPHA
-#define FF_API_ARCH_ALPHA (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_ARCH_ALPHA (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_XVMC
-#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_ERROR_RATE
-#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_QSCALE_TYPE
-#define FF_API_QSCALE_TYPE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_QSCALE_TYPE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_MB_TYPE
-#define FF_API_MB_TYPE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_MB_TYPE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_MAX_BFRAMES
-#define FF_API_MAX_BFRAMES (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_MAX_BFRAMES (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_NEG_LINESIZES
-#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_EMU_EDGE
-#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_ARCH_SH4
-#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_ARCH_SPARC
-#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_UNUSED_MEMBERS
-#define FF_API_UNUSED_MEMBERS (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_UNUSED_MEMBERS (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_IDCT_XVIDMMX
-#define FF_API_IDCT_XVIDMMX (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_IDCT_XVIDMMX (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_INPUT_PRESERVED
-#define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_NORMALIZE_AQP
-#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_GMC
-#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_MV0
-#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_CODEC_NAME
-#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AFD
-#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_VISMV
/* XXX: don't forget to drop the -vismv documentation */
-#define FF_API_VISMV (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
-#ifndef FF_API_DV_FRAME_PROFILE
-#define FF_API_DV_FRAME_PROFILE (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_VISMV (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AUDIOENC_DELAY
#define FF_API_AUDIOENC_DELAY (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
+#ifndef FF_API_VAAPI_CONTEXT
+#define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 58)
+#endif
#ifndef FF_API_AVCTX_TIMEBASE
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
@@ -190,5 +164,23 @@
#ifndef FF_API_STREAM_CODEC_TAG
#define FF_API_STREAM_CODEC_TAG (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
+#ifndef FF_API_QUANT_BIAS
+#define FF_API_QUANT_BIAS (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_RC_STRATEGY
+#define FF_API_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_CODED_FRAME
+#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_MOTION_EST
+#define FF_API_MOTION_EST (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_WITHOUT_PREFIX
+#define FF_API_WITHOUT_PREFIX (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
+#ifndef FF_API_SIDEDATA_ONLY_PKT
+#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
#endif /* AVCODEC_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
index c569c30d607..94c1b7188d2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
@@ -32,6 +32,8 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
if (!w || !h)
return;
+ av_assert2(block_w * sizeof(pixel) <= FFABS(buf_linesize));
+
if (src_y >= h) {
src -= src_y * src_linesize;
src += (h - 1) * src_linesize;
diff --git a/chromium/third_party/ffmpeg/libavcodec/videotoolbox.c b/chromium/third_party/ffmpeg/libavcodec/videotoolbox.c
new file mode 100644
index 00000000000..b78238ae375
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/videotoolbox.c
@@ -0,0 +1,690 @@
+/*
+ * Videotoolbox hardware acceleration
+ *
+ * copyright (c) 2012 Sebastien Zwickert
+ *
+ * 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"
+#if CONFIG_VIDEOTOOLBOX
+# include "videotoolbox.h"
+#else
+# include "vda.h"
+#endif
+#include "vda_vt_internal.h"
+#include "libavutil/avutil.h"
+#include "bytestream.h"
+#include "h264.h"
+#include "mpegvideo.h"
+
+#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
+# define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
+#endif
+
+#define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING 12
+
+static void videotoolbox_buffer_release(void *opaque, uint8_t *data)
+{
+ CVPixelBufferRef cv_buffer = (CVImageBufferRef)data;
+ CVPixelBufferRelease(cv_buffer);
+}
+
+static int videotoolbox_buffer_copy(VTContext *vtctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ void *tmp;
+
+ tmp = av_fast_realloc(vtctx->bitstream,
+ &vtctx->allocated_size,
+ size);
+
+ if (!tmp)
+ return AVERROR(ENOMEM);
+
+ vtctx->bitstream = tmp;
+ memcpy(vtctx->bitstream, buffer, size);
+ vtctx->bitstream_size = size;
+
+ return 0;
+}
+
+int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame)
+{
+ frame->width = avctx->width;
+ frame->height = avctx->height;
+ frame->format = avctx->pix_fmt;
+ frame->buf[0] = av_buffer_alloc(1);
+
+ if (!frame->buf[0])
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx)
+{
+ CFDataRef data = NULL;
+
+ /* Each VCL NAL in the bitstream sent to the decoder
+ * is preceded by a 4 bytes length header.
+ * Change the avcC atom header if needed, to signal headers of 4 bytes. */
+ if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {
+ uint8_t *rw_extradata = av_memdup(avctx->extradata, avctx->extradata_size);
+
+ if (!rw_extradata)
+ return NULL;
+
+ rw_extradata[4] |= 0x03;
+
+ data = CFDataCreate(kCFAllocatorDefault, rw_extradata, avctx->extradata_size);
+
+ av_freep(&rw_extradata);
+ } else {
+ data = CFDataCreate(kCFAllocatorDefault, avctx->extradata, avctx->extradata_size);
+ }
+
+ return data;
+}
+
+int ff_videotoolbox_buffer_create(VTContext *vtctx, AVFrame *frame)
+{
+ av_buffer_unref(&frame->buf[0]);
+
+ frame->buf[0] = av_buffer_create((uint8_t*)vtctx->frame,
+ sizeof(vtctx->frame),
+ videotoolbox_buffer_release,
+ NULL,
+ AV_BUFFER_FLAG_READONLY);
+ if (!frame->buf[0]) {
+ return AVERROR(ENOMEM);
+ }
+
+ frame->data[3] = (uint8_t*)vtctx->frame;
+ vtctx->frame = NULL;
+
+ return 0;
+}
+
+int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+ H264Context *h = avctx->priv_data;
+
+ vtctx->bitstream_size = 0;
+
+ if (h->is_avc == 1) {
+ return videotoolbox_buffer_copy(vtctx, buffer, size);
+ }
+
+ return 0;
+}
+
+int ff_videotoolbox_h264_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+ H264Context *h = avctx->priv_data;
+ void *tmp;
+
+ if (h->is_avc == 1)
+ return 0;
+
+ tmp = av_fast_realloc(vtctx->bitstream,
+ &vtctx->allocated_size,
+ vtctx->bitstream_size+size+4);
+ if (!tmp)
+ return AVERROR(ENOMEM);
+
+ vtctx->bitstream = tmp;
+
+ AV_WB32(vtctx->bitstream + vtctx->bitstream_size, size);
+ memcpy(vtctx->bitstream + vtctx->bitstream_size + 4, buffer, size);
+
+ vtctx->bitstream_size += size + 4;
+
+ return 0;
+}
+
+int ff_videotoolbox_uninit(AVCodecContext *avctx)
+{
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+ if (vtctx) {
+ av_freep(&vtctx->bitstream);
+ if (vtctx->frame)
+ CVPixelBufferRelease(vtctx->frame);
+ }
+
+ return 0;
+}
+
+#if CONFIG_VIDEOTOOLBOX
+static void videotoolbox_write_mp4_descr_length(PutByteContext *pb, int length)
+{
+ int i;
+ uint8_t b;
+
+ for (i = 3; i >= 0; i--) {
+ b = (length >> (i * 7)) & 0x7F;
+ if (i != 0)
+ b |= 0x80;
+
+ bytestream2_put_byteu(pb, b);
+ }
+}
+
+static CFDataRef videotoolbox_esds_extradata_create(AVCodecContext *avctx)
+{
+ CFDataRef data;
+ uint8_t *rw_extradata;
+ PutByteContext pb;
+ int full_size = 3 + 5 + 13 + 5 + avctx->extradata_size + 3;
+ // ES_DescrTag data + DecoderConfigDescrTag + data + DecSpecificInfoTag + size + SLConfigDescriptor
+ int config_size = 13 + 5 + avctx->extradata_size;
+ int s;
+
+ if (!(rw_extradata = av_mallocz(full_size + VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING)))
+ return NULL;
+
+ bytestream2_init_writer(&pb, rw_extradata, full_size + VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING);
+ bytestream2_put_byteu(&pb, 0); // version
+ bytestream2_put_ne24(&pb, 0); // flags
+
+ // elementary stream descriptor
+ bytestream2_put_byteu(&pb, 0x03); // ES_DescrTag
+ videotoolbox_write_mp4_descr_length(&pb, full_size);
+ bytestream2_put_ne16(&pb, 0); // esid
+ bytestream2_put_byteu(&pb, 0); // stream priority (0-32)
+
+ // decoder configuration descriptor
+ bytestream2_put_byteu(&pb, 0x04); // DecoderConfigDescrTag
+ videotoolbox_write_mp4_descr_length(&pb, config_size);
+ bytestream2_put_byteu(&pb, 32); // object type indication. 32 = AV_CODEC_ID_MPEG4
+ bytestream2_put_byteu(&pb, 0x11); // stream type
+ bytestream2_put_ne24(&pb, 0); // buffer size
+ bytestream2_put_ne32(&pb, 0); // max bitrate
+ bytestream2_put_ne32(&pb, 0); // avg bitrate
+
+ // decoder specific descriptor
+ bytestream2_put_byteu(&pb, 0x05); ///< DecSpecificInfoTag
+ videotoolbox_write_mp4_descr_length(&pb, avctx->extradata_size);
+
+ bytestream2_put_buffer(&pb, avctx->extradata, avctx->extradata_size);
+
+ // SLConfigDescriptor
+ bytestream2_put_byteu(&pb, 0x06); // SLConfigDescrTag
+ bytestream2_put_byteu(&pb, 0x01); // length
+ bytestream2_put_byteu(&pb, 0x02); //
+
+ s = bytestream2_size_p(&pb);
+
+ data = CFDataCreate(kCFAllocatorDefault, rw_extradata, s);
+
+ av_freep(&rw_extradata);
+ return data;
+}
+
+static CMSampleBufferRef videotoolbox_sample_buffer_create(CMFormatDescriptionRef fmt_desc,
+ void *buffer,
+ int size)
+{
+ OSStatus status;
+ CMBlockBufferRef block_buf;
+ CMSampleBufferRef sample_buf;
+
+ block_buf = NULL;
+ sample_buf = NULL;
+
+ status = CMBlockBufferCreateWithMemoryBlock(kCFAllocatorDefault,// structureAllocator
+ buffer, // memoryBlock
+ size, // blockLength
+ kCFAllocatorNull, // blockAllocator
+ NULL, // customBlockSource
+ 0, // offsetToData
+ size, // dataLength
+ 0, // flags
+ &block_buf);
+
+ if (!status) {
+ status = CMSampleBufferCreate(kCFAllocatorDefault, // allocator
+ block_buf, // dataBuffer
+ TRUE, // dataReady
+ 0, // makeDataReadyCallback
+ 0, // makeDataReadyRefcon
+ fmt_desc, // formatDescription
+ 1, // numSamples
+ 0, // numSampleTimingEntries
+ NULL, // sampleTimingArray
+ 0, // numSampleSizeEntries
+ NULL, // sampleSizeArray
+ &sample_buf);
+ }
+
+ if (block_buf)
+ CFRelease(block_buf);
+
+ return sample_buf;
+}
+
+static void videotoolbox_decoder_callback(void *opaque,
+ void *sourceFrameRefCon,
+ OSStatus status,
+ VTDecodeInfoFlags flags,
+ CVImageBufferRef image_buffer,
+ CMTime pts,
+ CMTime duration)
+{
+ AVCodecContext *avctx = opaque;
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+
+ if (vtctx->frame) {
+ CVPixelBufferRelease(vtctx->frame);
+ vtctx->frame = NULL;
+ }
+
+ if (!image_buffer) {
+ av_log(NULL, AV_LOG_DEBUG, "vt decoder cb: output image buffer is null\n");
+ return;
+ }
+
+ vtctx->frame = CVPixelBufferRetain(image_buffer);
+}
+
+static OSStatus videotoolbox_session_decode_frame(AVCodecContext *avctx)
+{
+ OSStatus status;
+ CMSampleBufferRef sample_buf;
+ AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+
+ sample_buf = videotoolbox_sample_buffer_create(videotoolbox->cm_fmt_desc,
+ vtctx->bitstream,
+ vtctx->bitstream_size);
+
+ if (!sample_buf)
+ return -1;
+
+ status = VTDecompressionSessionDecodeFrame(videotoolbox->session,
+ sample_buf,
+ 0, // decodeFlags
+ NULL, // sourceFrameRefCon
+ 0); // infoFlagsOut
+ if (status == noErr)
+ status = VTDecompressionSessionWaitForAsynchronousFrames(videotoolbox->session);
+
+ CFRelease(sample_buf);
+
+ return status;
+}
+
+static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)
+{
+ int status;
+ AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+
+ if (!videotoolbox->session || !vtctx->bitstream)
+ return AVERROR_INVALIDDATA;
+
+ status = videotoolbox_session_decode_frame(avctx);
+
+ if (status) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
+ return AVERROR_UNKNOWN;
+ }
+
+ if (!vtctx->frame)
+ return AVERROR_UNKNOWN;
+
+ return ff_videotoolbox_buffer_create(vtctx, frame);
+}
+
+static int videotoolbox_h264_end_frame(AVCodecContext *avctx)
+{
+ H264Context *h = avctx->priv_data;
+ AVFrame *frame = h->cur_pic_ptr->f;
+
+ return videotoolbox_common_end_frame(avctx, frame);
+}
+
+static int videotoolbox_mpeg_start_frame(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+
+ return videotoolbox_buffer_copy(vtctx, buffer, size);
+}
+
+static int videotoolbox_mpeg_decode_slice(AVCodecContext *avctx,
+ const uint8_t *buffer,
+ uint32_t size)
+{
+ return 0;
+}
+
+static int videotoolbox_mpeg_end_frame(AVCodecContext *avctx)
+{
+ MpegEncContext *s = avctx->priv_data;
+ AVFrame *frame = s->current_picture_ptr->f;
+
+ return videotoolbox_common_end_frame(avctx, frame);
+}
+
+static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec_type,
+ AVCodecContext *avctx)
+{
+ CFMutableDictionaryRef config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 1,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ CFDictionarySetValue(config_info,
+ kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder,
+ kCFBooleanTrue);
+
+ if (avctx->extradata_size) {
+ CFMutableDictionaryRef avc_info;
+ CFDataRef data = NULL;
+
+ avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 1,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ switch (codec_type) {
+ case kCMVideoCodecType_MPEG4Video :
+ data = videotoolbox_esds_extradata_create(avctx);
+ if (data)
+ CFDictionarySetValue(avc_info, CFSTR("esds"), data);
+ break;
+ case kCMVideoCodecType_H264 :
+ data = ff_videotoolbox_avcc_extradata_create(avctx);
+ if (data)
+ CFDictionarySetValue(avc_info, CFSTR("avcC"), data);
+ break;
+ default:
+ break;
+ }
+
+ CFDictionarySetValue(config_info,
+ kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms,
+ avc_info);
+
+ if (data)
+ CFRelease(data);
+
+ CFRelease(avc_info);
+ }
+ return config_info;
+}
+
+static CFDictionaryRef videotoolbox_buffer_attributes_create(int width,
+ int height,
+ OSType pix_fmt)
+{
+ CFMutableDictionaryRef buffer_attributes;
+ CFMutableDictionaryRef io_surface_properties;
+ CFNumberRef cv_pix_fmt;
+ CFNumberRef w;
+ CFNumberRef h;
+
+ w = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &width);
+ h = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &height);
+ cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &pix_fmt);
+
+ buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 4,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt);
+ CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties);
+ CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);
+ CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);
+
+ CFRelease(io_surface_properties);
+ CFRelease(cv_pix_fmt);
+ CFRelease(w);
+ CFRelease(h);
+
+ return buffer_attributes;
+}
+
+static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(CMVideoCodecType codec_type,
+ CFDictionaryRef decoder_spec,
+ int width,
+ int height)
+{
+ CMFormatDescriptionRef cm_fmt_desc;
+ OSStatus status;
+
+ status = CMVideoFormatDescriptionCreate(kCFAllocatorDefault,
+ codec_type,
+ width,
+ height,
+ decoder_spec, // Dictionary of extension
+ &cm_fmt_desc);
+
+ if (status)
+ return NULL;
+
+ return cm_fmt_desc;
+}
+
+static int videotoolbox_default_init(AVCodecContext *avctx)
+{
+ AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
+ OSStatus status;
+ VTDecompressionOutputCallbackRecord decoder_cb;
+ CFDictionaryRef decoder_spec;
+ CFDictionaryRef buf_attr;
+ int32_t pix_fmt;
+
+ if (!videotoolbox) {
+ av_log(avctx, AV_LOG_ERROR, "hwaccel context is not set\n");
+ return -1;
+ }
+
+ switch( avctx->codec_id ) {
+ case AV_CODEC_ID_H263 :
+ videotoolbox->cm_codec_type = kCMVideoCodecType_H263;
+ break;
+ case AV_CODEC_ID_H264 :
+ videotoolbox->cm_codec_type = kCMVideoCodecType_H264;
+ break;
+ case AV_CODEC_ID_MPEG1VIDEO :
+ videotoolbox->cm_codec_type = kCMVideoCodecType_MPEG1Video;
+ break;
+ case AV_CODEC_ID_MPEG2VIDEO :
+ videotoolbox->cm_codec_type = kCMVideoCodecType_MPEG2Video;
+ break;
+ case AV_CODEC_ID_MPEG4 :
+ videotoolbox->cm_codec_type = kCMVideoCodecType_MPEG4Video;
+ break;
+ default :
+ break;
+ }
+
+ pix_fmt = videotoolbox->cv_pix_fmt_type;
+
+ decoder_spec = videotoolbox_decoder_config_create(videotoolbox->cm_codec_type, avctx);
+
+ videotoolbox->cm_fmt_desc = videotoolbox_format_desc_create(videotoolbox->cm_codec_type,
+ decoder_spec,
+ avctx->width,
+ avctx->height);
+ if (!videotoolbox->cm_fmt_desc) {
+ if (decoder_spec)
+ CFRelease(decoder_spec);
+
+ av_log(avctx, AV_LOG_ERROR, "format description creation failed\n");
+ return -1;
+ }
+
+ buf_attr = videotoolbox_buffer_attributes_create(avctx->width,
+ avctx->height,
+ videotoolbox->cv_pix_fmt_type);
+
+ decoder_cb.decompressionOutputCallback = videotoolbox_decoder_callback;
+ decoder_cb.decompressionOutputRefCon = avctx;
+
+ status = VTDecompressionSessionCreate(NULL, // allocator
+ videotoolbox->cm_fmt_desc, // videoFormatDescription
+ decoder_spec, // videoDecoderSpecification
+ buf_attr, // destinationImageBufferAttributes
+ &decoder_cb, // outputCallback
+ &videotoolbox->session); // decompressionSessionOut
+
+ if (decoder_spec)
+ CFRelease(decoder_spec);
+ if (buf_attr)
+ CFRelease(buf_attr);
+
+ switch (status) {
+ case kVTVideoDecoderNotAvailableNowErr:
+ case kVTVideoDecoderUnsupportedDataFormatErr:
+ return AVERROR(ENOSYS);
+ case kVTVideoDecoderMalfunctionErr:
+ return AVERROR(EINVAL);
+ case kVTVideoDecoderBadDataErr :
+ return AVERROR_INVALIDDATA;
+ case 0:
+ return 0;
+ default:
+ return AVERROR_UNKNOWN;
+ }
+}
+
+static void videotoolbox_default_free(AVCodecContext *avctx)
+{
+ AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
+
+ if (videotoolbox) {
+ if (videotoolbox->cm_fmt_desc)
+ CFRelease(videotoolbox->cm_fmt_desc);
+
+ if (videotoolbox->session)
+ VTDecompressionSessionInvalidate(videotoolbox->session);
+ }
+}
+
+AVHWAccel ff_h263_videotoolbox_hwaccel = {
+ .name = "h263_videotoolbox",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H263,
+ .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = videotoolbox_mpeg_start_frame,
+ .decode_slice = videotoolbox_mpeg_decode_slice,
+ .end_frame = videotoolbox_mpeg_end_frame,
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
+};
+
+AVHWAccel ff_h264_videotoolbox_hwaccel = {
+ .name = "h264_videotoolbox",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = ff_videotoolbox_h264_start_frame,
+ .decode_slice = ff_videotoolbox_h264_decode_slice,
+ .end_frame = videotoolbox_h264_end_frame,
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
+};
+
+AVHWAccel ff_mpeg1_videotoolbox_hwaccel = {
+ .name = "mpeg1_videotoolbox",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG1VIDEO,
+ .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = videotoolbox_mpeg_start_frame,
+ .decode_slice = videotoolbox_mpeg_decode_slice,
+ .end_frame = videotoolbox_mpeg_end_frame,
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
+};
+
+AVHWAccel ff_mpeg2_videotoolbox_hwaccel = {
+ .name = "mpeg2_videotoolbox",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG2VIDEO,
+ .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = videotoolbox_mpeg_start_frame,
+ .decode_slice = videotoolbox_mpeg_decode_slice,
+ .end_frame = videotoolbox_mpeg_end_frame,
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
+};
+
+AVHWAccel ff_mpeg4_videotoolbox_hwaccel = {
+ .name = "mpeg4_videotoolbox",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_MPEG4,
+ .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX,
+ .alloc_frame = ff_videotoolbox_alloc_frame,
+ .start_frame = videotoolbox_mpeg_start_frame,
+ .decode_slice = videotoolbox_mpeg_decode_slice,
+ .end_frame = videotoolbox_mpeg_end_frame,
+ .uninit = ff_videotoolbox_uninit,
+ .priv_data_size = sizeof(VTContext),
+};
+
+AVVideotoolboxContext *av_videotoolbox_alloc_context(void)
+{
+ AVVideotoolboxContext *ret = av_mallocz(sizeof(*ret));
+
+ if (ret) {
+ ret->output_callback = videotoolbox_decoder_callback;
+ ret->cv_pix_fmt_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
+ }
+
+ return ret;
+}
+
+int av_videotoolbox_default_init(AVCodecContext *avctx)
+{
+ return av_videotoolbox_default_init2(avctx, NULL);
+}
+
+int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx)
+{
+ avctx->hwaccel_context = vtctx ?: av_videotoolbox_alloc_context();
+ if (!avctx->hwaccel_context)
+ return AVERROR(ENOMEM);
+ return videotoolbox_default_init(avctx);
+}
+
+void av_videotoolbox_default_free(AVCodecContext *avctx)
+{
+
+ videotoolbox_default_free(avctx);
+ av_freep(&avctx->hwaccel_context);
+}
+#endif /* CONFIG_VIDEOTOOLBOX */
diff --git a/chromium/third_party/ffmpeg/libavcodec/videotoolbox.h b/chromium/third_party/ffmpeg/libavcodec/videotoolbox.h
new file mode 100644
index 00000000000..a48638e2b22
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/videotoolbox.h
@@ -0,0 +1,126 @@
+/*
+ * Videotoolbox hardware acceleration
+ *
+ * copyright (c) 2012 Sebastien Zwickert
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VIDEOTOOLBOX_H
+#define AVCODEC_VIDEOTOOLBOX_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_videotoolbox
+ * Public libavcodec Videotoolbox header.
+ */
+
+#include <stdint.h>
+
+#define Picture QuickdrawPicture
+#include <VideoToolbox/VideoToolbox.h>
+#undef Picture
+
+#include "libavcodec/avcodec.h"
+
+/**
+ * This struct holds all the information that needs to be passed
+ * between the caller and libavcodec for initializing Videotoolbox decoding.
+ * Its size is not a part of the public ABI, it must be allocated with
+ * av_videotoolbox_alloc_context() and freed with av_free().
+ */
+typedef struct AVVideotoolboxContext {
+ /**
+ * Videotoolbox decompression session object.
+ * Created and freed the caller.
+ */
+ VTDecompressionSessionRef session;
+
+ /**
+ * The output callback that must be passed to the session.
+ * Set by av_videottoolbox_default_init()
+ */
+ VTDecompressionOutputCallback output_callback;
+
+ /**
+ * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
+ * set by the caller.
+ */
+ OSType cv_pix_fmt_type;
+
+ /**
+ * CoreMedia Format Description that Videotoolbox will use to create the decompression session.
+ * Set by the caller.
+ */
+ CMVideoFormatDescriptionRef cm_fmt_desc;
+
+ /**
+ * CoreMedia codec type that Videotoolbox will use to create the decompression session.
+ * Set by the caller.
+ */
+ int cm_codec_type;
+} AVVideotoolboxContext;
+
+/**
+ * Allocate and initialize a Videotoolbox context.
+ *
+ * This function should be called from the get_format() callback when the caller
+ * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create
+ * the decoder object (using the output callback provided by libavcodec) that
+ * will be used for Videotoolbox-accelerated decoding.
+ *
+ * When decoding with Videotoolbox is finished, the caller must destroy the decoder
+ * object and free the Videotoolbox context using av_free().
+ *
+ * @return the newly allocated context or NULL on failure
+ */
+AVVideotoolboxContext *av_videotoolbox_alloc_context(void);
+
+/**
+ * This is a convenience function that creates and sets up the Videotoolbox context using
+ * an internal implementation.
+ *
+ * @param avctx the corresponding codec context
+ *
+ * @return >= 0 on success, a negative AVERROR code on failure
+ */
+int av_videotoolbox_default_init(AVCodecContext *avctx);
+
+/**
+ * This is a convenience function that creates and sets up the Videotoolbox context using
+ * an internal implementation.
+ *
+ * @param avctx the corresponding codec context
+ * @param vtctx the Videotoolbox context to use
+ *
+ * @return >= 0 on success, a negative AVERROR code on failure
+ */
+int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx);
+
+/**
+ * This function must be called to free the Videotoolbox context initialized with
+ * av_videotoolbox_default_init().
+ *
+ * @param avctx the corresponding codec context
+ */
+void av_videotoolbox_default_free(AVCodecContext *avctx);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_VIDEOTOOLBOX_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vima.c b/chromium/third_party/ffmpeg/libavcodec/vima.c
index 74d6a9a1848..b4620acf6b9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vima.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vima.c
@@ -214,17 +214,5 @@ AVCodec ff_adpcm_vima_decoder = {
.id = AV_CODEC_ID_ADPCM_VIMA,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
-
-#if FF_API_VIMA_DECODER
-AVCodec ff_vima_decoder = {
- .name = "vima",
- .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"),
- .type = AVMEDIA_TYPE_AUDIO,
- .id = AV_CODEC_ID_ADPCM_VIMA,
- .init = decode_init,
- .decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
-};
-#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmdaudio.c b/chromium/third_party/ffmpeg/libavcodec/vmdaudio.c
index 3be0ff8520b..e8c8a064c7d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmdaudio.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmdaudio.c
@@ -231,5 +231,5 @@ AVCodec ff_vmdaudio_decoder = {
.priv_data_size = sizeof(VmdAudioContext),
.init = vmdaudio_decode_init,
.decode = vmdaudio_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmdvideo.c b/chromium/third_party/ffmpeg/libavcodec/vmdvideo.c
index a2ba1c959b0..b97032ff7e8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmdvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmdvideo.c
@@ -471,5 +471,5 @@ AVCodec ff_vmdvideo_decoder = {
.init = vmdvideo_decode_init,
.close = vmdvideo_decode_end,
.decode = vmdvideo_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmnc.c b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
index 58bd0e26ae8..49abb776f2d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmnc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
@@ -577,5 +577,5 @@ AVCodec ff_vmnc_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbis_parser.c b/chromium/third_party/ffmpeg/libavcodec/vorbis_parser.c
index 8fa6d995884..0b2c97cde58 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbis_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbis_parser.c
@@ -296,27 +296,6 @@ AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
return s;
}
-#if LIBAVCODEC_VERSION_MAJOR < 57
-int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s)
-{
- return vorbis_parse_init(s, avctx->extradata, avctx->extradata_size);
-}
-void avpriv_vorbis_parse_reset(AVVorbisParseContext *s)
-{
- av_vorbis_parse_reset(s);
-}
-int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
- int buf_size)
-{
- return av_vorbis_parse_frame(s, buf, buf_size);
-}
-int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
- int buf_size, int *flags)
-{
- return av_vorbis_parse_frame_flags(s, buf, buf_size, flags);
-}
-#endif
-
#if CONFIG_VORBIS_PARSER
typedef struct VorbisParseContext {
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbis_parser_internal.h b/chromium/third_party/ffmpeg/libavcodec/vorbis_parser_internal.h
index 49481eeafd8..98e48524a48 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbis_parser_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbis_parser_internal.h
@@ -43,44 +43,4 @@ struct AVVorbisParseContext {
int prev_mask; ///< bitmask used to get the previous mode flag in each packet
};
-#if LIBAVCODEC_VERSION_MAJOR < 57
-/**
- * Initialize the Vorbis parser using headers in the extradata.
- *
- * @param avctx codec context
- * @param s Vorbis parser context
- */
-int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s);
-
-/**
- * Get the duration for a Vorbis packet.
- *
- * avpriv_vorbis_parse_extradata() must have been successfully called prior to
- * this in order for a correct duration to be returned. If @p flags is @c NULL,
- * special frames are considered invalid.
- *
- * @param s Vorbis parser context
- * @param buf buffer containing a Vorbis frame
- * @param buf_size size of the buffer
- * @param flags flags for special frames
- */
-int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
- int buf_size, int *flags);
-
-/**
- * Get the duration for a Vorbis packet.
- *
- * avpriv_vorbis_parse_extradata() must have been successfully called prior to
- * this in order for a correct duration to be returned.
- *
- * @param s Vorbis parser context
- * @param buf buffer containing a Vorbis frame
- * @param buf_size size of the buffer
- */
-int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
- int buf_size);
-
-void avpriv_vorbis_parse_reset(AVVorbisParseContext *s);
-#endif
-
#endif /* AVCODEC_VORBIS_PARSER_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c b/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
index 2926e8e59d9..f773afaa41e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisdec.c
@@ -998,7 +998,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0);
ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0);
- vc->fdsp = avpriv_float_dsp_alloc(vc->avctx->flags & CODEC_FLAG_BITEXACT);
+ vc->fdsp = avpriv_float_dsp_alloc(vc->avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!vc->fdsp)
return AVERROR(ENOMEM);
@@ -1739,7 +1739,9 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
ff_dlog(NULL, "packet length %d \n", buf_size);
if (*buf == 1 && buf_size > 7) {
- init_get_bits(gb, buf+1, buf_size*8 - 8);
+ if ((ret = init_get_bits8(gb, buf + 1, buf_size - 1)) < 0)
+ return ret;
+
vorbis_free(vc);
if ((ret = vorbis_parse_id_hdr(vc))) {
av_log(avctx, AV_LOG_ERROR, "Id header corrupt.\n");
@@ -1763,7 +1765,9 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
}
if (*buf == 5 && buf_size > 7 && vc->channel_residues && !vc->modes) {
- init_get_bits(gb, buf+1, buf_size*8 - 8);
+ if ((ret = init_get_bits8(gb, buf + 1, buf_size - 1)) < 0)
+ return ret;
+
if ((ret = vorbis_parse_setup_hdr(vc))) {
av_log(avctx, AV_LOG_ERROR, "Setup header corrupt.\n");
vorbis_free(vc);
@@ -1792,7 +1796,8 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
}
}
- init_get_bits(gb, buf, buf_size*8);
+ if ((ret = init_get_bits8(gb, buf, buf_size)) < 0)
+ return ret;
if ((len = vorbis_parse_audio_packet(vc, channel_ptrs)) <= 0)
return len;
@@ -1846,7 +1851,7 @@ AVCodec ff_vorbis_decoder = {
.close = vorbis_decode_close,
.decode = vorbis_decode_frame,
.flush = vorbis_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.channel_layouts = ff_vorbis_channel_layouts,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c b/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
index dcb2a6e557d..2974ca2cf95 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vorbisenc.c
@@ -1033,7 +1033,7 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return 0;
samples = 1 << (venc->log2_blocksize[0] - 1);
- if ((ret = ff_alloc_packet2(avctx, avpkt, 8192)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 8192, 0)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
@@ -1178,7 +1178,7 @@ static av_cold int vorbis_encode_init(AVCodecContext *avctx)
goto error;
avctx->bit_rate = 0;
- if (avctx->flags & CODEC_FLAG_QSCALE)
+ if (avctx->flags & AV_CODEC_FLAG_QSCALE)
venc->quality = avctx->global_quality / (float)FF_QP2LAMBDA;
else
venc->quality = 8;
@@ -1205,7 +1205,7 @@ AVCodec ff_vorbis_encoder = {
.init = vorbis_encode_init,
.encode2 = vorbis_encode_frame,
.close = vorbis_encode_close,
- .capabilities = CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3.c b/chromium/third_party/ffmpeg/libavcodec/vp3.c
index 005f043b0fc..09e6f75ec4e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3.c
@@ -1095,7 +1095,7 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
return residual_eob_run;
/* reverse prediction of the C-plane DC coefficients */
- if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
+ if (!(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
reverse_dc_prediction(s, s->fragment_start[1],
s->fragment_width[1], s->fragment_height[1]);
reverse_dc_prediction(s, s->fragment_start[2],
@@ -1518,7 +1518,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
if (!s->flipped_image)
stride = -stride;
- if (CONFIG_GRAY && plane && (s->avctx->flags & CODEC_FLAG_GRAY))
+ if (CONFIG_GRAY && plane && (s->avctx->flags & AV_CODEC_FLAG_GRAY))
continue;
/* for each superblock row in the slice (both of them)... */
@@ -1738,7 +1738,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
if (avctx->codec_id != AV_CODEC_ID_THEORA)
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
- ff_hpeldsp_init(&s->hdsp, avctx->flags | CODEC_FLAG_BITEXACT);
+ ff_hpeldsp_init(&s->hdsp, avctx->flags | AV_CODEC_FLAG_BITEXACT);
ff_videodsp_init(&s->vdsp, 8);
ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
@@ -1947,6 +1947,8 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
}
if (s != s1) {
+ if (!s->current_frame.f)
+ return AVERROR(ENOMEM);
// init tables if the first frame hasn't been decoded
if (!s->current_frame.f->data[0]) {
int y_fragment_count, c_fragment_count;
@@ -2324,7 +2326,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
ret = ff_set_dimensions(avctx, s->width, s->height);
if (ret < 0)
return ret;
- if (!(avctx->flags2 & CODEC_FLAG2_IGNORE_CROP)) {
+ if (!(avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP)) {
avctx->width = visible_width;
avctx->height = visible_height;
// translate offsets from theora axis ([0,0] lower left)
@@ -2332,7 +2334,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
s->offset_x = offset_x;
s->offset_y = s->height - visible_height - offset_y;
- if ((s->offset_x & 0x1F) && !(avctx->flags & CODEC_FLAG_UNALIGNED)) {
+ if ((s->offset_x & 0x1F) && !(avctx->flags & AV_CODEC_FLAG_UNALIGNED)) {
s->offset_x &= ~0x1F;
if (!s->offset_x_warned) {
s->offset_x_warned = 1;
@@ -2473,6 +2475,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
const uint8_t *header_start[3];
int header_len[3];
int i;
+ int ret;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@@ -2492,7 +2495,9 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
for (i = 0; i < 3; i++) {
if (header_len[i] <= 0)
continue;
- init_get_bits8(&gb, header_start[i], header_len[i]);
+ ret = init_get_bits8(&gb, header_start[i], header_len[i]);
+ if (ret < 0)
+ return ret;
ptype = get_bits(&gb, 8);
@@ -2542,8 +2547,8 @@ AVCodec ff_theora_decoder = {
.init = theora_decode_init,
.close = vp3_decode_end,
.decode = vp3_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
- CODEC_CAP_FRAME_THREADS,
+ .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)
@@ -2559,8 +2564,8 @@ AVCodec ff_vp3_decoder = {
.init = vp3_decode_init,
.close = vp3_decode_end,
.decode = vp3_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
- CODEC_CAP_FRAME_THREADS,
+ .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),
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp5.c b/chromium/third_party/ffmpeg/libavcodec/vp5.c
index 1923d6335c8..5bcf9b6217e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp5.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp5.c
@@ -290,5 +290,5 @@ AVCodec ff_vp5_decoder = {
.init = vp5_decode_init,
.close = ff_vp56_free,
.decode = ff_vp56_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp6.c b/chromium/third_party/ffmpeg/libavcodec/vp6.c
index e97ef76d1e3..a2bb4578d5f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp6.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp6.c
@@ -679,7 +679,7 @@ AVCodec ff_vp6_decoder = {
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
/* flash version, not flipped upside-down */
@@ -692,7 +692,7 @@ AVCodec ff_vp6f_decoder = {
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
/* flash version, not flipped upside-down, with alpha channel */
@@ -705,5 +705,5 @@ AVCodec ff_vp6a_decoder = {
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8.c b/chromium/third_party/ffmpeg/libavcodec/vp8.c
index 9a8ed302d58..3c6a4969f0b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8.c
@@ -164,7 +164,7 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
s->mb_height = (s->avctx->coded_height + 15) / 16;
s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE &&
- FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1;
+ avctx->thread_count > 1;
if (!s->mb_layout) { // Frame threading and one thread
s->macroblocks_base = av_mallocz((s->mb_width + s->mb_height * 2 + 1) *
sizeof(*s->macroblocks));
@@ -493,6 +493,10 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
int width = s->avctx->width;
int height = s->avctx->height;
+ if (buf_size < 4) {
+ return AVERROR_INVALIDDATA;
+ }
+
s->profile = (buf[0] >> 1) & 7;
if (s->profile > 1) {
avpriv_request_sample(s->avctx, "Unknown profile %d", s->profile);
@@ -639,6 +643,11 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
int width = s->avctx->width;
int height = s->avctx->height;
+ if (buf_size < 3) {
+ av_log(s->avctx, AV_LOG_ERROR, "Insufficent data (%d) for header\n", buf_size);
+ return AVERROR_INVALIDDATA;
+ }
+
s->keyframe = !(buf[0] & 1);
s->profile = (buf[0]>>1) & 7;
s->invisible = !(buf[0] & 0x10);
@@ -2689,6 +2698,9 @@ av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
VP8Context *s = avctx->priv_data;
int i;
+ if (!s)
+ return 0;
+
vp8_decode_flush_impl(avctx, 1);
for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)
av_frame_free(&s->frames[i].tf.f);
@@ -2826,7 +2838,7 @@ AVCodec ff_vp7_decoder = {
.init = vp7_decode_init,
.close = ff_vp8_decode_free,
.decode = vp7_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.flush = vp8_decode_flush,
};
#endif /* CONFIG_VP7_DECODER */
@@ -2841,7 +2853,8 @@ AVCodec ff_vp8_decoder = {
.init = ff_vp8_decode_init,
.close = ff_vp8_decode_free,
.decode = ff_vp8_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
+ AV_CODEC_CAP_SLICE_THREADS,
.flush = vp8_decode_flush,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
index e1a91bb8c60..07bea69c78c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.c
@@ -735,5 +735,7 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
ff_vp8dsp_init_arm(dsp);
if (ARCH_X86)
ff_vp8dsp_init_x86(dsp);
+ if (ARCH_MIPS)
+ ff_vp8dsp_init_mips(dsp);
}
#endif /* CONFIG_VP8_DECODER */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
index 5fdd3af70da..0401c9221b0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp8dsp.h
@@ -98,6 +98,7 @@ void ff_vp78dsp_init_x86(VP8DSPContext *c);
void ff_vp8dsp_init(VP8DSPContext *c);
void ff_vp8dsp_init_arm(VP8DSPContext *c);
void ff_vp8dsp_init_x86(VP8DSPContext *c);
+void ff_vp8dsp_init_mips(VP8DSPContext *c);
#define IS_VP7 1
#define IS_VP8 0
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9.c b/chromium/third_party/ffmpeg/libavcodec/vp9.c
index 4e2ed537455..a357a5f5594 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9.c
@@ -153,7 +153,6 @@ typedef struct VP9Context {
uint8_t temporal;
uint8_t absolute_vals;
uint8_t update_map;
- uint8_t ignore_refmap;
struct {
uint8_t q_enabled;
uint8_t lf_enabled;
@@ -289,6 +288,7 @@ static void vp9_unref_frame(AVCodecContext *ctx, VP9Frame *f)
{
ff_thread_release_buffer(ctx, &f->tf);
av_buffer_unref(&f->extradata);
+ f->segmentation_map = NULL;
}
static int vp9_ref_frame(AVCodecContext *ctx, VP9Frame *dst, VP9Frame *src)
@@ -360,7 +360,7 @@ static int update_size(AVCodecContext *ctx, int w, int h, enum AVPixelFormat fmt
av_freep(&s->block_base);
if (s->bpp != s->last_bpp) {
- ff_vp9dsp_init(&s->dsp, s->bpp);
+ ff_vp9dsp_init(&s->dsp, s->bpp, ctx->flags & AV_CODEC_FLAG_BITEXACT);
ff_videodsp_init(&s->vdsp, s->bpp);
s->last_bpp = s->bpp;
}
@@ -425,7 +425,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[254] = {
+ static const int 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,
@@ -444,7 +444,7 @@ static int update_prob(VP56RangeCoder *c, int p)
207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221,
222, 223, 224, 225, 226, 227, 229, 230, 231, 232, 233, 234, 235, 236,
237, 238, 239, 240, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
- 252, 253,
+ 252, 253, 253,
};
int d;
@@ -474,6 +474,7 @@ static int update_prob(VP56RangeCoder *c, int p)
if (d >= 65)
d = (d << 1) - 65 + vp8_rac_get(c);
d += 64;
+ av_assert2(d < FF_ARRAY_ELEMS(inv_map_table));
}
return p <= 128 ? 1 + inv_recenter_nonneg(inv_map_table[d], p - 1) :
@@ -499,9 +500,13 @@ static enum AVPixelFormat read_colorspace_details(AVCodecContext *ctx)
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12
};
if (ctx->profile & 1) {
- s->ss_h = s->ss_v = 1;
+ s->ss_h = s->ss_v = 0;
res = pix_fmt_rgb[bits];
ctx->color_range = AVCOL_RANGE_JPEG;
+ if (get_bits1(&s->gb)) {
+ av_log(ctx, AV_LOG_ERROR, "Reserved bit set in RGB\n");
+ return AVERROR_INVALIDDATA;
+ }
} else {
av_log(ctx, AV_LOG_ERROR, "RGB not supported in profile %d\n",
ctx->profile);
@@ -594,7 +599,7 @@ static int decode_frame_header(AVCodecContext *ctx,
av_log(ctx, AV_LOG_ERROR, "Invalid sync code\n");
return AVERROR_INVALIDDATA;
}
- if (ctx->profile == 1) {
+ if (ctx->profile >= 1) {
if ((fmt = read_colorspace_details(ctx)) < 0)
return fmt;
} else {
@@ -706,6 +711,7 @@ static int decode_frame_header(AVCodecContext *ctx,
s->lf_delta.ref[3] = -1;
s->lf_delta.mode[0] = 0;
s->lf_delta.mode[1] = 0;
+ memset(s->segmentation.feat, 0, sizeof(s->segmentation.feat));
}
s->filter.level = get_bits(&s->gb, 6);
sharp = get_bits(&s->gb, 3);
@@ -732,9 +738,10 @@ static int decode_frame_header(AVCodecContext *ctx,
s->uvac_qdelta = get_bits1(&s->gb) ? get_sbits_inv(&s->gb, 4) : 0;
s->lossless = s->yac_qi == 0 && s->ydc_qdelta == 0 &&
s->uvdc_qdelta == 0 && s->uvac_qdelta == 0;
+ if (s->lossless)
+ ctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
/* segmentation header info */
- s->segmentation.ignore_refmap = 0;
if ((s->segmentation.enabled = get_bits1(&s->gb))) {
if ((s->segmentation.update_map = get_bits1(&s->gb))) {
for (i = 0; i < 7; i++)
@@ -746,15 +753,6 @@ static int decode_frame_header(AVCodecContext *ctx,
get_bits(&s->gb, 8) : 255;
}
}
- if ((!s->segmentation.update_map || s->segmentation.temporal) &&
- (w != s->frames[CUR_FRAME].tf.f->width ||
- h != s->frames[CUR_FRAME].tf.f->height)) {
- av_log(ctx, AV_LOG_WARNING,
- "Reference segmap (temp=%d,update=%d) enabled on size-change!\n",
- s->segmentation.temporal, s->segmentation.update_map);
- s->segmentation.ignore_refmap = 1;
- //return AVERROR_INVALIDDATA;
- }
if (get_bits1(&s->gb)) {
s->segmentation.absolute_vals = get_bits1(&s->gb);
@@ -768,22 +766,17 @@ static int decode_frame_header(AVCodecContext *ctx,
s->segmentation.feat[i].skip_enabled = get_bits1(&s->gb);
}
}
- } else {
- s->segmentation.feat[0].q_enabled = 0;
- s->segmentation.feat[0].lf_enabled = 0;
- s->segmentation.feat[0].skip_enabled = 0;
- s->segmentation.feat[0].ref_enabled = 0;
}
// set qmul[] based on Y/UV, AC/DC and segmentation Q idx deltas
for (i = 0; i < (s->segmentation.enabled ? 8 : 1); i++) {
int qyac, qydc, quvac, quvdc, lflvl, sh;
- if (s->segmentation.feat[i].q_enabled) {
+ if (s->segmentation.enabled && s->segmentation.feat[i].q_enabled) {
if (s->segmentation.absolute_vals)
- qyac = s->segmentation.feat[i].q_val;
+ qyac = av_clip_uintp2(s->segmentation.feat[i].q_val, 8);
else
- qyac = s->yac_qi + s->segmentation.feat[i].q_val;
+ qyac = av_clip_uintp2(s->yac_qi + s->segmentation.feat[i].q_val, 8);
} else {
qyac = s->yac_qi;
}
@@ -798,7 +791,7 @@ static int decode_frame_header(AVCodecContext *ctx,
s->segmentation.feat[i].qmul[1][1] = vp9_ac_qlookup[s->bpp_index][quvac];
sh = s->filter.level >= 32;
- if (s->segmentation.feat[i].lf_enabled) {
+ if (s->segmentation.enabled && s->segmentation.feat[i].lf_enabled) {
if (s->segmentation.absolute_vals)
lflvl = av_clip_uintp2(s->segmentation.feat[i].lf_val, 6);
else
@@ -852,7 +845,7 @@ static int decode_frame_header(AVCodecContext *ctx,
}
}
- if (s->keyframe || s->errorres || s->intraonly) {
+ if (s->keyframe || s->errorres || (s->intraonly && s->resetctx == 3)) {
s->prob_ctx[0].p = s->prob_ctx[1].p = s->prob_ctx[2].p =
s->prob_ctx[3].p = vp9_default_probs;
memcpy(s->prob_ctx[0].coef, vp9_default_coef_probs,
@@ -863,6 +856,10 @@ static int decode_frame_header(AVCodecContext *ctx,
sizeof(vp9_default_coef_probs));
memcpy(s->prob_ctx[3].coef, vp9_default_coef_probs,
sizeof(vp9_default_coef_probs));
+ } else if (s->intraonly && s->resetctx == 2) {
+ s->prob_ctx[c].p = vp9_default_probs;
+ memcpy(s->prob_ctx[c].coef, vp9_default_coef_probs,
+ sizeof(vp9_default_coef_probs));
}
// next 16 bits is size of the rest of the header (arith-coded)
@@ -1475,13 +1472,14 @@ static void decode_mode(AVCodecContext *ctx)
if (!s->segmentation.enabled) {
b->seg_id = 0;
} else if (s->keyframe || s->intraonly) {
- b->seg_id = vp8_rac_get_tree(&s->c, vp9_segmentation_tree, s->prob.seg);
+ b->seg_id = !s->segmentation.update_map ? 0 :
+ vp8_rac_get_tree(&s->c, vp9_segmentation_tree, s->prob.seg);
} else if (!s->segmentation.update_map ||
(s->segmentation.temporal &&
vp56_rac_get_prob_branchy(&s->c,
s->prob.segpred[s->above_segpred_ctx[col] +
s->left_segpred_ctx[row7]]))) {
- if (!s->errorres && !s->segmentation.ignore_refmap) {
+ if (!s->errorres && s->frames[REF_FRAME_SEGMAP].segmentation_map) {
int pred = 8, x;
uint8_t *refsegmap = s->frames[REF_FRAME_SEGMAP].segmentation_map;
@@ -1523,7 +1521,7 @@ static void decode_mode(AVCodecContext *ctx)
if (s->keyframe || s->intraonly) {
b->intra = 1;
- } else if (s->segmentation.feat[b->seg_id].ref_enabled) {
+ } else if (s->segmentation.enabled && s->segmentation.feat[b->seg_id].ref_enabled) {
b->intra = !s->segmentation.feat[b->seg_id].ref_val;
} else {
int c, bit;
@@ -1688,7 +1686,7 @@ static void decode_mode(AVCodecContext *ctx)
{ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 4 },
};
- if (s->segmentation.feat[b->seg_id].ref_enabled) {
+ if (s->segmentation.enabled && s->segmentation.feat[b->seg_id].ref_enabled) {
av_assert2(s->segmentation.feat[b->seg_id].ref_val != 0);
b->comp = 0;
b->ref[0] = s->segmentation.feat[b->seg_id].ref_val - 1;
@@ -1933,7 +1931,7 @@ static void decode_mode(AVCodecContext *ctx)
}
if (b->bs <= BS_8x8) {
- if (s->segmentation.feat[b->seg_id].skip_enabled) {
+ if (s->segmentation.enabled && s->segmentation.feat[b->seg_id].skip_enabled) {
b->mode[0] = b->mode[1] = b->mode[2] = b->mode[3] = ZEROMV;
} else {
static const uint8_t off[10] = {
@@ -2757,7 +2755,108 @@ static void intra_recon_16bpp(AVCodecContext *ctx, ptrdiff_t y_off, ptrdiff_t uv
intra_recon(ctx, y_off, uv_off, 2);
}
+static av_always_inline void mc_luma_unscaled(VP9Context *s, vp9_mc_func (*mc)[2],
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const uint8_t *ref, ptrdiff_t ref_stride,
+ ThreadFrame *ref_frame,
+ ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
+ int bw, int bh, int w, int h, int bytesperpixel)
+{
+ int mx = mv->x, my = mv->y, th;
+
+ y += my >> 3;
+ x += mx >> 3;
+ ref += y * ref_stride + x * bytesperpixel;
+ mx &= 7;
+ my &= 7;
+ // FIXME bilinear filter only needs 0/1 pixels, not 3/4
+ // we use +7 because the last 7 pixels of each sbrow can be changed in
+ // the longest loopfilter of the next sbrow
+ th = (y + bh + 4 * !!my + 7) >> 6;
+ ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
+ if (x < !!mx * 3 || y < !!my * 3 ||
+ x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ref - !!my * 3 * ref_stride - !!mx * 3 * bytesperpixel,
+ 160, ref_stride,
+ bw + !!mx * 7, bh + !!my * 7,
+ x - !!mx * 3, y - !!my * 3, w, h);
+ ref = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
+ ref_stride = 160;
+ }
+ mc[!!mx][!!my](dst, dst_stride, ref, ref_stride, bh, mx << 1, my << 1);
+}
+
+static av_always_inline void mc_chroma_unscaled(VP9Context *s, vp9_mc_func (*mc)[2],
+ uint8_t *dst_u, uint8_t *dst_v,
+ ptrdiff_t dst_stride,
+ const uint8_t *ref_u, ptrdiff_t src_stride_u,
+ const uint8_t *ref_v, ptrdiff_t src_stride_v,
+ ThreadFrame *ref_frame,
+ ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
+ int bw, int bh, int w, int h, int bytesperpixel)
+{
+ int mx = mv->x << !s->ss_h, my = mv->y << !s->ss_v, th;
+
+ y += my >> 4;
+ x += mx >> 4;
+ ref_u += y * src_stride_u + x * bytesperpixel;
+ ref_v += y * src_stride_v + x * bytesperpixel;
+ mx &= 15;
+ my &= 15;
+ // FIXME bilinear filter only needs 0/1 pixels, not 3/4
+ // we use +7 because the last 7 pixels of each sbrow can be changed in
+ // the longest loopfilter of the next sbrow
+ th = (y + bh + 4 * !!my + 7) >> (6 - s->ss_v);
+ ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
+ if (x < !!mx * 3 || y < !!my * 3 ||
+ x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ref_u - !!my * 3 * src_stride_u - !!mx * 3 * bytesperpixel,
+ 160, src_stride_u,
+ bw + !!mx * 7, bh + !!my * 7,
+ x - !!mx * 3, y - !!my * 3, w, h);
+ ref_u = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
+ mc[!!mx][!!my](dst_u, dst_stride, ref_u, 160, bh, mx, my);
+
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ref_v - !!my * 3 * src_stride_v - !!mx * 3 * bytesperpixel,
+ 160, src_stride_v,
+ bw + !!mx * 7, bh + !!my * 7,
+ x - !!mx * 3, y - !!my * 3, w, h);
+ ref_v = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
+ mc[!!mx][!!my](dst_v, dst_stride, ref_v, 160, bh, mx, my);
+ } else {
+ mc[!!mx][!!my](dst_u, dst_stride, ref_u, src_stride_u, bh, mx, my);
+ mc[!!mx][!!my](dst_v, dst_stride, ref_v, src_stride_v, bh, mx, my);
+ }
+}
+
+#define mc_luma_dir(s, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, \
+ px, py, pw, ph, bw, bh, w, h, i) \
+ mc_luma_unscaled(s, s->dsp.mc, dst, dst_ls, src, src_ls, tref, row, col, \
+ mv, bw, bh, w, h, bytesperpixel)
+#define mc_chroma_dir(s, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
+ row, col, mv, px, py, pw, ph, bw, bh, w, h, i) \
+ mc_chroma_unscaled(s, s->dsp.mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
+ row, col, mv, bw, bh, w, h, bytesperpixel)
+#define SCALED 0
+#define FN(x) x##_8bpp
+#define BYTES_PER_PIXEL 1
+#include "vp9_mc_template.c"
+#undef FN
+#undef BYTES_PER_PIXEL
+#define FN(x) x##_16bpp
+#define BYTES_PER_PIXEL 2
+#include "vp9_mc_template.c"
+#undef mc_luma_dir
+#undef mc_chroma_dir
+#undef FN
+#undef BYTES_PER_PIXEL
+#undef SCALED
+
static av_always_inline void mc_luma_scaled(VP9Context *s, vp9_scaled_mc_func smc,
+ vp9_mc_func (*mc)[2],
uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *ref, ptrdiff_t ref_stride,
ThreadFrame *ref_frame,
@@ -2766,6 +2865,11 @@ static av_always_inline void mc_luma_scaled(VP9Context *s, vp9_scaled_mc_func sm
int bw, int bh, int w, int h, int bytesperpixel,
const uint16_t *scale, const uint8_t *step)
{
+ if (s->frames[CUR_FRAME].tf.f->width == ref_frame->f->width &&
+ s->frames[CUR_FRAME].tf.f->height == ref_frame->f->height) {
+ mc_luma_unscaled(s, mc, dst, dst_stride, ref, ref_stride, ref_frame,
+ y, x, in_mv, bw, bh, w, h, bytesperpixel);
+ } else {
#define scale_mv(n, dim) (((int64_t)(n) * scale[dim]) >> 14)
int mx, my;
int refbw_m1, refbh_m1;
@@ -2802,9 +2906,11 @@ static av_always_inline void mc_luma_scaled(VP9Context *s, vp9_scaled_mc_func sm
ref_stride = 288;
}
smc(dst, dst_stride, ref, ref_stride, bh, mx, my, step[0], step[1]);
+ }
}
static av_always_inline void mc_chroma_scaled(VP9Context *s, vp9_scaled_mc_func smc,
+ vp9_mc_func (*mc)[2],
uint8_t *dst_u, uint8_t *dst_v,
ptrdiff_t dst_stride,
const uint8_t *ref_u, ptrdiff_t src_stride_u,
@@ -2815,6 +2921,12 @@ static av_always_inline void mc_chroma_scaled(VP9Context *s, vp9_scaled_mc_func
int bw, int bh, int w, int h, int bytesperpixel,
const uint16_t *scale, const uint8_t *step)
{
+ if (s->frames[CUR_FRAME].tf.f->width == ref_frame->f->width &&
+ s->frames[CUR_FRAME].tf.f->height == ref_frame->f->height) {
+ mc_chroma_unscaled(s, mc, dst_u, dst_v, dst_stride, ref_u, src_stride_u,
+ ref_v, src_stride_v, ref_frame,
+ y, x, in_mv, bw, bh, w, h, bytesperpixel);
+ } else {
int mx, my;
int refbw_m1, refbh_m1;
int th;
@@ -2870,16 +2982,17 @@ static av_always_inline void mc_chroma_scaled(VP9Context *s, vp9_scaled_mc_func
smc(dst_u, dst_stride, ref_u, src_stride_u, bh, mx, my, step[0], step[1]);
smc(dst_v, dst_stride, ref_v, src_stride_v, bh, mx, my, step[0], step[1]);
}
+ }
}
#define mc_luma_dir(s, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, \
px, py, pw, ph, bw, bh, w, h, i) \
- mc_luma_scaled(s, s->dsp.s##mc, dst, dst_ls, src, src_ls, tref, row, col, \
+ mc_luma_scaled(s, s->dsp.s##mc, s->dsp.mc, dst, dst_ls, src, src_ls, tref, row, col, \
mv, px, py, pw, ph, bw, bh, w, h, bytesperpixel, \
s->mvscale[b->ref[i]], s->mvstep[b->ref[i]])
#define mc_chroma_dir(s, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
row, col, mv, px, py, pw, ph, bw, bh, w, h, i) \
- mc_chroma_scaled(s, s->dsp.s##mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
+ mc_chroma_scaled(s, s->dsp.s##mc, s->dsp.mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
row, col, mv, px, py, pw, ph, bw, bh, w, h, bytesperpixel, \
s->mvscale[b->ref[i]], s->mvstep[b->ref[i]])
#define SCALED 1
@@ -2897,106 +3010,6 @@ static av_always_inline void mc_chroma_scaled(VP9Context *s, vp9_scaled_mc_func
#undef BYTES_PER_PIXEL
#undef SCALED
-static av_always_inline void mc_luma_unscaled(VP9Context *s, vp9_mc_func (*mc)[2],
- uint8_t *dst, ptrdiff_t dst_stride,
- const uint8_t *ref, ptrdiff_t ref_stride,
- ThreadFrame *ref_frame,
- ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
- int bw, int bh, int w, int h, int bytesperpixel)
-{
- int mx = mv->x, my = mv->y, th;
-
- y += my >> 3;
- x += mx >> 3;
- ref += y * ref_stride + x * bytesperpixel;
- mx &= 7;
- my &= 7;
- // FIXME bilinear filter only needs 0/1 pixels, not 3/4
- // we use +7 because the last 7 pixels of each sbrow can be changed in
- // the longest loopfilter of the next sbrow
- th = (y + bh + 4 * !!my + 7) >> 6;
- ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
- if (x < !!mx * 3 || y < !!my * 3 ||
- x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
- ref - !!my * 3 * ref_stride - !!mx * 3 * bytesperpixel,
- 160, ref_stride,
- bw + !!mx * 7, bh + !!my * 7,
- x - !!mx * 3, y - !!my * 3, w, h);
- ref = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
- ref_stride = 160;
- }
- mc[!!mx][!!my](dst, dst_stride, ref, ref_stride, bh, mx << 1, my << 1);
-}
-
-static av_always_inline void mc_chroma_unscaled(VP9Context *s, vp9_mc_func (*mc)[2],
- uint8_t *dst_u, uint8_t *dst_v,
- ptrdiff_t dst_stride,
- const uint8_t *ref_u, ptrdiff_t src_stride_u,
- const uint8_t *ref_v, ptrdiff_t src_stride_v,
- ThreadFrame *ref_frame,
- ptrdiff_t y, ptrdiff_t x, const VP56mv *mv,
- int bw, int bh, int w, int h, int bytesperpixel)
-{
- int mx = mv->x << !s->ss_h, my = mv->y << !s->ss_v, th;
-
- y += my >> 4;
- x += mx >> 4;
- ref_u += y * src_stride_u + x * bytesperpixel;
- ref_v += y * src_stride_v + x * bytesperpixel;
- mx &= 15;
- my &= 15;
- // FIXME bilinear filter only needs 0/1 pixels, not 3/4
- // we use +7 because the last 7 pixels of each sbrow can be changed in
- // the longest loopfilter of the next sbrow
- th = (y + bh + 4 * !!my + 7) >> (6 - s->ss_v);
- ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
- if (x < !!mx * 3 || y < !!my * 3 ||
- x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
- ref_u - !!my * 3 * src_stride_u - !!mx * 3 * bytesperpixel,
- 160, src_stride_u,
- bw + !!mx * 7, bh + !!my * 7,
- x - !!mx * 3, y - !!my * 3, w, h);
- ref_u = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
- mc[!!mx][!!my](dst_u, dst_stride, ref_u, 160, bh, mx, my);
-
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
- ref_v - !!my * 3 * src_stride_v - !!mx * 3 * bytesperpixel,
- 160, src_stride_v,
- bw + !!mx * 7, bh + !!my * 7,
- x - !!mx * 3, y - !!my * 3, w, h);
- ref_v = s->edge_emu_buffer + !!my * 3 * 160 + !!mx * 3 * bytesperpixel;
- mc[!!mx][!!my](dst_v, dst_stride, ref_v, 160, bh, mx, my);
- } else {
- mc[!!mx][!!my](dst_u, dst_stride, ref_u, src_stride_u, bh, mx, my);
- mc[!!mx][!!my](dst_v, dst_stride, ref_v, src_stride_v, bh, mx, my);
- }
-}
-
-#define mc_luma_dir(s, mc, dst, dst_ls, src, src_ls, tref, row, col, mv, \
- px, py, pw, ph, bw, bh, w, h, i) \
- mc_luma_unscaled(s, s->dsp.mc, dst, dst_ls, src, src_ls, tref, row, col, \
- mv, bw, bh, w, h, bytesperpixel)
-#define mc_chroma_dir(s, mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
- row, col, mv, px, py, pw, ph, bw, bh, w, h, i) \
- mc_chroma_unscaled(s, s->dsp.mc, dstu, dstv, dst_ls, srcu, srcu_ls, srcv, srcv_ls, tref, \
- row, col, mv, bw, bh, w, h, bytesperpixel)
-#define SCALED 0
-#define FN(x) x##_8bpp
-#define BYTES_PER_PIXEL 1
-#include "vp9_mc_template.c"
-#undef FN
-#undef BYTES_PER_PIXEL
-#define FN(x) x##_16bpp
-#define BYTES_PER_PIXEL 2
-#include "vp9_mc_template.c"
-#undef mc_luma_dir_dir
-#undef mc_chroma_dir_dir
-#undef FN
-#undef BYTES_PER_PIXEL
-#undef SCALED
-
static av_always_inline void inter_recon(AVCodecContext *ctx, int bytesperpixel)
{
VP9Context *s = ctx->priv_data;
@@ -3288,9 +3301,9 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
// emulated overhangs if the stride of the target buffer can't hold. This
// makes it possible to support emu-edge and so on even if we have large block
// overhangs
- emu[0] = (col + w4) * 8 > f->linesize[0] ||
+ emu[0] = (col + w4) * 8 * bytesperpixel > f->linesize[0] ||
(row + h4) > s->rows;
- emu[1] = (col + w4) * 4 > f->linesize[1] ||
+ emu[1] = ((col + w4) * 8 >> s->ss_h) * bytesperpixel > f->linesize[1] ||
(row + h4) > s->rows;
if (emu[0]) {
s->dst[0] = s->tmp_y;
@@ -3329,9 +3342,9 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
av_assert2(n <= 4);
if (w & bw) {
- s->dsp.mc[n][0][0][0][0](f->data[0] + yoff + o, f->linesize[0],
- s->tmp_y + o, 128, h, 0, 0);
- o += bw * bytesperpixel;
+ s->dsp.mc[n][0][0][0][0](f->data[0] + yoff + o * bytesperpixel, f->linesize[0],
+ s->tmp_y + o * bytesperpixel, 128, h, 0, 0);
+ o += bw;
}
}
}
@@ -3344,11 +3357,11 @@ static void decode_b(AVCodecContext *ctx, int row, int col,
av_assert2(n <= 4);
if (w & bw) {
- s->dsp.mc[n][0][0][0][0](f->data[1] + uvoff + o, f->linesize[1],
- s->tmp_uv[0] + o, 128, h, 0, 0);
- s->dsp.mc[n][0][0][0][0](f->data[2] + uvoff + o, f->linesize[2],
- s->tmp_uv[1] + o, 128, h, 0, 0);
- o += bw * bytesperpixel;
+ s->dsp.mc[n][0][0][0][0](f->data[1] + uvoff + o * bytesperpixel, f->linesize[1],
+ s->tmp_uv[0] + o * bytesperpixel, 128, h, 0, 0);
+ s->dsp.mc[n][0][0][0][0](f->data[2] + uvoff + o * bytesperpixel, f->linesize[2],
+ s->tmp_uv[1] + o * bytesperpixel, 128, h, 0, 0);
+ o += bw;
}
}
}
@@ -3988,7 +4001,8 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
int size = pkt->size;
VP9Context *s = ctx->priv_data;
int res, tile_row, tile_col, i, ref, row, col;
- int retain_segmap_ref = s->segmentation.enabled && !s->segmentation.update_map;
+ int retain_segmap_ref = s->frames[REF_FRAME_SEGMAP].segmentation_map &&
+ (!s->segmentation.enabled || !s->segmentation.update_map);
ptrdiff_t yoff, uvoff, ls_y, ls_uv;
AVFrame *f;
int bytesperpixel;
@@ -4017,7 +4031,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
data += res;
size -= res;
- if (!retain_segmap_ref) {
+ if (!retain_segmap_ref || s->keyframe || s->intraonly) {
if (s->frames[REF_FRAME_SEGMAP].tf.f->data[0])
vp9_unref_frame(ctx, &s->frames[REF_FRAME_SEGMAP]);
if (!s->keyframe && !s->intraonly && !s->errorres && s->frames[CUR_FRAME].tf.f->data[0] &&
@@ -4039,6 +4053,12 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
ls_y = f->linesize[0];
ls_uv =f->linesize[1];
+ if (s->frames[REF_FRAME_SEGMAP].tf.f->data[0] &&
+ (s->frames[REF_FRAME_MVPAIR].tf.f->width != s->frames[CUR_FRAME].tf.f->width ||
+ s->frames[REF_FRAME_MVPAIR].tf.f->height != s->frames[CUR_FRAME].tf.f->height)) {
+ vp9_unref_frame(ctx, &s->frames[REF_FRAME_SEGMAP]);
+ }
+
// ref frame setup
for (i = 0; i < 8; i++) {
if (s->next_refs[i].f->data[0])
@@ -4225,7 +4245,9 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
for (i = 0; i < 8; i++) {
if (s->refs[i].f->data[0])
ff_thread_release_buffer(ctx, &s->refs[i]);
- ff_thread_ref_frame(&s->refs[i], &s->next_refs[i]);
+ if (s->next_refs[i].f->data[0] &&
+ (res = ff_thread_ref_frame(&s->refs[i], &s->next_refs[i])) < 0)
+ return res;
}
if (!s->invisible) {
@@ -4297,7 +4319,8 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
// detect size changes in other threads
if (s->intra_pred_data[0] &&
- (!ssrc->intra_pred_data[0] || s->cols != ssrc->cols || s->rows != ssrc->rows)) {
+ (!ssrc->intra_pred_data[0] || s->cols != ssrc->cols ||
+ s->rows != ssrc->rows || s->bpp != ssrc->bpp)) {
free_buffers(s);
}
@@ -4320,19 +4343,19 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
s->invisible = ssrc->invisible;
s->keyframe = ssrc->keyframe;
+ s->intraonly = ssrc->intraonly;
s->ss_v = ssrc->ss_v;
s->ss_h = ssrc->ss_h;
s->segmentation.enabled = ssrc->segmentation.enabled;
s->segmentation.update_map = ssrc->segmentation.update_map;
+ s->segmentation.absolute_vals = ssrc->segmentation.absolute_vals;
s->bytesperpixel = ssrc->bytesperpixel;
s->bpp = ssrc->bpp;
s->bpp_index = ssrc->bpp_index;
memcpy(&s->prob_ctx, &ssrc->prob_ctx, sizeof(s->prob_ctx));
memcpy(&s->lf_delta, &ssrc->lf_delta, sizeof(s->lf_delta));
- if (ssrc->segmentation.enabled) {
- memcpy(&s->segmentation.feat, &ssrc->segmentation.feat,
- sizeof(s->segmentation.feat));
- }
+ memcpy(&s->segmentation.feat, &ssrc->segmentation.feat,
+ sizeof(s->segmentation.feat));
return 0;
}
@@ -4354,7 +4377,7 @@ AVCodec ff_vp9_decoder = {
.init = vp9_decode_init,
.close = vp9_decode_free,
.decode = vp9_decode_frame,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.flush = vp9_decode_flush,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp9_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp9_decode_update_thread_context),
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c b/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
index ab33c334143..f1f7e350d26 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9_parser.c
@@ -22,6 +22,7 @@
*/
#include "libavutil/intreadwrite.h"
+#include "libavcodec/get_bits.h"
#include "parser.h"
typedef struct VP9ParseContext {
@@ -30,11 +31,28 @@ typedef struct VP9ParseContext {
int64_t pts;
} VP9ParseContext;
-static void parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
+static int parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
{
VP9ParseContext *s = ctx->priv_data;
+ GetBitContext gb;
+ int res, profile, keyframe, invisible;
+
+ if ((res = init_get_bits8(&gb, buf, size)) < 0)
+ return res;
+ get_bits(&gb, 2); // frame marker
+ profile = get_bits1(&gb);
+ profile |= get_bits1(&gb) << 1;
+ if (profile == 3) profile += get_bits1(&gb);
+
+ if (get_bits1(&gb)) {
+ keyframe = 0;
+ invisible = 0;
+ } else {
+ keyframe = !get_bits1(&gb);
+ invisible = !get_bits1(&gb);
+ }
- if (buf[0] & 0x4) {
+ if (!keyframe) {
ctx->pict_type = AV_PICTURE_TYPE_P;
ctx->key_frame = 0;
} else {
@@ -42,7 +60,7 @@ static void parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
ctx->key_frame = 1;
}
- if (buf[0] & 0x2) {
+ if (!invisible) {
if (ctx->pts == AV_NOPTS_VALUE)
ctx->pts = s->pts;
s->pts = AV_NOPTS_VALUE;
@@ -50,6 +68,8 @@ static void parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
s->pts = ctx->pts;
ctx->pts = AV_NOPTS_VALUE;
}
+
+ return 0;
}
static int parse(AVCodecParserContext *ctx,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
index 5ff18b471ca..54e77e267b4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.c
@@ -25,7 +25,7 @@
#include "libavutil/common.h"
#include "vp9dsp.h"
-av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp)
+av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact)
{
if (bpp == 8) {
ff_vp9dsp_init_8(dsp);
@@ -36,5 +36,6 @@ av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp)
ff_vp9dsp_init_12(dsp);
}
- if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp);
+ if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp, bitexact);
+ if (ARCH_MIPS) ff_vp9dsp_init_mips(dsp, bpp);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
index beb8926353e..016a9bb2313 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9dsp.h
@@ -120,12 +120,13 @@ typedef struct VP9DSPContext {
vp9_scaled_mc_func smc[5][4][2];
} VP9DSPContext;
-void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp);
+void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact);
void ff_vp9dsp_init_8(VP9DSPContext *dsp);
void ff_vp9dsp_init_10(VP9DSPContext *dsp);
void ff_vp9dsp_init_12(VP9DSPContext *dsp);
-void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp);
+void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact);
+void ff_vp9dsp_init_mips(VP9DSPContext *dsp, int bpp);
#endif /* AVCODEC_VP9DSP_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9dsp_template.c b/chromium/third_party/ffmpeg/libavcodec/vp9dsp_template.c
index 8f10ccf893a..4d810fec3a9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9dsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9dsp_template.c
@@ -1078,12 +1078,12 @@ def_hor_up(32)
#endif /* BIT_DEPTH != 12 */
#if BIT_DEPTH != 8
-void vp9dsp_intrapred_init_10(VP9DSPContext *dsp);
+void ff_vp9dsp_intrapred_init_10(VP9DSPContext *dsp);
#endif
#if BIT_DEPTH != 10
static
#endif
-av_cold void FUNC(vp9dsp_intrapred_init)(VP9DSPContext *dsp)
+av_cold void FUNC(ff_vp9dsp_intrapred_init)(VP9DSPContext *dsp)
{
#define init_intra_pred_bd_aware(tx, sz) \
dsp->intra_pred[tx][TM_VP8_PRED] = tm_##sz##_c; \
@@ -1092,7 +1092,7 @@ av_cold void FUNC(vp9dsp_intrapred_init)(VP9DSPContext *dsp)
dsp->intra_pred[tx][DC_129_PRED] = dc_129_##sz##_c
#if BIT_DEPTH == 12
- vp9dsp_intrapred_init_10(dsp);
+ ff_vp9dsp_intrapred_init_10(dsp);
#define init_intra_pred(tx, sz) \
init_intra_pred_bd_aware(tx, sz)
#else
@@ -1131,8 +1131,8 @@ static void type_a##_##type_b##_##sz##x##sz##_add_c(uint8_t *_dst, \
\
stride /= sizeof(pixel); \
if (has_dconly && eob == 1) { \
- const int t = (((block[0] * 11585 + (1 << 13)) >> 14) \
- * 11585 + (1 << 13)) >> 14; \
+ const int t = ((((dctint) block[0] * 11585 + (1 << 13)) >> 14) \
+ * 11585 + (1 << 13)) >> 14; \
block[0] = 0; \
for (i = 0; i < sz; i++) { \
for (j = 0; j < sz; j++) \
@@ -1186,7 +1186,7 @@ static av_always_inline void idct4_1d(const dctcoef *in, ptrdiff_t stride,
static av_always_inline void iadst4_1d(const dctcoef *in, ptrdiff_t stride,
dctcoef *out, int pass)
{
- int t0, t1, t2, t3;
+ dctint t0, t1, t2, t3;
t0 = 5283 * IN(0) + 15212 * IN(2) + 9929 * IN(3);
t1 = 9929 * IN(0) - 5283 * IN(2) - 15212 * IN(3);
@@ -2317,15 +2317,15 @@ filter_fn_set(avg)
#undef bilinf_fn_2d
#if BIT_DEPTH != 8
-void vp9dsp_mc_init_10(VP9DSPContext *dsp);
+void ff_vp9dsp_mc_init_10(VP9DSPContext *dsp);
#endif
#if BIT_DEPTH != 10
static
#endif
-av_cold void FUNC(vp9dsp_mc_init)(VP9DSPContext *dsp)
+av_cold void FUNC(ff_vp9dsp_mc_init)(VP9DSPContext *dsp)
{
#if BIT_DEPTH == 12
- vp9dsp_mc_init_10(dsp);
+ ff_vp9dsp_mc_init_10(dsp);
#else /* BIT_DEPTH == 12 */
#define init_fpel(idx1, idx2, sz, type) \
@@ -2555,12 +2555,12 @@ scaled_filter_fn_set(avg)
#undef scaled_bilinf_fn
#if BIT_DEPTH != 8
-void vp9dsp_scaled_mc_init_10(VP9DSPContext *dsp);
+void ff_vp9dsp_scaled_mc_init_10(VP9DSPContext *dsp);
#endif
#if BIT_DEPTH != 10
static
#endif
-av_cold void FUNC(vp9dsp_scaled_mc_init)(VP9DSPContext *dsp)
+av_cold void FUNC(ff_vp9dsp_scaled_mc_init)(VP9DSPContext *dsp)
{
#define init_scaled_bd_aware(idx1, idx2, sz, type) \
dsp->smc[idx1][FILTER_8TAP_SMOOTH ][idx2] = type##_scaled_smooth_##sz##_c; \
@@ -2568,7 +2568,7 @@ av_cold void FUNC(vp9dsp_scaled_mc_init)(VP9DSPContext *dsp)
dsp->smc[idx1][FILTER_8TAP_SHARP ][idx2] = type##_scaled_sharp_##sz##_c
#if BIT_DEPTH == 12
- vp9dsp_scaled_mc_init_10(dsp);
+ ff_vp9dsp_scaled_mc_init_10(dsp);
#define init_scaled(a,b,c,d) init_scaled_bd_aware(a,b,c,d)
#else
#define init_scaled(idx1, idx2, sz, type) \
@@ -2593,9 +2593,9 @@ av_cold void FUNC(vp9dsp_scaled_mc_init)(VP9DSPContext *dsp)
av_cold void FUNC(ff_vp9dsp_init)(VP9DSPContext *dsp)
{
- FUNC(vp9dsp_intrapred_init)(dsp);
+ FUNC(ff_vp9dsp_intrapred_init)(dsp);
vp9dsp_itxfm_init(dsp);
vp9dsp_loopfilter_init(dsp);
- FUNC(vp9dsp_mc_init)(dsp);
- FUNC(vp9dsp_scaled_mc_init)(dsp);
+ FUNC(ff_vp9dsp_mc_init)(dsp);
+ FUNC(ff_vp9dsp_scaled_mc_init)(dsp);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vqavideo.c b/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
index 45eb1574f65..3ed9652d3b8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vqavideo.c
@@ -650,5 +650,5 @@ AVCodec ff_vqa_decoder = {
.init = vqa_decode_init,
.close = vqa_decode_end,
.decode = vqa_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wavpack.c b/chromium/third_party/ffmpeg/libavcodec/wavpack.c
index b51a21cc9da..9bafe65e0e6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wavpack.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wavpack.c
@@ -155,7 +155,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
if (t >= 2) {
if (get_bits_left(gb) < t - 1)
goto error;
- t = get_bits(gb, t - 1) | (1 << (t - 1));
+ t = get_bits_long(gb, t - 1) | (1 << (t - 1));
} else {
if (get_bits_left(gb) < 0)
goto error;
@@ -186,7 +186,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
} else {
if (get_bits_left(gb) < t2 - 1)
goto error;
- t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
+ t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
}
}
@@ -271,7 +271,7 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
if (s->got_extra_bits &&
get_bits_left(&s->gb_extra_bits) >= s->extra_bits) {
- S |= get_bits(&s->gb_extra_bits, s->extra_bits);
+ S |= get_bits_long(&s->gb_extra_bits, s->extra_bits);
*crc = *crc * 9 + (S & 0xffff) * 3 + ((unsigned)S >> 16);
}
}
@@ -299,7 +299,7 @@ static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
const int max_bits = 1 + 23 + 8 + 1;
const int left_bits = get_bits_left(&s->gb_extra_bits);
- if (left_bits + 8 * FF_INPUT_BUFFER_PADDING_SIZE < max_bits)
+ if (left_bits + 8 * AV_INPUT_BUFFER_PADDING_SIZE < max_bits)
return 0.0;
}
@@ -835,7 +835,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
continue;
}
bytestream2_get_buffer(&gb, val, 4);
- if (val[0]) {
+ if (val[0] > 32) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid INT32INFO, extra_bits = %d (> 32)\n", val[0]);
+ continue;
+ } else if (val[0]) {
s->extra_bits = val[0];
} else if (val[1]) {
s->shift = val[1];
@@ -1121,5 +1125,5 @@ AVCodec ff_wavpack_decoder = {
.decode = wavpack_decode_frame,
.flush = wavpack_decode_flush,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
index 87f14457381..977bcf0e048 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
@@ -1829,9 +1829,9 @@ static int wv_stereo(WavPackEncodeContext *s,
log_limit = (((s->flags & MAG_MASK) >> MAG_LSB) + 4) * 256;
log_limit = FFMIN(6912, log_limit);
- if (s->joint) {
- force_js = s->joint > 0;
- force_ts = s->joint < 0;
+ if (s->joint != -1) {
+ force_js = s->joint;
+ force_ts = !s->joint;
}
if ((ret = allocate_buffers(s)) < 0)
@@ -2879,7 +2879,7 @@ static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
buf_size = s->block_samples * avctx->channels * 8
+ 200 /* for headers */;
- if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size, 0)) < 0)
return ret;
buf = avpkt->data;
@@ -2955,13 +2955,8 @@ static av_cold int wavpack_encode_close(AVCodecContext *avctx)
#define OFFSET(x) offsetof(WavPackEncodeContext, x)
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static const AVOption options[] = {
- { "joint_stereo", "", OFFSET(joint), AV_OPT_TYPE_INT, {.i64=0},-1, 1, FLAGS, "joint" },
- { "on", "mid/side", 0, AV_OPT_TYPE_CONST, {.i64= 1}, 0, 0, FLAGS, "joint"},
- { "off", "left/right", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, "joint"},
- { "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64= 0}, 0, 0, FLAGS, "joint"},
- { "optimize_mono", "", OFFSET(optimize_mono), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "opt_mono" },
- { "on", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "opt_mono"},
- { "off", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "opt_mono"},
+ { "joint_stereo", "", OFFSET(joint), AV_OPT_TYPE_BOOL, {.i64=-1}, -1, 1, FLAGS },
+ { "optimize_mono", "", OFFSET(optimize_mono), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL },
};
@@ -2982,7 +2977,7 @@ AVCodec ff_wavpack_encoder = {
.init = wavpack_encode_init,
.encode2 = wavpack_encode_frame,
.close = wavpack_encode_close,
- .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,
diff --git a/chromium/third_party/ffmpeg/libavcodec/webp.c b/chromium/third_party/ffmpeg/libavcodec/webp.c
index 47e9e9e6622..5c2961ff19f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/webp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/webp.c
@@ -1387,7 +1387,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
av_dict_free(&s->exif_metadata);
- while (bytestream2_get_bytes_left(&gb) > 0) {
+ while (bytestream2_get_bytes_left(&gb) > 8) {
char chunk_str[5] = { 0 };
chunk_type = bytestream2_get_le32(&gb);
@@ -1417,6 +1417,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
chunk_size, 0);
if (ret < 0)
return ret;
+ avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
}
bytestream2_skip(&gb, chunk_size);
break;
@@ -1539,5 +1540,5 @@ AVCodec ff_webp_decoder = {
.priv_data_size = sizeof(WebPContext),
.decode = webp_decode_frame,
.close = webp_decode_close,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wma.c b/chromium/third_party/ffmpeg/libavcodec/wma.c
index 4c1bf00486f..006d8d55e45 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wma.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wma.c
@@ -338,7 +338,7 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
#endif /* TRACE */
}
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/wma.h b/chromium/third_party/ffmpeg/libavcodec/wma.h
index cc9d6f9f8a5..4aad713fa81 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wma.h
+++ b/chromium/third_party/ffmpeg/libavcodec/wma.h
@@ -120,7 +120,7 @@ typedef struct WMACodecContext {
/* output buffer for one frame and the last for IMDCT windowing */
DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2];
/* last frame info */
- uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; /* padding added */
+ uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; /* padding added */
int last_bitoffset;
int last_superframe_len;
float noise_table[NOISE_TAB_SIZE];
diff --git a/chromium/third_party/ffmpeg/libavcodec/wma_freqs.h b/chromium/third_party/ffmpeg/libavcodec/wma_freqs.h
index 85c5f697b76..6fd93e4effa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wma_freqs.h
+++ b/chromium/third_party/ffmpeg/libavcodec/wma_freqs.h
@@ -23,4 +23,4 @@
extern const uint16_t ff_wma_critical_freqs[25];
-#endif /* AVCODEC_WMA_FREQS */
+#endif /* AVCODEC_WMA_FREQS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmadec.c b/chromium/third_party/ffmpeg/libavcodec/wmadec.c
index d60cf1febb4..e814007ead5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmadec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmadec.c
@@ -854,7 +854,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
*q++ = get_bits (&s->gb, 8);
len --;
}
- memset(q, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(q, 0, AV_INPUT_BUFFER_PADDING_SIZE);
s->last_superframe_len += 8*buf_size - 8;
// s->reset_block_lengths = 1; //XXX is this needed ?
@@ -893,7 +893,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
}
if (len > 0)
*q++ = (get_bits) (&s->gb, len) << (8 - len);
- memset(q, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(q, 0, AV_INPUT_BUFFER_PADDING_SIZE);
/* XXX: bit_offset bits into last frame */
init_get_bits(&s->gb, s->last_superframe,
@@ -977,7 +977,7 @@ AVCodec ff_wmav1_decoder = {
.close = ff_wma_end,
.decode = wma_decode_superframe,
.flush = flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
@@ -993,7 +993,7 @@ AVCodec ff_wmav2_decoder = {
.close = ff_wma_end,
.decode = wma_decode_superframe,
.flush = flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmaenc.c b/chromium/third_party/ffmpeg/libavcodec/wmaenc.c
index b922acdee8e..fc23d4e33dc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmaenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmaenc.c
@@ -377,7 +377,7 @@ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt,
}
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * MAX_CODED_SUPERFRAME_SIZE)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * MAX_CODED_SUPERFRAME_SIZE, 0)) < 0)
return ret;
total_gain = 128;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c b/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
index 843ce90b3a8..e9d0bca616c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmalosslessdec.c
@@ -72,7 +72,7 @@ typedef struct WmallDecodeCtx {
AVCodecContext *avctx;
AVFrame *frame;
LLAudDSPContext dsp; ///< accelerated DSP functions
- uint8_t frame_data[MAX_FRAMESIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< compressed frame data
+ uint8_t frame_data[MAX_FRAMESIZE + AV_INPUT_BUFFER_PADDING_SIZE]; ///< compressed frame data
PutBitContext pb; ///< context for filling the frame_data buffer
/* frame size dependent frame information (set during initialization) */
@@ -201,6 +201,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (s->bits_per_sample == 16)
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
else if (s->bits_per_sample == 24) {
+ av_log(avctx, AV_LOG_WARNING, "Decoding audio at 24 bit-depth\n");
avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
avctx->bits_per_raw_sample = 24;
} else {
@@ -488,7 +489,7 @@ static int decode_cdlms(WmallDecodeCtx *s)
if ((1 << cbits) < s->cdlms[c][i].scaling + 1)
cbits++;
- s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2;
+ s->cdlms[c][i].bitsend = (cbits ? get_bits(&s->gb, cbits) : 0) + 2;
shift_l = 32 - s->cdlms[c][i].bitsend;
shift_r = 32 - s->cdlms[c][i].scaling - 2;
for (j = 0; j < s->cdlms[c][i].coefsend; j++)
@@ -1005,6 +1006,7 @@ static int decode_frame(WmallDecodeCtx *s)
if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) {
/* return an error if no frame could be decoded at all */
s->packet_loss = 1;
+ s->frame->nb_samples = 0;
return ret;
}
for (i = 0; i < s->num_channels; i++) {
@@ -1298,7 +1300,7 @@ AVCodec ff_wmalossless_decoder = {
.close = decode_close,
.decode = decode_packet,
.flush = flush,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c b/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
index c319b398365..19dc335b329 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmaprodec.c
@@ -173,7 +173,7 @@ typedef struct WMAProDecodeCtx {
AVCodecContext* avctx; ///< codec context for av_log
AVFloatDSPContext *fdsp;
uint8_t frame_data[MAX_FRAMESIZE +
- FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
+ AV_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
PutBitContext pb; ///< context for filling the frame_data buffer
FFTContext mdct_ctx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size
DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer
@@ -288,7 +288,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
s->avctx = avctx;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
@@ -1666,7 +1666,7 @@ AVCodec ff_wmapro_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_packet,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.flush = flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmavoice.c b/chromium/third_party/ffmpeg/libavcodec/wmavoice.c
index ae88d4ec800..029dfdd8bfc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmavoice.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmavoice.c
@@ -203,7 +203,7 @@ typedef struct WMAVoiceContext {
///< to #wmavoice_decode_packet() (since
///< they're part of the previous superframe)
- uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + AV_INPUT_BUFFER_PADDING_SIZE];
///< cache for superframe data split over
///< multiple packets
int sframe_cache_size; ///< set to >0 if we have data from an
@@ -1982,7 +1982,14 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,
*got_frame_ptr) {
cnt += s->spillover_nbits;
s->skip_bits_next = cnt & 7;
- return cnt >> 3;
+ res = cnt >> 3;
+ if (res > avpkt->size) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Trying to skip %d bytes in packet of size %d\n",
+ res, avpkt->size);
+ return AVERROR_INVALIDDATA;
+ }
+ return res;
} else
skip_bits_long (gb, s->spillover_nbits - cnt +
get_bits_count(gb)); // resync
@@ -2001,7 +2008,14 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,
} else if (*got_frame_ptr) {
int cnt = get_bits_count(gb);
s->skip_bits_next = cnt & 7;
- return cnt >> 3;
+ res = cnt >> 3;
+ if (res > avpkt->size) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Trying to skip %d bytes in packet of size %d\n",
+ res, avpkt->size);
+ return AVERROR_INVALIDDATA;
+ }
+ return res;
} else if ((s->sframe_cache_size = pos) > 0) {
/* rewind bit reader to start of last (incomplete) superframe... */
init_get_bits(gb, avpkt->data, size << 3);
@@ -2070,6 +2084,6 @@ AVCodec ff_wmavoice_decoder = {
.init_static_data = wmavoice_init_static_data,
.close = wmavoice_decode_end,
.decode = wmavoice_decode_packet,
- .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.flush = wmavoice_flush,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2.c b/chromium/third_party/ffmpeg/libavcodec/wmv2.c
index 0ebe02db45e..9c3acbcd2d4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2.c
@@ -89,7 +89,7 @@ void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64],
wmv2_add_block(w, block1[2], dest_y + 8 * s->linesize, s->linesize, 2);
wmv2_add_block(w, block1[3], dest_y + 8 + 8 * s->linesize, s->linesize, 3);
- if (s->avctx->flags & CODEC_FLAG_GRAY)
+ if (s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
wmv2_add_block(w, block1[4], dest_cb, s->uvlinesize, 4);
@@ -141,7 +141,7 @@ void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y,
w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 * linesize, ptr + 8 * linesize, linesize);
w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 + 8 * linesize, ptr + 8 + 8 * linesize, linesize);
- if (s->avctx->flags & CODEC_FLAG_GRAY)
+ if (s->avctx->flags & AV_CODEC_FLAG_GRAY)
return;
dxy = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
index d2b9b130533..99c95d397a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
@@ -108,7 +108,7 @@ static int decode_ext_header(Wmv2Context *w)
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG,
- "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, "
+ "fps:%d, br:%"PRId64", qpbit:%d, abt_flag:%d, j_type_bit:%d, "
"tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
"slices:%d\n",
fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit,
@@ -453,7 +453,9 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
Wmv2Context *const w = avctx->priv_data;
int ret;
+#if FF_API_EMU_EDGE
avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
return ret;
@@ -482,7 +484,7 @@ AVCodec ff_wmv2_decoder = {
.init = wmv2_decode_init,
.close = wmv2_decode_end,
.decode = ff_h263_decode_frame,
- .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2enc.c b/chromium/third_party/ffmpeg/libavcodec/wmv2enc.c
index 0499f0a1edd..3ed8b5fb533 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2enc.c
@@ -62,9 +62,10 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx)
ff_wmv2_common_init(w);
avctx->extradata_size = 4;
- avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
+
encode_ext_header(w);
return 0;
@@ -226,10 +227,10 @@ AVCodec ff_wmv2_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV2,
.priv_data_size = sizeof(Wmv2Context),
+ .priv_class = &wmv2_class,
.init = wmv2_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
- .priv_class = &wmv2_class,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/wnv1.c b/chromium/third_party/ffmpeg/libavcodec/wnv1.c
index fb9e9cfeef1..9ff99b2f98d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wnv1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wnv1.c
@@ -73,12 +73,12 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
- rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ rbuf = av_malloc(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!rbuf) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
return AVERROR(ENOMEM);
}
- memset(rbuf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(rbuf + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
av_free(rbuf);
@@ -155,5 +155,5 @@ AVCodec ff_wnv1_decoder = {
.priv_data_size = sizeof(WNV1Context),
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/ws-snd1.c b/chromium/third_party/ffmpeg/libavcodec/ws-snd1.c
index 6929cbf5e5e..0f005807ae8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ws-snd1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ws-snd1.c
@@ -177,5 +177,5 @@ AVCodec ff_ws_snd1_decoder = {
.id = AV_CODEC_ID_WESTWOOD_SND1,
.init = ws_snd_decode_init,
.decode = ws_snd_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
index 08cee1c4fdf..3c3cc1cebb5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
@@ -31,12 +31,15 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o \
x86/mpegvideoencdsp_init.o
OBJS-$(CONFIG_PIXBLOCKDSP) += x86/pixblockdsp_init.o
OBJS-$(CONFIG_QPELDSP) += x86/qpeldsp_init.o
+OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp_init.o
OBJS-$(CONFIG_VIDEODSP) += x86/videodsp_init.o
OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o
+OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp_init.o
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
# decoders/encoders
-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
+OBJS-$(CONFIG_AAC_DECODER) += x86/aacpsdsp_init.o \
+ x86/sbrdsp_init.o
OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp_init.o
OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp_init.o
OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp_init.o
@@ -50,9 +53,7 @@ OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct_init.o
OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o
OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o
-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o
-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \
- x86/rv40dsp_init.o
+OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp_init.o
OBJS-$(CONFIG_SVQ1_ENCODER) += x86/svq1enc_init.o
OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp_init.o
OBJS-$(CONFIG_TTA_DECODER) += x86/ttadsp_init.o
@@ -61,8 +62,6 @@ OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc_init.o
OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_init.o
OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp_init.o
OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp_init.o
-OBJS-$(CONFIG_VP7_DECODER) += x86/vp8dsp_init.o
-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o
OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o
OBJS-$(CONFIG_WEBP_DECODER) += x86/vp8dsp_init.o
@@ -78,10 +77,6 @@ MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_SNOW_ENCODER) += x86/snowdsp.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
-
-# YASM optimizations
-YASM-OBJS += x86/deinterlace.o \
-
# subsystems
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
YASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o
@@ -125,11 +120,15 @@ YASM-OBJS-$(CONFIG_PIXBLOCKDSP) += x86/pixblockdsp.o
YASM-OBJS-$(CONFIG_QPELDSP) += x86/qpeldsp.o \
x86/fpel.o \
x86/qpel.o
+YASM-OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp.o
YASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o
YASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
+YASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \
+ x86/vp8dsp_loopfilter.o
# decoders/encoders
-YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
+YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/aacpsdsp.o \
+ x86/sbrdsp.o
YASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o
YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o
YASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o
@@ -145,9 +144,7 @@ YASM-OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct.o
YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o
-YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o
-YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \
- x86/rv40dsp.o
+YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp.o
YASM-OBJS-$(CONFIG_SVQ1_ENCODER) += x86/svq1enc.o
YASM-OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o
YASM-OBJS-$(CONFIG_TTA_DECODER) += x86/ttadsp.o
@@ -156,10 +153,6 @@ YASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o
YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp.o
YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o
-YASM-OBJS-$(CONFIG_VP7_DECODER) += x86/vp8dsp.o \
- x86/vp8dsp_loopfilter.o
-YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o \
- x86/vp8dsp_loopfilter.o
YASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9intrapred.o \
x86/vp9itxfm.o \
x86/vp9lpf.o \
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp.asm
new file mode 100644
index 00000000000..d1187df4db5
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp.asm
@@ -0,0 +1,215 @@
+;******************************************************************************
+;* SIMD optimized MPEG-4 Parametric Stereo decoding functions
+;*
+;* Copyright (C) 2015 James Almer
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;******************************************************************************
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+ps_p1m1p1m1: dd 0, 0x80000000, 0, 0x80000000
+
+SECTION .text
+
+;*************************************************************************
+;void ff_ps_add_squares_<opt>(float *dst, const float (*src)[2], int n);
+;*************************************************************************
+%macro PS_ADD_SQUARES 1
+cglobal ps_add_squares, 3, 3, %1, dst, src, n
+.loop:
+ movaps m0, [srcq]
+ movaps m1, [srcq+mmsize]
+ mulps m0, m0
+ mulps m1, m1
+%if cpuflag(sse3)
+ haddps m0, m1
+%else
+ movaps m3, m0
+ movaps m4, m1
+ shufps m3, m3, q0301
+ shufps m4, m4, q0301
+ addps m0, m3
+ addps m1, m4
+ shufps m0, m1, q2020
+%endif
+ addps m0, [dstq]
+ movaps [dstq], m0
+ add dstq, mmsize
+ add srcq, mmsize*2
+ sub nd, mmsize/4
+ jg .loop
+ REP_RET
+%endmacro
+
+INIT_XMM sse
+PS_ADD_SQUARES 3
+INIT_XMM sse3
+PS_ADD_SQUARES 5
+
+;*******************************************************************
+;void ff_ps_mul_pair_single_sse(float (*dst)[2], float (*src0)[2],
+; float *src1, int n);
+;*******************************************************************
+INIT_XMM sse
+cglobal ps_mul_pair_single, 4, 5, 4, dst, src1, src2, n
+ xor r4q, r4q
+
+.loop:
+ movu m0, [src1q+r4q]
+ movu m1, [src1q+r4q+mmsize]
+ mova m2, [src2q]
+ mova m3, m2
+ unpcklps m2, m2
+ unpckhps m3, m3
+ mulps m0, m2
+ mulps m1, m3
+ mova [dstq+r4q], m0
+ mova [dstq+r4q+mmsize], m1
+ add src2q, mmsize
+ add r4q, mmsize*2
+ sub nd, mmsize/4
+ jg .loop
+ REP_RET
+
+;***********************************************************************
+;void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2],
+; float h[2][4], float h_step[2][4],
+; int len);
+;***********************************************************************
+INIT_XMM sse3
+cglobal ps_stereo_interpolate, 5, 5, 6, l, r, h, h_step, n
+ movaps m0, [hq]
+ movaps m1, [h_stepq]
+ cmp nd, 0
+ jle .ret
+ shl nd, 3
+ add lq, nq
+ add rq, nq
+ neg nq
+
+align 16
+.loop:
+ addps m0, m1
+ movddup m2, [lq+nq]
+ movddup m3, [rq+nq]
+ movaps m4, m0
+ movaps m5, m0
+ unpcklps m4, m4
+ unpckhps m5, m5
+ mulps m2, m4
+ mulps m3, m5
+ addps m2, m3
+ movsd [lq+nq], m2
+ movhps [rq+nq], m2
+ add nq, 8
+ jl .loop
+.ret:
+ REP_RET
+
+;*******************************************************************
+;void ff_ps_hybrid_analysis_<opt>(float (*out)[2], float (*in)[2],
+; const float (*filter)[8][2],
+; int stride, int n);
+;*******************************************************************
+%macro PS_HYBRID_ANALYSIS_LOOP 3
+ movu %1, [inq+mmsize*%3]
+ movu m1, [inq+mmsize*(5-%3)+8]
+%if cpuflag(sse3)
+ pshufd %2, %1, q2301
+ pshufd m4, m1, q0123
+ pshufd m1, m1, q1032
+ pshufd m2, [filterq+nq+mmsize*%3], q2301
+ addsubps %2, m4
+ addsubps %1, m1
+%else
+ mova m2, [filterq+nq+mmsize*%3]
+ mova %2, %1
+ mova m4, m1
+ shufps %2, %2, q2301
+ shufps m4, m4, q0123
+ shufps m1, m1, q1032
+ shufps m2, m2, q2301
+ xorps m4, m7
+ xorps m1, m7
+ subps %2, m4
+ subps %1, m1
+%endif
+ mulps %2, m2
+ mulps %1, m2
+%if %3
+ addps m3, %2
+ addps m0, %1
+%endif
+%endmacro
+
+%macro PS_HYBRID_ANALYSIS 0
+cglobal ps_hybrid_analysis, 5, 5, 8, out, in, filter, stride, n
+%if cpuflag(sse3)
+%define MOVH movsd
+%else
+%define MOVH movlps
+%endif
+ shl strided, 3
+ shl nd, 6
+ add filterq, nq
+ neg nq
+ mova m7, [ps_p1m1p1m1]
+
+align 16
+.loop:
+ PS_HYBRID_ANALYSIS_LOOP m0, m3, 0
+ PS_HYBRID_ANALYSIS_LOOP m5, m6, 1
+ PS_HYBRID_ANALYSIS_LOOP m5, m6, 2
+
+%if cpuflag(sse3)
+ pshufd m3, m3, q2301
+ xorps m0, m7
+ hsubps m3, m0
+ pshufd m1, m3, q0020
+ pshufd m3, m3, q0031
+ addps m1, m3
+ movsd m2, [inq+6*8]
+%else
+ mova m1, m3
+ mova m2, m0
+ shufps m1, m1, q2301
+ shufps m2, m2, q2301
+ subps m1, m3
+ addps m2, m0
+ unpcklps m3, m1, m2
+ unpckhps m1, m2
+ addps m1, m3
+ movu m2, [inq+6*8] ; faster than movlps and no risk of overread
+%endif
+ movss m3, [filterq+nq+8*6]
+ SPLATD m3
+ mulps m2, m3
+ addps m1, m2
+ MOVH [outq], m1
+ add outq, strideq
+ add nq, 64
+ jl .loop
+ REP_RET
+%endmacro
+
+INIT_XMM sse
+PS_HYBRID_ANALYSIS
+INIT_XMM sse3
+PS_HYBRID_ANALYSIS
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp_init.c
new file mode 100644
index 00000000000..f6d6c039c3f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/aacpsdsp_init.c
@@ -0,0 +1,55 @@
+/*
+ * SIMD optimized MPEG-4 Parametric Stereo decoding functions
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+
+#include "libavutil/x86/cpu.h"
+#include "libavutil/attributes.h"
+#include "libavcodec/aacpsdsp.h"
+
+void ff_ps_add_squares_sse (float *dst, const float (*src)[2], int n);
+void ff_ps_add_squares_sse3 (float *dst, const float (*src)[2], int n);
+void ff_ps_mul_pair_single_sse (float (*dst)[2], float (*src0)[2],
+ float *src1, int n);
+void ff_ps_hybrid_analysis_sse (float (*out)[2], float (*in)[2],
+ const float (*filter)[8][2],
+ int stride, int n);
+void ff_ps_hybrid_analysis_sse3(float (*out)[2], float (*in)[2],
+ const float (*filter)[8][2],
+ int stride, int n);
+void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2],
+ float h[2][4], float h_step[2][4],
+ int len);
+
+av_cold void ff_psdsp_init_x86(PSDSPContext *s)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE(cpu_flags)) {
+ s->add_squares = ff_ps_add_squares_sse;
+ s->mul_pair_single = ff_ps_mul_pair_single_sse;
+ s->hybrid_analysis = ff_ps_hybrid_analysis_sse;
+ }
+ if (EXTERNAL_SSE3(cpu_flags)) {
+ s->add_squares = ff_ps_add_squares_sse3;
+ s->stereo_interpolate[0] = ff_ps_stereo_interpolate_sse3;
+ s->hybrid_analysis = ff_ps_hybrid_analysis_sse3;
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/audiodsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/audiodsp.asm
index 273b9ef6602..3ffb27fcf93 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/audiodsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/audiodsp.asm
@@ -21,7 +21,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
%macro SCALARPRODUCT 0
; int ff_scalarproduct_int16(int16_t *v1, int16_t *v2, int order)
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c
index 885cdf1d8cd..26e072bb12a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c
@@ -162,6 +162,8 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
if (!w || !h)
return;
+ av_assert2(block_w <= FFABS(dst_stride));
+
if (src_y >= h) {
src -= src_y*src_stride;
src_y_add = h - 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp.asm
index c7938588615..7cbfa3a843b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp.asm
@@ -23,7 +23,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
;----------------------------------------
; void ff_clear_block(int16_t *blocks);
@@ -64,7 +64,7 @@ cglobal clear_blocks, 1, 2, %1, blocks, len
add blocksq, 768
mov lenq, -768
ZERO m0, m0
-.loop
+.loop:
mova [blocksq+lenq+mmsize*0], m0
mova [blocksq+lenq+mmsize*1], m0
mova [blocksq+lenq+mmsize*2], m0
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp_init.c
index 7780184af68..825e29f9d28 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/blockdsp_init.c
@@ -31,12 +31,8 @@ void ff_clear_block_sse(int16_t *block);
void ff_clear_blocks_mmx(int16_t *blocks);
void ff_clear_blocks_sse(int16_t *blocks);
-#if FF_API_XVMC
av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
AVCodecContext *avctx)
-#else
-av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth)
-#endif /* FF_API_XVMC */
{
#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/bswapdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/bswapdsp.asm
index ec060c93b6e..56d80836227 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/bswapdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/bswapdsp.asm
@@ -28,12 +28,12 @@ pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
cextern pb_80
-SECTION_TEXT
+SECTION .text
; %1 = aligned/unaligned
%macro BSWAP_LOOPS 1
- mov r3, r2
- sar r2, 3
+ mov r3d, r2d
+ sar r2d, 3
jz .left4_%1
.loop8_%1:
mov%1 m0, [r1 + 0]
@@ -61,11 +61,11 @@ SECTION_TEXT
%endif
add r0, 32
add r1, 32
- dec r2
+ dec r2d
jnz .loop8_%1
.left4_%1:
- mov r2, r3
- and r3, 4
+ mov r2d, r3d
+ test r3d, 4
jz .left
mov%1 m0, [r1]
%if cpuflag(ssse3)
@@ -95,7 +95,7 @@ cglobal bswap32_buf, 3,4,5
mov r3, r1
%endif
or r3, r0
- and r3, 15
+ test r3, 15
jz .start_align
BSWAP_LOOPS u
jmp .left
@@ -103,8 +103,7 @@ cglobal bswap32_buf, 3,4,5
BSWAP_LOOPS a
.left:
%if cpuflag(ssse3)
- mov r3, r2
- and r2, 2
+ test r2d, 2
jz .left1
movq m0, [r1]
pshufb m0, m2
@@ -112,13 +111,13 @@ cglobal bswap32_buf, 3,4,5
add r1, 8
add r0, 8
.left1:
- and r3, 1
+ test r2d, 1
jz .end
mov r2d, [r1]
bswap r2d
mov [r0], r2d
%else
- and r2, 3
+ and r2d, 3
jz .end
.loop2:
mov r3d, [r1]
@@ -126,7 +125,7 @@ cglobal bswap32_buf, 3,4,5
mov [r0], r3d
add r1, 4
add r0, 4
- dec r2
+ dec r2d
jnz .loop2
%endif
.end:
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm
index 1ac237885a2..548cec10b12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dcadsp.asm
@@ -24,7 +24,7 @@
SECTION_RODATA
pf_inv16: times 4 dd 0x3D800000 ; 1/16
-SECTION_TEXT
+SECTION .text
; void decode_hf(float dst[DCA_SUBBANDS][8], const int32_t vq_num[DCA_SUBBANDS],
; const int8_t hf_vq[1024][32], intptr_t vq_offset,
@@ -333,7 +333,7 @@ cglobal synth_filter_inner, 0, 6 + 4 * ARCH_X86_64, 7 + 6 * ARCH_X86_64, \
%if ARCH_X86_32
mov buf2, synth_buf2mp
%endif
-.mainloop
+.mainloop:
; m1 = a m2 = b m3 = c m4 = d
SETZERO m3
SETZERO m4
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dct32.asm b/chromium/third_party/ffmpeg/libavcodec/x86/dct32.asm
index c70f6c9c492..4e657b54605 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dct32.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dct32.asm
@@ -191,7 +191,7 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000
%endmacro
INIT_YMM avx
-SECTION_TEXT
+SECTION .text
%if HAVE_AVX_EXTERNAL
; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in)
cglobal dct32_float, 2,3,8, out, in, tmp
@@ -488,5 +488,6 @@ cglobal dct32_float, 2, 3, 16, out, in, tmp
INIT_XMM sse
DCT32_FUNC
%endif
+
INIT_XMM sse2
DCT32_FUNC
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/dct_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/dct_init.c
index daf2bb4e5d2..c31ef92238b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/dct_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/dct_init.c
@@ -30,8 +30,10 @@ av_cold void ff_dct_init_x86(DCTContext *s)
{
int cpu_flags = av_get_cpu_flags();
- if (ARCH_X86_32 && EXTERNAL_SSE(cpu_flags))
+#if ARCH_X86_32
+ if (EXTERNAL_SSE(cpu_flags))
s->dct32 = ff_dct32_float_sse;
+#endif
if (EXTERNAL_SSE2(cpu_flags))
s->dct32 = ff_dct32_float_sse2;
if (EXTERNAL_AVX_FAST(cpu_flags))
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm b/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm
deleted file mode 100644
index c421385fbb0..00000000000
--- a/chromium/third_party/ffmpeg/libavcodec/x86/deinterlace.asm
+++ /dev/null
@@ -1,84 +0,0 @@
-;******************************************************************************
-;* SIMD-optimized deinterlacing functions
-;* Copyright (c) 2010 Vitor Sessak
-;* Copyright (c) 2002 Michael Niedermayer
-;*
-;* This file is part of FFmpeg.
-;*
-;* FFmpeg is free software; you can redistribute it and/or
-;* modify it under the terms of the GNU Lesser General Public
-;* License as published by the Free Software Foundation; either
-;* version 2.1 of the License, or (at your option) any later version.
-;*
-;* FFmpeg is distributed in the hope that it will be useful,
-;* but WITHOUT ANY WARRANTY; without even the implied warranty of
-;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;* Lesser General Public License for more details.
-;*
-;* You should have received a copy of the GNU Lesser General Public
-;* License along with FFmpeg; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-cextern pw_4
-
-SECTION .text
-
-%macro DEINTERLACE 1
-%ifidn %1, inplace
-;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
-cglobal deinterlace_line_inplace, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
-%else
-;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
-cglobal deinterlace_line, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
-%endif
- pxor mm7, mm7
- movq mm6, [pw_4]
-.nextrow:
- movd mm0, [lum_m4q]
- movd mm1, [lum_m3q]
- movd mm2, [lum_m2q]
-%ifidn %1, inplace
- movd [lum_m4q], mm2
-%endif
- movd mm3, [lum_m1q]
- movd mm4, [lumq]
- punpcklbw mm0, mm7
- punpcklbw mm1, mm7
- punpcklbw mm2, mm7
- punpcklbw mm3, mm7
- punpcklbw mm4, mm7
- paddw mm1, mm3
- psllw mm2, 1
- paddw mm0, mm4
- psllw mm1, 2
- paddw mm2, mm6
- paddw mm1, mm2
- psubusw mm1, mm0
- psrlw mm1, 3
- packuswb mm1, mm7
-%ifidn %1, inplace
- movd [lum_m2q], mm1
-%else
- movd [dstq], mm1
- add dstq, 4
-%endif
- add lum_m4q, 4
- add lum_m3q, 4
- add lum_m2q, 4
- add lum_m1q, 4
- add lumq, 4
- sub sized, 4
- jg .nextrow
- REP_RET
-%endmacro
-
-INIT_MMX mmx
-
-DEINTERLACE ""
-
-DEINTERLACE inplace
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/diracdsp_yasm.asm b/chromium/third_party/ffmpeg/libavcodec/x86/diracdsp_yasm.asm
index d3cf9f19711..40fe2c82123 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/diracdsp_yasm.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/diracdsp_yasm.asm
@@ -149,7 +149,7 @@ cglobal put_signed_rect_clamped_%1, 5,9,3, dst, dst_stride, src, src_stride, w,
%define hd r5mp
%endif
-.loopy
+.loopy:
lea src2q, [srcq+src_strideq*2]
lea dst2q, [dstq+dst_strideq]
.loopx:
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fft.asm b/chromium/third_party/ffmpeg/libavcodec/x86/fft.asm
index f233774f1db..22d9866665d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fft.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fft.asm
@@ -90,7 +90,7 @@ cextern cos_ %+ i
%1
%endmacro
-SECTION_TEXT
+SECTION .text
%macro T2_3DNOW 4 ; z0, z1, mem0, mem1
mova %1, %3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/flac_dsp_gpl.asm b/chromium/third_party/ffmpeg/libavcodec/x86/flac_dsp_gpl.asm
index cedf0837a71..e2851581856 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/flac_dsp_gpl.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/flac_dsp_gpl.asm
@@ -22,7 +22,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
INIT_XMM sse4
%if ARCH_X86_64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm
index 901c440ccdf..71386115267 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/flacdsp.asm
@@ -25,6 +25,15 @@
SECTION .text
+%macro PMACSDQL 5
+%if cpuflag(xop)
+ pmacsdql %1, %2, %3, %1
+%else
+ pmuldq %2, %3
+ paddq %1, %2
+%endif
+%endmacro
+
%macro LPC_32 1
INIT_XMM %1
cglobal flac_lpc_32, 5,6,5, decoded, coeffs, pred_order, qlevel, len, j
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm b/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
index f4fc0c20ef7..20d8315fd99 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/fmtconvert.asm
@@ -21,7 +21,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
;------------------------------------------------------------------------------
; void ff_int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul,
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/g722dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/g722dsp.asm
index 807a1bdd0aa..a5294222620 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/g722dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/g722dsp.asm
@@ -29,7 +29,7 @@ pw_qmf_coeffs2: dw 12, 3876, -156, 951, 32, -805, 362, -210
pw_qmf_coeffs3: dw 362, 0 , 32, 0, -156, 0, 12, 0
pw_qmf_coeffs4: dw 53, 0, -11, 0, -11, 0, 3, 0
-SECTION_TEXT
+SECTION .text
INIT_XMM sse2
cglobal g722_apply_qmf, 2, 2, 5, prev, out
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
index 2fcd1a26e54..77c8cf154d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h263_loopfilter.asm
@@ -26,7 +26,7 @@ SECTION_RODATA
cextern pb_FC
cextern h263_loop_filter_strength
-SECTION_TEXT
+SECTION .text
%macro H263_LOOP_FILTER 5
pxor m7, m7
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
index 14c8205babe..5151f3c9cd3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_deblock.asm
@@ -446,13 +446,13 @@ cglobal deblock_%1_luma_8, 5,5,8,2*%2
; int8_t *tc0)
;-----------------------------------------------------------------------------
INIT_MMX cpuname
-cglobal deblock_h_luma_8, 0,5,8,0x60+HAVE_ALIGNED_STACK*12
+cglobal deblock_h_luma_8, 0,5,8,0x60+12
mov r0, r0mp
mov r3, r1m
lea r4, [r3*3]
sub r0, 4
lea r1, [r0+r4]
-%define pix_tmp esp+12*HAVE_ALIGNED_STACK
+%define pix_tmp esp+12
; transpose 6x16 -> tmp space
TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
index 757c425898f..7e9be36f279 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm
@@ -386,7 +386,7 @@ MC_CACHE MC10
; void ff_h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
;-----------------------------------------------------------------------------
%macro V_FILT 10
-v_filt%9_%10_10
+v_filt%9_%10_10:
add r4, r2
.no_addr4:
FILT_V m0, m1, m2, m3, m4, m5, m6, m7
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
index 897c616a815..6c57d57bc0d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/h264_weight.asm
@@ -139,12 +139,12 @@ WEIGHT_FUNC_HALF_MM 8, 8
je .nonnormal
cmp r5, 128
jne .normal
-.nonnormal
+.nonnormal:
sar r5, 1
sar r6, 1
sar off_regd, 1
sub r4, 1
-.normal
+.normal:
%if cpuflag(ssse3)
movd m4, r5d
movd m0, r6d
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_idct.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_idct.asm
index 481726d2170..2edaf9aef15 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_idct.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_idct.asm
@@ -21,7 +21,7 @@
; */
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT 32
+SECTION .text
; void ff_hevc_idctHxW_dc_{8,10}_<opt>(int16_t *coeffs)
; %1 = HxW
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm
index 986493f20c8..ff6ed0711a2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_mc.asm
@@ -40,7 +40,6 @@ max_pixels_12: times 16 dw ((1 << 12)-1)
cextern pd_1
cextern pb_0
-SECTION_TEXT 32
%macro EPEL_TABLE 4
hevc_epel_filters_%4_%1 times %2 d%3 -2, 58
times %2 d%3 10, -2
@@ -88,6 +87,8 @@ QPEL_TABLE 12, 4, w, sse4
QPEL_TABLE 8,16, b, avx2
QPEL_TABLE 10, 8, w, avx2
+SECTION .text
+
%define MAX_PB_SIZE 64
%define hevc_qpel_filters_sse4_14 hevc_qpel_filters_sse4_10
@@ -683,7 +684,7 @@ HEVC_BI_PEL_PIXELS %1, %2
%macro HEVC_PEL_PIXELS 2
cglobal hevc_put_hevc_pel_pixels%1_%2, 4, 4, 3, dst, src, srcstride,height
pxor m2, m2
-.loop
+.loop:
SIMPLE_LOAD %1, %2, srcq, m0
MC_PIXEL_COMPUTE %1, %2, 1
PEL_10STORE%1 dstq, m0, m1
@@ -693,7 +694,7 @@ cglobal hevc_put_hevc_pel_pixels%1_%2, 4, 4, 3, dst, src, srcstride,height
%macro HEVC_UNI_PEL_PIXELS 2
cglobal hevc_put_hevc_uni_pel_pixels%1_%2, 5, 5, 2, dst, dststride, src, srcstride,height
-.loop
+.loop:
SIMPLE_LOAD %1, %2, srcq, m0
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
@@ -707,7 +708,7 @@ cglobal hevc_put_hevc_uni_pel_pixels%1_%2, 5, 5, 2, dst, dststride, src, srcstri
cglobal hevc_put_hevc_bi_pel_pixels%1_%2, 6, 6, 6, dst, dststride, src, srcstride, src2, height
pxor m2, m2
movdqa m5, [pw_bi_%2]
-.loop
+.loop:
SIMPLE_LOAD %1, %2, srcq, m0
SIMPLE_BILOAD %1, src2q, m3, m4
MC_PIXEL_COMPUTE %1, %2, 1
@@ -739,7 +740,7 @@ cglobal hevc_put_hevc_bi_pel_pixels%1_%2, 6, 6, 6, dst, dststride, src, srcstrid
cglobal hevc_put_hevc_epel_h%1_%2, 5, 6, XMM_REGS, dst, src, srcstride, height, mx, rfilter
%assign %%stride ((%2 + 7)/8)
EPEL_FILTER %2, mx, m4, m5, rfilter
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
PEL_10STORE%1 dstq, m0, m1
@@ -750,7 +751,7 @@ cglobal hevc_put_hevc_uni_epel_h%1_%2, 6, 7, XMM_REGS, dst, dststride, src, srcs
%assign %%stride ((%2 + 7)/8)
movdqa m6, [pw_%2]
EPEL_FILTER %2, mx, m4, m5, rfilter
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5
UNI_COMPUTE %1, %2, m0, m1, m6
@@ -764,7 +765,7 @@ cglobal hevc_put_hevc_uni_epel_h%1_%2, 6, 7, XMM_REGS, dst, dststride, src, srcs
cglobal hevc_put_hevc_bi_epel_h%1_%2, 7, 8, XMM_REGS, dst, dststride, src, srcstride, src2, height, mx, rfilter
movdqa m6, [pw_bi_%2]
EPEL_FILTER %2, mx, m4, m5, rfilter
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
SIMPLE_BILOAD %1, src2q, m2, m3
@@ -788,7 +789,7 @@ cglobal hevc_put_hevc_epel_v%1_%2, 4, 6, XMM_REGS, dst, src, srcstride, height,
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
-.loop
+.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
PEL_10STORE%1 dstq, m0, m1
@@ -801,7 +802,7 @@ cglobal hevc_put_hevc_uni_epel_v%1_%2, 5, 7, XMM_REGS, dst, dststride, src, srcs
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
-.loop
+.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5
UNI_COMPUTE %1, %2, m0, m1, m6
@@ -819,7 +820,7 @@ cglobal hevc_put_hevc_bi_epel_v%1_%2, 6, 8, XMM_REGS, dst, dststride, src, srcst
sub srcq, srcstrideq
EPEL_FILTER %2, my, m4, m5, r3src
lea r3srcq, [srcstrideq*3]
-.loop
+.loop:
EPEL_LOAD %2, srcq, srcstride, %1
EPEL_COMPUTE %2, %1, m4, m5, 1
SIMPLE_BILOAD %1, src2q, m2, m3
@@ -866,7 +867,7 @@ cglobal hevc_put_hevc_epel_hv%1_%2, 6, 7, 16 , dst, src, srcstride, height, mx,
%endif
SWAP m6, m0
add srcq, srcstrideq
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
@@ -932,7 +933,7 @@ cglobal hevc_put_hevc_uni_epel_hv%1_%2, 7, 8, 16 , dst, dststride, src, srcstrid
%endif
SWAP m6, m0
add srcq, srcstrideq
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
@@ -996,7 +997,7 @@ cglobal hevc_put_hevc_bi_epel_hv%1_%2, 8, 9, 16, dst, dststride, src, srcstride,
%endif
SWAP m6, m0
add srcq, srcstrideq
-.loop
+.loop:
EPEL_LOAD %2, srcq-%%stride, %%stride, %1
EPEL_COMPUTE %2, %1, m14, m15
%if (%1 > 8 && (%2 == 8))
@@ -1054,7 +1055,7 @@ cglobal hevc_put_hevc_bi_epel_hv%1_%2, 8, 9, 16, dst, dststride, src, srcstride,
%macro HEVC_PUT_HEVC_QPEL 2
cglobal hevc_put_hevc_qpel_h%1_%2, 5, 6, 16, dst, src, srcstride, height, mx, rfilter
QPEL_FILTER %2, mx
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
@@ -1067,7 +1068,7 @@ cglobal hevc_put_hevc_qpel_h%1_%2, 5, 6, 16, dst, src, srcstride, height, mx, rf
cglobal hevc_put_hevc_uni_qpel_h%1_%2, 6, 7, 16 , dst, dststride, src, srcstride, height, mx, rfilter
mova m9, [pw_%2]
QPEL_FILTER %2, mx
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2
%if %2 > 8
@@ -1084,7 +1085,7 @@ cglobal hevc_put_hevc_uni_qpel_h%1_%2, 6, 7, 16 , dst, dststride, src, srcstride
cglobal hevc_put_hevc_bi_qpel_h%1_%2, 7, 8, 16 , dst, dststride, src, srcstride, src2, height, mx, rfilter
movdqa m9, [pw_bi_%2]
QPEL_FILTER %2, mx
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 10
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
@@ -1111,7 +1112,7 @@ cglobal hevc_put_hevc_qpel_v%1_%2, 4, 8, 16, dst, src, srcstride, height, r3src,
movifnidn myd, mym
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
-.loop
+.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r7
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
@@ -1126,7 +1127,7 @@ cglobal hevc_put_hevc_uni_qpel_v%1_%2, 5, 9, 16, dst, dststride, src, srcstride,
movdqa m9, [pw_%2]
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
-.loop
+.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r8
QPEL_COMPUTE %1, %2
%if %2 > 8
@@ -1145,7 +1146,7 @@ cglobal hevc_put_hevc_bi_qpel_v%1_%2, 6, 10, 16, dst, dststride, src, srcstride,
movdqa m9, [pw_bi_%2]
lea r3srcq, [srcstrideq*3]
QPEL_FILTER %2, my
-.loop
+.loop:
QPEL_V_LOAD %2, srcq, srcstride, %1, r9
QPEL_COMPUTE %1, %2, 1
%if %2 > 8
@@ -1209,7 +1210,7 @@ cglobal hevc_put_hevc_qpel_hv%1_%2, 6, 8, 16, dst, src, srcstride, height, mx, m
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
@@ -1285,7 +1286,7 @@ cglobal hevc_put_hevc_uni_qpel_hv%1_%2, 7, 9, 16 , dst, dststride, src, srcstrid
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
@@ -1366,7 +1367,7 @@ cglobal hevc_put_hevc_bi_qpel_hv%1_%2, 8, 10, 16, dst, dststride, src, srcstride
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m14, m0
add srcq, srcstrideq
-.loop
+.loop:
QPEL_H_LOAD %2, srcq, %1, 15
QPEL_HV_COMPUTE %1, %2, mx, ackssdw
SWAP m15, m0
@@ -1444,7 +1445,7 @@ cglobal hevc_put_hevc_uni_w%1_%2, 6, 6, 7, dst, dststride, src, height, denom, w
%if WIN64 || ARCH_X86_32
mov SHIFT, heightm
%endif
-.loop
+.loop:
SIMPLE_LOAD %1, 10, srcq, m0
%if %1 <= 4
punpcklwd m0, m1
@@ -1513,7 +1514,7 @@ cglobal hevc_put_hevc_bi_w%1_%2, 4, 6, 10, dst, dststride, src, src2, height, de
%endif
pslld m4, m0
-.loop
+.loop:
SIMPLE_LOAD %1, 10, srcq, m0
SIMPLE_LOAD %1, 10, src2q, m8
%if %1 <= 4
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_sao.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_sao.asm
index 86ef847ba2c..fa45a241e1d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hevc_sao.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hevc_sao.asm
@@ -36,10 +36,10 @@ cextern pw_2
cextern pb_1
cextern pb_2
-SECTION_TEXT
+SECTION .text
%define MAX_PB_SIZE 64
-%define PADDING_SIZE 32 ; FF_INPUT_BUFFER_PADDING_SIZE
+%define PADDING_SIZE 32 ; AV_INPUT_BUFFER_PADDING_SIZE
;******************************************************************************
;SAO Band Filter
@@ -141,7 +141,7 @@ cglobal hevc_sao_band_filter_%1_8, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dst
HEVC_SAO_BAND_FILTER_INIT 8
align 16
-.loop
+.loop:
%if %1 == 8
movq m8, [srcq]
punpcklbw m8, m14
@@ -191,7 +191,7 @@ cglobal hevc_sao_band_filter_%2_%1, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, ds
HEVC_SAO_BAND_FILTER_INIT %1
align 16
-.loop
+.loop:
%if %2 == 8
movu m8, [srcq]
HEVC_SAO_BAND_FILTER_COMPUTE %1, m9, m8
@@ -528,7 +528,7 @@ cglobal hevc_sao_edge_filter_%2_%1, 1, 6, 8, 5*mmsize, dst, src, dststride, a_st
%endif
align 16
-.loop
+.loop:
%if %2 == 8
mova m1, [srcq]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
index 2cef8e698c9..82fb8934af2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm
@@ -35,7 +35,7 @@ pb_interleave8: db 0, 4, 1, 5, 2, 6, 3, 7
cextern pw_8192
-SECTION_TEXT
+SECTION .text
; void ff_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
%macro PUT_PIXELS8_X2 0
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
index 8c0a0e9ab32..147999202ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c
@@ -230,7 +230,7 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags, int cpu_flags)
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_mmxext;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_mmxext;
- if (!(flags & CODEC_FLAG_BITEXACT)) {
+ if (!(flags & AV_CODEC_FLAG_BITEXACT)) {
c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmxext;
c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmxext;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_mmxext;
@@ -240,7 +240,7 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags, int cpu_flags)
c->avg_pixels_tab[1][3] = ff_avg_approx_pixels8_xy2_mmxext;
}
- if (CONFIG_VP3_DECODER && flags & CODEC_FLAG_BITEXACT) {
+ if (CONFIG_VP3_DECODER && flags & AV_CODEC_FLAG_BITEXACT) {
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
}
@@ -266,7 +266,7 @@ static void hpeldsp_init_3dnow(HpelDSPContext *c, int flags, int cpu_flags)
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_3dnow;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_3dnow;
- if (!(flags & CODEC_FLAG_BITEXACT)){
+ if (!(flags & AV_CODEC_FLAG_BITEXACT)){
c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow;
c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_3dnow;
@@ -276,7 +276,7 @@ static void hpeldsp_init_3dnow(HpelDSPContext *c, int flags, int cpu_flags)
c->avg_pixels_tab[1][3] = ff_avg_approx_pixels8_xy2_3dnow;
}
- if (CONFIG_VP3_DECODER && flags & CODEC_FLAG_BITEXACT) {
+ if (CONFIG_VP3_DECODER && flags & AV_CODEC_FLAG_BITEXACT) {
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_3dnow;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_3dnow;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/huffyuvdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/huffyuvdsp.asm
index 85ee56dff2d..0dbe5984218 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/huffyuvdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/huffyuvdsp.asm
@@ -29,7 +29,7 @@ pb_7: times 8 db 7
pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11
pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13
-SECTION_TEXT
+SECTION .text
; void ff_add_hfyu_median_pred_mmxext(uint8_t *dst, const uint8_t *top,
; const uint8_t *diff, int w,
@@ -196,7 +196,7 @@ cglobal add_bytes, 3,4,2, dst, src, w, size
add dstq, wq
add srcq, wq
neg wq
-.3
+.3:
mov sizeb, [srcq + wq]
add [dstq + wq], sizeb
inc wq
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/idctdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/idctdsp.asm
index 0aa73459e23..089425a9ab0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/idctdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/idctdsp.asm
@@ -27,7 +27,7 @@ SECTION_RODATA
cextern pb_80
-SECTION_TEXT
+SECTION .text
;--------------------------------------------------------------------------
;void ff_put_signed_pixels_clamped(const int16_t *block, uint8_t *pixels,
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm b/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
index ce30b421036..7218f06ba57 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/imdct36.asm
@@ -72,7 +72,7 @@ costabs: times 4 dd 0.98480773
times 4 dd 5.73685646
%define SBLIMIT 32
-SECTION_TEXT
+SECTION .text
%macro PSHUFD 3
%if cpuflag(sse2) && notcpuflag(avx)
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/jpeg2000dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/jpeg2000dsp.asm
index 712a298610d..56b5fbd6064 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/jpeg2000dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/jpeg2000dsp.asm
@@ -69,7 +69,7 @@ cglobal ict_float, 4, 4, %1, src0, src1, src2, csize
%endif ; ARCH
align 16
-.loop
+.loop:
movaps m0, [src0q+csizeq]
movaps m1, [src1q+csizeq]
movaps m2, [src2q+csizeq]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_audiodsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_audiodsp.asm
index 64b769f7d4f..5597dadab47 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_audiodsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_audiodsp.asm
@@ -20,7 +20,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
%macro SCALARPRODUCT 0
; int ff_scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3,
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm
index e6c23e79857..f06fcdf7cfb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp.asm
@@ -29,7 +29,7 @@ pb_67: times 8 db 6, 7
pb_zzzz2323zzzzabab: db -1,-1,-1,-1, 2, 3, 2, 3,-1,-1,-1,-1,10,11,10,11
pb_zzzzzzzz67676767: db -1,-1,-1,-1,-1,-1,-1,-1, 6, 7, 6, 7, 6, 7, 6, 7
-SECTION_TEXT
+SECTION .text
%macro INT16_LOOP 2 ; %1 = a/u (aligned/unaligned), %2 = add/sub
movd m4, maskd
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c
index 6589024a1a2..b0fbcfef8f8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/lossless_videodsp_init.c
@@ -42,7 +42,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c, AVCodecContext *avctx)
c->diff_int16 = ff_diff_int16_mmx;
}
- if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc->comp[0].depth_minus1<15) {
+ if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc->comp[0].depth<16) {
c->add_hfyu_median_pred_int16 = ff_add_hfyu_median_pred_int16_mmxext;
c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp.asm
index 0160dc348f1..ad06d485abe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp.asm
@@ -794,7 +794,7 @@ cglobal vsad_intra%1, 5, 5, 3, v, pix1, pix2, lsize, h
%endif
sub hd, 2
-.loop
+.loop:
lea pix1q, [pix1q + 2*lsizeq]
%if %1 == mmsize
mova m1, [pix1q]
@@ -875,7 +875,7 @@ cglobal vsad%1_approx, 5, 5, 5, v, pix1, pix2, lsize, h
%endif
sub hd, 2
-.loop
+.loop:
lea pix1q, [pix1q + 2*lsizeq]
lea pix2q, [pix2q + 2*lsizeq]
mova m2, [pix1q]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp_init.c
index 255df5065d6..49f50d0eed8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/me_cmp_init.c
@@ -573,7 +573,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
c->vsad[4] = vsad_intra16_mmx;
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->vsad[0] = vsad16_mmx;
}
}
@@ -610,7 +610,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
c->vsad[4] = ff_vsad_intra16_mmxext;
c->vsad[5] = ff_vsad_intra8_mmxext;
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->pix_abs[0][3] = ff_sad16_approx_xy2_mmxext;
c->pix_abs[1][3] = ff_sad8_approx_xy2_mmxext;
@@ -634,7 +634,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
c->pix_abs[0][2] = ff_sad16_y2_sse2;
c->vsad[4] = ff_vsad_intra16_sse2;
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->pix_abs[0][3] = ff_sad16_approx_xy2_sse2;
c->vsad[0] = ff_vsad16_approx_sse2;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.asm
index ce656af1451..3dc641e89e7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mlpdsp.asm
@@ -21,7 +21,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
%if ARCH_X86_64
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
index 27231674ae7..298dc2dbdaa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c
@@ -30,6 +30,7 @@
static void imdct36_blocks_ ## CPU(float *out, float *buf, float *in, int count, int switch_point, int block_type);\
void ff_imdct36_float_ ## CPU(float *out, float *buf, float *in, float *win);
+#if HAVE_YASM
#if ARCH_X86_32
DECL(sse)
#endif
@@ -37,6 +38,7 @@ DECL(sse2)
DECL(sse3)
DECL(ssse3)
DECL(avx)
+#endif /* HAVE_YASM */
void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win,
float *tmpbuf);
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
index 133ae80a275..6027874d160 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideo.c
@@ -454,7 +454,7 @@ av_cold void ff_mpv_common_init_x86(MpegEncContext *s)
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_mmx;
- if (!(s->avctx->flags & CODEC_FLAG_BITEXACT))
+ if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT))
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c
index 2a4db615118..532836cec99 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c
@@ -242,7 +242,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
#if HAVE_INLINE_ASM
if (INLINE_MMX(cpu_flags)) {
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->try_8x8basis = try_8x8basis_mmx;
}
c->add_8x8basis = add_8x8basis_mmx;
@@ -253,7 +253,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
}
if (INLINE_AMD3DNOW(cpu_flags)) {
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->try_8x8basis = try_8x8basis_3dnow;
}
c->add_8x8basis = add_8x8basis_3dnow;
@@ -261,7 +261,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
#if HAVE_SSSE3_INLINE
if (INLINE_SSSE3(cpu_flags)) {
- if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+ if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
c->try_8x8basis = try_8x8basis_ssse3;
}
c->add_8x8basis = add_8x8basis_ssse3;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/pngdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/pngdsp.asm
index 7bd1ab5c077..50e4255dec0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/pngdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/pngdsp.asm
@@ -27,7 +27,7 @@ SECTION_RODATA
cextern pw_255
-SECTION_TEXT
+SECTION .text
; %1 = nr. of xmm registers used
%macro ADD_BYTES_FN 1
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/qpeldsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/qpeldsp.asm
index dc0f900c5bd..282faed14f4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/qpeldsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/qpeldsp.asm
@@ -31,7 +31,7 @@ cextern pw_16
cextern pw_20
-SECTION_TEXT
+SECTION .text
; void ff_put_no_rnd_pixels8_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
%macro PUT_NO_RND_PIXELS8_L2 0
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
index 083461a1078..b6fa53517cb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/sbrdsp.asm
@@ -34,7 +34,7 @@ ps_noise13 dd 0.0, 1.0, 0.0, -1.0
cextern sbr_noise_table
cextern ps_neg
-SECTION_TEXT
+SECTION .text
INIT_XMM sse
cglobal sbr_sum_square, 2, 3, 6
@@ -382,6 +382,7 @@ apply_noise_main:
%else
%define count m_maxq
%endif
+ movsxdifnidn noiseq, noised
dec noiseq
shl count, 2
%ifdef PIC
@@ -515,42 +516,42 @@ align 16
jl .loop
movlhps m1, m1
- mulps m4, m1, m2
+ mulps m2, m1
mulps m1, m1
- addps m4, m6 ; real_sum1 + x[38][0] * x[39][0], x[38][1] * x[39][1]; imag_sum1 + x[38][0] * x[39][1], x[38][1] * x[39][0];
+ addps m2, m6 ; real_sum1 + x[38][0] * x[39][0], x[38][1] * x[39][1]; imag_sum1 + x[38][0] * x[39][1], x[38][1] * x[39][0];
addps m1, m7 ; real_sum0 + x[38][0] * x[38][0], x[38][1] * x[38][1];
addps m6, [rsp ] ; real_sum1 + x[ 0][0] * x[ 1][0], x[ 0][1] * x[ 1][1]; imag_sum1 + x[ 0][0] * x[ 1][1], x[ 0][1] * x[ 1][0];
addps m7, [rsp+16] ; real_sum0 + x[ 0][0] * x[ 0][0], x[ 0][1] * x[ 0][1];
- xorps m4, [ps_mask3]
+ xorps m2, [ps_mask3]
xorps m5, [ps_mask3]
xorps m6, [ps_mask3]
%if cpuflag(sse3)
- movshdup m2, m1
- haddps m4, m5
+ movshdup m0, m1
+ haddps m2, m5
haddps m7, m6
- addss m1, m2
+ addss m1, m0
%else
- movaps m3, m4
- movaps m2, m5
- movaps m0, m6
+ movaps m3, m2
+ movaps m0, m5
+ movaps m4, m6
shufps m3, m3, q0301
- shufps m2, m2, q0301
shufps m0, m0, q0301
- addps m4, m3
- addps m5, m2
- addps m6, m0
+ shufps m4, m4, q0301
+ addps m2, m3
+ addps m5, m0
+ addps m6, m4
- movss m2, m7
+ movss m0, m7
movss m3, m1
shufps m7, m7, q0001
shufps m1, m1, q0001
- addss m7, m2
+ addss m7, m0
addss m1, m3
- shufps m4, m5, q2020
+ shufps m2, m5, q2020
shufps m7, m6, q2020
%endif
- movaps [phiq ], m4
+ movaps [phiq ], m2
movhps [phiq+0x18], m7
movss [phiq+0x28], m7
movss [phiq+0x10], m1
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/svq1enc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/svq1enc.asm
index 24ee70f1082..a87632836da 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/svq1enc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/svq1enc.asm
@@ -21,12 +21,12 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
%macro SSD_INT8_VS_INT16 0
cglobal ssd_int8_vs_int16, 3, 3, 3, pix1, pix2, size
pxor m0, m0
-.loop
+.loop:
sub sizeq, 8
movq m1, [pix1q + sizeq]
mova m2, [pix2q + sizeq*2]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c b/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
index dfdfd2631b1..f579307aa04 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
@@ -27,9 +27,9 @@ extern void ff_v210_planar_unpack_aligned_avx(const uint32_t *src, uint16_t *y,
av_cold void ff_v210_x86_init(V210DecContext *s)
{
+#if HAVE_YASM
int cpu_flags = av_get_cpu_flags();
-#if HAVE_YASM
if (s->aligned_input) {
if (cpu_flags & AV_CPU_FLAG_SSSE3)
s->unpack_frame = ff_v210_planar_unpack_aligned_ssse3;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm b/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
index 400a1f3f9ef..c24c765e5bb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
@@ -45,7 +45,7 @@ cglobal v210_planar_unpack_%1, 5, 5, 7
mova m4, [v210_mask]
mova m5, [v210_luma_shuf]
mova m6, [v210_chroma_shuf]
-.loop
+.loop:
%ifidn %1, unaligned
movu m0, [r0]
%else
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/v210enc.asm b/chromium/third_party/ffmpeg/libavcodec/x86/v210enc.asm
index 751675fc5e9..859e2d94554 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/v210enc.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/v210enc.asm
@@ -60,7 +60,7 @@ cglobal v210_planar_pack_10, 5, 5, 4, y, u, v, dst, width
mova m2, [v210_enc_min_10]
mova m3, [v210_enc_max_10]
-.loop
+.loop:
movu m0, [yq+2*widthq]
CLIPW m0, m2, m3
@@ -102,7 +102,7 @@ cglobal v210_planar_pack_8, 5, 5, 7, y, u, v, dst, width
mova m5, [v210_enc_max_8]
pxor m6, m6
-.loop
+.loop:
movu m1, [yq+2*widthq]
CLIPUB m1, m4, m5
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
index 885cdf1d8cd..26e072bb12a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/videodsp_init.c
@@ -162,6 +162,8 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
if (!w || !h)
return;
+ av_assert2(block_w <= FFABS(dst_stride));
+
if (src_y >= h) {
src -= src_y*src_stride;
src_y_add = h - 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp.asm
index ee5a6bf67aa..d457cd7de50 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp.asm
@@ -167,7 +167,7 @@ INIT_MMX mmx
cglobal put_vp_no_rnd_pixels8_l2, 5, 6, 0, dst, src1, src2, stride, h, stride3
mova m6, [pb_FE]
lea stride3q,[strideq+strideq*2]
-.loop
+.loop:
mova m0, [src1q]
mova m1, [src2q]
mova m2, [src1q+strideq]
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
index 354e1a1944d..2ece9ab7d54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp3dsp_init.c
@@ -59,7 +59,7 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
if (EXTERNAL_MMXEXT(cpu_flags)) {
c->idct_dc_add = ff_vp3_idct_dc_add_mmxext;
- if (!(flags & CODEC_FLAG_BITEXACT)) {
+ if (!(flags & AV_CODEC_FLAG_BITEXACT)) {
c->v_loop_filter = ff_vp3_v_loop_filter_mmxext;
c->h_loop_filter = ff_vp3_h_loop_filter_mmxext;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c b/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
index 00e7125a0c2..f24cb674fa5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9dsp_init.c
@@ -307,7 +307,7 @@ ipred_func(32, tm, avx2);
#endif /* HAVE_YASM */
-av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp)
+av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact)
{
#if HAVE_YASM
int cpu_flags;
@@ -388,10 +388,12 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp)
if (EXTERNAL_MMX(cpu_flags)) {
init_fpel(4, 0, 4, put, mmx);
init_fpel(3, 0, 8, put, mmx);
- dsp->itxfm_add[4 /* lossless */][DCT_DCT] =
- dsp->itxfm_add[4 /* lossless */][ADST_DCT] =
- dsp->itxfm_add[4 /* lossless */][DCT_ADST] =
- dsp->itxfm_add[4 /* lossless */][ADST_ADST] = ff_vp9_iwht_iwht_4x4_add_mmx;
+ if (!bitexact) {
+ dsp->itxfm_add[4 /* lossless */][DCT_DCT] =
+ dsp->itxfm_add[4 /* lossless */][ADST_DCT] =
+ dsp->itxfm_add[4 /* lossless */][DCT_ADST] =
+ dsp->itxfm_add[4 /* lossless */][ADST_ADST] = ff_vp9_iwht_iwht_4x4_add_mmx;
+ }
init_ipred(8, mmx, v, VERT);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm b/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
index d9fb36f710c..4d6a73cde93 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/vp9itxfm.asm
@@ -29,6 +29,7 @@ pw_11585x2: times 8 dw 23170
pw_m11585x2: times 8 dw -23170
pw_m11585_11585: times 4 dw -11585, 11585
pw_11585_11585: times 8 dw 11585
+pw_m11585_m11585: times 8 dw -11585
%macro VP9_IDCT_COEFFS 2-3 0
pw_%1x2: times 8 dw %1*2
@@ -66,7 +67,8 @@ pw_15212_m13377: times 4 dw 15212, -13377
pw_15212_9929: times 4 dw 15212, 9929
pw_m5283_m15212: times 4 dw -5283, -15212
pw_13377x2: times 8 dw 13377*2
-pw_13377_m13377: times 4 dw 13377, -13377
+pw_m13377_13377: times 4 dw -13377, 13377
+pw_13377_0: times 4 dw 13377, 0
pd_8192: times 4 dd 8192
@@ -356,21 +358,24 @@ IDCT_4x4_FN ssse3
movq2dq xmm3, m3
%if cpuflag(ssse3)
paddw m3, m0
-%else
- paddw xmm6, xmm3, xmm0
- punpcklwd xmm6, xmm2
%endif
punpcklwd xmm0, xmm1
punpcklwd xmm2, xmm3
pmaddwd xmm1, xmm0, [pw_5283_13377]
pmaddwd xmm4, xmm0, [pw_9929_13377]
+%if notcpuflag(ssse3)
+ pmaddwd xmm6, xmm0, [pw_13377_0]
+%endif
pmaddwd xmm0, [pw_15212_m13377]
pmaddwd xmm3, xmm2, [pw_15212_9929]
+%if notcpuflag(ssse3)
+ pmaddwd xmm7, xmm2, [pw_m13377_13377]
+%endif
pmaddwd xmm2, [pw_m5283_m15212]
%if cpuflag(ssse3)
psubw m3, m2
%else
- pmaddwd xmm6, [pw_13377_m13377]
+ paddd xmm6, xmm7
%endif
paddd xmm0, xmm2
paddd xmm3, xmm5
@@ -406,9 +411,9 @@ IDCT_4x4_FN ssse3
%macro IADST4_FN 5
INIT_MMX %5
-cglobal vp9_%1_%3_4x4_add, 3, 3, 6 + notcpuflag(ssse3), dst, stride, block, eob
+cglobal vp9_%1_%3_4x4_add, 3, 3, 0, dst, stride, block, eob
%if WIN64 && notcpuflag(ssse3)
-WIN64_SPILL_XMM 7
+ WIN64_SPILL_XMM 8
%endif
movdqa xmm5, [pd_8192]
mova m0, [blockq+ 0]
@@ -527,10 +532,9 @@ IADST4_FN iadst, IADST4, iadst, IADST4, ssse3
pmulhrsw m2, [pw_6270x2] ; m2=t2a
pmulhrsw m7, m1, [pw_16069x2] ; m7=t7a
pmulhrsw m1, [pw_3196x2] ; m1=t4a
- pmulhrsw m5, m3, [pw_9102x2] ; m5=-t5a
+ pmulhrsw m5, m3, [pw_m9102x2] ; m5=t5a
pmulhrsw m3, [pw_13623x2] ; m3=t6a
SUMSUB_BA w, 5, 1, 4 ; m1=t4a+t5a (t4), m5=t4a-t5a (t5a)
- SWAP 1, 5
SUMSUB_BA w, 3, 7, 4 ; m3=t7a+t6a (t7), m7=t7a-t6a (t6a)
SUMSUB_BA w, 1, 7, 4 ; m1=t6a+t5a (t6), m7=t6a-t5a (t5)
pmulhrsw m1, W_11585x2_REG ; m1=t6
@@ -969,18 +973,15 @@ cglobal vp9_%1_%3_8x8_add, 3, 3, %6, dst, stride, block, eob
%endmacro
-%define PSIGNW PSIGNW_MMX
IADST8_FN idct, IDCT8, iadst, IADST8, sse2, 15
IADST8_FN iadst, IADST8, idct, IDCT8, sse2, 15
IADST8_FN iadst, IADST8, iadst, IADST8, sse2, 15
-%define PSIGNW PSIGNW_SSSE3
IADST8_FN idct, IDCT8, iadst, IADST8, ssse3, 16
IADST8_FN idct, IDCT8, iadst, IADST8, avx, 16
IADST8_FN iadst, IADST8, idct, IDCT8, ssse3, 16
IADST8_FN iadst, IADST8, idct, IDCT8, avx, 16
IADST8_FN iadst, IADST8, iadst, IADST8, ssse3, 16
IADST8_FN iadst, IADST8, iadst, IADST8, avx, 16
-%undef PSIGNW
;---------------------------------------------------------------------------------------------
; void vp9_idct_idct_16x16_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
@@ -1124,10 +1125,14 @@ IADST8_FN iadst, IADST8, iadst, IADST8, avx, 16
pmulhrsw m7, m4, [pw_16069x2] ; t6-7
pmulhrsw m4, [pw_3196x2] ; t4-5
+%if 0 ; overflows :(
paddw m6, m7, m4
psubw m5, m7, m4
pmulhrsw m5, [pw_11585x2] ; t5
pmulhrsw m6, [pw_11585x2] ; t6
+%else
+ VP9_UNPACK_MULSUB_2W_4X 5, 6, 7, 4, 11585, 11585, [pd_8192], 0, 1 ; t5, t6
+%endif
psubw m0, m3, m7
paddw m7, m3
@@ -1709,13 +1714,13 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
SUMSUB_BA w, 7, 6, 4
pmulhrsw m7, [pw_m11585x2] ; m8=out7[w]
pmulhrsw m6, [pw_11585x2] ; m1=out8[w]
+ SWAP 6, 7
SUMSUB_BA w, 3, 2, 4
pmulhrsw m3, [pw_11585x2] ; m3=out4[w]
pmulhrsw m2, [pw_11585x2] ; m2=out11[w]
%else
SCRATCH 5, 8, tmpq+10*%%str
- PSIGNW m7, [pw_m1]
- VP9_UNPACK_MULSUB_2W_4X 7, 6, 11585, 11585, [pd_8192], 5, 4
+ VP9_UNPACK_MULSUB_2W_4X 6, 7, 11585, m11585, [pd_8192], 5, 4
VP9_UNPACK_MULSUB_2W_4X 2, 3, 11585, 11585, [pd_8192], 5, 4
UNSCRATCH 5, 8, tmpq+10*%%str
%endif
@@ -1726,7 +1731,7 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
%if %2 == 1
%if ARCH_X86_64
mova m13, [tmpq+ 6*%%str]
- TRANSPOSE8x8W 1, 11, 14, 0, 3, 15, 13, 7, 10
+ TRANSPOSE8x8W 1, 11, 14, 0, 3, 15, 13, 6, 10
mova [tmpq+ 0*16], m1
mova [tmpq+ 2*16], m11
mova [tmpq+ 4*16], m14
@@ -1738,10 +1743,10 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
mova [tmpq+ 8*16], m3
mova [tmpq+10*16], m15
mova [tmpq+12*16], m13
- mova [tmpq+14*16], m7
+ mova [tmpq+14*16], m6
- TRANSPOSE8x8W 6, 1, 11, 2, 9, 14, 0, 5, 10
- mova [tmpq+ 1*16], m6
+ TRANSPOSE8x8W 7, 1, 11, 2, 9, 14, 0, 5, 10
+ mova [tmpq+ 1*16], m7
mova [tmpq+ 3*16], m1
mova [tmpq+ 5*16], m11
mova [tmpq+ 7*16], m2
@@ -1752,20 +1757,20 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
%else
mova [tmpq+12*%%str], m2
mova [tmpq+ 1*%%str], m5
- mova [tmpq+15*%%str], m6
+ mova [tmpq+15*%%str], m7
mova m2, [tmpq+ 9*%%str]
mova m5, [tmpq+ 5*%%str]
- mova m6, [tmpq+ 8*%%str]
- TRANSPOSE8x8W 1, 2, 5, 0, 3, 6, 4, 7, [tmpq+ 6*%%str], [tmpq+ 8*%%str], 1
+ mova m7, [tmpq+ 8*%%str]
+ TRANSPOSE8x8W 1, 2, 5, 0, 3, 7, 4, 6, [tmpq+ 6*%%str], [tmpq+ 8*%%str], 1
mova [tmpq+ 0*16], m1
mova [tmpq+ 2*16], m2
mova [tmpq+ 4*16], m5
mova [tmpq+ 6*16], m0
- mova [tmpq+10*16], m6
+ mova [tmpq+10*16], m7
mova m3, [tmpq+12*%%str]
mova [tmpq+12*16], m4
mova m4, [tmpq+14*%%str]
- mova [tmpq+14*16], m7
+ mova [tmpq+14*16], m6
mova m0, [tmpq+15*%%str]
mova m1, [tmpq+ 3*%%str]
@@ -1798,7 +1803,7 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
lea dstq, [dstq+strideq*2]
VP9_IDCT8_WRITEx2 3, 15, 10, 8, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
- VP9_IDCT8_WRITEx2 12, 7, 10, 8, 4, ROUND_REG, 6
+ VP9_IDCT8_WRITEx2 12, 6, 10, 8, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
mova m1, [tmpq+ 3*%%str]
@@ -1806,7 +1811,7 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
mova m14, [tmpq+11*%%str]
mova m0, [tmpq+13*%%str]
- VP9_IDCT8_WRITEx2 6, 1, 10, 8, 4, ROUND_REG, 6
+ VP9_IDCT8_WRITEx2 7, 1, 10, 8, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
VP9_IDCT8_WRITEx2 11, 2, 10, 8, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
@@ -1816,9 +1821,9 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
%else
mova [tmpq+ 0*%%str], m2
mova [tmpq+ 1*%%str], m5
- mova [tmpq+ 2*%%str], m6
+ mova [tmpq+ 2*%%str], m7
mova m2, [tmpq+ 9*%%str]
- VP9_IDCT8_WRITEx2 1, 2, 5, 6, 4, ROUND_REG, 6
+ VP9_IDCT8_WRITEx2 1, 2, 5, 7, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
mova m5, [tmpq+ 5*%%str]
VP9_IDCT8_WRITEx2 5, 0, 1, 2, 4, ROUND_REG, 6
@@ -1827,7 +1832,7 @@ VP9_IDCT_IDCT_16x16_ADD_XMM avx
VP9_IDCT8_WRITEx2 3, 5, 1, 2, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
mova m5, [tmpq+ 6*%%str]
- VP9_IDCT8_WRITEx2 5, 7, 1, 2, 4, ROUND_REG, 6
+ VP9_IDCT8_WRITEx2 5, 6, 1, 2, 4, ROUND_REG, 6
lea dstq, [dstq+strideq*2]
mova m0, [tmpq+ 2*%%str]
@@ -1881,18 +1886,15 @@ cglobal vp9_%1_%3_16x16_add, 3, 6, 16, 512, dst, stride, block, cnt, dst_bak, tm
RET
%endmacro
-%define PSIGNW PSIGNW_MMX
IADST16_FN idct, IDCT16, iadst, IADST16, sse2
IADST16_FN iadst, IADST16, idct, IDCT16, sse2
IADST16_FN iadst, IADST16, iadst, IADST16, sse2
-%define PSIGNW PSIGNW_SSSE3
IADST16_FN idct, IDCT16, iadst, IADST16, ssse3
IADST16_FN iadst, IADST16, idct, IDCT16, ssse3
IADST16_FN iadst, IADST16, iadst, IADST16, ssse3
IADST16_FN idct, IDCT16, iadst, IADST16, avx
IADST16_FN iadst, IADST16, idct, IDCT16, avx
IADST16_FN iadst, IADST16, iadst, IADST16, avx
-%undef PSIGNW
;---------------------------------------------------------------------------------------------
; void vp9_idct_idct_32x32_add_<opt>(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob);
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/w64xmmtest.c b/chromium/third_party/ffmpeg/libavcodec/x86/w64xmmtest.c
index 25e833fef3f..94b3049a7e4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/w64xmmtest.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/w64xmmtest.c
@@ -65,13 +65,6 @@ wrap(avcodec_encode_audio2(AVCodecContext *avctx,
got_packet_ptr);
}
-wrap(avcodec_encode_video(AVCodecContext *avctx,
- uint8_t *buf, int buf_size,
- const AVFrame *pict))
-{
- testxmmclobbers(avcodec_encode_video, avctx, buf, buf_size, pict);
-}
-
wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
uint8_t *buf, int buf_size,
const AVSubtitle *sub))
diff --git a/chromium/third_party/ffmpeg/libavcodec/xan.c b/chromium/third_party/ffmpeg/libavcodec/xan.c
index 2c565eed0d0..662386af9a5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xan.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xan.c
@@ -263,7 +263,7 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
prevframe_x = x + motion_x;
if (prev_palette_plane == palette_plane && FFABS(curframe_index - prevframe_index) < pixel_count) {
- avpriv_request_sample(s->avctx, "Overlapping copy\n");
+ avpriv_request_sample(s->avctx, "Overlapping copy");
return ;
}
@@ -644,5 +644,5 @@ AVCodec ff_xan_wc3_decoder = {
.init = xan_decode_init,
.close = xan_decode_end,
.decode = xan_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xbmdec.c b/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
index 143e3a28319..d19bdaee23c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xbmdec.c
@@ -133,5 +133,5 @@ AVCodec ff_xbm_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XBM,
.decode = xbm_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xbmenc.c b/chromium/third_party/ffmpeg/libavcodec/xbmenc.c
index a752bdf2a73..b25615f2a47 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xbmenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xbmenc.c
@@ -32,7 +32,7 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
linesize = (avctx->width + 7) / 8;
size = avctx->height * (linesize * 7 + 2) + 110;
- if ((ret = ff_alloc_packet2(avctx, pkt, size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, size, 0)) < 0)
return ret;
buf = pkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/xfaceenc.c b/chromium/third_party/ffmpeg/libavcodec/xfaceenc.c
index fa6f22734b7..bfb9fb9ece8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xfaceenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xfaceenc.c
@@ -124,16 +124,6 @@ static void encode_block(char *bitmap, int w, int h, int level, ProbRangesQueue
}
}
-static av_cold int xface_encode_init(AVCodecContext *avctx)
-{
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
- return 0;
-}
-
static void push_integer(BigInt *b, const ProbRange *prange)
{
uint8_t r;
@@ -205,7 +195,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
intbuf[i++] = r + XFACE_FIRST_PRINT;
}
- if ((ret = ff_alloc_packet2(avctx, pkt, i+2)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, i+2, 0)) < 0)
return ret;
/* revert the number, and close the buffer */
@@ -221,21 +211,13 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0;
}
-static av_cold int xface_encode_close(AVCodecContext *avctx)
-{
- av_frame_free(&avctx->coded_frame);
-
- return 0;
-}
-
AVCodec ff_xface_encoder = {
.name = "xface",
.long_name = NULL_IF_CONFIG_SMALL("X-face image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XFACE,
.priv_data_size = sizeof(XFaceContext),
- .init = xface_encode_init,
- .close = xface_encode_close,
.encode2 = xface_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xl.c b/chromium/third_party/ffmpeg/libavcodec/xl.c
index 2d1da1d2556..37ab46e4f7f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xl.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xl.c
@@ -134,5 +134,5 @@ AVCodec ff_xl_decoder = {
.id = AV_CODEC_ID_VIXL,
.init = decode_init,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xvididct.c b/chromium/third_party/ffmpeg/libavcodec/xvididct.c
index e9fab70cbbb..1f96ccc35c8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xvididct.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xvididct.c
@@ -348,6 +348,8 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx)
if (ARCH_X86)
ff_xvid_idct_init_x86(c, avctx, high_bit_depth);
+ if (ARCH_MIPS)
+ ff_xvid_idct_init_mips(c, avctx, high_bit_depth);
ff_init_scantable_permutation(c->idct_permutation, c->perm_type);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/xvididct.h b/chromium/third_party/ffmpeg/libavcodec/xvididct.h
index f7dfba48865..e0bc1a2b91f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xvididct.h
+++ b/chromium/third_party/ffmpeg/libavcodec/xvididct.h
@@ -30,5 +30,7 @@ void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx);
void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
+void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
#endif /* AVCODEC_XVIDIDCT_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/xwddec.c b/chromium/third_party/ffmpeg/libavcodec/xwddec.c
index 62dfdace165..2febedc4aa5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xwddec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xwddec.c
@@ -249,5 +249,5 @@ AVCodec ff_xwd_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XWD,
.decode = xwd_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/xwdenc.c b/chromium/third_party/ffmpeg/libavcodec/xwdenc.c
index 06fa4a0a978..43bca890332 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xwdenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xwdenc.c
@@ -146,7 +146,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
header_size = XWD_HEADER_SIZE + WINDOW_NAME_SIZE;
out_size = header_size + ncolors * XWD_CMAP_SIZE + avctx->height * lsize;
- if ((ret = ff_alloc_packet2(avctx, pkt, out_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, out_size, 0)) < 0)
return ret;
buf = pkt->data;
diff --git a/chromium/third_party/ffmpeg/libavcodec/xxan.c b/chromium/third_party/ffmpeg/libavcodec/xxan.c
index b261cdfdec9..54852962a10 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xxan.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xxan.c
@@ -447,5 +447,5 @@ AVCodec ff_xan_wc4_decoder = {
.init = xan_decode_init,
.close = xan_decode_end,
.decode = xan_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/y41pdec.c b/chromium/third_party/ffmpeg/libavcodec/y41pdec.c
index 22c7d1fd382..1b177d42621 100644
--- a/chromium/third_party/ffmpeg/libavcodec/y41pdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/y41pdec.c
@@ -88,5 +88,5 @@ AVCodec ff_y41p_decoder = {
.id = AV_CODEC_ID_Y41P,
.init = y41p_decode_init,
.decode = y41p_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/y41penc.c b/chromium/third_party/ffmpeg/libavcodec/y41penc.c
index 477861880ef..94acc343fb5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/y41penc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/y41penc.c
@@ -30,14 +30,8 @@ static av_cold int y41p_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- avctx->coded_frame = av_frame_alloc();
avctx->bits_per_coded_sample = 12;
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -48,11 +42,9 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *y, *u, *v;
int i, j, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5, 0)) < 0)
return ret;
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
dst = pkt->data;
for (i = avctx->height - 1; i >= 0; i--) {
@@ -84,8 +76,6 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int y41p_encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -99,4 +89,5 @@ AVCodec ff_y41p_encoder = {
.close = y41p_encode_close,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/yuv4dec.c b/chromium/third_party/ffmpeg/libavcodec/yuv4dec.c
index 00ccf581208..f89f62debe8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/yuv4dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/yuv4dec.c
@@ -80,5 +80,5 @@ AVCodec ff_yuv4_decoder = {
.id = AV_CODEC_ID_YUV4,
.init = yuv4_decode_init,
.decode = yuv4_decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/yuv4enc.c b/chromium/third_party/ffmpeg/libavcodec/yuv4enc.c
index 5ce48467d19..cc8846d7e52 100644
--- a/chromium/third_party/ffmpeg/libavcodec/yuv4enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/yuv4enc.c
@@ -25,13 +25,6 @@
static av_cold int yuv4_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = av_frame_alloc();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}
@@ -42,13 +35,10 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *y, *u, *v;
int i, j, ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1))) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1), 0)) < 0)
return ret;
dst = pkt->data;
- avctx->coded_frame->key_frame = 1;
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
y = pic->data[0];
u = pic->data[1];
v = pic->data[2];
@@ -74,8 +64,6 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static av_cold int yuv4_encode_close(AVCodecContext *avctx)
{
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -88,4 +76,5 @@ AVCodec ff_yuv4_encoder = {
.encode2 = yuv4_encode_frame,
.close = yuv4_encode_close,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_INTRA_ONLY,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/zerocodec.c b/chromium/third_party/ffmpeg/libavcodec/zerocodec.c
index 12d80241485..55a9a9173a2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/zerocodec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/zerocodec.c
@@ -148,5 +148,5 @@ AVCodec ff_zerocodec_decoder = {
.init = zerocodec_decode_init,
.decode = zerocodec_decode_frame,
.close = zerocodec_decode_close,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/zmbv.c b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
index 82ae169ef41..25a1cd215df 100644
--- a/chromium/third_party/ffmpeg/libavcodec/zmbv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
@@ -634,5 +634,5 @@ AVCodec ff_zmbv_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/zmbvenc.c b/chromium/third_party/ffmpeg/libavcodec/zmbvenc.c
index 2d56a13e016..df06e37cb2a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/zmbvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/zmbvenc.c
@@ -133,8 +133,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
c->curfrm++;
if(c->curfrm == c->keyint)
c->curfrm = 0;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
avctx->coded_frame->key_frame = keyframe;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
chpal = !keyframe && memcmp(p->data[1], c->pal2, 1024);
palptr = (uint32_t*)p->data[1];
@@ -227,7 +231,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
pkt_size = c->zstream.total_out + 1 + 6*keyframe;
- if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0)
return ret;
buf = pkt->data;
@@ -259,8 +263,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
deflateEnd(&c->zstream);
av_freep(&c->prev);
- av_frame_free(&avctx->coded_frame);
-
return 0;
}
@@ -324,12 +326,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1;
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame) {
- encode_end(avctx);
- return AVERROR(ENOMEM);
- }
-
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavdevice/caca.c b/chromium/third_party/ffmpeg/libavdevice/caca.c
index ff54940d31f..14775d2c7d3 100644
--- a/chromium/third_party/ffmpeg/libavdevice/caca.c
+++ b/chromium/third_party/ffmpeg/libavdevice/caca.c
@@ -69,18 +69,18 @@ static void list_drivers(CACAContext *c)
av_log(c->ctx, AV_LOG_INFO, "Available drivers:\n");
for (i = 0; drivers[i]; i += 2)
- av_log(c->ctx, AV_LOG_INFO, "%s : %s\n", drivers[i], drivers[i + 1]);
+ av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", drivers[i], drivers[i + 1]);
}
#define DEFINE_LIST_DITHER(thing, thing_str) \
-static void list_dither_## thing(CACAContext *c) \
+static void list_dither_## thing(CACAContext *c) \
{ \
const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
int i; \
\
av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
for (i = 0; thing[i]; i += 2) \
- av_log(c->ctx, AV_LOG_INFO, "%s : %s\n", thing[i], thing[i + 1]); \
+ av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", thing[i], thing[i + 1]); \
}
DEFINE_LIST_DITHER(color, "colors");
@@ -150,13 +150,15 @@ static int caca_write_header(AVFormatContext *s)
goto fail;
}
-#define CHECK_DITHER_OPT(opt) \
- if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
- ret = AVERROR(errno); \
- av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
- c->opt, #opt); \
- goto fail; \
- }
+#define CHECK_DITHER_OPT(opt) do { \
+ if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
+ ret = AVERROR(errno); \
+ av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
+ c->opt, #opt); \
+ goto fail; \
+ } \
+} while (0)
+
CHECK_DITHER_OPT(algorithm);
CHECK_DITHER_OPT(antialias);
CHECK_DITHER_OPT(charset);
@@ -208,9 +210,7 @@ static const AVOption options[] = {
{ "antialias", "set antialias method", OFFSET(antialias), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "charset", "set charset used to render output", OFFSET(charset), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "color", "set color used to render output", OFFSET(color), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
- { "list_drivers", "list available drivers", OFFSET(list_drivers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, ENC, "list_drivers" },
- { "true", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, ENC, "list_drivers" },
- { "false", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, ENC, "list_drivers" },
+ { "list_drivers", "list available drivers", OFFSET(list_drivers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, ENC },
{ "list_dither", "list available dither options", OFFSET(list_dither), AV_OPT_TYPE_STRING, {.dbl=0}, 0, 1, ENC, "list_dither" },
{ "algorithms", NULL, 0, AV_OPT_TYPE_CONST, {.str = "algorithms"}, 0, 0, ENC, "list_dither" },
{ "antialiases", NULL, 0, AV_OPT_TYPE_CONST, {.str = "antialiases"},0, 0, ENC, "list_dither" },
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_common.h b/chromium/third_party/ffmpeg/libavdevice/decklink_common.h
index 96912a7c2d9..3bc30f062ce 100644
--- a/chromium/third_party/ffmpeg/libavdevice/decklink_common.h
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_common.h
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <DeckLinkAPIVersion.h>
+
#include "decklink_common_c.h"
class decklink_output_callback;
@@ -82,7 +84,11 @@ struct decklink_ctx {
typedef enum { DIRECTION_IN, DIRECTION_OUT} decklink_direction_t;
#ifdef _WIN32
+#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0a040000
typedef unsigned long buffercount_type;
+#else
+typedef unsigned int buffercount_type;
+#endif
IDeckLinkIterator *CreateDeckLinkIteratorInstance(void);
#else
typedef uint32_t buffercount_type;
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow.c b/chromium/third_party/ffmpeg/libavdevice/dshow.c
index 62249785cb7..31764a9637a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow.c
@@ -975,7 +975,7 @@ dshow_add_device(AVFormatContext *avctx,
codec->codec_id = AV_CODEC_ID_RAWVIDEO;
if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) {
codec->bits_per_coded_sample = bih->biBitCount;
- codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);
+ codec->extradata = av_malloc(9 + AV_INPUT_BUFFER_PADDING_SIZE);
if (codec->extradata) {
codec->extradata_size = 9;
memcpy(codec->extradata, "BottomUp", 9);
@@ -1268,36 +1268,20 @@ static const AVOption options[] = {
{ "sample_size", "set audio sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 16, DEC },
{ "channels", "set number of audio channels, such as 1 or 2", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC },
{ "audio_buffer_size", "set audio device buffer latency size in milliseconds (default is the device's default)", OFFSET(audio_buffer_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC },
- { "list_devices", "list available devices", OFFSET(list_devices), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, DEC, "list_devices" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "list_devices" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "list_devices" },
- { "list_options", "list available options for specified device", OFFSET(list_options), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, DEC, "list_options" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "list_options" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "list_options" },
+ { "list_devices", "list available devices", OFFSET(list_devices), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, DEC },
+ { "list_options", "list available options for specified device", OFFSET(list_options), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, DEC },
{ "video_device_number", "set video device number for devices with same name (starts at 0)", OFFSET(video_device_number), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC },
{ "audio_device_number", "set audio device number for devices with same name (starts at 0)", OFFSET(audio_device_number), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC },
{ "video_pin_name", "select video capture pin by name", OFFSET(video_pin_name),AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "audio_pin_name", "select audio capture pin by name", OFFSET(audio_pin_name),AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "crossbar_video_input_pin_number", "set video input pin number for crossbar device", OFFSET(crossbar_video_input_pin_number), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, DEC },
{ "crossbar_audio_input_pin_number", "set audio input pin number for crossbar device", OFFSET(crossbar_audio_input_pin_number), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, DEC },
- { "show_video_device_dialog", "display property dialog for video capture device", OFFSET(show_video_device_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_video_device_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_video_device_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_video_device_dialog" },
- { "show_audio_device_dialog", "display property dialog for audio capture device", OFFSET(show_audio_device_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_audio_device_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_audio_device_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_audio_device_dialog" },
- { "show_video_crossbar_connection_dialog", "display property dialog for crossbar connecting pins filter on video device", OFFSET(show_video_crossbar_connection_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_video_crossbar_connection_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_video_crossbar_connection_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_video_crossbar_connection_dialog" },
- { "show_audio_crossbar_connection_dialog", "display property dialog for crossbar connecting pins filter on audio device", OFFSET(show_audio_crossbar_connection_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_audio_crossbar_connection_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_audio_crossbar_connection_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_audio_crossbar_connection_dialog" },
- { "show_analog_tv_tuner_dialog", "display property dialog for analog tuner filter", OFFSET(show_analog_tv_tuner_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_analog_tv_tuner_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_analog_tv_tuner_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_analog_tv_tuner_dialog" },
- { "show_analog_tv_tuner_audio_dialog", "display property dialog for analog tuner audio filter", OFFSET(show_analog_tv_tuner_audio_dialog), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC, "show_analog_tv_tuner_dialog" },
- { "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, DEC, "show_analog_tv_tuner_audio_dialog" },
- { "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, DEC, "show_analog_tv_tuner_audio_dialog" },
+ { "show_video_device_dialog", "display property dialog for video capture device", OFFSET(show_video_device_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
+ { "show_audio_device_dialog", "display property dialog for audio capture device", OFFSET(show_audio_device_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
+ { "show_video_crossbar_connection_dialog", "display property dialog for crossbar connecting pins filter on video device", OFFSET(show_video_crossbar_connection_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
+ { "show_audio_crossbar_connection_dialog", "display property dialog for crossbar connecting pins filter on audio device", OFFSET(show_audio_crossbar_connection_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
+ { "show_analog_tv_tuner_dialog", "display property dialog for analog tuner filter", OFFSET(show_analog_tv_tuner_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
+ { "show_analog_tv_tuner_audio_dialog", "display property dialog for analog tuner audio filter", OFFSET(show_analog_tv_tuner_audio_dialog), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ "audio_device_load", "load audio capture filter device (and properties) from file", OFFSET(audio_filter_load_file), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "audio_device_save", "save audio capture filter device (and properties) to file", OFFSET(audio_filter_save_file), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "video_device_load", "load video capture filter device (and properties) from file", OFFSET(video_filter_load_file), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
diff --git a/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c b/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
index 4f719a660ea..664246da92a 100644
--- a/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
+++ b/chromium/third_party/ffmpeg/libavdevice/dshow_pin.c
@@ -303,14 +303,18 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
libAVPin *pin = (libAVPin *) ((uint8_t *) this - imemoffset);
enum dshowDeviceType devtype = pin->filter->type;
void *priv_data;
+ AVFormatContext *s;
uint8_t *buf;
int buf_size; /* todo should be a long? */
int index;
int64_t curtime;
int64_t orig_curtime;
+ int64_t graphtime;
const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
IReferenceClock *clock = pin->filter->clock;
int64_t dummy;
+ struct dshow_ctx *ctx;
+
dshowdebug("libAVMemInputPin_Receive(%p)\n", this);
@@ -319,6 +323,7 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
IMediaSample_GetTime(sample, &orig_curtime, &dummy);
orig_curtime += pin->filter->start_time;
+ IReferenceClock_GetTime(clock, &graphtime);
if (devtype == VideoDevice) {
/* PTS from video devices is unreliable. */
IReferenceClock_GetTime(clock, &curtime);
@@ -338,10 +343,13 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
buf_size = IMediaSample_GetActualDataLength(sample);
IMediaSample_GetPointer(sample, &buf);
priv_data = pin->filter->priv_data;
+ s = priv_data;
+ ctx = s->priv_data;
index = pin->filter->stream_index;
- av_log(NULL, AV_LOG_VERBOSE, "dshow passing through packet of type %s size %6d timestamp %"PRId64" orig timestamp %"PRId64"\n",
- devtypename, buf_size, curtime, orig_curtime);
+ av_log(NULL, AV_LOG_VERBOSE, "dshow passing through packet of type %s size %8d "
+ "timestamp %"PRId64" orig timestamp %"PRId64" graph timestamp %"PRId64" diff %"PRId64" %s\n",
+ devtypename, buf_size, curtime, orig_curtime, graphtime, graphtime - orig_curtime, ctx->device_name[devtype]);
pin->filter->callback(priv_data, index, buf, buf_size, curtime, devtype);
return S_OK;
diff --git a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
index 98f96de2af6..91bd8e1a911 100644
--- a/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
+++ b/chromium/third_party/ffmpeg/libavdevice/fbdev_common.c
@@ -42,7 +42,7 @@ static const struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = {
{ 32, 3, 2, 8, 0, AV_PIX_FMT_ABGR },
{ 24, 0, 8, 16, 0, AV_PIX_FMT_RGB24 },
{ 24, 16, 8, 0, 0, AV_PIX_FMT_BGR24 },
- { 16, 11, 5, 0, 16, AV_PIX_FMT_RGB565 },
+ { 16, 11, 5, 0, 0, AV_PIX_FMT_RGB565 },
};
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
diff --git a/chromium/third_party/ffmpeg/libavdevice/iec61883.c b/chromium/third_party/ffmpeg/libavdevice/iec61883.c
index 5c74cc7729c..c45ae9ae5cd 100644
--- a/chromium/third_party/ffmpeg/libavdevice/iec61883.c
+++ b/chromium/third_party/ffmpeg/libavdevice/iec61883.c
@@ -198,7 +198,6 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)
size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
packet->buf, packet->len, -1);
- pkt->destruct = av_destruct_packet;
dv->queue_first = packet->next;
av_free(packet);
dv->packets--;
diff --git a/chromium/third_party/ffmpeg/libavdevice/lavfi.c b/chromium/third_party/ffmpeg/libavdevice/lavfi.c
index 126e5f62ce1..3453b4d3e7e 100644
--- a/chromium/third_party/ffmpeg/libavdevice/lavfi.c
+++ b/chromium/third_party/ffmpeg/libavdevice/lavfi.c
@@ -30,6 +30,7 @@
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/file.h"
+#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
@@ -247,7 +248,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
AVFilterContext *sink;
- type = inout->filter_ctx->output_pads[inout->pad_idx].type;
+ type = avfilter_pad_get_type(inout->filter_ctx->output_pads, inout->pad_idx);
if (type == AVMEDIA_TYPE_VIDEO && ! buffersink ||
type == AVMEDIA_TYPE_AUDIO && ! abuffersink) {
@@ -336,7 +337,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
}
if ((ret = create_subcc_streams(avctx)) < 0)
- FAIL(ret);
+ goto end;
if (!(lavfi->decoded_frame = av_frame_alloc()))
FAIL(AVERROR(ENOMEM));
@@ -406,13 +407,13 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
ret = av_buffersink_get_frame_flags(lavfi->sinks[i], frame,
AV_BUFFERSINK_FLAG_PEEK);
if (ret == AVERROR_EOF) {
- av_dlog(avctx, "EOF sink_idx:%d\n", i);
+ ff_dlog(avctx, "EOF sink_idx:%d\n", i);
lavfi->sink_eof[i] = 1;
continue;
} else if (ret < 0)
return ret;
d = av_rescale_q_rnd(frame->pts, tb, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
- av_dlog(avctx, "sink_idx:%d time:%f\n", i, d);
+ ff_dlog(avctx, "sink_idx:%d time:%f\n", i, d);
av_frame_unref(frame);
if (d < min_pts) {
@@ -423,7 +424,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
if (min_pts == DBL_MAX)
return AVERROR_EOF;
- av_dlog(avctx, "min_pts_sink_idx:%i\n", min_pts_sink_idx);
+ ff_dlog(avctx, "min_pts_sink_idx:%i\n", min_pts_sink_idx);
av_buffersink_get_frame_flags(lavfi->sinks[min_pts_sink_idx], frame, 0);
stream_idx = lavfi->sink_stream_map[min_pts_sink_idx];
diff --git a/chromium/third_party/ffmpeg/libavdevice/libdc1394.c b/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
index 5f49c5ed02a..6868e9ca7bd 100644
--- a/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
+++ b/chromium/third_party/ffmpeg/libavdevice/libdc1394.c
@@ -71,7 +71,7 @@ typedef struct dc1394_data {
AVPacket packet;
} dc1394_data;
-struct dc1394_frame_format {
+static const struct dc1394_frame_format {
int width;
int height;
enum AVPixelFormat pix_fmt;
@@ -84,7 +84,7 @@ struct dc1394_frame_format {
{ 0, 0, 0, 0 } /* gotta be the last one */
};
-struct dc1394_frame_rate {
+static const struct dc1394_frame_rate {
int frame_rate;
int frame_rate_id;
} dc1394_frame_rates[] = {
diff --git a/chromium/third_party/ffmpeg/libavdevice/openal-dec.c b/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
index b552158f76a..cab1eb6915c 100644
--- a/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
+++ b/chromium/third_party/ffmpeg/libavdevice/openal-dec.c
@@ -204,7 +204,7 @@ static int read_packet(AVFormatContext* ctx, AVPacket *pkt)
fail:
/* Handle failure */
if (pkt->data)
- av_destruct_packet(pkt);
+ av_free_packet(pkt);
if (error_msg)
av_log(ctx, AV_LOG_ERROR, "Error: %s\n", error_msg);
return error;
diff --git a/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c b/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c
index 434ae97a42b..851b94735d2 100644
--- a/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c
+++ b/chromium/third_party/ffmpeg/libavdevice/opengl_enc.c
@@ -733,8 +733,8 @@ static av_cold void opengl_fill_color_map(OpenGLContext *opengl)
return;
#define FILL_COMPONENT(i) { \
- shift = desc->comp[i].depth_minus1 >> 3; \
- opengl->color_map[(i << 2) + ((desc->comp[i].offset_plus1 - 1) >> shift)] = 1.0; \
+ shift = (desc->comp[i].depth - 1) >> 3; \
+ opengl->color_map[(i << 2) + (desc->comp[i].offset >> shift)] = 1.0; \
}
memset(opengl->color_map, 0, sizeof(opengl->color_map));
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l.c b/chromium/third_party/ffmpeg/libavdevice/v4l.c
index d33f7142a0e..81653e02fb5 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l.c
@@ -25,6 +25,7 @@
#include "config.h"
#include "libavutil/rational.h"
#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavformat/internal.h"
@@ -151,7 +152,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
ioctl(video_fd, VIDIOCSAUDIO, &audio);
ioctl(video_fd, VIDIOCGPICT, &pict);
- av_dlog(s1, "v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n",
+ ff_dlog(s1, "v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n",
pict.colour, pict.hue, pict.brightness, pict.contrast, pict.whiteness);
/* try to choose a suitable video format */
pict.palette = desired_palette;
diff --git a/chromium/third_party/ffmpeg/libavdevice/v4l2.c b/chromium/third_party/ffmpeg/libavdevice/v4l2.c
index 64ac09c1c7a..9e8ba1e5b61 100644
--- a/chromium/third_party/ffmpeg/libavdevice/v4l2.c
+++ b/chromium/third_party/ffmpeg/libavdevice/v4l2.c
@@ -394,13 +394,6 @@ static int mmap_init(AVFormatContext *ctx)
return 0;
}
-#if FF_API_DESTRUCT_PACKET
-static void dummy_release_buffer(AVPacket *pkt)
-{
- av_assert0(0);
-}
-#endif
-
static int enqueue_buffer(struct video_data *s, struct v4l2_buffer *buf)
{
int res = 0;
@@ -565,11 +558,6 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
pkt->data = s->buf_start[buf.index];
pkt->size = buf.bytesused;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_release_buffer;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
buf_descriptor = av_malloc(sizeof(struct buff_data));
if (!buf_descriptor) {
@@ -966,7 +954,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
st->codec->codec_tag =
avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
else if (codec_id == AV_CODEC_ID_H264) {
- st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
}
if (desired_format == V4L2_PIX_FMT_YVU420)
st->codec->codec_tag = MKTAG('Y', 'V', '1', '2');
@@ -987,7 +975,11 @@ fail:
static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
{
struct video_data *s = ctx->priv_data;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
AVFrame *frame = ctx->streams[0]->codec->coded_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
int res;
av_init_packet(pkt);
@@ -995,10 +987,14 @@ static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
return res;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
if (frame && s->interlaced) {
frame->interlaced_frame = 1;
frame->top_field_first = s->top_field_first;
}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return pkt->size;
}
@@ -1116,7 +1112,7 @@ static const AVOption options[] = {
{ "default", "use timestamps from the kernel", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_DEFAULT }, 0, 2, DEC, "timestamps" },
{ "abs", "use absolute timestamps (wall clock)", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_ABS }, 0, 2, DEC, "timestamps" },
{ "mono2abs", "force conversion from monotonic to absolute timestamps", OFFSET(ts_mode), AV_OPT_TYPE_CONST, {.i64 = V4L_TS_MONO2ABS }, 0, 2, DEC, "timestamps" },
- { "use_libv4l2", "use libv4l2 (v4l-utils) conversion functions", OFFSET(use_libv4l2), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
+ { "use_libv4l2", "use libv4l2 (v4l-utils) conversion functions", OFFSET(use_libv4l2), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/version.h b/chromium/third_party/ffmpeg/libavdevice/version.h
index 8de07f08b2a..45c9e8d4dba 100644
--- a/chromium/third_party/ffmpeg/libavdevice/version.h
+++ b/chromium/third_party/ffmpeg/libavdevice/version.h
@@ -27,8 +27,8 @@
#include "libavutil/version.h"
-#define LIBAVDEVICE_VERSION_MAJOR 56
-#define LIBAVDEVICE_VERSION_MINOR 4
+#define LIBAVDEVICE_VERSION_MAJOR 57
+#define LIBAVDEVICE_VERSION_MINOR 0
#define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
diff --git a/chromium/third_party/ffmpeg/libavdevice/vfwcap.c b/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
index 10e6c69dcb4..f536bc100fe 100644
--- a/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
+++ b/chromium/third_party/ffmpeg/libavdevice/vfwcap.c
@@ -396,7 +396,7 @@ static int vfw_read_header(AVFormatContext *s)
codec->codec_id = AV_CODEC_ID_RAWVIDEO;
if(biCompression == BI_RGB) {
codec->bits_per_coded_sample = biBitCount;
- codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);
+ codec->extradata = av_malloc(9 + AV_INPUT_BUFFER_PADDING_SIZE);
if (codec->extradata) {
codec->extradata_size = 9;
memcpy(codec->extradata, "BottomUp", 9);
diff --git a/chromium/third_party/ffmpeg/libavdevice/xcbgrab.c b/chromium/third_party/ffmpeg/libavdevice/xcbgrab.c
index 166575c9c2c..f169f936654 100644
--- a/chromium/third_party/ffmpeg/libavdevice/xcbgrab.c
+++ b/chromium/third_party/ffmpeg/libavdevice/xcbgrab.c
@@ -231,7 +231,7 @@ static int xcbgrab_frame_shm(AVFormatContext *s, AVPacket *pkt)
xcb_shm_get_image_reply_t *img;
xcb_drawable_t drawable = c->screen->root;
uint8_t *data;
- int size = c->frame_size + FF_INPUT_BUFFER_PADDING_SIZE;
+ int size = c->frame_size + AV_INPUT_BUFFER_PADDING_SIZE;
int id = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
xcb_generic_error_t *e = NULL;
diff --git a/chromium/third_party/ffmpeg/libavfilter/Makefile b/chromium/third_party/ffmpeg/libavfilter/Makefile
index fc9f4551ace..b0a2a7af251 100644
--- a/chromium/third_party/ffmpeg/libavfilter/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/Makefile
@@ -2,9 +2,7 @@ include $(SUBDIR)../config.mak
NAME = avfilter
-HEADERS = asrc_abuffer.h \
- avcodec.h \
- avfilter.h \
+HEADERS = avfilter.h \
avfiltergraph.h \
buffersink.h \
buffersrc.h \
@@ -14,7 +12,6 @@ OBJS = allfilters.o \
audio.o \
avfilter.o \
avfiltergraph.o \
- buffer.o \
buffersink.o \
buffersrc.o \
drawutils.o \
@@ -26,15 +23,14 @@ OBJS = allfilters.o \
transform.o \
video.o \
-
-OBJS-$(CONFIG_AVCODEC) += avcodec.o
-
+OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o
OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
OBJS-$(CONFIG_AINTERLEAVE_FILTER) += f_interleave.o
+OBJS-$(CONFIG_ALIMITER_FILTER) += af_alimiter.o
OBJS-$(CONFIG_ALLPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o
OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
@@ -43,6 +39,7 @@ OBJS-$(CONFIG_APAD_FILTER) += af_apad.o
OBJS-$(CONFIG_APERMS_FILTER) += f_perms.o
OBJS-$(CONFIG_APHASER_FILTER) += af_aphaser.o generate_wave_table.o
OBJS-$(CONFIG_ARESAMPLE_FILTER) += af_aresample.o
+OBJS-$(CONFIG_AREVERSE_FILTER) += f_reverse.o
OBJS-$(CONFIG_ASELECT_FILTER) += f_select.o
OBJS-$(CONFIG_ASENDCMD_FILTER) += f_sendcmd.o
OBJS-$(CONFIG_ASETNSAMPLES_FILTER) += af_asetnsamples.o
@@ -67,9 +64,11 @@ OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o
OBJS-$(CONFIG_CHORUS_FILTER) += af_chorus.o generate_wave_table.o
OBJS-$(CONFIG_COMPAND_FILTER) += af_compand.o
OBJS-$(CONFIG_DCSHIFT_FILTER) += af_dcshift.o
+OBJS-$(CONFIG_DYNAUDNORM_FILTER) += af_dynaudnorm.o
OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o
OBJS-$(CONFIG_EBUR128_FILTER) += f_ebur128.o
OBJS-$(CONFIG_EQUALIZER_FILTER) += af_biquads.o
+OBJS-$(CONFIG_EXTRASTEREO_FILTER) += af_extrastereo.o
OBJS-$(CONFIG_FLANGER_FILTER) += af_flanger.o generate_wave_table.o
OBJS-$(CONFIG_HIGHPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_JOIN_FILTER) += af_join.o
@@ -78,6 +77,7 @@ OBJS-$(CONFIG_LOWPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_PAN_FILTER) += af_pan.o
OBJS-$(CONFIG_REPLAYGAIN_FILTER) += af_replaygain.o
OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o
+OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o
OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o
OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o
OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o
@@ -94,6 +94,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER) += asink_anullsink.o
OBJS-$(CONFIG_ASS_FILTER) += vf_subtitles.o
OBJS-$(CONFIG_ALPHAEXTRACT_FILTER) += vf_extractplanes.o
OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o
+OBJS-$(CONFIG_ATADENOISE_FILTER) += vf_atadenoise.o
OBJS-$(CONFIG_BBOX_FILTER) += bbox.o vf_bbox.o
OBJS-$(CONFIG_BLACKDETECT_FILTER) += vf_blackdetect.o
OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
@@ -111,17 +112,22 @@ OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o
OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
OBJS-$(CONFIG_DCTDNOIZ_FILTER) += vf_dctdnoiz.o
+OBJS-$(CONFIG_DEBAND_FILTER) += vf_deband.o
OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o
+OBJS-$(CONFIG_DEFLATE_FILTER) += vf_neighbor.o
OBJS-$(CONFIG_DEJUDDER_FILTER) += vf_dejudder.o
OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o
OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
+OBJS-$(CONFIG_DILATION_FILTER) += vf_neighbor.o
OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o
+OBJS-$(CONFIG_DRAWGRAPH_FILTER) += f_drawgraph.o
OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o
OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o
OBJS-$(CONFIG_ELBG_FILTER) += vf_elbg.o
OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o
OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
+OBJS-$(CONFIG_EROSION_FILTER) += vf_neighbor.o
OBJS-$(CONFIG_EXTRACTPLANES_FILTER) += vf_extractplanes.o
OBJS-$(CONFIG_FADE_FILTER) += vf_fade.o
OBJS-$(CONFIG_FFTFILT_FILTER) += vf_fftfilt.o
@@ -130,9 +136,10 @@ OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
OBJS-$(CONFIG_FIND_RECT_FILTER) += vf_find_rect.o lavfutils.o
OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
-OBJS-$(CONFIG_FRAMESTEP_FILTER) += vf_framestep.o
OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o
OBJS-$(CONFIG_FRAMEPACK_FILTER) += vf_framepack.o
+OBJS-$(CONFIG_FRAMERATE_FILTER) += vf_framerate.o
+OBJS-$(CONFIG_FRAMESTEP_FILTER) += vf_framestep.o
OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
OBJS-$(CONFIG_FSPP_FILTER) += vf_fspp.o
OBJS-$(CONFIG_GEQ_FILTER) += vf_geq.o
@@ -143,9 +150,11 @@ OBJS-$(CONFIG_HISTEQ_FILTER) += vf_histeq.o
OBJS-$(CONFIG_HISTOGRAM_FILTER) += vf_histogram.o
OBJS-$(CONFIG_HQDN3D_FILTER) += vf_hqdn3d.o
OBJS-$(CONFIG_HQX_FILTER) += vf_hqx.o
+OBJS-$(CONFIG_HSTACK_FILTER) += vf_stack.o framesync.o
OBJS-$(CONFIG_HUE_FILTER) += vf_hue.o
OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o
OBJS-$(CONFIG_IL_FILTER) += vf_il.o
+OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o
OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o
OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o
@@ -161,6 +170,7 @@ OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o
OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o
OBJS-$(CONFIG_NULL_FILTER) += vf_null.o
+OBJS-$(CONFIG_OCR_FILTER) += vf_ocr.o
OBJS-$(CONFIG_OCV_FILTER) += vf_libopencv.o
OBJS-$(CONFIG_OPENCL) += deshake_opencl.o unsharp_opencl.o
OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o dualinput.o framesync.o
@@ -177,12 +187,16 @@ OBJS-$(CONFIG_PP7_FILTER) += vf_pp7.o
OBJS-$(CONFIG_PSNR_FILTER) += vf_psnr.o dualinput.o framesync.o
OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
+OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o
+OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += vf_removegrain.o
OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o
OBJS-$(CONFIG_REPEATFIELDS_FILTER) += vf_repeatfields.o
+OBJS-$(CONFIG_REVERSE_FILTER) += f_reverse.o
OBJS-$(CONFIG_ROTATE_FILTER) += vf_rotate.o
OBJS-$(CONFIG_SEPARATEFIELDS_FILTER) += vf_separatefields.o
OBJS-$(CONFIG_SAB_FILTER) += vf_sab.o
OBJS-$(CONFIG_SCALE_FILTER) += vf_scale.o
+OBJS-$(CONFIG_SCALE2REF_FILTER) += vf_scale.o
OBJS-$(CONFIG_SELECT_FILTER) += f_select.o
OBJS-$(CONFIG_SENDCMD_FILTER) += f_sendcmd.o
OBJS-$(CONFIG_SETDAR_FILTER) += vf_aspect.o
@@ -197,6 +211,7 @@ OBJS-$(CONFIG_SIGNALSTATS_FILTER) += vf_signalstats.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o
+OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o dualinput.o framesync.o
OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o
OBJS-$(CONFIG_SUBTITLES_FILTER) += vf_subtitles.o
OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
@@ -210,16 +225,21 @@ OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o
OBJS-$(CONFIG_TRIM_FILTER) += trim.o
OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o
OBJS-$(CONFIG_USPP_FILTER) += vf_uspp.o
+OBJS-$(CONFIG_VECTORSCOPE_FILTER) += vf_vectorscope.o
OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o
OBJS-$(CONFIG_VIDSTABDETECT_FILTER) += vidstabutils.o vf_vidstabdetect.o
OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER) += vidstabutils.o vf_vidstabtransform.o
OBJS-$(CONFIG_VIGNETTE_FILTER) += vf_vignette.o
+OBJS-$(CONFIG_VSTACK_FILTER) += vf_stack.o framesync.o
OBJS-$(CONFIG_W3FDIF_FILTER) += vf_w3fdif.o
+OBJS-$(CONFIG_WAVEFORM_FILTER) += vf_waveform.o
OBJS-$(CONFIG_XBR_FILTER) += vf_xbr.o
OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o
OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o
OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o
+OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o
+OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o
OBJS-$(CONFIG_CELLAUTO_FILTER) += vsrc_cellauto.o
OBJS-$(CONFIG_COLOR_FILTER) += vsrc_testsrc.o
OBJS-$(CONFIG_FREI0R_SRC_FILTER) += vf_frei0r.o
@@ -236,10 +256,14 @@ OBJS-$(CONFIG_TESTSRC_FILTER) += vsrc_testsrc.o
OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o
# multimedia filters
+OBJS-$(CONFIG_ADRAWGRAPH_FILTER) += f_drawgraph.o
+OBJS-$(CONFIG_APHASEMETER_FILTER) += avf_aphasemeter.o
OBJS-$(CONFIG_AVECTORSCOPE_FILTER) += avf_avectorscope.o
OBJS-$(CONFIG_CONCAT_FILTER) += avf_concat.o
OBJS-$(CONFIG_SHOWCQT_FILTER) += avf_showcqt.o
+OBJS-$(CONFIG_SHOWFREQS_FILTER) += avf_showfreqs.o
OBJS-$(CONFIG_SHOWSPECTRUM_FILTER) += avf_showspectrum.o
+OBJS-$(CONFIG_SHOWVOLUME_FILTER) += avf_showvolume.o
OBJS-$(CONFIG_SHOWWAVES_FILTER) += avf_showwaves.o
OBJS-$(CONFIG_SHOWWAVESPIC_FILTER) += avf_showwaves.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_adelay.c b/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
index ca141ce3b06..6bae4460c28 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_adelay.c
@@ -66,7 +66,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aecho.c b/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
index 8e7a39ecd0d..7e7a9d57594 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aecho.c
@@ -160,7 +160,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_afade.c b/chromium/third_party/ffmpeg/libavfilter/af_afade.c
index 4b5124a1d4e..7168eba4b50 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_afade.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_afade.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Paul B Mahol
+ * Copyright (c) 2013-2015 Paul B Mahol
*
* This file is part of FFmpeg.
*
@@ -23,6 +23,7 @@
* fade audio filter
*/
+#include "libavutil/audio_fifo.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
@@ -31,15 +32,24 @@
typedef struct {
const AVClass *class;
int type;
- int curve;
+ int curve, curve2;
int nb_samples;
int64_t start_sample;
int64_t duration;
int64_t start_time;
+ int overlap;
+ int cf0_eof;
+ int crossfade_is_over;
+ AVAudioFifo *fifo[2];
+ int64_t pts;
void (*fade_samples)(uint8_t **dst, uint8_t * const *src,
int nb_samples, int channels, int direction,
int64_t start, int range, int curve);
+ void (*crossfade_samples)(uint8_t **dst, uint8_t * const *cf0,
+ uint8_t * const *cf1,
+ int nb_samples, int channels,
+ int curve0, int curve1);
} AudioFadeContext;
enum CurveType { TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR, PAR, EXP, IQSIN, IHSIN, DESE, DESI, NB_CURVES };
@@ -47,52 +57,6 @@ enum CurveType { TRI, QSIN, ESIN, HSIN, LOG, IPAR, QUA, CUB, SQU, CBR, PAR, EXP,
#define OFFSET(x) offsetof(AudioFadeContext, x)
#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-static const AVOption afade_options[] = {
- { "type", "set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FLAGS, "type" },
- { "t", "set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FLAGS, "type" },
- { "in", "fade-in", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "type" },
- { "out", "fade-out", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "type" },
- { "start_sample", "set number of first sample to start fading", OFFSET(start_sample), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, FLAGS },
- { "ss", "set number of first sample to start fading", OFFSET(start_sample), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, FLAGS },
- { "nb_samples", "set number of samples for fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX, FLAGS },
- { "ns", "set number of samples for fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX, FLAGS },
- { "start_time", "set time to start fading", OFFSET(start_time), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
- { "st", "set time to start fading", OFFSET(start_time), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
- { "duration", "set fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
- { "d", "set fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
- { "curve", "set fade curve type", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve" },
- { "c", "set fade curve type", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve" },
- { "tri", "linear slope", 0, AV_OPT_TYPE_CONST, {.i64 = TRI }, 0, 0, FLAGS, "curve" },
- { "qsin", "quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = QSIN }, 0, 0, FLAGS, "curve" },
- { "esin", "exponential sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = ESIN }, 0, 0, FLAGS, "curve" },
- { "hsin", "half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = HSIN }, 0, 0, FLAGS, "curve" },
- { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64 = LOG }, 0, 0, FLAGS, "curve" },
- { "ipar", "inverted parabola", 0, AV_OPT_TYPE_CONST, {.i64 = IPAR }, 0, 0, FLAGS, "curve" },
- { "qua", "quadratic", 0, AV_OPT_TYPE_CONST, {.i64 = QUA }, 0, 0, FLAGS, "curve" },
- { "cub", "cubic", 0, AV_OPT_TYPE_CONST, {.i64 = CUB }, 0, 0, FLAGS, "curve" },
- { "squ", "square root", 0, AV_OPT_TYPE_CONST, {.i64 = SQU }, 0, 0, FLAGS, "curve" },
- { "cbr", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64 = CBR }, 0, 0, FLAGS, "curve" },
- { "par", "parabola", 0, AV_OPT_TYPE_CONST, {.i64 = PAR }, 0, 0, FLAGS, "curve" },
- { "exp", "exponential", 0, AV_OPT_TYPE_CONST, {.i64 = EXP }, 0, 0, FLAGS, "curve" },
- { "iqsin", "inverted quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IQSIN}, 0, 0, FLAGS, "curve" },
- { "ihsin", "inverted half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IHSIN}, 0, 0, FLAGS, "curve" },
- { "dese", "double-exponential seat", 0, AV_OPT_TYPE_CONST, {.i64 = DESE }, 0, 0, FLAGS, "curve" },
- { "desi", "double-exponential sigmoid", 0, AV_OPT_TYPE_CONST, {.i64 = DESI }, 0, 0, FLAGS, "curve" },
- { NULL }
-};
-
-AVFILTER_DEFINE_CLASS(afade);
-
-static av_cold int init(AVFilterContext *ctx)
-{
- AudioFadeContext *s = ctx->priv;
-
- if (INT64_MAX - s->nb_samples < s->start_sample)
- return AVERROR(EINVAL);
-
- return 0;
-}
-
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *formats;
@@ -106,7 +70,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -227,12 +191,12 @@ FADE(flt, float)
FADE(s16, int16_t)
FADE(s32, int32_t)
-static int config_input(AVFilterLink *inlink)
+static int config_output(AVFilterLink *outlink)
{
- AVFilterContext *ctx = inlink->dst;
+ AVFilterContext *ctx = outlink->src;
AudioFadeContext *s = ctx->priv;
- switch (inlink->format) {
+ switch (outlink->format) {
case AV_SAMPLE_FMT_DBL: s->fade_samples = fade_samples_dbl; break;
case AV_SAMPLE_FMT_DBLP: s->fade_samples = fade_samples_dblp; break;
case AV_SAMPLE_FMT_FLT: s->fade_samples = fade_samples_flt; break;
@@ -244,9 +208,57 @@ static int config_input(AVFilterLink *inlink)
}
if (s->duration)
- s->nb_samples = av_rescale(s->duration, inlink->sample_rate, AV_TIME_BASE);
+ s->nb_samples = av_rescale(s->duration, outlink->sample_rate, AV_TIME_BASE);
if (s->start_time)
- s->start_sample = av_rescale(s->start_time, inlink->sample_rate, AV_TIME_BASE);
+ s->start_sample = av_rescale(s->start_time, outlink->sample_rate, AV_TIME_BASE);
+
+ return 0;
+}
+
+#if CONFIG_AFADE_FILTER
+
+static const AVOption afade_options[] = {
+ { "type", "set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FLAGS, "type" },
+ { "t", "set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FLAGS, "type" },
+ { "in", "fade-in", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "type" },
+ { "out", "fade-out", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "type" },
+ { "start_sample", "set number of first sample to start fading", OFFSET(start_sample), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, FLAGS },
+ { "ss", "set number of first sample to start fading", OFFSET(start_sample), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, FLAGS },
+ { "nb_samples", "set number of samples for fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX, FLAGS },
+ { "ns", "set number of samples for fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX, FLAGS },
+ { "start_time", "set time to start fading", OFFSET(start_time), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
+ { "st", "set time to start fading", OFFSET(start_time), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
+ { "duration", "set fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
+ { "d", "set fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
+ { "curve", "set fade curve type", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve" },
+ { "c", "set fade curve type", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve" },
+ { "tri", "linear slope", 0, AV_OPT_TYPE_CONST, {.i64 = TRI }, 0, 0, FLAGS, "curve" },
+ { "qsin", "quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = QSIN }, 0, 0, FLAGS, "curve" },
+ { "esin", "exponential sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = ESIN }, 0, 0, FLAGS, "curve" },
+ { "hsin", "half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = HSIN }, 0, 0, FLAGS, "curve" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64 = LOG }, 0, 0, FLAGS, "curve" },
+ { "ipar", "inverted parabola", 0, AV_OPT_TYPE_CONST, {.i64 = IPAR }, 0, 0, FLAGS, "curve" },
+ { "qua", "quadratic", 0, AV_OPT_TYPE_CONST, {.i64 = QUA }, 0, 0, FLAGS, "curve" },
+ { "cub", "cubic", 0, AV_OPT_TYPE_CONST, {.i64 = CUB }, 0, 0, FLAGS, "curve" },
+ { "squ", "square root", 0, AV_OPT_TYPE_CONST, {.i64 = SQU }, 0, 0, FLAGS, "curve" },
+ { "cbr", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64 = CBR }, 0, 0, FLAGS, "curve" },
+ { "par", "parabola", 0, AV_OPT_TYPE_CONST, {.i64 = PAR }, 0, 0, FLAGS, "curve" },
+ { "exp", "exponential", 0, AV_OPT_TYPE_CONST, {.i64 = EXP }, 0, 0, FLAGS, "curve" },
+ { "iqsin", "inverted quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IQSIN}, 0, 0, FLAGS, "curve" },
+ { "ihsin", "inverted half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IHSIN}, 0, 0, FLAGS, "curve" },
+ { "dese", "double-exponential seat", 0, AV_OPT_TYPE_CONST, {.i64 = DESE }, 0, 0, FLAGS, "curve" },
+ { "desi", "double-exponential sigmoid", 0, AV_OPT_TYPE_CONST, {.i64 = DESI }, 0, 0, FLAGS, "curve" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(afade);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ AudioFadeContext *s = ctx->priv;
+
+ if (INT64_MAX - s->nb_samples < s->start_sample)
+ return AVERROR(EINVAL);
return 0;
}
@@ -301,15 +313,15 @@ static const AVFilterPad avfilter_af_afade_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.filter_frame = filter_frame,
- .config_props = config_input,
},
{ NULL }
};
static const AVFilterPad avfilter_af_afade_outputs[] = {
{
- .name = "default",
- .type = AVMEDIA_TYPE_AUDIO,
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_output,
},
{ NULL }
};
@@ -325,3 +337,344 @@ AVFilter ff_af_afade = {
.priv_class = &afade_class,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
};
+
+#endif /* CONFIG_AFADE_FILTER */
+
+#if CONFIG_ACROSSFADE_FILTER
+
+static const AVOption acrossfade_options[] = {
+ { "nb_samples", "set number of samples for cross fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX/10, FLAGS },
+ { "ns", "set number of samples for cross fade duration", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 44100}, 1, INT32_MAX/10, FLAGS },
+ { "duration", "set cross fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, 60, FLAGS },
+ { "d", "set cross fade duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, 60, FLAGS },
+ { "overlap", "overlap 1st stream end with 2nd stream start", OFFSET(overlap), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, FLAGS },
+ { "o", "overlap 1st stream end with 2nd stream start", OFFSET(overlap), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, FLAGS },
+ { "curve1", "set fade curve type for 1st stream", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve1" },
+ { "c1", "set fade curve type for 1st stream", OFFSET(curve), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve1" },
+ { "tri", "linear slope", 0, AV_OPT_TYPE_CONST, {.i64 = TRI }, 0, 0, FLAGS, "curve1" },
+ { "qsin", "quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = QSIN }, 0, 0, FLAGS, "curve1" },
+ { "esin", "exponential sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = ESIN }, 0, 0, FLAGS, "curve1" },
+ { "hsin", "half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = HSIN }, 0, 0, FLAGS, "curve1" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64 = LOG }, 0, 0, FLAGS, "curve1" },
+ { "ipar", "inverted parabola", 0, AV_OPT_TYPE_CONST, {.i64 = IPAR }, 0, 0, FLAGS, "curve1" },
+ { "qua", "quadratic", 0, AV_OPT_TYPE_CONST, {.i64 = QUA }, 0, 0, FLAGS, "curve1" },
+ { "cub", "cubic", 0, AV_OPT_TYPE_CONST, {.i64 = CUB }, 0, 0, FLAGS, "curve1" },
+ { "squ", "square root", 0, AV_OPT_TYPE_CONST, {.i64 = SQU }, 0, 0, FLAGS, "curve1" },
+ { "cbr", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64 = CBR }, 0, 0, FLAGS, "curve1" },
+ { "par", "parabola", 0, AV_OPT_TYPE_CONST, {.i64 = PAR }, 0, 0, FLAGS, "curve1" },
+ { "exp", "exponential", 0, AV_OPT_TYPE_CONST, {.i64 = EXP }, 0, 0, FLAGS, "curve1" },
+ { "iqsin", "inverted quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IQSIN}, 0, 0, FLAGS, "curve1" },
+ { "ihsin", "inverted half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IHSIN}, 0, 0, FLAGS, "curve1" },
+ { "dese", "double-exponential seat", 0, AV_OPT_TYPE_CONST, {.i64 = DESE }, 0, 0, FLAGS, "curve1" },
+ { "desi", "double-exponential sigmoid", 0, AV_OPT_TYPE_CONST, {.i64 = DESI }, 0, 0, FLAGS, "curve1" },
+ { "curve2", "set fade curve type for 2nd stream", OFFSET(curve2), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve2" },
+ { "c2", "set fade curve type for 2nd stream", OFFSET(curve2), AV_OPT_TYPE_INT, {.i64 = TRI }, 0, NB_CURVES - 1, FLAGS, "curve2" },
+ { "tri", "linear slope", 0, AV_OPT_TYPE_CONST, {.i64 = TRI }, 0, 0, FLAGS, "curve2" },
+ { "qsin", "quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = QSIN }, 0, 0, FLAGS, "curve2" },
+ { "esin", "exponential sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = ESIN }, 0, 0, FLAGS, "curve2" },
+ { "hsin", "half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = HSIN }, 0, 0, FLAGS, "curve2" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64 = LOG }, 0, 0, FLAGS, "curve2" },
+ { "ipar", "inverted parabola", 0, AV_OPT_TYPE_CONST, {.i64 = IPAR }, 0, 0, FLAGS, "curve2" },
+ { "qua", "quadratic", 0, AV_OPT_TYPE_CONST, {.i64 = QUA }, 0, 0, FLAGS, "curve2" },
+ { "cub", "cubic", 0, AV_OPT_TYPE_CONST, {.i64 = CUB }, 0, 0, FLAGS, "curve2" },
+ { "squ", "square root", 0, AV_OPT_TYPE_CONST, {.i64 = SQU }, 0, 0, FLAGS, "curve2" },
+ { "cbr", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64 = CBR }, 0, 0, FLAGS, "curve2" },
+ { "par", "parabola", 0, AV_OPT_TYPE_CONST, {.i64 = PAR }, 0, 0, FLAGS, "curve2" },
+ { "exp", "exponential", 0, AV_OPT_TYPE_CONST, {.i64 = EXP }, 0, 0, FLAGS, "curve2" },
+ { "iqsin", "inverted quarter of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IQSIN}, 0, 0, FLAGS, "curve2" },
+ { "ihsin", "inverted half of sine wave", 0, AV_OPT_TYPE_CONST, {.i64 = IHSIN}, 0, 0, FLAGS, "curve2" },
+ { "dese", "double-exponential seat", 0, AV_OPT_TYPE_CONST, {.i64 = DESE }, 0, 0, FLAGS, "curve2" },
+ { "desi", "double-exponential sigmoid", 0, AV_OPT_TYPE_CONST, {.i64 = DESI }, 0, 0, FLAGS, "curve2" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(acrossfade);
+
+#define CROSSFADE_PLANAR(name, type) \
+static void crossfade_samples_## name ##p(uint8_t **dst, uint8_t * const *cf0, \
+ uint8_t * const *cf1, \
+ int nb_samples, int channels, \
+ int curve0, int curve1) \
+{ \
+ int i, c; \
+ \
+ for (i = 0; i < nb_samples; i++) { \
+ double gain0 = fade_gain(curve0, nb_samples - 1 - i, nb_samples); \
+ double gain1 = fade_gain(curve1, i, nb_samples); \
+ for (c = 0; c < channels; c++) { \
+ type *d = (type *)dst[c]; \
+ const type *s0 = (type *)cf0[c]; \
+ const type *s1 = (type *)cf1[c]; \
+ \
+ d[i] = s0[i] * gain0 + s1[i] * gain1; \
+ } \
+ } \
+}
+
+#define CROSSFADE(name, type) \
+static void crossfade_samples_## name (uint8_t **dst, uint8_t * const *cf0, \
+ uint8_t * const *cf1, \
+ int nb_samples, int channels, \
+ int curve0, int curve1) \
+{ \
+ type *d = (type *)dst[0]; \
+ const type *s0 = (type *)cf0[0]; \
+ const type *s1 = (type *)cf1[0]; \
+ int i, c, k = 0; \
+ \
+ for (i = 0; i < nb_samples; i++) { \
+ double gain0 = fade_gain(curve0, nb_samples - 1 - i, nb_samples); \
+ double gain1 = fade_gain(curve1, i, nb_samples); \
+ for (c = 0; c < channels; c++, k++) \
+ d[k] = s0[k] * gain0 + s1[k] * gain1; \
+ } \
+}
+
+CROSSFADE_PLANAR(dbl, double)
+CROSSFADE_PLANAR(flt, float)
+CROSSFADE_PLANAR(s16, int16_t)
+CROSSFADE_PLANAR(s32, int32_t)
+
+CROSSFADE(dbl, double)
+CROSSFADE(flt, float)
+CROSSFADE(s16, int16_t)
+CROSSFADE(s32, int32_t)
+
+static int acrossfade_filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AudioFadeContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *out, *cf[2] = { NULL };
+ int ret = 0, nb_samples;
+
+ if (s->crossfade_is_over) {
+ in->pts = s->pts;
+ s->pts += av_rescale_q(in->nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ return ff_filter_frame(outlink, in);
+ } else if (inlink == ctx->inputs[0]) {
+ av_audio_fifo_write(s->fifo[0], (void **)in->extended_data, in->nb_samples);
+
+ nb_samples = av_audio_fifo_size(s->fifo[0]) - s->nb_samples;
+ if (nb_samples > 0) {
+ out = ff_get_audio_buffer(outlink, nb_samples);
+ if (!out) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ av_audio_fifo_read(s->fifo[0], (void **)out->extended_data, nb_samples);
+ out->pts = s->pts;
+ s->pts += av_rescale_q(nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ ret = ff_filter_frame(outlink, out);
+ }
+ } else if (av_audio_fifo_size(s->fifo[1]) < s->nb_samples) {
+ if (!s->overlap && av_audio_fifo_size(s->fifo[0]) > 0) {
+ nb_samples = av_audio_fifo_size(s->fifo[0]);
+
+ cf[0] = ff_get_audio_buffer(outlink, nb_samples);
+ out = ff_get_audio_buffer(outlink, nb_samples);
+ if (!out || !cf[0]) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ av_audio_fifo_read(s->fifo[0], (void **)cf[0]->extended_data, nb_samples);
+
+ s->fade_samples(out->extended_data, cf[0]->extended_data, nb_samples,
+ outlink->channels, -1, nb_samples - 1, nb_samples, s->curve);
+ out->pts = s->pts;
+ s->pts += av_rescale_q(nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ ret = ff_filter_frame(outlink, out);
+ if (ret < 0)
+ goto fail;
+ }
+
+ av_audio_fifo_write(s->fifo[1], (void **)in->extended_data, in->nb_samples);
+ } else if (av_audio_fifo_size(s->fifo[1]) >= s->nb_samples) {
+ if (s->overlap) {
+ cf[0] = ff_get_audio_buffer(outlink, s->nb_samples);
+ cf[1] = ff_get_audio_buffer(outlink, s->nb_samples);
+ out = ff_get_audio_buffer(outlink, s->nb_samples);
+ if (!out || !cf[0] || !cf[1]) {
+ av_frame_free(&out);
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ av_audio_fifo_read(s->fifo[0], (void **)cf[0]->extended_data, s->nb_samples);
+ av_audio_fifo_read(s->fifo[1], (void **)cf[1]->extended_data, s->nb_samples);
+
+ s->crossfade_samples(out->extended_data, cf[0]->extended_data,
+ cf[1]->extended_data,
+ s->nb_samples, av_frame_get_channels(in),
+ s->curve, s->curve2);
+ out->pts = s->pts;
+ s->pts += av_rescale_q(s->nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ ret = ff_filter_frame(outlink, out);
+ if (ret < 0)
+ goto fail;
+ } else {
+ out = ff_get_audio_buffer(outlink, s->nb_samples);
+ cf[1] = ff_get_audio_buffer(outlink, s->nb_samples);
+ if (!out || !cf[1]) {
+ ret = AVERROR(ENOMEM);
+ av_frame_free(&out);
+ goto fail;
+ }
+
+ av_audio_fifo_read(s->fifo[1], (void **)cf[1]->extended_data, s->nb_samples);
+
+ s->fade_samples(out->extended_data, cf[1]->extended_data, s->nb_samples,
+ outlink->channels, 1, 0, s->nb_samples, s->curve2);
+ out->pts = s->pts;
+ s->pts += av_rescale_q(s->nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ ret = ff_filter_frame(outlink, out);
+ if (ret < 0)
+ goto fail;
+ }
+
+ nb_samples = av_audio_fifo_size(s->fifo[1]);
+ if (nb_samples > 0) {
+ out = ff_get_audio_buffer(outlink, nb_samples);
+ if (!out) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ av_audio_fifo_read(s->fifo[1], (void **)out->extended_data, nb_samples);
+ out->pts = s->pts;
+ s->pts += av_rescale_q(nb_samples,
+ (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
+ ret = ff_filter_frame(outlink, out);
+ }
+ s->crossfade_is_over = 1;
+ }
+
+fail:
+ av_frame_free(&in);
+ av_frame_free(&cf[0]);
+ av_frame_free(&cf[1]);
+ return ret;
+}
+
+static int acrossfade_request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AudioFadeContext *s = ctx->priv;
+ int ret = 0;
+
+ if (!s->cf0_eof) {
+ AVFilterLink *cf0 = ctx->inputs[0];
+ ret = ff_request_frame(cf0);
+ if (ret < 0 && ret != AVERROR_EOF)
+ return ret;
+ if (ret == AVERROR_EOF) {
+ s->cf0_eof = 1;
+ ret = 0;
+ }
+ } else {
+ AVFilterLink *cf1 = ctx->inputs[1];
+ int nb_samples = av_audio_fifo_size(s->fifo[1]);
+
+ ret = ff_request_frame(cf1);
+ if (ret == AVERROR_EOF && nb_samples > 0) {
+ AVFrame *out = ff_get_audio_buffer(outlink, nb_samples);
+ if (!out)
+ return AVERROR(ENOMEM);
+
+ av_audio_fifo_read(s->fifo[1], (void **)out->extended_data, nb_samples);
+ ret = ff_filter_frame(outlink, out);
+ }
+ }
+
+ return ret;
+}
+
+static int acrossfade_config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AudioFadeContext *s = ctx->priv;
+
+ if (ctx->inputs[0]->sample_rate != ctx->inputs[1]->sample_rate) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Inputs must have the same sample rate "
+ "%d for in0 vs %d for in1\n",
+ ctx->inputs[0]->sample_rate, ctx->inputs[1]->sample_rate);
+ return AVERROR(EINVAL);
+ }
+
+ outlink->sample_rate = ctx->inputs[0]->sample_rate;
+ outlink->time_base = ctx->inputs[0]->time_base;
+ outlink->channel_layout = ctx->inputs[0]->channel_layout;
+ outlink->channels = ctx->inputs[0]->channels;
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+
+ switch (outlink->format) {
+ case AV_SAMPLE_FMT_DBL: s->crossfade_samples = crossfade_samples_dbl; break;
+ case AV_SAMPLE_FMT_DBLP: s->crossfade_samples = crossfade_samples_dblp; break;
+ case AV_SAMPLE_FMT_FLT: s->crossfade_samples = crossfade_samples_flt; break;
+ case AV_SAMPLE_FMT_FLTP: s->crossfade_samples = crossfade_samples_fltp; break;
+ case AV_SAMPLE_FMT_S16: s->crossfade_samples = crossfade_samples_s16; break;
+ case AV_SAMPLE_FMT_S16P: s->crossfade_samples = crossfade_samples_s16p; break;
+ case AV_SAMPLE_FMT_S32: s->crossfade_samples = crossfade_samples_s32; break;
+ case AV_SAMPLE_FMT_S32P: s->crossfade_samples = crossfade_samples_s32p; break;
+ }
+
+ config_output(outlink);
+
+ s->fifo[0] = av_audio_fifo_alloc(outlink->format, outlink->channels, s->nb_samples);
+ s->fifo[1] = av_audio_fifo_alloc(outlink->format, outlink->channels, s->nb_samples);
+ if (!s->fifo[0] || !s->fifo[1])
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ AudioFadeContext *s = ctx->priv;
+
+ av_audio_fifo_free(s->fifo[0]);
+ av_audio_fifo_free(s->fifo[1]);
+}
+
+static const AVFilterPad avfilter_af_acrossfade_inputs[] = {
+ {
+ .name = "crossfade0",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = acrossfade_filter_frame,
+ },
+ {
+ .name = "crossfade1",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = acrossfade_filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad avfilter_af_acrossfade_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .request_frame = acrossfade_request_frame,
+ .config_props = acrossfade_config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_acrossfade = {
+ .name = "acrossfade",
+ .description = NULL_IF_CONFIG_SMALL("Cross fade two input audio streams."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(AudioFadeContext),
+ .uninit = uninit,
+ .priv_class = &acrossfade_class,
+ .inputs = avfilter_af_acrossfade_inputs,
+ .outputs = avfilter_af_acrossfade_outputs,
+};
+
+#endif /* CONFIG_ACROSSFADE_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_alimiter.c b/chromium/third_party/ffmpeg/libavfilter/af_alimiter.c
new file mode 100644
index 00000000000..37839de7bf1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_alimiter.c
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others
+ * Copyright (c) 2015 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
+ */
+
+/**
+ * @file
+ * Lookahead limiter filter
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+
+typedef struct AudioLimiterContext {
+ const AVClass *class;
+
+ double limit;
+ double attack;
+ double release;
+ double att;
+ int auto_release;
+ double asc;
+ int asc_c;
+ int asc_pos;
+ double asc_coeff;
+
+ double *buffer;
+ int buffer_size;
+ int pos;
+ int *nextpos;
+ double *nextdelta;
+
+ double delta;
+ int nextiter;
+ int nextlen;
+ int asc_changed;
+} AudioLimiterContext;
+
+#define OFFSET(x) offsetof(AudioLimiterContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption alimiter_options[] = {
+ { "limit", "set limit", OFFSET(limit), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.0625, 1, A|F },
+ { "attack", "set attack", OFFSET(attack), AV_OPT_TYPE_DOUBLE, {.dbl=5}, 0.1, 80, A|F },
+ { "release", "set release", OFFSET(release), AV_OPT_TYPE_DOUBLE, {.dbl=50}, 1, 8000, A|F },
+ { "asc", "enable asc", OFFSET(auto_release), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A|F },
+ { "asc_level", "set asc level", OFFSET(asc_coeff), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, A|F },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(alimiter);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ AudioLimiterContext *s = ctx->priv;
+
+ s->attack /= 1000.;
+ s->release /= 1000.;
+ s->att = 1.;
+ s->asc_pos = -1;
+ s->asc_coeff = pow(0.5, s->asc_coeff - 0.5) * 2 * -1;
+
+ return 0;
+}
+
+static double get_rdelta(AudioLimiterContext *s, double release, int sample_rate,
+ double peak, double limit, double patt, int asc)
+{
+ double rdelta = (1.0 - patt) / (sample_rate * release);
+
+ if (asc && s->auto_release && s->asc_c > 0) {
+ double a_att = limit / (s->asc_coeff * s->asc) * (double)s->asc_c;
+
+ if (a_att > patt) {
+ double delta = FFMAX((a_att - patt) / (sample_rate * release), rdelta / 10);
+
+ if (delta < rdelta)
+ rdelta = delta;
+ }
+ }
+
+ return rdelta;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AudioLimiterContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ const double *src = (const double *)in->data[0];
+ const int channels = inlink->channels;
+ const int buffer_size = s->buffer_size;
+ double *dst, *buffer = s->buffer;
+ const double release = s->release;
+ const double limit = s->limit;
+ double *nextdelta = s->nextdelta;
+ int *nextpos = s->nextpos;
+ AVFrame *out;
+ double *buf;
+ int n, c, i;
+
+ if (av_frame_is_writable(in)) {
+ out = in;
+ } else {
+ out = ff_get_audio_buffer(inlink, in->nb_samples);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+ }
+ dst = (double *)out->data[0];
+
+ for (n = 0; n < in->nb_samples; n++) {
+ double peak = 0;
+
+ for (c = 0; c < channels; c++) {
+ double sample = src[c];
+
+ buffer[s->pos + c] = sample;
+ peak = FFMAX(peak, fabs(sample));
+ }
+
+ if (s->auto_release && peak > limit) {
+ s->asc += peak;
+ s->asc_c++;
+ }
+
+ if (peak > limit) {
+ double patt = FFMIN(limit / peak, 1.);
+ double rdelta = get_rdelta(s, release, inlink->sample_rate,
+ peak, limit, patt, 0);
+ double delta = (limit / peak - s->att) / buffer_size * channels;
+ int found = 0;
+
+ if (delta < s->delta) {
+ s->delta = delta;
+ nextpos[0] = s->pos;
+ nextpos[1] = -1;
+ nextdelta[0] = rdelta;
+ s->nextlen = 1;
+ s->nextiter= 0;
+ } else {
+ for (i = s->nextiter; i < s->nextiter + s->nextlen; i++) {
+ int j = i % buffer_size;
+ double ppeak, pdelta;
+
+ ppeak = fabs(buffer[nextpos[j]]) > fabs(buffer[nextpos[j] + 1]) ?
+ fabs(buffer[nextpos[j]]) : fabs(buffer[nextpos[j] + 1]);
+ pdelta = (limit / peak - limit / ppeak) / (((buffer_size - nextpos[j] + s->pos) % buffer_size) / channels);
+ if (pdelta < nextdelta[j]) {
+ nextdelta[j] = pdelta;
+ found = 1;
+ break;
+ }
+ }
+ if (found) {
+ s->nextlen = i - s->nextiter + 1;
+ nextpos[(s->nextiter + s->nextlen) % buffer_size] = s->pos;
+ nextdelta[(s->nextiter + s->nextlen) % buffer_size] = rdelta;
+ nextpos[(s->nextiter + s->nextlen + 1) % buffer_size] = -1;
+ s->nextlen++;
+ }
+ }
+ }
+
+ buf = &s->buffer[(s->pos + channels) % buffer_size];
+ peak = 0;
+ for (c = 0; c < channels; c++) {
+ double sample = buf[c];
+
+ peak = FFMAX(peak, fabs(sample));
+ }
+
+ if (s->pos == s->asc_pos && !s->asc_changed)
+ s->asc_pos = -1;
+
+ if (s->auto_release && s->asc_pos == -1 && peak > limit) {
+ s->asc -= peak;
+ s->asc_c--;
+ }
+
+ s->att += s->delta;
+
+ for (c = 0; c < channels; c++)
+ dst[c] = buf[c] * s->att;
+
+ if ((s->pos + channels) % buffer_size == nextpos[s->nextiter]) {
+ if (s->auto_release) {
+ s->delta = get_rdelta(s, release, inlink->sample_rate,
+ peak, limit, s->att, 1);
+ if (s->nextlen > 1) {
+ int pnextpos = nextpos[(s->nextiter + 1) % buffer_size];
+ double ppeak = fabs(buffer[pnextpos]) > fabs(buffer[pnextpos + 1]) ?
+ fabs(buffer[pnextpos]) :
+ fabs(buffer[pnextpos + 1]);
+ double pdelta = (limit / ppeak - s->att) /
+ (((buffer_size + pnextpos -
+ ((s->pos + channels) % buffer_size)) %
+ buffer_size) / channels);
+ if (pdelta < s->delta)
+ s->delta = pdelta;
+ }
+ } else {
+ s->delta = nextdelta[s->nextiter];
+ s->att = limit / peak;
+ }
+
+ s->nextlen -= 1;
+ nextpos[s->nextiter] = -1;
+ s->nextiter = (s->nextiter + 1) % buffer_size;
+ }
+
+ if (s->att > 1.) {
+ s->att = 1.;
+ s->delta = 0.;
+ s->nextiter = 0;
+ s->nextlen = 0;
+ nextpos[0] = -1;
+ }
+
+ if (s->att <= 0.) {
+ s->att = 0.0000000000001;
+ s->delta = (1.0 - s->att) / (inlink->sample_rate * release);
+ }
+
+ if (s->att != 1. && (1. - s->att) < 0.0000000000001)
+ s->att = 1.;
+
+ if (s->delta != 0. && fabs(s->delta) < 0.00000000000001)
+ s->delta = 0.;
+
+ for (c = 0; c < channels; c++)
+ dst[c] = av_clipd(dst[c], -limit, limit);
+
+ s->pos = (s->pos + channels) % buffer_size;
+ src += channels;
+ dst += channels;
+ }
+
+ if (in != out)
+ av_frame_free(&in);
+
+ return ff_filter_frame(outlink, out);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+ AVFilterChannelLayouts *layouts;
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_DBL,
+ AV_SAMPLE_FMT_NONE
+ };
+ int 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_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AudioLimiterContext *s = ctx->priv;
+ int obuffer_size;
+
+ obuffer_size = inlink->sample_rate * inlink->channels * 100 / 1000. + inlink->channels;
+ if (obuffer_size < inlink->channels)
+ return AVERROR(EINVAL);
+
+ s->buffer = av_calloc(obuffer_size, sizeof(*s->buffer));
+ s->nextdelta = av_calloc(obuffer_size, sizeof(*s->nextdelta));
+ s->nextpos = av_malloc_array(obuffer_size, sizeof(*s->nextpos));
+ if (!s->buffer || !s->nextdelta || !s->nextpos)
+ return AVERROR(ENOMEM);
+
+ memset(s->nextpos, -1, obuffer_size * sizeof(*s->nextpos));
+ s->buffer_size = inlink->sample_rate * s->attack * inlink->channels;
+ s->buffer_size -= s->buffer_size % inlink->channels;
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ AudioLimiterContext *s = ctx->priv;
+
+ av_freep(&s->buffer);
+ av_freep(&s->nextdelta);
+ av_freep(&s->nextpos);
+}
+
+static const AVFilterPad alimiter_inputs[] = {
+ {
+ .name = "main",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad alimiter_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_alimiter = {
+ .name = "alimiter",
+ .description = NULL_IF_CONFIG_SMALL("Lookahead limiter."),
+ .priv_size = sizeof(AudioLimiterContext),
+ .priv_class = &alimiter_class,
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .inputs = alimiter_inputs,
+ .outputs = alimiter_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_amerge.c b/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
index 0a0a79fd292..410d6134d7b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_amerge.c
@@ -32,7 +32,7 @@
#include "bufferqueue.h"
#include "internal.h"
-#define SWR_CH_MAX 32
+#define SWR_CH_MAX 64
typedef struct {
const AVClass *class;
@@ -60,27 +60,27 @@ AVFILTER_DEFINE_CLASS(amerge);
static av_cold void uninit(AVFilterContext *ctx)
{
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
int i;
- for (i = 0; i < am->nb_inputs; i++) {
- if (am->in)
- ff_bufqueue_discard_all(&am->in[i].queue);
+ for (i = 0; i < s->nb_inputs; i++) {
+ if (s->in)
+ ff_bufqueue_discard_all(&s->in[i].queue);
if (ctx->input_pads)
av_freep(&ctx->input_pads[i].name);
}
- av_freep(&am->in);
+ av_freep(&s->in);
}
static int query_formats(AVFilterContext *ctx)
{
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
int64_t inlayout[SWR_CH_MAX], outlayout = 0;
AVFilterFormats *formats;
AVFilterChannelLayouts *layouts;
int i, overlap = 0, nb_ch = 0;
- for (i = 0; i < am->nb_inputs; i++) {
+ for (i = 0; i < s->nb_inputs; i++) {
if (!ctx->inputs[i]->in_channel_layouts ||
!ctx->inputs[i]->in_channel_layouts->nb_channel_layouts) {
av_log(ctx, AV_LOG_WARNING,
@@ -93,11 +93,11 @@ static int query_formats(AVFilterContext *ctx)
av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]);
av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1);
}
- am->in[i].nb_ch = av_get_channel_layout_nb_channels(inlayout[i]);
+ s->in[i].nb_ch = av_get_channel_layout_nb_channels(inlayout[i]);
if (outlayout & inlayout[i])
overlap++;
outlayout |= inlayout[i];
- nb_ch += am->in[i].nb_ch;
+ nb_ch += s->in[i].nb_ch;
}
if (nb_ch > SWR_CH_MAX) {
av_log(ctx, AV_LOG_ERROR, "Too many channels (max %d)\n", SWR_CH_MAX);
@@ -108,25 +108,25 @@ static int query_formats(AVFilterContext *ctx)
"Input channel layouts overlap: "
"output layout will be determined by the number of distinct input channels\n");
for (i = 0; i < nb_ch; i++)
- am->route[i] = i;
+ s->route[i] = i;
outlayout = av_get_default_channel_layout(nb_ch);
- if (!outlayout)
- outlayout = ((int64_t)1 << nb_ch) - 1;
+ if (!outlayout && nb_ch)
+ outlayout = 0xFFFFFFFFFFFFFFFFULL >> (64 - nb_ch);
} else {
int *route[SWR_CH_MAX];
int c, out_ch_number = 0;
- route[0] = am->route;
- for (i = 1; i < am->nb_inputs; i++)
- route[i] = route[i - 1] + am->in[i - 1].nb_ch;
+ route[0] = s->route;
+ for (i = 1; i < s->nb_inputs; i++)
+ route[i] = route[i - 1] + s->in[i - 1].nb_ch;
for (c = 0; c < 64; c++)
- for (i = 0; i < am->nb_inputs; i++)
+ for (i = 0; i < s->nb_inputs; i++)
if ((inlayout[i] >> c) & 1)
*(route[i]++) = out_ch_number++;
}
formats = ff_make_format_list(ff_packed_sample_fmts_array);
ff_set_common_formats(ctx, formats);
- for (i = 0; i < am->nb_inputs; i++) {
+ for (i = 0; i < s->nb_inputs; i++) {
layouts = NULL;
ff_add_channel_layout(&layouts, inlayout[i]);
ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts);
@@ -141,11 +141,11 @@ static int query_formats(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
AVBPrint bp;
int i;
- for (i = 1; i < am->nb_inputs; i++) {
+ for (i = 1; i < s->nb_inputs; i++) {
if (ctx->inputs[i]->sample_rate != ctx->inputs[0]->sample_rate) {
av_log(ctx, AV_LOG_ERROR,
"Inputs must have the same sample rate "
@@ -154,12 +154,12 @@ static int config_output(AVFilterLink *outlink)
return AVERROR(EINVAL);
}
}
- am->bps = av_get_bytes_per_sample(ctx->outputs[0]->format);
+ s->bps = av_get_bytes_per_sample(ctx->outputs[0]->format);
outlink->sample_rate = ctx->inputs[0]->sample_rate;
outlink->time_base = ctx->inputs[0]->time_base;
av_bprint_init(&bp, 0, 1);
- for (i = 0; i < am->nb_inputs; i++) {
+ for (i = 0; i < s->nb_inputs; i++) {
av_bprintf(&bp, "%sin%d:", i ? " + " : "", i);
av_bprint_channel_layout(&bp, -1, ctx->inputs[i]->channel_layout);
}
@@ -173,11 +173,11 @@ static int config_output(AVFilterLink *outlink)
static int request_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
int i, ret;
- for (i = 0; i < am->nb_inputs; i++)
- if (!am->in[i].nb_samples)
+ for (i = 0; i < s->nb_inputs; i++)
+ if (!s->in[i].nb_samples)
if ((ret = ff_request_frame(ctx->inputs[i])) < 0)
return ret;
return 0;
@@ -223,27 +223,27 @@ static inline void copy_samples(int nb_inputs, struct amerge_input in[],
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
{
AVFilterContext *ctx = inlink->dst;
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
AVFilterLink *const outlink = ctx->outputs[0];
int input_number;
int nb_samples, ns, i;
AVFrame *outbuf, *inbuf[SWR_CH_MAX];
uint8_t *ins[SWR_CH_MAX], *outs;
- for (input_number = 0; input_number < am->nb_inputs; input_number++)
+ for (input_number = 0; input_number < s->nb_inputs; input_number++)
if (inlink == ctx->inputs[input_number])
break;
- av_assert1(input_number < am->nb_inputs);
- if (ff_bufqueue_is_full(&am->in[input_number].queue)) {
+ av_assert1(input_number < s->nb_inputs);
+ if (ff_bufqueue_is_full(&s->in[input_number].queue)) {
av_frame_free(&insamples);
return AVERROR(ENOMEM);
}
- ff_bufqueue_add(ctx, &am->in[input_number].queue, av_frame_clone(insamples));
- am->in[input_number].nb_samples += insamples->nb_samples;
+ ff_bufqueue_add(ctx, &s->in[input_number].queue, av_frame_clone(insamples));
+ s->in[input_number].nb_samples += insamples->nb_samples;
av_frame_free(&insamples);
- nb_samples = am->in[0].nb_samples;
- for (i = 1; i < am->nb_inputs; i++)
- nb_samples = FFMIN(nb_samples, am->in[i].nb_samples);
+ nb_samples = s->in[0].nb_samples;
+ for (i = 1; i < s->nb_inputs; i++)
+ nb_samples = FFMIN(nb_samples, s->in[i].nb_samples);
if (!nb_samples)
return 0;
@@ -251,15 +251,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if (!outbuf)
return AVERROR(ENOMEM);
outs = outbuf->data[0];
- for (i = 0; i < am->nb_inputs; i++) {
- inbuf[i] = ff_bufqueue_peek(&am->in[i].queue, 0);
+ for (i = 0; i < s->nb_inputs; i++) {
+ inbuf[i] = ff_bufqueue_peek(&s->in[i].queue, 0);
ins[i] = inbuf[i]->data[0] +
- am->in[i].pos * am->in[i].nb_ch * am->bps;
+ s->in[i].pos * s->in[i].nb_ch * s->bps;
}
av_frame_copy_props(outbuf, inbuf[0]);
outbuf->pts = inbuf[0]->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
inbuf[0]->pts +
- av_rescale_q(am->in[0].pos,
+ av_rescale_q(s->in[0].pos,
av_make_q(1, ctx->inputs[0]->sample_rate),
ctx->outputs[0]->time_base);
@@ -269,34 +269,34 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
while (nb_samples) {
ns = nb_samples;
- for (i = 0; i < am->nb_inputs; i++)
- ns = FFMIN(ns, inbuf[i]->nb_samples - am->in[i].pos);
+ for (i = 0; i < s->nb_inputs; i++)
+ ns = FFMIN(ns, inbuf[i]->nb_samples - s->in[i].pos);
/* Unroll the most common sample formats: speed +~350% for the loop,
+~13% overall (including two common decoders) */
- switch (am->bps) {
+ switch (s->bps) {
case 1:
- copy_samples(am->nb_inputs, am->in, am->route, ins, &outs, ns, 1);
+ copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, ns, 1);
break;
case 2:
- copy_samples(am->nb_inputs, am->in, am->route, ins, &outs, ns, 2);
+ copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, ns, 2);
break;
case 4:
- copy_samples(am->nb_inputs, am->in, am->route, ins, &outs, ns, 4);
+ copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, ns, 4);
break;
default:
- copy_samples(am->nb_inputs, am->in, am->route, ins, &outs, ns, am->bps);
+ copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, ns, s->bps);
break;
}
nb_samples -= ns;
- for (i = 0; i < am->nb_inputs; i++) {
- am->in[i].nb_samples -= ns;
- am->in[i].pos += ns;
- if (am->in[i].pos == inbuf[i]->nb_samples) {
- am->in[i].pos = 0;
+ for (i = 0; i < s->nb_inputs; i++) {
+ s->in[i].nb_samples -= ns;
+ s->in[i].pos += ns;
+ if (s->in[i].pos == inbuf[i]->nb_samples) {
+ s->in[i].pos = 0;
av_frame_free(&inbuf[i]);
- ff_bufqueue_get(&am->in[i].queue);
- inbuf[i] = ff_bufqueue_peek(&am->in[i].queue, 0);
+ ff_bufqueue_get(&s->in[i].queue);
+ inbuf[i] = ff_bufqueue_peek(&s->in[i].queue, 0);
ins[i] = inbuf[i] ? inbuf[i]->data[0] : NULL;
}
}
@@ -306,13 +306,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
static av_cold int init(AVFilterContext *ctx)
{
- AMergeContext *am = ctx->priv;
+ AMergeContext *s = ctx->priv;
int i;
- am->in = av_calloc(am->nb_inputs, sizeof(*am->in));
- if (!am->in)
+ s->in = av_calloc(s->nb_inputs, sizeof(*s->in));
+ if (!s->in)
return AVERROR(ENOMEM);
- for (i = 0; i < am->nb_inputs; i++) {
+ for (i = 0; i < s->nb_inputs; i++) {
char *name = av_asprintf("in%d", i);
AVFilterPad pad = {
.name = name,
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_apad.c b/chromium/third_party/ffmpeg/libavfilter/af_apad.c
index eafc7050e82..0a2d4206a9c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_apad.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_apad.c
@@ -57,15 +57,15 @@ AVFILTER_DEFINE_CLASS(apad);
static av_cold int init(AVFilterContext *ctx)
{
- APadContext *apad = ctx->priv;
+ APadContext *s = ctx->priv;
- apad->next_pts = AV_NOPTS_VALUE;
- if (apad->whole_len >= 0 && apad->pad_len >= 0) {
+ s->next_pts = AV_NOPTS_VALUE;
+ if (s->whole_len >= 0 && s->pad_len >= 0) {
av_log(ctx, AV_LOG_ERROR, "Both whole and pad length are set, this is not possible\n");
return AVERROR(EINVAL);
}
- apad->pad_len_left = apad->pad_len;
- apad->whole_len_left = apad->whole_len;
+ s->pad_len_left = s->pad_len;
+ s->whole_len_left = s->whole_len;
return 0;
}
@@ -73,38 +73,38 @@ static av_cold int init(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
- APadContext *apad = ctx->priv;
+ APadContext *s = ctx->priv;
- if (apad->whole_len >= 0) {
- apad->whole_len_left = FFMAX(apad->whole_len_left - frame->nb_samples, 0);
+ if (s->whole_len >= 0) {
+ s->whole_len_left = FFMAX(s->whole_len_left - frame->nb_samples, 0);
av_log(ctx, AV_LOG_DEBUG,
- "n_out:%d whole_len_left:%"PRId64"\n", frame->nb_samples, apad->whole_len_left);
+ "n_out:%d whole_len_left:%"PRId64"\n", frame->nb_samples, s->whole_len_left);
}
- apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
+ s->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
return ff_filter_frame(ctx->outputs[0], frame);
}
static int request_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- APadContext *apad = ctx->priv;
+ APadContext *s = ctx->priv;
int ret;
ret = ff_request_frame(ctx->inputs[0]);
if (ret == AVERROR_EOF && !ctx->is_disabled) {
- int n_out = apad->packet_size;
+ int n_out = s->packet_size;
AVFrame *outsamplesref;
- if (apad->whole_len >= 0 && apad->pad_len < 0) {
- apad->pad_len = apad->pad_len_left = apad->whole_len_left;
+ if (s->whole_len >= 0 && s->pad_len < 0) {
+ s->pad_len = s->pad_len_left = s->whole_len_left;
}
- if (apad->pad_len >=0 || apad->whole_len >= 0) {
- n_out = FFMIN(n_out, apad->pad_len_left);
- apad->pad_len_left -= n_out;
+ if (s->pad_len >=0 || s->whole_len >= 0) {
+ n_out = FFMIN(n_out, s->pad_len_left);
+ s->pad_len_left -= n_out;
av_log(ctx, AV_LOG_DEBUG,
- "padding n_out:%d pad_len_left:%"PRId64"\n", n_out, apad->pad_len_left);
+ "padding n_out:%d pad_len_left:%"PRId64"\n", n_out, s->pad_len_left);
}
if (!n_out)
@@ -122,9 +122,9 @@ static int request_frame(AVFilterLink *outlink)
av_frame_get_channels(outsamplesref),
outsamplesref->format);
- outsamplesref->pts = apad->next_pts;
- if (apad->next_pts != AV_NOPTS_VALUE)
- apad->next_pts += av_rescale_q(n_out, (AVRational){1, outlink->sample_rate}, outlink->time_base);
+ outsamplesref->pts = s->next_pts;
+ if (s->next_pts != AV_NOPTS_VALUE)
+ s->next_pts += av_rescale_q(n_out, (AVRational){1, outlink->sample_rate}, outlink->time_base);
return ff_filter_frame(outlink, outsamplesref);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aphaser.c b/chromium/third_party/ffmpeg/libavfilter/af_aphaser.c
index 582f6e79819..33ecb1a7fbe 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aphaser.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aphaser.c
@@ -47,7 +47,7 @@ typedef struct AudioPhaserContext {
int delay_pos, modulation_pos;
- void (*phaser)(struct AudioPhaserContext *p,
+ void (*phaser)(struct AudioPhaserContext *s,
uint8_t * const *src, uint8_t **dst,
int nb_samples, int channels);
} AudioPhaserContext;
@@ -73,11 +73,11 @@ AVFILTER_DEFINE_CLASS(aphaser);
static av_cold int init(AVFilterContext *ctx)
{
- AudioPhaserContext *p = ctx->priv;
+ AudioPhaserContext *s = ctx->priv;
- if (p->in_gain > (1 - p->decay * p->decay))
+ if (s->in_gain > (1 - s->decay * s->decay))
av_log(ctx, AV_LOG_WARNING, "in_gain may cause clipping\n");
- if (p->in_gain / (1 - p->decay) > 1 / p->out_gain)
+ if (s->in_gain / (1 - s->decay) > 1 / s->out_gain)
av_log(ctx, AV_LOG_WARNING, "out_gain may cause clipping\n");
return 0;
@@ -96,7 +96,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -119,75 +119,75 @@ static int query_formats(AVFilterContext *ctx)
#define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
#define PHASER_PLANAR(name, type) \
-static void phaser_## name ##p(AudioPhaserContext *p, \
- uint8_t * const *src, uint8_t **dst, \
+static void phaser_## name ##p(AudioPhaserContext *s, \
+ uint8_t * const *ssrc, uint8_t **ddst, \
int nb_samples, int channels) \
{ \
int i, c, delay_pos, modulation_pos; \
\
av_assert0(channels > 0); \
for (c = 0; c < channels; c++) { \
- type *s = (type *)src[c]; \
- type *d = (type *)dst[c]; \
- double *buffer = p->delay_buffer + \
- c * p->delay_buffer_length; \
+ type *src = (type *)ssrc[c]; \
+ type *dst = (type *)ddst[c]; \
+ double *buffer = s->delay_buffer + \
+ c * s->delay_buffer_length; \
\
- delay_pos = p->delay_pos; \
- modulation_pos = p->modulation_pos; \
+ delay_pos = s->delay_pos; \
+ modulation_pos = s->modulation_pos; \
\
- for (i = 0; i < nb_samples; i++, s++, d++) { \
- double v = *s * p->in_gain + buffer[ \
- MOD(delay_pos + p->modulation_buffer[ \
+ for (i = 0; i < nb_samples; i++, src++, dst++) { \
+ double v = *src * s->in_gain + buffer[ \
+ MOD(delay_pos + s->modulation_buffer[ \
modulation_pos], \
- p->delay_buffer_length)] * p->decay; \
+ s->delay_buffer_length)] * s->decay; \
\
modulation_pos = MOD(modulation_pos + 1, \
- p->modulation_buffer_length); \
- delay_pos = MOD(delay_pos + 1, p->delay_buffer_length); \
+ s->modulation_buffer_length); \
+ delay_pos = MOD(delay_pos + 1, s->delay_buffer_length); \
buffer[delay_pos] = v; \
\
- *d = v * p->out_gain; \
+ *dst = v * s->out_gain; \
} \
} \
\
- p->delay_pos = delay_pos; \
- p->modulation_pos = modulation_pos; \
+ s->delay_pos = delay_pos; \
+ s->modulation_pos = modulation_pos; \
}
#define PHASER(name, type) \
-static void phaser_## name (AudioPhaserContext *p, \
- uint8_t * const *src, uint8_t **dst, \
+static void phaser_## name (AudioPhaserContext *s, \
+ uint8_t * const *ssrc, uint8_t **ddst, \
int nb_samples, int channels) \
{ \
int i, c, delay_pos, modulation_pos; \
- type *s = (type *)src[0]; \
- type *d = (type *)dst[0]; \
- double *buffer = p->delay_buffer; \
+ type *src = (type *)ssrc[0]; \
+ type *dst = (type *)ddst[0]; \
+ double *buffer = s->delay_buffer; \
\
- delay_pos = p->delay_pos; \
- modulation_pos = p->modulation_pos; \
+ delay_pos = s->delay_pos; \
+ modulation_pos = s->modulation_pos; \
\
for (i = 0; i < nb_samples; i++) { \
- int pos = MOD(delay_pos + p->modulation_buffer[modulation_pos], \
- p->delay_buffer_length) * channels; \
+ int pos = MOD(delay_pos + s->modulation_buffer[modulation_pos], \
+ s->delay_buffer_length) * channels; \
int npos; \
\
- delay_pos = MOD(delay_pos + 1, p->delay_buffer_length); \
+ delay_pos = MOD(delay_pos + 1, s->delay_buffer_length); \
npos = delay_pos * channels; \
- for (c = 0; c < channels; c++, s++, d++) { \
- double v = *s * p->in_gain + buffer[pos + c] * p->decay; \
+ for (c = 0; c < channels; c++, src++, dst++) { \
+ double v = *src * s->in_gain + buffer[pos + c] * s->decay; \
\
buffer[npos + c] = v; \
\
- *d = v * p->out_gain; \
+ *dst = v * s->out_gain; \
} \
\
modulation_pos = MOD(modulation_pos + 1, \
- p->modulation_buffer_length); \
+ s->modulation_buffer_length); \
} \
\
- p->delay_pos = delay_pos; \
- p->modulation_pos = modulation_pos; \
+ s->delay_pos = delay_pos; \
+ s->modulation_pos = modulation_pos; \
}
PHASER_PLANAR(dbl, double)
@@ -202,36 +202,36 @@ PHASER(s32, int32_t)
static int config_output(AVFilterLink *outlink)
{
- AudioPhaserContext *p = outlink->src->priv;
+ AudioPhaserContext *s = outlink->src->priv;
AVFilterLink *inlink = outlink->src->inputs[0];
- p->delay_buffer_length = p->delay * 0.001 * inlink->sample_rate + 0.5;
- if (p->delay_buffer_length <= 0) {
+ s->delay_buffer_length = s->delay * 0.001 * inlink->sample_rate + 0.5;
+ if (s->delay_buffer_length <= 0) {
av_log(outlink->src, AV_LOG_ERROR, "delay is too small\n");
return AVERROR(EINVAL);
}
- p->delay_buffer = av_calloc(p->delay_buffer_length, sizeof(*p->delay_buffer) * inlink->channels);
- p->modulation_buffer_length = inlink->sample_rate / p->speed + 0.5;
- p->modulation_buffer = av_malloc_array(p->modulation_buffer_length, sizeof(*p->modulation_buffer));
+ s->delay_buffer = av_calloc(s->delay_buffer_length, sizeof(*s->delay_buffer) * inlink->channels);
+ s->modulation_buffer_length = inlink->sample_rate / s->speed + 0.5;
+ s->modulation_buffer = av_malloc_array(s->modulation_buffer_length, sizeof(*s->modulation_buffer));
- if (!p->modulation_buffer || !p->delay_buffer)
+ if (!s->modulation_buffer || !s->delay_buffer)
return AVERROR(ENOMEM);
- ff_generate_wave_table(p->type, AV_SAMPLE_FMT_S32,
- p->modulation_buffer, p->modulation_buffer_length,
- 1., p->delay_buffer_length, M_PI / 2.0);
+ ff_generate_wave_table(s->type, AV_SAMPLE_FMT_S32,
+ s->modulation_buffer, s->modulation_buffer_length,
+ 1., s->delay_buffer_length, M_PI / 2.0);
- p->delay_pos = p->modulation_pos = 0;
+ s->delay_pos = s->modulation_pos = 0;
switch (inlink->format) {
- case AV_SAMPLE_FMT_DBL: p->phaser = phaser_dbl; break;
- case AV_SAMPLE_FMT_DBLP: p->phaser = phaser_dblp; break;
- case AV_SAMPLE_FMT_FLT: p->phaser = phaser_flt; break;
- case AV_SAMPLE_FMT_FLTP: p->phaser = phaser_fltp; break;
- case AV_SAMPLE_FMT_S16: p->phaser = phaser_s16; break;
- case AV_SAMPLE_FMT_S16P: p->phaser = phaser_s16p; break;
- case AV_SAMPLE_FMT_S32: p->phaser = phaser_s32; break;
- case AV_SAMPLE_FMT_S32P: p->phaser = phaser_s32p; break;
+ case AV_SAMPLE_FMT_DBL: s->phaser = phaser_dbl; break;
+ case AV_SAMPLE_FMT_DBLP: s->phaser = phaser_dblp; break;
+ case AV_SAMPLE_FMT_FLT: s->phaser = phaser_flt; break;
+ case AV_SAMPLE_FMT_FLTP: s->phaser = phaser_fltp; break;
+ case AV_SAMPLE_FMT_S16: s->phaser = phaser_s16; break;
+ case AV_SAMPLE_FMT_S16P: s->phaser = phaser_s16p; break;
+ case AV_SAMPLE_FMT_S32: s->phaser = phaser_s32; break;
+ case AV_SAMPLE_FMT_S32P: s->phaser = phaser_s32p; break;
default: av_assert0(0);
}
@@ -240,7 +240,7 @@ static int config_output(AVFilterLink *outlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
{
- AudioPhaserContext *p = inlink->dst->priv;
+ AudioPhaserContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *outbuf;
@@ -253,7 +253,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
av_frame_copy_props(outbuf, inbuf);
}
- p->phaser(p, inbuf->extended_data, outbuf->extended_data,
+ s->phaser(s, inbuf->extended_data, outbuf->extended_data,
outbuf->nb_samples, av_frame_get_channels(outbuf));
if (inbuf != outbuf)
@@ -264,10 +264,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
static av_cold void uninit(AVFilterContext *ctx)
{
- AudioPhaserContext *p = ctx->priv;
+ AudioPhaserContext *s = ctx->priv;
- av_freep(&p->delay_buffer);
- av_freep(&p->modulation_buffer);
+ av_freep(&s->delay_buffer);
+ av_freep(&s->modulation_buffer);
}
static const AVFilterPad aphaser_inputs[] = {
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aresample.c b/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
index 57ac3978be2..f6fdd08a1ae 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aresample.c
@@ -80,22 +80,33 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
AResampleContext *aresample = ctx->priv;
- int out_rate = av_get_int(aresample->swr, "osr", NULL);
- uint64_t out_layout = av_get_int(aresample->swr, "ocl", NULL);
- enum AVSampleFormat out_format = av_get_int(aresample->swr, "osf", NULL);
+ enum AVSampleFormat out_format;
+ int64_t out_rate, out_layout;
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
- AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
- AVFilterFormats *out_formats;
- AVFilterFormats *in_samplerates = ff_all_samplerates();
- AVFilterFormats *out_samplerates;
- AVFilterChannelLayouts *in_layouts = ff_all_channel_counts();
- AVFilterChannelLayouts *out_layouts;
+ AVFilterFormats *in_formats, *out_formats;
+ AVFilterFormats *in_samplerates, *out_samplerates;
+ AVFilterChannelLayouts *in_layouts, *out_layouts;
+
+ av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
+ av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
+ av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
+ in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
+ if (!in_formats)
+ return AVERROR(ENOMEM);
ff_formats_ref (in_formats, &inlink->out_formats);
+
+ in_samplerates = ff_all_samplerates();
+ if (!in_samplerates)
+ return AVERROR(ENOMEM);
ff_formats_ref (in_samplerates, &inlink->out_samplerates);
+
+ in_layouts = ff_all_channel_counts();
+ if (!in_layouts)
+ return AVERROR(ENOMEM);
ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
if(out_rate > 0) {
@@ -135,8 +146,7 @@ static int config_output(AVFilterLink *outlink)
AVFilterContext *ctx = outlink->src;
AVFilterLink *inlink = ctx->inputs[0];
AResampleContext *aresample = ctx->priv;
- int out_rate;
- uint64_t out_layout;
+ int64_t out_rate, out_layout;
enum AVSampleFormat out_format;
char inchl_buf[128], outchl_buf[128];
@@ -155,9 +165,9 @@ static int config_output(AVFilterLink *outlink)
if (ret < 0)
return ret;
- out_rate = av_get_int(aresample->swr, "osr", NULL);
- out_layout = av_get_int(aresample->swr, "ocl", NULL);
- out_format = av_get_int(aresample->swr, "osf", NULL);
+ av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
+ av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
+ av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
outlink->time_base = (AVRational) {1, out_rate};
av_assert0(outlink->sample_rate == out_rate);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c b/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
index e830643115a..02668e47c83 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
@@ -47,8 +47,8 @@ typedef struct {
static const AVOption asetnsamples_options[] = {
{ "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
{ "n", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
- { "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
- { "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+ { "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_astats.c b/chromium/third_party/ffmpeg/libavfilter/af_astats.c
index 5780fb900a2..f385d2e854e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_astats.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_astats.c
@@ -33,6 +33,9 @@ typedef struct ChannelStats {
double min, max;
double min_run, max_run;
double min_runs, max_runs;
+ double min_diff, max_diff;
+ double diff1_sum;
+ uint64_t mask;
uint64_t min_count, max_count;
uint64_t nb_samples;
} ChannelStats;
@@ -44,6 +47,9 @@ typedef struct {
uint64_t tc_samples;
double time_constant;
double mult;
+ int metadata;
+ int reset_count;
+ int nb_frames;
} AudioStatsContext;
#define OFFSET(x) offsetof(AudioStatsContext, x)
@@ -51,6 +57,8 @@ typedef struct {
static const AVOption astats_options[] = {
{ "length", "set the window length", OFFSET(time_constant), AV_OPT_TYPE_DOUBLE, {.dbl=.05}, .01, 10, FLAGS },
+ { "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "reset", "recalculate stats after this many frames", OFFSET(reset_count), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{ NULL }
};
@@ -66,7 +74,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -86,10 +94,24 @@ static int query_formats(AVFilterContext *ctx)
return ff_set_common_samplerates(ctx, formats);
}
+static void reset_stats(AudioStatsContext *s)
+{
+ int c;
+
+ memset(s->chstats, 0, sizeof(*s->chstats));
+
+ for (c = 0; c < s->nb_channels; c++) {
+ ChannelStats *p = &s->chstats[c];
+
+ p->min = p->min_sigma_x2 = DBL_MAX;
+ p->max = p->max_sigma_x2 = DBL_MIN;
+ p->min_diff = p->max_diff = -1;
+ }
+}
+
static int config_output(AVFilterLink *outlink)
{
AudioStatsContext *s = outlink->src->priv;
- int c;
s->chstats = av_calloc(sizeof(*s->chstats), outlink->channels);
if (!s->chstats)
@@ -98,16 +120,20 @@ static int config_output(AVFilterLink *outlink)
s->mult = exp((-1 / s->time_constant / outlink->sample_rate));
s->tc_samples = 5 * s->time_constant * outlink->sample_rate + .5;
- for (c = 0; c < s->nb_channels; c++) {
- ChannelStats *p = &s->chstats[c];
-
- p->min = p->min_sigma_x2 = DBL_MAX;
- p->max = p->max_sigma_x2 = DBL_MIN;
- }
+ reset_stats(s);
return 0;
}
+static unsigned bit_depth(uint64_t mask)
+{
+ unsigned result = 64;
+
+ for (; result && !(mask & 1); --result, mask >>= 1);
+
+ return result;
+}
+
static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d)
{
if (d < p->min) {
@@ -137,7 +163,11 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d)
p->sigma_x += d;
p->sigma_x2 += d * d;
p->avg_sigma_x2 = p->avg_sigma_x2 * s->mult + (1.0 - s->mult) * d * d;
+ p->min_diff = FFMIN(p->min_diff == -1 ? DBL_MAX : p->min_diff, FFABS(d - (p->min_diff == -1 ? DBL_MAX : p->last)));
+ p->max_diff = FFMAX(p->max_diff, FFABS(d - (p->max_diff == -1 ? d : p->last)));
+ p->diff1_sum += FFABS(d - p->last);
p->last = d;
+ p->mask |= llrint(d * (UINT64_C(1) << 63));
if (p->nb_samples >= s->tc_samples) {
p->max_sigma_x2 = FFMAX(p->max_sigma_x2, p->avg_sigma_x2);
@@ -146,9 +176,95 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d)
p->nb_samples++;
}
+static void set_meta(AVDictionary **metadata, int chan, const char *key,
+ const char *fmt, double val)
+{
+ uint8_t value[128];
+ uint8_t key2[128];
+
+ snprintf(value, sizeof(value), fmt, val);
+ if (chan)
+ snprintf(key2, sizeof(key2), "lavfi.astats.%d.%s", chan, key);
+ else
+ snprintf(key2, sizeof(key2), "lavfi.astats.%s", key);
+ av_dict_set(metadata, key2, value, 0);
+}
+
+#define LINEAR_TO_DB(x) (log10(x) * 20)
+
+static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
+{
+ uint64_t mask = 0, min_count = 0, max_count = 0, nb_samples = 0;
+ double min_runs = 0, max_runs = 0,
+ min = DBL_MAX, max = DBL_MIN, min_diff = DBL_MAX, max_diff = 0,
+ max_sigma_x = 0,
+ diff1_sum = 0,
+ sigma_x = 0,
+ sigma_x2 = 0,
+ min_sigma_x2 = DBL_MAX,
+ max_sigma_x2 = DBL_MIN;
+ int c;
+
+ for (c = 0; c < s->nb_channels; c++) {
+ ChannelStats *p = &s->chstats[c];
+
+ if (p->nb_samples < s->tc_samples)
+ p->min_sigma_x2 = p->max_sigma_x2 = p->sigma_x2 / p->nb_samples;
+
+ min = FFMIN(min, p->min);
+ max = FFMAX(max, p->max);
+ min_diff = FFMIN(min_diff, p->min_diff);
+ max_diff = FFMAX(max_diff, p->max_diff);
+ diff1_sum += p->diff1_sum,
+ min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2);
+ max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2);
+ sigma_x += p->sigma_x;
+ sigma_x2 += p->sigma_x2;
+ min_count += p->min_count;
+ max_count += p->max_count;
+ min_runs += p->min_runs;
+ max_runs += p->max_runs;
+ mask |= p->mask;
+ nb_samples += p->nb_samples;
+ if (fabs(p->sigma_x) > fabs(max_sigma_x))
+ max_sigma_x = p->sigma_x;
+
+ set_meta(metadata, c + 1, "DC_offset", "%f", p->sigma_x / p->nb_samples);
+ set_meta(metadata, c + 1, "Min_level", "%f", p->min);
+ set_meta(metadata, c + 1, "Max_level", "%f", p->max);
+ set_meta(metadata, c + 1, "Min_difference", "%f", p->min_diff);
+ set_meta(metadata, c + 1, "Max_difference", "%f", p->max_diff);
+ set_meta(metadata, c + 1, "Mean_difference", "%f", p->diff1_sum / (p->nb_samples - 1));
+ set_meta(metadata, c + 1, "Peak_level", "%f", LINEAR_TO_DB(FFMAX(-p->min, p->max)));
+ set_meta(metadata, c + 1, "RMS_level", "%f", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
+ set_meta(metadata, c + 1, "RMS_peak", "%f", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
+ set_meta(metadata, c + 1, "RMS_trough", "%f", LINEAR_TO_DB(sqrt(p->min_sigma_x2)));
+ set_meta(metadata, c + 1, "Crest_factor", "%f", p->sigma_x2 ? FFMAX(-p->min, p->max) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
+ set_meta(metadata, c + 1, "Flat_factor", "%f", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
+ set_meta(metadata, c + 1, "Peak_count", "%f", (float)(p->min_count + p->max_count));
+ set_meta(metadata, c + 1, "Bit_depth", "%f", bit_depth(p->mask));
+ }
+
+ set_meta(metadata, 0, "Overall.DC_offset", "%f", max_sigma_x / (nb_samples / s->nb_channels));
+ set_meta(metadata, 0, "Overall.Min_level", "%f", min);
+ set_meta(metadata, 0, "Overall.Max_level", "%f", max);
+ set_meta(metadata, 0, "Overall.Min_difference", "%f", min_diff);
+ set_meta(metadata, 0, "Overall.Max_difference", "%f", max_diff);
+ set_meta(metadata, 0, "Overall.Mean_difference", "%f", diff1_sum / (nb_samples - s->nb_channels));
+ set_meta(metadata, 0, "Overall.Peak_level", "%f", LINEAR_TO_DB(FFMAX(-min, max)));
+ set_meta(metadata, 0, "Overall.RMS_level", "%f", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
+ set_meta(metadata, 0, "Overall.RMS_peak", "%f", LINEAR_TO_DB(sqrt(max_sigma_x2)));
+ set_meta(metadata, 0, "Overall.RMS_trough", "%f", LINEAR_TO_DB(sqrt(min_sigma_x2)));
+ set_meta(metadata, 0, "Overall.Flat_factor", "%f", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
+ set_meta(metadata, 0, "Overall.Peak_count", "%f", (float)(min_count + max_count) / (double)s->nb_channels);
+ set_meta(metadata, 0, "Overall.Bit_depth", "%f", bit_depth(mask));
+ set_meta(metadata, 0, "Overall.Number_of_samples", "%f", nb_samples / s->nb_channels);
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
AudioStatsContext *s = inlink->dst->priv;
+ AVDictionary **metadata = avpriv_frame_get_metadatap(buf);
const int channels = s->nb_channels;
const double *src;
int i, c;
@@ -173,18 +289,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
break;
}
+ if (s->metadata)
+ set_metadata(s, metadata);
+
+ if (s->reset_count > 0) {
+ s->nb_frames++;
+ if (s->nb_frames >= s->reset_count) {
+ reset_stats(s);
+ s->nb_frames = 0;
+ }
+ }
+
return ff_filter_frame(inlink->dst->outputs[0], buf);
}
-#define LINEAR_TO_DB(x) (log10(x) * 20)
-
static void print_stats(AVFilterContext *ctx)
{
AudioStatsContext *s = ctx->priv;
- uint64_t min_count = 0, max_count = 0, nb_samples = 0;
+ uint64_t mask = 0, min_count = 0, max_count = 0, nb_samples = 0;
double min_runs = 0, max_runs = 0,
- min = DBL_MAX, max = DBL_MIN,
+ min = DBL_MAX, max = DBL_MIN, min_diff = DBL_MAX, max_diff = 0,
max_sigma_x = 0,
+ diff1_sum = 0,
sigma_x = 0,
sigma_x2 = 0,
min_sigma_x2 = DBL_MAX,
@@ -199,6 +325,9 @@ static void print_stats(AVFilterContext *ctx)
min = FFMIN(min, p->min);
max = FFMAX(max, p->max);
+ min_diff = FFMIN(min_diff, p->min_diff);
+ max_diff = FFMAX(max_diff, p->max_diff);
+ diff1_sum += p->diff1_sum,
min_sigma_x2 = FFMIN(min_sigma_x2, p->min_sigma_x2);
max_sigma_x2 = FFMAX(max_sigma_x2, p->max_sigma_x2);
sigma_x += p->sigma_x;
@@ -207,6 +336,7 @@ static void print_stats(AVFilterContext *ctx)
max_count += p->max_count;
min_runs += p->min_runs;
max_runs += p->max_runs;
+ mask |= p->mask;
nb_samples += p->nb_samples;
if (fabs(p->sigma_x) > fabs(max_sigma_x))
max_sigma_x = p->sigma_x;
@@ -215,6 +345,9 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", p->sigma_x / p->nb_samples);
av_log(ctx, AV_LOG_INFO, "Min level: %f\n", p->min);
av_log(ctx, AV_LOG_INFO, "Max level: %f\n", p->max);
+ av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", p->min_diff);
+ av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", p->max_diff);
+ av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", p->diff1_sum / (p->nb_samples - 1));
av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-p->min, p->max)));
av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(p->sigma_x2 / p->nb_samples)));
av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(p->max_sigma_x2)));
@@ -223,12 +356,16 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "Crest factor: %f\n", p->sigma_x2 ? FFMAX(-p->min, p->max) / sqrt(p->sigma_x2 / p->nb_samples) : 1);
av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((p->min_runs + p->max_runs) / (p->min_count + p->max_count)));
av_log(ctx, AV_LOG_INFO, "Peak count: %"PRId64"\n", p->min_count + p->max_count);
+ av_log(ctx, AV_LOG_INFO, "Bit depth: %u\n", bit_depth(p->mask));
}
av_log(ctx, AV_LOG_INFO, "Overall\n");
av_log(ctx, AV_LOG_INFO, "DC offset: %f\n", max_sigma_x / (nb_samples / s->nb_channels));
av_log(ctx, AV_LOG_INFO, "Min level: %f\n", min);
av_log(ctx, AV_LOG_INFO, "Max level: %f\n", max);
+ av_log(ctx, AV_LOG_INFO, "Min difference: %f\n", min_diff);
+ av_log(ctx, AV_LOG_INFO, "Max difference: %f\n", max_diff);
+ av_log(ctx, AV_LOG_INFO, "Mean difference: %f\n", diff1_sum / (nb_samples - s->nb_channels));
av_log(ctx, AV_LOG_INFO, "Peak level dB: %f\n", LINEAR_TO_DB(FFMAX(-min, max)));
av_log(ctx, AV_LOG_INFO, "RMS level dB: %f\n", LINEAR_TO_DB(sqrt(sigma_x2 / nb_samples)));
av_log(ctx, AV_LOG_INFO, "RMS peak dB: %f\n", LINEAR_TO_DB(sqrt(max_sigma_x2)));
@@ -236,6 +373,7 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "RMS trough dB: %f\n", LINEAR_TO_DB(sqrt(min_sigma_x2)));
av_log(ctx, AV_LOG_INFO, "Flat factor: %f\n", LINEAR_TO_DB((min_runs + max_runs) / (min_count + max_count)));
av_log(ctx, AV_LOG_INFO, "Peak count: %f\n", (min_count + max_count) / (double)s->nb_channels);
+ av_log(ctx, AV_LOG_INFO, "Bit depth: %u\n", bit_depth(mask));
av_log(ctx, AV_LOG_INFO, "Number of samples: %"PRId64"\n", nb_samples / s->nb_channels);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_asyncts.c b/chromium/third_party/ffmpeg/libavfilter/af_asyncts.c
index 5f8e1f61cc7..214cefd20bd 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_asyncts.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_asyncts.c
@@ -53,7 +53,7 @@ typedef struct ASyncContext {
#define A AV_OPT_FLAG_AUDIO_PARAM
#define F AV_OPT_FLAG_FILTERING_PARAM
static const AVOption asyncts_options[] = {
- { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, A|F },
+ { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, A|F },
{ "min_delta", "Minimum difference between timestamps and audio data "
"(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { .dbl = 0.1 }, 0, INT_MAX, A|F },
{ "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { .i64 = 500 }, 0, INT_MAX, A|F },
@@ -205,7 +205,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
delta = pts - s->pts - get_delay(s);
out_size = avresample_available(s->avr);
- if (labs(delta) > s->min_delta ||
+ if (llabs(delta) > s->min_delta ||
(s->first_frame && delta && s->first_pts != AV_NOPTS_VALUE)) {
av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta);
out_size = av_clipl_int32((int64_t)out_size + delta);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_biquads.c b/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
index 118a0c0b75f..b5b258f1b48 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
@@ -144,7 +144,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -534,7 +534,7 @@ static const AVOption bandpass_options[] = {
{"s", "slope", 0, AV_OPT_TYPE_CONST, {.i64=SLOPE}, 0, 0, FLAGS, "width_type"},
{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 999, FLAGS},
{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 999, FLAGS},
- {"csg", "use constant skirt gain", OFFSET(csg), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
+ {"csg", "use constant skirt gain", OFFSET(csg), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{NULL}
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c b/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c
index 592fdec3d76..54d52c5c6e9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_bs2b.c
@@ -47,7 +47,7 @@ typedef struct Bs2bContext {
#define OFFSET(x) offsetof(Bs2bContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption bs2b_options[] = {
{ "profile", "Apply a pre-defined crossfeed level",
OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, INT_MAX, A, "profile" },
{ "default", "default profile", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0, A, "profile" },
@@ -60,12 +60,7 @@ static const AVOption options[] = {
{ NULL },
};
-static const AVClass bs2b_class = {
- .class_name = "bs2b filter",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(bs2b);
static av_cold int init(AVFilterContext *ctx)
{
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c b/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
index f8289ccf5ee..37b47b2d7bb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_channelmap.c
@@ -57,7 +57,6 @@ enum MappingMode {
#define MAX_CH 64
typedef struct ChannelMapContext {
const AVClass *class;
- AVFilterChannelLayouts *channel_layouts;
char *mapping_str;
char *channel_layout_str;
uint64_t output_layout;
@@ -275,8 +274,6 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
return AVERROR(EINVAL);
}
- ff_add_channel_layout(&s->channel_layouts, s->output_layout);
-
if (mode == MAP_PAIR_INT_STR || mode == MAP_PAIR_STR_STR) {
for (i = 0; i < s->nch; i++) {
s->map[i].out_channel_idx = av_get_channel_layout_channel_index(
@@ -291,16 +288,19 @@ static int channelmap_query_formats(AVFilterContext *ctx)
{
ChannelMapContext *s = ctx->priv;
AVFilterChannelLayouts *layouts;
-
- ff_set_common_formats(ctx, ff_planar_sample_fmts());
- ff_set_common_samplerates(ctx, ff_all_samplerates());
+ AVFilterChannelLayouts *channel_layouts = NULL;
layouts = ff_all_channel_layouts();
if (!layouts)
return AVERROR(ENOMEM);
+ ff_add_channel_layout(&channel_layouts, s->output_layout);
+
+ ff_set_common_formats(ctx, ff_planar_sample_fmts());
+ ff_set_common_samplerates(ctx, ff_all_samplerates());
+
ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts);
- ff_channel_layouts_ref(s->channel_layouts, &ctx->outputs[0]->in_channel_layouts);
+ ff_channel_layouts_ref(channel_layouts, &ctx->outputs[0]->in_channel_layouts);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_chorus.c b/chromium/third_party/ffmpeg/libavfilter/af_chorus.c
index 93fb36b6ba9..2bdaca348dc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_chorus.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_chorus.c
@@ -162,7 +162,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_compand.c b/chromium/third_party/ffmpeg/libavfilter/af_compand.c
index 55ad98a15dd..6724121350e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_compand.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_compand.c
@@ -109,7 +109,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -398,6 +398,11 @@ static int config_output(AVFilterLink *outlink)
return AVERROR(EINVAL);
}
+ for (i = nb_decays; i < channels; i++) {
+ s->channels[i].attack = s->channels[nb_decays - 1].attack;
+ s->channels[i].decay = s->channels[nb_decays - 1].decay;
+ }
+
#define S(x) s->segments[2 * ((x) + 1)]
p = s->points;
for (i = 0, new_nb_items = 0; i < nb_points; i++) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_dcshift.c b/chromium/third_party/ffmpeg/libavfilter/af_dcshift.c
index eb981568f19..7332c12b195 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_dcshift.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_dcshift.c
@@ -61,7 +61,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c b/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c
new file mode 100644
index 00000000000..e58564871ae
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c
@@ -0,0 +1,740 @@
+/*
+ * Dynamic Audio Normalizer
+ * Copyright (c) 2015 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Dynamic Audio Normalizer
+ */
+
+#include <float.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+
+#define FF_BUFQUEUE_SIZE 302
+#include "libavfilter/bufferqueue.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct cqueue {
+ double *elements;
+ int size;
+ int nb_elements;
+ int first;
+} cqueue;
+
+typedef struct DynamicAudioNormalizerContext {
+ const AVClass *class;
+
+ struct FFBufQueue queue;
+
+ int frame_len;
+ int frame_len_msec;
+ int filter_size;
+ int dc_correction;
+ int channels_coupled;
+ int alt_boundary_mode;
+
+ double peak_value;
+ double max_amplification;
+ double target_rms;
+ double compress_factor;
+ double *prev_amplification_factor;
+ double *dc_correction_value;
+ double *compress_threshold;
+ double *fade_factors[2];
+ double *weights;
+
+ int channels;
+ int delay;
+
+ cqueue **gain_history_original;
+ cqueue **gain_history_minimum;
+ cqueue **gain_history_smoothed;
+} DynamicAudioNormalizerContext;
+
+#define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x)
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption dynaudnorm_options[] = {
+ { "f", "set the frame length in msec", OFFSET(frame_len_msec), AV_OPT_TYPE_INT, {.i64 = 500}, 10, 8000, FLAGS },
+ { "g", "set the filter size", OFFSET(filter_size), AV_OPT_TYPE_INT, {.i64 = 31}, 3, 301, FLAGS },
+ { "p", "set the peak value", OFFSET(peak_value), AV_OPT_TYPE_DOUBLE, {.dbl = 0.95}, 0.0, 1.0, FLAGS },
+ { "m", "set the max amplification", OFFSET(max_amplification), AV_OPT_TYPE_DOUBLE, {.dbl = 10.0}, 1.0, 100.0, FLAGS },
+ { "r", "set the target RMS", OFFSET(target_rms), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, 0.0, 1.0, FLAGS },
+ { "n", "set channel coupling", OFFSET(channels_coupled), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
+ { "c", "set DC correction", OFFSET(dc_correction), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
+ { "b", "set alternative boundary mode", OFFSET(alt_boundary_mode), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
+ { "s", "set the compress factor", OFFSET(compress_factor), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, 0.0, 30.0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(dynaudnorm);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ DynamicAudioNormalizerContext *s = ctx->priv;
+
+ if (!(s->filter_size & 1)) {
+ av_log(ctx, AV_LOG_ERROR, "filter size %d is invalid. Must be an odd value.\n", s->filter_size);
+ return AVERROR(EINVAL);
+ }
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+ AVFilterChannelLayouts *layouts;
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_DBLP,
+ AV_SAMPLE_FMT_NONE
+ };
+ int 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_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static inline int frame_size(int sample_rate, int frame_len_msec)
+{
+ const int frame_size = round((double)sample_rate * (frame_len_msec / 1000.0));
+ return frame_size + (frame_size % 2);
+}
+
+static void precalculate_fade_factors(double *fade_factors[2], int frame_len)
+{
+ const double step_size = 1.0 / frame_len;
+ int pos;
+
+ for (pos = 0; pos < frame_len; pos++) {
+ fade_factors[0][pos] = 1.0 - (step_size * (pos + 1.0));
+ fade_factors[1][pos] = 1.0 - fade_factors[0][pos];
+ }
+}
+
+static cqueue *cqueue_create(int size)
+{
+ cqueue *q;
+
+ q = av_malloc(sizeof(cqueue));
+ if (!q)
+ return NULL;
+
+ q->size = size;
+ q->nb_elements = 0;
+ q->first = 0;
+
+ q->elements = av_malloc(sizeof(double) * size);
+ if (!q->elements) {
+ av_free(q);
+ return NULL;
+ }
+
+ return q;
+}
+
+static void cqueue_free(cqueue *q)
+{
+ av_free(q->elements);
+ av_free(q);
+}
+
+static int cqueue_size(cqueue *q)
+{
+ return q->nb_elements;
+}
+
+static int cqueue_empty(cqueue *q)
+{
+ return !q->nb_elements;
+}
+
+static int cqueue_enqueue(cqueue *q, double element)
+{
+ int i;
+
+ av_assert2(q->nb_elements != q->size);
+
+ i = (q->first + q->nb_elements) % q->size;
+ q->elements[i] = element;
+ q->nb_elements++;
+
+ return 0;
+}
+
+static double cqueue_peek(cqueue *q, int index)
+{
+ av_assert2(index < q->nb_elements);
+ return q->elements[(q->first + index) % q->size];
+}
+
+static int cqueue_dequeue(cqueue *q, double *element)
+{
+ av_assert2(!cqueue_empty(q));
+
+ *element = q->elements[q->first];
+ q->first = (q->first + 1) % q->size;
+ q->nb_elements--;
+
+ return 0;
+}
+
+static int cqueue_pop(cqueue *q)
+{
+ av_assert2(!cqueue_empty(q));
+
+ q->first = (q->first + 1) % q->size;
+ q->nb_elements--;
+
+ return 0;
+}
+
+static const double s_pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679;
+
+static void init_gaussian_filter(DynamicAudioNormalizerContext *s)
+{
+ double total_weight = 0.0;
+ const double sigma = (((s->filter_size / 2.0) - 1.0) / 3.0) + (1.0 / 3.0);
+ double adjust;
+ int i;
+
+ // Pre-compute constants
+ const int offset = s->filter_size / 2;
+ const double c1 = 1.0 / (sigma * sqrt(2.0 * s_pi));
+ const double c2 = 2.0 * pow(sigma, 2.0);
+
+ // Compute weights
+ for (i = 0; i < s->filter_size; i++) {
+ const int x = i - offset;
+
+ s->weights[i] = c1 * exp(-(pow(x, 2.0) / c2));
+ total_weight += s->weights[i];
+ }
+
+ // Adjust weights
+ adjust = 1.0 / total_weight;
+ for (i = 0; i < s->filter_size; i++) {
+ s->weights[i] *= adjust;
+ }
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ DynamicAudioNormalizerContext *s = ctx->priv;
+ int c;
+
+ s->frame_len =
+ inlink->min_samples =
+ inlink->max_samples =
+ inlink->partial_buf_size = 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(s->frame_len * sizeof(*s->fade_factors[0]));
+ s->fade_factors[1] = av_malloc(s->frame_len * sizeof(*s->fade_factors[1]));
+
+ s->prev_amplification_factor = av_malloc(inlink->channels * sizeof(*s->prev_amplification_factor));
+ s->dc_correction_value = av_calloc(inlink->channels, sizeof(*s->dc_correction_value));
+ s->compress_threshold = av_calloc(inlink->channels, sizeof(*s->compress_threshold));
+ s->gain_history_original = av_calloc(inlink->channels, sizeof(*s->gain_history_original));
+ 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(s->filter_size * sizeof(*s->weights));
+ 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)
+ return AVERROR(ENOMEM);
+
+ for (c = 0; c < inlink->channels; c++) {
+ s->prev_amplification_factor[c] = 1.0;
+
+ s->gain_history_original[c] = cqueue_create(s->filter_size);
+ s->gain_history_minimum[c] = cqueue_create(s->filter_size);
+ s->gain_history_smoothed[c] = cqueue_create(s->filter_size);
+
+ if (!s->gain_history_original[c] || !s->gain_history_minimum[c] ||
+ !s->gain_history_smoothed[c])
+ return AVERROR(ENOMEM);
+ }
+
+ precalculate_fade_factors(s->fade_factors, s->frame_len);
+ init_gaussian_filter(s);
+
+ s->channels = inlink->channels;
+ s->delay = s->filter_size;
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ return 0;
+}
+
+static inline double fade(double prev, double next, int pos,
+ double *fade_factors[2])
+{
+ return fade_factors[0][pos] * prev + fade_factors[1][pos] * next;
+}
+
+static inline double pow2(const double value)
+{
+ return value * value;
+}
+
+static inline double bound(const double threshold, const double val)
+{
+ const double CONST = 0.8862269254527580136490837416705725913987747280611935; //sqrt(PI) / 2.0
+ return erf(CONST * (val / threshold)) * threshold;
+}
+
+static double find_peak_magnitude(AVFrame *frame, int channel)
+{
+ double max = DBL_EPSILON;
+ int c, i;
+
+ if (channel == -1) {
+ for (c = 0; c < av_frame_get_channels(frame); c++) {
+ double *data_ptr = (double *)frame->extended_data[c];
+
+ for (i = 0; i < frame->nb_samples; i++)
+ max = FFMAX(max, fabs(data_ptr[i]));
+ }
+ } else {
+ double *data_ptr = (double *)frame->extended_data[channel];
+
+ for (i = 0; i < frame->nb_samples; i++)
+ max = FFMAX(max, fabs(data_ptr[i]));
+ }
+
+ return max;
+}
+
+static double compute_frame_rms(AVFrame *frame, int channel)
+{
+ double rms_value = 0.0;
+ int c, i;
+
+ if (channel == -1) {
+ for (c = 0; c < av_frame_get_channels(frame); c++) {
+ const double *data_ptr = (double *)frame->extended_data[c];
+
+ for (i = 0; i < frame->nb_samples; i++) {
+ rms_value += pow2(data_ptr[i]);
+ }
+ }
+
+ rms_value /= frame->nb_samples * av_frame_get_channels(frame);
+ } else {
+ const double *data_ptr = (double *)frame->extended_data[channel];
+ for (i = 0; i < frame->nb_samples; i++) {
+ rms_value += pow2(data_ptr[i]);
+ }
+
+ rms_value /= frame->nb_samples;
+ }
+
+ return FFMAX(sqrt(rms_value), DBL_EPSILON);
+}
+
+static double get_max_local_gain(DynamicAudioNormalizerContext *s, AVFrame *frame,
+ int channel)
+{
+ const double maximum_gain = s->peak_value / find_peak_magnitude(frame, channel);
+ const double rms_gain = s->target_rms > DBL_EPSILON ? (s->target_rms / compute_frame_rms(frame, channel)) : DBL_MAX;
+ return bound(s->max_amplification, FFMIN(maximum_gain, rms_gain));
+}
+
+static double minimum_filter(cqueue *q)
+{
+ double min = DBL_MAX;
+ int i;
+
+ for (i = 0; i < cqueue_size(q); i++) {
+ min = FFMIN(min, cqueue_peek(q, i));
+ }
+
+ return min;
+}
+
+static double gaussian_filter(DynamicAudioNormalizerContext *s, cqueue *q)
+{
+ double result = 0.0;
+ int i;
+
+ for (i = 0; i < cqueue_size(q); i++) {
+ result += cqueue_peek(q, i) * s->weights[i];
+ }
+
+ return result;
+}
+
+static void update_gain_history(DynamicAudioNormalizerContext *s, int channel,
+ double current_gain_factor)
+{
+ if (cqueue_empty(s->gain_history_original[channel]) ||
+ cqueue_empty(s->gain_history_minimum[channel])) {
+ const int pre_fill_size = s->filter_size / 2;
+
+ s->prev_amplification_factor[channel] = s->alt_boundary_mode ? current_gain_factor : 1.0;
+
+ while (cqueue_size(s->gain_history_original[channel]) < pre_fill_size) {
+ cqueue_enqueue(s->gain_history_original[channel], s->alt_boundary_mode ? current_gain_factor : 1.0);
+ }
+
+ while (cqueue_size(s->gain_history_minimum[channel]) < pre_fill_size) {
+ cqueue_enqueue(s->gain_history_minimum[channel], s->alt_boundary_mode ? current_gain_factor : 1.0);
+ }
+ }
+
+ cqueue_enqueue(s->gain_history_original[channel], current_gain_factor);
+
+ while (cqueue_size(s->gain_history_original[channel]) >= s->filter_size) {
+ double minimum;
+ av_assert0(cqueue_size(s->gain_history_original[channel]) == s->filter_size);
+ minimum = minimum_filter(s->gain_history_original[channel]);
+
+ cqueue_enqueue(s->gain_history_minimum[channel], minimum);
+
+ cqueue_pop(s->gain_history_original[channel]);
+ }
+
+ while (cqueue_size(s->gain_history_minimum[channel]) >= s->filter_size) {
+ double smoothed;
+ av_assert0(cqueue_size(s->gain_history_minimum[channel]) == s->filter_size);
+ smoothed = gaussian_filter(s, s->gain_history_minimum[channel]);
+
+ cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);
+
+ cqueue_pop(s->gain_history_minimum[channel]);
+ }
+}
+
+static inline double update_value(double new, double old, double aggressiveness)
+{
+ av_assert0((aggressiveness >= 0.0) && (aggressiveness <= 1.0));
+ return aggressiveness * new + (1.0 - aggressiveness) * old;
+}
+
+static void perform_dc_correction(DynamicAudioNormalizerContext *s, AVFrame *frame)
+{
+ const double diff = 1.0 / frame->nb_samples;
+ int is_first_frame = cqueue_empty(s->gain_history_original[0]);
+ int c, i;
+
+ for (c = 0; c < s->channels; c++) {
+ double *dst_ptr = (double *)frame->extended_data[c];
+ double current_average_value = 0.0;
+ double prev_value;
+
+ for (i = 0; i < frame->nb_samples; i++)
+ current_average_value += dst_ptr[i] * diff;
+
+ prev_value = is_first_frame ? current_average_value : s->dc_correction_value[c];
+ s->dc_correction_value[c] = is_first_frame ? current_average_value : update_value(current_average_value, s->dc_correction_value[c], 0.1);
+
+ for (i = 0; i < frame->nb_samples; i++) {
+ dst_ptr[i] -= fade(prev_value, s->dc_correction_value[c], i, s->fade_factors);
+ }
+ }
+}
+
+static double setup_compress_thresh(double threshold)
+{
+ if ((threshold > DBL_EPSILON) && (threshold < (1.0 - DBL_EPSILON))) {
+ double current_threshold = threshold;
+ double step_size = 1.0;
+
+ while (step_size > DBL_EPSILON) {
+ while ((current_threshold + step_size > current_threshold) &&
+ (bound(current_threshold + step_size, 1.0) <= threshold)) {
+ current_threshold += step_size;
+ }
+
+ step_size /= 2.0;
+ }
+
+ return current_threshold;
+ } else {
+ return threshold;
+ }
+}
+
+static double compute_frame_std_dev(DynamicAudioNormalizerContext *s,
+ AVFrame *frame, int channel)
+{
+ double variance = 0.0;
+ int i, c;
+
+ if (channel == -1) {
+ for (c = 0; c < s->channels; c++) {
+ const double *data_ptr = (double *)frame->extended_data[c];
+
+ for (i = 0; i < frame->nb_samples; i++) {
+ variance += pow2(data_ptr[i]); // Assume that MEAN is *zero*
+ }
+ }
+ variance /= (s->channels * frame->nb_samples) - 1;
+ } else {
+ const double *data_ptr = (double *)frame->extended_data[channel];
+
+ for (i = 0; i < frame->nb_samples; i++) {
+ variance += pow2(data_ptr[i]); // Assume that MEAN is *zero*
+ }
+ variance /= frame->nb_samples - 1;
+ }
+
+ return FFMAX(sqrt(variance), DBL_EPSILON);
+}
+
+static void perform_compression(DynamicAudioNormalizerContext *s, AVFrame *frame)
+{
+ int is_first_frame = cqueue_empty(s->gain_history_original[0]);
+ int c, i;
+
+ if (s->channels_coupled) {
+ const double standard_deviation = compute_frame_std_dev(s, frame, -1);
+ const double current_threshold = FFMIN(1.0, s->compress_factor * standard_deviation);
+
+ const double prev_value = is_first_frame ? current_threshold : s->compress_threshold[0];
+ double prev_actual_thresh, curr_actual_thresh;
+ s->compress_threshold[0] = is_first_frame ? current_threshold : update_value(current_threshold, s->compress_threshold[0], (1.0/3.0));
+
+ prev_actual_thresh = setup_compress_thresh(prev_value);
+ curr_actual_thresh = setup_compress_thresh(s->compress_threshold[0]);
+
+ for (c = 0; c < s->channels; c++) {
+ double *const dst_ptr = (double *)frame->extended_data[c];
+ for (i = 0; i < frame->nb_samples; i++) {
+ const double localThresh = fade(prev_actual_thresh, curr_actual_thresh, i, s->fade_factors);
+ dst_ptr[i] = copysign(bound(localThresh, fabs(dst_ptr[i])), dst_ptr[i]);
+ }
+ }
+ } else {
+ for (c = 0; c < s->channels; c++) {
+ const double standard_deviation = compute_frame_std_dev(s, frame, c);
+ const double current_threshold = setup_compress_thresh(FFMIN(1.0, s->compress_factor * standard_deviation));
+
+ const double prev_value = is_first_frame ? current_threshold : s->compress_threshold[c];
+ double prev_actual_thresh, curr_actual_thresh;
+ double *dst_ptr;
+ s->compress_threshold[c] = is_first_frame ? current_threshold : update_value(current_threshold, s->compress_threshold[c], 1.0/3.0);
+
+ prev_actual_thresh = setup_compress_thresh(prev_value);
+ curr_actual_thresh = setup_compress_thresh(s->compress_threshold[c]);
+
+ dst_ptr = (double *)frame->extended_data[c];
+ for (i = 0; i < frame->nb_samples; i++) {
+ const double localThresh = fade(prev_actual_thresh, curr_actual_thresh, i, s->fade_factors);
+ dst_ptr[i] = copysign(bound(localThresh, fabs(dst_ptr[i])), dst_ptr[i]);
+ }
+ }
+ }
+}
+
+static void analyze_frame(DynamicAudioNormalizerContext *s, AVFrame *frame)
+{
+ if (s->dc_correction) {
+ perform_dc_correction(s, frame);
+ }
+
+ if (s->compress_factor > DBL_EPSILON) {
+ perform_compression(s, frame);
+ }
+
+ if (s->channels_coupled) {
+ const double current_gain_factor = get_max_local_gain(s, frame, -1);
+ int c;
+
+ for (c = 0; c < s->channels; c++)
+ update_gain_history(s, c, current_gain_factor);
+ } else {
+ int c;
+
+ for (c = 0; c < s->channels; c++)
+ update_gain_history(s, c, get_max_local_gain(s, frame, c));
+ }
+}
+
+static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *frame)
+{
+ int c, i;
+
+ for (c = 0; c < s->channels; c++) {
+ double *dst_ptr = (double *)frame->extended_data[c];
+ double current_amplification_factor;
+
+ cqueue_dequeue(s->gain_history_smoothed[c], &current_amplification_factor);
+
+ for (i = 0; i < frame->nb_samples; i++) {
+ const double amplification_factor = fade(s->prev_amplification_factor[c],
+ current_amplification_factor, i,
+ s->fade_factors);
+
+ dst_ptr[i] *= amplification_factor;
+
+ if (fabs(dst_ptr[i]) > s->peak_value)
+ dst_ptr[i] = copysign(s->peak_value, dst_ptr[i]);
+ }
+
+ s->prev_amplification_factor[c] = current_amplification_factor;
+ }
+}
+
+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;
+
+ if (!cqueue_empty(s->gain_history_smoothed[0])) {
+ AVFrame *out = ff_bufqueue_get(&s->queue);
+
+ amplify_frame(s, out);
+ ret = ff_filter_frame(outlink, out);
+ }
+
+ analyze_frame(s, in);
+ ff_bufqueue_add(ctx, &s->queue, in);
+
+ return ret;
+}
+
+static int flush_buffer(DynamicAudioNormalizerContext *s, AVFilterLink *inlink,
+ AVFilterLink *outlink)
+{
+ AVFrame *out = ff_get_audio_buffer(outlink, s->frame_len);
+ int c, i;
+
+ if (!out)
+ return AVERROR(ENOMEM);
+
+ for (c = 0; c < s->channels; c++) {
+ double *dst_ptr = (double *)out->extended_data[c];
+
+ for (i = 0; i < out->nb_samples; i++) {
+ dst_ptr[i] = s->alt_boundary_mode ? DBL_EPSILON : ((s->target_rms > DBL_EPSILON) ? FFMIN(s->peak_value, s->target_rms) : s->peak_value);
+ if (s->dc_correction) {
+ dst_ptr[i] *= ((i % 2) == 1) ? -1 : 1;
+ dst_ptr[i] += s->dc_correction_value[c];
+ }
+ }
+ }
+
+ s->delay--;
+ return filter_frame(inlink, out);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ DynamicAudioNormalizerContext *s = ctx->priv;
+ int ret = 0;
+
+ ret = ff_request_frame(ctx->inputs[0]);
+
+ if (ret == AVERROR_EOF && !ctx->is_disabled && s->delay)
+ ret = flush_buffer(s, ctx->inputs[0], outlink);
+
+ return ret;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ DynamicAudioNormalizerContext *s = ctx->priv;
+ int c;
+
+ av_freep(&s->prev_amplification_factor);
+ av_freep(&s->dc_correction_value);
+ av_freep(&s->compress_threshold);
+ av_freep(&s->fade_factors[0]);
+ av_freep(&s->fade_factors[1]);
+
+ for (c = 0; c < s->channels; c++) {
+ cqueue_free(s->gain_history_original[c]);
+ cqueue_free(s->gain_history_minimum[c]);
+ cqueue_free(s->gain_history_smoothed[c]);
+ }
+
+ av_freep(&s->gain_history_original);
+ av_freep(&s->gain_history_minimum);
+ av_freep(&s->gain_history_smoothed);
+
+ av_freep(&s->weights);
+
+ ff_bufqueue_discard_all(&s->queue);
+}
+
+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 }
+};
+
+static const AVFilterPad avfilter_af_dynaudnorm_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_output,
+ .request_frame = request_frame,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_dynaudnorm = {
+ .name = "dynaudnorm",
+ .description = NULL_IF_CONFIG_SMALL("Dynamic Audio Normalizer."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(DynamicAudioNormalizerContext),
+ .init = init,
+ .uninit = uninit,
+ .inputs = avfilter_af_dynaudnorm_inputs,
+ .outputs = avfilter_af_dynaudnorm_outputs,
+ .priv_class = &dynaudnorm_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c b/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c
new file mode 100644
index 00000000000..b4f8c85c38c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2015 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"
+
+typedef struct ExtraStereoContext {
+ const AVClass *class;
+ float mult;
+ int clip;
+} ExtraStereoContext;
+
+#define OFFSET(x) offsetof(ExtraStereoContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption extrastereo_options[] = {
+ { "m", "set the difference coefficient", OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.5}, -10, 10, A },
+ { "c", "enable clipping", OFFSET(clip), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, A },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(extrastereo);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layout = NULL;
+
+ ff_add_format(&formats, AV_SAMPLE_FMT_FLT);
+ ff_set_common_formats(ctx, formats);
+ ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO);
+ ff_set_common_channel_layouts(ctx, layout);
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ExtraStereoContext *s = ctx->priv;
+ const float *src = (const float *)in->data[0];
+ const float mult = s->mult;
+ AVFrame *out = NULL;
+ float *dst;
+ int n;
+
+ if (av_frame_is_writable(in)) {
+ out = in;
+ } else {
+ AVFrame *out = ff_get_audio_buffer(inlink, in->nb_samples);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+ }
+ dst = (float *)out->data[0];
+
+ for (n = 0; n < in->nb_samples; n++) {
+ float average, left, right;
+
+ left = src[n * 2 ];
+ right = src[n * 2 + 1];
+ average = (left + right) / 2.;
+ left = average + mult * (left - average);
+ right = average + mult * (right - average);
+
+ if (s->clip) {
+ dst[n * 2 ] = av_clipf(left, -1, 1);
+ dst[n * 2 + 1] = av_clipf(right, -1, 1);
+ }
+ }
+
+ 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,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_extrastereo = {
+ .name = "extrastereo",
+ .description = NULL_IF_CONFIG_SMALL("Increase difference between stereo audio channels."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(ExtraStereoContext),
+ .priv_class = &extrastereo_class,
+ .inputs = inputs,
+ .outputs = outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_flanger.c b/chromium/third_party/ffmpeg/libavfilter/af_flanger.c
index 106e6f73f8e..39d4e7b4b71 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_flanger.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_flanger.c
@@ -97,7 +97,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_ladspa.c b/chromium/third_party/ffmpeg/libavfilter/af_ladspa.c
index 2057e6d0efe..655c01811d8 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_ladspa.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_ladspa.c
@@ -303,6 +303,10 @@ static int config_output(AVFilterLink *outlink)
outlink->format = inlink->format;
outlink->sample_rate = inlink->sample_rate;
+ if (ctx->nb_inputs == ctx->nb_outputs) {
+ outlink->channel_layout = inlink->channel_layout;
+ outlink->channels = inlink->channels;
+ }
ret = 0;
} else {
@@ -392,7 +396,7 @@ static av_cold int init(AVFilterContext *ctx)
AVFilterPad pad = { NULL };
char *p, *arg, *saveptr = NULL;
unsigned long nb_ports;
- int i;
+ int i, j = 0;
if (!s->dl_name) {
av_log(ctx, AV_LOG_ERROR, "No plugin name provided\n");
@@ -539,8 +543,11 @@ static av_cold int init(AVFilterContext *ctx)
p = NULL;
if (sscanf(arg, "c%d=%f", &i, &val) != 2) {
- av_log(ctx, AV_LOG_ERROR, "Invalid syntax.\n");
- return AVERROR(EINVAL);
+ if (sscanf(arg, "%f", &val) != 1) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid syntax.\n");
+ return AVERROR(EINVAL);
+ }
+ i = j++;
}
if ((ret = set_control(ctx, i, val)) < 0)
@@ -608,11 +615,15 @@ static int query_formats(AVFilterContext *ctx)
if (s->nb_inputs == 1 && s->nb_outputs == 1) {
// We will instantiate multiple LADSPA_Handle, one over each channel
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ff_set_common_channel_layouts(ctx, layouts);
+ } else if (s->nb_inputs == 2 && s->nb_outputs == 2) {
+ layouts = NULL;
+ ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO);
+ ff_set_common_channel_layouts(ctx, layouts);
} else {
AVFilterLink *outlink = ctx->outputs[0];
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_pan.c b/chromium/third_party/ffmpeg/libavfilter/af_pan.c
index 4ba77a73666..9117cc09c9d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_pan.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_pan.c
@@ -37,7 +37,7 @@
#include "formats.h"
#include "internal.h"
-#define MAX_CHANNELS 63
+#define MAX_CHANNELS 64
typedef struct PanContext {
const AVClass *class;
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_resample.c b/chromium/third_party/ffmpeg/libavfilter/af_resample.c
index d65d4bc64a2..375f480bcf1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_resample.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_resample.c
@@ -40,6 +40,7 @@ typedef struct ResampleContext {
AVAudioResampleContext *avr;
AVDictionary *options;
+ int resampling;
int64_t next_pts;
int64_t next_in_pts;
@@ -117,6 +118,8 @@ static int config_output(AVFilterLink *outlink)
char buf1[64], buf2[64];
int ret;
+ int64_t resampling_forced;
+
if (s->avr) {
avresample_close(s->avr);
avresample_free(&s->avr);
@@ -155,9 +158,15 @@ static int config_output(AVFilterLink *outlink)
if ((ret = avresample_open(s->avr)) < 0)
return ret;
- outlink->time_base = (AVRational){ 1, outlink->sample_rate };
- s->next_pts = AV_NOPTS_VALUE;
- s->next_in_pts = AV_NOPTS_VALUE;
+ av_opt_get_int(s->avr, "force_resampling", 0, &resampling_forced);
+ s->resampling = resampling_forced || (inlink->sample_rate != outlink->sample_rate);
+
+ if (s->resampling) {
+ outlink->time_base = (AVRational){ 1, outlink->sample_rate };
+ s->next_pts = AV_NOPTS_VALUE;
+ s->next_in_pts = AV_NOPTS_VALUE;
+ } else
+ outlink->time_base = inlink->time_base;
av_get_channel_layout_string(buf1, sizeof(buf1),
-1, inlink ->channel_layout);
@@ -201,6 +210,7 @@ static int request_frame(AVFilterLink *outlink)
return (ret == 0) ? AVERROR_EOF : ret;
}
+ frame->nb_samples = ret;
frame->pts = s->next_pts;
return ff_filter_frame(outlink, frame);
}
@@ -239,7 +249,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_assert0(!avresample_available(s->avr));
- if (s->next_pts == AV_NOPTS_VALUE) {
+ if (s->resampling && s->next_pts == AV_NOPTS_VALUE) {
if (in->pts == AV_NOPTS_VALUE) {
av_log(ctx, AV_LOG_WARNING, "First timestamp is missing, "
"assuming 0.\n");
@@ -258,22 +268,25 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
goto fail;
}
- out->sample_rate = outlink->sample_rate;
- /* Only convert in->pts if there is a discontinuous jump.
- This ensures that out->pts tracks the number of samples actually
- output by the resampler in the absence of such a jump.
- Otherwise, the rounding in av_rescale_q() and av_rescale()
- causes off-by-1 errors. */
- if (in->pts != AV_NOPTS_VALUE && in->pts != s->next_in_pts) {
- out->pts = av_rescale_q(in->pts, inlink->time_base,
- outlink->time_base) -
- av_rescale(delay, outlink->sample_rate,
- inlink->sample_rate);
+ if (s->resampling) {
+ out->sample_rate = outlink->sample_rate;
+ /* Only convert in->pts if there is a discontinuous jump.
+ This ensures that out->pts tracks the number of samples actually
+ output by the resampler in the absence of such a jump.
+ Otherwise, the rounding in av_rescale_q() and av_rescale()
+ causes off-by-1 errors. */
+ if (in->pts != AV_NOPTS_VALUE && in->pts != s->next_in_pts) {
+ out->pts = av_rescale_q(in->pts, inlink->time_base,
+ outlink->time_base) -
+ av_rescale(delay, outlink->sample_rate,
+ inlink->sample_rate);
+ } else
+ out->pts = s->next_pts;
+
+ s->next_pts = out->pts + out->nb_samples;
+ s->next_in_pts = in->pts + in->nb_samples;
} else
- out->pts = s->next_pts;
-
- s->next_pts = out->pts + out->nb_samples;
- s->next_in_pts = in->pts + in->nb_samples;
+ out->pts = in->pts;
ret = ff_filter_frame(outlink, out);
s->got_output = 1;
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_sidechaincompress.c b/chromium/third_party/ffmpeg/libavfilter/af_sidechaincompress.c
new file mode 100644
index 00000000000..e45fd720d7c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_sidechaincompress.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others
+ * Copyright (c) 2015 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
+ */
+
+/**
+ * @file
+ * Sidechain compressor filter
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+
+typedef struct SidechainCompressContext {
+ const AVClass *class;
+
+ double attack, attack_coeff;
+ double release, release_coeff;
+ double lin_slope;
+ double ratio;
+ double threshold;
+ double makeup;
+ double thres;
+ double knee;
+ double knee_start;
+ double knee_stop;
+ double lin_knee_start;
+ double compressed_knee_stop;
+ int link;
+ int detection;
+
+ AVFrame *input_frame[2];
+} SidechainCompressContext;
+
+#define OFFSET(x) offsetof(SidechainCompressContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption sidechaincompress_options[] = {
+ { "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0.125}, 0.000976563, 1, A|F },
+ { "ratio", "set ratio", OFFSET(ratio), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 1, 20, A|F },
+ { "attack", "set attack", OFFSET(attack), AV_OPT_TYPE_DOUBLE, {.dbl=20}, 0.01, 2000, A|F },
+ { "release", "set release", OFFSET(release), AV_OPT_TYPE_DOUBLE, {.dbl=250}, 0.01, 9000, A|F },
+ { "makeup", "set make up gain", OFFSET(makeup), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 1, 64, A|F },
+ { "knee", "set knee", OFFSET(knee), AV_OPT_TYPE_DOUBLE, {.dbl=2.82843}, 1, 8, A|F },
+ { "link", "set link type", OFFSET(link), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, A|F, "link" },
+ { "average", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A|F, "link" },
+ { "maximum", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A|F, "link" },
+ { "detection", "set detection", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, A|F, "detection" },
+ { "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A|F, "detection" },
+ { "rms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A|F, "detection" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(sidechaincompress);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ SidechainCompressContext *s = ctx->priv;
+
+ s->thres = log(s->threshold);
+ s->lin_knee_start = s->threshold / sqrt(s->knee);
+ s->knee_start = log(s->lin_knee_start);
+ s->knee_stop = log(s->threshold * sqrt(s->knee));
+ s->compressed_knee_stop = (s->knee_stop - s->thres) / s->ratio + s->thres;
+
+ return 0;
+}
+
+static inline float hermite_interpolation(float x, float x0, float x1,
+ float p0, float p1,
+ float m0, float m1)
+{
+ float width = x1 - x0;
+ float t = (x - x0) / width;
+ float t2, t3;
+ float ct0, ct1, ct2, ct3;
+
+ m0 *= width;
+ m1 *= width;
+
+ t2 = t*t;
+ t3 = t2*t;
+ ct0 = p0;
+ ct1 = m0;
+
+ ct2 = -3 * p0 - 2 * m0 + 3 * p1 - m1;
+ ct3 = 2 * p0 + m0 - 2 * p1 + m1;
+
+ return ct3 * t3 + ct2 * t2 + ct1 * t + ct0;
+}
+
+// A fake infinity value (because real infinity may break some hosts)
+#define FAKE_INFINITY (65536.0 * 65536.0)
+
+// Check for infinity (with appropriate-ish tolerance)
+#define IS_FAKE_INFINITY(value) (fabs(value-FAKE_INFINITY) < 1.0)
+
+static double output_gain(double lin_slope, double ratio, double thres,
+ double knee, double knee_start, double knee_stop,
+ double compressed_knee_stop, int detection)
+{
+ double slope = log(lin_slope);
+ double gain = 0.0;
+ double delta = 0.0;
+
+ if (detection)
+ slope *= 0.5;
+
+ if (IS_FAKE_INFINITY(ratio)) {
+ gain = thres;
+ delta = 0.0;
+ } else {
+ gain = (slope - thres) / ratio + thres;
+ delta = 1.0 / ratio;
+ }
+
+ if (knee > 1.0 && slope < knee_stop)
+ gain = hermite_interpolation(slope, knee_start, knee_stop,
+ knee_start, compressed_knee_stop,
+ 1.0, delta);
+
+ return exp(gain - slope);
+}
+
+static int filter_frame(AVFilterLink *link, AVFrame *frame)
+{
+ AVFilterContext *ctx = link->dst;
+ SidechainCompressContext *s = ctx->priv;
+ AVFilterLink *sclink = ctx->inputs[1];
+ AVFilterLink *outlink = ctx->outputs[0];
+ const double makeup = s->makeup;
+ const double *scsrc;
+ double *sample;
+ int nb_samples;
+ int ret, i, c;
+
+ for (i = 0; i < 2; i++)
+ if (link == ctx->inputs[i])
+ break;
+ av_assert0(i < 2 && !s->input_frame[i]);
+ s->input_frame[i] = frame;
+
+ if (!s->input_frame[0] || !s->input_frame[1])
+ return 0;
+
+ nb_samples = FFMIN(s->input_frame[0]->nb_samples,
+ s->input_frame[1]->nb_samples);
+
+ sample = (double *)s->input_frame[0]->data[0];
+ scsrc = (const double *)s->input_frame[1]->data[0];
+
+ for (i = 0; i < nb_samples; i++) {
+ double abs_sample, gain = 1.0;
+
+ abs_sample = FFABS(scsrc[0]);
+
+ if (s->link == 1) {
+ for (c = 1; c < sclink->channels; c++)
+ abs_sample = FFMAX(FFABS(scsrc[c]), abs_sample);
+ } else {
+ for (c = 1; c < sclink->channels; c++)
+ abs_sample += FFABS(scsrc[c]);
+
+ abs_sample /= sclink->channels;
+ }
+
+ if (s->detection)
+ abs_sample *= abs_sample;
+
+ s->lin_slope += (abs_sample - s->lin_slope) * (abs_sample > s->lin_slope ? s->attack_coeff : s->release_coeff);
+
+ if (s->lin_slope > 0.0 && s->lin_slope > s->lin_knee_start)
+ gain = output_gain(s->lin_slope, s->ratio, s->thres, s->knee,
+ s->knee_start, s->knee_stop,
+ s->compressed_knee_stop, s->detection);
+
+ for (c = 0; c < outlink->channels; c++)
+ sample[c] *= gain * makeup;
+
+ sample += outlink->channels;
+ scsrc += sclink->channels;
+ }
+
+ ret = ff_filter_frame(outlink, s->input_frame[0]);
+
+ s->input_frame[0] = NULL;
+ av_frame_free(&s->input_frame[1]);
+
+ return ret;
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ SidechainCompressContext *s = ctx->priv;
+ int i, ret;
+
+ /* get a frame on each input */
+ for (i = 0; i < 2; i++) {
+ AVFilterLink *inlink = ctx->inputs[i];
+ if (!s->input_frame[i] &&
+ (ret = ff_request_frame(inlink)) < 0)
+ return ret;
+
+ /* request the same number of samples on all inputs */
+ if (i == 0)
+ ctx->inputs[1]->request_samples = s->input_frame[0]->nb_samples;
+ }
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+ AVFilterChannelLayouts *layouts = NULL;
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_DBL,
+ AV_SAMPLE_FMT_NONE
+ };
+ int ret, i;
+
+ if (!ctx->inputs[0]->in_channel_layouts ||
+ !ctx->inputs[0]->in_channel_layouts->nb_channel_layouts) {
+ av_log(ctx, AV_LOG_WARNING,
+ "No channel layout for input 1\n");
+ return AVERROR(EAGAIN);
+ }
+
+ ff_add_channel_layout(&layouts, ctx->inputs[0]->in_channel_layouts->channel_layouts[0]);
+ if (!layouts)
+ return AVERROR(ENOMEM);
+ ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts);
+
+ for (i = 0; i < 2; i++) {
+ layouts = ff_all_channel_counts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+ ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts);
+ }
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ SidechainCompressContext *s = ctx->priv;
+
+ if (ctx->inputs[0]->sample_rate != ctx->inputs[1]->sample_rate) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Inputs must have the same sample rate "
+ "%d for in0 vs %d for in1\n",
+ ctx->inputs[0]->sample_rate, ctx->inputs[1]->sample_rate);
+ return AVERROR(EINVAL);
+ }
+
+ outlink->sample_rate = ctx->inputs[0]->sample_rate;
+ outlink->time_base = ctx->inputs[0]->time_base;
+ outlink->channel_layout = ctx->inputs[0]->channel_layout;
+ outlink->channels = ctx->inputs[0]->channels;
+
+ s->attack_coeff = FFMIN(1.f, 1.f / (s->attack * outlink->sample_rate / 4000.f));
+ s->release_coeff = FFMIN(1.f, 1.f / (s->release * outlink->sample_rate / 4000.f));
+
+ return 0;
+}
+
+static const AVFilterPad sidechaincompress_inputs[] = {
+ {
+ .name = "main",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .needs_writable = 1,
+ .needs_fifo = 1,
+ },{
+ .name = "sidechain",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .needs_fifo = 1,
+ },
+ { NULL }
+};
+
+static const AVFilterPad sidechaincompress_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_output,
+ .request_frame = request_frame,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_sidechaincompress = {
+ .name = "sidechaincompress",
+ .description = NULL_IF_CONFIG_SMALL("Sidechain compressor."),
+ .priv_size = sizeof(SidechainCompressContext),
+ .priv_class = &sidechaincompress_class,
+ .init = init,
+ .query_formats = query_formats,
+ .inputs = sidechaincompress_inputs,
+ .outputs = sidechaincompress_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c b/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
index cd1e0384d3f..00a3959b10c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
@@ -81,7 +81,7 @@ static const AVOption silenceremove_options[] = {
{ "stop_periods", NULL, OFFSET(stop_periods), AV_OPT_TYPE_INT, {.i64=0}, -9000, 9000, FLAGS },
{ "stop_duration", NULL, OFFSET(stop_duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, 9000, FLAGS },
{ "stop_threshold", NULL, OFFSET(stop_threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, DBL_MAX, FLAGS },
- { "leave_silence", NULL, OFFSET(leave_silence), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+ { "leave_silence", NULL, OFFSET(leave_silence), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};
@@ -420,7 +420,7 @@ static int query_formats(AVFilterContext *ctx)
};
int ret;
- layouts = ff_all_channel_layouts();
+ layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_volume.c b/chromium/third_party/ffmpeg/libavfilter/af_volume.c
index 54bffa6015c..16e994c93fd 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_volume.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_volume.c
@@ -74,16 +74,16 @@ static const AVOption volume_options[] = {
{ "once", "eval volume expression once", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_ONCE}, .flags = A|F, .unit = "eval" },
{ "frame", "eval volume expression per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = A|F, .unit = "eval" },
{ "replaygain", "Apply replaygain side data when present",
- OFFSET(replaygain), AV_OPT_TYPE_INT, { .i64 = REPLAYGAIN_DROP }, REPLAYGAIN_DROP, REPLAYGAIN_ALBUM, A, "replaygain" },
- { "drop", "replaygain side data is dropped", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_DROP }, 0, 0, A, "replaygain" },
- { "ignore", "replaygain side data is ignored", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_IGNORE }, 0, 0, A, "replaygain" },
- { "track", "track gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_TRACK }, 0, 0, A, "replaygain" },
- { "album", "album gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_ALBUM }, 0, 0, A, "replaygain" },
+ OFFSET(replaygain), AV_OPT_TYPE_INT, { .i64 = REPLAYGAIN_DROP }, REPLAYGAIN_DROP, REPLAYGAIN_ALBUM, A|F, "replaygain" },
+ { "drop", "replaygain side data is dropped", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_DROP }, 0, 0, A|F, "replaygain" },
+ { "ignore", "replaygain side data is ignored", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_IGNORE }, 0, 0, A|F, "replaygain" },
+ { "track", "track gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_TRACK }, 0, 0, A|F, "replaygain" },
+ { "album", "album gain is preferred", 0, AV_OPT_TYPE_CONST, { .i64 = REPLAYGAIN_ALBUM }, 0, 0, A|F, "replaygain" },
{ "replaygain_preamp", "Apply replaygain pre-amplification",
- OFFSET(replaygain_preamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, -15.0, 15.0, A },
+ OFFSET(replaygain_preamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, -15.0, 15.0, A|F },
{ "replaygain_noclip", "Apply replaygain clipping prevention",
- OFFSET(replaygain_noclip), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, A },
- { NULL },
+ OFFSET(replaygain_noclip), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, A|F },
+ { NULL }
};
AVFILTER_DEFINE_CLASS(volume);
diff --git a/chromium/third_party/ffmpeg/libavfilter/allfilters.c b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
index 415ed1bce12..c78d79be9bb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/allfilters.c
+++ b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
@@ -45,12 +45,14 @@ void avfilter_register_all(void)
return;
initialized = 1;
+ REGISTER_FILTER(ACROSSFADE, acrossfade, af);
REGISTER_FILTER(ADELAY, adelay, af);
REGISTER_FILTER(AECHO, aecho, af);
REGISTER_FILTER(AEVAL, aeval, af);
REGISTER_FILTER(AFADE, afade, af);
REGISTER_FILTER(AFORMAT, aformat, af);
REGISTER_FILTER(AINTERLEAVE, ainterleave, af);
+ REGISTER_FILTER(ALIMITER, alimiter, af);
REGISTER_FILTER(ALLPASS, allpass, af);
REGISTER_FILTER(AMERGE, amerge, af);
REGISTER_FILTER(AMIX, amix, af);
@@ -59,6 +61,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(APERMS, aperms, af);
REGISTER_FILTER(APHASER, aphaser, af);
REGISTER_FILTER(ARESAMPLE, aresample, af);
+ REGISTER_FILTER(AREVERSE, areverse, af);
REGISTER_FILTER(ASELECT, aselect, af);
REGISTER_FILTER(ASENDCMD, asendcmd, af);
REGISTER_FILTER(ASETNSAMPLES, asetnsamples, af);
@@ -83,9 +86,11 @@ void avfilter_register_all(void)
REGISTER_FILTER(CHORUS, chorus, af);
REGISTER_FILTER(COMPAND, compand, af);
REGISTER_FILTER(DCSHIFT, dcshift, af);
+ REGISTER_FILTER(DYNAUDNORM, dynaudnorm, af);
REGISTER_FILTER(EARWAX, earwax, af);
REGISTER_FILTER(EBUR128, ebur128, af);
REGISTER_FILTER(EQUALIZER, equalizer, af);
+ REGISTER_FILTER(EXTRASTEREO, extrastereo, af);
REGISTER_FILTER(FLANGER, flanger, af);
REGISTER_FILTER(HIGHPASS, highpass, af);
REGISTER_FILTER(JOIN, join, af);
@@ -94,6 +99,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(PAN, pan, af);
REGISTER_FILTER(REPLAYGAIN, replaygain, af);
REGISTER_FILTER(RESAMPLE, resample, af);
+ REGISTER_FILTER(SIDECHAINCOMPRESS, sidechaincompress, af);
REGISTER_FILTER(SILENCEDETECT, silencedetect, af);
REGISTER_FILTER(SILENCEREMOVE, silenceremove, af);
REGISTER_FILTER(TREBLE, treble, af);
@@ -109,6 +115,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(ALPHAEXTRACT, alphaextract, vf);
REGISTER_FILTER(ALPHAMERGE, alphamerge, vf);
+ REGISTER_FILTER(ATADENOISE, atadenoise, vf);
REGISTER_FILTER(ASS, ass, vf);
REGISTER_FILTER(BBOX, bbox, vf);
REGISTER_FILTER(BLACKDETECT, blackdetect, vf);
@@ -127,17 +134,22 @@ void avfilter_register_all(void)
REGISTER_FILTER(CROPDETECT, cropdetect, vf);
REGISTER_FILTER(CURVES, curves, vf);
REGISTER_FILTER(DCTDNOIZ, dctdnoiz, vf);
+ REGISTER_FILTER(DEBAND, deband, vf);
REGISTER_FILTER(DECIMATE, decimate, vf);
+ REGISTER_FILTER(DEFLATE, deflate, vf);
REGISTER_FILTER(DEJUDDER, dejudder, vf);
REGISTER_FILTER(DELOGO, delogo, vf);
REGISTER_FILTER(DESHAKE, deshake, vf);
REGISTER_FILTER(DETELECINE, detelecine, vf);
+ REGISTER_FILTER(DILATION, dilation, vf);
REGISTER_FILTER(DRAWBOX, drawbox, vf);
+ REGISTER_FILTER(DRAWGRAPH, drawgraph, vf);
REGISTER_FILTER(DRAWGRID, drawgrid, vf);
REGISTER_FILTER(DRAWTEXT, drawtext, vf);
REGISTER_FILTER(EDGEDETECT, edgedetect, vf);
REGISTER_FILTER(ELBG, elbg, vf);
REGISTER_FILTER(EQ, eq, vf);
+ REGISTER_FILTER(EROSION, erosion, vf);
REGISTER_FILTER(EXTRACTPLANES, extractplanes, vf);
REGISTER_FILTER(FADE, fade, vf);
REGISTER_FILTER(FFTFILT, fftfilt, vf);
@@ -148,6 +160,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(FORMAT, format, vf);
REGISTER_FILTER(FPS, fps, vf);
REGISTER_FILTER(FRAMEPACK, framepack, vf);
+ REGISTER_FILTER(FRAMERATE, framerate, vf);
REGISTER_FILTER(FRAMESTEP, framestep, vf);
REGISTER_FILTER(FREI0R, frei0r, vf);
REGISTER_FILTER(FSPP, fspp, vf);
@@ -159,9 +172,11 @@ void avfilter_register_all(void)
REGISTER_FILTER(HISTOGRAM, histogram, vf);
REGISTER_FILTER(HQDN3D, hqdn3d, vf);
REGISTER_FILTER(HQX, hqx, vf);
+ REGISTER_FILTER(HSTACK, hstack, vf);
REGISTER_FILTER(HUE, hue, vf);
REGISTER_FILTER(IDET, idet, vf);
REGISTER_FILTER(IL, il, vf);
+ REGISTER_FILTER(INFLATE, inflate, vf);
REGISTER_FILTER(INTERLACE, interlace, vf);
REGISTER_FILTER(INTERLEAVE, interleave, vf);
REGISTER_FILTER(KERNDEINT, kerndeint, vf);
@@ -177,6 +192,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(NOFORMAT, noformat, vf);
REGISTER_FILTER(NOISE, noise, vf);
REGISTER_FILTER(NULL, null, vf);
+ REGISTER_FILTER(OCR, ocr, vf);
REGISTER_FILTER(OCV, ocv, vf);
REGISTER_FILTER(OVERLAY, overlay, vf);
REGISTER_FILTER(OWDENOISE, owdenoise, vf);
@@ -192,11 +208,15 @@ void avfilter_register_all(void)
REGISTER_FILTER(PSNR, psnr, vf);
REGISTER_FILTER(PULLUP, pullup, vf);
REGISTER_FILTER(QP, qp, vf);
+ REGISTER_FILTER(RANDOM, random, vf);
+ REGISTER_FILTER(REMOVEGRAIN, removegrain, vf);
REGISTER_FILTER(REMOVELOGO, removelogo, vf);
REGISTER_FILTER(REPEATFIELDS, repeatfields, vf);
+ REGISTER_FILTER(REVERSE, reverse, vf);
REGISTER_FILTER(ROTATE, rotate, vf);
REGISTER_FILTER(SAB, sab, vf);
REGISTER_FILTER(SCALE, scale, vf);
+ REGISTER_FILTER(SCALE2REF, scale2ref, vf);
REGISTER_FILTER(SELECT, select, vf);
REGISTER_FILTER(SENDCMD, sendcmd, vf);
REGISTER_FILTER(SEPARATEFIELDS, separatefields, vf);
@@ -212,6 +232,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SMARTBLUR, smartblur, vf);
REGISTER_FILTER(SPLIT, split, vf);
REGISTER_FILTER(SPP, spp, vf);
+ REGISTER_FILTER(SSIM, ssim, vf);
REGISTER_FILTER(STEREO3D, stereo3d, vf);
REGISTER_FILTER(SUBTITLES, subtitles, vf);
REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
@@ -225,16 +246,21 @@ void avfilter_register_all(void)
REGISTER_FILTER(TRIM, trim, vf);
REGISTER_FILTER(UNSHARP, unsharp, vf);
REGISTER_FILTER(USPP, uspp, vf);
+ REGISTER_FILTER(VECTORSCOPE, vectorscope, vf);
REGISTER_FILTER(VFLIP, vflip, vf);
REGISTER_FILTER(VIDSTABDETECT, vidstabdetect, vf);
REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf);
REGISTER_FILTER(VIGNETTE, vignette, vf);
+ REGISTER_FILTER(VSTACK, vstack, vf);
REGISTER_FILTER(W3FDIF, w3fdif, vf);
+ REGISTER_FILTER(WAVEFORM, waveform, vf);
REGISTER_FILTER(XBR, xbr, vf);
REGISTER_FILTER(YADIF, yadif, vf);
REGISTER_FILTER(ZMQ, zmq, vf);
REGISTER_FILTER(ZOOMPAN, zoompan, vf);
+ REGISTER_FILTER(ALLRGB, allrgb, vsrc);
+ REGISTER_FILTER(ALLYUV, allyuv, vsrc);
REGISTER_FILTER(CELLAUTO, cellauto, vsrc);
REGISTER_FILTER(COLOR, color, vsrc);
REGISTER_FILTER(FREI0R, frei0r_src, vsrc);
@@ -251,10 +277,14 @@ void avfilter_register_all(void)
REGISTER_FILTER(NULLSINK, nullsink, vsink);
/* multimedia filters */
+ REGISTER_FILTER(ADRAWGRAPH, adrawgraph, avf);
+ REGISTER_FILTER(APHASEMETER, aphasemeter, avf);
REGISTER_FILTER(AVECTORSCOPE, avectorscope, avf);
REGISTER_FILTER(CONCAT, concat, avf);
REGISTER_FILTER(SHOWCQT, showcqt, avf);
+ REGISTER_FILTER(SHOWFREQS, showfreqs, avf);
REGISTER_FILTER(SHOWSPECTRUM, showspectrum, avf);
+ REGISTER_FILTER(SHOWVOLUME, showvolume, avf);
REGISTER_FILTER(SHOWWAVES, showwaves, avf);
REGISTER_FILTER(SHOWWAVESPIC, showwavespic, avf);
@@ -262,11 +292,6 @@ void avfilter_register_all(void)
REGISTER_FILTER(AMOVIE, amovie, avsrc);
REGISTER_FILTER(MOVIE, movie, avsrc);
-#if FF_API_AVFILTERBUFFER
- REGISTER_FILTER_UNCONDITIONAL(vsink_ffbuffersink);
- REGISTER_FILTER_UNCONDITIONAL(asink_ffabuffersink);
-#endif
-
/* those filters are part of public or internal API => registered
* unconditionally */
REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
diff --git a/chromium/third_party/ffmpeg/libavfilter/asrc_abuffer.h b/chromium/third_party/ffmpeg/libavfilter/asrc_abuffer.h
deleted file mode 100644
index aa3446166f5..00000000000
--- a/chromium/third_party/ffmpeg/libavfilter/asrc_abuffer.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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 AVFILTER_ASRC_ABUFFER_H
-#define AVFILTER_ASRC_ABUFFER_H
-
-#include "avfilter.h"
-
-/**
- * @file
- * memory buffer source for audio
- *
- * @deprecated use buffersrc.h instead.
- */
-
-/**
- * Queue an audio buffer to the audio buffer source.
- *
- * @param abuffersrc audio source buffer context
- * @param data pointers to the samples planes
- * @param linesize linesizes of each audio buffer plane
- * @param nb_samples number of samples per channel
- * @param sample_fmt sample format of the audio data
- * @param ch_layout channel layout of the audio data
- * @param planar flag to indicate if audio data is planar or packed
- * @param pts presentation timestamp of the audio buffer
- * @param flags unused
- *
- * @deprecated use av_buffersrc_add_ref() instead.
- */
-attribute_deprecated
-int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc,
- uint8_t *data[8], int linesize[8],
- int nb_samples, int sample_rate,
- int sample_fmt, int64_t ch_layout, int planar,
- int64_t pts, int av_unused flags);
-
-/**
- * Queue an audio buffer to the audio buffer source.
- *
- * This is similar to av_asrc_buffer_add_samples(), but the samples
- * are stored in a buffer with known size.
- *
- * @param abuffersrc audio source buffer context
- * @param buf pointer to the samples data, packed is assumed
- * @param size the size in bytes of the buffer, it must contain an
- * integer number of samples
- * @param sample_fmt sample format of the audio data
- * @param ch_layout channel layout of the audio data
- * @param pts presentation timestamp of the audio buffer
- * @param flags unused
- *
- * @deprecated use av_buffersrc_add_ref() instead.
- */
-attribute_deprecated
-int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
- uint8_t *buf, int buf_size,
- int sample_rate,
- int sample_fmt, int64_t ch_layout, int planar,
- int64_t pts, int av_unused flags);
-
-/**
- * Queue an audio buffer to the audio buffer source.
- *
- * @param abuffersrc audio source buffer context
- * @param samplesref buffer ref to queue
- * @param flags unused
- *
- * @deprecated use av_buffersrc_add_ref() instead.
- */
-attribute_deprecated
-int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
- AVFilterBufferRef *samplesref,
- int av_unused flags);
-
-#endif /* AVFILTER_ASRC_ABUFFER_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/asrc_flite.c b/chromium/third_party/ffmpeg/libavfilter/asrc_flite.c
index 098a1dd134c..a99f2dc923e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/asrc_flite.c
+++ b/chromium/third_party/ffmpeg/libavfilter/asrc_flite.c
@@ -51,7 +51,7 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption flite_options[] = {
- { "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+ { "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "nb_samples", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
{ "n", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
{ "text", "set text to speak", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
diff --git a/chromium/third_party/ffmpeg/libavfilter/asrc_sine.c b/chromium/third_party/ffmpeg/libavfilter/asrc_sine.c
index 6aa01d5ec59..cd43ae444ec 100644
--- a/chromium/third_party/ffmpeg/libavfilter/asrc_sine.c
+++ b/chromium/third_party/ffmpeg/libavfilter/asrc_sine.c
@@ -22,6 +22,7 @@
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
@@ -31,7 +32,8 @@ typedef struct {
const AVClass *class;
double frequency;
double beep_factor;
- int samples_per_frame;
+ char *samples_per_frame;
+ AVExpr *samples_per_frame_expr;
int sample_rate;
int64_t duration;
int16_t *sin;
@@ -61,6 +63,9 @@ typedef struct {
#define OPT_DUR(name, field, def, min, max, descr, ...) \
OPT_GENERIC(name, field, def, min, max, descr, DURATION, str, __VA_ARGS__)
+#define OPT_STR(name, field, def, min, max, descr, ...) \
+ OPT_GENERIC(name, field, def, min, max, descr, STRING, str, __VA_ARGS__)
+
static const AVOption sine_options[] = {
OPT_DBL("frequency", frequency, 440, 0, DBL_MAX, "set the sine frequency"),
OPT_DBL("f", frequency, 440, 0, DBL_MAX, "set the sine frequency"),
@@ -70,7 +75,7 @@ static const AVOption sine_options[] = {
OPT_INT("r", sample_rate, 44100, 1, INT_MAX, "set the sample rate"),
OPT_DUR("duration", duration, 0, 0, INT64_MAX, "set the audio duration"),
OPT_DUR("d", duration, 0, 0, INT64_MAX, "set the audio duration"),
- OPT_INT("samples_per_frame", samples_per_frame, 1024, 0, INT_MAX, "set the number of samples per frame"),
+ OPT_STR("samples_per_frame", samples_per_frame, "1024", 0, 0, "set the number of samples per frame"),
{NULL}
};
@@ -120,8 +125,25 @@ static void make_sin_table(int16_t *sin)
sin[i + 2 * half_pi] = -sin[i];
}
+static const char *const var_names[] = {
+ "n",
+ "pts",
+ "t",
+ "TB",
+ NULL
+};
+
+enum {
+ VAR_N,
+ VAR_PTS,
+ VAR_T,
+ VAR_TB,
+ VAR_VARS_NB
+};
+
static av_cold int init(AVFilterContext *ctx)
{
+ int ret;
SineContext *sine = ctx->priv;
if (!(sine->sin = av_malloc(sizeof(*sine->sin) << LOG_PERIOD)))
@@ -136,6 +158,12 @@ static av_cold int init(AVFilterContext *ctx)
sine->sample_rate + 0.5;
}
+ ret = av_expr_parse(&sine->samples_per_frame_expr,
+ sine->samples_per_frame, var_names,
+ NULL, NULL, NULL, NULL, 0, sine);
+ if (ret < 0)
+ return ret;
+
return 0;
}
@@ -143,6 +171,8 @@ static av_cold void uninit(AVFilterContext *ctx)
{
SineContext *sine = ctx->priv;
+ av_expr_free(sine->samples_per_frame_expr);
+ sine->samples_per_frame_expr = NULL;
av_freep(&sine->sin);
}
@@ -188,9 +218,21 @@ static int request_frame(AVFilterLink *outlink)
{
SineContext *sine = outlink->src->priv;
AVFrame *frame;
- int i, nb_samples = sine->samples_per_frame;
+ double values[VAR_VARS_NB] = {
+ [VAR_N] = outlink->frame_count,
+ [VAR_PTS] = sine->pts,
+ [VAR_T] = sine->pts * av_q2d(outlink->time_base),
+ [VAR_TB] = av_q2d(outlink->time_base),
+ };
+ int i, nb_samples = lrint(av_expr_eval(sine->samples_per_frame_expr, values, sine));
int16_t *samples;
+ if (nb_samples <= 0) {
+ av_log(sine, AV_LOG_WARNING, "nb samples expression evaluated to %d, "
+ "defaulting to 1024\n", nb_samples);
+ nb_samples = 1024;
+ }
+
if (sine->duration) {
nb_samples = FFMIN(nb_samples, sine->duration - sine->pts);
av_assert1(nb_samples >= 0);
diff --git a/chromium/third_party/ffmpeg/libavfilter/audio.c b/chromium/third_party/ffmpeg/libavfilter/audio.c
index 1e1d8e04dfe..51fef03f866 100644
--- a/chromium/third_party/ffmpeg/libavfilter/audio.c
+++ b/chromium/third_party/ffmpeg/libavfilter/audio.c
@@ -28,11 +28,6 @@
#include "avfilter.h"
#include "internal.h"
-int avfilter_ref_get_channels(AVFilterBufferRef *ref)
-{
- return ref->audio ? ref->audio->channels : 0;
-}
-
AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples)
{
return ff_get_audio_buffer(link->dst->outputs[0], nb_samples);
@@ -79,92 +74,3 @@ AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
return ret;
}
-
-#if FF_API_AVFILTERBUFFER
-AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
- int linesize,int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- int channels,
- uint64_t channel_layout)
-{
- int planes;
- AVFilterBuffer *samples = av_mallocz(sizeof(*samples));
- AVFilterBufferRef *samplesref = av_mallocz(sizeof(*samplesref));
-
- if (!samples || !samplesref)
- goto fail;
-
- av_assert0(channels);
- av_assert0(channel_layout == 0 ||
- channels == av_get_channel_layout_nb_channels(channel_layout));
-
- samplesref->buf = samples;
- samplesref->buf->free = ff_avfilter_default_free_buffer;
- if (!(samplesref->audio = av_mallocz(sizeof(*samplesref->audio))))
- goto fail;
-
- samplesref->audio->nb_samples = nb_samples;
- samplesref->audio->channel_layout = channel_layout;
- samplesref->audio->channels = channels;
-
- planes = av_sample_fmt_is_planar(sample_fmt) ? channels : 1;
-
- /* make sure the buffer gets read permission or it's useless for output */
- samplesref->perms = perms | AV_PERM_READ;
-
- samples->refcount = 1;
- samplesref->type = AVMEDIA_TYPE_AUDIO;
- samplesref->format = sample_fmt;
-
- memcpy(samples->data, data,
- FFMIN(FF_ARRAY_ELEMS(samples->data), planes)*sizeof(samples->data[0]));
- memcpy(samplesref->data, samples->data, sizeof(samples->data));
-
- samples->linesize[0] = samplesref->linesize[0] = linesize;
-
- if (planes > FF_ARRAY_ELEMS(samples->data)) {
- samples-> extended_data = av_mallocz_array(sizeof(*samples->extended_data),
- planes);
- samplesref->extended_data = av_mallocz_array(sizeof(*samplesref->extended_data),
- planes);
-
- if (!samples->extended_data || !samplesref->extended_data)
- goto fail;
-
- memcpy(samples-> extended_data, data, sizeof(*data)*planes);
- memcpy(samplesref->extended_data, data, sizeof(*data)*planes);
- } else {
- samples->extended_data = samples->data;
- samplesref->extended_data = samplesref->data;
- }
-
- samplesref->pts = AV_NOPTS_VALUE;
-
- return samplesref;
-
-fail:
- if (samples && samples->extended_data != samples->data)
- av_freep(&samples->extended_data);
- if (samplesref) {
- av_freep(&samplesref->audio);
- if (samplesref->extended_data != samplesref->data)
- av_freep(&samplesref->extended_data);
- }
- av_freep(&samplesref);
- av_freep(&samples);
- return NULL;
-}
-
-AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout)
-{
- int channels = av_get_channel_layout_nb_channels(channel_layout);
- return avfilter_get_audio_buffer_ref_from_arrays_channels(data, linesize, perms,
- nb_samples, sample_fmt,
- channels, channel_layout);
-}
-#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/audio.h b/chromium/third_party/ffmpeg/libavfilter/audio.h
index 3335c96ecac..6adc82dc810 100644
--- a/chromium/third_party/ffmpeg/libavfilter/audio.h
+++ b/chromium/third_party/ffmpeg/libavfilter/audio.h
@@ -60,24 +60,4 @@ AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples);
*/
AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples);
-/**
- * Send a buffer of audio samples to the next filter.
- *
- * @param link the output link over which the audio samples are being sent
- * @param samplesref a reference to the buffer of audio samples being sent. The
- * receiving filter will free this reference when it no longer
- * needs it or pass it on to the next filter.
- *
- * @return >= 0 on success, a negative AVERROR on error. The receiving filter
- * is responsible for unreferencing samplesref in case of error.
- */
-int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
-
-/**
- * Send a buffer of audio samples to the next link, without checking
- * min_samples.
- */
-int ff_filter_samples_framed(AVFilterLink *link,
- AVFilterBufferRef *samplesref);
-
#endif /* AVFILTER_AUDIO_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/avcodec.c b/chromium/third_party/ffmpeg/libavfilter/avcodec.c
deleted file mode 100644
index def735f84d4..00000000000
--- a/chromium/third_party/ffmpeg/libavfilter/avcodec.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2011 Stefano Sabatini | stefasab at gmail.com
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * libavcodec/libavfilter gluing utilities
- */
-
-#include "avcodec.h"
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/opt.h"
-
-#if FF_API_AVFILTERBUFFER
-AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
- int perms)
-{
- AVFilterBufferRef *picref =
- avfilter_get_video_buffer_ref_from_arrays(frame->data, frame->linesize, perms,
- frame->width, frame->height,
- frame->format);
- if (!picref)
- return NULL;
- if (avfilter_copy_frame_props(picref, frame) < 0) {
- picref->buf->data[0] = NULL;
- avfilter_unref_bufferp(&picref);
- }
- return picref;
-}
-
-AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms)
-{
- AVFilterBufferRef *samplesref;
- int channels = av_frame_get_channels(frame);
- int64_t layout = av_frame_get_channel_layout(frame);
-
- if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {
- av_log(NULL, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
- return NULL;
- }
-
- samplesref = avfilter_get_audio_buffer_ref_from_arrays_channels(
- (uint8_t **)frame->extended_data, frame->linesize[0], perms,
- frame->nb_samples, frame->format, channels, layout);
- if (!samplesref)
- return NULL;
- if (avfilter_copy_frame_props(samplesref, frame) < 0) {
- samplesref->buf->data[0] = NULL;
- avfilter_unref_bufferp(&samplesref);
- }
- return samplesref;
-}
-
-AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms)
-{
- switch (type) {
- case AVMEDIA_TYPE_VIDEO:
- return avfilter_get_video_buffer_ref_from_frame(frame, perms);
- case AVMEDIA_TYPE_AUDIO:
- return avfilter_get_audio_buffer_ref_from_frame(frame, perms);
- default:
- return NULL;
- }
-}
-
-int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
-{
- int planes, nb_channels;
-
- if (!dst)
- return AVERROR(EINVAL);
- /* abort in case the src is NULL and dst is not, avoid inconsistent state in dst */
- av_assert0(src);
-
- memcpy(dst->data, src->data, sizeof(dst->data));
- memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
-
- dst->pts = src->pts;
- dst->format = src->format;
- av_frame_set_pkt_pos(dst, src->pos);
-
- switch (src->type) {
- case AVMEDIA_TYPE_VIDEO:
- av_assert0(src->video);
- dst->width = src->video->w;
- dst->height = src->video->h;
- dst->sample_aspect_ratio = src->video->sample_aspect_ratio;
- dst->interlaced_frame = src->video->interlaced;
- dst->top_field_first = src->video->top_field_first;
- dst->key_frame = src->video->key_frame;
- dst->pict_type = src->video->pict_type;
- break;
- case AVMEDIA_TYPE_AUDIO:
- av_assert0(src->audio);
- nb_channels = av_get_channel_layout_nb_channels(src->audio->channel_layout);
- planes = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
-
- if (planes > FF_ARRAY_ELEMS(dst->data)) {
- dst->extended_data = av_mallocz_array(planes, sizeof(*dst->extended_data));
- if (!dst->extended_data)
- return AVERROR(ENOMEM);
- memcpy(dst->extended_data, src->extended_data,
- planes * sizeof(*dst->extended_data));
- } else
- dst->extended_data = dst->data;
- dst->nb_samples = src->audio->nb_samples;
- av_frame_set_sample_rate (dst, src->audio->sample_rate);
- av_frame_set_channel_layout(dst, src->audio->channel_layout);
- av_frame_set_channels (dst, src->audio->channels);
- break;
- default:
- return AVERROR(EINVAL);
- }
-
- return 0;
-}
-#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/avcodec.h b/chromium/third_party/ffmpeg/libavfilter/avcodec.h
deleted file mode 100644
index d3d0e20e712..00000000000
--- a/chromium/third_party/ffmpeg/libavfilter/avcodec.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 AVFILTER_AVCODEC_H
-#define AVFILTER_AVCODEC_H
-
-/**
- * @file
- * libavcodec/libavfilter gluing utilities
- *
- * This should be included in an application ONLY if the installed
- * libavfilter has been compiled with libavcodec support, otherwise
- * symbols defined below will not be available.
- */
-
-#include "avfilter.h"
-
-#if FF_API_AVFILTERBUFFER
-/**
- * Create and return a picref reference from the data and properties
- * contained in frame.
- *
- * @param perms permissions to assign to the new buffer reference
- * @deprecated avfilter APIs work natively with AVFrame instead.
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
-
-
-/**
- * Create and return a picref reference from the data and properties
- * contained in frame.
- *
- * @param perms permissions to assign to the new buffer reference
- * @deprecated avfilter APIs work natively with AVFrame instead.
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
- int perms);
-
-/**
- * Create and return a buffer reference from the data and properties
- * contained in frame.
- *
- * @param perms permissions to assign to the new buffer reference
- * @deprecated avfilter APIs work natively with AVFrame instead.
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
- const AVFrame *frame,
- int perms);
-#endif
-
-#endif /* AVFILTER_AVCODEC_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c b/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c
new file mode 100644
index 00000000000..5a470cf9210
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2015 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
+ */
+
+/**
+ * @file
+ * audio to video multimedia aphasemeter filter
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "audio.h"
+#include "video.h"
+#include "internal.h"
+
+typedef struct AudioPhaseMeterContext {
+ const AVClass *class;
+ AVFrame *out;
+ int w, h;
+ AVRational frame_rate;
+ int contrast[4];
+ uint8_t *mpc_str;
+ uint8_t mpc[4];
+ int draw_median_phase;
+} AudioPhaseMeterContext;
+
+#define OFFSET(x) offsetof(AudioPhaseMeterContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption aphasemeter_options[] = {
+ { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
+ { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
+ { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="800x400"}, 0, 0, FLAGS },
+ { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="800x400"}, 0, 0, FLAGS },
+ { "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=2}, 0, 255, FLAGS },
+ { "gc", "set green contrast", OFFSET(contrast[1]), AV_OPT_TYPE_INT, {.i64=7}, 0, 255, FLAGS },
+ { "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=1}, 0, 255, FLAGS },
+ { "mpc", "set median phase color", OFFSET(mpc_str), AV_OPT_TYPE_STRING, {.str = "none"}, 0, 0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(aphasemeter);
+
+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_FLT, AV_SAMPLE_FMT_NONE };
+ static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE };
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_formats);
+
+ ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO);
+ ff_channel_layouts_ref(layout, &inlink->out_channel_layouts);
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_samplerates);
+
+ formats = ff_make_format_list(pix_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &outlink->in_formats);
+
+ return 0;
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AudioPhaseMeterContext *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;
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AudioPhaseMeterContext *s = ctx->priv;
+
+ outlink->w = s->w;
+ outlink->h = s->h;
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+ outlink->frame_rate = s->frame_rate;
+
+ if (!strcmp(s->mpc_str, "none"))
+ s->draw_median_phase = 0;
+ else if (av_parse_color(s->mpc, s->mpc_str, -1, ctx) >= 0)
+ s->draw_median_phase = 1;
+ else
+ return AVERROR(EINVAL);
+
+ return 0;
+}
+
+static inline int get_x(float phase, int w)
+{
+ return (phase + 1.) / 2. * (w - 1);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AudioPhaseMeterContext *s = ctx->priv;
+ AVDictionary **metadata;
+ const int rc = s->contrast[0];
+ const int gc = s->contrast[1];
+ const int bc = s->contrast[2];
+ float fphase = 0;
+ AVFrame *out;
+ uint8_t *dst;
+ int i;
+
+ if (!s->out || s->out->width != outlink->w ||
+ s->out->height != outlink->h) {
+ av_frame_free(&s->out);
+ s->out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!s->out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+
+ out = s->out;
+ for (i = 0; i < outlink->h; i++)
+ memset(out->data[0] + i * out->linesize[0], 0, outlink->w * 4);
+ } else {
+ out = s->out;
+ for (i = outlink->h - 1; i >= 10; i--)
+ memmove(out->data[0] + (i ) * out->linesize[0],
+ out->data[0] + (i-1) * out->linesize[0],
+ outlink->w * 4);
+ for (i = 0; i < outlink->w; i++)
+ AV_WL32(out->data[0] + i * 4, 0);
+ }
+ s->out->pts = in->pts;
+
+ for (i = 0; i < in->nb_samples; i++) {
+ const float *src = (float *)in->data[0] + i * 2;
+ const float f = src[0] * src[1] / (src[0]*src[0] + src[1] * src[1]) * 2;
+ const float phase = isnan(f) ? 1 : f;
+ const int x = get_x(phase, s->w);
+
+ dst = out->data[0] + x * 4;
+ dst[0] = FFMIN(255, dst[0] + rc);
+ dst[1] = FFMIN(255, dst[1] + gc);
+ dst[2] = FFMIN(255, dst[2] + bc);
+ dst[3] = 255;
+ fphase += phase;
+ }
+ fphase /= in->nb_samples;
+
+ if (s->draw_median_phase) {
+ dst = out->data[0] + get_x(fphase, s->w) * 4;
+ AV_WL32(dst, AV_RL32(s->mpc));
+ }
+
+ for (i = 1; i < 10 && i < outlink->h; i++)
+ memcpy(out->data[0] + i * out->linesize[0], out->data[0], outlink->w * 4);
+
+ metadata = avpriv_frame_get_metadatap(out);
+ if (metadata) {
+ uint8_t value[128];
+
+ snprintf(value, sizeof(value), "%f", fphase);
+ av_dict_set(metadata, "lavfi.aphasemeter.phase", value, 0);
+ }
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, av_frame_clone(s->out));
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ AudioPhaseMeterContext *s = ctx->priv;
+
+ av_frame_free(&s->out);
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_input,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_avf_aphasemeter = {
+ .name = "aphasemeter",
+ .description = NULL_IF_CONFIG_SMALL("Convert input audio to phase meter video output."),
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(AudioPhaseMeterContext),
+ .inputs = inputs,
+ .outputs = outputs,
+ .priv_class = &aphasemeter_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
index 3027de37fc3..bc9e2356bce 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
@@ -36,6 +36,7 @@
enum VectorScopeMode {
LISSAJOUS,
LISSAJOUS_XY,
+ POLAR,
MODE_NB,
};
@@ -45,8 +46,8 @@ typedef struct AudioVectorScopeContext {
int w, h;
int hw, hh;
int mode;
- int contrast[3];
- int fade[3];
+ int contrast[4];
+ int fade[4];
double zoom;
AVRational frame_rate;
} AudioVectorScopeContext;
@@ -59,17 +60,20 @@ static const AVOption avectorscope_options[] = {
{ "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=LISSAJOUS}, 0, MODE_NB-1, FLAGS, "mode" },
{ "lissajous", "", 0, AV_OPT_TYPE_CONST, {.i64=LISSAJOUS}, 0, 0, FLAGS, "mode" },
{ "lissajous_xy", "", 0, AV_OPT_TYPE_CONST, {.i64=LISSAJOUS_XY}, 0, 0, FLAGS, "mode" },
+ { "polar", "", 0, AV_OPT_TYPE_CONST, {.i64=POLAR}, 0, 0, FLAGS, "mode" },
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="400x400"}, 0, 0, FLAGS },
- { "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=40}, 0, 255, FLAGS },
+ { "rc", "set red contrast", OFFSET(contrast[0]), AV_OPT_TYPE_INT, {.i64=40}, 0, 255, FLAGS },
{ "gc", "set green contrast", OFFSET(contrast[1]), AV_OPT_TYPE_INT, {.i64=160}, 0, 255, FLAGS },
- { "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=80}, 0, 255, FLAGS },
+ { "bc", "set blue contrast", OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=80}, 0, 255, FLAGS },
+ { "ac", "set alpha contrast", OFFSET(contrast[3]), AV_OPT_TYPE_INT, {.i64=255}, 0, 255, FLAGS },
{ "rf", "set red fade", OFFSET(fade[0]), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, FLAGS },
{ "gf", "set green fade", OFFSET(fade[1]), AV_OPT_TYPE_INT, {.i64=10}, 0, 255, FLAGS },
- { "bf", "set blue fade", OFFSET(fade[2]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
- { "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 10, FLAGS },
+ { "bf", "set blue fade", OFFSET(fade[2]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
+ { "af", "set alpha fade", OFFSET(fade[3]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, FLAGS },
+ { "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 10, FLAGS },
{ NULL }
};
@@ -92,6 +96,7 @@ static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y)
dst[0] = FFMIN(dst[0] + s->contrast[0], 255);
dst[1] = FFMIN(dst[1] + s->contrast[1], 255);
dst[2] = FFMIN(dst[2] + s->contrast[2], 255);
+ dst[3] = FFMIN(dst[3] + s->contrast[3], 255);
}
static void fade(AudioVectorScopeContext *s)
@@ -106,6 +111,7 @@ static void fade(AudioVectorScopeContext *s)
d[j+0] = FFMAX(d[j+0] - s->fade[0], 0);
d[j+1] = FFMAX(d[j+1] - s->fade[1], 0);
d[j+2] = FFMAX(d[j+2] - s->fade[2], 0);
+ d[j+3] = FFMAX(d[j+3] - s->fade[3], 0);
}
d += linesize;
}
@@ -206,9 +212,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if (s->mode == LISSAJOUS) {
x = ((src[1] - src[0]) * zoom / (float)(UINT16_MAX) + 1) * hw;
y = (1.0 - (src[0] + src[1]) * zoom / (float)UINT16_MAX) * hh;
- } else {
+ } else if (s->mode == LISSAJOUS_XY) {
x = (src[1] * zoom / (float)INT16_MAX + 1) * hw;
y = (src[0] * zoom / (float)INT16_MAX + 1) * hh;
+ } else {
+ float sx, sy, cx, cy;
+
+ sx = src[1] * zoom / (float)INT16_MAX;
+ sy = src[0] * zoom / (float)INT16_MAX;
+ cx = sx * sqrtf(1 - 0.5*sy*sy);
+ cy = sy * sqrtf(1 - 0.5*sx*sx);
+ x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7;
+ y = s->h - s->h * FFABS(cx + cy) * .7;
}
draw_dot(s, x, y);
@@ -221,9 +236,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
if (s->mode == LISSAJOUS) {
x = ((src[1] - src[0]) * zoom / 2 + 1) * hw;
y = (1.0 - (src[0] + src[1]) * zoom / 2) * hh;
- } else {
+ } else if (s->mode == LISSAJOUS_XY){
x = (src[1] * zoom + 1) * hw;
y = (src[0] * zoom + 1) * hh;
+ } else {
+ float sx, sy, cx, cy;
+
+ sx = src[1] * zoom;
+ sy = src[0] * zoom;
+ cx = sx * sqrtf(1 - 0.5 * sy * sy);
+ cy = sy * sqrtf(1 - 0.5 * sx * sx);
+ x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7;
+ y = s->h - s->h * FFABS(cx + cy) * .7;
}
draw_dot(s, x, y);
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_concat.c b/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
index 088d782d465..8d736a424c4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_concat.c
@@ -68,7 +68,7 @@ static const AVOption concat_options[] = {
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A|F},
{ "unsafe", "enable unsafe mode",
OFFSET(unsafe),
- AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, V|A|F},
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|A|F},
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showcqt.c b/chromium/third_party/ffmpeg/libavfilter/avf_showcqt.c
index 85f9ea97fa7..8f067525304 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showcqt.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showcqt.c
@@ -68,8 +68,7 @@ typedef struct {
AVFrame *outpicref;
FFTContext *fft_context;
FFTComplex *fft_data;
- FFTComplex *fft_result_left;
- FFTComplex *fft_result_right;
+ FFTComplex *fft_result;
uint8_t *spectogram;
SparseCoeff *coeff_sort;
SparseCoeff *coeffs[VIDEO_WIDTH];
@@ -105,7 +104,7 @@ static const AVOption showcqt_options[] = {
{ "coeffclamp", "set coeffclamp", OFFSET(coeffclamp), AV_OPT_TYPE_FLOAT, { .dbl = 1 }, 0.1, 10, FLAGS },
{ "gamma", "set gamma", OFFSET(gamma), AV_OPT_TYPE_FLOAT, { .dbl = 3 }, 1, 7, FLAGS },
{ "gamma2", "set gamma of bargraph", OFFSET(gamma2), AV_OPT_TYPE_FLOAT, { .dbl = 1 }, 1, 7, FLAGS },
- { "fullhd", "set full HD resolution", OFFSET(fullhd), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS },
+ { "fullhd", "set full HD resolution", OFFSET(fullhd), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
{ "fps", "set video fps", OFFSET(fps), AV_OPT_TYPE_INT, { .i64 = 25 }, 10, 100, FLAGS },
{ "count", "set number of transform per frame", OFFSET(count), AV_OPT_TYPE_INT, { .i64 = 6 }, 1, 30, FLAGS },
{ "fontfile", "set font file", OFFSET(fontfile), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, FLAGS },
@@ -125,8 +124,7 @@ static av_cold void uninit(AVFilterContext *ctx)
for (k = 0; k < VIDEO_WIDTH; k++)
av_freep(&s->coeffs[k]);
av_freep(&s->fft_data);
- av_freep(&s->fft_result_left);
- av_freep(&s->fft_result_right);
+ av_freep(&s->fft_result);
av_freep(&s->coeff_sort);
av_freep(&s->spectogram);
av_freep(&s->font_alpha);
@@ -345,11 +343,10 @@ static int config_output(AVFilterLink *outlink)
s->fft_data = av_malloc_array(fft_len, sizeof(*s->fft_data));
s->coeff_sort = av_malloc_array(fft_len, sizeof(*s->coeff_sort));
- s->fft_result_left = av_malloc_array(fft_len, sizeof(*s->fft_result_left));
- s->fft_result_right = av_malloc_array(fft_len, sizeof(*s->fft_result_right));
+ s->fft_result = av_malloc_array(fft_len + 1, sizeof(*s->fft_result));
s->fft_context = av_fft_init(s->fft_bits, 0);
- if (!s->fft_data || !s->coeff_sort || !s->fft_result_left || !s->fft_result_right || !s->fft_context)
+ if (!s->fft_data || !s->coeff_sort || !s->fft_result || !s->fft_context)
return AVERROR(ENOMEM);
#if CONFIG_LIBFREETYPE
@@ -541,43 +538,32 @@ static int plot_cqt(AVFilterLink *inlink)
int font_height = (FONT_HEIGHT/2) * video_scale;
/* real part contains left samples, imaginary part contains right samples */
- memcpy(s->fft_result_left, s->fft_data, fft_len * sizeof(*s->fft_data));
- av_fft_permute(s->fft_context, s->fft_result_left);
- av_fft_calc(s->fft_context, s->fft_result_left);
-
- /* separate left and right, (and multiply by 2.0) */
- s->fft_result_right[0].re = 2.0f * s->fft_result_left[0].im;
- s->fft_result_right[0].im = 0;
- s->fft_result_left[0].re = 2.0f * s->fft_result_left[0].re;
- s->fft_result_left[0].im = 0;
- for (x = 1; x <= fft_len >> 1; x++) {
- FFTSample tmpy = s->fft_result_left[fft_len-x].im - s->fft_result_left[x].im;
-
- s->fft_result_right[x].re = s->fft_result_left[x].im + s->fft_result_left[fft_len-x].im;
- s->fft_result_right[x].im = s->fft_result_left[x].re - s->fft_result_left[fft_len-x].re;
- s->fft_result_right[fft_len-x].re = s->fft_result_right[x].re;
- s->fft_result_right[fft_len-x].im = -s->fft_result_right[x].im;
-
- s->fft_result_left[x].re = s->fft_result_left[x].re + s->fft_result_left[fft_len-x].re;
- s->fft_result_left[x].im = tmpy;
- s->fft_result_left[fft_len-x].re = s->fft_result_left[x].re;
- s->fft_result_left[fft_len-x].im = -s->fft_result_left[x].im;
- }
+ memcpy(s->fft_result, s->fft_data, fft_len * sizeof(*s->fft_data));
+ av_fft_permute(s->fft_context, s->fft_result);
+ av_fft_calc(s->fft_context, s->fft_result);
+ s->fft_result[fft_len] = s->fft_result[0];
/* calculating cqt */
for (x = 0; x < VIDEO_WIDTH; x++) {
int u;
- FFTComplex l = {0,0};
- FFTComplex r = {0,0};
+ FFTComplex v = {0,0};
+ FFTComplex w = {0,0};
+ FFTComplex l, r;
for (u = 0; u < s->coeffs_len[x]; u++) {
FFTSample value = s->coeffs[x][u].value;
int index = s->coeffs[x][u].index;
- l.re += value * s->fft_result_left[index].re;
- l.im += value * s->fft_result_left[index].im;
- r.re += value * s->fft_result_right[index].re;
- r.im += value * s->fft_result_right[index].im;
+ v.re += value * s->fft_result[index].re;
+ v.im += value * s->fft_result[index].im;
+ w.re += value * s->fft_result[fft_len - index].re;
+ w.im += value * s->fft_result[fft_len - index].im;
}
+
+ /* separate left and right, (and multiply by 2.0) */
+ l.re = v.re + w.re;
+ l.im = v.im - w.im;
+ r.re = w.im + v.im;
+ r.im = w.re - v.re;
/* result is power, not amplitude */
result[x][0] = l.re * l.re + l.im * l.im;
result[x][2] = r.re * r.re + r.im * r.im;
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c b/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c
new file mode 100644
index 00000000000..c00e4d86338
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c
@@ -0,0 +1,561 @@
+/*
+ * Copyright (c) 2015 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 <math.h>
+
+#include "libavcodec/avfft.h"
+#include "libavutil/audio_fifo.h"
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "audio.h"
+#include "video.h"
+#include "avfilter.h"
+#include "internal.h"
+
+enum DisplayMode { LINE, BAR, DOT, NB_MODES };
+enum FrequencyScale { FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES };
+enum AmplitudeScale { AS_LINEAR, AS_SQRT, AS_CBRT, AS_LOG, NB_ASCALES };
+enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
+ WFUNC_BARTLETT, WFUNC_WELCH, WFUNC_FLATTOP,
+ WFUNC_BHARRIS, WFUNC_BNUTTALL, WFUNC_SINE, WFUNC_NUTTALL,
+ WFUNC_BHANN, NB_WFUNC };
+
+typedef struct ShowFreqsContext {
+ const AVClass *class;
+ int w, h;
+ int mode;
+ int fft_bits;
+ int ascale, fscale;
+ int avg;
+ int win_func;
+ FFTContext *fft;
+ FFTComplex **fft_data;
+ float **avg_data;
+ float *window_func_lut;
+ float overlap;
+ int skip_samples;
+ int nb_channels;
+ int nb_freq;
+ int win_size;
+ float scale;
+ char *colors;
+ AVAudioFifo *fifo;
+ int64_t pts;
+} ShowFreqsContext;
+
+#define OFFSET(x) offsetof(ShowFreqsContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption showfreqs_options[] = {
+ { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "1024x512"}, 0, 0, FLAGS },
+ { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "1024x512"}, 0, 0, FLAGS },
+ { "mode", "set display mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=BAR}, 0, NB_MODES-1, FLAGS, "mode" },
+ { "line", "show lines", 0, AV_OPT_TYPE_CONST, {.i64=LINE}, 0, 0, FLAGS, "mode" },
+ { "bar", "show bars", 0, AV_OPT_TYPE_CONST, {.i64=BAR}, 0, 0, FLAGS, "mode" },
+ { "dot", "show dots", 0, AV_OPT_TYPE_CONST, {.i64=DOT}, 0, 0, FLAGS, "mode" },
+ { "ascale", "set amplitude scale", OFFSET(ascale), AV_OPT_TYPE_INT, {.i64=AS_LOG}, 0, NB_ASCALES-1, FLAGS, "ascale" },
+ { "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=AS_LINEAR}, 0, 0, FLAGS, "ascale" },
+ { "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=AS_SQRT}, 0, 0, FLAGS, "ascale" },
+ { "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=AS_CBRT}, 0, 0, FLAGS, "ascale" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=AS_LOG}, 0, 0, FLAGS, "ascale" },
+ { "fscale", "set frequency scale", OFFSET(fscale), AV_OPT_TYPE_INT, {.i64=FS_LINEAR}, 0, NB_FSCALES-1, FLAGS, "fscale" },
+ { "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_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" },
+ { "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" },
+ { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=1.}, 0., 1., FLAGS },
+ { "averaging", "set time averaging", OFFSET(avg), AV_OPT_TYPE_INT, {.i64=1}, 0, INT32_MAX, FLAGS },
+ { "colors", "set channels colors", OFFSET(colors), AV_OPT_TYPE_STRING, {.str = "red|green|blue|yellow|orange|lime|pink|magenta|brown" }, 0, 0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(showfreqs);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layouts = 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_RGBA, AV_PIX_FMT_NONE };
+
+ /* set input audio formats */
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_formats);
+
+ layouts = ff_all_channel_layouts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+ ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_samplerates);
+
+ /* set output video format */
+ formats = ff_make_format_list(pix_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &outlink->in_formats);
+
+ return 0;
+}
+
+static void generate_window_func(float *lut, int N, int win_func, float *overlap)
+{
+ int n;
+
+ switch (win_func) {
+ case WFUNC_RECT:
+ for (n = 0; n < N; n++)
+ lut[n] = 1.;
+ *overlap = 0.;
+ break;
+ case WFUNC_BARTLETT:
+ for (n = 0; n < N; n++)
+ lut[n] = 1.-FFABS((n-(N-1)/2.)/((N-1)/2.));
+ *overlap = 0.5;
+ break;
+ case WFUNC_HANNING:
+ for (n = 0; n < N; n++)
+ lut[n] = .5*(1-cos(2*M_PI*n/(N-1)));
+ *overlap = 0.5;
+ break;
+ case WFUNC_HAMMING:
+ for (n = 0; n < N; n++)
+ lut[n] = .54-.46*cos(2*M_PI*n/(N-1));
+ *overlap = 0.5;
+ break;
+ case WFUNC_BLACKMAN:
+ for (n = 0; n < N; n++)
+ lut[n] = .42659-.49656*cos(2*M_PI*n/(N-1))+.076849*cos(4*M_PI*n/(N-1));
+ *overlap = 0.661;
+ break;
+ case WFUNC_WELCH:
+ for (n = 0; n < N; n++)
+ lut[n] = 1.-(n-(N-1)/2.)/((N-1)/2.)*(n-(N-1)/2.)/((N-1)/2.);
+ *overlap = 0.293;
+ break;
+ case WFUNC_FLATTOP:
+ for (n = 0; n < N; n++)
+ lut[n] = 1.-1.985844164102*cos( 2*M_PI*n/(N-1))+1.791176438506*cos( 4*M_PI*n/(N-1))-
+ 1.282075284005*cos( 6*M_PI*n/(N-1))+0.667777530266*cos( 8*M_PI*n/(N-1))-
+ 0.240160796576*cos(10*M_PI*n/(N-1))+0.056656381764*cos(12*M_PI*n/(N-1))-
+ 0.008134974479*cos(14*M_PI*n/(N-1))+0.000624544650*cos(16*M_PI*n/(N-1))-
+ 0.000019808998*cos(18*M_PI*n/(N-1))+0.000000132974*cos(20*M_PI*n/(N-1));
+ *overlap = 0.841;
+ break;
+ case WFUNC_BHARRIS:
+ for (n = 0; n < N; n++)
+ lut[n] = 0.35875-0.48829*cos(2*M_PI*n/(N-1))+0.14128*cos(4*M_PI*n/(N-1))-0.01168*cos(6*M_PI*n/(N-1));
+ *overlap = 0.661;
+ break;
+ case WFUNC_BNUTTALL:
+ for (n = 0; n < N; n++)
+ lut[n] = 0.3635819-0.4891775*cos(2*M_PI*n/(N-1))+0.1365995*cos(4*M_PI*n/(N-1))-0.0106411*cos(6*M_PI*n/(N-1));
+ *overlap = 0.661;
+ break;
+ case WFUNC_BHANN:
+ for (n = 0; n < N; n++)
+ lut[n] = 0.62-0.48*FFABS(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
+ *overlap = 0.5;
+ break;
+ case WFUNC_SINE:
+ for (n = 0; n < N; n++)
+ lut[n] = sin(M_PI*n/(N-1));
+ *overlap = 0.75;
+ break;
+ case WFUNC_NUTTALL:
+ for (n = 0; n < N; n++)
+ lut[n] = 0.355768-0.487396*cos(2*M_PI*n/(N-1))+0.144232*cos(4*M_PI*n/(N-1))-0.012604*cos(6*M_PI*n/(N-1));
+ *overlap = 0.663;
+ break;
+ default:
+ av_assert0(0);
+ }
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AVFilterLink *inlink = ctx->inputs[0];
+ ShowFreqsContext *s = ctx->priv;
+ float overlap;
+ int i;
+
+ s->nb_freq = 1 << (s->fft_bits - 1);
+ s->win_size = s->nb_freq << 1;
+ av_audio_fifo_free(s->fifo);
+ av_fft_end(s->fft);
+ s->fft = av_fft_init(s->fft_bits, 0);
+ if (!s->fft) {
+ av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
+ "The window size might be too high.\n");
+ return AVERROR(ENOMEM);
+ }
+
+ /* FFT buffers: x2 for each (display) 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 < s->nb_channels; i++) {
+ av_freep(&s->fft_data[i]);
+ av_freep(&s->avg_data[i]);
+ }
+ av_freep(&s->fft_data);
+ av_freep(&s->avg_data);
+ s->nb_channels = inlink->channels;
+
+ s->fft_data = av_calloc(s->nb_channels, sizeof(*s->fft_data));
+ if (!s->fft_data)
+ return AVERROR(ENOMEM);
+ s->avg_data = av_calloc(s->nb_channels, sizeof(*s->avg_data));
+ if (!s->fft_data)
+ return AVERROR(ENOMEM);
+ for (i = 0; i < s->nb_channels; i++) {
+ s->fft_data[i] = av_calloc(s->win_size, sizeof(**s->fft_data));
+ s->avg_data[i] = av_calloc(s->nb_freq, sizeof(**s->avg_data));
+ if (!s->fft_data[i] || !s->avg_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->skip_samples = (1. - s->overlap) * s->win_size;
+ if (s->skip_samples < 1) {
+ av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
+ return AVERROR(EINVAL);
+ }
+
+ for (s->scale = 0, i = 0; i < s->win_size; i++) {
+ s->scale += s->window_func_lut[i] * s->window_func_lut[i];
+ }
+
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ outlink->frame_rate = av_make_q(inlink->sample_rate, s->win_size * (1.-s->overlap));
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+ outlink->w = s->w;
+ outlink->h = s->h;
+
+ s->fifo = av_audio_fifo_alloc(inlink->format, inlink->channels, s->win_size);
+ if (!s->fifo)
+ return AVERROR(ENOMEM);
+ return 0;
+}
+
+static inline void draw_dot(AVFrame *out, int x, int y, uint8_t fg[4])
+{
+
+ uint32_t color = AV_RL32(out->data[0] + y * out->linesize[0] + x * 4);
+
+ if ((color & 0xffffff) != 0)
+ AV_WL32(out->data[0] + y * out->linesize[0] + x * 4, AV_RL32(fg) | color);
+ else
+ AV_WL32(out->data[0] + y * out->linesize[0] + x * 4, AV_RL32(fg));
+}
+
+static int get_sx(ShowFreqsContext *s, int f)
+{
+ switch (s->fscale) {
+ case FS_LINEAR:
+ return (s->w/(float)s->nb_freq)*f;
+ case FS_LOG:
+ return s->w-pow(s->w, (s->nb_freq-f-1)/(s->nb_freq-1.));
+ case FS_RLOG:
+ return pow(s->w, f/(s->nb_freq-1.));
+ }
+
+ return 0;
+}
+
+static float get_bsize(ShowFreqsContext *s, int f)
+{
+ switch (s->fscale) {
+ case FS_LINEAR:
+ return s->w/(float)s->nb_freq;
+ case FS_LOG:
+ return pow(s->w, (s->nb_freq-f-1)/(s->nb_freq-1.))-
+ pow(s->w, (s->nb_freq-f-2)/(s->nb_freq-1.));
+ case FS_RLOG:
+ return pow(s->w, (f+1)/(s->nb_freq-1.))-
+ pow(s->w, f /(s->nb_freq-1.));
+ }
+
+ return 1.;
+}
+
+static inline void plot_freq(ShowFreqsContext *s, int ch,
+ double a, int f, uint8_t fg[4], int *prev_y,
+ AVFrame *out, AVFilterLink *outlink)
+{
+ const int w = s->w;
+ const float avg = s->avg_data[ch][f];
+ const float bsize = get_bsize(s, f);
+ const int sx = get_sx(s, f);
+ int x, y, i;
+
+ switch(s->ascale) {
+ case AS_SQRT:
+ a = 1.0 - sqrt(a);
+ break;
+ case AS_CBRT:
+ a = 1.0 - cbrt(a);
+ break;
+ case AS_LOG:
+ a = log(av_clipd(a, 1e-6, 1)) / log(1e-6);
+ break;
+ case AS_LINEAR:
+ a = 1.0 - a;
+ break;
+ }
+ y = a * outlink->h - 1;
+ if (y < 0)
+ return;
+
+ switch (s->avg) {
+ case 0:
+ y = s->avg_data[ch][f] = !outlink->frame_count ? y : FFMIN(avg, y);
+ break;
+ case 1:
+ break;
+ default:
+ s->avg_data[ch][f] = avg + y * (y - avg) / (FFMIN(outlink->frame_count + 1, s->avg) * y);
+ y = s->avg_data[ch][f];
+ break;
+ }
+
+ switch(s->mode) {
+ case LINE:
+ if (*prev_y == -1) {
+ *prev_y = y;
+ }
+ if (y <= *prev_y) {
+ for (x = sx + 1; x < sx + bsize && x < w; x++)
+ draw_dot(out, x, y, fg);
+ for (i = y; i <= *prev_y; i++)
+ draw_dot(out, sx, i, fg);
+ } else {
+ for (i = *prev_y; i <= y; i++)
+ draw_dot(out, sx, i, fg);
+ for (x = sx + 1; x < sx + bsize && x < w; x++)
+ draw_dot(out, x, i - 1, fg);
+ }
+ *prev_y = y;
+ break;
+ case BAR:
+ for (x = sx; x < sx + bsize && x < w; x++)
+ for (i = y; i < outlink->h; i++)
+ draw_dot(out, x, i, fg);
+ break;
+ case DOT:
+ for (x = sx; x < sx + bsize && x < w; x++)
+ draw_dot(out, x, y, fg);
+ break;
+ }
+}
+
+static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowFreqsContext *s = ctx->priv;
+ const int win_size = s->win_size;
+ char *colors, *color, *saveptr = NULL;
+ AVFrame *out;
+ int ch, n;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out)
+ return AVERROR(ENOMEM);
+
+ for (n = 0; n < outlink->h; n++)
+ memset(out->data[0] + out->linesize[0] * n, 0, outlink->w * 4);
+
+ /* fill FFT input with the number of samples available */
+ for (ch = 0; ch < s->nb_channels; ch++) {
+ const float *p = (float *)in->extended_data[ch];
+
+ for (n = 0; n < in->nb_samples; n++) {
+ s->fft_data[ch][n].re = p[n] * s->window_func_lut[n];
+ s->fft_data[ch][n].im = 0;
+ }
+ for (; n < win_size; n++) {
+ s->fft_data[ch][n].re = 0;
+ s->fft_data[ch][n].im = 0;
+ }
+ }
+
+ /* run FFT on each samples set */
+ for (ch = 0; ch < s->nb_channels; ch++) {
+ av_fft_permute(s->fft, s->fft_data[ch]);
+ av_fft_calc(s->fft, s->fft_data[ch]);
+ }
+
+#define RE(x, ch) s->fft_data[ch][x].re
+#define IM(x, ch) s->fft_data[ch][x].im
+#define M(a, b) (sqrt((a) * (a) + (b) * (b)))
+
+ colors = av_strdup(s->colors);
+ if (!colors) {
+ av_frame_free(&out);
+ return AVERROR(ENOMEM);
+ }
+
+ for (ch = 0; ch < s->nb_channels; ch++) {
+ uint8_t fg[4] = { 0xff, 0xff, 0xff, 0xff };
+ int prev_y = -1, f;
+ double a;
+
+ color = av_strtok(ch == 0 ? colors : NULL, " |", &saveptr);
+ if (color)
+ av_parse_color(fg, color, -1, ctx);
+
+ a = av_clipd(M(RE(0, ch), 0) / s->scale, 0, 1);
+ plot_freq(s, ch, a, 0, fg, &prev_y, out, outlink);
+
+ for (f = 1; f < s->nb_freq; f++) {
+ a = av_clipd(M(RE(f, ch), IM(f, ch)) / s->scale, 0, 1);
+
+ plot_freq(s, ch, a, f, fg, &prev_y, out, outlink);
+ }
+ }
+
+ av_free(colors);
+ out->pts = in->pts;
+ return ff_filter_frame(outlink, out);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ShowFreqsContext *s = ctx->priv;
+ AVFrame *fin = NULL;
+ int ret = 0;
+
+ 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->skip_samples;
+ 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->skip_samples);
+ if (ret < 0)
+ goto fail;
+ }
+
+fail:
+ av_frame_free(&fin);
+ av_frame_free(&in);
+ return ret;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ShowFreqsContext *s = ctx->priv;
+ int i;
+
+ av_fft_end(s->fft);
+ for (i = 0; i < s->nb_channels; i++) {
+ av_freep(&s->fft_data[i]);
+ av_freep(&s->avg_data[i]);
+ }
+ av_freep(&s->fft_data);
+ av_freep(&s->avg_data);
+ av_freep(&s->window_func_lut);
+ av_audio_fifo_free(s->fifo);
+}
+
+static const AVFilterPad showfreqs_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad showfreqs_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_avf_showfreqs = {
+ .name = "showfreqs",
+ .description = NULL_IF_CONFIG_SMALL("Convert input audio to a frequencies video output."),
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(ShowFreqsContext),
+ .inputs = showfreqs_inputs,
+ .outputs = showfreqs_outputs,
+ .priv_class = &showfreqs_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c b/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
index 49491b66461..e29687d8bac 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
@@ -172,7 +172,6 @@ static int config_output(AVFilterLink *outlink)
/* (re-)configuration if the video output changed (or first init) */
if (rdft_bits != s->rdft_bits) {
- size_t rdft_size, rdft_listsize;
AVFrame *outpicref;
av_rdft_end(s->rdft);
@@ -192,17 +191,11 @@ static int config_output(AVFilterLink *outlink)
av_freep(&s->rdft_data);
s->nb_display_channels = inlink->channels;
- if (av_size_mult(sizeof(*s->rdft_data),
- s->nb_display_channels, &rdft_listsize) < 0)
- return AVERROR(EINVAL);
- if (av_size_mult(sizeof(**s->rdft_data),
- win_size, &rdft_size) < 0)
- return AVERROR(EINVAL);
- s->rdft_data = av_malloc(rdft_listsize);
+ s->rdft_data = av_calloc(s->nb_display_channels, sizeof(*s->rdft_data));
if (!s->rdft_data)
return AVERROR(ENOMEM);
for (i = 0; i < s->nb_display_channels; i++) {
- s->rdft_data[i] = av_malloc(rdft_size);
+ s->rdft_data[i] = av_calloc(win_size, sizeof(**s->rdft_data));
if (!s->rdft_data[i])
return AVERROR(ENOMEM);
}
@@ -321,167 +314,165 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
s->rdft_data[ch][n] = p[n] * s->window_func_lut[n];
}
- /* TODO reindent */
-
- /* run RDFT on each samples set */
- for (ch = 0; ch < s->nb_display_channels; ch++)
- av_rdft_calc(s->rdft, s->rdft_data[ch]);
+ /* run RDFT on each samples set */
+ for (ch = 0; ch < s->nb_display_channels; ch++)
+ av_rdft_calc(s->rdft, s->rdft_data[ch]);
- /* fill a new spectrum column */
+ /* fill a new spectrum column */
#define RE(y, ch) s->rdft_data[ch][2 * (y) + 0]
#define IM(y, ch) s->rdft_data[ch][2 * (y) + 1]
#define MAGNITUDE(y, ch) hypot(RE(y, ch), IM(y, ch))
- /* initialize buffer for combining to black */
- for (y = 0; y < outlink->h; y++) {
- s->combine_buffer[3 * y ] = 0;
- s->combine_buffer[3 * y + 1] = 127.5;
- s->combine_buffer[3 * y + 2] = 127.5;
- }
+ /* initialize buffer for combining to black */
+ for (y = 0; y < outlink->h; y++) {
+ s->combine_buffer[3 * y ] = 0;
+ s->combine_buffer[3 * y + 1] = 127.5;
+ s->combine_buffer[3 * y + 2] = 127.5;
+ }
- for (ch = 0; ch < s->nb_display_channels; ch++) {
- float yf, uf, vf;
-
- /* decide color range */
- switch (s->mode) {
- case COMBINED:
- // reduce range by channel count
- yf = 256.0f / s->nb_display_channels;
- switch (s->color_mode) {
- case INTENSITY:
- uf = yf;
- vf = yf;
- break;
- case CHANNEL:
- /* adjust saturation for mixed UV coloring */
- /* this factor is correct for infinite channels, an approximation otherwise */
- uf = yf * M_PI;
- vf = yf * M_PI;
- break;
- default:
- av_assert0(0);
- }
+ for (ch = 0; ch < s->nb_display_channels; ch++) {
+ float yf, uf, vf;
+
+ /* decide color range */
+ switch (s->mode) {
+ case COMBINED:
+ // reduce range by channel count
+ yf = 256.0f / s->nb_display_channels;
+ switch (s->color_mode) {
+ case INTENSITY:
+ uf = yf;
+ vf = yf;
break;
- case SEPARATE:
- // full range
- yf = 256.0f;
- uf = 256.0f;
- vf = 256.0f;
+ case CHANNEL:
+ /* adjust saturation for mixed UV coloring */
+ /* this factor is correct for infinite channels, an approximation otherwise */
+ uf = yf * M_PI;
+ vf = yf * M_PI;
break;
default:
av_assert0(0);
}
+ break;
+ case SEPARATE:
+ // full range
+ yf = 256.0f;
+ uf = 256.0f;
+ vf = 256.0f;
+ break;
+ default:
+ av_assert0(0);
+ }
- if (s->color_mode == CHANNEL) {
- if (s->nb_display_channels > 1) {
- uf *= 0.5 * sin((2 * M_PI * ch) / s->nb_display_channels);
- vf *= 0.5 * cos((2 * M_PI * ch) / s->nb_display_channels);
- } else {
- uf = 0.0f;
- vf = 0.0f;
- }
+ if (s->color_mode == CHANNEL) {
+ if (s->nb_display_channels > 1) {
+ uf *= 0.5 * sin((2 * M_PI * ch) / s->nb_display_channels);
+ vf *= 0.5 * cos((2 * M_PI * ch) / s->nb_display_channels);
+ } else {
+ uf = 0.0f;
+ vf = 0.0f;
}
- uf *= s->saturation;
- vf *= s->saturation;
-
- /* draw the channel */
- for (y = 0; y < h; y++) {
- int row = (s->mode == COMBINED) ? y : ch * h + y;
- float *out = &s->combine_buffer[3 * row];
-
- /* get magnitude */
- float a = w * MAGNITUDE(y, ch);
-
- /* apply scale */
- switch (s->scale) {
- case LINEAR:
- break;
- case SQRT:
- a = sqrt(a);
- break;
- case CBRT:
- a = cbrt(a);
- break;
- case LOG:
- a = 1 - log(FFMAX(FFMIN(1, a), 1e-6)) / log(1e-6); // zero = -120dBFS
- break;
- default:
- av_assert0(0);
- }
+ }
+ uf *= s->saturation;
+ vf *= s->saturation;
- if (s->color_mode == INTENSITY) {
- float y, u, v;
- int i;
-
- for (i = 1; i < sizeof(intensity_color_table) / sizeof(*intensity_color_table) - 1; i++)
- if (intensity_color_table[i].a >= a)
- break;
- // i now is the first item >= the color
- // now we know to interpolate between item i - 1 and i
- if (a <= intensity_color_table[i - 1].a) {
- y = intensity_color_table[i - 1].y;
- u = intensity_color_table[i - 1].u;
- v = intensity_color_table[i - 1].v;
- } else if (a >= intensity_color_table[i].a) {
- y = intensity_color_table[i].y;
- u = intensity_color_table[i].u;
- v = intensity_color_table[i].v;
- } else {
- float start = intensity_color_table[i - 1].a;
- float end = intensity_color_table[i].a;
- float lerpfrac = (a - start) / (end - start);
- y = intensity_color_table[i - 1].y * (1.0f - lerpfrac)
- + intensity_color_table[i].y * lerpfrac;
- u = intensity_color_table[i - 1].u * (1.0f - lerpfrac)
- + intensity_color_table[i].u * lerpfrac;
- v = intensity_color_table[i - 1].v * (1.0f - lerpfrac)
- + intensity_color_table[i].v * lerpfrac;
- }
-
- out[0] += y * yf;
- out[1] += u * uf;
- out[2] += v * vf;
- } else {
- out[0] += a * yf;
- out[1] += a * uf;
- out[2] += a * vf;
- }
+ /* draw the channel */
+ for (y = 0; y < h; y++) {
+ int row = (s->mode == COMBINED) ? y : ch * h + y;
+ float *out = &s->combine_buffer[3 * row];
+
+ /* get magnitude */
+ float a = w * MAGNITUDE(y, ch);
+
+ /* apply scale */
+ switch (s->scale) {
+ case LINEAR:
+ break;
+ case SQRT:
+ a = sqrt(a);
+ break;
+ case CBRT:
+ a = cbrt(a);
+ break;
+ case LOG:
+ a = 1 - log(FFMAX(FFMIN(1, a), 1e-6)) / log(1e-6); // zero = -120dBFS
+ break;
+ default:
+ av_assert0(0);
}
- }
- /* copy to output */
- if (s->sliding == SCROLL) {
- for (plane = 0; plane < 3; plane++) {
- for (y = 0; y < outlink->h; y++) {
- uint8_t *p = outpicref->data[plane] +
- y * outpicref->linesize[plane];
- memmove(p, p + 1, outlink->w - 1);
+ if (s->color_mode == INTENSITY) {
+ float y, u, v;
+ int i;
+
+ for (i = 1; i < sizeof(intensity_color_table) / sizeof(*intensity_color_table) - 1; i++)
+ if (intensity_color_table[i].a >= a)
+ break;
+ // i now is the first item >= the color
+ // now we know to interpolate between item i - 1 and i
+ if (a <= intensity_color_table[i - 1].a) {
+ y = intensity_color_table[i - 1].y;
+ u = intensity_color_table[i - 1].u;
+ v = intensity_color_table[i - 1].v;
+ } else if (a >= intensity_color_table[i].a) {
+ y = intensity_color_table[i].y;
+ u = intensity_color_table[i].u;
+ v = intensity_color_table[i].v;
+ } else {
+ float start = intensity_color_table[i - 1].a;
+ float end = intensity_color_table[i].a;
+ float lerpfrac = (a - start) / (end - start);
+ y = intensity_color_table[i - 1].y * (1.0f - lerpfrac)
+ + intensity_color_table[i].y * lerpfrac;
+ u = intensity_color_table[i - 1].u * (1.0f - lerpfrac)
+ + intensity_color_table[i].u * lerpfrac;
+ v = intensity_color_table[i - 1].v * (1.0f - lerpfrac)
+ + intensity_color_table[i].v * lerpfrac;
}
+
+ out[0] += y * yf;
+ out[1] += u * uf;
+ out[2] += v * vf;
+ } else {
+ out[0] += a * yf;
+ out[1] += a * uf;
+ out[2] += a * vf;
}
- s->xpos = outlink->w - 1;
}
+ }
+
+ /* copy to output */
+ if (s->sliding == SCROLL) {
for (plane = 0; plane < 3; plane++) {
- uint8_t *p = outpicref->data[plane] +
- (outlink->h - 1) * outpicref->linesize[plane] +
- s->xpos;
for (y = 0; y < outlink->h; y++) {
- *p = rint(FFMAX(0, FFMIN(s->combine_buffer[3 * y + plane], 255)));
- p -= outpicref->linesize[plane];
+ uint8_t *p = outpicref->data[plane] +
+ y * outpicref->linesize[plane];
+ memmove(p, p + 1, outlink->w - 1);
}
}
+ s->xpos = outlink->w - 1;
+ }
+ for (plane = 0; plane < 3; plane++) {
+ uint8_t *p = outpicref->data[plane] +
+ (outlink->h - 1) * outpicref->linesize[plane] +
+ s->xpos;
+ for (y = 0; y < outlink->h; y++) {
+ *p = rint(FFMAX(0, FFMIN(s->combine_buffer[3 * y + plane], 255)));
+ p -= outpicref->linesize[plane];
+ }
+ }
- if (s->sliding != FULLFRAME || s->xpos == 0)
- outpicref->pts = insamples->pts;
+ if (s->sliding != FULLFRAME || s->xpos == 0)
+ outpicref->pts = insamples->pts;
- s->xpos++;
- if (s->xpos >= outlink->w)
- s->xpos = 0;
- if (s->sliding != FULLFRAME || s->xpos == 0) {
- s->req_fullfilled = 1;
- ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
- if (ret < 0)
- return ret;
- }
+ s->xpos++;
+ if (s->xpos >= outlink->w)
+ s->xpos = 0;
+ if (s->sliding != FULLFRAME || s->xpos == 0) {
+ s->req_fullfilled = 1;
+ ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
+ if (ret < 0)
+ return ret;
+ }
return win_size;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c b/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c
new file mode 100644
index 00000000000..9accfb068fb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2015 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/channel_layout.h"
+#include "libavutil/eval.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/xga_font_data.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "audio.h"
+#include "video.h"
+#include "internal.h"
+
+typedef struct ShowVolumeContext {
+ const AVClass *class;
+ int w, h;
+ int f, b;
+ AVRational frame_rate;
+ char *color;
+
+ AVFrame *out;
+ AVExpr *c_expr;
+ int draw_text;
+} ShowVolumeContext;
+
+#define OFFSET(x) offsetof(ShowVolumeContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption showvolume_options[] = {
+ { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
+ { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
+ { "b", "set border width", OFFSET(b), AV_OPT_TYPE_INT, {.i64=1}, 0, 5, FLAGS },
+ { "w", "set channel width", OFFSET(w), AV_OPT_TYPE_INT, {.i64=400}, 40, 1080, FLAGS },
+ { "h", "set channel height", OFFSET(h), AV_OPT_TYPE_INT, {.i64=20}, 1, 100, FLAGS },
+ { "f", "set fade", OFFSET(f), AV_OPT_TYPE_INT, {.i64=20}, 1, 255, FLAGS },
+ { "c", "set volume color expression", OFFSET(color), AV_OPT_TYPE_STRING, {.str="if(gte(VOLUME,-2), if(gte(VOLUME,-1),0xff0000ff, 0xff00ffff),0xff00ff00)"}, 0, 0, FLAGS },
+ { "t", "display channel names", OFFSET(draw_text), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(showvolume);
+
+static const char *const var_names[] = { "VOLUME", "CHANNEL", NULL };
+enum { VAR_VOLUME, VAR_CHANNEL, VAR_VARS_NB };
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ ShowVolumeContext *s = ctx->priv;
+ int ret;
+
+ if (s->color) {
+ ret = av_expr_parse(&s->c_expr, s->color, var_names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layouts = 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_RGBA, AV_PIX_FMT_NONE };
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_formats);
+
+ layouts = ff_all_channel_layouts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+ ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &inlink->out_samplerates);
+
+ formats = ff_make_format_list(pix_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(formats, &outlink->in_formats);
+
+ return 0;
+}
+
+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;
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ ShowVolumeContext *s = outlink->src->priv;
+ AVFilterLink *inlink = outlink->src->inputs[0];
+
+ outlink->w = s->w;
+ outlink->h = s->h * inlink->channels + (inlink->channels - 1) * s->b;
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+ outlink->frame_rate = s->frame_rate;
+
+ return 0;
+}
+
+static void drawtext(AVFrame *pic, int x, int y, const char *txt)
+{
+ const uint8_t *font;
+ int font_height;
+ int i;
+
+ font = avpriv_cga_font, font_height = 8;
+
+ for (i = 0; txt[i]; i++) {
+ int char_y, mask;
+ uint8_t *p = pic->data[0] + y*pic->linesize[0] + (x + i*8)*4;
+
+ for (char_y = 0; char_y < font_height; char_y++) {
+ for (mask = 0x80; mask; mask >>= 1) {
+ if (font[txt[i] * font_height + char_y] & mask)
+ AV_WN32(p, ~AV_RN32(p));
+ p += 4;
+ }
+ p += pic->linesize[0] - 8*4;
+ }
+ }
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowVolumeContext *s = ctx->priv;
+ int c, i, j, k;
+ double values[VAR_VARS_NB];
+
+ if (!s->out || s->out->width != outlink->w ||
+ s->out->height != outlink->h) {
+ av_frame_free(&s->out);
+ s->out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!s->out) {
+ av_frame_free(&insamples);
+ return AVERROR(ENOMEM);
+ }
+
+ for (i = 0; i < outlink->h; i++)
+ memset(s->out->data[0] + i * s->out->linesize[0], 0, outlink->w * 4);
+ }
+ s->out->pts = insamples->pts;
+
+ for (j = 0; j < outlink->h; j++) {
+ uint8_t *dst = s->out->data[0] + j * s->out->linesize[0];
+ for (k = 0; k < s->w; k++) {
+ dst[k * 4 + 0] = FFMAX(dst[k * 4 + 0] - s->f, 0);
+ dst[k * 4 + 1] = FFMAX(dst[k * 4 + 1] - s->f, 0);
+ dst[k * 4 + 2] = FFMAX(dst[k * 4 + 2] - s->f, 0);
+ dst[k * 4 + 3] = FFMAX(dst[k * 4 + 3] - s->f, 0);
+ }
+ }
+
+ for (c = 0; c < inlink->channels; c++) {
+ float *src = (float *)insamples->extended_data[c];
+ float max = 0;
+ uint32_t color;
+
+ for (i = 0; i < insamples->nb_samples; i++)
+ max = FFMAX(max, src[i]);
+
+ max = av_clipf(max, 0, 1);
+ values[VAR_VOLUME] = 20.0 * log(max) / M_LN10;
+ values[VAR_CHANNEL] = c;
+ color = av_expr_eval(s->c_expr, values, NULL);
+
+ for (j = 0; j < s->h; j++) {
+ uint8_t *dst = s->out->data[0] + (c * s->h + c * s->b + j) * s->out->linesize[0];
+
+ for (k = 0; k < s->w * max; k++)
+ AV_WN32A(dst + k * 4, color);
+ }
+
+ if (s->h >= 8 && s->draw_text)
+ drawtext(s->out, 2, c * (s->h + s->b) + (s->h - 8) / 2,
+ av_get_channel_name(av_channel_layout_extract_channel(insamples->channel_layout, c)));
+ }
+
+ av_frame_free(&insamples);
+
+ return ff_filter_frame(outlink, av_frame_clone(s->out));
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ShowVolumeContext *s = ctx->priv;
+
+ av_frame_free(&s->out);
+ av_expr_free(s->c_expr);
+}
+
+static const AVFilterPad showvolume_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .config_props = config_input,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad showvolume_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_avf_showvolume = {
+ .name = "showvolume",
+ .description = NULL_IF_CONFIG_SMALL("Convert input audio volume to video output."),
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(ShowVolumeContext),
+ .inputs = showvolume_inputs,
+ .outputs = showvolume_outputs,
+ .priv_class = &showvolume_class,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c b/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
index 57a6b2e149f..ec5291a405f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
@@ -83,7 +83,7 @@ static const AVOption showwaves_options[] = {
{ "n", "set how many samples to show in the same point", OFFSET(n), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
{ "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
- { "split_channels", "draw channels separately", OFFSET(split_channels), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
+ { "split_channels", "draw channels separately", OFFSET(split_channels), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
{ NULL }
};
@@ -203,6 +203,11 @@ static int push_single_pic(AVFilterLink *outlink)
int col = 0;
int64_t *sum = showwaves->sum;
+ if (max_samples == 0) {
+ av_log(ctx, AV_LOG_ERROR, "Too few samples\n");
+ return AVERROR(EINVAL);
+ }
+
av_log(ctx, AV_LOG_DEBUG, "Create frame averaging %"PRId64" samples per column\n", max_samples);
memset(sum, 0, nb_channels);
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfilter.c b/chromium/third_party/ffmpeg/libavfilter/avfilter.c
index bcf8d3f91ff..7da6cf26437 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfilter.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avfilter.c
@@ -501,17 +501,10 @@ AVFilter *avfilter_get_by_name(const char *name)
int avfilter_register(AVFilter *filter)
{
AVFilter **f = last_filter;
- int i;
/* the filter must select generic or internal exclusively */
av_assert0((filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE) != AVFILTER_FLAG_SUPPORT_TIMELINE);
- for(i=0; filter->inputs && filter->inputs[i].name; i++) {
- const AVFilterPad *input = &filter->inputs[i];
- av_assert0( !input->filter_frame
- || (!input->start_frame && !input->end_frame));
- }
-
filter->next = NULL;
while(*f || avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
@@ -669,12 +662,6 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
if (!ret->outputs)
goto err;
}
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
- ret->output_count = ret->nb_outputs;
- ret->input_count = ret->nb_inputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return ret;
@@ -893,7 +880,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
return AVERROR(EINVAL);
}
-#if FF_API_OLD_FILTER_OPTS
+#if FF_API_OLD_FILTER_OPTS || FF_API_OLD_FILTER_OPTS_ERROR
if ( !strcmp(filter->filter->name, "format") ||
!strcmp(filter->filter->name, "noformat") ||
!strcmp(filter->filter->name, "frei0r") ||
@@ -953,18 +940,30 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
while ((p = strchr(p, ':')))
*p++ = '|';
+#if FF_API_OLD_FILTER_OPTS
if (deprecated)
av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
"'|' to separate the list items.\n");
av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);
ret = process_options(filter, &options, copy);
+#else
+ if (deprecated) {
+ av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
+ "'|' to separate the list items ('%s' instead of '%s')\n",
+ copy, args);
+ ret = AVERROR(EINVAL);
+ } else {
+ ret = process_options(filter, &options, copy);
+ }
+#endif
av_freep(&copy);
if (ret < 0)
goto fail;
+ } else
#endif
- } else {
+ {
ret = process_options(filter, &options, args);
if (ret < 0)
goto fail;
@@ -1024,7 +1023,6 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
if (dst->needs_writable && !av_frame_is_writable(frame)) {
av_log(link->dst, AV_LOG_DEBUG, "Copying data in avfilter.\n");
- /* Maybe use ff_copy_buffer_ref instead? */
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
out = ff_get_video_buffer(link, link->w, link->h);
@@ -1148,8 +1146,11 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
/* Consistency checks */
if (link->type == AVMEDIA_TYPE_VIDEO) {
- if (strcmp(link->dst->filter->name, "scale") &&
- strcmp(link->dst->filter->name, "idet")) {
+ if (strcmp(link->dst->filter->name, "buffersink") &&
+ strcmp(link->dst->filter->name, "format") &&
+ strcmp(link->dst->filter->name, "idet") &&
+ strcmp(link->dst->filter->name, "null") &&
+ strcmp(link->dst->filter->name, "scale")) {
av_assert1(frame->format == link->format);
av_assert1(frame->width == link->w);
av_assert1(frame->height == link->h);
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfilter.h b/chromium/third_party/ffmpeg/libavfilter/avfilter.h
index 296f2d3c9a7..642aa834ab5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfilter.h
+++ b/chromium/third_party/ffmpeg/libavfilter/avfilter.h
@@ -66,335 +66,6 @@ typedef struct AVFilterLink AVFilterLink;
typedef struct AVFilterPad AVFilterPad;
typedef struct AVFilterFormats AVFilterFormats;
-#if FF_API_AVFILTERBUFFER
-/**
- * A reference-counted buffer data type used by the filter system. Filters
- * should not store pointers to this structure directly, but instead use the
- * AVFilterBufferRef structure below.
- */
-typedef struct AVFilterBuffer {
- uint8_t *data[8]; ///< buffer data for each plane/channel
-
- /**
- * pointers to the data planes/channels.
- *
- * For video, this should simply point to data[].
- *
- * For planar audio, each channel has a separate data pointer, and
- * linesize[0] contains the size of each channel buffer.
- * For packed audio, there is just one data pointer, and linesize[0]
- * contains the total size of the buffer for all channels.
- *
- * Note: Both data and extended_data will always be set, but for planar
- * audio with more channels that can fit in data, extended_data must be used
- * in order to access all channels.
- */
- uint8_t **extended_data;
- int linesize[8]; ///< number of bytes per line
-
- /** private data to be used by a custom free function */
- void *priv;
- /**
- * A pointer to the function to deallocate this buffer if the default
- * function is not sufficient. This could, for example, add the memory
- * back into a memory pool to be reused later without the overhead of
- * reallocating it from scratch.
- */
- void (*free)(struct AVFilterBuffer *buf);
-
- int format; ///< media format
- int w, h; ///< width and height of the allocated buffer
- unsigned refcount; ///< number of references to this buffer
-} AVFilterBuffer;
-
-#define AV_PERM_READ 0x01 ///< can read from the buffer
-#define AV_PERM_WRITE 0x02 ///< can write to the buffer
-#define AV_PERM_PRESERVE 0x04 ///< nobody else can overwrite the buffer
-#define AV_PERM_REUSE 0x08 ///< can output the buffer multiple times, with the same contents each time
-#define AV_PERM_REUSE2 0x10 ///< can output the buffer multiple times, modified each time
-#define AV_PERM_NEG_LINESIZES 0x20 ///< the buffer requested can have negative linesizes
-#define AV_PERM_ALIGN 0x40 ///< the buffer must be aligned
-
-#define AVFILTER_ALIGN 16 //not part of ABI
-
-/**
- * Audio specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, audio specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefAudioProps {
- uint64_t channel_layout; ///< channel layout of audio buffer
- int nb_samples; ///< number of audio samples per channel
- int sample_rate; ///< audio buffer sample rate
- int channels; ///< number of channels (do not access directly)
-} AVFilterBufferRefAudioProps;
-
-/**
- * Video specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, video specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefVideoProps {
- int w; ///< image width
- int h; ///< image height
- AVRational sample_aspect_ratio; ///< sample aspect ratio
- int interlaced; ///< is frame interlaced
- int top_field_first; ///< field order
- enum AVPictureType pict_type; ///< picture type of the frame
- int key_frame; ///< 1 -> keyframe, 0-> not
- int qp_table_linesize; ///< qp_table stride
- int qp_table_size; ///< qp_table size
- int8_t *qp_table; ///< array of Quantization Parameters
-} AVFilterBufferRefVideoProps;
-
-/**
- * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
- * a buffer to, for example, crop image without any memcpy, the buffer origin
- * and dimensions are per-reference properties. Linesize is also useful for
- * image flipping, frame to field filters, etc, and so is also per-reference.
- *
- * TODO: add anything necessary for frame reordering
- */
-typedef struct AVFilterBufferRef {
- AVFilterBuffer *buf; ///< the buffer that this is a reference to
- uint8_t *data[8]; ///< picture/audio data for each plane
- /**
- * pointers to the data planes/channels.
- *
- * For video, this should simply point to data[].
- *
- * For planar audio, each channel has a separate data pointer, and
- * linesize[0] contains the size of each channel buffer.
- * For packed audio, there is just one data pointer, and linesize[0]
- * contains the total size of the buffer for all channels.
- *
- * Note: Both data and extended_data will always be set, but for planar
- * audio with more channels that can fit in data, extended_data must be used
- * in order to access all channels.
- */
- uint8_t **extended_data;
- int linesize[8]; ///< number of bytes per line
-
- AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
- AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties
-
- /**
- * presentation timestamp. The time unit may change during
- * filtering, as it is specified in the link and the filter code
- * may need to rescale the PTS accordingly.
- */
- int64_t pts;
- int64_t pos; ///< byte position in stream, -1 if unknown
-
- int format; ///< media format
-
- int perms; ///< permissions, see the AV_PERM_* flags
-
- enum AVMediaType type; ///< media type of buffer data
-
- AVDictionary *metadata; ///< dictionary containing metadata key=value tags
-} AVFilterBufferRef;
-
-/**
- * Copy properties of src to dst, without copying the actual data
- */
-attribute_deprecated
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, const AVFilterBufferRef *src);
-
-/**
- * Add a new reference to a buffer.
- *
- * @param ref an existing reference to the buffer
- * @param pmask a bitmask containing the allowable permissions in the new
- * reference
- * @return a new reference to the buffer with the same properties as the
- * old, excluding any permissions denied by pmask
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
-
-/**
- * Remove a reference to a buffer. If this is the last reference to the
- * buffer, the buffer itself is also automatically freed.
- *
- * @param ref reference to the buffer, may be NULL
- *
- * @note it is recommended to use avfilter_unref_bufferp() instead of this
- * function
- */
-attribute_deprecated
-void avfilter_unref_buffer(AVFilterBufferRef *ref);
-
-/**
- * Remove a reference to a buffer and set the pointer to NULL.
- * If this is the last reference to the buffer, the buffer itself
- * is also automatically freed.
- *
- * @param ref pointer to the buffer reference
- */
-attribute_deprecated
-void avfilter_unref_bufferp(AVFilterBufferRef **ref);
-#endif
-
-/**
- * Get the number of channels of a buffer reference.
- */
-attribute_deprecated
-int avfilter_ref_get_channels(AVFilterBufferRef *ref);
-
-#if FF_API_AVFILTERPAD_PUBLIC
-/**
- * A filter pad used for either input or output.
- *
- * See doc/filter_design.txt for details on how to implement the methods.
- *
- * @warning this struct might be removed from public API.
- * users should call avfilter_pad_get_name() and avfilter_pad_get_type()
- * to access the name and type fields; there should be no need to access
- * any other fields from outside of libavfilter.
- */
-struct AVFilterPad {
- /**
- * Pad name. The name is unique among inputs and among outputs, but an
- * input may have the same name as an output. This may be NULL if this
- * pad has no need to ever be referenced by name.
- */
- const char *name;
-
- /**
- * AVFilterPad type.
- */
- enum AVMediaType type;
-
- /**
- * Input pads:
- * Minimum required permissions on incoming buffers. Any buffer with
- * insufficient permissions will be automatically copied by the filter
- * system to a new buffer which provides the needed access permissions.
- *
- * Output pads:
- * Guaranteed permissions on outgoing buffers. Any buffer pushed on the
- * link must have at least these permissions; this fact is checked by
- * asserts. It can be used to optimize buffer allocation.
- */
- attribute_deprecated int min_perms;
-
- /**
- * Input pads:
- * Permissions which are not accepted on incoming buffers. Any buffer
- * which has any of these permissions set will be automatically copied
- * by the filter system to a new buffer which does not have those
- * permissions. This can be used to easily disallow buffers with
- * AV_PERM_REUSE.
- *
- * Output pads:
- * Permissions which are automatically removed on outgoing buffers. It
- * can be used to optimize buffer allocation.
- */
- attribute_deprecated int rej_perms;
-
- /**
- * @deprecated unused
- */
- int (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref);
-
- /**
- * Callback function to get a video buffer. If NULL, the filter system will
- * use ff_default_get_video_buffer().
- *
- * Input video pads only.
- */
- AVFrame *(*get_video_buffer)(AVFilterLink *link, int w, int h);
-
- /**
- * Callback function to get an audio buffer. If NULL, the filter system will
- * use ff_default_get_audio_buffer().
- *
- * Input audio pads only.
- */
- AVFrame *(*get_audio_buffer)(AVFilterLink *link, int nb_samples);
-
- /**
- * @deprecated unused
- */
- int (*end_frame)(AVFilterLink *link);
-
- /**
- * @deprecated unused
- */
- int (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
-
- /**
- * Filtering callback. This is where a filter receives a frame with
- * audio/video data and should do its processing.
- *
- * Input pads only.
- *
- * @return >= 0 on success, a negative AVERROR on error. This function
- * must ensure that frame is properly unreferenced on error if it
- * hasn't been passed on to another filter.
- */
- int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
-
- /**
- * Frame poll callback. This returns the number of immediately available
- * samples. It should return a positive value if the next request_frame()
- * is guaranteed to return one frame (with no delay).
- *
- * Defaults to just calling the source poll_frame() method.
- *
- * Output pads only.
- */
- int (*poll_frame)(AVFilterLink *link);
-
- /**
- * Frame request callback. A call to this should result in at least one
- * frame being output over the given link. This should return zero on
- * success, and another value on error.
- * See ff_request_frame() for the error codes with a specific
- * meaning.
- *
- * Output pads only.
- */
- int (*request_frame)(AVFilterLink *link);
-
- /**
- * Link configuration callback.
- *
- * For output pads, this should set the following link properties:
- * video: width, height, sample_aspect_ratio, time_base
- * audio: sample_rate.
- *
- * This should NOT set properties such as format, channel_layout, etc which
- * are negotiated between filters by the filter system using the
- * query_formats() callback before this function is called.
- *
- * For input pads, this should check the properties of the link, and update
- * the filter's internal state as necessary.
- *
- * For both input and output pads, this should return zero on success,
- * and another value on error.
- */
- int (*config_props)(AVFilterLink *link);
-
- /**
- * The filter expects a fifo to be inserted on its input link,
- * typically because it has a delay.
- *
- * input pads only.
- */
- int needs_fifo;
-
- /**
- * The filter expects writable frames from its input link,
- * duplicating data buffers if needed.
- *
- * input pads only.
- */
- int needs_writable;
-};
-#endif
-
/**
* Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
* AVFilter.inputs/outputs).
@@ -639,16 +310,10 @@ struct AVFilterContext {
AVFilterPad *input_pads; ///< array of input pads
AVFilterLink **inputs; ///< array of pointers to input links
-#if FF_API_FOO_COUNT
- attribute_deprecated unsigned input_count; ///< @deprecated use nb_inputs
-#endif
unsigned nb_inputs; ///< number of input pads
AVFilterPad *output_pads; ///< array of output pads
AVFilterLink **outputs; ///< array of pointers to output links
-#if FF_API_FOO_COUNT
- attribute_deprecated unsigned output_count; ///< @deprecated use nb_outputs
-#endif
unsigned nb_outputs; ///< number of output pads
void *priv; ///< private data for use by the filter
@@ -763,8 +428,6 @@ struct AVFilterLink {
AVLINK_INIT ///< complete
} init_state;
- struct AVFilterPool *pool;
-
/**
* Graph the filter belongs to.
*/
@@ -820,15 +483,6 @@ struct AVFilterLink {
int max_samples;
/**
- * The buffer reference currently being received across the link by the
- * destination filter. This is used internally by the filter system to
- * allow automatic copying of buffers which do not have sufficient
- * permissions for the destination. This should not be accessed directly
- * by the filters.
- */
- AVFilterBufferRef *cur_buf_copy;
-
- /**
* True if the link is closed.
* If set, all attempts of start_frame, filter_frame or request_frame
* will fail with AVERROR_EOF, and if necessary the reference will be
@@ -897,69 +551,6 @@ void avfilter_link_set_closed(AVFilterLink *link, int closed);
*/
int avfilter_config_links(AVFilterContext *filter);
-#if FF_API_AVFILTERBUFFER
-/**
- * Create a buffer reference wrapped around an already allocated image
- * buffer.
- *
- * @param data pointers to the planes of the image to reference
- * @param linesize linesizes for the planes of the image to reference
- * @param perms the required access permissions
- * @param w the width of the image specified by the data and linesize arrays
- * @param h the height of the image specified by the data and linesize arrays
- * @param format the pixel format of the image specified by the data and linesize arrays
- */
-attribute_deprecated
-AVFilterBufferRef *
-avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum AVPixelFormat format);
-
-/**
- * Create an audio buffer reference wrapped around an already
- * allocated samples buffer.
- *
- * See avfilter_get_audio_buffer_ref_from_arrays_channels() for a version
- * that can handle unknown channel layouts.
- *
- * @param data pointers to the samples plane buffers
- * @param linesize linesize for the samples plane buffers
- * @param perms the required access permissions
- * @param nb_samples number of samples per channel
- * @param sample_fmt the format of each sample in the buffer to allocate
- * @param channel_layout the channel layout of the buffer
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- uint64_t channel_layout);
-/**
- * Create an audio buffer reference wrapped around an already
- * allocated samples buffer.
- *
- * @param data pointers to the samples plane buffers
- * @param linesize linesize for the samples plane buffers
- * @param perms the required access permissions
- * @param nb_samples number of samples per channel
- * @param sample_fmt the format of each sample in the buffer to allocate
- * @param channels the number of channels of the buffer
- * @param channel_layout the channel layout of the buffer,
- * must be either 0 or consistent with channels
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
- int linesize,
- int perms,
- int nb_samples,
- enum AVSampleFormat sample_fmt,
- int channels,
- uint64_t channel_layout);
-
-#endif
-
-
#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
#define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw)
@@ -1106,26 +697,6 @@ void avfilter_free(AVFilterContext *filter);
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
-#if FF_API_AVFILTERBUFFER
-/**
- * Copy the frame properties of src to dst, without copying the actual
- * image data.
- *
- * @return 0 on success, a negative number on error.
- */
-attribute_deprecated
-int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
-
-/**
- * Copy the frame properties and data pointers of src to dst, without copying
- * the actual data.
- *
- * @return 0 on success, a negative number on error.
- */
-attribute_deprecated
-int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
-#endif
-
/**
* @return AVClass for AVFilterContext.
*
@@ -1166,20 +737,11 @@ typedef int (avfilter_execute_func)(AVFilterContext *ctx, avfilter_action_func *
typedef struct AVFilterGraph {
const AVClass *av_class;
-#if FF_API_FOO_COUNT
- attribute_deprecated
- unsigned filter_count_unused;
-#endif
AVFilterContext **filters;
-#if !FF_API_FOO_COUNT
unsigned nb_filters;
-#endif
char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
char *resample_lavr_opts; ///< libavresample options to use for the auto-inserted resample filters
-#if FF_API_FOO_COUNT
- unsigned nb_filters;
-#endif
/**
* Type of multithreading allowed for filters in this graph. A combination
@@ -1375,7 +937,6 @@ AVFilterInOut *avfilter_inout_alloc(void);
*/
void avfilter_inout_free(AVFilterInOut **inout);
-#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
/**
* Add a graph described by a string to a graph.
*
@@ -1397,26 +958,6 @@ void avfilter_inout_free(AVFilterInOut **inout);
int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
AVFilterInOut *inputs, AVFilterInOut *outputs,
void *log_ctx);
-#else
-/**
- * Add a graph described by a string to a graph.
- *
- * @param graph the filter graph where to link the parsed graph context
- * @param filters string to be parsed
- * @param inputs pointer to a linked list to the inputs of the graph, may be NULL.
- * If non-NULL, *inputs is updated to contain the list of open inputs
- * after the parsing, should be freed with avfilter_inout_free().
- * @param outputs pointer to a linked list to the outputs of the graph, may be NULL.
- * If non-NULL, *outputs is updated to contain the list of open outputs
- * after the parsing, should be freed with avfilter_inout_free().
- * @return non negative on success, a negative AVERROR code on error
- * @deprecated Use avfilter_graph_parse_ptr() instead.
- */
-attribute_deprecated
-int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
- AVFilterInOut **inputs, AVFilterInOut **outputs,
- void *log_ctx);
-#endif
/**
* Add a graph described by a string to a graph.
diff --git a/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c b/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
index bac0da18a4c..b42983140a1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avfiltergraph.c
@@ -135,12 +135,6 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
graph->filters = filters;
graph->filters[graph->nb_filters++] = filter;
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
- graph->filter_count_unused = graph->nb_filters;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
filter->graph = graph;
return 0;
@@ -206,12 +200,6 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
graph->filters = filters;
graph->filters[graph->nb_filters++] = s;
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
- graph->filter_count_unused = graph->nb_filters;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
s->graph = graph;
return s;
@@ -631,6 +619,40 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
return 0;
}
+static int get_fmt_score(enum AVSampleFormat dst_fmt, enum AVSampleFormat src_fmt)
+{
+ int score = 0;
+
+ if (av_sample_fmt_is_planar(dst_fmt) != av_sample_fmt_is_planar(src_fmt))
+ score ++;
+
+ if (av_get_bytes_per_sample(dst_fmt) < av_get_bytes_per_sample(src_fmt)) {
+ score += 100 * (av_get_bytes_per_sample(src_fmt) - av_get_bytes_per_sample(dst_fmt));
+ }else
+ score += 10 * (av_get_bytes_per_sample(dst_fmt) - av_get_bytes_per_sample(src_fmt));
+
+ if (av_get_packed_sample_fmt(dst_fmt) == AV_SAMPLE_FMT_S32 &&
+ av_get_packed_sample_fmt(src_fmt) == AV_SAMPLE_FMT_FLT)
+ score += 20;
+
+ if (av_get_packed_sample_fmt(dst_fmt) == AV_SAMPLE_FMT_FLT &&
+ av_get_packed_sample_fmt(src_fmt) == AV_SAMPLE_FMT_S32)
+ score += 2;
+
+ return score;
+}
+
+static enum AVSampleFormat find_best_sample_fmt_of_2(enum AVSampleFormat dst_fmt1, enum AVSampleFormat dst_fmt2,
+ enum AVSampleFormat src_fmt)
+{
+ int score1, score2;
+
+ score1 = get_fmt_score(dst_fmt1, src_fmt);
+ score2 = get_fmt_score(dst_fmt2, src_fmt);
+
+ return score1 < score2 ? dst_fmt1 : dst_fmt2;
+}
+
static int pick_format(AVFilterLink *link, AVFilterLink *ref)
{
if (!link || !link->in_formats)
@@ -650,6 +672,19 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref)
av_get_pix_fmt_name(ref->format), has_alpha);
link->in_formats->formats[0] = best;
}
+ } else if (link->type == AVMEDIA_TYPE_AUDIO) {
+ if(ref && ref->type == AVMEDIA_TYPE_AUDIO){
+ enum AVSampleFormat best= AV_SAMPLE_FMT_NONE;
+ int i;
+ for (i=0; i<link->in_formats->nb_formats; i++) {
+ enum AVSampleFormat p = link->in_formats->formats[i];
+ best = find_best_sample_fmt_of_2(best, p, ref->format);
+ }
+ av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s\n",
+ av_get_sample_fmt_name(best), link->in_formats->nb_formats,
+ av_get_sample_fmt_name(ref->format));
+ link->in_formats->formats[0] = best;
+ }
}
link->in_formats->nb_formats = 1;
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffer.c b/chromium/third_party/ffmpeg/libavfilter/buffer.c
deleted file mode 100644
index a5b3b1dbafc..00000000000
--- a/chromium/third_party/ffmpeg/libavfilter/buffer.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright Stefano Sabatini <stefasab gmail com>
- * Copyright Anton Khirnov <anton khirnov net>
- * Copyright Michael Niedermayer <michaelni gmx at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/avassert.h"
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavcodec/avcodec.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "audio.h"
-#include "avcodec.h"
-#include "version.h"
-
-#if FF_API_AVFILTERBUFFER
-void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
-{
- if (ptr->extended_data != ptr->data)
- av_freep(&ptr->extended_data);
- av_freep(&ptr->data[0]);
- av_free(ptr);
-}
-
-static int copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
- *dst = *src;
- if (src->qp_table) {
- int qsize = src->qp_table_size;
- dst->qp_table = av_malloc(qsize);
- if (!dst->qp_table) {
- av_log(NULL, AV_LOG_ERROR, "Failed to allocate qp_table\n");
- dst->qp_table_size = 0;
- return AVERROR(ENOMEM);
- }
- memcpy(dst->qp_table, src->qp_table, qsize);
- }
- return 0;
-}
-
-AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
-{
- AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
- if (!ret)
- return NULL;
- *ret = *ref;
-
- ret->metadata = NULL;
- av_dict_copy(&ret->metadata, ref->metadata, 0);
-
- if (ref->type == AVMEDIA_TYPE_VIDEO) {
- ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
- if (!ret->video) {
- av_free(ret);
- return NULL;
- }
- copy_video_props(ret->video, ref->video);
- ret->extended_data = ret->data;
- } else if (ref->type == AVMEDIA_TYPE_AUDIO) {
- ret->audio = av_malloc(sizeof(AVFilterBufferRefAudioProps));
- if (!ret->audio) {
- av_free(ret);
- return NULL;
- }
- *ret->audio = *ref->audio;
-
- if (ref->extended_data && ref->extended_data != ref->data) {
- int nb_channels = av_get_channel_layout_nb_channels(ref->audio->channel_layout);
- if (!(ret->extended_data = av_malloc_array(sizeof(*ret->extended_data),
- nb_channels))) {
- av_freep(&ret->audio);
- av_freep(&ret);
- return NULL;
- }
- memcpy(ret->extended_data, ref->extended_data,
- sizeof(*ret->extended_data) * nb_channels);
- } else
- ret->extended_data = ret->data;
- }
- ret->perms &= pmask;
- ret->buf->refcount ++;
- return ret;
-}
-
-void avfilter_unref_buffer(AVFilterBufferRef *ref)
-{
- if (!ref)
- return;
- av_assert0(ref->buf->refcount > 0);
- if (!(--ref->buf->refcount))
- ref->buf->free(ref->buf);
- if (ref->extended_data != ref->data)
- av_freep(&ref->extended_data);
- if (ref->video)
- av_freep(&ref->video->qp_table);
- av_freep(&ref->video);
- av_freep(&ref->audio);
- av_dict_free(&ref->metadata);
- av_free(ref);
-}
-
-void avfilter_unref_bufferp(AVFilterBufferRef **ref)
-{
-FF_DISABLE_DEPRECATION_WARNINGS
- avfilter_unref_buffer(*ref);
-FF_ENABLE_DEPRECATION_WARNINGS
- *ref = NULL;
-}
-
-int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
-{
- dst->pts = src->pts;
- dst->pos = av_frame_get_pkt_pos(src);
- dst->format = src->format;
-
- av_dict_free(&dst->metadata);
- av_dict_copy(&dst->metadata, av_frame_get_metadata(src), 0);
-
- switch (dst->type) {
- case AVMEDIA_TYPE_VIDEO:
- dst->video->w = src->width;
- dst->video->h = src->height;
- dst->video->sample_aspect_ratio = src->sample_aspect_ratio;
- dst->video->interlaced = src->interlaced_frame;
- dst->video->top_field_first = src->top_field_first;
- dst->video->key_frame = src->key_frame;
- dst->video->pict_type = src->pict_type;
- break;
- case AVMEDIA_TYPE_AUDIO:
- dst->audio->sample_rate = src->sample_rate;
- dst->audio->channel_layout = src->channel_layout;
- break;
- default:
- return AVERROR(EINVAL);
- }
-
- return 0;
-}
-
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, const AVFilterBufferRef *src)
-{
- // copy common properties
- dst->pts = src->pts;
- dst->pos = src->pos;
-
- switch (src->type) {
- case AVMEDIA_TYPE_VIDEO: {
- if (dst->video->qp_table)
- av_freep(&dst->video->qp_table);
- copy_video_props(dst->video, src->video);
- break;
- }
- case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
- default: break;
- }
-
- av_dict_free(&dst->metadata);
- av_dict_copy(&dst->metadata, src->metadata, 0);
-}
-#endif /* FF_API_AVFILTERBUFFER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersink.c b/chromium/third_party/ffmpeg/libavfilter/buffersink.c
index b145e35c3f9..e693161554c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersink.c
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersink.c
@@ -62,6 +62,8 @@ typedef struct BufferSinkContext {
} BufferSinkContext;
#define NB_ITEMS(list) (list ## _size / sizeof(*list))
+#define FIFO_INIT_SIZE 8
+#define FIFO_INIT_ELEMENT_SIZE sizeof(void *)
static av_cold void uninit(AVFilterContext *ctx)
{
@@ -72,7 +74,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_audio_fifo_free(sink->audio_fifo);
if (sink->fifo) {
- while (av_fifo_size(sink->fifo) >= sizeof(AVFilterBufferRef *)) {
+ while (av_fifo_size(sink->fifo) >= FIFO_INIT_ELEMENT_SIZE) {
av_fifo_generic_read(sink->fifo, &frame, sizeof(frame), NULL);
av_frame_free(&frame);
}
@@ -84,7 +86,7 @@ static int add_buffer_ref(AVFilterContext *ctx, AVFrame *ref)
{
BufferSinkContext *buf = ctx->priv;
- if (av_fifo_space(buf->fifo) < sizeof(AVFilterBufferRef *)) {
+ if (av_fifo_space(buf->fifo) < FIFO_INIT_ELEMENT_SIZE) {
/* realloc fifo size */
if (av_fifo_realloc2(buf->fifo, av_fifo_size(buf->fifo) * 2) < 0) {
av_log(ctx, AV_LOG_ERROR,
@@ -95,7 +97,7 @@ static int add_buffer_ref(AVFilterContext *ctx, AVFrame *ref)
}
/* cache frame */
- av_fifo_generic_write(buf->fifo, &ref, sizeof(AVFilterBufferRef *), NULL);
+ av_fifo_generic_write(buf->fifo, &ref, FIFO_INIT_ELEMENT_SIZE, NULL);
return 0;
}
@@ -108,7 +110,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
if ((ret = add_buffer_ref(ctx, frame)) < 0)
return ret;
if (buf->warning_limit &&
- av_fifo_size(buf->fifo) / sizeof(AVFilterBufferRef *) >= buf->warning_limit) {
+ av_fifo_size(buf->fifo) / FIFO_INIT_ELEMENT_SIZE >= buf->warning_limit) {
av_log(ctx, AV_LOG_WARNING,
"%d buffers queued in %s, something may be wrong.\n",
buf->warning_limit,
@@ -242,13 +244,11 @@ AVABufferSinkParams *av_abuffersink_params_alloc(void)
return params;
}
-#define FIFO_INIT_SIZE 8
-
static av_cold int common_init(AVFilterContext *ctx)
{
BufferSinkContext *buf = ctx->priv;
- buf->fifo = av_fifo_alloc_array(FIFO_INIT_SIZE, sizeof(AVFilterBufferRef *));
+ buf->fifo = av_fifo_alloc_array(FIFO_INIT_SIZE, FIFO_INIT_ELEMENT_SIZE);
if (!buf->fifo) {
av_log(ctx, AV_LOG_ERROR, "Failed to allocate fifo\n");
return AVERROR(ENOMEM);
@@ -266,95 +266,6 @@ void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size)
inlink->partial_buf_size = frame_size;
}
-#if FF_API_AVFILTERBUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-static void compat_free_buffer(AVFilterBuffer *buf)
-{
- AVFrame *frame = buf->priv;
- av_frame_free(&frame);
- av_free(buf);
-}
-
-static int compat_read(AVFilterContext *ctx,
- AVFilterBufferRef **pbuf, int nb_samples, int flags)
-{
- AVFilterBufferRef *buf;
- AVFrame *frame;
- int ret;
-
- if (!pbuf)
- return ff_poll_frame(ctx->inputs[0]);
-
- frame = av_frame_alloc();
- if (!frame)
- return AVERROR(ENOMEM);
-
- if (!nb_samples)
- ret = av_buffersink_get_frame_flags(ctx, frame, flags);
- else
- ret = av_buffersink_get_samples(ctx, frame, nb_samples);
-
- if (ret < 0)
- goto fail;
-
- AV_NOWARN_DEPRECATED(
- if (ctx->inputs[0]->type == AVMEDIA_TYPE_VIDEO) {
- buf = avfilter_get_video_buffer_ref_from_arrays(frame->data, frame->linesize,
- AV_PERM_READ,
- frame->width, frame->height,
- frame->format);
- } else {
- buf = avfilter_get_audio_buffer_ref_from_arrays(frame->extended_data,
- frame->linesize[0], AV_PERM_READ,
- frame->nb_samples,
- frame->format,
- frame->channel_layout);
- }
- if (!buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- avfilter_copy_frame_props(buf, frame);
- )
-
- buf->buf->priv = frame;
- buf->buf->free = compat_free_buffer;
-
- *pbuf = buf;
-
- return 0;
-fail:
- av_frame_free(&frame);
- return ret;
-}
-
-int attribute_align_arg av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)
-{
- return compat_read(ctx, buf, 0, 0);
-}
-
-int attribute_align_arg av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
- int nb_samples)
-{
- return compat_read(ctx, buf, nb_samples, 0);
-}
-
-int attribute_align_arg av_buffersink_get_buffer_ref(AVFilterContext *ctx,
- AVFilterBufferRef **bufref, int flags)
-{
- *bufref = NULL;
-
- av_assert0( !strcmp(ctx->filter->name, "buffersink")
- || !strcmp(ctx->filter->name, "abuffersink")
- || !strcmp(ctx->filter->name, "ffbuffersink")
- || !strcmp(ctx->filter->name, "ffabuffersink"));
-
- return compat_read(ctx, bufref, 0, flags);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
{
av_assert0( !strcmp(ctx->filter->name, "buffersink")
@@ -363,19 +274,6 @@ AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
return ctx->inputs[0]->frame_rate;
}
-int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
-{
- BufferSinkContext *buf = ctx->priv;
- AVFilterLink *inlink = ctx->inputs[0];
-
- av_assert0( !strcmp(ctx->filter->name, "buffersink")
- || !strcmp(ctx->filter->name, "abuffersink")
- || !strcmp(ctx->filter->name, "ffbuffersink")
- || !strcmp(ctx->filter->name, "ffabuffersink"));
-
- return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
-}
-
static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
{
BufferSinkContext *buf = ctx->priv;
@@ -506,7 +404,7 @@ static const AVOption abuffersink_options[] = {
{ "sample_rates", "set the supported sample rates", OFFSET(sample_rates), AV_OPT_TYPE_BINARY, .flags = FLAGS },
{ "channel_layouts", "set the supported channel layouts", OFFSET(channel_layouts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
{ "channel_counts", "set the supported channel counts", OFFSET(channel_counts), AV_OPT_TYPE_BINARY, .flags = FLAGS },
- { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
+ { "all_channel_counts", "accept all channel counts", OFFSET(all_channel_counts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
{ NULL },
};
#undef FLAGS
@@ -514,57 +412,6 @@ static const AVOption abuffersink_options[] = {
AVFILTER_DEFINE_CLASS(buffersink);
AVFILTER_DEFINE_CLASS(abuffersink);
-#if FF_API_AVFILTERBUFFER
-
-#define ffbuffersink_options buffersink_options
-#define ffabuffersink_options abuffersink_options
-AVFILTER_DEFINE_CLASS(ffbuffersink);
-AVFILTER_DEFINE_CLASS(ffabuffersink);
-
-static const AVFilterPad ffbuffersink_inputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_VIDEO,
- .filter_frame = filter_frame,
- },
- { NULL },
-};
-
-AVFilter ff_vsink_ffbuffersink = {
- .name = "ffbuffersink",
- .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
- .priv_size = sizeof(BufferSinkContext),
- .priv_class = &ffbuffersink_class,
- .init_opaque = vsink_init,
- .uninit = uninit,
-
- .query_formats = vsink_query_formats,
- .inputs = ffbuffersink_inputs,
- .outputs = NULL,
-};
-
-static const AVFilterPad ffabuffersink_inputs[] = {
- {
- .name = "default",
- .type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
- },
- { NULL },
-};
-
-AVFilter ff_asink_ffabuffersink = {
- .name = "ffabuffersink",
- .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
- .init_opaque = asink_init,
- .uninit = uninit,
- .priv_size = sizeof(BufferSinkContext),
- .priv_class = &ffabuffersink_class,
- .query_formats = asink_query_formats,
- .inputs = ffabuffersink_inputs,
- .outputs = NULL,
-};
-#endif /* FF_API_AVFILTERBUFFER */
-
static const AVFilterPad avfilter_vsink_buffer_inputs[] = {
{
.name = "default",
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersink.h b/chromium/third_party/ffmpeg/libavfilter/buffersink.h
index 24cd2feac7b..e399b911753 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersink.h
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersink.h
@@ -33,63 +33,6 @@
* @{
*/
-#if FF_API_AVFILTERBUFFER
-/**
- * Get an audio/video buffer data from buffer_sink and put it in bufref.
- *
- * This function works with both audio and video buffer sinks.
- *
- * @param buffer_sink pointer to a buffersink or abuffersink context
- * @param flags a combination of AV_BUFFERSINK_FLAG_* flags
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure
- */
-attribute_deprecated
-int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink,
- AVFilterBufferRef **bufref, int flags);
-
-/**
- * Get the number of immediately available frames.
- */
-attribute_deprecated
-int av_buffersink_poll_frame(AVFilterContext *ctx);
-
-/**
- * Get a buffer with filtered data from sink and put it in buf.
- *
- * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
- * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
- * must be freed by the caller using avfilter_unref_buffer().
- * Buf may also be NULL to query whether a buffer is ready to be
- * output.
- *
- * @return >= 0 in case of success, a negative AVERROR code in case of
- * failure.
- */
-attribute_deprecated
-int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf);
-
-/**
- * Same as av_buffersink_read, but with the ability to specify the number of
- * samples read. This function is less efficient than av_buffersink_read(),
- * because it copies the data around.
- *
- * @param ctx pointer to a context of the abuffersink AVFilter.
- * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
- * must be freed by the caller using avfilter_unref_buffer(). buf
- * will contain exactly nb_samples audio samples, except at the end
- * of stream, when it can contain less than nb_samples.
- * Buf may also be NULL to query whether a buffer is ready to be
- * output.
- *
- * @warning do not mix this function with av_buffersink_read(). Use only one or
- * the other with a single sink, not both.
- */
-attribute_deprecated
-int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
- int nb_samples);
-#endif
-
/**
* Get a frame with filtered data from sink and put it in frame.
*
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersrc.c b/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
index bf77b88fec6..45e219a0843 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersrc.c
@@ -39,7 +39,6 @@
#include "formats.h"
#include "internal.h"
#include "video.h"
-#include "avcodec.h"
typedef struct BufferSourceContext {
const AVClass *class;
@@ -184,127 +183,6 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
return 0;
}
-#if FF_API_AVFILTERBUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-static void compat_free_buffer(void *opaque, uint8_t *data)
-{
- AVFilterBufferRef *buf = opaque;
- AV_NOWARN_DEPRECATED(
- avfilter_unref_buffer(buf);
- )
-}
-
-static void compat_unref_buffer(void *opaque, uint8_t *data)
-{
- AVBufferRef *buf = opaque;
- AV_NOWARN_DEPRECATED(
- av_buffer_unref(&buf);
- )
-}
-
-int av_buffersrc_add_ref(AVFilterContext *ctx, AVFilterBufferRef *buf,
- int flags)
-{
- BufferSourceContext *s = ctx->priv;
- AVFrame *frame = NULL;
- AVBufferRef *dummy_buf = NULL;
- int ret = 0, planes, i;
-
- if (!buf) {
- s->eof = 1;
- return 0;
- } else if (s->eof)
- return AVERROR(EINVAL);
-
- frame = av_frame_alloc();
- if (!frame)
- return AVERROR(ENOMEM);
-
- dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, buf,
- (buf->perms & AV_PERM_WRITE) ? 0 : AV_BUFFER_FLAG_READONLY);
- if (!dummy_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- AV_NOWARN_DEPRECATED(
- if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
- goto fail;
- )
-
-#define WRAP_PLANE(ref_out, data, data_size) \
-do { \
- AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf); \
- if (!dummy_ref) { \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
- ref_out = av_buffer_create(data, data_size, compat_unref_buffer, \
- dummy_ref, (buf->perms & AV_PERM_WRITE) ? 0 : AV_BUFFER_FLAG_READONLY); \
- if (!ref_out) { \
- av_buffer_unref(&dummy_ref); \
- av_frame_unref(frame); \
- ret = AVERROR(ENOMEM); \
- goto fail; \
- } \
-} while (0)
-
- if (ctx->outputs[0]->type == AVMEDIA_TYPE_VIDEO) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-
- planes = av_pix_fmt_count_planes(frame->format);
- if (!desc || planes <= 0) {
- ret = AVERROR(EINVAL);
- goto fail;
- }
-
- for (i = 0; i < planes; i++) {
- int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
- int plane_size = (frame->height >> v_shift) * frame->linesize[i];
-
- WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
- }
- } else {
- int planar = av_sample_fmt_is_planar(frame->format);
- int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
-
- planes = planar ? channels : 1;
-
- if (planes > FF_ARRAY_ELEMS(frame->buf)) {
- frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_mallocz_array(sizeof(*frame->extended_buf),
- frame->nb_extended_buf);
- if (!frame->extended_buf) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- }
-
- for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
- WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
-
- for (i = 0; i < planes - FF_ARRAY_ELEMS(frame->buf); i++)
- WRAP_PLANE(frame->extended_buf[i],
- frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
- frame->linesize[0]);
- }
-
- ret = av_buffersrc_add_frame_flags(ctx, frame, flags);
-
-fail:
- av_buffer_unref(&dummy_buf);
- av_frame_free(&frame);
-
- return ret;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-
-int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf)
-{
- return av_buffersrc_add_ref(ctx, buf, 0);
-}
-#endif
-
static av_cold int init_video(AVFilterContext *ctx)
{
BufferSourceContext *c = ctx->priv;
diff --git a/chromium/third_party/ffmpeg/libavfilter/buffersrc.h b/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
index ea34c04ee9f..cd3d95fb9a3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
+++ b/chromium/third_party/ffmpeg/libavfilter/buffersrc.h
@@ -42,13 +42,6 @@ enum {
*/
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1,
-#if FF_API_AVFILTERBUFFER
- /**
- * Ignored
- */
- AV_BUFFERSRC_FLAG_NO_COPY = 2,
-#endif
-
/**
* Immediately push the frame to the output.
*/
@@ -64,18 +57,6 @@ enum {
};
/**
- * Add buffer data in picref to buffer_src.
- *
- * @param buffer_src pointer to a buffer source context
- * @param picref a buffer reference, or NULL to mark EOF
- * @param flags a combination of AV_BUFFERSRC_FLAG_*
- * @return >= 0 in case of success, a negative AVERROR code
- * in case of failure
- */
-int av_buffersrc_add_ref(AVFilterContext *buffer_src,
- AVFilterBufferRef *picref, int flags);
-
-/**
* Get the number of failed requests.
*
* A failed request is when the request_frame method is called while no
@@ -84,21 +65,6 @@ int av_buffersrc_add_ref(AVFilterContext *buffer_src,
*/
unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
-#if FF_API_AVFILTERBUFFER
-/**
- * Add a buffer to a filtergraph.
- *
- * @param ctx an instance of the buffersrc filter
- * @param buf buffer containing frame data to be passed down the filtergraph.
- * This function will take ownership of buf, the user must not free it.
- * A NULL buf signals EOF -- i.e. no more frames will be sent to this filter.
- *
- * @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame()
- */
-attribute_deprecated
-int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf);
-#endif
-
/**
* Add a frame to the buffer source.
*
diff --git a/chromium/third_party/ffmpeg/libavfilter/drawutils.c b/chromium/third_party/ffmpeg/libavfilter/drawutils.c
index 5a82b10cd64..b65d57cfaea 100644
--- a/chromium/third_party/ffmpeg/libavfilter/drawutils.c
+++ b/chromium/third_party/ffmpeg/libavfilter/drawutils.c
@@ -172,15 +172,15 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
for (i = 0; i < desc->nb_components; i++) {
c = &desc->comp[i];
/* for now, only 8-bits formats */
- if (c->depth_minus1 != 8 - 1)
+ if (c->depth != 8)
return AVERROR(ENOSYS);
if (c->plane >= MAX_PLANES)
return AVERROR(ENOSYS);
/* strange interleaving */
if (pixelstep[c->plane] != 0 &&
- pixelstep[c->plane] != c->step_minus1 + 1)
+ pixelstep[c->plane] != c->step)
return AVERROR(ENOSYS);
- pixelstep[c->plane] = c->step_minus1 + 1;
+ pixelstep[c->plane] = c->step;
if (pixelstep[c->plane] >= 8)
return AVERROR(ENOSYS);
nb_planes = FFMAX(nb_planes, c->plane + 1);
@@ -196,7 +196,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
for (i = 0; i < ((desc->nb_components - 1) | 1); i++)
draw->comp_mask[desc->comp[i].plane] |=
- 1 << (desc->comp[i].offset_plus1 - 1);
+ 1 << desc->comp[i].offset;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/dualinput.c b/chromium/third_party/ffmpeg/libavfilter/dualinput.c
index 45f681078d3..ea2007f93c7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dualinput.c
+++ b/chromium/third_party/ffmpeg/libavfilter/dualinput.c
@@ -42,9 +42,13 @@ static int process_frame(FFFrameSync *fs)
int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
{
- FFFrameSyncIn *in = s->fs.in;
+ FFFrameSyncIn *in;
+ int ret;
- ff_framesync_init(&s->fs, ctx, 2);
+ if ((ret = ff_framesync_init(&s->fs, ctx, 2)) < 0)
+ return ret;
+
+ in = s->fs.in;
s->fs.opaque = s;
s->fs.on_event = process_frame;
in[0].time_base = ctx->inputs[0]->time_base;
diff --git a/chromium/third_party/ffmpeg/libavfilter/dualinput.h b/chromium/third_party/ffmpeg/libavfilter/dualinput.h
index 0ec0ea7350b..5ff23e62495 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dualinput.h
+++ b/chromium/third_party/ffmpeg/libavfilter/dualinput.h
@@ -31,7 +31,6 @@
typedef struct {
FFFrameSync fs;
- FFFrameSyncIn second_input; /* must be immediately after fs */
AVFrame *(*process)(AVFilterContext *ctx, AVFrame *main, const AVFrame *second);
int shortest; ///< terminate stream when the second input terminates
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_drawgraph.c b/chromium/third_party/ffmpeg/libavfilter/f_drawgraph.c
new file mode 100644
index 00000000000..2b9340b500b
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/f_drawgraph.c
@@ -0,0 +1,355 @@
+/*
+ * Copyright (c) 2015 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 "libavutil/eval.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct DrawGraphContext {
+ const AVClass *class;
+
+ char *key[4];
+ float min, max;
+ char *fg_str[4];
+ AVExpr *fg_expr[4];
+ uint8_t bg[4];
+ int mode;
+ int slide;
+ int w, h;
+
+ AVFrame *out;
+ int x;
+ int prev_y[4];
+ int first;
+} DrawGraphContext;
+
+#define OFFSET(x) offsetof(DrawGraphContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption drawgraph_options[] = {
+ { "m1", "set 1st metadata key", OFFSET(key[0]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "fg1", "set 1st foreground color expression", OFFSET(fg_str[0]), AV_OPT_TYPE_STRING, {.str="0xffff0000"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "m2", "set 2nd metadata key", OFFSET(key[1]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "fg2", "set 2nd foreground color expression", OFFSET(fg_str[1]), AV_OPT_TYPE_STRING, {.str="0xff00ff00"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "m3", "set 3rd metadata key", OFFSET(key[2]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "fg3", "set 3rd foreground color expression", OFFSET(fg_str[2]), AV_OPT_TYPE_STRING, {.str="0xffff00ff"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "m4", "set 4th metadata key", OFFSET(key[3]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "fg4", "set 4th foreground color expression", OFFSET(fg_str[3]), AV_OPT_TYPE_STRING, {.str="0xffffff00"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "bg", "set background color", OFFSET(bg), AV_OPT_TYPE_COLOR, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "min", "set minimal value", OFFSET(min), AV_OPT_TYPE_FLOAT, {.dbl=-1.}, INT_MIN, INT_MAX, FLAGS },
+ { "max", "set maximal value", OFFSET(max), AV_OPT_TYPE_FLOAT, {.dbl=1.}, INT_MIN, INT_MAX, FLAGS },
+ { "mode", "set graph mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS, "mode" },
+ {"bar", "draw bars", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode"},
+ {"dot", "draw dots", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode"},
+ {"line", "draw lines", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "mode"},
+ { "slide", "set slide mode", OFFSET(slide), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "slide" },
+ {"frame", "draw new frames", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "slide"},
+ {"replace", "replace old columns with new", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "slide"},
+ {"scroll", "scroll from right to left", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "slide"},
+ {"rscroll", "scroll from left to right", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "slide"},
+ { "size", "set graph size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="900x256"}, 0, 0, FLAGS },
+ { "s", "set graph size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="900x256"}, 0, 0, FLAGS },
+ { NULL }
+};
+
+static const char *const var_names[] = { "MAX", "MIN", "VAL", NULL };
+enum { VAR_MAX, VAR_MIN, VAR_VAL, VAR_VARS_NB };
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ DrawGraphContext *s = ctx->priv;
+ int ret, i;
+
+ if (s->max <= s->min) {
+ av_log(ctx, AV_LOG_ERROR, "max is same or lower than min\n");
+ return AVERROR(EINVAL);
+ }
+
+ for (i = 0; i < 4; i++) {
+ if (s->fg_str[i]) {
+ ret = av_expr_parse(&s->fg_expr[i], s->fg_str[i], var_names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+
+ if (ret < 0)
+ return ret;
+ }
+ }
+
+ s->first = 1;
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterLink *outlink = ctx->outputs[0];
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_RGBA,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ ff_formats_ref(fmts_list, &outlink->in_formats);
+
+ return 0;
+}
+
+static void clear_image(DrawGraphContext *s, AVFrame *out, AVFilterLink *outlink)
+{
+ int i, j;
+ int bg = AV_RN32(s->bg);
+
+ for (i = 0; i < out->height; i++)
+ for (j = 0; j < out->width; j++)
+ AV_WN32(out->data[0] + i * out->linesize[0] + j * 4, bg);
+}
+
+static inline void draw_dot(int fg, int x, int y, AVFrame *out)
+{
+ AV_WN32(out->data[0] + y * out->linesize[0] + x * 4, fg);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ DrawGraphContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVDictionary *metadata;
+ AVDictionaryEntry *e;
+ AVFrame *out = s->out;
+ int i;
+
+ if (!s->out || s->out->width != outlink->w ||
+ s->out->height != outlink->h) {
+ av_frame_free(&s->out);
+ s->out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ out = s->out;
+ if (!s->out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+
+ clear_image(s, out, outlink);
+ }
+ av_frame_copy_props(out, in);
+
+ metadata = av_frame_get_metadata(in);
+
+ for (i = 0; i < 4; i++) {
+ double values[VAR_VARS_NB];
+ int j, y, x, old;
+ uint32_t fg, bg;
+ float vf;
+
+ e = av_dict_get(metadata, s->key[i], NULL, 0);
+ if (!e || !e->value)
+ continue;
+
+ if (sscanf(e->value, "%f", &vf) != 1)
+ continue;
+
+ vf = av_clipf(vf, s->min, s->max);
+
+ values[VAR_MIN] = s->min;
+ values[VAR_MAX] = s->max;
+ values[VAR_VAL] = vf;
+
+ fg = av_expr_eval(s->fg_expr[i], values, NULL);
+ bg = AV_RN32(s->bg);
+
+ if (i == 0 && (s->x >= outlink->w || s->slide == 3)) {
+ if (s->slide == 0 || s->slide == 1)
+ s->x = 0;
+
+ if (s->slide == 2) {
+ s->x = outlink->w - 1;
+ for (j = 0; j < outlink->h; j++) {
+ memmove(out->data[0] + j * out->linesize[0] ,
+ out->data[0] + j * out->linesize[0] + 4,
+ (outlink->w - 1) * 4);
+ }
+ } else if (s->slide == 3) {
+ s->x = 0;
+ for (j = 0; j < outlink->h; j++) {
+ memmove(out->data[0] + j * out->linesize[0] + 4,
+ out->data[0] + j * out->linesize[0],
+ (outlink->w - 1) * 4);
+ }
+ } else if (s->slide == 0) {
+ clear_image(s, out, outlink);
+ }
+ }
+
+ x = s->x;
+ y = (outlink->h - 1) * (1 - ((vf - s->min) / (s->max - s->min)));
+
+ switch (s->mode) {
+ case 0:
+ if (i == 0 && (s->slide > 0))
+ for (j = 0; j < outlink->h; j++)
+ draw_dot(bg, x, j, out);
+
+ old = AV_RN32(out->data[0] + y * out->linesize[0] + x * 4);
+ for (j = y; j < outlink->h; j++) {
+ if (old != bg &&
+ (AV_RN32(out->data[0] + j * out->linesize[0] + x * 4) != old) ||
+ AV_RN32(out->data[0] + FFMIN(j+1, outlink->h - 1) * out->linesize[0] + x * 4) != old) {
+ draw_dot(fg, x, j, out);
+ break;
+ }
+ draw_dot(fg, x, j, out);
+ }
+ break;
+ case 1:
+ if (i == 0 && (s->slide > 0))
+ for (j = 0; j < outlink->h; j++)
+ draw_dot(bg, x, j, out);
+ draw_dot(fg, x, y, out);
+ break;
+ case 2:
+ if (s->first) {
+ s->first = 0;
+ s->prev_y[i] = y;
+ }
+
+ if (i == 0 && (s->slide > 0)) {
+ for (j = 0; j < y; j++)
+ draw_dot(bg, x, j, out);
+ for (j = outlink->h - 1; j > y; j--)
+ draw_dot(bg, x, j, out);
+ }
+ if (y <= s->prev_y[i]) {
+ for (j = y; j <= s->prev_y[i]; j++)
+ draw_dot(fg, x, j, out);
+ } else {
+ for (j = s->prev_y[i]; j <= y; j++)
+ draw_dot(fg, x, j, out);
+ }
+ s->prev_y[i] = y;
+ break;
+ }
+ }
+
+ s->x++;
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, av_frame_clone(s->out));
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ DrawGraphContext *s = outlink->src->priv;
+
+ outlink->w = s->w;
+ outlink->h = s->h;
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ DrawGraphContext *s = ctx->priv;
+ int i;
+
+ for (i = 0; i < 4; i++)
+ av_expr_free(s->fg_expr[i]);
+ av_frame_free(&s->out);
+}
+
+#if CONFIG_DRAWGRAPH_FILTER
+
+AVFILTER_DEFINE_CLASS(drawgraph);
+
+static const AVFilterPad drawgraph_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad drawgraph_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_drawgraph = {
+ .name = "drawgraph",
+ .description = NULL_IF_CONFIG_SMALL("Draw a graph using input video metadata."),
+ .priv_size = sizeof(DrawGraphContext),
+ .priv_class = &drawgraph_class,
+ .query_formats = query_formats,
+ .init = init,
+ .uninit = uninit,
+ .inputs = drawgraph_inputs,
+ .outputs = drawgraph_outputs,
+};
+
+#endif // CONFIG_DRAWGRAPH_FILTER
+
+#if CONFIG_ADRAWGRAPH_FILTER
+
+#define adrawgraph_options drawgraph_options
+AVFILTER_DEFINE_CLASS(adrawgraph);
+
+static const AVFilterPad adrawgraph_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad adrawgraph_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_avf_adrawgraph = {
+ .name = "adrawgraph",
+ .description = NULL_IF_CONFIG_SMALL("Draw a graph using input audio metadata."),
+ .priv_size = sizeof(DrawGraphContext),
+ .priv_class = &adrawgraph_class,
+ .query_formats = query_formats,
+ .init = init,
+ .uninit = uninit,
+ .inputs = adrawgraph_inputs,
+ .outputs = adrawgraph_outputs,
+};
+#endif // CONFIG_ADRAWGRAPH_FILTER
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
index c18ae799159..cad1119ee5d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
@@ -158,7 +158,7 @@ static const AVOption ebur128_options[] = {
{ "framelog", "force frame logging level", OFFSET(loglevel), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, A|V|F, "level" },
{ "info", "information logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_INFO}, INT_MIN, INT_MAX, A|V|F, "level" },
{ "verbose", "verbose logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_VERBOSE}, INT_MIN, INT_MAX, A|V|F, "level" },
- { "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|F },
+ { "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, A|V|F },
{ "peak", "set peak mode", OFFSET(peak_mode), AV_OPT_TYPE_FLAGS, {.i64 = PEAK_MODE_NONE}, 0, INT_MAX, A|F, "mode" },
{ "none", "disable any peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_NONE}, INT_MIN, INT_MAX, A|F, "mode" },
{ "sample", "enable peak-sample mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_SAMPLES_PEAKS}, INT_MIN, INT_MAX, A|F, "mode" },
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_perms.c b/chromium/third_party/ffmpeg/libavfilter/f_perms.c
index abe2e4f46f8..40b88111495 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_perms.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_perms.c
@@ -56,16 +56,16 @@ static const AVOption options[] = {
static av_cold int init(AVFilterContext *ctx)
{
- PermsContext *perms = ctx->priv;
+ PermsContext *s = ctx->priv;
- if (perms->mode == MODE_RANDOM) {
+ if (s->mode == MODE_RANDOM) {
uint32_t seed;
- if (perms->random_seed == -1)
- perms->random_seed = av_get_random_seed();
- seed = perms->random_seed;
+ if (s->random_seed == -1)
+ s->random_seed = av_get_random_seed();
+ seed = s->random_seed;
av_log(ctx, AV_LOG_INFO, "random seed: 0x%08x\n", seed);
- av_lfg_init(&perms->lfg, seed);
+ av_lfg_init(&s->lfg, seed);
}
return 0;
@@ -78,14 +78,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
int ret;
AVFilterContext *ctx = inlink->dst;
- PermsContext *perms = ctx->priv;
+ PermsContext *s = ctx->priv;
AVFrame *out = frame;
enum perm in_perm = av_frame_is_writable(frame) ? RW : RO;
enum perm out_perm;
- switch (perms->mode) {
+ switch (s->mode) {
case MODE_TOGGLE: out_perm = in_perm == RO ? RW : RO; break;
- case MODE_RANDOM: out_perm = av_lfg_get(&perms->lfg) & 1 ? RW : RO; break;
+ case MODE_RANDOM: out_perm = av_lfg_get(&s->lfg) & 1 ? RW : RO; break;
case MODE_RO: out_perm = RO; break;
case MODE_RW: out_perm = RW; break;
default: out_perm = in_perm; break;
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_reverse.c b/chromium/third_party/ffmpeg/libavfilter/f_reverse.c
new file mode 100644
index 00000000000..37c25e90456
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/f_reverse.c
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2015 Derek Buitenhuis
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define DEFAULT_LENGTH 300
+
+typedef struct ReverseContext {
+ int nb_frames;
+ AVFrame **frames;
+ unsigned int frames_size;
+ unsigned int pts_size;
+ int64_t *pts;
+ int flush_idx;
+} ReverseContext;
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ ReverseContext *s = ctx->priv;
+
+ s->pts = av_fast_realloc(NULL, &s->pts_size,
+ DEFAULT_LENGTH * sizeof(*(s->pts)));
+ if (!s->pts)
+ return AVERROR(ENOMEM);
+
+ s->frames = av_fast_realloc(NULL, &s->frames_size,
+ DEFAULT_LENGTH * sizeof(*(s->frames)));
+ if (!s->frames) {
+ av_freep(&s->pts);
+ return AVERROR(ENOMEM);
+ }
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ReverseContext *s = ctx->priv;
+
+ av_freep(&s->pts);
+ av_freep(&s->frames);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ReverseContext *s = ctx->priv;
+ void *ptr;
+
+ if (s->nb_frames + 1 > s->pts_size / sizeof(*(s->pts))) {
+ ptr = av_fast_realloc(s->pts, &s->pts_size, s->pts_size * 2);
+ if (!ptr)
+ return AVERROR(ENOMEM);
+ s->pts = ptr;
+ }
+
+ if (s->nb_frames + 1 > s->frames_size / sizeof(*(s->frames))) {
+ ptr = av_fast_realloc(s->frames, &s->frames_size, s->frames_size * 2);
+ if (!ptr)
+ return AVERROR(ENOMEM);
+ s->frames = ptr;
+ }
+
+ s->frames[s->nb_frames] = in;
+ s->pts[s->nb_frames] = in->pts;
+ s->nb_frames++;
+
+ return 0;
+}
+
+#if CONFIG_REVERSE_FILTER
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ ReverseContext *s = ctx->priv;
+ int ret;
+
+ ret = ff_request_frame(ctx->inputs[0]);
+
+ if (ret == AVERROR_EOF && s->nb_frames > 0) {
+ AVFrame *out = s->frames[s->nb_frames - 1];
+ out->pts = s->pts[s->flush_idx++];
+ ret = ff_filter_frame(outlink, out);
+ s->nb_frames--;
+ }
+
+ return ret;
+}
+
+static const AVFilterPad reverse_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad reverse_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_reverse = {
+ .name = "reverse",
+ .description = NULL_IF_CONFIG_SMALL("Reverse a clip."),
+ .priv_size = sizeof(ReverseContext),
+ .init = init,
+ .uninit = uninit,
+ .inputs = reverse_inputs,
+ .outputs = reverse_outputs,
+};
+
+#endif /* CONFIG_REVERSE_FILTER */
+
+#if CONFIG_AREVERSE_FILTER
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+ AVFilterChannelLayouts *layouts;
+ int ret;
+
+ layouts = ff_all_channel_counts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_channel_layouts(ctx, layouts);
+ if (ret < 0)
+ return ret;
+
+ ret = ff_set_common_formats(ctx, ff_planar_sample_fmts());
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static int areverse_request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ ReverseContext *s = ctx->priv;
+ int ret, p, i, j;
+
+ ret = ff_request_frame(ctx->inputs[0]);
+
+ if (ret == AVERROR_EOF && s->nb_frames > 0) {
+ AVFrame *out = s->frames[s->nb_frames - 1];
+ out->pts = s->pts[s->flush_idx++];
+
+ for (p = 0; p < outlink->channels; p++) {
+ switch (outlink->format) {
+ case AV_SAMPLE_FMT_U8P: {
+ uint8_t *dst = (uint8_t *)out->extended_data[p];
+ for (i = 0, j = out->nb_samples - 1; i < j; i++, j--)
+ FFSWAP(uint8_t, dst[i], dst[j]);
+ }
+ break;
+ case AV_SAMPLE_FMT_S16P: {
+ int16_t *dst = (int16_t *)out->extended_data[p];
+ for (i = 0, j = out->nb_samples - 1; i < j; i++, j--)
+ FFSWAP(int16_t, dst[i], dst[j]);
+ }
+ break;
+ case AV_SAMPLE_FMT_S32P: {
+ int32_t *dst = (int32_t *)out->extended_data[p];
+ for (i = 0, j = out->nb_samples - 1; i < j; i++, j--)
+ FFSWAP(int32_t, dst[i], dst[j]);
+ }
+ break;
+ case AV_SAMPLE_FMT_FLTP: {
+ float *dst = (float *)out->extended_data[p];
+ for (i = 0, j = out->nb_samples - 1; i < j; i++, j--)
+ FFSWAP(float, dst[i], dst[j]);
+ }
+ break;
+ case AV_SAMPLE_FMT_DBLP: {
+ double *dst = (double *)out->extended_data[p];
+ for (i = 0, j = out->nb_samples - 1; i < j; i++, j--)
+ FFSWAP(double, dst[i], dst[j]);
+ }
+ break;
+ }
+ }
+
+ ret = ff_filter_frame(outlink, out);
+ s->nb_frames--;
+ }
+
+ return ret;
+}
+
+static const AVFilterPad areverse_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .needs_writable = 1,
+ },
+ { NULL }
+};
+
+static const AVFilterPad areverse_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .request_frame = areverse_request_frame,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_areverse = {
+ .name = "areverse",
+ .description = NULL_IF_CONFIG_SMALL("Reverse an audio clip."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(ReverseContext),
+ .init = init,
+ .uninit = uninit,
+ .inputs = areverse_inputs,
+ .outputs = areverse_outputs,
+};
+
+#endif /* CONFIG_AREVERSE_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/formats.c b/chromium/third_party/ffmpeg/libavfilter/formats.c
index 4f9773bd151..8758b3d1131 100644
--- a/chromium/third_party/ffmpeg/libavfilter/formats.c
+++ b/chromium/third_party/ffmpeg/libavfilter/formats.c
@@ -637,23 +637,20 @@ int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
void *log_ctx)
{
char *tail;
- int64_t chlayout, count;
+ int64_t chlayout;
- if (nret) {
- count = strtol(arg, &tail, 10);
- if (*tail == 'c' && !tail[1] && count > 0 && count < 63) {
- *nret = count;
- *ret = 0;
- return 0;
- }
- }
chlayout = av_get_channel_layout(arg);
if (chlayout == 0) {
chlayout = strtol(arg, &tail, 10);
- if (*tail || chlayout == 0) {
+ if (!(*tail == '\0' || *tail == 'c' && *(tail + 1) == '\0') || chlayout <= 0 || chlayout > 63) {
av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
return AVERROR(EINVAL);
}
+ if (nret) {
+ *nret = chlayout;
+ *ret = 0;
+ return 0;
+ }
}
*ret = chlayout;
if (nret)
@@ -669,12 +666,41 @@ int main(void)
{
const int64_t *cl;
char buf[512];
+ int i;
+ const char *teststrings[] ={
+ "blah",
+ "1",
+ "2",
+ "-1",
+ "60",
+ "65",
+ "1c",
+ "2c",
+ "-1c",
+ "60c",
+ "65c",
+ "5.1",
+ "stereo",
+ "1+1+1+1",
+ "1c+1c+1c+1c",
+ "2c+1c",
+ "0x3",
+ };
for (cl = avfilter_all_channel_layouts; *cl != -1; cl++) {
av_get_channel_layout_string(buf, sizeof(buf), -1, *cl);
printf("%s\n", buf);
}
+ for ( i = 0; i<FF_ARRAY_ELEMS(teststrings); i++) {
+ int64_t layout = -1;
+ int count = -1;
+ int ret;
+ ret = ff_parse_channel_layout(&layout, &count, teststrings[i], NULL);
+
+ printf ("%d = ff_parse_channel_layout(%016"PRIX64", %2d, %s);\n", ret ? -1 : 0, layout, count, teststrings[i]);
+ }
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/framesync.c b/chromium/third_party/ffmpeg/libavfilter/framesync.c
index 12db50cb77d..bdac40b783c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/framesync.c
+++ b/chromium/third_party/ffmpeg/libavfilter/framesync.c
@@ -46,11 +46,16 @@ enum {
STATE_EOF,
};
-void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
+int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in)
{
fs->class = &framesync_class;
fs->parent = parent;
fs->nb_in = nb_in;
+
+ fs->in = av_calloc(nb_in, sizeof(*fs->in));
+ if (!fs->in)
+ return AVERROR(ENOMEM);
+ return 0;
}
static void framesync_sync_level_update(FFFrameSync *fs)
@@ -267,6 +272,8 @@ void ff_framesync_uninit(FFFrameSync *fs)
av_frame_free(&fs->in[i].frame_next);
ff_bufqueue_discard_all(&fs->in[i].queue);
}
+
+ av_freep(&fs->in);
}
int ff_framesync_process_frame(FFFrameSync *fs, unsigned all)
diff --git a/chromium/third_party/ffmpeg/libavfilter/framesync.h b/chromium/third_party/ffmpeg/libavfilter/framesync.h
index 2072781054d..7ba99d5d861 100644
--- a/chromium/third_party/ffmpeg/libavfilter/framesync.h
+++ b/chromium/third_party/ffmpeg/libavfilter/framesync.h
@@ -201,9 +201,9 @@ typedef struct FFFrameSync {
uint8_t eof;
/**
- * Array of inputs; all inputs must be in consecutive memory
+ * Pointer to array of inputs.
*/
- FFFrameSyncIn in[1]; /* must be the last field */
+ FFFrameSyncIn *in;
} FFFrameSync;
@@ -215,8 +215,9 @@ typedef struct FFFrameSync {
* @param fs frame sync structure to initialize
* @param parent parent object, used for logging
* @param nb_in number of inputs
+ * @return >= 0 for success or a negative error code
*/
-void ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in);
+int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in);
/**
* Configure a frame sync structure.
diff --git a/chromium/third_party/ffmpeg/libavfilter/graphdump.c b/chromium/third_party/ffmpeg/libavfilter/graphdump.c
index 3d702c6af5f..531bb571aa4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/graphdump.c
+++ b/chromium/third_party/ffmpeg/libavfilter/graphdump.c
@@ -26,6 +26,7 @@
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "avfiltergraph.h"
+#include "internal.h"
static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
{
diff --git a/chromium/third_party/ffmpeg/libavfilter/graphparser.c b/chromium/third_party/ffmpeg/libavfilter/graphparser.c
index dd331d12c05..d9f40d698dc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/graphparser.c
+++ b/chromium/third_party/ffmpeg/libavfilter/graphparser.c
@@ -118,13 +118,16 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
return AVERROR(ENOMEM);
}
- if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&
+ if (!strcmp(filt_name, "scale") && (!args || !strstr(args, "flags")) &&
ctx->scale_sws_opts) {
- tmp_args = av_asprintf("%s:%s",
- args, ctx->scale_sws_opts);
- if (!tmp_args)
- return AVERROR(ENOMEM);
- args = tmp_args;
+ if (args) {
+ tmp_args = av_asprintf("%s:%s",
+ args, ctx->scale_sws_opts);
+ if (!tmp_args)
+ return AVERROR(ENOMEM);
+ args = tmp_args;
+ } else
+ args = ctx->scale_sws_opts;
}
ret = avfilter_init_str(*filt_ctx, args);
@@ -453,7 +456,6 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
return ret;
}
-#if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
AVFilterInOut *open_inputs,
AVFilterInOut *open_outputs, void *log_ctx)
@@ -515,13 +517,6 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
avfilter_inout_free(&open_inputs);
avfilter_inout_free(&open_outputs);
return ret;
-#else
-int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
- AVFilterInOut **inputs, AVFilterInOut **outputs,
- void *log_ctx)
-{
- return avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx);
-#endif
}
int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters,
diff --git a/chromium/third_party/ffmpeg/libavfilter/internal.h b/chromium/third_party/ffmpeg/libavfilter/internal.h
index a7ec751a0f4..78166540106 100644
--- a/chromium/third_party/ffmpeg/libavfilter/internal.h
+++ b/chromium/third_party/ffmpeg/libavfilter/internal.h
@@ -33,14 +33,6 @@
#include "video.h"
#include "libavcodec/avcodec.h"
-#define POOL_SIZE 32
-typedef struct AVFilterPool {
- AVFilterBufferRef *pic[POOL_SIZE];
- int count;
- int refcount;
- int draining;
-} AVFilterPool;
-
typedef struct AVFilterCommand {
double time; ///< time expressed in seconds
char *command; ///< command
@@ -54,7 +46,6 @@ typedef struct AVFilterCommand {
*/
void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link);
-#if !FF_API_AVFILTERPAD_PUBLIC
/**
* A filter pad used for either input or output.
*/
@@ -151,7 +142,6 @@ struct AVFilterPad {
*/
int needs_writable;
};
-#endif
struct AVFilterGraphInternal {
void *thread;
@@ -162,11 +152,6 @@ struct AVFilterInternal {
avfilter_execute_func *execute;
};
-#if FF_API_AVFILTERBUFFER
-/** default handler for freeing audio/video buffer when there are no references left */
-void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
-#endif
-
/** Tell is a format is contained in the provided list terminated by -1. */
int ff_fmt_is_in(int fmt, const int *fmts);
@@ -269,28 +254,16 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
static inline int ff_insert_inpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
- int ret = ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
+ return ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
&f->input_pads, &f->inputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
- f->input_count = f->nb_inputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
- return ret;
}
/** Insert a new output pad for the filter. */
static inline int ff_insert_outpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
- int ret = ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
+ return ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
&f->output_pads, &f->outputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
- f->output_count = f->nb_outputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
- return ret;
}
/**
@@ -305,8 +278,27 @@ int ff_poll_frame(AVFilterLink *link);
/**
* Request an input frame from the filter at the other end of the link.
*
+ * The input filter may pass the request on to its inputs, fulfill the
+ * request from an internal buffer or any other means specific to its function.
+ *
+ * When the end of a stream is reached AVERROR_EOF is returned and no further
+ * frames are returned after that.
+ *
+ * When a filter is unable to output a frame for example due to its sources
+ * being unable to do so or because it depends on external means pushing data
+ * into it then AVERROR(EAGAIN) is returned.
+ * It is important that a AVERROR(EAGAIN) return is returned all the way to the
+ * caller (generally eventually a user application) as this step may (but does
+ * not have to be) necessary to provide the input with the next frame.
+ *
+ * If a request is successful then the filter_frame() function will be called
+ * at least once before ff_request_frame() returns
+ *
* @param link the input link
* @return zero on success
+ * AVERROR_EOF on end of file
+ * AVERROR(EAGAIN) if the previous filter cannot output a frame
+ * currently and can neither guarantee that EOF has been reached.
*/
int ff_request_frame(AVFilterLink *link);
@@ -319,9 +311,6 @@ int ff_request_frame(AVFilterLink *link);
.category = AV_CLASS_CATEGORY_FILTER, \
}
-AVFilterBufferRef *ff_copy_buffer_ref(AVFilterLink *outlink,
- AVFilterBufferRef *ref);
-
/**
* Find the index of a link.
*
@@ -330,9 +319,6 @@ AVFilterBufferRef *ff_copy_buffer_ref(AVFilterLink *outlink,
#define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads))
#define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
-int ff_buffersink_read_compat(AVFilterContext *ctx, AVFilterBufferRef **buf);
-int ff_buffersink_read_samples_compat(AVFilterContext *ctx, AVFilterBufferRef **pbuf,
- int nb_samples);
/**
* Send a frame of data to the next filter.
*
diff --git a/chromium/third_party/ffmpeg/libavfilter/psnr.h b/chromium/third_party/ffmpeg/libavfilter/psnr.h
new file mode 100644
index 00000000000..efe94da23c1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/psnr.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LIBAVFILTER_PSNR_H
+#define LIBAVFILTER_PSNR_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef struct PSNRDSPContext {
+ uint64_t (*sse_line)(const uint8_t *buf, const uint8_t *ref, int w);
+} PSNRDSPContext;
+
+void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp);
+
+#endif /* LIBAVFILTER_PSNR_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/removegrain.h b/chromium/third_party/ffmpeg/libavfilter/removegrain.h
new file mode 100644
index 00000000000..60401fbe438
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/removegrain.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015 Paul B Mahol
+ * Copyright (c) 2015 James Darnley
+ *
+ * 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 "avfilter.h"
+
+typedef struct RemoveGrainContext {
+ const AVClass *class;
+
+ int mode[4];
+
+ int nb_planes;
+ int planewidth[4];
+ int planeheight[4];
+ int skip_even;
+ int skip_odd;
+
+ int (*rg[4])(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
+
+ void (*fl[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+} RemoveGrainContext;
+
+void ff_removegrain_init_x86(RemoveGrainContext *rg);
diff --git a/chromium/third_party/ffmpeg/libavfilter/src_movie.c b/chromium/third_party/ffmpeg/libavfilter/src_movie.c
index 908c03e1d33..bbdcbc8cd0b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/src_movie.c
+++ b/chromium/third_party/ffmpeg/libavfilter/src_movie.c
@@ -35,10 +35,10 @@
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
#include "libavutil/timestamp.h"
#include "libavformat/avformat.h"
#include "audio.h"
-#include "avcodec.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
@@ -536,7 +536,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
}
frame->pts = av_frame_get_best_effort_timestamp(frame);
- av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
+ ff_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
describe_frame_to_str((char[1024]){0}, 1024, frame, frame_type, outlink));
if (st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/ssim.h b/chromium/third_party/ffmpeg/libavfilter/ssim.h
new file mode 100644
index 00000000000..cd3a6eef4ba
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/ssim.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LIBAVFILTER_SSIM_H
+#define LIBAVFILTER_SSIM_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef struct SSIMDSPContext {
+ void (*ssim_4x4_line)(const uint8_t *buf, ptrdiff_t buf_stride,
+ const uint8_t *ref, ptrdiff_t ref_stride,
+ int (*sums)[4], int w);
+ float (*ssim_end_line)(const int (*sum0)[4], const int (*sum1)[4], int w);
+} SSIMDSPContext;
+
+void ff_ssim_init_x86(SSIMDSPContext *dsp);
+
+#endif /* LIBAVFILTER_SSIM_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/version.h b/chromium/third_party/ffmpeg/libavfilter/version.h
index e7b585234d0..e7204bca7b4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/version.h
+++ b/chromium/third_party/ffmpeg/libavfilter/version.h
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
-#define LIBAVFILTER_VERSION_MAJOR 5
-#define LIBAVFILTER_VERSION_MINOR 17
+#define LIBAVFILTER_VERSION_MAJOR 6
+#define LIBAVFILTER_VERSION_MINOR 3
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -49,32 +49,23 @@
* the public API and may change, break or disappear at any time.
*/
-#ifndef FF_API_AVFILTERPAD_PUBLIC
-#define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 6)
-#endif
-#ifndef FF_API_FOO_COUNT
-#define FF_API_FOO_COUNT (LIBAVFILTER_VERSION_MAJOR < 6)
-#endif
-#ifndef FF_API_AVFILTERBUFFER
-#define FF_API_AVFILTERBUFFER (LIBAVFILTER_VERSION_MAJOR < 6)
-#endif
#ifndef FF_API_OLD_FILTER_OPTS
-#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 6)
+#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7)
+#endif
+#ifndef FF_API_OLD_FILTER_OPTS_ERROR
+#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7)
#endif
#ifndef FF_API_AVFILTER_OPEN
-#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 6)
+#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7)
#endif
#ifndef FF_API_AVFILTER_INIT_FILTER
-#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 6)
+#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7)
#endif
#ifndef FF_API_OLD_FILTER_REGISTER
-#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 6)
-#endif
-#ifndef FF_API_OLD_GRAPH_PARSE
-#define FF_API_OLD_GRAPH_PARSE (LIBAVFILTER_VERSION_MAJOR < 5)
+#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7)
#endif
#ifndef FF_API_NOCONST_GET_NAME
-#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 6)
+#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7)
#endif
#endif /* AVFILTER_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c b/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
index 84dbee95d5f..bf308248516 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_aspect.c
@@ -69,10 +69,10 @@ typedef struct AspectContext {
static av_cold int init(AVFilterContext *ctx)
{
+#if FF_API_OLD_FILTER_OPTS
AspectContext *s = ctx->priv;
int ret;
-#if FF_API_OLD_FILTER_OPTS
if (s->ratio_expr && s->aspect_den > 0) {
double num;
av_log(ctx, AV_LOG_WARNING,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_atadenoise.c b/chromium/third_party/ffmpeg/libavfilter/vf_atadenoise.c
new file mode 100755
index 00000000000..9ce0250471c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_atadenoise.c
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2015 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
+ */
+
+/**
+ * @file
+ * Adaptive Temporal Averaging Denoiser,
+ * based on paper "Video Denoising Based on Adaptive Temporal Averaging" by
+ * David BartovÄak and Miroslav Vrankić
+ */
+
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+
+#define FF_BUFQUEUE_SIZE 129
+#include "bufferqueue.h"
+
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define SIZE FF_BUFQUEUE_SIZE
+
+typedef struct ATADenoiseContext {
+ const AVClass *class;
+
+ float fthra[4], fthrb[4];
+ int thra[4], thrb[4];
+
+ int nb_planes;
+ int planewidth[4];
+ int planeheight[4];
+
+ struct FFBufQueue q;
+ void *data[4][SIZE];
+ int linesize[4][SIZE];
+ int size, mid;
+ int available;
+
+ int (*filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
+} ATADenoiseContext;
+
+#define OFFSET(x) offsetof(ATADenoiseContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption atadenoise_options[] = {
+ { "0a", "set threshold A for 1st plane", OFFSET(fthra[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
+ { "0b", "set threshold B for 1st plane", OFFSET(fthrb[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
+ { "1a", "set threshold A for 2nd plane", OFFSET(fthra[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
+ { "1b", "set threshold B for 2nd plane", OFFSET(fthrb[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
+ { "2a", "set threshold A for 3rd plane", OFFSET(fthra[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
+ { "2b", "set threshold B for 3rd plane", OFFSET(fthrb[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
+ { "s", "set how many frames to use", OFFSET(size), AV_OPT_TYPE_INT, {.i64=33}, 5, SIZE, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(atadenoise);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pixel_fmts[] = {
+ AV_PIX_FMT_GRAY8,
+ 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_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)
+{
+ ATADenoiseContext *s = ctx->priv;
+
+ if (!(s->size & 1)) {
+ av_log(ctx, AV_LOG_ERROR, "size %d is invalid. Must be an odd value.\n", s->size);
+ return AVERROR(EINVAL);
+ }
+ s->mid = s->size / 2 + 1;
+
+ return 0;
+}
+
+typedef struct ThreadData {
+ AVFrame *in, *out;
+} ThreadData;
+
+static int filter_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ ATADenoiseContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ const int size = s->size;
+ const int mid = s->mid;
+ int p, x, y, i, j;
+
+ for (p = 0; p < s->nb_planes; p++) {
+ const int h = s->planeheight[p];
+ const int w = s->planewidth[p];
+ const int slice_start = (h * jobnr) / nb_jobs;
+ const int slice_end = (h * (jobnr+1)) / nb_jobs;
+ const uint8_t *src = in->data[p] + slice_start * in->linesize[p];
+ uint8_t *dst = out->data[p] + slice_start * out->linesize[p];
+ const int thra = s->thra[p];
+ const int thrb = s->thrb[p];
+ const uint8_t **data = (const uint8_t **)s->data[p];
+ const int *linesize = (const int *)s->linesize[p];
+ const uint8_t *srcf[SIZE];
+
+ for (i = 0; i < size; i++)
+ srcf[i] = data[i] + slice_start * linesize[i];
+
+ for (y = slice_start; y < slice_end; y++) {
+ for (x = 0; x < w; x++) {
+ const int srcx = src[x];
+ unsigned lsumdiff = 0, rsumdiff = 0;
+ unsigned ldiff, rdiff;
+ unsigned sum = srcx;
+ int l = 0, r = 0;
+ int srcjx, srcix;
+
+ for (j = mid - 1, i = mid + 1; j >= 0 && i < size; j--, i++) {
+ srcjx = srcf[j][x];
+
+ ldiff = FFABS(srcx - srcjx);
+ lsumdiff += ldiff;
+ if (ldiff > thra ||
+ lsumdiff > thrb)
+ break;
+ l++;
+ sum += srcjx;
+
+ srcix = srcf[i][x];
+
+ rdiff = FFABS(srcx - srcix);
+ rsumdiff += rdiff;
+ if (rdiff > thra ||
+ rsumdiff > thrb)
+ break;
+ r++;
+ sum += srcix;
+ }
+
+ dst[x] = sum / (r + l + 1);
+ }
+
+ dst += out->linesize[p];
+ src += in->linesize[p];
+
+ for (i = 0; i < size; i++)
+ srcf[i] += linesize[i];
+ }
+ }
+
+ return 0;
+}
+
+static int filter_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ ATADenoiseContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ const int size = s->size;
+ const int mid = s->mid;
+ int p, x, y, i, j;
+
+ for (p = 0; p < s->nb_planes; p++) {
+ const int h = s->planeheight[p];
+ const int w = s->planewidth[p];
+ const int slice_start = (h * jobnr) / nb_jobs;
+ const int slice_end = (h * (jobnr+1)) / nb_jobs;
+ const uint16_t *src = (uint16_t *)(in->data[p] + slice_start * in->linesize[p]);
+ uint16_t *dst = (uint16_t *)(out->data[p] + slice_start * out->linesize[p]);
+ const int thra = s->thra[p];
+ const int thrb = s->thrb[p];
+ const uint8_t **data = (const uint8_t **)s->data[p];
+ const int *linesize = (const int *)s->linesize[p];
+ const uint16_t *srcf[SIZE];
+
+ for (i = 0; i < s->size; i++)
+ srcf[i] = (const uint16_t *)(data[i] + slice_start * linesize[i]);
+
+ for (y = slice_start; y < slice_end; y++) {
+ for (x = 0; x < w; x++) {
+ const int srcx = src[x];
+ unsigned lsumdiff = 0, rsumdiff = 0;
+ unsigned ldiff, rdiff;
+ unsigned sum = srcx;
+ int l = 0, r = 0;
+ int srcjx, srcix;
+
+ for (j = mid - 1, i = mid + 1; j >= 0 && i < size; j--, i++) {
+ srcjx = srcf[j][x];
+
+ ldiff = FFABS(srcx - srcjx);
+ lsumdiff += ldiff;
+ if (ldiff > thra ||
+ lsumdiff > thrb)
+ break;
+ l++;
+ sum += srcjx;
+
+ srcix = srcf[i][x];
+
+ rdiff = FFABS(srcx - srcix);
+ rsumdiff += rdiff;
+ if (rdiff > thra ||
+ rsumdiff > thrb)
+ break;
+ r++;
+ sum += srcix;
+ }
+
+ dst[x] = sum / (r + l + 1);
+ }
+
+ dst += out->linesize[p] / 2;
+ src += in->linesize[p] / 2;
+
+ for (i = 0; i < size; i++)
+ srcf[i] += linesize[i] / 2;
+ }
+ }
+
+ return 0;
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ AVFilterContext *ctx = inlink->dst;
+ ATADenoiseContext *s = ctx->priv;
+ int depth;
+
+ s->nb_planes = desc->nb_components;
+
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ s->planewidth[0] = s->planewidth[3] = inlink->w;
+
+ depth = desc->comp[0].depth;
+ if (depth == 8)
+ s->filter_slice = filter_slice8;
+ else
+ s->filter_slice = filter_slice16;
+
+ s->thra[0] = s->fthra[0] * (1 << depth) - 1;
+ s->thra[1] = s->fthra[1] * (1 << depth) - 1;
+ s->thra[2] = s->fthra[2] * (1 << depth) - 1;
+ s->thrb[0] = s->fthrb[0] * (1 << depth) - 1;
+ s->thrb[1] = s->fthrb[1] * (1 << depth) - 1;
+ s->thrb[2] = s->fthrb[2] * (1 << depth) - 1;
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ATADenoiseContext *s = ctx->priv;
+ AVFrame *out, *in;
+ int i;
+
+ if (s->q.available != s->size) {
+ if (s->q.available < s->mid) {
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < s->mid; i++)
+ ff_bufqueue_add(ctx, &s->q, av_frame_clone(out));
+ av_frame_free(&out);
+ }
+ if (s->q.available < s->size) {
+ ff_bufqueue_add(ctx, &s->q, buf);
+ s->available++;
+ }
+ return 0;
+ }
+
+ in = ff_bufqueue_peek(&s->q, s->mid);
+
+ if (!ctx->is_disabled) {
+ ThreadData td;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&buf);
+ return AVERROR(ENOMEM);
+ }
+
+ for (i = 0; i < s->size; i++) {
+ AVFrame *frame = ff_bufqueue_peek(&s->q, i);
+
+ s->data[0][i] = frame->data[0];
+ s->data[1][i] = frame->data[1];
+ s->data[2][i] = frame->data[2];
+ s->linesize[0][i] = frame->linesize[0];
+ s->linesize[1][i] = frame->linesize[1];
+ s->linesize[2][i] = frame->linesize[2];
+ }
+
+ td.in = in; td.out = out;
+ ctx->internal->execute(ctx, s->filter_slice, &td, NULL,
+ FFMIN3(s->planeheight[1],
+ s->planeheight[2],
+ ctx->graph->nb_threads));
+ av_frame_copy_props(out, in);
+ } else {
+ out = av_frame_clone(in);
+ if (!out) {
+ av_frame_free(&buf);
+ return AVERROR(ENOMEM);
+ }
+ }
+
+ in = ff_bufqueue_get(&s->q);
+ av_frame_free(&in);
+ ff_bufqueue_add(ctx, &s->q, buf);
+
+ return ff_filter_frame(outlink, out);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ ATADenoiseContext *s = ctx->priv;
+ int ret = 0;
+
+ ret = ff_request_frame(ctx->inputs[0]);
+
+ if (ret == AVERROR_EOF && !ctx->is_disabled && s->available) {
+ AVFrame *buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!buf)
+ return AVERROR(ENOMEM);
+
+ ret = filter_frame(ctx->inputs[0], buf);
+ s->available--;
+ }
+
+ return ret;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ATADenoiseContext *s = ctx->priv;
+
+ ff_bufqueue_discard_all(&s->q);
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_atadenoise = {
+ .name = "atadenoise",
+ .description = NULL_IF_CONFIG_SMALL("Apply an Adaptive Temporal Averaging Denoiser."),
+ .priv_size = sizeof(ATADenoiseContext),
+ .priv_class = &atadenoise_class,
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .inputs = inputs,
+ .outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_blend.c b/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
index 9c93baf3e91..be92bd15be0 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
@@ -153,8 +153,8 @@ typedef struct {
static const AVOption blend_options[] = {
COMMON_OPTIONS,
- { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "repeatlast", "repeat last bottom frame", OFFSET(dinput.repeatlast), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "repeatlast", "repeat last bottom frame", OFFSET(dinput.repeatlast), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
};
@@ -169,24 +169,50 @@ static void blend_normal(const uint8_t *top, int top_linesize,
av_image_copy_plane(dst, dst_linesize, top, top_linesize, width, end - start);
}
-#define DEFINE_BLEND(name, expr) \
-static void blend_## name(const uint8_t *top, int top_linesize, \
- const uint8_t *bottom, int bottom_linesize, \
- uint8_t *dst, int dst_linesize, \
- int width, int start, int end, \
- FilterParams *param, double *values) \
-{ \
- double opacity = param->opacity; \
- int i, j; \
- \
- for (i = start; i < end; i++) { \
- for (j = 0; j < width; j++) { \
- dst[j] = top[j] + ((expr) - top[j]) * opacity; \
- } \
- dst += dst_linesize; \
- top += top_linesize; \
- bottom += bottom_linesize; \
- } \
+#define DEFINE_BLEND8(name, expr) \
+static void blend_## name##_8bit(const uint8_t *top, int top_linesize, \
+ const uint8_t *bottom, int bottom_linesize, \
+ uint8_t *dst, int dst_linesize, \
+ int width, int start, int end, \
+ FilterParams *param, double *values) \
+{ \
+ double opacity = param->opacity; \
+ int i, j; \
+ \
+ for (i = start; i < end; i++) { \
+ for (j = 0; j < width; j++) { \
+ dst[j] = top[j] + ((expr) - top[j]) * opacity; \
+ } \
+ dst += dst_linesize; \
+ top += top_linesize; \
+ bottom += bottom_linesize; \
+ } \
+}
+
+#define DEFINE_BLEND16(name, expr) \
+static void blend_## name##_16bit(const uint8_t *_top, int top_linesize, \
+ const uint8_t *_bottom, int bottom_linesize, \
+ uint8_t *_dst, int dst_linesize, \
+ int width, int start, int end, \
+ FilterParams *param, double *values) \
+{ \
+ const uint16_t *top = (uint16_t*)_top; \
+ const uint16_t *bottom = (uint16_t*)_bottom; \
+ uint16_t *dst = (uint16_t*)_dst; \
+ double opacity = param->opacity; \
+ int i, j; \
+ dst_linesize /= 2; \
+ top_linesize /= 2; \
+ bottom_linesize /= 2; \
+ \
+ for (i = start; i < end; i++) { \
+ for (j = 0; j < width; j++) { \
+ dst[j] = top[j] + ((expr) - top[j]) * opacity; \
+ } \
+ dst += dst_linesize; \
+ top += top_linesize; \
+ bottom += bottom_linesize; \
+ } \
}
#define A top[j]
@@ -197,57 +223,105 @@ static void blend_## name(const uint8_t *top, int top_linesize, \
#define BURN(a, b) (((a) == 0) ? (a) : FFMAX(0, 255 - ((255 - (b)) << 8) / (a)))
#define DODGE(a, b) (((a) == 255) ? (a) : FFMIN(255, (((b) << 8) / (255 - (a)))))
-DEFINE_BLEND(addition, FFMIN(255, A + B))
-DEFINE_BLEND(average, (A + B) / 2)
-DEFINE_BLEND(subtract, FFMAX(0, A - B))
-DEFINE_BLEND(multiply, MULTIPLY(1, A, B))
-DEFINE_BLEND(negation, 255 - FFABS(255 - A - B))
-DEFINE_BLEND(difference, FFABS(A - B))
-DEFINE_BLEND(difference128, av_clip_uint8(128 + A - B))
-DEFINE_BLEND(screen, SCREEN(1, A, B))
-DEFINE_BLEND(overlay, (A < 128) ? MULTIPLY(2, A, B) : SCREEN(2, A, B))
-DEFINE_BLEND(hardlight, (B < 128) ? MULTIPLY(2, B, A) : SCREEN(2, B, A))
-DEFINE_BLEND(hardmix, (A < (255 - B)) ? 0: 255)
-DEFINE_BLEND(darken, FFMIN(A, B))
-DEFINE_BLEND(lighten, FFMAX(A, B))
-DEFINE_BLEND(divide, av_clip_uint8(((float)A / ((float)B) * 255)))
-DEFINE_BLEND(dodge, DODGE(A, B))
-DEFINE_BLEND(burn, BURN(A, B))
-DEFINE_BLEND(softlight, (A > 127) ? B + (255 - B) * (A - 127.5) / 127.5 * (0.5 - FFABS(B - 127.5) / 255): B - B * ((127.5 - A) / 127.5) * (0.5 - FFABS(B - 127.5)/255))
-DEFINE_BLEND(exclusion, A + B - 2 * A * B / 255)
-DEFINE_BLEND(pinlight, (B < 128) ? FFMIN(A, 2 * B) : FFMAX(A, 2 * (B - 128)))
-DEFINE_BLEND(phoenix, FFMIN(A, B) - FFMAX(A, B) + 255)
-DEFINE_BLEND(reflect, (B == 255) ? B : FFMIN(255, (A * A / (255 - B))))
-DEFINE_BLEND(glow, (A == 255) ? A : FFMIN(255, (B * B / (255 - A))))
-DEFINE_BLEND(and, A & B)
-DEFINE_BLEND(or, A | B)
-DEFINE_BLEND(xor, A ^ B)
-DEFINE_BLEND(vividlight, (A < 128) ? BURN(2 * A, B) : DODGE(2 * (A - 128), B))
-DEFINE_BLEND(linearlight,av_clip_uint8((B < 128) ? B + 2 * A - 255 : B + 2 * (A - 128)))
-
-static void blend_expr(const uint8_t *top, int top_linesize,
- const uint8_t *bottom, int bottom_linesize,
- uint8_t *dst, int dst_linesize,
- int width, int start, int end,
- FilterParams *param, double *values)
-{
- AVExpr *e = param->e;
- int y, x;
-
- for (y = start; y < end; y++) {
- values[VAR_Y] = y;
- for (x = 0; x < width; x++) {
- values[VAR_X] = x;
- values[VAR_TOP] = values[VAR_A] = top[x];
- values[VAR_BOTTOM] = values[VAR_B] = bottom[x];
- dst[x] = av_expr_eval(e, values, NULL);
- }
- dst += dst_linesize;
- top += top_linesize;
- bottom += bottom_linesize;
- }
+DEFINE_BLEND8(addition, FFMIN(255, A + B))
+DEFINE_BLEND8(average, (A + B) / 2)
+DEFINE_BLEND8(subtract, FFMAX(0, A - B))
+DEFINE_BLEND8(multiply, MULTIPLY(1, A, B))
+DEFINE_BLEND8(negation, 255 - FFABS(255 - A - B))
+DEFINE_BLEND8(difference, FFABS(A - B))
+DEFINE_BLEND8(difference128, av_clip_uint8(128 + A - B))
+DEFINE_BLEND8(screen, SCREEN(1, A, B))
+DEFINE_BLEND8(overlay, (A < 128) ? MULTIPLY(2, A, B) : SCREEN(2, A, B))
+DEFINE_BLEND8(hardlight, (B < 128) ? MULTIPLY(2, B, A) : SCREEN(2, B, A))
+DEFINE_BLEND8(hardmix, (A < (255 - B)) ? 0: 255)
+DEFINE_BLEND8(darken, FFMIN(A, B))
+DEFINE_BLEND8(lighten, FFMAX(A, B))
+DEFINE_BLEND8(divide, av_clip_uint8(((float)A / ((float)B) * 255)))
+DEFINE_BLEND8(dodge, DODGE(A, B))
+DEFINE_BLEND8(burn, BURN(A, B))
+DEFINE_BLEND8(softlight, (A > 127) ? B + (255 - B) * (A - 127.5) / 127.5 * (0.5 - FFABS(B - 127.5) / 255): B - B * ((127.5 - A) / 127.5) * (0.5 - FFABS(B - 127.5)/255))
+DEFINE_BLEND8(exclusion, A + B - 2 * A * B / 255)
+DEFINE_BLEND8(pinlight, (B < 128) ? FFMIN(A, 2 * B) : FFMAX(A, 2 * (B - 128)))
+DEFINE_BLEND8(phoenix, FFMIN(A, B) - FFMAX(A, B) + 255)
+DEFINE_BLEND8(reflect, (B == 255) ? B : FFMIN(255, (A * A / (255 - B))))
+DEFINE_BLEND8(glow, (A == 255) ? A : FFMIN(255, (B * B / (255 - A))))
+DEFINE_BLEND8(and, A & B)
+DEFINE_BLEND8(or, A | B)
+DEFINE_BLEND8(xor, A ^ B)
+DEFINE_BLEND8(vividlight, (A < 128) ? BURN(2 * A, B) : DODGE(2 * (A - 128), B))
+DEFINE_BLEND8(linearlight,av_clip_uint8((B < 128) ? B + 2 * A - 255 : B + 2 * (A - 128)))
+
+#undef MULTIPLY
+#undef SCREEN
+#undef BURN
+#undef DODGE
+
+#define MULTIPLY(x, a, b) ((x) * (((a) * (b)) / 65535))
+#define SCREEN(x, a, b) (65535 - (x) * ((65535 - (a)) * (65535 - (b)) / 65535))
+#define BURN(a, b) (((a) == 0) ? (a) : FFMAX(0, 65535 - ((65535 - (b)) << 16) / (a)))
+#define DODGE(a, b) (((a) == 65535) ? (a) : FFMIN(65535, (((b) << 16) / (65535 - (a)))))
+
+DEFINE_BLEND16(addition, FFMIN(65535, A + B))
+DEFINE_BLEND16(average, (A + B) / 2)
+DEFINE_BLEND16(subtract, FFMAX(0, A - B))
+DEFINE_BLEND16(multiply, MULTIPLY(1, A, B))
+DEFINE_BLEND16(negation, 65535 - FFABS(65535 - A - B))
+DEFINE_BLEND16(difference, FFABS(A - B))
+DEFINE_BLEND16(difference128, av_clip_uint16(32768 + A - B))
+DEFINE_BLEND16(screen, SCREEN(1, A, B))
+DEFINE_BLEND16(overlay, (A < 32768) ? MULTIPLY(2, A, B) : SCREEN(2, A, B))
+DEFINE_BLEND16(hardlight, (B < 32768) ? MULTIPLY(2, B, A) : SCREEN(2, B, A))
+DEFINE_BLEND16(hardmix, (A < (65535 - B)) ? 0: 65535)
+DEFINE_BLEND16(darken, FFMIN(A, B))
+DEFINE_BLEND16(lighten, FFMAX(A, B))
+DEFINE_BLEND16(divide, av_clip_uint16(((float)A / ((float)B) * 65535)))
+DEFINE_BLEND16(dodge, DODGE(A, B))
+DEFINE_BLEND16(burn, BURN(A, B))
+DEFINE_BLEND16(softlight, (A > 32767) ? B + (65535 - B) * (A - 32767.5) / 32767.5 * (0.5 - FFABS(B - 32767.5) / 65535): B - B * ((32767.5 - A) / 32767.5) * (0.5 - FFABS(B - 32767.5)/65535))
+DEFINE_BLEND16(exclusion, A + B - 2 * A * B / 65535)
+DEFINE_BLEND16(pinlight, (B < 32768) ? FFMIN(A, 2 * B) : FFMAX(A, 2 * (B - 32768)))
+DEFINE_BLEND16(phoenix, FFMIN(A, B) - FFMAX(A, B) + 65535)
+DEFINE_BLEND16(reflect, (B == 65535) ? B : FFMIN(65535, (A * A / (65535 - B))))
+DEFINE_BLEND16(glow, (A == 65535) ? A : FFMIN(65535, (B * B / (65535 - A))))
+DEFINE_BLEND16(and, A & B)
+DEFINE_BLEND16(or, A | B)
+DEFINE_BLEND16(xor, A ^ B)
+DEFINE_BLEND16(vividlight, (A < 32768) ? BURN(2 * A, B) : DODGE(2 * (A - 32768), B))
+DEFINE_BLEND16(linearlight,av_clip_uint16((B < 32768) ? B + 2 * A - 65535 : B + 2 * (A - 32768)))
+
+#define DEFINE_BLEND_EXPR(type, name, div) \
+static void blend_expr_## name(const uint8_t *_top, int top_linesize, \
+ const uint8_t *_bottom, int bottom_linesize, \
+ uint8_t *_dst, int dst_linesize, \
+ int width, int start, int end, \
+ FilterParams *param, double *values) \
+{ \
+ const type *top = (type*)_top; \
+ const type *bottom = (type*)_bottom; \
+ type *dst = (type*)_dst; \
+ AVExpr *e = param->e; \
+ int y, x; \
+ dst_linesize /= div; \
+ top_linesize /= div; \
+ bottom_linesize /= div; \
+ \
+ for (y = start; y < end; y++) { \
+ values[VAR_Y] = y; \
+ for (x = 0; x < width; x++) { \
+ values[VAR_X] = x; \
+ values[VAR_TOP] = values[VAR_A] = top[x]; \
+ values[VAR_BOTTOM] = values[VAR_B] = bottom[x]; \
+ dst[x] = av_expr_eval(e, values, NULL); \
+ } \
+ dst += dst_linesize; \
+ top += top_linesize; \
+ bottom += bottom_linesize; \
+ } \
}
+DEFINE_BLEND_EXPR(uint8_t, 8bit, 1)
+DEFINE_BLEND_EXPR(uint16_t, 16bit, 2)
+
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
ThreadData *td = arg;
@@ -278,7 +352,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
const AVFrame *bottom_buf)
{
- BlendContext *b = ctx->priv;
+ BlendContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *dst_buf;
@@ -289,12 +363,12 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
return top_buf;
av_frame_copy_props(dst_buf, top_buf);
- for (plane = 0; plane < b->nb_planes; plane++) {
- int hsub = plane == 1 || plane == 2 ? b->hsub : 0;
- int vsub = plane == 1 || plane == 2 ? b->vsub : 0;
+ for (plane = 0; plane < s->nb_planes; plane++) {
+ int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
+ int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
int outw = FF_CEIL_RSHIFT(dst_buf->width, hsub);
int outh = FF_CEIL_RSHIFT(dst_buf->height, vsub);
- FilterParams *param = &b->params[plane];
+ FilterParams *param = &s->params[plane];
ThreadData td = { .top = top_buf, .bottom = bottom_buf, .dst = dst_buf,
.w = outw, .h = outh, .param = param, .plane = plane,
.inlink = inlink };
@@ -302,7 +376,7 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outh, ctx->graph->nb_threads));
}
- if (!b->tblend)
+ if (!s->tblend)
av_frame_free(&top_buf);
return dst_buf;
@@ -310,65 +384,11 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
static av_cold int init(AVFilterContext *ctx)
{
- BlendContext *b = ctx->priv;
- int ret, plane;
-
- b->tblend = !strcmp(ctx->filter->name, "tblend");
+ BlendContext *s = ctx->priv;
- for (plane = 0; plane < FF_ARRAY_ELEMS(b->params); plane++) {
- FilterParams *param = &b->params[plane];
-
- if (b->all_mode >= 0)
- param->mode = b->all_mode;
- if (b->all_opacity < 1)
- param->opacity = b->all_opacity;
-
- switch (param->mode) {
- case BLEND_ADDITION: param->blend = blend_addition; break;
- case BLEND_AND: param->blend = blend_and; break;
- case BLEND_AVERAGE: param->blend = blend_average; break;
- case BLEND_BURN: param->blend = blend_burn; break;
- case BLEND_DARKEN: param->blend = blend_darken; break;
- case BLEND_DIFFERENCE: param->blend = blend_difference; break;
- case BLEND_DIFFERENCE128: param->blend = blend_difference128; break;
- case BLEND_DIVIDE: param->blend = blend_divide; break;
- case BLEND_DODGE: param->blend = blend_dodge; break;
- case BLEND_EXCLUSION: param->blend = blend_exclusion; break;
- case BLEND_GLOW: param->blend = blend_glow; break;
- case BLEND_HARDLIGHT: param->blend = blend_hardlight; break;
- case BLEND_HARDMIX: param->blend = blend_hardmix; break;
- case BLEND_LIGHTEN: param->blend = blend_lighten; break;
- case BLEND_LINEARLIGHT:param->blend = blend_linearlight;break;
- case BLEND_MULTIPLY: param->blend = blend_multiply; break;
- case BLEND_NEGATION: param->blend = blend_negation; break;
- case BLEND_NORMAL: param->blend = blend_normal; break;
- case BLEND_OR: param->blend = blend_or; break;
- case BLEND_OVERLAY: param->blend = blend_overlay; break;
- case BLEND_PHOENIX: param->blend = blend_phoenix; break;
- case BLEND_PINLIGHT: param->blend = blend_pinlight; break;
- case BLEND_REFLECT: param->blend = blend_reflect; break;
- case BLEND_SCREEN: param->blend = blend_screen; break;
- case BLEND_SOFTLIGHT: param->blend = blend_softlight; break;
- case BLEND_SUBTRACT: param->blend = blend_subtract; break;
- case BLEND_VIVIDLIGHT: param->blend = blend_vividlight; break;
- case BLEND_XOR: param->blend = blend_xor; break;
- }
-
- if (b->all_expr && !param->expr_str) {
- param->expr_str = av_strdup(b->all_expr);
- if (!param->expr_str)
- return AVERROR(ENOMEM);
- }
- if (param->expr_str) {
- ret = av_expr_parse(&param->e, param->expr_str, var_names,
- NULL, NULL, NULL, NULL, 0, ctx);
- if (ret < 0)
- return ret;
- param->blend = blend_expr;
- }
- }
+ s->tblend = !strcmp(ctx->filter->name, "tblend");
- b->dinput.process = blend_frame;
+ s->dinput.process = blend_frame;
return 0;
}
@@ -378,7 +398,11 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
+ AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
+ AV_PIX_FMT_GBRP16, AV_PIX_FMT_GRAY16,
+ AV_PIX_FMT_NONE
};
AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
@@ -389,45 +413,46 @@ static int query_formats(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
{
- BlendContext *b = ctx->priv;
+ BlendContext *s = ctx->priv;
int i;
- ff_dualinput_uninit(&b->dinput);
- av_frame_free(&b->prev_frame);
+ ff_dualinput_uninit(&s->dinput);
+ av_frame_free(&s->prev_frame);
- for (i = 0; i < FF_ARRAY_ELEMS(b->params); i++)
- av_expr_free(b->params[i].e);
+ for (i = 0; i < FF_ARRAY_ELEMS(s->params); i++)
+ av_expr_free(s->params[i].e);
}
-#if CONFIG_BLEND_FILTER
-
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
AVFilterLink *toplink = ctx->inputs[TOP];
- AVFilterLink *bottomlink = ctx->inputs[BOTTOM];
- BlendContext *b = ctx->priv;
+ BlendContext *s = ctx->priv;
const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(toplink->format);
- int ret;
+ int ret, plane, is_16bit;
- if (toplink->format != bottomlink->format) {
- av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");
- return AVERROR(EINVAL);
- }
- if (toplink->w != bottomlink->w ||
- toplink->h != bottomlink->h ||
- toplink->sample_aspect_ratio.num != bottomlink->sample_aspect_ratio.num ||
- toplink->sample_aspect_ratio.den != bottomlink->sample_aspect_ratio.den) {
- av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
- "(size %dx%d, SAR %d:%d) do not match the corresponding "
- "second input link %s parameters (%dx%d, SAR %d:%d)\n",
- ctx->input_pads[TOP].name, toplink->w, toplink->h,
- toplink->sample_aspect_ratio.num,
- toplink->sample_aspect_ratio.den,
- ctx->input_pads[BOTTOM].name, bottomlink->w, bottomlink->h,
- bottomlink->sample_aspect_ratio.num,
- bottomlink->sample_aspect_ratio.den);
- return AVERROR(EINVAL);
+ if (!s->tblend) {
+ AVFilterLink *bottomlink = ctx->inputs[BOTTOM];
+
+ if (toplink->format != bottomlink->format) {
+ av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");
+ return AVERROR(EINVAL);
+ }
+ if (toplink->w != bottomlink->w ||
+ toplink->h != bottomlink->h ||
+ toplink->sample_aspect_ratio.num != bottomlink->sample_aspect_ratio.num ||
+ toplink->sample_aspect_ratio.den != bottomlink->sample_aspect_ratio.den) {
+ av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
+ "(size %dx%d, SAR %d:%d) do not match the corresponding "
+ "second input link %s parameters (%dx%d, SAR %d:%d)\n",
+ ctx->input_pads[TOP].name, toplink->w, toplink->h,
+ toplink->sample_aspect_ratio.num,
+ toplink->sample_aspect_ratio.den,
+ ctx->input_pads[BOTTOM].name, bottomlink->w, bottomlink->h,
+ bottomlink->sample_aspect_ratio.num,
+ bottomlink->sample_aspect_ratio.den);
+ return AVERROR(EINVAL);
+ }
}
outlink->w = toplink->w;
@@ -436,26 +461,85 @@ static int config_output(AVFilterLink *outlink)
outlink->sample_aspect_ratio = toplink->sample_aspect_ratio;
outlink->frame_rate = toplink->frame_rate;
- b->hsub = pix_desc->log2_chroma_w;
- b->vsub = pix_desc->log2_chroma_h;
- b->nb_planes = av_pix_fmt_count_planes(toplink->format);
+ s->hsub = pix_desc->log2_chroma_w;
+ s->vsub = pix_desc->log2_chroma_h;
- if ((ret = ff_dualinput_init(ctx, &b->dinput)) < 0)
- return ret;
+ is_16bit = pix_desc->comp[0].depth == 16;
+ s->nb_planes = av_pix_fmt_count_planes(toplink->format);
+
+ if (s->tblend)
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ else if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
+ return ret;
+
+ for (plane = 0; plane < FF_ARRAY_ELEMS(s->params); plane++) {
+ FilterParams *param = &s->params[plane];
+
+ if (s->all_mode >= 0)
+ param->mode = s->all_mode;
+ if (s->all_opacity < 1)
+ param->opacity = s->all_opacity;
+
+ switch (param->mode) {
+ case BLEND_ADDITION: param->blend = is_16bit ? blend_addition_16bit : blend_addition_8bit; break;
+ case BLEND_AND: param->blend = is_16bit ? blend_and_16bit : blend_and_8bit; break;
+ case BLEND_AVERAGE: param->blend = is_16bit ? blend_average_16bit : blend_average_8bit; break;
+ case BLEND_BURN: param->blend = is_16bit ? blend_burn_16bit : blend_burn_8bit; break;
+ case BLEND_DARKEN: param->blend = is_16bit ? blend_darken_16bit : blend_darken_8bit; break;
+ case BLEND_DIFFERENCE: param->blend = is_16bit ? blend_difference_16bit : blend_difference_8bit; break;
+ case BLEND_DIFFERENCE128: param->blend = is_16bit ? blend_difference128_16bit: blend_difference128_8bit; break;
+ case BLEND_DIVIDE: param->blend = is_16bit ? blend_divide_16bit : blend_divide_8bit; break;
+ case BLEND_DODGE: param->blend = is_16bit ? blend_dodge_16bit : blend_dodge_8bit; break;
+ case BLEND_EXCLUSION: param->blend = is_16bit ? blend_exclusion_16bit : blend_exclusion_8bit; break;
+ case BLEND_GLOW: param->blend = is_16bit ? blend_glow_16bit : blend_glow_8bit; break;
+ case BLEND_HARDLIGHT: param->blend = is_16bit ? blend_hardlight_16bit : blend_hardlight_8bit; break;
+ case BLEND_HARDMIX: param->blend = is_16bit ? blend_hardmix_16bit : blend_hardmix_8bit; break;
+ case BLEND_LIGHTEN: param->blend = is_16bit ? blend_lighten_16bit : blend_lighten_8bit; break;
+ case BLEND_LINEARLIGHT:param->blend = is_16bit ? blend_linearlight_16bit: blend_linearlight_8bit;break;
+ case BLEND_MULTIPLY: param->blend = is_16bit ? blend_multiply_16bit : blend_multiply_8bit; break;
+ case BLEND_NEGATION: param->blend = is_16bit ? blend_negation_16bit : blend_negation_8bit; break;
+ case BLEND_NORMAL: param->blend = blend_normal; break;
+ case BLEND_OR: param->blend = is_16bit ? blend_or_16bit : blend_or_8bit; break;
+ case BLEND_OVERLAY: param->blend = is_16bit ? blend_overlay_16bit : blend_overlay_8bit; break;
+ case BLEND_PHOENIX: param->blend = is_16bit ? blend_phoenix_16bit : blend_phoenix_8bit; break;
+ case BLEND_PINLIGHT: param->blend = is_16bit ? blend_pinlight_16bit : blend_pinlight_8bit; break;
+ case BLEND_REFLECT: param->blend = is_16bit ? blend_reflect_16bit : blend_reflect_8bit; break;
+ case BLEND_SCREEN: param->blend = is_16bit ? blend_screen_16bit : blend_screen_8bit; break;
+ case BLEND_SOFTLIGHT: param->blend = is_16bit ? blend_softlight_16bit : blend_softlight_8bit; break;
+ case BLEND_SUBTRACT: param->blend = is_16bit ? blend_subtract_16bit : blend_subtract_8bit; break;
+ case BLEND_VIVIDLIGHT: param->blend = is_16bit ? blend_vividlight_16bit : blend_vividlight_8bit; break;
+ case BLEND_XOR: param->blend = is_16bit ? blend_xor_16bit : blend_xor_8bit; break;
+ }
+
+ if (s->all_expr && !param->expr_str) {
+ param->expr_str = av_strdup(s->all_expr);
+ if (!param->expr_str)
+ return AVERROR(ENOMEM);
+ }
+ if (param->expr_str) {
+ ret = av_expr_parse(&param->e, param->expr_str, var_names,
+ NULL, NULL, NULL, NULL, 0, ctx);
+ if (ret < 0)
+ return ret;
+ param->blend = is_16bit? blend_expr_16bit : blend_expr_8bit;
+ }
+ }
return 0;
}
+#if CONFIG_BLEND_FILTER
+
static int request_frame(AVFilterLink *outlink)
{
- BlendContext *b = outlink->src->priv;
- return ff_dualinput_request_frame(&b->dinput, outlink);
+ BlendContext *s = outlink->src->priv;
+ return ff_dualinput_request_frame(&s->dinput, outlink);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
- BlendContext *b = inlink->dst->priv;
- return ff_dualinput_filter_frame(&b->dinput, inlink, buf);
+ BlendContext *s = inlink->dst->priv;
+ return ff_dualinput_filter_frame(&s->dinput, inlink, buf);
}
static const AVFilterPad blend_inputs[] = {
@@ -498,33 +582,18 @@ AVFilter ff_vf_blend = {
#if CONFIG_TBLEND_FILTER
-static int tblend_config_output(AVFilterLink *outlink)
-{
- AVFilterContext *ctx = outlink->src;
- AVFilterLink *inlink = ctx->inputs[0];
- BlendContext *b = ctx->priv;
- const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-
- b->hsub = pix_desc->log2_chroma_w;
- b->vsub = pix_desc->log2_chroma_h;
- b->nb_planes = av_pix_fmt_count_planes(inlink->format);
- outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
-
- return 0;
-}
-
static int tblend_filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
- BlendContext *b = inlink->dst->priv;
+ BlendContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
- if (b->prev_frame) {
- AVFrame *out = blend_frame(inlink->dst, frame, b->prev_frame);
- av_frame_free(&b->prev_frame);
- b->prev_frame = frame;
+ if (s->prev_frame) {
+ AVFrame *out = blend_frame(inlink->dst, frame, s->prev_frame);
+ av_frame_free(&s->prev_frame);
+ s->prev_frame = frame;
return ff_filter_frame(outlink, out);
}
- b->prev_frame = frame;
+ s->prev_frame = frame;
return 0;
}
@@ -548,7 +617,7 @@ static const AVFilterPad tblend_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .config_props = tblend_config_output,
+ .config_props = config_output,
},
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c b/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
index 17db949bc60..0e9bafd700c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_boxblur.c
@@ -124,7 +124,7 @@ static int query_formats(AVFilterContext *ctx)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) &&
(desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) &&
- (!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth_minus1 == 7))
+ (!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth == 8))
ff_add_format(&formats, fmt);
}
@@ -351,7 +351,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int w[4] = { inlink->w, cw, cw, inlink->w };
int h[4] = { in->height, ch, ch, in->height };
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- const int depth = desc->comp[0].depth_minus1 + 1;
+ const int depth = desc->comp[0].depth;
const int pixsize = (depth+7)/8;
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c b/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
index 19e39ec6aa5..993da8b10fe 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
@@ -103,7 +103,7 @@ static av_cold int config_output(AVFilterLink *outlink)
outlink->time_base = avctx->inputs[0]->time_base;
for (i = 0; i < 4; ++i)
- ctx->co[i] = desc->comp[i].offset_plus1 - 1;
+ ctx->co[i] = desc->comp[i].offset;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c b/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
index 7157c9138a5..cb3314b8acb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
@@ -97,7 +97,7 @@ static int config_input(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
s->nb_comp = desc->nb_components;
- s->bpp = (desc->comp[0].depth_minus1 + 1) >> 3;
+ s->bpp = desc->comp[0].depth >> 3;
s->step = (av_get_padded_bits_per_pixel(desc) >> 3) / s->bpp;
s->linesize = inlink->w * s->step;
ff_fill_rgba_map(s->rgba_map, inlink->format);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c b/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
index 4971cac3086..4a57fe0b3e1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colormatrix.c
@@ -94,6 +94,7 @@ static const AVOption colormatrix_options[] = {
{ "fcc", "set FCC colorspace ", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_FCC}, .flags=FLAGS, .unit="color_mode" },
{ "bt601", "set BT.601 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "bt470", "set BT.470 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
+ { "bt470bg", "set BT.470 colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "smpte170m", "set SMTPE-170M colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_BT601}, .flags=FLAGS, .unit="color_mode" },
{ "smpte240m", "set SMPTE-240M colorspace", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_MODE_SMPTE240M}, .flags=FLAGS, .unit="color_mode" },
{ NULL }
@@ -230,6 +231,53 @@ static int process_slice_uyvy422(AVFilterContext *ctx, void *arg, int jobnr, int
return 0;
}
+static int process_slice_yuv444p(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ const ThreadData *td = arg;
+ const AVFrame *src = td->src;
+ AVFrame *dst = td->dst;
+ const int height = src->height;
+ const int width = src->width;
+ const int slice_start = (height * jobnr ) / nb_jobs;
+ const int slice_end = (height * (jobnr+1)) / nb_jobs;
+ const int src_pitchY = src->linesize[0];
+ const int src_pitchUV = src->linesize[1];
+ const unsigned char *srcpU = src->data[1] + slice_start * src_pitchUV;
+ const unsigned char *srcpV = src->data[2] + slice_start * src_pitchUV;
+ const unsigned char *srcpY = src->data[0] + slice_start * src_pitchY;
+ const int dst_pitchY = dst->linesize[0];
+ const int dst_pitchUV = dst->linesize[1];
+ unsigned char *dstpU = dst->data[1] + slice_start * dst_pitchUV;
+ unsigned char *dstpV = dst->data[2] + slice_start * dst_pitchUV;
+ unsigned char *dstpY = dst->data[0] + slice_start * dst_pitchY;
+ const int c2 = td->c2;
+ const int c3 = td->c3;
+ const int c4 = td->c4;
+ const int c5 = td->c5;
+ const int c6 = td->c6;
+ const int c7 = td->c7;
+ int x, y;
+
+ for (y = slice_start; y < slice_end; y++) {
+ for (x = 0; x < width; x++) {
+ const int u = srcpU[x] - 128;
+ const int v = srcpV[x] - 128;
+ const int uvval = c2 * u + c3 * v + 1081344;
+ dstpY[x] = CB((65536 * (srcpY[x] - 16) + uvval) >> 16);
+ dstpU[x] = CB((c4 * u + c5 * v + 8421376) >> 16);
+ dstpV[x] = CB((c6 * u + c7 * v + 8421376) >> 16);
+ }
+ srcpY += src_pitchY;
+ dstpY += dst_pitchY;
+ srcpU += src_pitchUV;
+ srcpV += src_pitchUV;
+ dstpU += dst_pitchUV;
+ dstpV += dst_pitchUV;
+ }
+
+ return 0;
+}
+
static int process_slice_yuv422p(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
const ThreadData *td = arg;
@@ -350,6 +398,7 @@ static int config_input(AVFilterLink *inlink)
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_UYVY422,
@@ -411,7 +460,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
td.c6 = color->yuv_convert[color->mode][2][1];
td.c7 = color->yuv_convert[color->mode][2][2];
- if (in->format == AV_PIX_FMT_YUV422P)
+ if (in->format == AV_PIX_FMT_YUV444P)
+ ctx->internal->execute(ctx, process_slice_yuv444p, &td, NULL,
+ FFMIN(in->height, ctx->graph->nb_threads));
+ else if (in->format == AV_PIX_FMT_YUV422P)
ctx->internal->execute(ctx, process_slice_yuv422p, &td, NULL,
FFMIN(in->height, ctx->graph->nb_threads));
else if (in->format == AV_PIX_FMT_YUV420P)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c b/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
index c2020bb3929..5086a24faa2 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
@@ -53,13 +53,7 @@ static const AVOption cover_rect_options[] = {
{ NULL }
};
-static const AVClass cover_rect_class = {
- .class_name = "cover_rect",
- .item_name = av_default_item_name,
- .option = cover_rect_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(cover_rect);
static int query_formats(AVFilterContext *ctx)
{
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
index f58a7ae80fa..b695a6ffe11 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
@@ -296,6 +296,42 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
return ff_filter_frame(link->dst->outputs[0], frame);
}
+static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
+ char *res, int res_len, int flags)
+{
+ CropContext *s = ctx->priv;
+ int ret;
+
+ if ( !strcmp(cmd, "out_w") || !strcmp(cmd, "w")
+ || !strcmp(cmd, "out_h") || !strcmp(cmd, "h")
+ || !strcmp(cmd, "x") || !strcmp(cmd, "y")) {
+
+ int old_x = s->x;
+ int old_y = s->y;
+ int old_w = s->w;
+ int old_h = s->h;
+
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFilterLink *inlink = ctx->inputs[0];
+
+ av_opt_set(s, cmd, args, 0);
+
+ if ((ret = config_input(inlink)) < 0) {
+ s->x = old_x;
+ s->y = old_y;
+ s->w = old_w;
+ s->h = old_h;
+ return ret;
+ }
+
+ ret = config_output(outlink);
+
+ } else
+ ret = AVERROR(ENOSYS);
+
+ return ret;
+}
+
#define OFFSET(x) offsetof(CropContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
@@ -306,7 +342,7 @@ static const AVOption crop_options[] = {
{ "h", "set the height crop area expression", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "x", "set the x crop area expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "(in_w-out_w)/2"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "y", "set the y crop area expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "(in_h-out_h)/2"}, CHAR_MIN, CHAR_MAX, FLAGS },
- { "keep_aspect", "keep aspect ratio", OFFSET(keep_aspect), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+ { "keep_aspect", "keep aspect ratio", OFFSET(keep_aspect), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};
@@ -332,12 +368,13 @@ static const AVFilterPad avfilter_vf_crop_outputs[] = {
};
AVFilter ff_vf_crop = {
- .name = "crop",
- .description = NULL_IF_CONFIG_SMALL("Crop the input video."),
- .priv_size = sizeof(CropContext),
- .priv_class = &crop_class,
- .query_formats = query_formats,
- .uninit = uninit,
- .inputs = avfilter_vf_crop_inputs,
- .outputs = avfilter_vf_crop_outputs,
+ .name = "crop",
+ .description = NULL_IF_CONFIG_SMALL("Crop the input video."),
+ .priv_size = sizeof(CropContext),
+ .priv_class = &crop_class,
+ .query_formats = query_formats,
+ .uninit = uninit,
+ .inputs = avfilter_vf_crop_inputs,
+ .outputs = avfilter_vf_crop_outputs,
+ .process_command = process_command,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c b/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
index 7fa965160fb..d45637777f3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_cropdetect.c
@@ -144,7 +144,7 @@ static int config_input(AVFilterLink *inlink)
av_image_fill_max_pixsteps(s->max_pixsteps, NULL, desc);
if (s->limit < 1.0)
- s->limit *= (1 << (desc->comp[0].depth_minus1 + 1)) - 1;
+ s->limit *= (1 << desc->comp[0].depth) - 1;
s->x1 = inlink->w - 1;
s->y1 = inlink->h - 1;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_deband.c b/chromium/third_party/ffmpeg/libavfilter/vf_deband.c
new file mode 100644
index 00000000000..f25cbdd5936
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_deband.c
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2015 Niklas Haas
+ * Copyright (c) 2015 Paul B Mahol
+ *
+ * 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/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct DebandContext {
+ const AVClass *class;
+
+ float threshold[4];
+ int range;
+ int blur;
+ float direction;
+
+ int nb_components;
+ int planewidth[4];
+ int planeheight[4];
+ int thr[4];
+
+ int *x_pos;
+ int *y_pos;
+
+ int (*deband)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
+} DebandContext;
+
+#define OFFSET(x) offsetof(DebandContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption deband_options[] = {
+ { "1thr", "set 1st plane threshold", OFFSET(threshold[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
+ { "2thr", "set 2nd plane threshold", OFFSET(threshold[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
+ { "3thr", "set 3rd plane threshold", OFFSET(threshold[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
+ { "4thr", "set 4th plane threshold", OFFSET(threshold[3]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
+ { "range", "set range", OFFSET(range), AV_OPT_TYPE_INT, {.i64=16}, INT_MIN, INT_MAX, FLAGS },
+ { "r", "set range", OFFSET(range), AV_OPT_TYPE_INT, {.i64=16}, INT_MIN, INT_MAX, FLAGS },
+ { "direction", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS },
+ { "d", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS },
+ { "blur", "set blur", OFFSET(blur), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(deband);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
+ AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
+ AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
+ AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
+ AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14,
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14,
+ AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
+ AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
+ AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
+ AV_PIX_FMT_NONE
+ };
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static float frand(int x, int y)
+{
+ const float r = sinf(x * 12.9898 + y * 78.233) * 43758.545;
+
+ return r - floorf(r);
+}
+
+static int inline get_avg(int ref0, int ref1, int ref2, int ref3)
+{
+ return (ref0 + ref1 + ref2 + ref3) / 4;
+}
+
+typedef struct ThreadData {
+ AVFrame *in, *out;
+} ThreadData;
+
+static int deband_8_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ DebandContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ int x, y, p;
+
+ for (p = 0; p < s->nb_components; p++) {
+ const uint8_t *src_ptr = (const uint8_t *)in->data[p];
+ uint8_t *dst_ptr = (uint8_t *)out->data[p];
+ const int dst_linesize = out->linesize[p];
+ const int src_linesize = in->linesize[p];
+ const int thr = s->thr[p];
+ const int start = (s->planeheight[p] * jobnr ) / nb_jobs;
+ const int end = (s->planeheight[p] * (jobnr+1)) / nb_jobs;
+ const int w = s->planewidth[p] - 1;
+ const int h = s->planeheight[p] - 1;
+
+ for (y = start; y < end; y++) {
+ const int pos = y * s->planeheight[0];
+
+ for (x = 0; x < s->planewidth[p]; x++) {
+ const int x_pos = s->x_pos[pos + x];
+ const int y_pos = s->y_pos[pos + x];
+ const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
+ const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
+ const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
+ const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
+ const int src0 = src_ptr[y * src_linesize + x];
+
+ if (s->blur) {
+ const int avg = get_avg(ref0, ref1, ref2, ref3);
+ const int diff = FFABS(src0 - avg);
+
+ dst_ptr[y * dst_linesize + x] = diff < thr ? avg : src0;
+ } else {
+ dst_ptr[y * dst_linesize + x] = (FFABS(src0 - ref0) < thr) &&
+ (FFABS(src0 - ref1) < thr) &&
+ (FFABS(src0 - ref2) < thr) &&
+ (FFABS(src0 - ref3) < thr) ? get_avg(ref0, ref1, ref2, ref3) : src0;
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int deband_16_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ DebandContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ int x, y, p;
+
+ for (p = 0; p < s->nb_components; p++) {
+ const uint16_t *src_ptr = (const uint16_t *)in->data[p];
+ uint16_t *dst_ptr = (uint16_t *)out->data[p];
+ const int dst_linesize = out->linesize[p] / 2;
+ const int src_linesize = in->linesize[p] / 2;
+ const int thr = s->thr[p];
+ const int start = (s->planeheight[p] * jobnr ) / nb_jobs;
+ const int end = (s->planeheight[p] * (jobnr+1)) / nb_jobs;
+ const int w = s->planewidth[p] - 1;
+ const int h = s->planeheight[p] - 1;
+
+ for (y = start; y < end; y++) {
+ const int pos = y * s->planeheight[0];
+
+ for (x = 0; x < s->planewidth[p]; x++) {
+ const int x_pos = s->x_pos[pos + x];
+ const int y_pos = s->y_pos[pos + x];
+ const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
+ const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
+ const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
+ const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
+ const int src0 = src_ptr[y * src_linesize + x];
+
+ if (s->blur) {
+ const int avg = get_avg(ref0, ref1, ref2, ref3);
+ const int diff = FFABS(src0 - avg);
+
+ dst_ptr[y * dst_linesize + x] = diff < thr ? avg : src0;
+ } else {
+ dst_ptr[y * dst_linesize + x] = (FFABS(src0 - ref0) < thr) &&
+ (FFABS(src0 - ref1) < thr) &&
+ (FFABS(src0 - ref2) < thr) &&
+ (FFABS(src0 - ref3) < thr) ? get_avg(ref0, ref1, ref2, ref3) : src0;
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ AVFilterContext *ctx = inlink->dst;
+ DebandContext *s = ctx->priv;
+ const float direction = s->direction;
+ const int range = s->range;
+ int x, y;
+
+ s->nb_components = desc->nb_components;
+
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ s->planewidth[0] = s->planewidth[3] = inlink->w;
+
+ s->deband = desc->comp[0].depth > 8 ? deband_16_c : deband_8_c;
+
+ s->thr[0] = ((1 << desc->comp[0].depth) - 1) * s->threshold[0];
+ s->thr[1] = ((1 << desc->comp[1].depth) - 1) * s->threshold[1];
+ s->thr[2] = ((1 << desc->comp[2].depth) - 1) * s->threshold[2];
+ s->thr[3] = ((1 << desc->comp[3].depth) - 1) * s->threshold[3];
+
+ s->x_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->x_pos));
+ s->y_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->y_pos));
+ if (!s->x_pos || !s->y_pos)
+ return AVERROR(ENOMEM);
+
+ for (y = 0; y < s->planeheight[0]; y++) {
+ for (x = 0; x < s->planewidth[0]; x++) {
+ const float r = frand(x, y);
+ const float dir = direction < 0 ? -direction : r * direction;
+ const int dist = range < 0 ? -range : r * range;
+
+ s->x_pos[y * s->planeheight[0] + x] = cosf(dir) * dist;
+ s->y_pos[y * s->planeheight[0] + x] = sinf(dir) * dist;
+ }
+ }
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ DebandContext *s = ctx->priv;
+ AVFrame *out;
+ ThreadData td;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+
+ td.in = in; td.out = out;
+ ctx->internal->execute(ctx, s->deband, &td, NULL, FFMIN3(s->planeheight[1],
+ s->planeheight[2],
+ ctx->graph->nb_threads));
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, out);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ DebandContext *s = ctx->priv;
+
+ av_freep(&s->x_pos);
+ av_freep(&s->y_pos);
+}
+
+static const AVFilterPad avfilter_vf_deband_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_input,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad avfilter_vf_deband_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_deband = {
+ .name = "deband",
+ .description = NULL_IF_CONFIG_SMALL("Debands video."),
+ .priv_size = sizeof(DebandContext),
+ .priv_class = &deband_class,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .inputs = avfilter_vf_deband_inputs,
+ .outputs = avfilter_vf_deband_outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_decimate.c b/chromium/third_party/ffmpeg/libavfilter/vf_decimate.c
index 70357ea8e29..ae15ebe36e3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_decimate.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_decimate.c
@@ -71,8 +71,8 @@ static const AVOption decimate_options[] = {
{ "scthresh", "set scene change threshold", OFFSET(scthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS },
{ "blockx", "set the size of the x-axis blocks used during metric calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
{ "blocky", "set the size of the y-axis blocks used during metric calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
- { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
};
@@ -239,7 +239,7 @@ static int config_input(AVFilterLink *inlink)
dm->hsub = pix_desc->log2_chroma_w;
dm->vsub = pix_desc->log2_chroma_h;
- dm->depth = pix_desc->comp[0].depth_minus1 + 1;
+ dm->depth = pix_desc->comp[0].depth;
max_value = (1 << dm->depth) - 1;
dm->scthresh = (int64_t)(((int64_t)max_value * w * h * dm->scthresh_flt) / 100);
dm->dupthresh = (int64_t)(((int64_t)max_value * dm->blockx * dm->blocky * dm->dupthresh_flt) / 100);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c b/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c
index ab525b666c2..c4d7b6bb6cc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_dejudder.c
@@ -80,40 +80,40 @@ AVFILTER_DEFINE_CLASS(dejudder);
static int config_out_props(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- DejudderContext *dj = ctx->priv;
+ DejudderContext *s = ctx->priv;
AVFilterLink *inlink = outlink->src->inputs[0];
- outlink->time_base = av_mul_q(inlink->time_base, av_make_q(1, 2 * dj->cycle));
- outlink->frame_rate = av_mul_q(inlink->frame_rate, av_make_q(2 * dj->cycle, 1));
+ outlink->time_base = av_mul_q(inlink->time_base, av_make_q(1, 2 * s->cycle));
+ outlink->frame_rate = av_mul_q(inlink->frame_rate, av_make_q(2 * s->cycle, 1));
- av_log(ctx, AV_LOG_VERBOSE, "cycle:%d\n", dj->cycle);
+ av_log(ctx, AV_LOG_VERBOSE, "cycle:%d\n", s->cycle);
return 0;
}
static av_cold int dejudder_init(AVFilterContext *ctx)
{
- DejudderContext *dj = ctx->priv;
+ DejudderContext *s = ctx->priv;
- dj->ringbuff = av_mallocz_array(dj->cycle+2, sizeof(*dj->ringbuff));
- if (!dj->ringbuff)
+ s->ringbuff = av_mallocz_array(s->cycle+2, sizeof(*s->ringbuff));
+ if (!s->ringbuff)
return AVERROR(ENOMEM);
- dj->new_pts = 0;
- dj->i1 = 0;
- dj->i2 = 1;
- dj->i3 = 2;
- dj->i4 = 3;
- dj->start_count = dj->cycle + 2;
+ s->new_pts = 0;
+ s->i1 = 0;
+ s->i2 = 1;
+ s->i3 = 2;
+ s->i4 = 3;
+ s->start_count = s->cycle + 2;
return 0;
}
static av_cold void dejudder_uninit(AVFilterContext *ctx)
{
- DejudderContext *dj = ctx->priv;
+ DejudderContext *s = ctx->priv;
- av_freep(&(dj->ringbuff));
+ av_freep(&(s->ringbuff));
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -121,36 +121,36 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
int k;
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
- DejudderContext *dj = ctx->priv;
- int64_t *judbuff = dj->ringbuff;
+ DejudderContext *s = ctx->priv;
+ int64_t *judbuff = s->ringbuff;
int64_t next_pts = frame->pts;
int64_t offset;
if (next_pts == AV_NOPTS_VALUE)
return ff_filter_frame(outlink, frame);
- if (dj->start_count) {
- dj->start_count--;
- dj->new_pts = next_pts * 2 * dj->cycle;
+ if (s->start_count) {
+ s->start_count--;
+ s->new_pts = next_pts * 2 * s->cycle;
} else {
- if (next_pts < judbuff[dj->i2]) {
- offset = next_pts + judbuff[dj->i3] - judbuff[dj->i4] - judbuff[dj->i1];
- for (k = 0; k < dj->cycle + 2; k++)
+ if (next_pts < judbuff[s->i2]) {
+ offset = next_pts + judbuff[s->i3] - judbuff[s->i4] - judbuff[s->i1];
+ for (k = 0; k < s->cycle + 2; k++)
judbuff[k] += offset;
}
- dj->new_pts += (dj->cycle - 1) * (judbuff[dj->i3] - judbuff[dj->i1])
- + (dj->cycle + 1) * (next_pts - judbuff[dj->i4]);
+ s->new_pts += (s->cycle - 1) * (judbuff[s->i3] - judbuff[s->i1])
+ + (s->cycle + 1) * (next_pts - judbuff[s->i4]);
}
- judbuff[dj->i2] = next_pts;
- dj->i1 = dj->i2;
- dj->i2 = dj->i3;
- dj->i3 = dj->i4;
- dj->i4 = (dj->i4 + 1) % (dj->cycle + 2);
+ judbuff[s->i2] = next_pts;
+ s->i1 = s->i2;
+ s->i2 = s->i3;
+ s->i3 = s->i4;
+ s->i4 = (s->i4 + 1) % (s->cycle + 2);
- frame->pts = dj->new_pts;
+ frame->pts = s->new_pts;
- for (k = 0; k < dj->cycle + 2; k++)
+ for (k = 0; k < s->cycle + 2; k++)
av_log(ctx, AV_LOG_DEBUG, "%"PRId64"\t", judbuff[k]);
av_log(ctx, AV_LOG_DEBUG, "next=%"PRId64", new=%"PRId64"\n", next_pts, frame->pts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c b/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
index 50a548b83c8..fa5e227c4a5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_delogo.c
@@ -163,7 +163,7 @@ static const AVOption delogo_options[]= {
{ "h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
{ "band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 = 4 }, 1, INT_MAX, FLAGS },
{ "t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 = 4 }, 1, INT_MAX, FLAGS },
- { "show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+ { "show", "show delogo area", OFFSET(show), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c b/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
index cd06ee7dde0..ac13ecdabab 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_deshake.c
@@ -85,7 +85,7 @@ static const AVOption deshake_options[] = {
{ "exhaustive", "exhaustive search", 0, AV_OPT_TYPE_CONST, {.i64=EXHAUSTIVE}, INT_MIN, INT_MAX, FLAGS, "smode" },
{ "less", "less exhaustive search", 0, AV_OPT_TYPE_CONST, {.i64=SMART_EXHAUSTIVE}, INT_MIN, INT_MAX, FLAGS, "smode" },
{ "filename", "set motion search detailed log file name", OFFSET(filename), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
- { "opencl", "use OpenCL filtering capabilities", OFFSET(opencl), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = FLAGS },
+ { "opencl", "use OpenCL filtering capabilities", OFFSET(opencl), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
index 16e3383db0c..9fd94618634 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
@@ -207,7 +207,7 @@ static const AVOption drawtext_options[]= {
{"boxcolor", "set box color", OFFSET(boxcolor.rgba), AV_OPT_TYPE_COLOR, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"bordercolor", "set border color", OFFSET(bordercolor.rgba), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
{"shadowcolor", "set shadow color", OFFSET(shadowcolor.rgba), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
- {"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 , FLAGS},
+ {"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 , FLAGS},
{"boxborderw", "set box border width", OFFSET(boxborderw), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX , FLAGS},
{"fontsize", "set font size", OFFSET(fontsize), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX , FLAGS},
{"x", "set x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, FLAGS},
@@ -227,17 +227,17 @@ static const AVOption drawtext_options[]= {
{"strftime", "set strftime expansion (deprecated)", OFFSET(exp_mode), AV_OPT_TYPE_CONST, {.i64=EXP_STRFTIME}, 0, 0, FLAGS, "expansion"},
{"timecode", "set initial timecode", OFFSET(tc_opt_string), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS},
- {"tc24hmax", "set 24 hours max (timecode only)", OFFSET(tc24hmax), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
+ {"tc24hmax", "set 24 hours max (timecode only)", OFFSET(tc24hmax), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{"timecode_rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS},
{"r", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS},
{"rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS},
- {"reload", "reload text file for each frame", OFFSET(reload), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
+ {"reload", "reload text file for each frame", OFFSET(reload), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{ "alpha", "apply alpha while rendering", OFFSET(a_expr), AV_OPT_TYPE_STRING, { .str = "1" }, .flags = FLAGS },
- {"fix_bounds", "if true, check and fix text coords to avoid clipping", OFFSET(fix_bounds), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS},
+ {"fix_bounds", "check and fix text coords to avoid clipping", OFFSET(fix_bounds), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS},
{"start_number", "start frame number for n/frame_num variable", OFFSET(start_number), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS},
#if CONFIG_LIBFRIBIDI
- {"text_shaping", "attempt to shape text before drawing", OFFSET(text_shaping), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS},
+ {"text_shaping", "attempt to shape text before drawing", OFFSET(text_shaping), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS},
#endif
/* FT_LOAD_* flags */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c b/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
index 86560708afe..9805eccbbdb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_elbg.c
@@ -33,7 +33,7 @@
#include "internal.h"
#include "video.h"
-typedef struct ColorContext {
+typedef struct ELBGContext {
const AVClass *class;
AVLFG lfg;
unsigned int lfg_seed;
@@ -45,6 +45,7 @@ typedef struct ColorContext {
int codebook_length;
const AVPixFmtDescriptor *pix_desc;
uint8_t rgba_map[4];
+ int pal8;
} ELBGContext;
#define OFFSET(x) offsetof(ELBGContext, x)
@@ -57,6 +58,7 @@ static const AVOption elbg_options[] = {
{ "n", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "seed", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
{ "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT32_MAX, FLAGS },
+ { "pal8", "set the pal8 output", OFFSET(pal8), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
@@ -66,6 +68,11 @@ static av_cold int init(AVFilterContext *ctx)
{
ELBGContext *elbg = ctx->priv;
+ if (elbg->pal8 && elbg->codebook_length > 256) {
+ av_log(ctx, AV_LOG_ERROR, "pal8 output allows max 256 codebook length.\n");
+ return AVERROR(EINVAL);
+ }
+
if (elbg->lfg_seed == -1)
elbg->lfg_seed = av_get_random_seed();
@@ -75,15 +82,27 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
+ ELBGContext *elbg = ctx->priv;
+
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_NONE
};
- AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
- if (!fmts_list)
- return AVERROR(ENOMEM);
- return ff_set_common_formats(ctx, fmts_list);
+ if (!elbg->pal8) {
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+ } else {
+ static const enum AVPixelFormat pal8_fmt[] = {
+ AV_PIX_FMT_PAL8,
+ AV_PIX_FMT_NONE
+ };
+ ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->out_formats);
+ ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->in_formats);
+ }
+ return 0;
}
#define NB_COMPONENTS 3
@@ -152,6 +171,36 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
elbg->codebook, elbg->codebook_length, elbg->max_steps_nb,
elbg->codeword_closest_codebook_idxs, &elbg->lfg);
+ if (elbg->pal8) {
+ AVFilterLink *outlink = inlink->dst->outputs[0];
+ AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ uint32_t *pal;
+
+ if (!out)
+ return AVERROR(ENOMEM);
+ out->pts = frame->pts;
+ av_frame_free(&frame);
+ pal = (uint32_t *)out->data[1];
+ p0 = (uint8_t *)out->data[0];
+
+ for (i = 0; i < elbg->codebook_length; i++) {
+ pal[i] = (elbg->codebook[i*3 ] << 16) |
+ (elbg->codebook[i*3+1] << 8) |
+ elbg->codebook[i*3+2];
+ }
+
+ k = 0;
+ for (i = 0; i < inlink->h; i++) {
+ p = p0;
+ for (j = 0; j < inlink->w; j++, p++) {
+ p[0] = elbg->codeword_closest_codebook_idxs[k++];
+ }
+ p0 += out->linesize[0];
+ }
+
+ return ff_filter_frame(outlink, out);
+ }
+
/* fill the output with the codebook values */
p0 = frame->data[0];
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_eq.c b/chromium/third_party/ffmpeg/libavfilter/vf_eq.c
index f8b816038d3..1519d3d5693 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_eq.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_eq.c
@@ -98,7 +98,7 @@ static void check_values(EQParameters *param, EQContext *eq)
{
if (param->contrast == 1.0 && param->brightness == 0.0 && param->gamma == 1.0)
param->adjust = NULL;
- else if (param->gamma == 1.0)
+ else if (param->gamma == 1.0 && fabs(param->contrast) < 7.9)
param->adjust = eq->process;
else
param->adjust = apply_lut;
@@ -106,7 +106,7 @@ static void check_values(EQParameters *param, EQContext *eq)
static void set_contrast(EQContext *eq)
{
- eq->contrast = av_clipf(av_expr_eval(eq->contrast_pexpr, eq->var_values, eq), -2.0, 2.0);
+ eq->contrast = av_clipf(av_expr_eval(eq->contrast_pexpr, eq->var_values, eq), -1000.0, 1000.0);
eq->param[0].contrast = eq->contrast;
eq->param[0].lut_clean = 0;
check_values(&eq->param[0], eq);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_extractplanes.c b/chromium/third_party/ffmpeg/libavfilter/vf_extractplanes.c
index b0fa1bb292e..47a174856e4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_extractplanes.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_extractplanes.c
@@ -39,7 +39,7 @@ typedef struct {
int requested_planes;
int map[4];
int linesize[4];
- int is_packed_rgb;
+ int is_packed;
int depth;
int step;
} ExtractPlanesContext;
@@ -70,6 +70,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P,
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUVA420P16LE,
AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUVA420P16BE,
@@ -78,6 +79,7 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUVA444P16LE,
AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUVA444P16BE,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A,
+ AV_PIX_FMT_YA16LE, AV_PIX_FMT_YA16BE,
AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
@@ -109,17 +111,17 @@ static int query_formats(AVFilterContext *ctx)
avff = ctx->inputs[0]->in_formats;
desc = av_pix_fmt_desc_get(avff->formats[0]);
- depth = desc->comp[0].depth_minus1;
+ depth = desc->comp[0].depth;
be = desc->flags & AV_PIX_FMT_FLAG_BE;
for (i = 1; i < avff->nb_formats; i++) {
desc = av_pix_fmt_desc_get(avff->formats[i]);
- if (depth != desc->comp[0].depth_minus1 ||
+ if (depth != desc->comp[0].depth ||
be != (desc->flags & AV_PIX_FMT_FLAG_BE)) {
return AVERROR(EAGAIN);
}
}
- if (depth == 7)
+ if (depth == 8)
out_pixfmts = out8_pixfmts;
else if (be)
out_pixfmts = out16be_pixfmts;
@@ -150,9 +152,10 @@ static int config_input(AVFilterLink *inlink)
if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
return ret;
- s->depth = (desc->comp[0].depth_minus1 + 1) >> 3;
+ s->depth = desc->comp[0].depth >> 3;
s->step = av_get_padded_bits_per_pixel(desc) >> 3;
- s->is_packed_rgb = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
+ s->is_packed = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR) &&
+ (desc->nb_components > 1);
if (desc->flags & AV_PIX_FMT_FLAG_RGB) {
ff_fill_rgba_map(rgba_map, inlink->format);
for (i = 0; i < 4; i++)
@@ -224,7 +227,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
av_frame_copy_props(out, frame);
- if (s->is_packed_rgb) {
+ if (s->is_packed) {
extract_from_packed(out->data[0], out->linesize[0],
frame->data[0], frame->linesize[0],
outlink->w, outlink->h,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fade.c b/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
index 3e6aa7fe870..040e3fdc53f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fade.c
@@ -384,7 +384,7 @@ static const AVOption fade_options[] = {
OFFSET(nb_frames), AV_OPT_TYPE_INT, { .i64 = 25 }, 0, INT_MAX, FLAGS },
{ "n", "Number of frames to which the effect should be applied.",
OFFSET(nb_frames), AV_OPT_TYPE_INT, { .i64 = 25 }, 0, INT_MAX, FLAGS },
- { "alpha", "fade alpha if it is available on the input", OFFSET(alpha), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FLAGS },
+ { "alpha", "fade alpha if it is available on the input", OFFSET(alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FLAGS },
{ "start_time", "Number of seconds of the beginning of the effect.",
OFFSET(start_time), AV_OPT_TYPE_DURATION, {.i64 = 0. }, 0, INT32_MAX, FLAGS },
{ "st", "Number of seconds of the beginning of the effect.",
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fieldmatch.c b/chromium/third_party/ffmpeg/libavfilter/vf_fieldmatch.c
index c01af6681cc..b987e299c08 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fieldmatch.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fieldmatch.c
@@ -124,12 +124,12 @@ static const AVOption fieldmatch_options[] = {
{ "pc_n_ub", "2-way match + 3rd match on combed + 4th/5th matches if still combed (p/c + u + u/b)", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PC_N_UB}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "pcn", "3-way match (p/c/n)", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PCN}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "pcn_ub", "3-way match + 4th/5th matches on combed (p/c/n + u/b)", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PCN_UB}, INT_MIN, INT_MAX, FLAGS, "mode" },
- { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+ { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "field", "set the field to match from", OFFSET(field), AV_OPT_TYPE_INT, {.i64=FM_PARITY_AUTO}, -1, 1, FLAGS, "field" },
{ "auto", "automatic (same value as 'order')", 0, AV_OPT_TYPE_CONST, {.i64=FM_PARITY_AUTO}, INT_MIN, INT_MAX, FLAGS, "field" },
{ "bottom", "bottom field", 0, AV_OPT_TYPE_CONST, {.i64=FM_PARITY_BOTTOM}, INT_MIN, INT_MAX, FLAGS, "field" },
{ "top", "top field", 0, AV_OPT_TYPE_CONST, {.i64=FM_PARITY_TOP}, INT_MIN, INT_MAX, FLAGS, "field" },
- { "mchroma", "set whether or not chroma is included during the match comparisons", OFFSET(mchroma), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "mchroma", "set whether or not chroma is included during the match comparisons", OFFSET(mchroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ "y0", "define an exclusion band which excludes the lines between y0 and y1 from the field matching decision", OFFSET(y0), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{ "y1", "define an exclusion band which excludes the lines between y0 and y1 from the field matching decision", OFFSET(y1), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{ "scthresh", "set scene change detection threshold", OFFSET(scthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl=12}, 0, 100, FLAGS },
@@ -142,7 +142,7 @@ static const AVOption fieldmatch_options[] = {
{ "pcn", "calculate p/c/n", 0, AV_OPT_TYPE_CONST, {.i64=COMBDBG_PCN}, INT_MIN, INT_MAX, FLAGS, "dbglvl" },
{ "pcnub", "calculate p/c/n/u/b", 0, AV_OPT_TYPE_CONST, {.i64=COMBDBG_PCNUB}, INT_MIN, INT_MAX, FLAGS, "dbglvl" },
{ "cthresh", "set the area combing threshold used for combed frame detection", OFFSET(cthresh), AV_OPT_TYPE_INT, {.i64= 9}, -1, 0xff, FLAGS },
- { "chroma", "set whether or not chroma is considered in the combed frame decision", OFFSET(chroma), AV_OPT_TYPE_INT, {.i64= 0}, 0, 1, FLAGS },
+ { "chroma", "set whether or not chroma is considered in the combed frame decision", OFFSET(chroma), AV_OPT_TYPE_BOOL,{.i64= 0}, 0, 1, FLAGS },
{ "blockx", "set the x-axis size of the window used during combed frame detection", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64=16}, 4, 1<<9, FLAGS },
{ "blocky", "set the y-axis size of the window used during combed frame detection", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64=16}, 4, 1<<9, FLAGS },
{ "combpel", "set the number of combed pixels inside any of the blocky by blockx size blocks on the frame for the frame to be detected as combed", OFFSET(combpel), AV_OPT_TYPE_INT, {.i64=80}, 0, INT_MAX, FLAGS },
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_find_rect.c b/chromium/third_party/ffmpeg/libavfilter/vf_find_rect.c
index a4631deed41..cb79f4a4ca0 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_find_rect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_find_rect.c
@@ -45,7 +45,7 @@ typedef struct FOCContext {
#define OFFSET(x) offsetof(FOCContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption foc_options[] = {
+static const AVOption find_rect_options[] = {
{ "object", "object bitmap filename", OFFSET(obj_filename), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl = 0.5}, 0, 1.0, FLAGS },
{ "mipmaps", "set mipmaps", OFFSET(mipmaps), AV_OPT_TYPE_INT, {.i64 = 3}, 1, MAX_MIPMAPS, FLAGS },
@@ -56,13 +56,7 @@ static const AVOption foc_options[] = {
{ NULL }
};
-static const AVClass foc_class = {
- .class_name = "find_rect",
- .item_name = av_default_item_name,
- .option = foc_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(find_rect);
static int query_formats(AVFilterContext *ctx)
{
@@ -307,5 +301,5 @@ AVFilter ff_vf_find_rect = {
.query_formats = query_formats,
.inputs = foc_inputs,
.outputs = foc_outputs,
- .priv_class = &foc_class,
+ .priv_class = &find_rect_class,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c b/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c
index e9b9ed1362b..be85f85cf90 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_framepack.c
@@ -315,7 +315,7 @@ static int request_frame(AVFilterLink *outlink)
#define OFFSET(x) offsetof(FramepackContext, x)
#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
+static const AVOption framepack_options[] = {
{ "format", "Frame pack output format", OFFSET(format), AV_OPT_TYPE_INT,
{ .i64 = AV_STEREO3D_SIDEBYSIDE }, 0, INT_MAX, .flags = V, .unit = "format" },
{ "sbs", "Views are packed next to each other", 0, AV_OPT_TYPE_CONST,
@@ -331,12 +331,7 @@ static const AVOption options[] = {
{ NULL },
};
-static const AVClass framepack_class = {
- .class_name = "framepack",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(framepack);
static const AVFilterPad framepack_inputs[] = {
{
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_framerate.c b/chromium/third_party/ffmpeg/libavfilter/vf_framerate.c
new file mode 100644
index 00000000000..687b9a50fe2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_framerate.c
@@ -0,0 +1,732 @@
+/*
+ * Copyright (C) 2012 Mark Himsley
+ *
+ * get_scene_score() Copyright (c) 2011 Stefano Sabatini
+ * taken from libavfilter/vf_select.c
+ *
+ * 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 for upsampling or downsampling a progressive source
+ */
+
+#define DEBUG
+
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/pixelutils.h"
+
+#include "avfilter.h"
+#include "internal.h"
+#include "video.h"
+
+#define N_SRCE 3
+
+typedef struct FrameRateContext {
+ const AVClass *class;
+ // parameters
+ AVRational dest_frame_rate; ///< output frames per second
+ int flags; ///< flags affecting frame rate conversion algorithm
+ double scene_score; ///< score that denotes a scene change has happened
+ int interp_start; ///< start of range to apply linear interpolation
+ int interp_end; ///< end of range to apply linear interpolation
+
+ int line_size[4]; ///< bytes of pixel data per line for each plane
+ int vsub;
+
+ int frst, next, prev, crnt, last;
+ int pending_srce_frames; ///< how many input frames are still waiting to be processed
+ int flush; ///< are we flushing final frames
+ int pending_end_frame; ///< flag indicating we are waiting to call filter_frame()
+
+ AVRational srce_time_base; ///< timebase of source
+
+ AVRational dest_time_base; ///< timebase of destination
+ int32_t dest_frame_num;
+ int64_t last_dest_frame_pts; ///< pts of the last frame output
+ int64_t average_srce_pts_dest_delta;///< average input pts delta converted from input rate to output rate
+ int64_t average_dest_pts_delta; ///< calculated average output pts delta
+
+ av_pixelutils_sad_fn sad; ///< Sum of the absolute difference function (scene detect only)
+ double prev_mafd; ///< previous MAFD (scene detect only)
+
+ AVFrame *srce[N_SRCE]; ///< buffered source frames
+ int64_t srce_pts_dest[N_SRCE]; ///< pts for source frames scaled to output timebase
+ int64_t pts; ///< pts of frame we are working on
+
+ int (*blend_frames)(AVFilterContext *ctx, float interpolate,
+ AVFrame *copy_src1, AVFrame *copy_src2);
+ int max;
+ int bitdepth;
+ AVFrame *work;
+} FrameRateContext;
+
+#define OFFSET(x) offsetof(FrameRateContext, x)
+#define V AV_OPT_FLAG_VIDEO_PARAM
+#define F AV_OPT_FLAG_FILTERING_PARAM
+#define FRAMERATE_FLAG_SCD 01
+
+static const AVOption framerate_options[] = {
+ {"fps", "required output frames per second rate", OFFSET(dest_frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="50"}, 0, INT_MAX, V|F },
+
+ {"interp_start", "point to start linear interpolation", OFFSET(interp_start), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, V|F },
+ {"interp_end", "point to end linear interpolation", OFFSET(interp_end), AV_OPT_TYPE_INT, {.i64=240}, 0, 255, V|F },
+ {"scene", "scene change level", OFFSET(scene_score), AV_OPT_TYPE_DOUBLE, {.dbl=7.0}, 0, INT_MAX, V|F },
+
+ {"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=1}, 0, INT_MAX, V|F, "flags" },
+ {"scene_change_detect", "enable scene change detection", 0, AV_OPT_TYPE_CONST, {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
+ {"scd", "enable scene change detection", 0, AV_OPT_TYPE_CONST, {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
+
+ {NULL}
+};
+
+AVFILTER_DEFINE_CLASS(framerate);
+
+static void next_source(AVFilterContext *ctx)
+{
+ FrameRateContext *s = ctx->priv;
+ int i;
+
+ ff_dlog(ctx, "next_source()\n");
+
+ if (s->srce[s->last] && s->srce[s->last] != s->srce[s->last-1]) {
+ ff_dlog(ctx, "next_source() unlink %d\n", s->last);
+ av_frame_free(&s->srce[s->last]);
+ }
+ for (i = s->last; i > s->frst; i--) {
+ ff_dlog(ctx, "next_source() copy %d to %d\n", i - 1, i);
+ s->srce[i] = s->srce[i - 1];
+ }
+ ff_dlog(ctx, "next_source() make %d null\n", s->frst);
+ s->srce[s->frst] = NULL;
+}
+
+static av_always_inline int64_t sad_8x8_16(const uint16_t *src1, ptrdiff_t stride1,
+ const uint16_t *src2, ptrdiff_t stride2)
+{
+ int sum = 0;
+ int x, y;
+
+ for (y = 0; y < 8; y++) {
+ for (x = 0; x < 8; x++)
+ sum += FFABS(src1[x] - src2[x]);
+ src1 += stride1;
+ src2 += stride2;
+ }
+ return sum;
+}
+
+static double get_scene_score16(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)
+{
+ FrameRateContext *s = ctx->priv;
+ double ret = 0;
+
+ ff_dlog(ctx, "get_scene_score16()\n");
+
+ if (crnt &&
+ crnt->height == next->height &&
+ crnt->width == next->width) {
+ int x, y;
+ int64_t sad;
+ double mafd, diff;
+ const uint16_t *p1 = (const uint16_t *)crnt->data[0];
+ const uint16_t *p2 = (const uint16_t *)next->data[0];
+ const int p1_linesize = crnt->linesize[0] / 2;
+ const int p2_linesize = next->linesize[0] / 2;
+
+ ff_dlog(ctx, "get_scene_score16() process\n");
+
+ for (sad = y = 0; y < crnt->height; y += 8) {
+ for (x = 0; x < p1_linesize; x += 8) {
+ sad += sad_8x8_16(p1 + y * p1_linesize + x,
+ p1_linesize,
+ p2 + y * p2_linesize + x,
+ p2_linesize);
+ }
+ }
+ mafd = sad / (crnt->height * crnt->width * 3);
+ diff = fabs(mafd - s->prev_mafd);
+ ret = av_clipf(FFMIN(mafd, diff), 0, 100.0);
+ s->prev_mafd = mafd;
+ }
+ ff_dlog(ctx, "get_scene_score16() result is:%f\n", ret);
+ return ret;
+}
+
+static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)
+{
+ FrameRateContext *s = ctx->priv;
+ double ret = 0;
+
+ ff_dlog(ctx, "get_scene_score()\n");
+
+ if (crnt &&
+ crnt->height == next->height &&
+ crnt->width == next->width) {
+ int x, y;
+ int64_t sad;
+ double mafd, diff;
+ uint8_t *p1 = crnt->data[0];
+ uint8_t *p2 = next->data[0];
+ const int p1_linesize = crnt->linesize[0];
+ const int p2_linesize = next->linesize[0];
+
+ ff_dlog(ctx, "get_scene_score() process\n");
+
+ for (sad = y = 0; y < crnt->height; y += 8) {
+ for (x = 0; x < p1_linesize; x += 8) {
+ sad += s->sad(p1 + y * p1_linesize + x,
+ p1_linesize,
+ p2 + y * p2_linesize + x,
+ p2_linesize);
+ }
+ }
+ emms_c();
+ mafd = sad / (crnt->height * crnt->width * 3);
+ diff = fabs(mafd - s->prev_mafd);
+ ret = av_clipf(FFMIN(mafd, diff), 0, 100.0);
+ s->prev_mafd = mafd;
+ }
+ ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);
+ return ret;
+}
+
+static int blend_frames16(AVFilterContext *ctx, float interpolate,
+ AVFrame *copy_src1, AVFrame *copy_src2)
+{
+ FrameRateContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ double interpolate_scene_score = 0;
+
+ if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
+ interpolate_scene_score = get_scene_score16(ctx, copy_src1, copy_src2);
+ ff_dlog(ctx, "blend_frames16() interpolate scene score:%f\n", interpolate_scene_score);
+ }
+ // decide if the shot-change detection allows us to blend two frames
+ if (interpolate_scene_score < s->scene_score && copy_src2) {
+ uint16_t src2_factor = FFABS(interpolate) * (1 << (s->bitdepth - 8));
+ uint16_t src1_factor = s->max - src2_factor;
+ const int half = s->max / 2;
+ const int uv = (s->max + 1) * half;
+ const int shift = s->bitdepth;
+ int plane, line, pixel;
+
+ // get work-space for output frame
+ s->work = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!s->work)
+ return AVERROR(ENOMEM);
+
+ av_frame_copy_props(s->work, s->srce[s->crnt]);
+
+ ff_dlog(ctx, "blend_frames16() INTERPOLATE to create work frame\n");
+ for (plane = 0; plane < 4 && copy_src1->data[plane] && copy_src2->data[plane]; plane++) {
+ int cpy_line_width = s->line_size[plane];
+ const uint16_t *cpy_src1_data = (const uint16_t *)copy_src1->data[plane];
+ int cpy_src1_line_size = copy_src1->linesize[plane] / 2;
+ const uint16_t *cpy_src2_data = (const uint16_t *)copy_src2->data[plane];
+ int cpy_src2_line_size = copy_src2->linesize[plane] / 2;
+ int cpy_src_h = (plane > 0 && plane < 3) ? (copy_src1->height >> s->vsub) : (copy_src1->height);
+ uint16_t *cpy_dst_data = (uint16_t *)s->work->data[plane];
+ int cpy_dst_line_size = s->work->linesize[plane] / 2;
+
+ if (plane <1 || plane >2) {
+ // luma or alpha
+ for (line = 0; line < cpy_src_h; line++) {
+ for (pixel = 0; pixel < cpy_line_width; pixel++)
+ cpy_dst_data[pixel] = ((cpy_src1_data[pixel] * src1_factor) + (cpy_src2_data[pixel] * src2_factor) + half) >> shift;
+ cpy_src1_data += cpy_src1_line_size;
+ cpy_src2_data += cpy_src2_line_size;
+ cpy_dst_data += cpy_dst_line_size;
+ }
+ } else {
+ // chroma
+ for (line = 0; line < cpy_src_h; line++) {
+ for (pixel = 0; pixel < cpy_line_width; pixel++) {
+ cpy_dst_data[pixel] = (((cpy_src1_data[pixel] - half) * src1_factor) + ((cpy_src2_data[pixel] - half) * src2_factor) + uv) >> shift;
+ }
+ cpy_src1_data += cpy_src1_line_size;
+ cpy_src2_data += cpy_src2_line_size;
+ cpy_dst_data += cpy_dst_line_size;
+ }
+ }
+ }
+ return 1;
+ }
+ return 0;
+}
+
+static int blend_frames8(AVFilterContext *ctx, float interpolate,
+ AVFrame *copy_src1, AVFrame *copy_src2)
+{
+ FrameRateContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ double interpolate_scene_score = 0;
+
+ if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
+ interpolate_scene_score = get_scene_score(ctx, copy_src1, copy_src2);
+ ff_dlog(ctx, "blend_frames8() interpolate scene score:%f\n", interpolate_scene_score);
+ }
+ // decide if the shot-change detection allows us to blend two frames
+ if (interpolate_scene_score < s->scene_score && copy_src2) {
+ uint16_t src2_factor = FFABS(interpolate);
+ uint16_t src1_factor = 256 - src2_factor;
+ int plane, line, pixel;
+
+ // get work-space for output frame
+ s->work = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!s->work)
+ return AVERROR(ENOMEM);
+
+ av_frame_copy_props(s->work, s->srce[s->crnt]);
+
+ ff_dlog(ctx, "blend_frames8() INTERPOLATE to create work frame\n");
+ for (plane = 0; plane < 4 && copy_src1->data[plane] && copy_src2->data[plane]; plane++) {
+ int cpy_line_width = s->line_size[plane];
+ uint8_t *cpy_src1_data = copy_src1->data[plane];
+ int cpy_src1_line_size = copy_src1->linesize[plane];
+ uint8_t *cpy_src2_data = copy_src2->data[plane];
+ int cpy_src2_line_size = copy_src2->linesize[plane];
+ int cpy_src_h = (plane > 0 && plane < 3) ? (copy_src1->height >> s->vsub) : (copy_src1->height);
+ uint8_t *cpy_dst_data = s->work->data[plane];
+ int cpy_dst_line_size = s->work->linesize[plane];
+ if (plane <1 || plane >2) {
+ // luma or alpha
+ for (line = 0; line < cpy_src_h; line++) {
+ for (pixel = 0; pixel < cpy_line_width; pixel++) {
+ // integer version of (src1 * src1_factor) + (src2 + src2_factor) + 0.5
+ // 0.5 is for rounding
+ // 128 is the integer representation of 0.5 << 8
+ cpy_dst_data[pixel] = ((cpy_src1_data[pixel] * src1_factor) + (cpy_src2_data[pixel] * src2_factor) + 128) >> 8;
+ }
+ cpy_src1_data += cpy_src1_line_size;
+ cpy_src2_data += cpy_src2_line_size;
+ cpy_dst_data += cpy_dst_line_size;
+ }
+ } else {
+ // chroma
+ for (line = 0; line < cpy_src_h; line++) {
+ for (pixel = 0; pixel < cpy_line_width; pixel++) {
+ // as above
+ // because U and V are based around 128 we have to subtract 128 from the components.
+ // 32896 is the integer representation of 128.5 << 8
+ cpy_dst_data[pixel] = (((cpy_src1_data[pixel] - 128) * src1_factor) + ((cpy_src2_data[pixel] - 128) * src2_factor) + 32896) >> 8;
+ }
+ cpy_src1_data += cpy_src1_line_size;
+ cpy_src2_data += cpy_src2_line_size;
+ cpy_dst_data += cpy_dst_line_size;
+ }
+ }
+ }
+ return 1;
+ }
+ return 0;
+}
+
+static int process_work_frame(AVFilterContext *ctx, int stop)
+{
+ FrameRateContext *s = ctx->priv;
+ int64_t work_next_pts;
+ AVFrame *copy_src1;
+ float interpolate;
+
+ ff_dlog(ctx, "process_work_frame()\n");
+
+ ff_dlog(ctx, "process_work_frame() pending_input_frames %d\n", s->pending_srce_frames);
+
+ if (s->srce[s->prev]) ff_dlog(ctx, "process_work_frame() srce prev pts:%"PRId64"\n", s->srce[s->prev]->pts);
+ if (s->srce[s->crnt]) ff_dlog(ctx, "process_work_frame() srce crnt pts:%"PRId64"\n", s->srce[s->crnt]->pts);
+ if (s->srce[s->next]) ff_dlog(ctx, "process_work_frame() srce next pts:%"PRId64"\n", s->srce[s->next]->pts);
+
+ if (!s->srce[s->crnt]) {
+ // the filter cannot do anything
+ ff_dlog(ctx, "process_work_frame() no current frame cached: move on to next frame, do not output a frame\n");
+ next_source(ctx);
+ return 0;
+ }
+
+ work_next_pts = s->pts + s->average_dest_pts_delta;
+
+ ff_dlog(ctx, "process_work_frame() work crnt pts:%"PRId64"\n", s->pts);
+ ff_dlog(ctx, "process_work_frame() work next pts:%"PRId64"\n", work_next_pts);
+ if (s->srce[s->prev])
+ ff_dlog(ctx, "process_work_frame() srce prev pts:%"PRId64" at dest time base:%u/%u\n",
+ s->srce_pts_dest[s->prev], s->dest_time_base.num, s->dest_time_base.den);
+ if (s->srce[s->crnt])
+ ff_dlog(ctx, "process_work_frame() srce crnt pts:%"PRId64" at dest time base:%u/%u\n",
+ s->srce_pts_dest[s->crnt], s->dest_time_base.num, s->dest_time_base.den);
+ if (s->srce[s->next])
+ ff_dlog(ctx, "process_work_frame() srce next pts:%"PRId64" at dest time base:%u/%u\n",
+ s->srce_pts_dest[s->next], s->dest_time_base.num, s->dest_time_base.den);
+
+ av_assert0(s->srce[s->next]);
+
+ // should filter be skipping input frame (output frame rate is lower than input frame rate)
+ if (!s->flush && s->pts >= s->srce_pts_dest[s->next]) {
+ ff_dlog(ctx, "process_work_frame() work crnt pts >= srce next pts: SKIP FRAME, move on to next frame, do not output a frame\n");
+ next_source(ctx);
+ s->pending_srce_frames--;
+ return 0;
+ }
+
+ // calculate interpolation
+ interpolate = ((s->pts - s->srce_pts_dest[s->crnt]) * 256.0 / s->average_srce_pts_dest_delta);
+ ff_dlog(ctx, "process_work_frame() interpolate:%f/256\n", interpolate);
+ copy_src1 = s->srce[s->crnt];
+ if (interpolate > s->interp_end) {
+ ff_dlog(ctx, "process_work_frame() source is:NEXT\n");
+ copy_src1 = s->srce[s->next];
+ }
+ if (s->srce[s->prev] && interpolate < -s->interp_end) {
+ ff_dlog(ctx, "process_work_frame() source is:PREV\n");
+ copy_src1 = s->srce[s->prev];
+ }
+
+ // decide whether to blend two frames
+ if ((interpolate >= s->interp_start && interpolate <= s->interp_end) || (interpolate <= -s->interp_start && interpolate >= -s->interp_end)) {
+ AVFrame *copy_src2;
+
+ if (interpolate > 0) {
+ ff_dlog(ctx, "process_work_frame() interpolate source is:NEXT\n");
+ copy_src2 = s->srce[s->next];
+ } else {
+ ff_dlog(ctx, "process_work_frame() interpolate source is:PREV\n");
+ copy_src2 = s->srce[s->prev];
+ }
+ if (s->blend_frames(ctx, interpolate, copy_src1, copy_src2))
+ goto copy_done;
+ else
+ ff_dlog(ctx, "process_work_frame() CUT - DON'T INTERPOLATE\n");
+ }
+
+ ff_dlog(ctx, "process_work_frame() COPY to the work frame\n");
+ // copy the frame we decided is our base source
+ s->work = av_frame_clone(copy_src1);
+ if (!s->work)
+ return AVERROR(ENOMEM);
+
+copy_done:
+ s->work->pts = s->pts;
+
+ // should filter be re-using input frame (output frame rate is higher than input frame rate)
+ if (!s->flush && (work_next_pts + s->average_dest_pts_delta) < (s->srce_pts_dest[s->crnt] + s->average_srce_pts_dest_delta)) {
+ ff_dlog(ctx, "process_work_frame() REPEAT FRAME\n");
+ } else {
+ ff_dlog(ctx, "process_work_frame() CONSUME FRAME, move to next frame\n");
+ s->pending_srce_frames--;
+ next_source(ctx);
+ }
+ ff_dlog(ctx, "process_work_frame() output a frame\n");
+ s->dest_frame_num++;
+ if (stop)
+ s->pending_end_frame = 0;
+ s->last_dest_frame_pts = s->work->pts;
+
+ return ff_filter_frame(ctx->outputs[0], s->work);
+}
+
+static void set_srce_frame_dest_pts(AVFilterContext *ctx)
+{
+ FrameRateContext *s = ctx->priv;
+
+ ff_dlog(ctx, "set_srce_frame_output_pts()\n");
+
+ // scale the input pts from the timebase difference between input and output
+ if (s->srce[s->prev])
+ s->srce_pts_dest[s->prev] = av_rescale_q(s->srce[s->prev]->pts, s->srce_time_base, s->dest_time_base);
+ if (s->srce[s->crnt])
+ s->srce_pts_dest[s->crnt] = av_rescale_q(s->srce[s->crnt]->pts, s->srce_time_base, s->dest_time_base);
+ if (s->srce[s->next])
+ s->srce_pts_dest[s->next] = av_rescale_q(s->srce[s->next]->pts, s->srce_time_base, s->dest_time_base);
+}
+
+static void set_work_frame_pts(AVFilterContext *ctx)
+{
+ FrameRateContext *s = ctx->priv;
+ int64_t pts, average_srce_pts_delta = 0;
+
+ ff_dlog(ctx, "set_work_frame_pts()\n");
+
+ av_assert0(s->srce[s->next]);
+ av_assert0(s->srce[s->crnt]);
+
+ ff_dlog(ctx, "set_work_frame_pts() srce crnt pts:%"PRId64"\n", s->srce[s->crnt]->pts);
+ ff_dlog(ctx, "set_work_frame_pts() srce next pts:%"PRId64"\n", s->srce[s->next]->pts);
+ if (s->srce[s->prev])
+ ff_dlog(ctx, "set_work_frame_pts() srce prev pts:%"PRId64"\n", s->srce[s->prev]->pts);
+
+ average_srce_pts_delta = s->average_srce_pts_dest_delta;
+ ff_dlog(ctx, "set_work_frame_pts() initial average srce pts:%"PRId64"\n", average_srce_pts_delta);
+
+ set_srce_frame_dest_pts(ctx);
+
+ // calculate the PTS delta
+ if ((pts = (s->srce_pts_dest[s->next] - s->srce_pts_dest[s->crnt]))) {
+ average_srce_pts_delta = average_srce_pts_delta?((average_srce_pts_delta+pts)>>1):pts;
+ } else if (s->srce[s->prev] && (pts = (s->srce_pts_dest[s->crnt] - s->srce_pts_dest[s->prev]))) {
+ average_srce_pts_delta = average_srce_pts_delta?((average_srce_pts_delta+pts)>>1):pts;
+ }
+
+ s->average_srce_pts_dest_delta = average_srce_pts_delta;
+ ff_dlog(ctx, "set_work_frame_pts() average srce pts:%"PRId64"\n", average_srce_pts_delta);
+ ff_dlog(ctx, "set_work_frame_pts() average srce pts:%"PRId64" at dest time base:%u/%u\n",
+ s->average_srce_pts_dest_delta, s->dest_time_base.num, s->dest_time_base.den);
+
+ if (ctx->inputs[0] && !s->average_dest_pts_delta) {
+ int64_t d = av_q2d(av_inv_q(av_mul_q(s->dest_time_base, s->dest_frame_rate)));
+ s->average_dest_pts_delta = d;
+ ff_dlog(ctx, "set_work_frame_pts() average dest pts delta:%"PRId64"\n", s->average_dest_pts_delta);
+ }
+
+ if (!s->dest_frame_num) {
+ s->pts = s->last_dest_frame_pts = s->srce_pts_dest[s->crnt];
+ } else {
+ s->pts = s->last_dest_frame_pts + s->average_dest_pts_delta;
+ }
+
+ ff_dlog(ctx, "set_work_frame_pts() calculated pts:%"PRId64" at dest time base:%u/%u\n",
+ s->pts, s->dest_time_base.num, s->dest_time_base.den);
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ FrameRateContext *s = ctx->priv;
+
+ s->dest_frame_num = 0;
+
+ s->crnt = (N_SRCE)>>1;
+ s->last = N_SRCE - 1;
+
+ s->next = s->crnt - 1;
+ s->prev = s->crnt + 1;
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ FrameRateContext *s = ctx->priv;
+ int i;
+
+ for (i = s->frst + 1; i < s->last; i++) {
+ if (s->srce[i] && (s->srce[i] != s->srce[i + 1]))
+ av_frame_free(&s->srce[i]);
+ }
+ av_frame_free(&s->srce[s->last]);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12,
+ AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12,
+ AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ FrameRateContext *s = ctx->priv;
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
+ int plane;
+
+ for (plane = 0; plane < 4; plane++) {
+ s->line_size[plane] = av_image_get_linesize(inlink->format, inlink->w,
+ plane);
+ }
+
+ s->bitdepth = pix_desc->comp[0].depth;
+ s->vsub = pix_desc->log2_chroma_h;
+
+ s->sad = av_pixelutils_get_sad_fn(3, 3, 2, s); // 8x8 both sources aligned
+ if (!s->sad)
+ return AVERROR(EINVAL);
+
+ s->srce_time_base = inlink->time_base;
+
+ if (s->bitdepth == 8)
+ s->blend_frames = blend_frames8;
+ else
+ s->blend_frames = blend_frames16;
+ s->max = 1 << (s->bitdepth);
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
+{
+ AVFilterContext *ctx = inlink->dst;
+ FrameRateContext *s = ctx->priv;
+
+ // we have one new frame
+ s->pending_srce_frames++;
+
+ if (inpicref->interlaced_frame)
+ av_log(ctx, AV_LOG_WARNING, "Interlaced frame found - the output will not be correct.\n");
+
+ // store the pointer to the new frame
+ av_frame_free(&s->srce[s->frst]);
+ s->srce[s->frst] = inpicref;
+
+ if (!s->pending_end_frame && s->srce[s->crnt]) {
+ set_work_frame_pts(ctx);
+ s->pending_end_frame = 1;
+ } else {
+ set_srce_frame_dest_pts(ctx);
+ }
+
+ return process_work_frame(ctx, 1);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ FrameRateContext *s = ctx->priv;
+ int exact;
+
+ ff_dlog(ctx, "config_output()\n");
+
+ ff_dlog(ctx,
+ "config_output() input time base:%u/%u (%f)\n",
+ ctx->inputs[0]->time_base.num,ctx->inputs[0]->time_base.den,
+ av_q2d(ctx->inputs[0]->time_base));
+
+ // make sure timebase is small enough to hold the framerate
+
+ exact = av_reduce(&s->dest_time_base.num, &s->dest_time_base.den,
+ av_gcd((int64_t)s->srce_time_base.num * s->dest_frame_rate.num,
+ (int64_t)s->srce_time_base.den * s->dest_frame_rate.den ),
+ (int64_t)s->srce_time_base.den * s->dest_frame_rate.num, INT_MAX);
+
+ av_log(ctx, AV_LOG_INFO,
+ "time base:%u/%u -> %u/%u exact:%d\n",
+ s->srce_time_base.num, s->srce_time_base.den,
+ s->dest_time_base.num, s->dest_time_base.den, exact);
+ if (!exact) {
+ av_log(ctx, AV_LOG_WARNING, "Timebase conversion is not exact\n");
+ }
+
+ outlink->frame_rate = s->dest_frame_rate;
+ outlink->time_base = s->dest_time_base;
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+
+ ff_dlog(ctx,
+ "config_output() output time base:%u/%u (%f) w:%d h:%d\n",
+ outlink->time_base.num, outlink->time_base.den,
+ av_q2d(outlink->time_base),
+ outlink->w, outlink->h);
+
+
+ av_log(ctx, AV_LOG_INFO, "fps -> fps:%u/%u scene score:%f interpolate start:%d end:%d\n",
+ s->dest_frame_rate.num, s->dest_frame_rate.den,
+ s->scene_score, s->interp_start, s->interp_end);
+
+ return 0;
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ FrameRateContext *s = ctx->priv;
+ int val, i;
+
+ ff_dlog(ctx, "request_frame()\n");
+
+ // if there is no "next" frame AND we are not in flush then get one from our input filter
+ if (!s->srce[s->frst] && !s->flush) {
+ ff_dlog(ctx, "request_frame() call source's request_frame()\n");
+ val = ff_request_frame(outlink->src->inputs[0]);
+ if (val < 0 && (val != AVERROR_EOF)) {
+ ff_dlog(ctx, "request_frame() source's request_frame() returned error:%d\n", val);
+ return val;
+ } else if (val == AVERROR_EOF) {
+ s->flush = 1;
+ }
+ ff_dlog(ctx, "request_frame() source's request_frame() returned:%d\n", val);
+ return 0;
+ }
+
+ ff_dlog(ctx, "request_frame() REPEAT or FLUSH\n");
+
+ if (s->pending_srce_frames <= 0) {
+ ff_dlog(ctx, "request_frame() nothing else to do, return:EOF\n");
+ return AVERROR_EOF;
+ }
+
+ // otherwise, make brand-new frame and pass to our output filter
+ ff_dlog(ctx, "request_frame() FLUSH\n");
+
+ // back fill at end of file when source has no more frames
+ for (i = s->last; i > s->frst; i--) {
+ if (!s->srce[i - 1] && s->srce[i]) {
+ ff_dlog(ctx, "request_frame() copy:%d to:%d\n", i, i - 1);
+ s->srce[i - 1] = s->srce[i];
+ }
+ }
+
+ set_work_frame_pts(ctx);
+ return process_work_frame(ctx, 0);
+}
+
+static const AVFilterPad framerate_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_input,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad framerate_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_framerate = {
+ .name = "framerate",
+ .description = NULL_IF_CONFIG_SMALL("Upsamples or downsamples progressive source between specified frame rates."),
+ .priv_size = sizeof(FrameRateContext),
+ .priv_class = &framerate_class,
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .inputs = framerate_inputs,
+ .outputs = framerate_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_fspp.c b/chromium/third_party/ffmpeg/libavfilter/vf_fspp.c
index 7bdaa91b064..e346294eee1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_fspp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_fspp.c
@@ -48,7 +48,7 @@ static const AVOption fspp_options[] = {
{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 4}, 4, MAX_LEVEL, FLAGS },
{ "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
{ "strength", "set filter strength", OFFSET(strength), AV_OPT_TYPE_INT, {.i64 = 0}, -15, 32, FLAGS },
- { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
+ { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_BOOL,{.i64 = 0}, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_histeq.c b/chromium/third_party/ffmpeg/libavfilter/vf_histeq.c
index ce28afdad65..b3d2545b9f2 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_histeq.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_histeq.c
@@ -28,6 +28,7 @@
*/
#include "libavutil/common.h"
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
@@ -168,7 +169,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
#ifdef DEBUG
for (x = 0; x < 256; x++)
- av_dlog(ctx, "in[%d]: %u\n", x, histeq->in_histogram[x]);
+ ff_dlog(ctx, "in[%d]: %u\n", x, histeq->in_histogram[x]);
#endif
/* Calculate the lookup table. */
@@ -244,7 +245,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
}
#ifdef DEBUG
for (x = 0; x < 256; x++)
- av_dlog(ctx, "out[%d]: %u\n", x, histeq->out_histogram[x]);
+ ff_dlog(ctx, "out[%d]: %u\n", x, histeq->out_histogram[x]);
#endif
av_frame_free(&inpic);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_histogram.c b/chromium/third_party/ffmpeg/libavfilter/vf_histogram.c
index 31004b71dbf..d8e935a28eb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_histogram.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_histogram.c
@@ -22,6 +22,8 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
@@ -38,7 +40,9 @@ enum HistogramMode {
typedef struct HistogramContext {
const AVClass *class; ///< AVClass context for log and options purpose
int mode; ///< HistogramMode
- unsigned histogram[256];
+ unsigned histogram[256*256];
+ int histogram_size;
+ int mult;
int ncomp;
const uint8_t *bg_color;
const uint8_t *fg_color;
@@ -49,7 +53,10 @@ typedef struct HistogramContext {
int waveform_mirror;
int display_mode;
int levels_mode;
- const AVPixFmtDescriptor *desc;
+ const AVPixFmtDescriptor *desc, *odesc;
+ int components;
+ int planewidth[4];
+ int planeheight[4];
} HistogramContext;
#define OFFSET(x) offsetof(HistogramContext, x)
@@ -74,6 +81,7 @@ static const AVOption histogram_options[] = {
{ "levels_mode", "set levels mode", OFFSET(levels_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "levels_mode"},
{ "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "levels_mode" },
{ "logarithmic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "levels_mode" },
+ { "components", "set color components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=7}, 1, 15, FLAGS},
{ NULL }
};
@@ -84,9 +92,50 @@ static const enum AVPixelFormat color_pix_fmts[] = {
AV_PIX_FMT_NONE
};
-static const enum AVPixelFormat levels_pix_fmts[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_NONE
+static const enum AVPixelFormat levels_in_pix_fmts[] = {
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
+ AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
+ AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
+ AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_yuv8_pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_yuv9_pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUV444P9,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_yuv10_pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_rgb8_pix_fmts[] = {
+ AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_rgb9_pix_fmts[] = {
+ AV_PIX_FMT_GBRP9,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat levels_out_rgb10_pix_fmts[] = {
+ AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_NONE
};
static const enum AVPixelFormat waveform_pix_fmts[] = {
@@ -112,7 +161,46 @@ static int query_formats(AVFilterContext *ctx)
pix_fmts = waveform_pix_fmts;
break;
case MODE_LEVELS:
- pix_fmts = levels_pix_fmts;
+ {
+ AVFilterFormats *avff;
+ const AVPixFmtDescriptor *desc;
+ const enum AVPixelFormat *out_pix_fmts;
+ int rgb, i, bits;
+
+ if (!ctx->inputs[0]->in_formats ||
+ !ctx->inputs[0]->in_formats->nb_formats) {
+ return AVERROR(EAGAIN);
+ }
+
+ if (!ctx->inputs[0]->out_formats)
+ ff_formats_ref(ff_make_format_list(levels_in_pix_fmts), &ctx->inputs[0]->out_formats);
+ avff = ctx->inputs[0]->in_formats;
+ desc = av_pix_fmt_desc_get(avff->formats[0]);
+ rgb = desc->flags & AV_PIX_FMT_FLAG_RGB;
+ bits = desc->comp[0].depth;
+ for (i = 1; i < avff->nb_formats; i++) {
+ desc = av_pix_fmt_desc_get(avff->formats[i]);
+ if ((rgb != (desc->flags & AV_PIX_FMT_FLAG_RGB)) ||
+ (bits != desc->comp[0].depth))
+ return AVERROR(EAGAIN);
+ }
+
+ if (rgb && bits == 8)
+ out_pix_fmts = levels_out_rgb8_pix_fmts;
+ else if (rgb && bits == 9)
+ out_pix_fmts = levels_out_rgb9_pix_fmts;
+ else if (rgb && bits == 10)
+ out_pix_fmts = levels_out_rgb10_pix_fmts;
+ else if (bits == 8)
+ out_pix_fmts = levels_out_yuv8_pix_fmts;
+ else if (bits == 9)
+ out_pix_fmts = levels_out_yuv9_pix_fmts;
+ else // if (bits == 10)
+ out_pix_fmts = levels_out_yuv10_pix_fmts;
+ ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats);
+
+ return 0;
+ }
break;
case MODE_COLOR:
case MODE_COLOR2:
@@ -139,8 +227,12 @@ static int config_input(AVFilterLink *inlink)
h->desc = av_pix_fmt_desc_get(inlink->format);
h->ncomp = h->desc->nb_components;
+ h->histogram_size = 1 << h->desc->comp[0].depth;
+ h->mult = h->histogram_size / 256;
switch (inlink->format) {
+ case AV_PIX_FMT_GBRP10:
+ case AV_PIX_FMT_GBRP9:
case AV_PIX_FMT_GBRAP:
case AV_PIX_FMT_GBRP:
h->bg_color = black_gbrp_color;
@@ -151,6 +243,11 @@ static int config_input(AVFilterLink *inlink)
h->fg_color = white_yuva_color;
}
+ h->planeheight[1] = h->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, h->desc->log2_chroma_h);
+ h->planeheight[0] = h->planeheight[3] = inlink->h;
+ h->planewidth[1] = h->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, h->desc->log2_chroma_w);
+ h->planewidth[0] = h->planewidth[3] = inlink->w;
+
return 0;
}
@@ -158,13 +255,19 @@ static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
HistogramContext *h = ctx->priv;
+ int ncomp = 0, i;
switch (h->mode) {
case MODE_LEVELS:
- outlink->w = 256;
- outlink->h = (h->level_height + h->scale_height) * FFMAX(h->ncomp * h->display_mode, 1);
+ for (i = 0; i < h->ncomp; i++) {
+ if ((1 << i) & h->components)
+ ncomp++;
+ }
+ outlink->w = h->histogram_size;
+ outlink->h = (h->level_height + h->scale_height) * FFMAX(ncomp * h->display_mode, 1);
break;
case MODE_WAVEFORM:
+ av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, please use waveform filter instead.\n");
if (h->waveform_mode)
outlink->h = 256 * FFMAX(h->ncomp * h->display_mode, 1);
else
@@ -172,12 +275,14 @@ static int config_output(AVFilterLink *outlink)
break;
case MODE_COLOR:
case MODE_COLOR2:
+ av_log(ctx, AV_LOG_WARNING, "This mode is deprecated, use vectorscope filter instead.");
outlink->h = outlink->w = 256;
break;
default:
av_assert0(0);
}
+ h->odesc = av_pix_fmt_desc_get(outlink->format);
outlink->sample_aspect_ratio = (AVRational){1,1};
return 0;
@@ -236,9 +341,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out;
- const uint8_t *src;
uint8_t *dst;
- int i, j, k, l;
+ int i, j, k, l, m;
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
@@ -248,31 +352,56 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
out->pts = in->pts;
- for (k = 0; k < h->ncomp; k++) {
+ for (k = 0; k < 4 && out->data[k]; k++) {
const int is_chroma = (k == 1 || k == 2);
- const int dst_h = FF_CEIL_RSHIFT(outlink->h, (is_chroma ? h->desc->log2_chroma_h : 0));
- const int dst_w = FF_CEIL_RSHIFT(outlink->w, (is_chroma ? h->desc->log2_chroma_w : 0));
- for (i = 0; i < dst_h ; i++)
- memset(out->data[h->desc->comp[k].plane] +
- i * out->linesize[h->desc->comp[k].plane],
- h->bg_color[k], dst_w);
+ const int dst_h = FF_CEIL_RSHIFT(outlink->h, (is_chroma ? h->odesc->log2_chroma_h : 0));
+ const int dst_w = FF_CEIL_RSHIFT(outlink->w, (is_chroma ? h->odesc->log2_chroma_w : 0));
+
+ if (h->histogram_size <= 256) {
+ for (i = 0; i < dst_h ; i++)
+ memset(out->data[h->odesc->comp[k].plane] +
+ i * out->linesize[h->odesc->comp[k].plane],
+ h->bg_color[k], dst_w);
+ } else {
+ const int mult = h->mult;
+
+ for (i = 0; i < dst_h ; i++)
+ for (j = 0; j < dst_w; j++)
+ AV_WN16(out->data[h->odesc->comp[k].plane] +
+ i * out->linesize[h->odesc->comp[k].plane] + j * 2,
+ h->bg_color[k] * mult);
+ }
}
switch (h->mode) {
case MODE_LEVELS:
- for (k = 0; k < h->ncomp; k++) {
+ for (m = 0, k = 0; k < h->ncomp; k++) {
const int p = h->desc->comp[k].plane;
- const int start = k * (h->level_height + h->scale_height) * h->display_mode;
+ const int height = h->planeheight[p];
+ const int width = h->planewidth[p];
double max_hval_log;
unsigned max_hval = 0;
+ int start;
+
+ if (!((1 << k) & h->components))
+ continue;
+ start = m++ * (h->level_height + h->scale_height) * h->display_mode;
- for (i = 0; i < in->height; i++) {
- src = in->data[p] + i * in->linesize[p];
- for (j = 0; j < in->width; j++)
- h->histogram[src[j]]++;
+ if (h->histogram_size <= 256) {
+ for (i = 0; i < height; i++) {
+ const uint8_t *src = in->data[p] + i * in->linesize[p];
+ for (j = 0; j < width; j++)
+ h->histogram[src[j]]++;
+ }
+ } else {
+ for (i = 0; i < height; i++) {
+ const uint16_t *src = (const uint16_t *)(in->data[p] + i * in->linesize[p]);
+ for (j = 0; j < width; j++)
+ h->histogram[src[j]]++;
+ }
}
- for (i = 0; i < 256; i++)
+ for (i = 0; i < h->histogram_size; i++)
max_hval = FFMAX(max_hval, h->histogram[i]);
max_hval_log = log2(max_hval + 1);
@@ -284,19 +413,34 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
else
col_height = h->level_height - (h->histogram[i] * (int64_t)h->level_height + max_hval - 1) / max_hval;
- for (j = h->level_height - 1; j >= col_height; j--) {
- if (h->display_mode) {
- for (l = 0; l < h->ncomp; l++)
- out->data[l][(j + start) * out->linesize[l] + i] = h->fg_color[l];
- } else {
- out->data[p][(j + start) * out->linesize[p] + i] = 255;
+ if (h->histogram_size <= 256) {
+ for (j = h->level_height - 1; j >= col_height; j--) {
+ if (h->display_mode) {
+ for (l = 0; l < h->ncomp; l++)
+ out->data[l][(j + start) * out->linesize[l] + i] = h->fg_color[l];
+ } else {
+ out->data[p][(j + start) * out->linesize[p] + i] = 255;
+ }
+ }
+ for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
+ out->data[p][(j + start) * out->linesize[p] + i] = i;
+ } else {
+ const int mult = h->mult;
+
+ for (j = h->level_height - 1; j >= col_height; j--) {
+ if (h->display_mode) {
+ for (l = 0; l < h->ncomp; l++)
+ AV_WN16(out->data[l] + (j + start) * out->linesize[l] + i * 2, h->fg_color[l] * mult);
+ } else {
+ AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, 255 * mult);
+ }
}
+ for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
+ AV_WN16(out->data[p] + (j + start) * out->linesize[p] + i * 2, i);
}
- for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--)
- out->data[p][(j + start) * out->linesize[p] + i] = i;
}
- memset(h->histogram, 0, 256 * sizeof(unsigned));
+ memset(h->histogram, 0, h->histogram_size * sizeof(unsigned));
}
break;
case MODE_WAVEFORM:
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
index ffc1b255f59..6c76c5c1761 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_hqdn3d.c
@@ -269,7 +269,7 @@ static int config_input(AVFilterLink *inlink)
s->hsub = desc->log2_chroma_w;
s->vsub = desc->log2_chroma_h;
- s->depth = desc->comp[0].depth_minus1+1;
+ s->depth = desc->comp[0].depth;
s->line = av_malloc_array(inlink->w, sizeof(*s->line));
if (!s->line)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_idet.c b/chromium/third_party/ffmpeg/libavfilter/vf_idet.c
index eb1303a3100..711ba6e2185 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_idet.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_idet.c
@@ -275,7 +275,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
if (!idet->csp)
idet->csp = av_pix_fmt_desc_get(link->format);
- if (idet->csp->comp[0].depth_minus1 / 8 == 1){
+ if (idet->csp->comp[0].depth > 8){
idet->filter_line = (ff_idet_filter_func)ff_idet_filter_line_c_16bit;
if (ARCH_X86)
ff_idet_init_x86(idet, 1);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_il.c b/chromium/third_party/ffmpeg/libavfilter/vf_il.c
index edb58d03249..d370b5257a3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_il.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_il.c
@@ -70,12 +70,12 @@ static const AVOption il_options[] = {
{"i", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE}, 0, 0, FLAGS, "alpha_mode"},
{"deinterleave", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, "alpha_mode"},
{"d", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_DEINTERLEAVE}, 0, 0, FLAGS, "alpha_mode"},
- {"luma_swap", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
- {"ls", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
- {"chroma_swap", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
- {"cs", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
- {"alpha_swap", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
- {"as", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
+ {"luma_swap", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"ls", "swap luma fields", OFFSET(luma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"chroma_swap", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"cs", "swap chroma fields", OFFSET(chroma_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"alpha_swap", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"as", "swap alpha fields", OFFSET(alpha_swap), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{NULL}
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c b/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
index a520776f574..dcc94133a87 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_interlace.c
@@ -38,16 +38,16 @@
#include "video.h"
#define OFFSET(x) offsetof(InterlaceContext, x)
-#define V AV_OPT_FLAG_VIDEO_PARAM
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption interlace_options[] = {
{ "scan", "scanning mode", OFFSET(scan),
- AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = V, .unit = "scan" },
+ AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" },
{ "tff", "top field first", 0,
- AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
+ AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" },
{ "bff", "bottom field first", 0,
- AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
- { "lowpass", "enable vertical low-pass filter", OFFSET(lowpass),
- AV_OPT_TYPE_INT, {.i64 = 1 }, 0, 1, .flags = V },
+ AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" },
+ { "lowpass", "set vertical low-pass filter", OFFSET(lowpass),
+ AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, .flags = FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_kerndeint.c b/chromium/third_party/ffmpeg/libavfilter/vf_kerndeint.c
index 0e2417ad59c..d2ef070973f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_kerndeint.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_kerndeint.c
@@ -50,10 +50,10 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption kerndeint_options[] = {
{ "thresh", "set the threshold", OFFSET(thresh), AV_OPT_TYPE_INT, {.i64=10}, 0, 255, FLAGS },
- { "map", "set the map", OFFSET(map), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "order", "set the order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "sharp", "enable sharpening", OFFSET(sharp), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "twoway", "enable twoway", OFFSET(twoway), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
+ { "map", "set the map", OFFSET(map), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "order", "set the order", OFFSET(order), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "sharp", "set sharpening", OFFSET(sharp), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "twoway", "set twoway", OFFSET(twoway), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
index 93b18a82cb0..7d708f615b5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/attributes.h"
+#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
@@ -59,12 +60,13 @@ enum var_name {
typedef struct LutContext {
const AVClass *class;
- uint8_t lut[4][256]; ///< lookup table for each component
+ uint16_t lut[4][256 * 256]; ///< lookup table for each component
char *comp_expr_str[4];
AVExpr *comp_expr[4];
int hsub, vsub;
double var_values[VAR_VARS_NB];
int is_rgb, is_yuv;
+ int is_16bit;
int step;
int negate_alpha; /* only used by negate */
} LutContext;
@@ -112,7 +114,13 @@ static av_cold void uninit(AVFilterContext *ctx)
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, \
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, \
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \
- AV_PIX_FMT_YUVJ440P
+ AV_PIX_FMT_YUVJ440P, \
+ AV_PIX_FMT_YUV444P9LE, AV_PIX_FMT_YUV422P9LE, AV_PIX_FMT_YUV420P9LE, \
+ AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV440P10LE, \
+ AV_PIX_FMT_YUV444P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV440P12LE, \
+ AV_PIX_FMT_YUV444P14LE, AV_PIX_FMT_YUV422P14LE, AV_PIX_FMT_YUV420P14LE, \
+ AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV420P16LE, \
+ AV_PIX_FMT_YUVA444P16LE, AV_PIX_FMT_YUVA422P16LE, AV_PIX_FMT_YUVA420P16LE
#define RGB_FORMATS \
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, \
@@ -205,6 +213,7 @@ static int config_props(AVFilterLink *inlink)
s->var_values[VAR_W] = inlink->w;
s->var_values[VAR_H] = inlink->h;
+ s->is_16bit = desc->comp[0].depth > 8;
switch (inlink->format) {
case AV_PIX_FMT_YUV410P:
@@ -216,10 +225,40 @@ static int config_props(AVFilterLink *inlink)
case AV_PIX_FMT_YUVA420P:
case AV_PIX_FMT_YUVA422P:
case AV_PIX_FMT_YUVA444P:
- min[Y] = min[U] = min[V] = 16;
- max[Y] = 235;
- max[U] = max[V] = 240;
- min[A] = 0; max[A] = 255;
+ case AV_PIX_FMT_YUV420P9LE:
+ case AV_PIX_FMT_YUV422P9LE:
+ case AV_PIX_FMT_YUV444P9LE:
+ case AV_PIX_FMT_YUVA420P9LE:
+ case AV_PIX_FMT_YUVA422P9LE:
+ case AV_PIX_FMT_YUVA444P9LE:
+ case AV_PIX_FMT_YUV420P10LE:
+ case AV_PIX_FMT_YUV422P10LE:
+ case AV_PIX_FMT_YUV440P10LE:
+ case AV_PIX_FMT_YUV444P10LE:
+ case AV_PIX_FMT_YUVA420P10LE:
+ case AV_PIX_FMT_YUVA422P10LE:
+ case AV_PIX_FMT_YUVA444P10LE:
+ case AV_PIX_FMT_YUV420P12LE:
+ case AV_PIX_FMT_YUV422P12LE:
+ case AV_PIX_FMT_YUV440P12LE:
+ case AV_PIX_FMT_YUV444P12LE:
+ case AV_PIX_FMT_YUV420P14LE:
+ case AV_PIX_FMT_YUV422P14LE:
+ case AV_PIX_FMT_YUV444P14LE:
+ case AV_PIX_FMT_YUV420P16LE:
+ case AV_PIX_FMT_YUV422P16LE:
+ case AV_PIX_FMT_YUV444P16LE:
+ case AV_PIX_FMT_YUVA420P16LE:
+ case AV_PIX_FMT_YUVA422P16LE:
+ case AV_PIX_FMT_YUVA444P16LE:
+ min[Y] = 16 * (1 << (desc->comp[0].depth - 8));
+ min[U] = 16 * (1 << (desc->comp[1].depth - 8));
+ min[V] = 16 * (1 << (desc->comp[2].depth - 8));
+ min[A] = 0;
+ max[Y] = 235 * (1 << (desc->comp[0].depth - 8));
+ max[U] = 240 * (1 << (desc->comp[1].depth - 8));
+ max[V] = 240 * (1 << (desc->comp[2].depth - 8));
+ max[A] = (1 << desc->comp[3].depth) - 1;
break;
default:
min[0] = min[1] = min[2] = min[3] = 0;
@@ -255,7 +294,7 @@ static int config_props(AVFilterLink *inlink)
s->var_values[VAR_MAXVAL] = max[color];
s->var_values[VAR_MINVAL] = min[color];
- for (val = 0; val < 256; val++) {
+ for (val = 0; val < (1 << desc->comp[0].depth); val++) {
s->var_values[VAR_VAL] = val;
s->var_values[VAR_CLIPVAL] = av_clip(val, min[color], max[color]);
s->var_values[VAR_NEGVAL] =
@@ -283,7 +322,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
LutContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out;
- uint8_t *inrow, *outrow, *inrow0, *outrow0;
int i, j, plane, direct = 0;
if (av_frame_is_writable(in)) {
@@ -300,9 +338,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->is_rgb) {
/* packed */
+ uint8_t *inrow, *outrow, *inrow0, *outrow0;
const int w = inlink->w;
const int h = in->height;
- const uint8_t (*tab)[256] = (const uint8_t (*)[256])s->lut;
+ 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;
@@ -326,14 +365,44 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
inrow0 += in_linesize;
outrow0 += out_linesize;
}
+ } else if (s->is_16bit) {
+ // planar yuv >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 = FF_CEIL_RSHIFT(inlink->h, vsub);
+ int w = FF_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;
+ }
+ }
} else {
- /* planar */
+ /* 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 = FF_CEIL_RSHIFT(inlink->h, vsub);
int w = FF_CEIL_RSHIFT(inlink->w, hsub);
- const uint8_t *tab = s->lut[plane];
+ const uint16_t *tab = s->lut[plane];
const int in_linesize = in->linesize[plane];
const int out_linesize = out->linesize[plane];
@@ -434,7 +503,7 @@ DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input vid
#if CONFIG_NEGATE_FILTER
static const AVOption negate_options[] = {
- { "negate_alpha", NULL, OFFSET(negate_alpha), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+ { "negate_alpha", NULL, OFFSET(negate_alpha), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
index 5bdbb7983b7..2b8e0272b08 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
@@ -772,8 +772,8 @@ static av_cold void haldclut_uninit(AVFilterContext *ctx)
}
static const AVOption haldclut_options[] = {
- { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
- { "repeatlast", "continue applying the last clut after eos", OFFSET(dinput.repeatlast), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS },
+ { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
+ { "repeatlast", "continue applying the last clut after eos", OFFSET(dinput.repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
COMMON_OPTIONS
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_mcdeint.c b/chromium/third_party/ffmpeg/libavfilter/vf_mcdeint.c
index b0070d8253a..03daca53792 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_mcdeint.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_mcdeint.c
@@ -120,7 +120,7 @@ static int config_props(AVFilterLink *inlink)
enc_ctx->gop_size = INT_MAX;
enc_ctx->max_b_frames = 0;
enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
- enc_ctx->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY;
+ enc_ctx->flags = AV_CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY;
enc_ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
enc_ctx->global_quality = 1;
enc_ctx->me_cmp = enc_ctx->me_sub_cmp = FF_CMP_SAD;
@@ -134,10 +134,10 @@ static int config_props(AVFilterLink *inlink)
case MODE_SLOW:
enc_ctx->me_method = ME_ITER;
case MODE_MEDIUM:
- enc_ctx->flags |= CODEC_FLAG_4MV;
+ enc_ctx->flags |= AV_CODEC_FLAG_4MV;
enc_ctx->dia_size = 2;
case MODE_FAST:
- enc_ctx->flags |= CODEC_FLAG_QPEL;
+ enc_ctx->flags |= AV_CODEC_FLAG_QPEL;
}
ret = avcodec_open2(enc_ctx, enc, &opts);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c b/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
index c76e82a4198..ea796be10f7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_mergeplanes.c
@@ -46,7 +46,6 @@ typedef struct MergePlanesContext {
const AVPixFmtDescriptor *outdesc;
FFFrameSync fs;
- FFFrameSyncIn fsin[3]; /* must be immediately after fs */
} MergePlanesContext;
#define OFFSET(x) offsetof(MergePlanesContext, x)
@@ -122,7 +121,7 @@ static int query_formats(AVFilterContext *ctx)
s->outdesc = av_pix_fmt_desc_get(s->out_fmt);
for (i = 0; av_pix_fmt_desc_get(i); i++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
- if (desc->comp[0].depth_minus1 == s->outdesc->comp[0].depth_minus1 &&
+ if (desc->comp[0].depth == s->outdesc->comp[0].depth &&
av_pix_fmt_count_planes(i) == desc->nb_components)
ff_add_format(&formats, i);
}
@@ -174,9 +173,11 @@ static int config_output(AVFilterLink *outlink)
MergePlanesContext *s = ctx->priv;
InputParam inputsp[4];
FFFrameSyncIn *in;
- int i;
+ int i, ret;
+
+ if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
+ return ret;
- ff_framesync_init(&s->fs, ctx, s->nb_inputs);
in = s->fs.in;
s->fs.opaque = s;
s->fs.on_event = process_frame;
@@ -226,7 +227,7 @@ static int config_output(AVFilterLink *outlink)
inputp->nb_planes = av_pix_fmt_count_planes(inlink->format);
for (j = 0; j < inputp->nb_planes; j++)
- inputp->depth[j] = indesc->comp[j].depth_minus1 + 1;
+ inputp->depth[j] = indesc->comp[j].depth;
in[i].time_base = inlink->time_base;
in[i].sync = 1;
@@ -244,10 +245,10 @@ static int config_output(AVFilterLink *outlink)
input, plane);
goto fail;
}
- if (s->outdesc->comp[i].depth_minus1 + 1 != inputp->depth[plane]) {
+ if (s->outdesc->comp[i].depth != inputp->depth[plane]) {
av_log(ctx, AV_LOG_ERROR, "output plane %d depth %d does not "
"match input %d plane %d depth %d\n",
- i, s->outdesc->comp[i].depth_minus1 + 1,
+ i, s->outdesc->comp[i].depth,
input, plane, inputp->depth[plane]);
goto fail;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_mpdecimate.c b/chromium/third_party/ffmpeg/libavfilter/vf_mpdecimate.c
index 7cc32547ff5..25efacfeebd 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_mpdecimate.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_mpdecimate.c
@@ -168,9 +168,6 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA420P,
- AV_PIX_FMT_GRAY8A,
- AV_PIX_FMT_YA8,
-
AV_PIX_FMT_GBRP,
AV_PIX_FMT_YUVA444P,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_neighbor.c b/chromium/third_party/ffmpeg/libavfilter/vf_neighbor.c
new file mode 100644
index 00000000000..c3c7f749feb
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_neighbor.c
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)
+ * Copyright (c) 2015 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/imgutils.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct NContext {
+ const AVClass *class;
+ int planeheight[4];
+ int planewidth[4];
+ int nb_planes;
+ int threshold[4];
+ int coordinates;
+ uint8_t *buffer;
+
+ void (*filter)(uint8_t *dst, const uint8_t *p1, int width,
+ int threshold, const uint8_t *coordinates[], int coord);
+} NContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
+ };
+
+ ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ NContext *s = ctx->priv;
+
+ av_freep(&s->buffer);
+}
+
+static inline void line_copy8(uint8_t *line, const uint8_t *srcp, int width, int mergin)
+{
+ int i;
+
+ memcpy(line, srcp, width);
+
+ for (i = mergin; i > 0; i--) {
+ line[-i] = line[i];
+ line[width - 1 + i] = line[width - 1 - i];
+ }
+}
+
+static void erosion(uint8_t *dst, const uint8_t *p1, int width,
+ int threshold, const uint8_t *coordinates[], int coord)
+{
+ int x, i;
+
+ for (x = 0; x < width; x++) {
+ int min = p1[x];
+ int limit = FFMAX(min - threshold, 0);
+
+ for (i = 0; i < 8; i++) {
+ if (coord & (1 << i)) {
+ min = FFMIN(min, *(coordinates[i] + x));
+ }
+ min = FFMAX(min, limit);
+ }
+
+ dst[x] = min;
+ }
+}
+
+static void dilation(uint8_t *dst, const uint8_t *p1, int width,
+ int threshold, const uint8_t *coordinates[], int coord)
+{
+ int x, i;
+
+ for (x = 0; x < width; x++) {
+ int max = p1[x];
+ int limit = FFMIN(max + threshold, 255);
+
+ for (i = 0; i < 8; i++) {
+ if (coord & (1 << i)) {
+ max = FFMAX(max, *(coordinates[i] + x));
+ }
+ max = FFMIN(max, limit);
+ }
+
+ dst[x] = max;
+ }
+}
+
+static void deflate(uint8_t *dst, const uint8_t *p1, int width,
+ int threshold, const uint8_t *coordinates[], int coord)
+{
+ int x, i;
+
+ for (x = 0; x < width; x++) {
+ int sum = 0;
+ int limit = FFMAX(p1[x] - threshold, 0);
+
+ for (i = 0; i < 8; sum += *(coordinates[i++] + x));
+
+ dst[x] = FFMAX(FFMIN(sum / 8, p1[x]), limit);
+ }
+}
+
+static void inflate(uint8_t *dst, const uint8_t *p1, int width,
+ int threshold, const uint8_t *coordinates[], int coord)
+{
+ int x, i;
+
+ for (x = 0; x < width; x++) {
+ int sum = 0;
+ int limit = FFMIN(p1[x] + threshold, 255);
+
+ for (i = 0; i < 8; sum += *(coordinates[i++] + x));
+
+ dst[x] = FFMIN(FFMAX(sum / 8, p1[x]), limit);
+ }
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ NContext *s = ctx->priv;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ int ret;
+
+ if ((ret = av_image_fill_linesizes(s->planewidth, inlink->format, inlink->w)) < 0)
+ return ret;
+
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+
+ s->nb_planes = av_pix_fmt_count_planes(inlink->format);
+ s->buffer = av_malloc(3 * (s->planewidth[0] + 32));
+ if (!s->buffer)
+ return AVERROR(ENOMEM);
+
+ if (!strcmp(ctx->filter->name, "erosion"))
+ s->filter = erosion;
+ else if (!strcmp(ctx->filter->name, "dilation"))
+ s->filter = dilation;
+ else if (!strcmp(ctx->filter->name, "deflate"))
+ s->filter = deflate;
+ else if (!strcmp(ctx->filter->name, "inflate"))
+ s->filter = inflate;
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ NContext *s = ctx->priv;
+ AVFrame *out;
+ int plane, y;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+
+ for (plane = 0; plane < s->nb_planes; plane++) {
+ const int threshold = s->threshold[plane];
+
+ if (threshold) {
+ const uint8_t *src = in->data[plane];
+ uint8_t *dst = out->data[plane];
+ int stride = in->linesize[plane];
+ int height = s->planeheight[plane];
+ int width = s->planewidth[plane];
+ uint8_t *p0 = s->buffer + 16;
+ uint8_t *p1 = p0 + s->planewidth[0];
+ uint8_t *p2 = p1 + s->planewidth[0];
+ uint8_t *orig = p0, *end = p2;
+
+ line_copy8(p0, src + stride, width, 1);
+ line_copy8(p1, src, width, 1);
+
+ for (y = 0; y < height; y++) {
+ const uint8_t *coordinates[] = { p0 - 1, p0, p0 + 1,
+ p1 - 1, p1 + 1,
+ p2 - 1, p2, p2 + 1};
+ src += stride * (y < height - 1 ? 1 : -1);
+ line_copy8(p2, src, width, 1);
+
+ s->filter(dst, p1, width, threshold, coordinates, s->coordinates);
+
+ p0 = p1;
+ p1 = p2;
+ p2 = (p2 == end) ? orig: p2 + s->planewidth[0];
+ dst += out->linesize[plane];
+ }
+ } else {
+ av_image_copy_plane(out->data[plane], out->linesize[plane],
+ in->data[plane], in->linesize[plane],
+ s->planewidth[plane], s->planeheight[plane]);
+ }
+ }
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, out);
+}
+
+static const AVFilterPad neighbor_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad neighbor_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL }
+};
+
+#define OFFSET(x) offsetof(NContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+#define DEFINE_NEIGHBOR_FILTER(name_, description_) \
+AVFILTER_DEFINE_CLASS(name_); \
+ \
+AVFilter ff_vf_##name_ = { \
+ .name = #name_, \
+ .description = NULL_IF_CONFIG_SMALL(description_), \
+ .priv_size = sizeof(NContext), \
+ .priv_class = &name_##_class, \
+ .uninit = uninit, \
+ .query_formats = query_formats, \
+ .inputs = neighbor_inputs, \
+ .outputs = neighbor_outputs, \
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, \
+}
+
+#if CONFIG_EROSION_FILTER
+
+static const AVOption erosion_options[] = {
+ { "threshold0", "set threshold for 1st plane", OFFSET(threshold[0]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold1", "set threshold for 2nd plane", OFFSET(threshold[1]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold2", "set threshold for 3rd plane", OFFSET(threshold[2]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold3", "set threshold for 4th plane", OFFSET(threshold[3]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "coordinates", "set coordinates", OFFSET(coordinates), AV_OPT_TYPE_INT, {.i64=255}, 0, 255, FLAGS },
+ { NULL }
+};
+
+DEFINE_NEIGHBOR_FILTER(erosion, "Apply erosion effect");
+
+#endif /* CONFIG_EROSION_FILTER */
+
+#if CONFIG_DILATION_FILTER
+
+static const AVOption dilation_options[] = {
+ { "threshold0", "set threshold for 1st plane", OFFSET(threshold[0]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold1", "set threshold for 2nd plane", OFFSET(threshold[1]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold2", "set threshold for 3rd plane", OFFSET(threshold[2]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold3", "set threshold for 4th plane", OFFSET(threshold[3]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "coordinates", "set coordinates", OFFSET(coordinates), AV_OPT_TYPE_INT, {.i64=255}, 0, 255, FLAGS },
+ { NULL }
+};
+
+DEFINE_NEIGHBOR_FILTER(dilation, "Apply dilation effect");
+
+#endif /* CONFIG_DILATION_FILTER */
+
+#if CONFIG_DEFLATE_FILTER
+
+static const AVOption deflate_options[] = {
+ { "threshold0", "set threshold for 1st plane", OFFSET(threshold[0]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold1", "set threshold for 2nd plane", OFFSET(threshold[1]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold2", "set threshold for 3rd plane", OFFSET(threshold[2]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold3", "set threshold for 4th plane", OFFSET(threshold[3]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { NULL }
+};
+
+DEFINE_NEIGHBOR_FILTER(deflate, "Apply deflate effect");
+
+#endif /* CONFIG_DEFLATE_FILTER */
+
+#if CONFIG_INFLATE_FILTER
+
+static const AVOption inflate_options[] = {
+ { "threshold0", "set threshold for 1st plane", OFFSET(threshold[0]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold1", "set threshold for 2nd plane", OFFSET(threshold[1]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold2", "set threshold for 3rd plane", OFFSET(threshold[2]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { "threshold3", "set threshold for 4th plane", OFFSET(threshold[3]), AV_OPT_TYPE_INT, {.i64=65535}, 0, 65535, FLAGS },
+ { NULL }
+};
+
+DEFINE_NEIGHBOR_FILTER(inflate, "Apply inflate effect");
+
+#endif /* CONFIG_INFLATE_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_noise.c b/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
index 861ac090871..c658bba8c17 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_noise.c
@@ -137,7 +137,7 @@ 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_PLANAR && !((desc->comp[0].depth_minus1 + 1) & 7))
+ if (desc->flags & AV_PIX_FMT_FLAG_PLANAR && !(desc->comp[0].depth & 7))
ff_add_format(&formats, fmt);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c b/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c
new file mode 100644
index 00000000000..870dd688410
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2015 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 <tesseract/capi.h>
+
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+typedef struct OCRContext {
+ const AVClass *class;
+
+ char *datapath;
+ char *language;
+ char *whitelist;
+ char *blacklist;
+
+ TessBaseAPI *tess;
+} OCRContext;
+
+#define OFFSET(x) offsetof(OCRContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption ocr_options[] = {
+ { "datapath", "set datapath", OFFSET(datapath), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
+ { "language", "set language", OFFSET(language), AV_OPT_TYPE_STRING, {.str="eng"}, 0, 0, FLAGS },
+ { "whitelist", "set character whitelist", OFFSET(whitelist), AV_OPT_TYPE_STRING, {.str="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.:;,-+_!?\"'[]{}()<>|/\\=*&%$#@!~"}, 0, 0, FLAGS },
+ { "blacklist", "set character blacklist", OFFSET(blacklist), AV_OPT_TYPE_STRING, {.str=""}, 0, 0, FLAGS },
+ { NULL }
+};
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ OCRContext *s = ctx->priv;
+
+ s->tess = TessBaseAPICreate();
+ if (TessBaseAPIInit3(s->tess, s->datapath, s->language) == -1) {
+ av_log(ctx, AV_LOG_ERROR, "failed to init tesseract\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (!TessBaseAPISetVariable(s->tess, "tessedit_char_whitelist", s->whitelist)) {
+ av_log(ctx, AV_LOG_ERROR, "failed to set whitelist\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (!TessBaseAPISetVariable(s->tess, "tessedit_char_blacklist", s->blacklist)) {
+ av_log(ctx, AV_LOG_ERROR, "failed to set blacklist\n");
+ return AVERROR(EINVAL);
+ }
+
+ av_log(ctx, AV_LOG_DEBUG, "Tesseract version: %s\n", TessVersion());
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_GRAY8,
+ 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_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ ff_set_common_formats(ctx, fmts_list);
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVDictionary **metadata = avpriv_frame_get_metadatap(in);
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ OCRContext *s = ctx->priv;
+ char *result;
+
+ result = TessBaseAPIRect(s->tess, in->data[0], 1,
+ in->linesize[0], 0, 0, in->width, in->height);
+ av_dict_set(metadata, "lavfi.ocr.text", result, 0);
+ TessDeleteText(result);
+
+ return ff_filter_frame(outlink, in);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ OCRContext *s = ctx->priv;
+
+ TessBaseAPIEnd(s->tess);
+ TessBaseAPIDelete(s->tess);
+}
+
+AVFILTER_DEFINE_CLASS(ocr);
+
+static const AVFilterPad ocr_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad ocr_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_ocr = {
+ .name = "ocr",
+ .description = NULL_IF_CONFIG_SMALL("Optical Character Recognition."),
+ .priv_size = sizeof(OCRContext),
+ .priv_class = &ocr_class,
+ .query_formats = query_formats,
+ .init = init,
+ .uninit = uninit,
+ .inputs = ocr_inputs,
+ .outputs = ocr_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c b/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
index 788c1d94a21..81c9cc1665f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_overlay.c
@@ -638,14 +638,14 @@ static const AVOption overlay_options[] = {
{ "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_FRAME}, 0, EVAL_MODE_NB-1, FLAGS, "eval" },
{ "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
{ "frame", "eval expressions per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
- { "rgb", "force packed RGB in input and output (deprecated)", OFFSET(allow_packed_rgb), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+ { "rgb", "force packed RGB in input and output (deprecated)", OFFSET(allow_packed_rgb), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "shortest", "force termination when the shortest input terminates", OFFSET(dinput.shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "format", "set output format", OFFSET(format), AV_OPT_TYPE_INT, {.i64=OVERLAY_FORMAT_YUV420}, 0, OVERLAY_FORMAT_NB-1, FLAGS, "format" },
{ "yuv420", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV420}, .flags = FLAGS, .unit = "format" },
{ "yuv422", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422}, .flags = FLAGS, .unit = "format" },
{ "yuv444", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV444}, .flags = FLAGS, .unit = "format" },
{ "rgb", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_RGB}, .flags = FLAGS, .unit = "format" },
- { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(dinput.repeatlast), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(dinput.repeatlast), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_palettegen.c b/chromium/third_party/ffmpeg/libavfilter/vf_palettegen.c
index 4b49058b352..9e723377b78 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_palettegen.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_palettegen.c
@@ -24,6 +24,7 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"
#include "avfilter.h"
@@ -78,7 +79,7 @@ typedef struct {
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption palettegen_options[] = {
{ "max_colors", "set the maximum number of colors to use in the palette", OFFSET(max_colors), AV_OPT_TYPE_INT, {.i64=256}, 4, 256, FLAGS },
- { "reserve_transparent", "reserve a palette entry for transparency", OFFSET(reserve_transparent), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "reserve_transparent", "reserve a palette entry for transparency", OFFSET(reserve_transparent), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ "stats_mode", "set statistics mode", OFFSET(stats_mode), AV_OPT_TYPE_INT, {.i64=STATS_MODE_ALL_FRAMES}, 0, NB_STATS_MODE, FLAGS, "mode" },
{ "full", "compute full frame histograms", 0, AV_OPT_TYPE_CONST, {.i64=STATS_MODE_ALL_FRAMES}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "diff", "compute histograms only for the part that differs from previous frame", 0, AV_OPT_TYPE_CONST, {.i64=STATS_MODE_DIFF_FRAMES}, INT_MIN, INT_MAX, FLAGS, "mode" },
@@ -347,7 +348,7 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx)
if (rr >= gr && rr >= br) longest = 0;
if (gr >= rr && gr >= br) longest = 1; // prefer green again
- av_dlog(ctx, "box #%02X [%6d..%-6d] (%6d) w:%-6"PRIu64" ranges:[%2x %2x %2x] sort by %c (already sorted:%c) ",
+ ff_dlog(ctx, "box #%02X [%6d..%-6d] (%6d) w:%-6"PRIu64" ranges:[%2x %2x %2x] sort by %c (already sorted:%c) ",
box_id, box->start, box->start + box->len - 1, box->len, box_weight,
rr, gr, br, "rgb"[longest], box->sorted_by == longest ? 'y':'n');
@@ -368,7 +369,7 @@ static AVFrame *get_palette_frame(AVFilterContext *ctx)
if (box_weight > median)
break;
}
- av_dlog(ctx, "split @ i=%-6d with w=%-6"PRIu64" (target=%6"PRIu64")\n", i, box_weight, median);
+ ff_dlog(ctx, "split @ i=%-6d with w=%-6"PRIu64" (target=%6"PRIu64")\n", i, box_weight, median);
split_box(s, box, i);
box_id = get_next_box_id_to_split(s);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_paletteuse.c b/chromium/third_party/ffmpeg/libavfilter/vf_paletteuse.c
index 8835d8b21cf..f8350ac5856 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_paletteuse.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_paletteuse.c
@@ -24,6 +24,7 @@
*/
#include "libavutil/bprint.h"
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"
#include "dualinput.h"
@@ -119,8 +120,8 @@ static const AVOption paletteuse_options[] = {
{ "nns_iterative", "iterative search", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_NNS_ITERATIVE}, INT_MIN, INT_MAX, FLAGS, "search" },
{ "nns_recursive", "recursive search", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_NNS_RECURSIVE}, INT_MIN, INT_MAX, FLAGS, "search" },
{ "bruteforce", "brute-force into the palette", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_BRUTEFORCE}, INT_MIN, INT_MAX, FLAGS, "search" },
- { "mean_err", "compute and print mean error", OFFSET(calc_mean_err), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS },
- { "debug_accuracy", "test color search accuracy", OFFSET(debug_accuracy), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, 1, FLAGS },
+ { "mean_err", "compute and print mean error", OFFSET(calc_mean_err), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
+ { "debug_accuracy", "test color search accuracy", OFFSET(debug_accuracy), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};
@@ -875,7 +876,7 @@ static AVFrame *apply_palette(AVFilterLink *inlink, AVFrame *in)
return NULL;
}
- av_dlog(ctx, "%dx%d rect: (%d;%d) -> (%d,%d) [area:%dx%d]\n",
+ ff_dlog(ctx, "%dx%d rect: (%d;%d) -> (%d,%d) [area:%dx%d]\n",
w, h, x, y, x+w, y+h, in->width, in->height);
if (s->set_frame(s, out, in, x, y, w, h) < 0) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c b/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
index 406be881a6f..a01b2c12ce5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_psnr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Roger Pau Monné <roger.pau@entel.upc.edu>
+ * Copyright (c) 2011 Roger Pau Monné <roger.pau@entel.upc.edu>
* Copyright (c) 2011 Stefano Sabatini
* Copyright (c) 2013 Paul B Mahol
*
@@ -25,6 +25,7 @@
* Caculate the PSNR between two input videos.
*/
+#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
@@ -32,12 +33,13 @@
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
+#include "psnr.h"
#include "video.h"
typedef struct PSNRContext {
const AVClass *class;
FFDualInputContext dinput;
- double mse, min_mse, max_mse;
+ double mse, min_mse, max_mse, mse_comp[4];
uint64_t nb_frames;
FILE *stats_file;
char *stats_file_str;
@@ -48,11 +50,8 @@ typedef struct PSNRContext {
int nb_components;
int planewidth[4];
int planeheight[4];
-
- void (*compute_mse)(struct PSNRContext *s,
- const uint8_t *m[4], const int ml[4],
- const uint8_t *r[4], const int rl[4],
- int w, int h, double mse[4]);
+ double planeweight[4];
+ PSNRDSPContext dsp;
} PSNRContext;
#define OFFSET(x) offsetof(PSNRContext, x)
@@ -76,55 +75,48 @@ static inline double get_psnr(double mse, uint64_t nb_frames, int max)
return 10.0 * log(pow2(max) / (mse / nb_frames)) / log(10.0);
}
-static inline
-void compute_images_mse(PSNRContext *s,
- const uint8_t *main_data[4], const int main_linesizes[4],
- const uint8_t *ref_data[4], const int ref_linesizes[4],
- int w, int h, double mse[4])
+static uint64_t sse_line_8bit(const uint8_t *main_line, const uint8_t *ref_line, int outw)
{
- int i, c, j;
+ int j;
+ unsigned m2 = 0;
- for (c = 0; c < s->nb_components; c++) {
- const int outw = s->planewidth[c];
- const int outh = s->planeheight[c];
- const uint8_t *main_line = main_data[c];
- const uint8_t *ref_line = ref_data[c];
- const int ref_linesize = ref_linesizes[c];
- const int main_linesize = main_linesizes[c];
- uint64_t m = 0;
+ for (j = 0; j < outw; j++)
+ m2 += pow2(main_line[j] - ref_line[j]);
- for (i = 0; i < outh; i++) {
- int m2 = 0;
- for (j = 0; j < outw; j++)
- m2 += pow2(main_line[j] - ref_line[j]);
- m += m2;
- ref_line += ref_linesize;
- main_line += main_linesize;
- }
- mse[c] = m / (double)(outw * outh);
- }
+ return m2;
+}
+
+static uint64_t sse_line_16bit(const uint8_t *_main_line, const uint8_t *_ref_line, int outw)
+{
+ int j;
+ uint64_t m2 = 0;
+ const uint16_t *main_line = (const uint16_t *) _main_line;
+ const uint16_t *ref_line = (const uint16_t *) _ref_line;
+
+ for (j = 0; j < outw; j++)
+ m2 += pow2(main_line[j] - ref_line[j]);
+
+ return m2;
}
static inline
-void compute_images_mse_16bit(PSNRContext *s,
+void compute_images_mse(PSNRContext *s,
const uint8_t *main_data[4], const int main_linesizes[4],
const uint8_t *ref_data[4], const int ref_linesizes[4],
int w, int h, double mse[4])
{
- int i, c, j;
+ int i, c;
for (c = 0; c < s->nb_components; c++) {
const int outw = s->planewidth[c];
const int outh = s->planeheight[c];
- const uint16_t *main_line = (uint16_t *)main_data[c];
- const uint16_t *ref_line = (uint16_t *)ref_data[c];
- const int ref_linesize = ref_linesizes[c] / 2;
- const int main_linesize = main_linesizes[c] / 2;
+ const uint8_t *main_line = main_data[c];
+ const uint8_t *ref_line = ref_data[c];
+ const int ref_linesize = ref_linesizes[c];
+ const int main_linesize = main_linesizes[c];
uint64_t m = 0;
-
for (i = 0; i < outh; i++) {
- for (j = 0; j < outw; j++)
- m += pow2(main_line[j] - ref_line[j]);
+ m += s->dsp.sse_line(main_line, ref_line, outw);
ref_line += ref_linesize;
main_line += main_linesize;
}
@@ -153,27 +145,28 @@ static AVFrame *do_psnr(AVFilterContext *ctx, AVFrame *main,
int j, c;
AVDictionary **metadata = avpriv_frame_get_metadatap(main);
- s->compute_mse(s, (const uint8_t **)main->data, main->linesize,
- (const uint8_t **)ref->data, ref->linesize,
- main->width, main->height, comp_mse);
+ compute_images_mse(s, (const uint8_t **)main->data, main->linesize,
+ (const uint8_t **)ref->data, ref->linesize,
+ main->width, main->height, comp_mse);
for (j = 0; j < s->nb_components; j++)
- mse += comp_mse[j];
- mse /= s->nb_components;
+ mse += comp_mse[j] * s->planeweight[j];
s->min_mse = FFMIN(s->min_mse, mse);
s->max_mse = FFMAX(s->max_mse, mse);
s->mse += mse;
+ for (j = 0; j < s->nb_components; j++)
+ s->mse_comp[j] += comp_mse[j];
s->nb_frames++;
for (j = 0; j < s->nb_components; j++) {
c = s->is_rgb ? s->rgba_map[j] : j;
set_meta(metadata, "lavfi.psnr.mse.", s->comps[j], comp_mse[c]);
- set_meta(metadata, "lavfi.psnr.mse_avg", 0, mse);
set_meta(metadata, "lavfi.psnr.psnr.", s->comps[j], get_psnr(comp_mse[c], 1, s->max[c]));
- set_meta(metadata, "lavfi.psnr.psnr_avg", 0, get_psnr(mse, 1, s->average_max));
}
+ set_meta(metadata, "lavfi.psnr.mse_avg", 0, mse);
+ set_meta(metadata, "lavfi.psnr.psnr_avg", 0, get_psnr(mse, 1, s->average_max));
if (s->stats_file) {
fprintf(s->stats_file, "n:%"PRId64" mse_avg:%0.2f ", s->nb_frames, mse);
@@ -181,6 +174,7 @@ static AVFrame *do_psnr(AVFilterContext *ctx, AVFrame *main,
c = s->is_rgb ? s->rgba_map[j] : j;
fprintf(s->stats_file, "mse_%c:%0.2f ", s->comps[j], comp_mse[c]);
}
+ fprintf(s->stats_file, "psnr_avg:%0.2f ", get_psnr(mse, 1, s->average_max));
for (j = 0; j < s->nb_components; j++) {
c = s->is_rgb ? s->rgba_map[j] : j;
fprintf(s->stats_file, "psnr_%c:%0.2f ", s->comps[j],
@@ -243,6 +237,7 @@ static int config_input_ref(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
AVFilterContext *ctx = inlink->dst;
PSNRContext *s = ctx->priv;
+ unsigned sum;
int j;
s->nb_components = desc->nb_components;
@@ -256,33 +251,10 @@ static int config_input_ref(AVFilterLink *inlink)
return AVERROR(EINVAL);
}
- switch (inlink->format) {
- case AV_PIX_FMT_GRAY8:
- case AV_PIX_FMT_GRAY16:
- case AV_PIX_FMT_GBRP:
- case AV_PIX_FMT_GBRP9:
- case AV_PIX_FMT_GBRP10:
- case AV_PIX_FMT_GBRP12:
- case AV_PIX_FMT_GBRP14:
- case AV_PIX_FMT_GBRP16:
- case AV_PIX_FMT_GBRAP:
- case AV_PIX_FMT_GBRAP16:
- case AV_PIX_FMT_YUVJ411P:
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ440P:
- case AV_PIX_FMT_YUVJ444P:
- s->max[0] = (1 << (desc->comp[0].depth_minus1 + 1)) - 1;
- s->max[1] = (1 << (desc->comp[1].depth_minus1 + 1)) - 1;
- s->max[2] = (1 << (desc->comp[2].depth_minus1 + 1)) - 1;
- s->max[3] = (1 << (desc->comp[3].depth_minus1 + 1)) - 1;
- break;
- default:
- s->max[0] = 235 * (1 << (desc->comp[0].depth_minus1 - 7));
- s->max[1] = 240 * (1 << (desc->comp[1].depth_minus1 - 7));
- s->max[2] = 240 * (1 << (desc->comp[2].depth_minus1 - 7));
- s->max[3] = (1 << (desc->comp[3].depth_minus1 + 1)) - 1;
- }
+ s->max[0] = (1 << desc->comp[0].depth) - 1;
+ s->max[1] = (1 << desc->comp[1].depth) - 1;
+ s->max[2] = (1 << desc->comp[2].depth) - 1;
+ s->max[3] = (1 << desc->comp[3].depth) - 1;
s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0;
s->comps[0] = s->is_rgb ? 'r' : 'y' ;
@@ -290,16 +262,21 @@ static int config_input_ref(AVFilterLink *inlink)
s->comps[2] = s->is_rgb ? 'b' : 'v' ;
s->comps[3] = 'a';
- for (j = 0; j < s->nb_components; j++)
- s->average_max += s->max[j];
- s->average_max /= s->nb_components;
-
s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[0] = s->planewidth[3] = inlink->w;
+ sum = 0;
+ for (j = 0; j < s->nb_components; j++)
+ sum += s->planeheight[j] * s->planewidth[j];
+ for (j = 0; j < s->nb_components; j++) {
+ s->planeweight[j] = (double) s->planeheight[j] * s->planewidth[j] / sum;
+ s->average_max += s->max[j] * s->planeweight[j];
+ }
- s->compute_mse = desc->comp[0].depth_minus1 > 7 ? compute_images_mse_16bit : compute_images_mse;
+ s->dsp.sse_line = desc->comp[0].depth > 8 ? sse_line_16bit : sse_line_8bit;
+ if (ARCH_X86)
+ ff_psnr_init_x86(&s->dsp, desc->comp[0].depth);
return 0;
}
@@ -339,7 +316,17 @@ static av_cold void uninit(AVFilterContext *ctx)
PSNRContext *s = ctx->priv;
if (s->nb_frames > 0) {
- av_log(ctx, AV_LOG_INFO, "PSNR average:%0.2f min:%0.2f max:%0.2f\n",
+ int j;
+ char buf[256];
+
+ buf[0] = 0;
+ for (j = 0; j < s->nb_components; j++) {
+ int c = s->is_rgb ? s->rgba_map[j] : j;
+ av_strlcatf(buf, sizeof(buf), " %c:%0.2f", s->comps[j],
+ get_psnr(s->mse_comp[c], s->nb_frames, s->max[c]));
+ }
+ av_log(ctx, AV_LOG_INFO, "PSNR%s average:%0.2f min:%0.2f max:%0.2f\n",
+ buf,
get_psnr(s->mse, s->nb_frames, s->average_max),
get_psnr(s->max_mse, 1, s->average_max),
get_psnr(s->min_mse, 1, s->average_max));
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_random.c b/chromium/third_party/ffmpeg/libavfilter/vf_random.c
new file mode 100644
index 00000000000..663fafc24d0
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_random.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2015 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/lfg.h"
+#include "libavutil/opt.h"
+#include "libavutil/random_seed.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+#define MAX_FRAMES 512
+
+typedef struct RandomContext {
+ const AVClass *class;
+
+ AVLFG lfg;
+ int nb_frames;
+ int64_t random_seed;
+ int nb_frames_filled;
+ AVFrame *frames[MAX_FRAMES];
+ int64_t pts[MAX_FRAMES];
+ int flush_idx;
+} RandomContext;
+
+#define OFFSET(x) offsetof(RandomContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption random_options[] = {
+ { "frames", "set number of frames in cache", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.i64=30}, 2, MAX_FRAMES, FLAGS },
+ { "seed", "set the seed", OFFSET(random_seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT32_MAX, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(random);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ RandomContext *s = ctx->priv;
+ uint32_t seed;
+
+ if (s->random_seed < 0)
+ s->random_seed = av_get_random_seed();
+ seed = s->random_seed;
+ av_lfg_init(&s->lfg, seed);
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ RandomContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *out;
+ int idx;
+
+ if (s->nb_frames_filled < s->nb_frames) {
+ s->frames[s->nb_frames_filled] = in;
+ s->pts[s->nb_frames_filled++] = in->pts;
+ return 0;
+ }
+
+ idx = av_lfg_get(&s->lfg) % s->nb_frames;
+
+ out = s->frames[idx];
+ out->pts = s->pts[0];
+ memmove(&s->pts[0], &s->pts[1], (s->nb_frames - 1) * sizeof(s->pts[0]));
+ s->frames[idx] = in;
+ s->pts[s->nb_frames - 1] = in->pts;
+
+ return ff_filter_frame(outlink, out);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ RandomContext *s = ctx->priv;
+ int ret;
+
+ ret = ff_request_frame(ctx->inputs[0]);
+
+ if (ret == AVERROR_EOF && !ctx->is_disabled && s->nb_frames > 0) {
+ AVFrame *out = s->frames[s->nb_frames - 1];
+ out->pts = s->pts[s->flush_idx++];
+ ret = ff_filter_frame(outlink, out);
+ s->frames[s->nb_frames - 1] = NULL;
+ s->nb_frames--;
+ }
+
+ return ret;
+}
+
+static const AVFilterPad random_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad random_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_random = {
+ .name = "random",
+ .description = NULL_IF_CONFIG_SMALL("Return random frames."),
+ .priv_size = sizeof(RandomContext),
+ .priv_class = &random_class,
+ .init = init,
+ .inputs = random_inputs,
+ .outputs = random_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_removegrain.c b/chromium/third_party/ffmpeg/libavfilter/vf_removegrain.c
new file mode 100644
index 00000000000..da17f6a5add
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_removegrain.c
@@ -0,0 +1,660 @@
+/*
+ * Copyright (c) 2012 Laurent de Soras
+ * Copyright (c) 2013 Fredrik Mellbin
+ * Copyright (c) 2015 Paul B Mahol
+ * Copyright (c) 2015 James Darnley
+ *
+ * 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/imgutils.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "removegrain.h"
+#include "video.h"
+
+#define OFFSET(x) offsetof(RemoveGrainContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption removegrain_options[] = {
+ { "m0", "set mode for 1st plane", OFFSET(mode[0]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
+ { "m1", "set mode for 2nd plane", OFFSET(mode[1]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
+ { "m2", "set mode for 3rd plane", OFFSET(mode[2]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
+ { "m3", "set mode for 4th plane", OFFSET(mode[3]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
+ {NULL}
+};
+
+AVFILTER_DEFINE_CLASS(removegrain);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+#define REMOVE_GRAIN_SORT_AXIS \
+ const int ma1 = FFMAX(a1, a8); \
+ const int mi1 = FFMIN(a1, a8); \
+ const int ma2 = FFMAX(a2, a7); \
+ const int mi2 = FFMIN(a2, a7); \
+ const int ma3 = FFMAX(a3, a6); \
+ const int mi3 = FFMIN(a3, a6); \
+ const int ma4 = FFMAX(a4, a5); \
+ const int mi4 = FFMIN(a4, a5);
+
+static int mode01(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int mi = FFMIN(FFMIN(FFMIN(a1, a2), FFMIN(a3, a4)), FFMIN(FFMIN(a5, a6), FFMIN(a7, a8)));
+ const int ma = FFMAX(FFMAX(FFMAX(a1, a2), FFMAX(a3, a4)), FFMAX(FFMAX(a5, a6), FFMAX(a7, a8)));
+
+ return av_clip(c, mi, ma);
+}
+
+static int cmp_int(const void *p1, const void *p2)
+{
+ int left = *(const int *)p1;
+ int right = *(const int *)p2;
+
+ return ((left > right) - (left < right));
+}
+
+static int mode02(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ int a[8] = { a1, a2, a3, a4, a5, a6, a7, a8 };
+
+ qsort(&a, 8, sizeof(a[0]), cmp_int);
+
+ return av_clip(c, a[2 - 1 ], a[7 - 1]);
+}
+
+static int mode03(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ int a[8] = { a1, a2, a3, a4, a5, a6, a7, a8 };
+
+ qsort(&a, 8, sizeof(a[0]), cmp_int);
+
+ return av_clip(c, a[3 - 1 ], a[6 - 1]);
+}
+
+static int mode04(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ int a[8] = { a1, a2, a3, a4, a5, a6, a7, a8 };
+
+ qsort(&a, 8, sizeof(a[0]), cmp_int);
+
+ return av_clip(c, a[4 - 1 ], a[5 - 1]);
+}
+
+static int mode05(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int c1 = FFABS(c - av_clip(c, mi1, ma1));
+ const int c2 = FFABS(c - av_clip(c, mi2, ma2));
+ const int c3 = FFABS(c - av_clip(c, mi3, ma3));
+ const int c4 = FFABS(c - av_clip(c, mi4, ma4));
+
+ const int mindiff = FFMIN(FFMIN(c1, c2), FFMIN(c3, c4));
+
+ /* When adding SIMD notice the return order here: 4, 2, 3, 1. */
+ if (mindiff == c4) {
+ return av_clip(c, mi4, ma4);
+ } else if (mindiff == c2) {
+ return av_clip(c, mi2, ma2);
+ } else if (mindiff == c3) {
+ return av_clip(c, mi3, ma3);
+ }
+
+ return av_clip(c, mi1, ma1);
+}
+
+static int mode06(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int d1 = ma1 - mi1;
+ const int d2 = ma2 - mi2;
+ const int d3 = ma3 - mi3;
+ const int d4 = ma4 - mi4;
+
+ const int cli1 = av_clip(c, mi1, ma1);
+ const int cli2 = av_clip(c, mi2, ma2);
+ const int cli3 = av_clip(c, mi3, ma3);
+ const int cli4 = av_clip(c, mi4, ma4);
+
+ const int c1 = av_clip_uint16((FFABS(c - cli1) << 1) + d1);
+ const int c2 = av_clip_uint16((FFABS(c - cli2) << 1) + d2);
+ const int c3 = av_clip_uint16((FFABS(c - cli3) << 1) + d3);
+ const int c4 = av_clip_uint16((FFABS(c - cli4) << 1) + d4);
+
+ const int mindiff = FFMIN(FFMIN(c1, c2), FFMIN(c3, c4));
+
+ if (mindiff == c4) {
+ return cli4;
+ } else if (mindiff == c2) {
+ return cli2;
+ } else if (mindiff == c3) {
+ return cli3;
+ }
+
+ return cli1;
+}
+
+static int mode07(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int d1 = ma1 - mi1;
+ const int d2 = ma2 - mi2;
+ const int d3 = ma3 - mi3;
+ const int d4 = ma4 - mi4;
+
+ const int cli1 = av_clip(c, mi1, ma1);
+ const int cli2 = av_clip(c, mi2, ma2);
+ const int cli3 = av_clip(c, mi3, ma3);
+ const int cli4 = av_clip(c, mi4, ma4);
+
+ const int c1 = FFABS(c - cli1) + d1;
+ const int c2 = FFABS(c - cli2) + d2;
+ const int c3 = FFABS(c - cli3) + d3;
+ const int c4 = FFABS(c - cli4) + d4;
+
+ const int mindiff = FFMIN(FFMIN(c1, c2), FFMIN(c3, c4));
+
+ if (mindiff == c4) {
+ return cli4;
+ } else if (mindiff == c2) {
+ return cli2;
+ } else if (mindiff == c3) {
+ return cli3;
+ }
+
+ return cli1;
+}
+
+static int mode08(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int d1 = ma1 - mi1;
+ const int d2 = ma2 - mi2;
+ const int d3 = ma3 - mi3;
+ const int d4 = ma4 - mi4;
+
+ const int cli1 = av_clip(c, mi1, ma1);
+ const int cli2 = av_clip(c, mi2, ma2);
+ const int cli3 = av_clip(c, mi3, ma3);
+ const int cli4 = av_clip(c, mi4, ma4);
+
+ const int c1 = av_clip_uint16(FFABS(c - cli1) + (d1 << 1));
+ const int c2 = av_clip_uint16(FFABS(c - cli2) + (d2 << 1));
+ const int c3 = av_clip_uint16(FFABS(c - cli3) + (d3 << 1));
+ const int c4 = av_clip_uint16(FFABS(c - cli4) + (d4 << 1));
+
+ const int mindiff = FFMIN(FFMIN(c1, c2), FFMIN(c3, c4));
+
+ if (mindiff == c4) {
+ return cli4;
+ } else if (mindiff == c2) {
+ return cli2;
+ } else if (mindiff == c3) {
+ return cli3;
+ }
+
+ return cli1;
+}
+
+static int mode09(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int d1 = ma1 - mi1;
+ const int d2 = ma2 - mi2;
+ const int d3 = ma3 - mi3;
+ const int d4 = ma4 - mi4;
+
+ const int mindiff = FFMIN(FFMIN(d1, d2), FFMIN(d3, d4));
+
+ if (mindiff == d4) {
+ return av_clip(c, mi4, ma4);
+ } else if (mindiff == d2) {
+ return av_clip(c, mi2, ma2);
+ } else if (mindiff == d3) {
+ return av_clip(c, mi3, ma3);
+ }
+
+ return av_clip(c, mi1, ma1);
+}
+
+static int mode10(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int d1 = FFABS(c - a1);
+ const int d2 = FFABS(c - a2);
+ const int d3 = FFABS(c - a3);
+ const int d4 = FFABS(c - a4);
+ const int d5 = FFABS(c - a5);
+ const int d6 = FFABS(c - a6);
+ const int d7 = FFABS(c - a7);
+ const int d8 = FFABS(c - a8);
+
+ const int mindiff = FFMIN(FFMIN(FFMIN(d1, d2), FFMIN(d3, d4)),
+ FFMIN(FFMIN(d5, d6), FFMIN(d7, d8)));
+
+ if (mindiff == d7) return a7;
+ if (mindiff == d8) return a8;
+ if (mindiff == d6) return a6;
+ if (mindiff == d2) return a2;
+ if (mindiff == d3) return a3;
+ if (mindiff == d1) return a1;
+ if (mindiff == d5) return a5;
+
+ return a4;
+}
+
+static int mode1112(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int sum = 4 * c + 2 * (a2 + a4 + a5 + a7) + a1 + a3 + a6 + a8;
+ const int val = (sum + 8) >> 4;
+
+ return val;
+}
+
+static int mode1314(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int d1 = FFABS(a1 - a8);
+ const int d2 = FFABS(a2 - a7);
+ const int d3 = FFABS(a3 - a6);
+
+ const int mindiff = FFMIN(FFMIN(d1, d2), d3);
+
+ if (mindiff == d2) {
+ return (a2 + a7 + 1) >> 1;
+ }
+ if (mindiff == d3) {
+ return (a3 + a6 + 1) >> 1;
+ }
+
+ return (a1 + a8 + 1) >> 1;
+}
+
+static int mode1516(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int d1 = FFABS(a1 - a8);
+ const int d2 = FFABS(a2 - a7);
+ const int d3 = FFABS(a3 - a6);
+
+ const int mindiff = FFMIN(FFMIN(d1, d2), d3);
+ const int average = (2 * (a2 + a7) + a1 + a3 + a6 + a8 + 4) >> 3;
+
+ if (mindiff == d2) {
+ return av_clip(average, FFMIN(a2, a7), FFMAX(a2, a7));
+ }
+ if (mindiff == d3) {
+ return av_clip(average, FFMIN(a3, a6), FFMAX(a3, a6));
+ }
+
+ return av_clip(average, FFMIN(a1, a8), FFMAX(a1, a8));
+}
+
+static int mode17(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int l = FFMAX(FFMAX(mi1, mi2), FFMAX(mi3, mi4));
+ const int u = FFMIN(FFMIN(ma1, ma2), FFMIN(ma3, ma4));
+
+ return av_clip(c, FFMIN(l, u), FFMAX(l, u));
+}
+
+static int mode18(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int d1 = FFMAX(FFABS(c - a1), FFABS(c - a8));
+ const int d2 = FFMAX(FFABS(c - a2), FFABS(c - a7));
+ const int d3 = FFMAX(FFABS(c - a3), FFABS(c - a6));
+ const int d4 = FFMAX(FFABS(c - a4), FFABS(c - a5));
+
+ const int mindiff = FFMIN(FFMIN(d1, d2), FFMIN(d3, d4));
+
+ if (mindiff == d4) {
+ return av_clip(c, FFMIN(a4, a5), FFMAX(a4, a5));
+ }
+ if (mindiff == d2) {
+ return av_clip(c, FFMIN(a2, a7), FFMAX(a2, a7));
+ }
+ if (mindiff == d3) {
+ return av_clip(c, FFMIN(a3, a6), FFMAX(a3, a6));
+ }
+
+ return av_clip(c, FFMIN(a1, a8), FFMAX(a1, a8));
+}
+
+static int mode19(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int sum = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
+ const int val = (sum + 4) >> 3;
+
+ return val;
+}
+
+static int mode20(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int sum = a1 + a2 + a3 + a4 + c + a5 + a6 + a7 + a8;
+ const int val = (sum + 4) / 9;
+
+ return val;
+}
+
+static int mode21(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int l1l = (a1 + a8) >> 1;
+ const int l2l = (a2 + a7) >> 1;
+ const int l3l = (a3 + a6) >> 1;
+ const int l4l = (a4 + a5) >> 1;
+
+ const int l1h = (a1 + a8 + 1) >> 1;
+ const int l2h = (a2 + a7 + 1) >> 1;
+ const int l3h = (a3 + a6 + 1) >> 1;
+ const int l4h = (a4 + a5 + 1) >> 1;
+
+ const int mi = FFMIN(FFMIN(l1l, l2l), FFMIN(l3l, l4l));
+ const int ma = FFMAX(FFMAX(l1h, l2h), FFMAX(l3h, l4h));
+
+ return av_clip(c, mi, ma);
+}
+
+static int mode22(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ const int l1 = (a1 + a8 + 1) >> 1;
+ const int l2 = (a2 + a7 + 1) >> 1;
+ const int l3 = (a3 + a6 + 1) >> 1;
+ const int l4 = (a4 + a5 + 1) >> 1;
+
+ const int mi = FFMIN(FFMIN(l1, l2), FFMIN(l3, l4));
+ const int ma = FFMAX(FFMAX(l1, l2), FFMAX(l3, l4));
+
+ return av_clip(c, mi, ma);
+}
+
+static int mode23(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int linediff1 = ma1 - mi1;
+ const int linediff2 = ma2 - mi2;
+ const int linediff3 = ma3 - mi3;
+ const int linediff4 = ma4 - mi4;
+
+ const int u1 = FFMIN(c - ma1, linediff1);
+ const int u2 = FFMIN(c - ma2, linediff2);
+ const int u3 = FFMIN(c - ma3, linediff3);
+ const int u4 = FFMIN(c - ma4, linediff4);
+ const int u = FFMAX(FFMAX(FFMAX(u1, u2), FFMAX(u3, u4)), 0);
+
+ const int d1 = FFMIN(mi1 - c, linediff1);
+ const int d2 = FFMIN(mi2 - c, linediff2);
+ const int d3 = FFMIN(mi3 - c, linediff3);
+ const int d4 = FFMIN(mi4 - c, linediff4);
+ const int d = FFMAX(FFMAX(FFMAX(d1, d2), FFMAX(d3, d4)), 0);
+
+ return c - u + d; // This probably will never overflow.
+}
+
+static int mode24(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ REMOVE_GRAIN_SORT_AXIS
+
+ const int linediff1 = ma1 - mi1;
+ const int linediff2 = ma2 - mi2;
+ const int linediff3 = ma3 - mi3;
+ const int linediff4 = ma4 - mi4;
+
+ const int tu1 = c - ma1;
+ const int tu2 = c - ma2;
+ const int tu3 = c - ma3;
+ const int tu4 = c - ma4;
+
+ const int u1 = FFMIN(tu1, linediff1 - tu1);
+ const int u2 = FFMIN(tu2, linediff2 - tu2);
+ const int u3 = FFMIN(tu3, linediff3 - tu3);
+ const int u4 = FFMIN(tu4, linediff4 - tu4);
+ const int u = FFMAX(FFMAX(FFMAX(u1, u2), FFMAX(u3, u4)), 0);
+
+ const int td1 = mi1 - c;
+ const int td2 = mi2 - c;
+ const int td3 = mi3 - c;
+ const int td4 = mi4 - c;
+
+ const int d1 = FFMIN(td1, linediff1 - td1);
+ const int d2 = FFMIN(td2, linediff2 - td2);
+ const int d3 = FFMIN(td3, linediff3 - td3);
+ const int d4 = FFMIN(td4, linediff4 - td4);
+ const int d = FFMAX(FFMAX(FFMAX(d1, d2), FFMAX(d3, d4)), 0);
+
+ return c - u + d; // This probably will never overflow.
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ RemoveGrainContext *s = inlink->dst->priv;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ int i;
+
+ s->nb_planes = av_pix_fmt_count_planes(inlink->format);
+
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ s->planewidth[0] = s->planewidth[3] = inlink->w;
+
+ for (i = 0; i < s->nb_planes; i++) {
+ switch (s->mode[i]) {
+ case 1: s->rg[i] = mode01; break;
+ case 2: s->rg[i] = mode02; break;
+ case 3: s->rg[i] = mode03; break;
+ case 4: s->rg[i] = mode04; break;
+ case 5: s->rg[i] = mode05; break;
+ case 6: s->rg[i] = mode06; break;
+ case 7: s->rg[i] = mode07; break;
+ case 8: s->rg[i] = mode08; break;
+ case 9: s->rg[i] = mode09; break;
+ case 10: s->rg[i] = mode10; break;
+ case 11: s->rg[i] = mode1112; break;
+ case 12: s->rg[i] = mode1112; break;
+ case 13: s->skip_odd = 1;
+ s->rg[i] = mode1314; break;
+ case 14: s->skip_even = 1;
+ s->rg[i] = mode1314; break;
+ case 15: s->skip_odd = 1;
+ s->rg[i] = mode1516; break;
+ case 16: s->skip_even = 1;
+ s->rg[i] = mode1516; break;
+ case 17: s->rg[i] = mode17; break;
+ case 18: s->rg[i] = mode18; break;
+ case 19: s->rg[i] = mode19; break;
+ case 20: s->rg[i] = mode20; break;
+ case 21: s->rg[i] = mode21; break;
+ case 22: s->rg[i] = mode22; break;
+ case 23: s->rg[i] = mode23; break;
+ case 24: s->rg[i] = mode24; break;
+ }
+ }
+
+ if (ARCH_X86)
+ ff_removegrain_init_x86(s);
+
+ return 0;
+}
+
+typedef struct ThreadData {
+ AVFrame *in, *out;
+ int plane;
+} ThreadData;
+
+static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ RemoveGrainContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ const int i = td->plane;
+ const int height = s->planeheight[i];
+ const int om = in->linesize[i] - 1;
+ const int o0 = in->linesize[i] ;
+ const int op = in->linesize[i] + 1;
+ int start = (height * jobnr ) / nb_jobs;
+ int end = (height * (jobnr+1)) / nb_jobs;
+ int x, y;
+
+ start = FFMAX(1, start);
+ end = FFMIN(height-1, end);
+ for (y = start; y < end; y++) {
+ uint8_t *dst = out->data[i];
+ uint8_t *src = in->data[i];
+
+ src = in->data[i] + y * in->linesize[i];
+ dst = out->data[i] + y * out->linesize[i];
+
+ if (s->skip_even && !(y & 1)) {
+ memcpy(dst, src, s->planewidth[i]);
+ continue;
+ }
+ if (s->skip_odd && y & 1) {
+ memcpy(dst, src, s->planewidth[i]);
+ continue;
+ }
+
+ *dst++ = *src++;
+
+ if (s->fl[i]) {
+ int w_asm = (s->planewidth[i] - 2) & ~15;
+
+ s->fl[i](dst, src, in->linesize[i], w_asm);
+
+ x = 1 + w_asm;
+ dst += w_asm;
+ src += w_asm;
+ } else
+ x = 1;
+
+ for (; x < s->planewidth[i] - 1; x++) {
+ const int a1 = src[-op];
+ const int a2 = src[-o0];
+ const int a3 = src[-om];
+ const int a4 = src[-1 ];
+ const int c = src[ 0 ];
+ const int a5 = src[ 1 ];
+ const int a6 = src[ om];
+ const int a7 = src[ o0];
+ const int a8 = src[ op];
+
+ const int res = s->rg[i](c, a1, a2, a3, a4, a5, a6, a7, a8);
+
+ *dst = res;
+ dst++, src++;
+ }
+ dst[0] = src[0];
+ }
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ RemoveGrainContext *s = ctx->priv;
+ ThreadData td;
+ AVFrame *out;
+ int i;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+
+ for (i = 0; i < s->nb_planes; i++) {
+ uint8_t *dst = out->data[i];
+ uint8_t *src = in->data[i];
+
+ if (s->mode[i] == 0) {
+ av_image_copy_plane(dst, out->linesize[i],
+ src, in->linesize[i],
+ s->planewidth[i], s->planeheight[i]);
+ continue;
+ }
+
+ memcpy(dst, src, s->planewidth[i]);
+
+ td.in = in; td.out = out; td.plane = i;
+ ctx->internal->execute(ctx, filter_slice, &td, NULL,
+ FFMIN(s->planeheight[i], ctx->graph->nb_threads));
+
+ src = in->data[i] + (s->planeheight[i] - 1) * in->linesize[i];
+ dst = out->data[i] + (s->planeheight[i] - 1) * out->linesize[i];
+ memcpy(dst, src, s->planewidth[i]);
+ }
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, out);
+}
+
+static const AVFilterPad removegrain_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad removegrain_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_removegrain = {
+ .name = "removegrain",
+ .description = NULL_IF_CONFIG_SMALL("Remove grain."),
+ .priv_size = sizeof(RemoveGrainContext),
+ .query_formats = query_formats,
+ .inputs = removegrain_inputs,
+ .outputs = removegrain_outputs,
+ .priv_class = &removegrain_class,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c b/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
index 46ab796c7ad..f12a103bf96 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_rotate.c
@@ -101,7 +101,7 @@ static const AVOption rotate_options[] = {
{ "oh", "set output height expression", OFFSET(outh_expr_str), AV_OPT_TYPE_STRING, {.str="ih"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
{ "fillcolor", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
{ "c", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, .flags=FLAGS },
- { "bilinear", "use bilinear interpolation", OFFSET(use_bilinear), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, .flags=FLAGS },
+ { "bilinear", "use bilinear interpolation", OFFSET(use_bilinear), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, .flags=FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_sab.c b/chromium/third_party/ffmpeg/libavfilter/vf_sab.c
index da594396524..6b88c862818 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_sab.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_sab.c
@@ -107,24 +107,24 @@ AVFILTER_DEFINE_CLASS(sab);
static av_cold int init(AVFilterContext *ctx)
{
- SabContext *sab = ctx->priv;
+ SabContext *s = ctx->priv;
/* make chroma default to luma values, if not explicitly set */
- if (sab->chroma.radius < RADIUS_MIN)
- sab->chroma.radius = sab->luma.radius;
- if (sab->chroma.pre_filter_radius < PRE_FILTER_RADIUS_MIN)
- sab->chroma.pre_filter_radius = sab->luma.pre_filter_radius;
- if (sab->chroma.strength < STRENGTH_MIN)
- sab->chroma.strength = sab->luma.strength;
+ if (s->chroma.radius < RADIUS_MIN)
+ s->chroma.radius = s->luma.radius;
+ if (s->chroma.pre_filter_radius < PRE_FILTER_RADIUS_MIN)
+ s->chroma.pre_filter_radius = s->luma.pre_filter_radius;
+ if (s->chroma.strength < STRENGTH_MIN)
+ s->chroma.strength = s->luma.strength;
- sab->luma.quality = sab->chroma.quality = 3.0;
- sab->sws_flags = SWS_POINT;
+ s->luma.quality = s->chroma.quality = 3.0;
+ s->sws_flags = SWS_POINT;
av_log(ctx, AV_LOG_VERBOSE,
"luma_radius:%f luma_pre_filter_radius::%f luma_strength:%f "
"chroma_radius:%f chroma_pre_filter_radius:%f chroma_strength:%f\n",
- sab->luma .radius, sab->luma .pre_filter_radius, sab->luma .strength,
- sab->chroma.radius, sab->chroma.pre_filter_radius, sab->chroma.strength);
+ s->luma .radius, s->luma .pre_filter_radius, s->luma .strength,
+ s->chroma.radius, s->chroma.pre_filter_radius, s->chroma.strength);
return 0;
}
@@ -140,10 +140,10 @@ static void close_filter_param(FilterParam *f)
static av_cold void uninit(AVFilterContext *ctx)
{
- SabContext *sab = ctx->priv;
+ SabContext *s = ctx->priv;
- close_filter_param(&sab->luma);
- close_filter_param(&sab->chroma);
+ close_filter_param(&s->luma);
+ close_filter_param(&s->chroma);
}
static int open_filter_param(FilterParam *f, int width, int height, unsigned int sws_flags)
@@ -200,22 +200,22 @@ static int open_filter_param(FilterParam *f, int width, int height, unsigned int
static int config_props(AVFilterLink *inlink)
{
- SabContext *sab = inlink->dst->priv;
+ SabContext *s = inlink->dst->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
int ret;
- sab->hsub = desc->log2_chroma_w;
- sab->vsub = desc->log2_chroma_h;
+ s->hsub = desc->log2_chroma_w;
+ s->vsub = desc->log2_chroma_h;
- close_filter_param(&sab->luma);
- ret = open_filter_param(&sab->luma, inlink->w, inlink->h, sab->sws_flags);
+ close_filter_param(&s->luma);
+ ret = open_filter_param(&s->luma, inlink->w, inlink->h, s->sws_flags);
if (ret < 0)
return ret;
- close_filter_param(&sab->chroma);
- ret = open_filter_param(&sab->chroma,
- FF_CEIL_RSHIFT(inlink->w, sab->hsub),
- FF_CEIL_RSHIFT(inlink->h, sab->vsub), sab->sws_flags);
+ close_filter_param(&s->chroma);
+ ret = open_filter_param(&s->chroma,
+ FF_CEIL_RSHIFT(inlink->w, s->hsub),
+ FF_CEIL_RSHIFT(inlink->h, s->vsub), s->sws_flags);
return ret;
}
@@ -281,7 +281,7 @@ static void blur(uint8_t *dst, const int dst_linesize,
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
{
- SabContext *sab = inlink->dst->priv;
+ SabContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *outpic;
@@ -293,12 +293,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
av_frame_copy_props(outpic, inpic);
blur(outpic->data[0], outpic->linesize[0], inpic->data[0], inpic->linesize[0],
- inlink->w, inlink->h, &sab->luma);
+ inlink->w, inlink->h, &s->luma);
if (inpic->data[2]) {
- int cw = FF_CEIL_RSHIFT(inlink->w, sab->hsub);
- int ch = FF_CEIL_RSHIFT(inlink->h, sab->vsub);
- blur(outpic->data[1], outpic->linesize[1], inpic->data[1], inpic->linesize[1], cw, ch, &sab->chroma);
- blur(outpic->data[2], outpic->linesize[2], inpic->data[2], inpic->linesize[2], cw, ch, &sab->chroma);
+ int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub);
+ int ch = FF_CEIL_RSHIFT(inlink->h, s->vsub);
+ blur(outpic->data[1], outpic->linesize[1], inpic->data[1], inpic->linesize[1], cw, ch, &s->chroma);
+ blur(outpic->data[2], outpic->linesize[2], inpic->data[2], inpic->linesize[2], cw, ch, &s->chroma);
}
av_frame_free(&inpic);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
index 2a3d00808db..a40b392c653 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
@@ -86,6 +86,7 @@ typedef struct ScaleContext {
int w, h;
char *size_str;
unsigned int flags; ///sws flags
+ double param[2]; // sws params
int hsub, vsub; ///< chroma subsampling
int slice_y; ///< top of current output slice
@@ -111,6 +112,8 @@ typedef struct ScaleContext {
int force_original_aspect_ratio;
} ScaleContext;
+AVFilter ff_vf_scale2ref;
+
static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts)
{
ScaleContext *scale = ctx->priv;
@@ -234,7 +237,10 @@ static const int *parse_yuv_type(const char *s, enum AVColorSpace colorspace)
static int config_props(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- AVFilterLink *inlink = outlink->src->inputs[0];
+ AVFilterLink *inlink0 = outlink->src->inputs[0];
+ AVFilterLink *inlink = ctx->filter == &ff_vf_scale2ref ?
+ outlink->src->inputs[1] :
+ outlink->src->inputs[0];
enum AVPixelFormat outfmt = outlink->format;
ScaleContext *scale = ctx->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
@@ -343,8 +349,11 @@ static int config_props(AVFilterLink *outlink)
if (scale->isws[1])
sws_freeContext(scale->isws[1]);
scale->isws[0] = scale->isws[1] = scale->sws = NULL;
- if (inlink->w == outlink->w && inlink->h == outlink->h &&
- inlink->format == outlink->format)
+ if (inlink0->w == outlink->w &&
+ inlink0->h == outlink->h &&
+ !scale->out_color_matrix &&
+ scale->in_range == scale->out_range &&
+ inlink0->format == outlink->format)
;
else {
struct SwsContext **swscs[3] = {&scale->sws, &scale->isws[0], &scale->isws[1]};
@@ -356,27 +365,33 @@ static int config_props(AVFilterLink *outlink)
if (!*s)
return AVERROR(ENOMEM);
+ av_opt_set_int(*s, "srcw", inlink0 ->w, 0);
+ av_opt_set_int(*s, "srch", inlink0 ->h >> !!i, 0);
+ av_opt_set_int(*s, "src_format", inlink0->format, 0);
+ av_opt_set_int(*s, "dstw", outlink->w, 0);
+ av_opt_set_int(*s, "dsth", outlink->h >> !!i, 0);
+ av_opt_set_int(*s, "dst_format", outfmt, 0);
+ av_opt_set_int(*s, "sws_flags", scale->flags, 0);
+ av_opt_set_int(*s, "param0", scale->param[0], 0);
+ av_opt_set_int(*s, "param1", scale->param[1], 0);
+ if (scale->in_range != AVCOL_RANGE_UNSPECIFIED)
+ av_opt_set_int(*s, "src_range",
+ scale->in_range == AVCOL_RANGE_JPEG, 0);
+ if (scale->out_range != AVCOL_RANGE_UNSPECIFIED)
+ av_opt_set_int(*s, "dst_range",
+ scale->out_range == AVCOL_RANGE_JPEG, 0);
+
if (scale->opts) {
AVDictionaryEntry *e = NULL;
-
while ((e = av_dict_get(scale->opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
if ((ret = av_opt_set(*s, e->key, e->value, 0)) < 0)
return ret;
}
}
-
- av_opt_set_int(*s, "srcw", inlink ->w, 0);
- av_opt_set_int(*s, "srch", inlink ->h >> !!i, 0);
- av_opt_set_int(*s, "src_format", inlink->format, 0);
- av_opt_set_int(*s, "dstw", outlink->w, 0);
- av_opt_set_int(*s, "dsth", outlink->h >> !!i, 0);
- av_opt_set_int(*s, "dst_format", outfmt, 0);
- av_opt_set_int(*s, "sws_flags", scale->flags, 0);
-
/* Override YUV420P settings to have the correct (MPEG-2) chroma positions
* MPEG-2 chroma positions are used by convention
* XXX: support other 4:2:0 pixel formats */
- if (inlink->format == AV_PIX_FMT_YUV420P) {
+ if (inlink0->format == AV_PIX_FMT_YUV420P) {
scale->in_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192;
}
@@ -417,6 +432,28 @@ fail:
return ret;
}
+static int config_props_ref(AVFilterLink *outlink)
+{
+ AVFilterLink *inlink = outlink->src->inputs[1];
+
+ outlink->w = inlink->w;
+ outlink->h = inlink->h;
+ outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
+ outlink->time_base = inlink->time_base;
+
+ return 0;
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ return ff_request_frame(outlink->src->inputs[0]);
+}
+
+static int request_frame_ref(AVFilterLink *outlink)
+{
+ return ff_request_frame(outlink->src->inputs[1]);
+}
+
static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)
{
ScaleContext *scale = link->dst->priv;
@@ -507,6 +544,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
inv_table = parse_yuv_type(scale->in_color_matrix, av_frame_get_colorspace(in));
if (scale->out_color_matrix)
table = parse_yuv_type(scale->out_color_matrix, AVCOL_SPC_UNSPECIFIED);
+ else if (scale->in_color_matrix)
+ table = inv_table;
if (scale-> in_range != AVCOL_RANGE_UNSPECIFIED)
in_full = (scale-> in_range == AVCOL_RANGE_JPEG);
@@ -544,6 +583,37 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
return ff_filter_frame(outlink, out);
}
+static int filter_frame_ref(AVFilterLink *link, AVFrame *in)
+{
+ AVFilterLink *outlink = link->dst->outputs[1];
+
+ return ff_filter_frame(outlink, in);
+}
+
+static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
+ char *res, int res_len, int flags)
+{
+ ScaleContext *scale = ctx->priv;
+ int ret;
+
+ if ( !strcmp(cmd, "width") || !strcmp(cmd, "w")
+ || !strcmp(cmd, "height") || !strcmp(cmd, "h")) {
+
+ int old_w = scale->w;
+ int old_h = scale->h;
+ AVFilterLink *outlink = ctx->outputs[0];
+
+ av_opt_set(scale, cmd, args, 0);
+ if ((ret = config_props(outlink)) < 0) {
+ scale->w = old_w;
+ scale->h = old_h;
+ }
+ } else
+ ret = AVERROR(ENOSYS);
+
+ return ret;
+}
+
static const AVClass *child_class_next(const AVClass *prev)
{
return prev ? NULL : sws_get_class();
@@ -579,6 +649,8 @@ static const AVOption scale_options[] = {
{ "disable", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "force_oar" },
{ "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "force_oar" },
{ "increase", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 0, FLAGS, "force_oar" },
+ { "param0", "Scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS },
+ { "param1", "Scaler param 1", OFFSET(param[1]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS },
{ NULL }
};
@@ -610,13 +682,66 @@ static const AVFilterPad avfilter_vf_scale_outputs[] = {
};
AVFilter ff_vf_scale = {
- .name = "scale",
- .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format."),
- .init_dict = init_dict,
- .uninit = uninit,
- .query_formats = query_formats,
- .priv_size = sizeof(ScaleContext),
- .priv_class = &scale_class,
- .inputs = avfilter_vf_scale_inputs,
- .outputs = avfilter_vf_scale_outputs,
+ .name = "scale",
+ .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format."),
+ .init_dict = init_dict,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(ScaleContext),
+ .priv_class = &scale_class,
+ .inputs = avfilter_vf_scale_inputs,
+ .outputs = avfilter_vf_scale_outputs,
+ .process_command = process_command,
+};
+
+static const AVClass scale2ref_class = {
+ .class_name = "scale2ref",
+ .item_name = av_default_item_name,
+ .option = scale_options,
+ .version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_FILTER,
+ .child_class_next = child_class_next,
+};
+
+static const AVFilterPad avfilter_vf_scale2ref_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },
+ {
+ .name = "ref",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame_ref,
+ },
+ { NULL }
+};
+
+static const AVFilterPad avfilter_vf_scale2ref_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_props,
+ .request_frame= request_frame,
+ },
+ {
+ .name = "ref",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_props_ref,
+ .request_frame= request_frame_ref,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_scale2ref = {
+ .name = "scale2ref",
+ .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format to the given reference."),
+ .init_dict = init_dict,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(ScaleContext),
+ .priv_class = &scale2ref_class,
+ .inputs = avfilter_vf_scale2ref_inputs,
+ .outputs = avfilter_vf_scale2ref_outputs,
+ .process_command = process_command,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c b/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
index 42ce6829723..3ea5eb67d7f 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
@@ -30,10 +30,10 @@ typedef struct {
static int config_props_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- SeparateFieldsContext *sf = ctx->priv;
+ SeparateFieldsContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
- sf->nb_planes = av_pix_fmt_count_planes(inlink->format);
+ s->nb_planes = av_pix_fmt_count_planes(inlink->format);
if (inlink->h & 1) {
av_log(ctx, AV_LOG_ERROR, "height must be even\n");
@@ -64,19 +64,19 @@ static void extract_field(AVFrame *frame, int nb_planes, int type)
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
{
AVFilterContext *ctx = inlink->dst;
- SeparateFieldsContext *sf = ctx->priv;
+ SeparateFieldsContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int ret;
inpicref->height = outlink->h;
inpicref->interlaced_frame = 0;
- if (!sf->second) {
+ if (!s->second) {
goto clone;
} else {
- AVFrame *second = sf->second;
+ AVFrame *second = s->second;
- extract_field(second, sf->nb_planes, second->top_field_first);
+ extract_field(second, s->nb_planes, second->top_field_first);
if (second->pts != AV_NOPTS_VALUE &&
inpicref->pts != AV_NOPTS_VALUE)
@@ -88,12 +88,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
if (ret < 0)
return ret;
clone:
- sf->second = av_frame_clone(inpicref);
- if (!sf->second)
+ s->second = av_frame_clone(inpicref);
+ if (!s->second)
return AVERROR(ENOMEM);
}
- extract_field(inpicref, sf->nb_planes, !inpicref->top_field_first);
+ extract_field(inpicref, s->nb_planes, !inpicref->top_field_first);
if (inpicref->pts != AV_NOPTS_VALUE)
inpicref->pts *= 2;
@@ -104,15 +104,15 @@ clone:
static int request_frame(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- SeparateFieldsContext *sf = ctx->priv;
+ SeparateFieldsContext *s = ctx->priv;
int ret;
ret = ff_request_frame(ctx->inputs[0]);
- if (ret == AVERROR_EOF && sf->second) {
- sf->second->pts *= 2;
- extract_field(sf->second, sf->nb_planes, sf->second->top_field_first);
- ret = ff_filter_frame(outlink, sf->second);
- sf->second = 0;
+ if (ret == AVERROR_EOF && s->second) {
+ s->second->pts *= 2;
+ extract_field(s->second, s->nb_planes, s->second->top_field_first);
+ ret = ff_filter_frame(outlink, s->second);
+ s->second = 0;
}
return ret;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c b/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c
index 80085cd712a..45698ecbd68 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_shuffleplanes.c
@@ -134,12 +134,7 @@ static const AVOption shuffleplanes_options[] = {
{ NULL },
};
-static const AVClass shuffleplanes_class = {
- .class_name = "shuffleplanes",
- .item_name = av_default_item_name,
- .option = shuffleplanes_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(shuffleplanes);
static const AVFilterPad shuffleplanes_inputs[] = {
{
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_smartblur.c b/chromium/third_party/ffmpeg/libavfilter/vf_smartblur.c
index 169f540b15a..c3b12d9e407 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_smartblur.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_smartblur.c
@@ -84,34 +84,34 @@ AVFILTER_DEFINE_CLASS(smartblur);
static av_cold int init(AVFilterContext *ctx)
{
- SmartblurContext *sblur = ctx->priv;
+ SmartblurContext *s = ctx->priv;
/* make chroma default to luma values, if not explicitly set */
- if (sblur->chroma.radius < RADIUS_MIN)
- sblur->chroma.radius = sblur->luma.radius;
- if (sblur->chroma.strength < STRENGTH_MIN)
- sblur->chroma.strength = sblur->luma.strength;
- if (sblur->chroma.threshold < THRESHOLD_MIN)
- sblur->chroma.threshold = sblur->luma.threshold;
+ if (s->chroma.radius < RADIUS_MIN)
+ s->chroma.radius = s->luma.radius;
+ if (s->chroma.strength < STRENGTH_MIN)
+ s->chroma.strength = s->luma.strength;
+ if (s->chroma.threshold < THRESHOLD_MIN)
+ s->chroma.threshold = s->luma.threshold;
- sblur->luma.quality = sblur->chroma.quality = 3.0;
- sblur->sws_flags = SWS_BICUBIC;
+ s->luma.quality = s->chroma.quality = 3.0;
+ s->sws_flags = SWS_BICUBIC;
av_log(ctx, AV_LOG_VERBOSE,
"luma_radius:%f luma_strength:%f luma_threshold:%d "
"chroma_radius:%f chroma_strength:%f chroma_threshold:%d\n",
- sblur->luma.radius, sblur->luma.strength, sblur->luma.threshold,
- sblur->chroma.radius, sblur->chroma.strength, sblur->chroma.threshold);
+ s->luma.radius, s->luma.strength, s->luma.threshold,
+ s->chroma.radius, s->chroma.strength, s->chroma.threshold);
return 0;
}
static av_cold void uninit(AVFilterContext *ctx)
{
- SmartblurContext *sblur = ctx->priv;
+ SmartblurContext *s = ctx->priv;
- sws_freeContext(sblur->luma.filter_context);
- sws_freeContext(sblur->chroma.filter_context);
+ sws_freeContext(s->luma.filter_context);
+ sws_freeContext(s->chroma.filter_context);
}
static int query_formats(AVFilterContext *ctx)
@@ -159,17 +159,17 @@ static int alloc_sws_context(FilterParam *f, int width, int height, unsigned int
static int config_props(AVFilterLink *inlink)
{
- SmartblurContext *sblur = inlink->dst->priv;
+ SmartblurContext *s = inlink->dst->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- sblur->hsub = desc->log2_chroma_w;
- sblur->vsub = desc->log2_chroma_h;
+ s->hsub = desc->log2_chroma_w;
+ s->vsub = desc->log2_chroma_h;
- alloc_sws_context(&sblur->luma, inlink->w, inlink->h, sblur->sws_flags);
- alloc_sws_context(&sblur->chroma,
- FF_CEIL_RSHIFT(inlink->w, sblur->hsub),
- FF_CEIL_RSHIFT(inlink->h, sblur->vsub),
- sblur->sws_flags);
+ alloc_sws_context(&s->luma, inlink->w, inlink->h, s->sws_flags);
+ alloc_sws_context(&s->chroma,
+ FF_CEIL_RSHIFT(inlink->w, s->hsub),
+ FF_CEIL_RSHIFT(inlink->h, s->vsub),
+ s->sws_flags);
return 0;
}
@@ -240,11 +240,11 @@ static void blur(uint8_t *dst, const int dst_linesize,
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
{
- SmartblurContext *sblur = inlink->dst->priv;
+ SmartblurContext *s = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *outpic;
- int cw = FF_CEIL_RSHIFT(inlink->w, sblur->hsub);
- int ch = FF_CEIL_RSHIFT(inlink->h, sblur->vsub);
+ int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub);
+ int ch = FF_CEIL_RSHIFT(inlink->h, s->vsub);
outpic = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!outpic) {
@@ -255,18 +255,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
blur(outpic->data[0], outpic->linesize[0],
inpic->data[0], inpic->linesize[0],
- inlink->w, inlink->h, sblur->luma.threshold,
- sblur->luma.filter_context);
+ inlink->w, inlink->h, s->luma.threshold,
+ s->luma.filter_context);
if (inpic->data[2]) {
blur(outpic->data[1], outpic->linesize[1],
inpic->data[1], inpic->linesize[1],
- cw, ch, sblur->chroma.threshold,
- sblur->chroma.filter_context);
+ cw, ch, s->chroma.threshold,
+ s->chroma.filter_context);
blur(outpic->data[2], outpic->linesize[2],
inpic->data[2], inpic->linesize[2],
- cw, ch, sblur->chroma.threshold,
- sblur->chroma.filter_context);
+ cw, ch, s->chroma.threshold,
+ s->chroma.filter_context);
}
av_frame_free(&inpic);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_spp.c b/chromium/third_party/ffmpeg/libavfilter/vf_spp.c
index b75f5f39377..11954542bb7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_spp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_spp.c
@@ -63,7 +63,7 @@ static const AVOption spp_options[] = {
{ "mode", "set thresholding mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_HARD}, 0, NB_MODES - 1, FLAGS, "mode" },
{ "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_HARD}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "soft", "soft thresholding", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_SOFT}, INT_MIN, INT_MAX, FLAGS, "mode" },
- { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
+ { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
{ NULL }
};
@@ -328,24 +328,24 @@ static int query_formats(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
{
- SPPContext *spp = inlink->dst->priv;
+ SPPContext *s = inlink->dst->priv;
const int h = FFALIGN(inlink->h + 16, 16);
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- const int bps = desc->comp[0].depth_minus1 + 1;
+ const int bps = desc->comp[0].depth;
- av_opt_set_int(spp->dct, "bits_per_sample", bps, 0);
- avcodec_dct_init(spp->dct);
+ av_opt_set_int(s->dct, "bits_per_sample", bps, 0);
+ avcodec_dct_init(s->dct);
if (ARCH_X86)
- ff_spp_init_x86(spp);
+ ff_spp_init_x86(s);
- spp->hsub = desc->log2_chroma_w;
- spp->vsub = desc->log2_chroma_h;
- spp->temp_linesize = FFALIGN(inlink->w + 16, 16);
- spp->temp = av_malloc_array(spp->temp_linesize, h * sizeof(*spp->temp));
- spp->src = av_malloc_array(spp->temp_linesize, h * sizeof(*spp->src) * 2);
+ s->hsub = desc->log2_chroma_w;
+ s->vsub = desc->log2_chroma_h;
+ s->temp_linesize = FFALIGN(inlink->w + 16, 16);
+ s->temp = av_malloc_array(s->temp_linesize, h * sizeof(*s->temp));
+ s->src = av_malloc_array(s->temp_linesize, h * sizeof(*s->src) * 2);
- if (!spp->temp || !spp->src)
+ if (!s->temp || !s->src)
return AVERROR(ENOMEM);
return 0;
}
@@ -353,22 +353,22 @@ static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
- SPPContext *spp = ctx->priv;
+ SPPContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out = in;
int qp_stride = 0;
const int8_t *qp_table = NULL;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- const int depth = desc->comp[0].depth_minus1 + 1;
+ const int depth = desc->comp[0].depth;
/* if we are not in a constant user quantizer mode and we don't want to use
* the quantizers from the B-frames (B-frames often have a higher QP), we
* need to save the qp table from the last non B-frame; this is what the
* following code block does */
- if (!spp->qp) {
- qp_table = av_frame_get_qp_table(in, &qp_stride, &spp->qscale_type);
+ if (!s->qp) {
+ qp_table = av_frame_get_qp_table(in, &qp_stride, &s->qscale_type);
- if (qp_table && !spp->use_bframe_qp && in->pict_type != AV_PICTURE_TYPE_B) {
+ if (qp_table && !s->use_bframe_qp && in->pict_type != AV_PICTURE_TYPE_B) {
int w, h;
/* if the qp stride is not set, it means the QP are only defined on
@@ -381,27 +381,27 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
h = FF_CEIL_RSHIFT(inlink->h, 4);
}
- if (w * h > spp->non_b_qp_alloc_size) {
- int ret = av_reallocp_array(&spp->non_b_qp_table, w, h);
+ if (w * h > s->non_b_qp_alloc_size) {
+ int ret = av_reallocp_array(&s->non_b_qp_table, w, h);
if (ret < 0) {
- spp->non_b_qp_alloc_size = 0;
+ s->non_b_qp_alloc_size = 0;
return ret;
}
- spp->non_b_qp_alloc_size = w * h;
+ s->non_b_qp_alloc_size = w * h;
}
- av_assert0(w * h <= spp->non_b_qp_alloc_size);
- memcpy(spp->non_b_qp_table, qp_table, w * h);
+ av_assert0(w * h <= s->non_b_qp_alloc_size);
+ memcpy(s->non_b_qp_table, qp_table, w * h);
}
}
- if (spp->log2_count && !ctx->is_disabled) {
- if (!spp->use_bframe_qp && spp->non_b_qp_table)
- qp_table = spp->non_b_qp_table;
+ if (s->log2_count && !ctx->is_disabled) {
+ if (!s->use_bframe_qp && s->non_b_qp_table)
+ qp_table = s->non_b_qp_table;
- if (qp_table || spp->qp) {
- const int cw = FF_CEIL_RSHIFT(inlink->w, spp->hsub);
- const int ch = FF_CEIL_RSHIFT(inlink->h, spp->vsub);
+ if (qp_table || s->qp) {
+ const int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub);
+ const int ch = FF_CEIL_RSHIFT(inlink->h, s->vsub);
/* get a new frame if in-place is not possible or if the dimensions
* are not multiple of 8 */
@@ -419,11 +419,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
out->height = in->height;
}
- filter(spp, out->data[0], in->data[0], out->linesize[0], in->linesize[0], inlink->w, inlink->h, qp_table, qp_stride, 1, depth);
+ filter(s, out->data[0], in->data[0], out->linesize[0], in->linesize[0], inlink->w, inlink->h, qp_table, qp_stride, 1, depth);
if (out->data[2]) {
- filter(spp, out->data[1], in->data[1], out->linesize[1], in->linesize[1], cw, ch, qp_table, qp_stride, 0, depth);
- filter(spp, out->data[2], in->data[2], out->linesize[2], in->linesize[2], cw, ch, qp_table, qp_stride, 0, depth);
+ filter(s, out->data[1], in->data[1], out->linesize[1], in->linesize[1], cw, ch, qp_table, qp_stride, 0, depth);
+ filter(s, out->data[2], in->data[2], out->linesize[2], in->linesize[2], cw, ch, qp_table, qp_stride, 0, depth);
}
emms_c();
}
@@ -442,13 +442,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
char *res, int res_len, int flags)
{
- SPPContext *spp = ctx->priv;
+ SPPContext *s = ctx->priv;
if (!strcmp(cmd, "level")) {
if (!strcmp(args, "max"))
- spp->log2_count = MAX_LEVEL;
+ s->log2_count = MAX_LEVEL;
else
- spp->log2_count = av_clip(strtol(args, NULL, 10), 0, MAX_LEVEL);
+ s->log2_count = av_clip(strtol(args, NULL, 10), 0, MAX_LEVEL);
return 0;
}
return AVERROR(ENOSYS);
@@ -456,44 +456,44 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts)
{
- SPPContext *spp = ctx->priv;
+ SPPContext *s = ctx->priv;
int ret;
- spp->avctx = avcodec_alloc_context3(NULL);
- spp->dct = avcodec_dct_alloc();
- if (!spp->avctx || !spp->dct)
+ s->avctx = avcodec_alloc_context3(NULL);
+ s->dct = avcodec_dct_alloc();
+ if (!s->avctx || !s->dct)
return AVERROR(ENOMEM);
if (opts) {
AVDictionaryEntry *e = NULL;
while ((e = av_dict_get(*opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
- if ((ret = av_opt_set(spp->dct, e->key, e->value, 0)) < 0)
+ if ((ret = av_opt_set(s->dct, e->key, e->value, 0)) < 0)
return ret;
}
av_dict_free(opts);
}
- spp->store_slice = store_slice_c;
- switch (spp->mode) {
- case MODE_HARD: spp->requantize = hardthresh_c; break;
- case MODE_SOFT: spp->requantize = softthresh_c; break;
+ s->store_slice = store_slice_c;
+ switch (s->mode) {
+ case MODE_HARD: s->requantize = hardthresh_c; break;
+ case MODE_SOFT: s->requantize = softthresh_c; break;
}
return 0;
}
static av_cold void uninit(AVFilterContext *ctx)
{
- SPPContext *spp = ctx->priv;
+ SPPContext *s = ctx->priv;
- av_freep(&spp->temp);
- av_freep(&spp->src);
- if (spp->avctx) {
- avcodec_close(spp->avctx);
- av_freep(&spp->avctx);
+ av_freep(&s->temp);
+ av_freep(&s->src);
+ if (s->avctx) {
+ avcodec_close(s->avctx);
+ av_freep(&s->avctx);
}
- av_freep(&spp->dct);
- av_freep(&spp->non_b_qp_table);
+ av_freep(&s->dct);
+ av_freep(&s->non_b_qp_table);
}
static const AVFilterPad spp_inputs[] = {
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_ssim.c b/chromium/third_party/ffmpeg/libavfilter/vf_ssim.c
new file mode 100644
index 00000000000..5cd9361f1ff
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_ssim.c
@@ -0,0 +1,397 @@
+/*
+ * Copyright (c) 2003-2013 Loren Merritt
+ * Copyright (c) 2015 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
+ */
+
+/* Computes the Structural Similarity Metric between two video streams.
+ * original algorithm:
+ * Z. Wang, A. C. Bovik, H. R. Sheikh and E. P. Simoncelli,
+ * "Image quality assessment: From error visibility to structural similarity,"
+ * IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004.
+ *
+ * To improve speed, this implementation uses the standard approximation of
+ * overlapped 8x8 block sums, rather than the original gaussian weights.
+ */
+
+/*
+ * @file
+ * Caculate the SSIM between two input videos.
+ */
+
+#include "libavutil/avstring.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "dualinput.h"
+#include "drawutils.h"
+#include "formats.h"
+#include "internal.h"
+#include "ssim.h"
+#include "video.h"
+
+typedef struct SSIMContext {
+ const AVClass *class;
+ FFDualInputContext dinput;
+ FILE *stats_file;
+ char *stats_file_str;
+ int nb_components;
+ uint64_t nb_frames;
+ double ssim[4], ssim_total;
+ char comps[4];
+ float coefs[4];
+ uint8_t rgba_map[4];
+ int planewidth[4];
+ int planeheight[4];
+ int *temp;
+ int is_rgb;
+ SSIMDSPContext dsp;
+} SSIMContext;
+
+#define OFFSET(x) offsetof(SSIMContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption ssim_options[] = {
+ {"stats_file", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
+ {"f", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(ssim);
+
+static void set_meta(AVDictionary **metadata, const char *key, char comp, float d)
+{
+ char value[128];
+ snprintf(value, sizeof(value), "%0.2f", d);
+ if (comp) {
+ char key2[128];
+ snprintf(key2, sizeof(key2), "%s%c", key, comp);
+ av_dict_set(metadata, key2, value, 0);
+ } else {
+ av_dict_set(metadata, key, value, 0);
+ }
+}
+
+static void ssim_4x4xn(const uint8_t *main, ptrdiff_t main_stride,
+ const uint8_t *ref, ptrdiff_t ref_stride,
+ int (*sums)[4], int width)
+{
+ int x, y, z;
+
+ for (z = 0; z < width; z++) {
+ uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0;
+
+ for (y = 0; y < 4; y++) {
+ for (x = 0; x < 4; x++) {
+ int a = main[x + y * main_stride];
+ int b = ref[x + y * ref_stride];
+
+ s1 += a;
+ s2 += b;
+ ss += a*a;
+ ss += b*b;
+ s12 += a*b;
+ }
+ }
+
+ sums[z][0] = s1;
+ sums[z][1] = s2;
+ sums[z][2] = ss;
+ sums[z][3] = s12;
+ main += 4;
+ ref += 4;
+ }
+}
+
+static float ssim_end1(int s1, int s2, int ss, int s12)
+{
+ static const int ssim_c1 = (int)(.01*.01*255*255*64 + .5);
+ static const int ssim_c2 = (int)(.03*.03*255*255*64*63 + .5);
+
+ int fs1 = s1;
+ int fs2 = s2;
+ int fss = ss;
+ int fs12 = s12;
+ int vars = fss * 64 - fs1 * fs1 - fs2 * fs2;
+ int covar = fs12 * 64 - fs1 * fs2;
+
+ return (float)(2 * fs1 * fs2 + ssim_c1) * (float)(2 * covar + ssim_c2)
+ / ((float)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (float)(vars + ssim_c2));
+}
+
+static float ssim_endn(const int (*sum0)[4], const int (*sum1)[4], int width)
+{
+ float ssim = 0.0;
+ int i;
+
+ for (i = 0; i < width; i++)
+ ssim += ssim_end1(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0],
+ sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1],
+ sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2],
+ sum0[i][3] + sum0[i + 1][3] + sum1[i][3] + sum1[i + 1][3]);
+ return ssim;
+}
+
+static float ssim_plane(SSIMDSPContext *dsp,
+ uint8_t *main, int main_stride,
+ uint8_t *ref, int ref_stride,
+ int width, int height, void *temp)
+{
+ int z = 0, y;
+ float ssim = 0.0;
+ int (*sum0)[4] = temp;
+ int (*sum1)[4] = sum0 + (width >> 2) + 3;
+
+ width >>= 2;
+ height >>= 2;
+
+ for (y = 1; y < height; y++) {
+ for (; z <= y; z++) {
+ FFSWAP(void*, sum0, sum1);
+ dsp->ssim_4x4_line(&main[4 * z * main_stride], main_stride,
+ &ref[4 * z * ref_stride], ref_stride,
+ sum0, width);
+ }
+
+ ssim += dsp->ssim_end_line((const int (*)[4])sum0, (const int (*)[4])sum1, width - 1);
+ }
+
+ return ssim / ((height - 1) * (width - 1));
+}
+
+static double ssim_db(double ssim, double weight)
+{
+ return 10 * (log(weight) / log(10) - log(weight - ssim) / log(10));
+}
+
+static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main,
+ const AVFrame *ref)
+{
+ AVDictionary **metadata = avpriv_frame_get_metadatap(main);
+ SSIMContext *s = ctx->priv;
+ float c[4], ssimv = 0.0;
+ int i;
+
+ s->nb_frames++;
+
+ for (i = 0; i < s->nb_components; i++) {
+ c[i] = ssim_plane(&s->dsp, main->data[i], main->linesize[i],
+ ref->data[i], ref->linesize[i],
+ s->planewidth[i], s->planeheight[i], s->temp);
+ ssimv += s->coefs[i] * c[i];
+ s->ssim[i] += c[i];
+ }
+ for (i = 0; i < s->nb_components; i++) {
+ int cidx = s->is_rgb ? s->rgba_map[i] : i;
+ set_meta(metadata, "lavfi.ssim.", s->comps[i], c[cidx]);
+ }
+ s->ssim_total += ssimv;
+
+ set_meta(metadata, "lavfi.ssim.All", 0, ssimv);
+ set_meta(metadata, "lavfi.ssim.dB", 0, ssim_db(ssimv, 1.0));
+
+ if (s->stats_file) {
+ fprintf(s->stats_file, "n:%"PRId64" ", s->nb_frames);
+
+ for (i = 0; i < s->nb_components; i++) {
+ int cidx = s->is_rgb ? s->rgba_map[i] : i;
+ fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]);
+ }
+
+ fprintf(s->stats_file, "All:%f (%f)\n", ssimv, ssim_db(ssimv, 1.0));
+ }
+
+ return main;
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ SSIMContext *s = ctx->priv;
+
+ if (s->stats_file_str) {
+ s->stats_file = fopen(s->stats_file_str, "w");
+ if (!s->stats_file) {
+ int err = AVERROR(errno);
+ char buf[128];
+ av_strerror(err, buf, sizeof(buf));
+ av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n",
+ s->stats_file_str, buf);
+ return err;
+ }
+ }
+
+ s->dinput.process = do_ssim;
+ s->dinput.shortest = 1;
+ s->dinput.repeatlast = 0;
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static int config_input_ref(AVFilterLink *inlink)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ AVFilterContext *ctx = inlink->dst;
+ SSIMContext *s = ctx->priv;
+ int sum = 0, i;
+
+ s->nb_components = desc->nb_components;
+
+ if (ctx->inputs[0]->w != ctx->inputs[1]->w ||
+ ctx->inputs[0]->h != ctx->inputs[1]->h) {
+ av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n");
+ return AVERROR(EINVAL);
+ }
+ if (ctx->inputs[0]->format != ctx->inputs[1]->format) {
+ av_log(ctx, AV_LOG_ERROR, "Inputs must be of same pixel format.\n");
+ return AVERROR(EINVAL);
+ }
+
+ s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0;
+ s->comps[0] = s->is_rgb ? 'R' : 'Y';
+ s->comps[1] = s->is_rgb ? 'G' : 'U';
+ s->comps[2] = s->is_rgb ? 'B' : 'V';
+ s->comps[3] = 'A';
+
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ s->planewidth[0] = s->planewidth[3] = inlink->w;
+ for (i = 0; i < s->nb_components; i++)
+ sum += s->planeheight[i] * s->planewidth[i];
+ for (i = 0; i < s->nb_components; i++)
+ s->coefs[i] = (double) s->planeheight[i] * s->planewidth[i] / sum;
+
+ s->temp = av_malloc((2 * inlink->w + 12) * sizeof(*s->temp));
+ if (!s->temp)
+ return AVERROR(ENOMEM);
+
+ s->dsp.ssim_4x4_line = ssim_4x4xn;
+ s->dsp.ssim_end_line = ssim_endn;
+ if (ARCH_X86)
+ ff_ssim_init_x86(&s->dsp);
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ SSIMContext *s = ctx->priv;
+ AVFilterLink *mainlink = ctx->inputs[0];
+ int ret;
+
+ outlink->w = mainlink->w;
+ outlink->h = mainlink->h;
+ outlink->time_base = mainlink->time_base;
+ outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
+ outlink->frame_rate = mainlink->frame_rate;
+
+ if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
+ return ret;
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
+{
+ SSIMContext *s = inlink->dst->priv;
+ return ff_dualinput_filter_frame(&s->dinput, inlink, buf);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ SSIMContext *s = outlink->src->priv;
+ return ff_dualinput_request_frame(&s->dinput, outlink);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ SSIMContext *s = ctx->priv;
+
+ if (s->nb_frames > 0) {
+ char buf[256];
+ int i;
+ buf[0] = 0;
+ for (i = 0; i < s->nb_components; i++) {
+ int c = s->is_rgb ? s->rgba_map[i] : i;
+ av_strlcatf(buf, sizeof(buf), " %c:%f", s->comps[i], s->ssim[c] / s->nb_frames);
+ }
+ av_log(ctx, AV_LOG_INFO, "SSIM%s All:%f (%f)\n", buf,
+ s->ssim_total / s->nb_frames, ssim_db(s->ssim_total, s->nb_frames));
+ }
+
+ ff_dualinput_uninit(&s->dinput);
+
+ if (s->stats_file)
+ fclose(s->stats_file);
+
+ av_freep(&s->temp);
+}
+
+static const AVFilterPad ssim_inputs[] = {
+ {
+ .name = "main",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ },{
+ .name = "reference",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input_ref,
+ },
+ { NULL }
+};
+
+static const AVFilterPad ssim_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ .request_frame = request_frame,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_ssim = {
+ .name = "ssim",
+ .description = NULL_IF_CONFIG_SMALL("Calculate the SSIM between two video streams."),
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(SSIMContext),
+ .priv_class = &ssim_class,
+ .inputs = ssim_inputs,
+ .outputs = ssim_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_stack.c b/chromium/third_party/ffmpeg/libavfilter/vf_stack.c
new file mode 100644
index 00000000000..8a90caada70
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_stack.c
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2015 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/opt.h"
+#include "libavutil/pixdesc.h"
+
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "framesync.h"
+#include "video.h"
+
+typedef struct StackContext {
+ const AVClass *class;
+ const AVPixFmtDescriptor *desc;
+ int nb_inputs;
+ int is_vertical;
+ int nb_planes;
+
+ AVFrame **frames;
+ FFFrameSync fs;
+} StackContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *pix_fmts = NULL;
+ int fmt;
+
+ 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_PAL ||
+ desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
+ desc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
+ ff_add_format(&pix_fmts, fmt);
+ }
+
+ return ff_set_common_formats(ctx, pix_fmts);
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ StackContext *s = inlink->dst->priv;
+ return ff_framesync_filter_frame(&s->fs, inlink, in);
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ StackContext *s = ctx->priv;
+ int i, ret;
+
+ if (!strcmp(ctx->filter->name, "vstack"))
+ s->is_vertical = 1;
+
+ s->frames = av_calloc(s->nb_inputs, sizeof(*s->frames));
+ if (!s->frames)
+ return AVERROR(ENOMEM);
+
+ for (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);
+ pad.filter_frame = filter_frame;
+
+ if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static int process_frame(FFFrameSync *fs)
+{
+ AVFilterContext *ctx = fs->parent;
+ AVFilterLink *outlink = ctx->outputs[0];
+ StackContext *s = fs->opaque;
+ AVFrame **in = s->frames;
+ AVFrame *out;
+ int i, p, ret, offset[4] = { 0 };
+
+ 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);
+
+ for (i = 0; i < s->nb_inputs; i++) {
+ AVFilterLink *inlink = ctx->inputs[i];
+ int linesize[4];
+ int height[4];
+
+ if ((ret = av_image_fill_linesizes(linesize, inlink->format, inlink->w)) < 0) {
+ av_frame_free(&out);
+ return ret;
+ }
+
+ height[1] = height[2] = FF_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
+ height[0] = height[3] = inlink->h;
+
+ for (p = 0; p < s->nb_planes; p++) {
+ if (s->is_vertical) {
+ av_image_copy_plane(out->data[p] + offset[p] * out->linesize[p],
+ out->linesize[p],
+ in[i]->data[p],
+ in[i]->linesize[p],
+ linesize[p], height[p]);
+ offset[p] += height[p];
+ } else {
+ av_image_copy_plane(out->data[p] + offset[p],
+ out->linesize[p],
+ in[i]->data[p],
+ in[i]->linesize[p],
+ linesize[p], height[p]);
+ offset[p] += linesize[p];
+ }
+ }
+ }
+
+ return ff_filter_frame(outlink, out);
+}
+
+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;
+ int height = ctx->inputs[0]->h;
+ int width = ctx->inputs[0]->w;
+ FFFrameSyncIn *in;
+ int i, ret;
+
+ if (s->is_vertical) {
+ for (i = 1; i < s->nb_inputs; i++) {
+ if (ctx->inputs[i]->w != width) {
+ av_log(ctx, AV_LOG_ERROR, "Input %d width %d does not match input %d width %d.\n", i, ctx->inputs[i]->w, 0, width);
+ return AVERROR(EINVAL);
+ }
+ height += ctx->inputs[i]->h;
+ }
+ } else {
+ for (i = 1; i < s->nb_inputs; i++) {
+ if (ctx->inputs[i]->h != height) {
+ av_log(ctx, AV_LOG_ERROR, "Input %d height %d does not match input %d height %d.\n", i, ctx->inputs[i]->h, 0, height);
+ return AVERROR(EINVAL);
+ }
+ width += ctx->inputs[i]->w;
+ }
+ }
+
+ 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);
+
+ outlink->w = width;
+ outlink->h = height;
+ outlink->time_base = time_base;
+ outlink->frame_rate = frame_rate;
+
+ 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_INFINITY;
+ }
+
+ return ff_framesync_configure(&s->fs);
+}
+
+static int request_frame(AVFilterLink *outlink)
+{
+ StackContext *s = outlink->src->priv;
+ return ff_framesync_request_frame(&s->fs, outlink);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ StackContext *s = ctx->priv;
+ ff_framesync_uninit(&s->fs);
+ av_freep(&s->frames);
+}
+
+#define OFFSET(x) offsetof(StackContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
+static const AVOption stack_options[] = {
+ { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT_MAX, .flags = FLAGS },
+ { NULL },
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ .request_frame = request_frame,
+ },
+ { NULL }
+};
+
+#if CONFIG_HSTACK_FILTER
+
+#define hstack_options stack_options
+AVFILTER_DEFINE_CLASS(hstack);
+
+AVFilter ff_vf_hstack = {
+ .name = "hstack",
+ .description = NULL_IF_CONFIG_SMALL("Stack video inputs horizontally."),
+ .priv_size = sizeof(StackContext),
+ .priv_class = &hstack_class,
+ .query_formats = query_formats,
+ .outputs = outputs,
+ .init = init,
+ .uninit = uninit,
+ .flags = AVFILTER_FLAG_DYNAMIC_INPUTS,
+};
+
+#endif /* CONFIG_HSTACK_FILTER */
+
+#if CONFIG_VSTACK_FILTER
+
+#define vstack_options stack_options
+AVFILTER_DEFINE_CLASS(vstack);
+
+AVFilter ff_vf_vstack = {
+ .name = "vstack",
+ .description = NULL_IF_CONFIG_SMALL("Stack video inputs vertically."),
+ .priv_size = sizeof(StackContext),
+ .priv_class = &vstack_class,
+ .query_formats = query_formats,
+ .outputs = outputs,
+ .init = init,
+ .uninit = uninit,
+ .flags = AVFILTER_FLAG_DYNAMIC_INPUTS,
+};
+
+#endif /* CONFIG_VSTACK_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_stereo3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_stereo3d.c
index 771bdde6766..02dc9487448 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_stereo3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_stereo3d.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2010 Gordon Schmidt <gordon.schmidt <at> s2000.tu-chemnitz.de>
- * Copyright (c) 2013 Paul B Mahol
+ * Copyright (c) 2013-2015 Paul B Mahol
*
* This file is part of FFmpeg.
*
@@ -21,6 +21,7 @@
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
@@ -59,6 +60,11 @@ enum StereoCode {
ABOVE_BELOW_2_RL, // above-below with half height resolution
ALTERNATING_LR, // alternating frames (left eye first, right eye second)
ALTERNATING_RL, // alternating frames (right eye first, left eye second)
+ CHECKERBOARD_LR, // checkerboard pattern (left eye first, right eye second)
+ CHECKERBOARD_RL, // checkerboard pattern (right eye first, left eye second)
+ INTERLEAVE_COLS_LR, // column-interleave (left eye first, right eye second)
+ INTERLEAVE_COLS_RL, // column-interleave (right eye first, left eye second)
+ HDMI, // HDMI frame pack (left eye first, right eye second)
STEREO_CODE_COUNT // TODO: needs autodetection
};
@@ -68,6 +74,7 @@ typedef struct StereoComponent {
int off_left, off_right;
int off_lstep, off_rstep;
int row_left, row_right;
+ int row_step;
} StereoComponent;
static const int ana_coeff[][3][6] = {
@@ -133,7 +140,6 @@ typedef struct Stereo3DContext {
const AVClass *class;
StereoComponent in, out;
int width, height;
- int row_step;
const int *ana_matrix[3];
int nb_planes;
int linesize[4];
@@ -142,24 +148,28 @@ typedef struct Stereo3DContext {
int pixstep[4];
AVFrame *prev;
double ts_unit;
+ int blanks;
+ int in_off_left[4], in_off_right[4];
} Stereo3DContext;
#define OFFSET(x) offsetof(Stereo3DContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static const AVOption stereo3d_options[] = {
- { "in", "set input format", OFFSET(in.format), AV_OPT_TYPE_INT, {.i64=SIDE_BY_SIDE_LR}, SIDE_BY_SIDE_LR, STEREO_CODE_COUNT-1, FLAGS, "in"},
- { "ab2l", "above below half height left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR}, 0, 0, FLAGS, "in" },
- { "ab2r", "above below half height right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_RL}, 0, 0, FLAGS, "in" },
- { "abl", "above below left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_LR}, 0, 0, FLAGS, "in" },
- { "abr", "above below right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_RL}, 0, 0, FLAGS, "in" },
- { "al", "alternating frames left first", 0, AV_OPT_TYPE_CONST, {.i64=ALTERNATING_LR}, 0, 0, FLAGS, "in" },
- { "ar", "alternating frames right first", 0, AV_OPT_TYPE_CONST, {.i64=ALTERNATING_RL}, 0, 0, FLAGS, "in" },
- { "sbs2l", "side by side half width left first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_LR}, 0, 0, FLAGS, "in" },
- { "sbs2r", "side by side half width right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_RL}, 0, 0, FLAGS, "in" },
- { "sbsl", "side by side left first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_LR}, 0, 0, FLAGS, "in" },
- { "sbsr", "side by side right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_RL}, 0, 0, FLAGS, "in" },
- { "out", "set output format", OFFSET(out.format), AV_OPT_TYPE_INT, {.i64=ANAGLYPH_RC_DUBOIS}, 0, STEREO_CODE_COUNT-1, FLAGS, "out"},
+ { "in", "set input format", OFFSET(in.format), AV_OPT_TYPE_INT, {.i64=SIDE_BY_SIDE_LR}, INTERLEAVE_ROWS_LR, STEREO_CODE_COUNT-1, FLAGS, "in"},
+ { "ab2l", "above below half height left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR}, 0, 0, FLAGS, "in" },
+ { "ab2r", "above below half height right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_RL}, 0, 0, FLAGS, "in" },
+ { "abl", "above below left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_LR}, 0, 0, FLAGS, "in" },
+ { "abr", "above below right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_RL}, 0, 0, FLAGS, "in" },
+ { "al", "alternating frames left first", 0, AV_OPT_TYPE_CONST, {.i64=ALTERNATING_LR}, 0, 0, FLAGS, "in" },
+ { "ar", "alternating frames right first", 0, AV_OPT_TYPE_CONST, {.i64=ALTERNATING_RL}, 0, 0, FLAGS, "in" },
+ { "sbs2l", "side by side half width left first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_LR}, 0, 0, FLAGS, "in" },
+ { "sbs2r", "side by side half width right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_RL}, 0, 0, FLAGS, "in" },
+ { "sbsl", "side by side left first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_LR}, 0, 0, FLAGS, "in" },
+ { "sbsr", "side by side right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_RL}, 0, 0, FLAGS, "in" },
+ { "irl", "interleave rows left first", 0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_ROWS_LR}, 0, 0, FLAGS, "in" },
+ { "irr", "interleave rows right first", 0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_ROWS_RL}, 0, 0, FLAGS, "in" },
+ { "out", "set output format", OFFSET(out.format), AV_OPT_TYPE_INT, {.i64=ANAGLYPH_RC_DUBOIS}, 0, STEREO_CODE_COUNT-1, FLAGS, "out"},
{ "ab2l", "above below half height left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR}, 0, 0, FLAGS, "out" },
{ "ab2r", "above below half height right first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_RL}, 0, 0, FLAGS, "out" },
{ "abl", "above below left first", 0, AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_LR}, 0, 0, FLAGS, "out" },
@@ -188,6 +198,11 @@ static const AVOption stereo3d_options[] = {
{ "sbs2r", "side by side half width right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_2_RL}, 0, 0, FLAGS, "out" },
{ "sbsl", "side by side left first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_LR}, 0, 0, FLAGS, "out" },
{ "sbsr", "side by side right first", 0, AV_OPT_TYPE_CONST, {.i64=SIDE_BY_SIDE_RL}, 0, 0, FLAGS, "out" },
+ { "chl", "checkerboard left first", 0, AV_OPT_TYPE_CONST, {.i64=CHECKERBOARD_LR}, 0, 0, FLAGS, "out" },
+ { "chr", "checkerboard right first", 0, AV_OPT_TYPE_CONST, {.i64=CHECKERBOARD_RL}, 0, 0, FLAGS, "out" },
+ { "icl", "interleave columns left first", 0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_COLS_LR}, 0, 0, FLAGS, "out" },
+ { "icr", "interleave columns right first", 0, AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_COLS_RL}, 0, 0, FLAGS, "out" },
+ { "hdmi", "HDMI frame pack", 0, AV_OPT_TYPE_CONST, {.i64=HDMI}, 0, 0, FLAGS, "out" },
{ NULL }
};
@@ -306,17 +321,12 @@ static int config_output(AVFilterLink *outlink)
return AVERROR_INVALIDDATA;
}
break;
+ case INTERLEAVE_ROWS_LR:
+ case INTERLEAVE_ROWS_RL:
case ABOVE_BELOW_2_LR:
case ABOVE_BELOW_LR:
case ABOVE_BELOW_2_RL:
case ABOVE_BELOW_RL:
- if (s->out.format == INTERLEAVE_ROWS_LR ||
- s->out.format == INTERLEAVE_ROWS_RL) {
- if (inlink->h & 3) {
- av_log(ctx, AV_LOG_ERROR, "height must be multiple of 4\n");
- return AVERROR_INVALIDDATA;
- }
- }
if (inlink->h & 1) {
av_log(ctx, AV_LOG_ERROR, "height must be even\n");
return AVERROR_INVALIDDATA;
@@ -328,13 +338,13 @@ static int config_output(AVFilterLink *outlink)
s->width = inlink->w;
s->in.height =
s->height = inlink->h;
- s->row_step = 1;
s->in.off_lstep =
s->in.off_rstep =
s->in.off_left =
s->in.off_right =
s->in.row_left =
s->in.row_right = 0;
+ s->in.row_step = 1;
switch (s->in.format) {
case SIDE_BY_SIDE_2_LR:
@@ -367,6 +377,17 @@ static int config_output(AVFilterLink *outlink)
fps.den *= 2;
tb.num *= 2;
break;
+ case INTERLEAVE_ROWS_LR:
+ case INTERLEAVE_ROWS_RL:
+ s->in.row_step = 2;
+ if (s->in.format == INTERLEAVE_ROWS_RL)
+ s->in.off_lstep = 1;
+ else
+ s->in.off_rstep = 1;
+ if (s->out.format != CHECKERBOARD_LR &&
+ s->out.format != CHECKERBOARD_RL)
+ s->height = inlink->h / 2;
+ break;
default:
av_log(ctx, AV_LOG_ERROR, "input format %d is not supported\n", s->in.format);
return AVERROR(EINVAL);
@@ -380,6 +401,7 @@ static int config_output(AVFilterLink *outlink)
s->out.off_right =
s->out.row_left =
s->out.row_right = 0;
+ s->out.row_step = 1;
switch (s->out.format) {
case ANAGLYPH_RB_GRAY:
@@ -422,6 +444,14 @@ static int config_output(AVFilterLink *outlink)
s->out.height = s->height * 2;
s->out.row_right = s->height;
break;
+ case HDMI:
+ if (s->in.height <= 720)
+ s->blanks = 30;
+ else
+ s->blanks = 45;
+ s->out.height = s->height * 2 + s->blanks;
+ s->out.row_right = s->height + s->blanks;
+ break;
case ABOVE_BELOW_2_RL:
aspect.num *= 2;
case ABOVE_BELOW_RL:
@@ -429,27 +459,42 @@ static int config_output(AVFilterLink *outlink)
s->out.row_left = s->height;
break;
case INTERLEAVE_ROWS_LR:
- s->row_step = 2;
- s->height = s->height / 2;
- s->out.off_rstep =
- s->in.off_rstep = 1;
+ s->in.row_step = 1 + (s->in.format == INTERLEAVE_ROWS_RL);
+ s->out.row_step = 2;
+ s->out.height = s->height * 2;
+ s->out.off_rstep = 1;
+ s->in.off_rstep = s->in.format != INTERLEAVE_ROWS_RL;
break;
case INTERLEAVE_ROWS_RL:
- s->row_step = 2;
- s->height = s->height / 2;
- s->out.off_lstep =
- s->in.off_lstep = 1;
+ s->in.row_step = 1 + (s->in.format == INTERLEAVE_ROWS_LR);
+ s->out.row_step = 2;
+ s->out.height = s->height * 2;
+ s->out.off_lstep = 1;
+ s->in.off_lstep = s->in.format != INTERLEAVE_ROWS_LR;
break;
case MONO_R:
s->in.off_left = s->in.off_right;
s->in.row_left = s->in.row_right;
+ if (s->in.format == INTERLEAVE_ROWS_LR)
+ FFSWAP(int, s->in.off_lstep, s->in.off_rstep);
+ break;
case MONO_L:
+ if (s->in.format == INTERLEAVE_ROWS_RL)
+ FFSWAP(int, s->in.off_lstep, s->in.off_rstep);
break;
case ALTERNATING_RL:
case ALTERNATING_LR:
fps.num *= 2;
tb.den *= 2;
break;
+ case CHECKERBOARD_LR:
+ case CHECKERBOARD_RL:
+ s->out.width = s->width * 2;
+ break;
+ case INTERLEAVE_COLS_LR:
+ case INTERLEAVE_COLS_RL:
+ s->out.width = s->width * 2;
+ break;
default:
av_log(ctx, AV_LOG_ERROR, "output format %d is not supported\n", s->out.format);
return AVERROR(EINVAL);
@@ -485,6 +530,42 @@ static inline uint8_t ana_convert(const int *coeff, const uint8_t *left, const u
return av_clip_uint8(sum >> 16);
}
+typedef struct ThreadData {
+ AVFrame *ileft, *iright;
+ AVFrame *out;
+} ThreadData;
+
+static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ Stereo3DContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *ileft = td->ileft;
+ AVFrame *iright = td->iright;
+ AVFrame *out = td->out;
+ int height = s->out.height;
+ int start = (height * jobnr ) / nb_jobs;
+ int end = (height * (jobnr+1)) / nb_jobs;
+ uint8_t *dst = out->data[0];
+ const int **ana_matrix = s->ana_matrix;
+ int x, y, il, ir, o;
+ const uint8_t *lsrc = ileft->data[0];
+ const uint8_t *rsrc = iright->data[0];
+ int out_width = s->out.width;
+
+ for (y = start; y < end; y++) {
+ o = out->linesize[0] * y;
+ il = s->in_off_left[0] + y * ileft->linesize[0] * s->in.row_step;
+ ir = s->in_off_right[0] + y * iright->linesize[0] * s->in.row_step;
+ for (x = 0; x < out_width; x++, il += 3, ir += 3, o+= 3) {
+ dst[o ] = ana_convert(ana_matrix[0], lsrc + il, rsrc + ir);
+ dst[o + 1] = ana_convert(ana_matrix[1], lsrc + il, rsrc + ir);
+ dst[o + 2] = ana_convert(ana_matrix[2], lsrc + il, rsrc + ir);
+ }
+ }
+
+ return 0;
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
{
AVFilterContext *ctx = inlink->dst;
@@ -492,9 +573,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out, *oleft, *oright, *ileft, *iright;
int out_off_left[4], out_off_right[4];
- int in_off_left[4], in_off_right[4];
int i;
+ if (s->in.format == s->out.format)
+ return ff_filter_frame(outlink, inpicref);
+
switch (s->in.format) {
case ALTERNATING_LR:
case ALTERNATING_RL:
@@ -534,13 +617,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
for (i = 0; i < 4; i++) {
int hsub = i == 1 || i == 2 ? s->hsub : 0;
int vsub = i == 1 || i == 2 ? s->vsub : 0;
- in_off_left[i] = (FF_CEIL_RSHIFT(s->in.row_left, vsub) + s->in.off_lstep) * ileft->linesize[i] + FF_CEIL_RSHIFT(s->in.off_left * s->pixstep[i], hsub);
- in_off_right[i] = (FF_CEIL_RSHIFT(s->in.row_right, vsub) + s->in.off_rstep) * iright->linesize[i] + FF_CEIL_RSHIFT(s->in.off_right * s->pixstep[i], hsub);
+ s->in_off_left[i] = (FF_CEIL_RSHIFT(s->in.row_left, vsub) + s->in.off_lstep) * ileft->linesize[i] + FF_CEIL_RSHIFT(s->in.off_left * s->pixstep[i], hsub);
+ s->in_off_right[i] = (FF_CEIL_RSHIFT(s->in.row_right, vsub) + s->in.off_rstep) * iright->linesize[i] + FF_CEIL_RSHIFT(s->in.off_right * s->pixstep[i], hsub);
out_off_left[i] = (FF_CEIL_RSHIFT(s->out.row_left, vsub) + s->out.off_lstep) * oleft->linesize[i] + FF_CEIL_RSHIFT(s->out.off_left * s->pixstep[i], hsub);
out_off_right[i] = (FF_CEIL_RSHIFT(s->out.row_right, vsub) + s->out.off_rstep) * oright->linesize[i] + FF_CEIL_RSHIFT(s->out.off_right * s->pixstep[i], hsub);
}
switch (s->out.format) {
+ case HDMI:
+ for (i = 0; i < s->nb_planes; i++) {
+ int j, h = s->height >> ((i == 1 || i == 2) ? s->vsub : 0);
+ int b = (s->blanks) >> ((i == 1 || i == 2) ? s->vsub : 0);
+
+ for (j = h; j < h + b; j++)
+ memset(oleft->data[i] + j * s->linesize[i], 0, s->linesize[i]);
+ }
case ALTERNATING_LR:
case ALTERNATING_RL:
case SIDE_BY_SIDE_LR:
@@ -555,14 +646,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
case INTERLEAVE_ROWS_RL:
for (i = 0; i < s->nb_planes; i++) {
av_image_copy_plane(oleft->data[i] + out_off_left[i],
- oleft->linesize[i] * s->row_step,
- ileft->data[i] + in_off_left[i],
- ileft->linesize[i] * s->row_step,
+ oleft->linesize[i] * s->out.row_step,
+ ileft->data[i] + s->in_off_left[i],
+ ileft->linesize[i] * s->in.row_step,
s->linesize[i], s->pheight[i]);
av_image_copy_plane(oright->data[i] + out_off_right[i],
- oright->linesize[i] * s->row_step,
- iright->data[i] + in_off_right[i],
- iright->linesize[i] * s->row_step,
+ oright->linesize[i] * s->out.row_step,
+ iright->data[i] + s->in_off_right[i],
+ iright->linesize[i] * s->in.row_step,
s->linesize[i], s->pheight[i]);
}
break;
@@ -571,8 +662,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
case MONO_R:
for (i = 0; i < s->nb_planes; i++) {
av_image_copy_plane(out->data[i], out->linesize[i],
- iright->data[i] + in_off_left[i],
- iright->linesize[i],
+ iright->data[i] + s->in_off_left[i],
+ iright->linesize[i] * s->in.row_step,
s->linesize[i], s->pheight[i]);
}
break;
@@ -590,25 +681,122 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR:
case ANAGLYPH_YB_DUBOIS: {
- int x, y, il, ir, o;
- const uint8_t *lsrc = ileft->data[0];
- const uint8_t *rsrc = iright->data[0];
- uint8_t *dst = out->data[0];
- int out_width = s->out.width;
- const int **ana_matrix = s->ana_matrix;
-
- for (y = 0; y < s->out.height; y++) {
- o = out->linesize[0] * y;
- il = in_off_left[0] + y * ileft->linesize[0];
- ir = in_off_right[0] + y * iright->linesize[0];
- for (x = 0; x < out_width; x++, il += 3, ir += 3, o+= 3) {
- dst[o ] = ana_convert(ana_matrix[0], lsrc + il, rsrc + ir);
- dst[o + 1] = ana_convert(ana_matrix[1], lsrc + il, rsrc + ir);
- dst[o + 2] = ana_convert(ana_matrix[2], lsrc + il, rsrc + ir);
+ ThreadData td;
+
+ td.ileft = ileft; td.iright = iright; td.out = out;
+ ctx->internal->execute(ctx, filter_slice, &td, NULL,
+ FFMIN(s->out.height, ctx->graph->nb_threads));
+ break;
+ }
+ case CHECKERBOARD_RL:
+ case CHECKERBOARD_LR:
+ for (i = 0; i < s->nb_planes; i++) {
+ int x, y;
+
+ for (y = 0; y < s->pheight[i]; y++) {
+ uint8_t *dst = out->data[i] + out->linesize[i] * y;
+ uint8_t *left = ileft->data[i] + ileft->linesize[i] * y + s->in_off_left[i];
+ uint8_t *right = iright->data[i] + iright->linesize[i] * y + s->in_off_right[i];
+ int p, b;
+
+ if (s->out.format == CHECKERBOARD_RL)
+ FFSWAP(uint8_t*, left, right);
+ switch (s->pixstep[i]) {
+ case 1:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=2, p++, b++) {
+ dst[x ] = (b&1) == (y&1) ? left[p] : right[p];
+ dst[x+1] = (b&1) != (y&1) ? left[p] : right[p];
+ }
+ break;
+ case 2:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=4, p+=2, b++) {
+ AV_WN16(&dst[x ], (b&1) == (y&1) ? AV_RN16(&left[p]) : AV_RN16(&right[p]));
+ AV_WN16(&dst[x+2], (b&1) != (y&1) ? AV_RN16(&left[p]) : AV_RN16(&right[p]));
+ }
+ break;
+ case 3:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=6, p+=3, b++) {
+ AV_WB24(&dst[x ], (b&1) == (y&1) ? AV_RB24(&left[p]) : AV_RB24(&right[p]));
+ AV_WB24(&dst[x+3], (b&1) != (y&1) ? AV_RB24(&left[p]) : AV_RB24(&right[p]));
+ }
+ break;
+ case 4:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=8, p+=4, b++) {
+ AV_WN32(&dst[x ], (b&1) == (y&1) ? AV_RN32(&left[p]) : AV_RN32(&right[p]));
+ AV_WN32(&dst[x+4], (b&1) != (y&1) ? AV_RN32(&left[p]) : AV_RN32(&right[p]));
+ }
+ break;
+ case 6:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=12, p+=6, b++) {
+ AV_WB48(&dst[x ], (b&1) == (y&1) ? AV_RB48(&left[p]) : AV_RB48(&right[p]));
+ AV_WB48(&dst[x+6], (b&1) != (y&1) ? AV_RB48(&left[p]) : AV_RB48(&right[p]));
+ }
+ break;
+ case 8:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=16, p+=8, b++) {
+ AV_WN64(&dst[x ], (b&1) == (y&1) ? AV_RN64(&left[p]) : AV_RN64(&right[p]));
+ AV_WN64(&dst[x+8], (b&1) != (y&1) ? AV_RN64(&left[p]) : AV_RN64(&right[p]));
+ }
+ break;
+ }
+ }
+ }
+ break;
+ case INTERLEAVE_COLS_LR:
+ case INTERLEAVE_COLS_RL:
+ for (i = 0; i < s->nb_planes; i++) {
+ int x, y;
+
+ for (y = 0; y < s->pheight[i]; y++) {
+ uint8_t *dst = out->data[i] + out->linesize[i] * y;
+ uint8_t *left = ileft->data[i] + ileft->linesize[i] * y * s->in.row_step + s->in_off_left[i];
+ uint8_t *right = iright->data[i] + iright->linesize[i] * y * s->in.row_step + s->in_off_right[i];
+ int p, b;
+
+ if (s->out.format == INTERLEAVE_COLS_LR)
+ FFSWAP(uint8_t*, left, right);
+
+ switch (s->pixstep[i]) {
+ case 1:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=2, p++, b++) {
+ dst[x ] = b&1 ? left[p] : right[p];
+ dst[x+1] = !(b&1) ? left[p] : right[p];
+ }
+ break;
+ case 2:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=4, p+=2, b++) {
+ AV_WN16(&dst[x ], b&1 ? AV_RN16(&left[p]) : AV_RN16(&right[p]));
+ AV_WN16(&dst[x+2], !(b&1) ? AV_RN16(&left[p]) : AV_RN16(&right[p]));
+ }
+ break;
+ case 3:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=6, p+=3, b++) {
+ AV_WB24(&dst[x ], b&1 ? AV_RB24(&left[p]) : AV_RB24(&right[p]));
+ AV_WB24(&dst[x+3], !(b&1) ? AV_RB24(&left[p]) : AV_RB24(&right[p]));
+ }
+ break;
+ case 4:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=8, p+=4, b++) {
+ AV_WN32(&dst[x ], b&1 ? AV_RN32(&left[p]) : AV_RN32(&right[p]));
+ AV_WN32(&dst[x+4], !(b&1) ? AV_RN32(&left[p]) : AV_RN32(&right[p]));
+ }
+ break;
+ case 6:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=12, p+=6, b++) {
+ AV_WB48(&dst[x ], b&1 ? AV_RB48(&left[p]) : AV_RB48(&right[p]));
+ AV_WB48(&dst[x+6], !(b&1) ? AV_RB48(&left[p]) : AV_RB48(&right[p]));
+ }
+ break;
+ case 8:
+ for (x = 0, b = 0, p = 0; x < s->linesize[i] * 2; x+=16, p+=8, b++) {
+ AV_WN64(&dst[x ], b&1 ? AV_RN64(&left[p]) : AV_RN64(&right[p]));
+ AV_WN64(&dst[x+8], !(b&1) ? AV_RN64(&left[p]) : AV_RN64(&right[p]));
+ }
+ break;
+ }
}
}
break;
- }
default:
av_assert0(0);
}
@@ -663,4 +851,5 @@ AVFilter ff_vf_stereo3d = {
.inputs = stereo3d_inputs,
.outputs = stereo3d_outputs,
.priv_class = &stereo3d_class,
+ .flags = AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c b/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
index 5e1324c7157..b0d016c0e58 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_subtitles.c
@@ -50,6 +50,7 @@ typedef struct {
ASS_Renderer *renderer;
ASS_Track *track;
char *filename;
+ char *fontsdir;
char *charenc;
char *force_style;
int stream_index;
@@ -67,6 +68,7 @@ typedef struct {
{"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
{"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
{"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
+ {"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
/* libass supports a log level ranging from 0 to 7 */
static const int ass_libavfilter_log_level_map[] = {
@@ -106,6 +108,8 @@ static av_cold int init(AVFilterContext *ctx)
}
ass_set_message_cb(ass->library, ass_log, ctx);
+ ass_set_fonts_dir(ass->library, ass->fontsdir);
+
ass->renderer = ass_renderer_init(ass->library);
if (!ass->renderer) {
av_log(ctx, AV_LOG_ERROR, "Could not initialize libass renderer.\n");
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_super2xsai.c b/chromium/third_party/ffmpeg/libavfilter/vf_super2xsai.c
index 67e9f97e541..cbb3f62414b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_super2xsai.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_super2xsai.c
@@ -58,15 +58,15 @@ static void super2xsai(AVFilterContext *ctx,
uint8_t *dst, int dst_linesize,
int width, int height)
{
- Super2xSaIContext *sai = ctx->priv;
+ Super2xSaIContext *s = ctx->priv;
unsigned int x, y;
uint32_t color[4][4];
unsigned char *src_line[4];
- const int bpp = sai->bpp;
- const uint32_t hi_pixel_mask = sai->hi_pixel_mask;
- const uint32_t lo_pixel_mask = sai->lo_pixel_mask;
- const uint32_t q_hi_pixel_mask = sai->q_hi_pixel_mask;
- const uint32_t q_lo_pixel_mask = sai->q_lo_pixel_mask;
+ const int bpp = s->bpp;
+ const uint32_t hi_pixel_mask = s->hi_pixel_mask;
+ const uint32_t lo_pixel_mask = s->lo_pixel_mask;
+ const uint32_t q_hi_pixel_mask = s->q_hi_pixel_mask;
+ const uint32_t q_lo_pixel_mask = s->q_lo_pixel_mask;
/* Point to the first 4 lines, first line is duplicated */
src_line[0] = src;
@@ -76,7 +76,7 @@ static void super2xsai(AVFilterContext *ctx,
#define READ_COLOR4(dst, src_line, off) dst = *((const uint32_t *)src_line + off)
#define READ_COLOR3(dst, src_line, off) dst = AV_RL24 (src_line + 3*off)
-#define READ_COLOR2(dst, src_line, off) dst = sai->is_be ? AV_RB16(src_line + 2 * off) : AV_RL16(src_line + 2 * off)
+#define READ_COLOR2(dst, src_line, off) dst = s->is_be ? AV_RB16(src_line + 2 * off) : AV_RL16(src_line + 2 * off)
for (y = 0; y < height; y++) {
uint8_t *dst_line[2];
@@ -179,7 +179,7 @@ static void super2xsai(AVFilterContext *ctx,
AV_WL24(dst_line[1] + x * 6 + 3, product2b);
break;
default: // bpp = 2
- if (sai->is_be) {
+ if (s->is_be) {
AV_WB32(dst_line[0] + x * 4, product1a | (product1b << 16));
AV_WB32(dst_line[1] + x * 4, product2a | (product2b << 16));
} else {
@@ -249,42 +249,42 @@ static int query_formats(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
{
- Super2xSaIContext *sai = inlink->dst->priv;
+ Super2xSaIContext *s = inlink->dst->priv;
- sai->hi_pixel_mask = 0xFEFEFEFE;
- sai->lo_pixel_mask = 0x01010101;
- sai->q_hi_pixel_mask = 0xFCFCFCFC;
- sai->q_lo_pixel_mask = 0x03030303;
- sai->bpp = 4;
+ s->hi_pixel_mask = 0xFEFEFEFE;
+ s->lo_pixel_mask = 0x01010101;
+ s->q_hi_pixel_mask = 0xFCFCFCFC;
+ s->q_lo_pixel_mask = 0x03030303;
+ s->bpp = 4;
switch (inlink->format) {
case AV_PIX_FMT_RGB24:
case AV_PIX_FMT_BGR24:
- sai->bpp = 3;
+ s->bpp = 3;
break;
case AV_PIX_FMT_RGB565BE:
case AV_PIX_FMT_BGR565BE:
- sai->is_be = 1;
+ s->is_be = 1;
case AV_PIX_FMT_RGB565LE:
case AV_PIX_FMT_BGR565LE:
- sai->hi_pixel_mask = 0xF7DEF7DE;
- sai->lo_pixel_mask = 0x08210821;
- sai->q_hi_pixel_mask = 0xE79CE79C;
- sai->q_lo_pixel_mask = 0x18631863;
- sai->bpp = 2;
+ s->hi_pixel_mask = 0xF7DEF7DE;
+ s->lo_pixel_mask = 0x08210821;
+ s->q_hi_pixel_mask = 0xE79CE79C;
+ s->q_lo_pixel_mask = 0x18631863;
+ s->bpp = 2;
break;
case AV_PIX_FMT_BGR555BE:
case AV_PIX_FMT_RGB555BE:
- sai->is_be = 1;
+ s->is_be = 1;
case AV_PIX_FMT_BGR555LE:
case AV_PIX_FMT_RGB555LE:
- sai->hi_pixel_mask = 0x7BDE7BDE;
- sai->lo_pixel_mask = 0x04210421;
- sai->q_hi_pixel_mask = 0x739C739C;
- sai->q_lo_pixel_mask = 0x0C630C63;
- sai->bpp = 2;
+ s->hi_pixel_mask = 0x7BDE7BDE;
+ s->lo_pixel_mask = 0x04210421;
+ s->q_hi_pixel_mask = 0x739C739C;
+ s->q_lo_pixel_mask = 0x0C630C63;
+ s->bpp = 2;
break;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_swapuv.c b/chromium/third_party/ffmpeg/libavfilter/vf_swapuv.c
index 632e31c75e0..b450e6fb4cb 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_swapuv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_swapuv.c
@@ -56,10 +56,10 @@ static int is_planar_yuv(const AVPixFmtDescriptor *desc)
if (desc->flags & ~(AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA) ||
desc->nb_components < 3 ||
- (desc->comp[1].depth_minus1 != desc->comp[2].depth_minus1))
+ (desc->comp[1].depth != desc->comp[2].depth))
return 0;
for (i = 0; i < desc->nb_components; i++) {
- if (desc->comp[i].offset_plus1 != 1 ||
+ if (desc->comp[i].offset != 0 ||
desc->comp[i].shift != 0 ||
desc->comp[i].plane != i)
return 0;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_thumbnail.c b/chromium/third_party/ffmpeg/libavfilter/vf_thumbnail.c
index d70d0635a38..c378791666c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_thumbnail.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_thumbnail.c
@@ -58,15 +58,15 @@ AVFILTER_DEFINE_CLASS(thumbnail);
static av_cold int init(AVFilterContext *ctx)
{
- ThumbContext *thumb = ctx->priv;
+ ThumbContext *s = ctx->priv;
- thumb->frames = av_calloc(thumb->n_frames, sizeof(*thumb->frames));
- if (!thumb->frames) {
+ s->frames = av_calloc(s->n_frames, sizeof(*s->frames));
+ if (!s->frames) {
av_log(ctx, AV_LOG_ERROR,
"Allocation failure, try to lower the number of frames\n");
return AVERROR(ENOMEM);
}
- av_log(ctx, AV_LOG_VERBOSE, "batch size: %d frames\n", thumb->n_frames);
+ av_log(ctx, AV_LOG_VERBOSE, "batch size: %d frames\n", s->n_frames);
return 0;
}
@@ -91,39 +91,39 @@ static double frame_sum_square_err(const int *hist, const double *median)
static AVFrame *get_best_frame(AVFilterContext *ctx)
{
AVFrame *picref;
- ThumbContext *thumb = ctx->priv;
+ ThumbContext *s = ctx->priv;
int i, j, best_frame_idx = 0;
- int nb_frames = thumb->n;
+ int nb_frames = s->n;
double avg_hist[HIST_SIZE] = {0}, sq_err, min_sq_err = -1;
// average histogram of the N frames
for (j = 0; j < FF_ARRAY_ELEMS(avg_hist); j++) {
for (i = 0; i < nb_frames; i++)
- avg_hist[j] += (double)thumb->frames[i].histogram[j];
+ avg_hist[j] += (double)s->frames[i].histogram[j];
avg_hist[j] /= nb_frames;
}
// find the frame closer to the average using the sum of squared errors
for (i = 0; i < nb_frames; i++) {
- sq_err = frame_sum_square_err(thumb->frames[i].histogram, avg_hist);
+ sq_err = frame_sum_square_err(s->frames[i].histogram, avg_hist);
if (i == 0 || sq_err < min_sq_err)
best_frame_idx = i, min_sq_err = sq_err;
}
// free and reset everything (except the best frame buffer)
for (i = 0; i < nb_frames; i++) {
- memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
+ memset(s->frames[i].histogram, 0, sizeof(s->frames[i].histogram));
if (i != best_frame_idx)
- av_frame_free(&thumb->frames[i].buf);
+ av_frame_free(&s->frames[i].buf);
}
- thumb->n = 0;
+ s->n = 0;
// raise the chosen one
- picref = thumb->frames[best_frame_idx].buf;
+ picref = s->frames[best_frame_idx].buf;
av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected "
"from a set of %d images\n", best_frame_idx,
- picref->pts * av_q2d(thumb->tb), nb_frames);
- thumb->frames[best_frame_idx].buf = NULL;
+ picref->pts * av_q2d(s->tb), nb_frames);
+ s->frames[best_frame_idx].buf = NULL;
return picref;
}
@@ -132,13 +132,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
int i, j;
AVFilterContext *ctx = inlink->dst;
- ThumbContext *thumb = ctx->priv;
+ ThumbContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
- int *hist = thumb->frames[thumb->n].histogram;
+ int *hist = s->frames[s->n].histogram;
const uint8_t *p = frame->data[0];
// keep a reference of each frame
- thumb->frames[thumb->n].buf = frame;
+ s->frames[s->n].buf = frame;
// update current frame RGB histogram
for (j = 0; j < inlink->h; j++) {
@@ -151,8 +151,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
// no selection until the buffer of N frames is filled up
- thumb->n++;
- if (thumb->n < thumb->n_frames)
+ s->n++;
+ if (s->n < s->n_frames)
return 0;
return ff_filter_frame(outlink, get_best_frame(ctx));
@@ -161,22 +161,22 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static av_cold void uninit(AVFilterContext *ctx)
{
int i;
- ThumbContext *thumb = ctx->priv;
- for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++)
- av_frame_free(&thumb->frames[i].buf);
- av_freep(&thumb->frames);
+ ThumbContext *s = ctx->priv;
+ for (i = 0; i < s->n_frames && s->frames[i].buf; i++)
+ av_frame_free(&s->frames[i].buf);
+ av_freep(&s->frames);
}
static int request_frame(AVFilterLink *link)
{
AVFilterContext *ctx = link->src;
- ThumbContext *thumb = ctx->priv;
+ ThumbContext *s = ctx->priv;
/* loop until a frame thumbnail is available (when a frame is queued,
- * thumb->n is reset to zero) */
+ * s->n is reset to zero) */
do {
int ret = ff_request_frame(ctx->inputs[0]);
- if (ret == AVERROR_EOF && thumb->n) {
+ if (ret == AVERROR_EOF && s->n) {
ret = ff_filter_frame(link, get_best_frame(ctx));
if (ret < 0)
return ret;
@@ -184,16 +184,16 @@ static int request_frame(AVFilterLink *link)
}
if (ret < 0)
return ret;
- } while (thumb->n);
+ } while (s->n);
return 0;
}
static int config_props(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
- ThumbContext *thumb = ctx->priv;
+ ThumbContext *s = ctx->priv;
- thumb->tb = inlink->time_base;
+ s->tb = inlink->time_base;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c b/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
index 911329caac9..484b8e874ec 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_transpose.c
@@ -81,32 +81,32 @@ static int query_formats(AVFilterContext *ctx)
static int config_props_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
- TransContext *trans = ctx->priv;
+ TransContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
const AVPixFmtDescriptor *desc_out = av_pix_fmt_desc_get(outlink->format);
const AVPixFmtDescriptor *desc_in = av_pix_fmt_desc_get(inlink->format);
- if (trans->dir&4) {
+ if (s->dir&4) {
av_log(ctx, AV_LOG_WARNING,
"dir values greater than 3 are deprecated, use the passthrough option instead\n");
- trans->dir &= 3;
- trans->passthrough = TRANSPOSE_PT_TYPE_LANDSCAPE;
+ s->dir &= 3;
+ s->passthrough = TRANSPOSE_PT_TYPE_LANDSCAPE;
}
- if ((inlink->w >= inlink->h && trans->passthrough == TRANSPOSE_PT_TYPE_LANDSCAPE) ||
- (inlink->w <= inlink->h && trans->passthrough == TRANSPOSE_PT_TYPE_PORTRAIT)) {
+ if ((inlink->w >= inlink->h && s->passthrough == TRANSPOSE_PT_TYPE_LANDSCAPE) ||
+ (inlink->w <= inlink->h && s->passthrough == TRANSPOSE_PT_TYPE_PORTRAIT)) {
av_log(ctx, AV_LOG_VERBOSE,
"w:%d h:%d -> w:%d h:%d (passthrough mode)\n",
inlink->w, inlink->h, inlink->w, inlink->h);
return 0;
} else {
- trans->passthrough = TRANSPOSE_PT_TYPE_NONE;
+ s->passthrough = TRANSPOSE_PT_TYPE_NONE;
}
- trans->hsub = desc_in->log2_chroma_w;
- trans->vsub = desc_in->log2_chroma_h;
+ s->hsub = desc_in->log2_chroma_w;
+ s->vsub = desc_in->log2_chroma_h;
- av_image_fill_max_pixsteps(trans->pixsteps, NULL, desc_out);
+ av_image_fill_max_pixsteps(s->pixsteps, NULL, desc_out);
outlink->w = inlink->h;
outlink->h = inlink->w;
@@ -119,17 +119,17 @@ static int config_props_output(AVFilterLink *outlink)
av_log(ctx, AV_LOG_VERBOSE,
"w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
- inlink->w, inlink->h, trans->dir, outlink->w, outlink->h,
- trans->dir == 1 || trans->dir == 3 ? "clockwise" : "counterclockwise",
- trans->dir == 0 || trans->dir == 3);
+ inlink->w, inlink->h, s->dir, outlink->w, outlink->h,
+ s->dir == 1 || s->dir == 3 ? "clockwise" : "counterclockwise",
+ s->dir == 0 || s->dir == 3);
return 0;
}
static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
{
- TransContext *trans = inlink->dst->priv;
+ TransContext *s = inlink->dst->priv;
- return trans->passthrough ?
+ return s->passthrough ?
ff_null_get_video_buffer (inlink, w, h) :
ff_default_get_video_buffer(inlink, w, h);
}
@@ -141,17 +141,17 @@ typedef struct ThreadData {
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
int nb_jobs)
{
- TransContext *trans = ctx->priv;
+ TransContext *s = ctx->priv;
ThreadData *td = arg;
AVFrame *out = td->out;
AVFrame *in = td->in;
int plane;
for (plane = 0; out->data[plane]; plane++) {
- int hsub = plane == 1 || plane == 2 ? trans->hsub : 0;
- int vsub = plane == 1 || plane == 2 ? trans->vsub : 0;
- int pixstep = trans->pixsteps[plane];
- int inh = in->height >> vsub;
+ int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
+ int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
+ int pixstep = s->pixsteps[plane];
+ int inh = FF_CEIL_RSHIFT(in->height, vsub);
int outw = FF_CEIL_RSHIFT(out->width, hsub);
int outh = FF_CEIL_RSHIFT(out->height, vsub);
int start = (outh * jobnr ) / nb_jobs;
@@ -165,12 +165,12 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
src = in->data[plane];
srclinesize = in->linesize[plane];
- if (trans->dir & 1) {
+ if (s->dir & 1) {
src += in->linesize[plane] * (inh - 1);
srclinesize *= -1;
}
- if (trans->dir & 2) {
+ if (s->dir & 2) {
dst = out->data[plane] + dstlinesize * (outh - start - 1);
dstlinesize *= -1;
}
@@ -226,12 +226,12 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr,
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
- TransContext *trans = ctx->priv;
+ TransContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
ThreadData td;
AVFrame *out;
- if (trans->passthrough)
+ if (s->passthrough)
return ff_filter_frame(outlink, in);
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c b/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
index d5f5018ce4e..a56b0234607 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
@@ -105,15 +105,15 @@ static void apply_unsharp( uint8_t *dst, int dst_stride,
static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
{
AVFilterLink *inlink = ctx->inputs[0];
- UnsharpContext *unsharp = ctx->priv;
+ UnsharpContext *s = ctx->priv;
int i, plane_w[3], plane_h[3];
UnsharpFilterParam *fp[3];
plane_w[0] = inlink->w;
- plane_w[1] = plane_w[2] = FF_CEIL_RSHIFT(inlink->w, unsharp->hsub);
+ plane_w[1] = plane_w[2] = FF_CEIL_RSHIFT(inlink->w, s->hsub);
plane_h[0] = inlink->h;
- plane_h[1] = plane_h[2] = FF_CEIL_RSHIFT(inlink->h, unsharp->vsub);
- fp[0] = &unsharp->luma;
- fp[1] = fp[2] = &unsharp->chroma;
+ plane_h[1] = plane_h[2] = FF_CEIL_RSHIFT(inlink->h, s->vsub);
+ 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]);
}
@@ -135,19 +135,19 @@ static void set_filter_param(UnsharpFilterParam *fp, int msize_x, int msize_y, f
static av_cold int init(AVFilterContext *ctx)
{
int ret = 0;
- UnsharpContext *unsharp = ctx->priv;
+ UnsharpContext *s = ctx->priv;
- set_filter_param(&unsharp->luma, unsharp->lmsize_x, unsharp->lmsize_y, unsharp->lamount);
- set_filter_param(&unsharp->chroma, unsharp->cmsize_x, unsharp->cmsize_y, unsharp->camount);
+ set_filter_param(&s->luma, s->lmsize_x, s->lmsize_y, s->lamount);
+ set_filter_param(&s->chroma, s->cmsize_x, s->cmsize_y, s->camount);
- unsharp->apply_unsharp = apply_unsharp_c;
- if (!CONFIG_OPENCL && unsharp->opencl) {
+ s->apply_unsharp = apply_unsharp_c;
+ if (!CONFIG_OPENCL && s->opencl) {
av_log(ctx, AV_LOG_ERROR, "OpenCL support was not enabled in this build, cannot be selected\n");
return AVERROR(EINVAL);
}
- if (CONFIG_OPENCL && unsharp->opencl) {
- unsharp->apply_unsharp = ff_opencl_apply_unsharp;
+ if (CONFIG_OPENCL && s->opencl) {
+ s->apply_unsharp = ff_opencl_apply_unsharp;
ret = ff_opencl_unsharp_init(ctx);
if (ret < 0)
return ret;
@@ -194,17 +194,17 @@ static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const
static int config_props(AVFilterLink *link)
{
- UnsharpContext *unsharp = link->dst->priv;
+ UnsharpContext *s = link->dst->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
int ret;
- unsharp->hsub = desc->log2_chroma_w;
- unsharp->vsub = desc->log2_chroma_h;
+ s->hsub = desc->log2_chroma_w;
+ s->vsub = desc->log2_chroma_h;
- ret = init_filter_param(link->dst, &unsharp->luma, "luma", link->w);
+ ret = init_filter_param(link->dst, &s->luma, "luma", link->w);
if (ret < 0)
return ret;
- ret = init_filter_param(link->dst, &unsharp->chroma, "chroma", FF_CEIL_RSHIFT(link->w, unsharp->hsub));
+ ret = init_filter_param(link->dst, &s->chroma, "chroma", FF_CEIL_RSHIFT(link->w, s->hsub));
if (ret < 0)
return ret;
@@ -221,19 +221,19 @@ static void free_filter_param(UnsharpFilterParam *fp)
static av_cold void uninit(AVFilterContext *ctx)
{
- UnsharpContext *unsharp = ctx->priv;
+ UnsharpContext *s = ctx->priv;
- if (CONFIG_OPENCL && unsharp->opencl) {
+ if (CONFIG_OPENCL && s->opencl) {
ff_opencl_unsharp_uninit(ctx);
}
- free_filter_param(&unsharp->luma);
- free_filter_param(&unsharp->chroma);
+ free_filter_param(&s->luma);
+ free_filter_param(&s->chroma);
}
static int filter_frame(AVFilterLink *link, AVFrame *in)
{
- UnsharpContext *unsharp = link->dst->priv;
+ UnsharpContext *s = link->dst->priv;
AVFilterLink *outlink = link->dst->outputs[0];
AVFrame *out;
int ret = 0;
@@ -244,13 +244,13 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
- if (CONFIG_OPENCL && unsharp->opencl) {
+ if (CONFIG_OPENCL && s->opencl) {
ret = ff_opencl_unsharp_process_inout_buf(link->dst, in, out);
if (ret < 0)
goto end;
}
- ret = unsharp->apply_unsharp(link->dst, in, out);
+ ret = s->apply_unsharp(link->dst, in, out);
end:
av_frame_free(&in);
@@ -276,7 +276,7 @@ static const AVOption unsharp_options[] = {
{ "cy", "set chroma matrix vertical size", OFFSET(cmsize_y), AV_OPT_TYPE_INT, { .i64 = 5 }, MIN_SIZE, MAX_SIZE, FLAGS },
{ "chroma_amount", "set chroma effect strength", OFFSET(camount), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, -2, 5, FLAGS },
{ "ca", "set chroma effect strength", OFFSET(camount), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, -2, 5, FLAGS },
- { "opencl", "use OpenCL filtering capabilities", OFFSET(opencl), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+ { "opencl", "use OpenCL filtering capabilities", OFFSET(opencl), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_uspp.c b/chromium/third_party/ffmpeg/libavfilter/vf_uspp.c
index 82ee99760c8..bd6c680eed5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_uspp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_uspp.c
@@ -61,7 +61,7 @@ typedef struct {
static const AVOption uspp_options[] = {
{ "quality", "set quality", OFFSET(log2_count), AV_OPT_TYPE_INT, {.i64 = 3}, 0, MAX_LEVEL, FLAGS },
{ "qp", "force a constant quantizer parameter", OFFSET(qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, FLAGS },
- { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
+ { "use_bframe_qp", "use B-frames' QP", OFFSET(use_bframe_qp), AV_OPT_TYPE_BOOL,{.i64 = 0}, 0, 1, FLAGS },
{ NULL }
};
@@ -351,7 +351,7 @@ static int config_input(AVFilterLink *inlink)
avctx_enc->gop_size = INT_MAX;
avctx_enc->max_b_frames = 0;
avctx_enc->pix_fmt = inlink->format;
- avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY;
+ avctx_enc->flags = AV_CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY;
avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
avctx_enc->global_quality = 123;
av_dict_set(&opts, "no_bitstream", "1", 0);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vectorscope.c b/chromium/third_party/ffmpeg/libavfilter/vf_vectorscope.c
new file mode 100644
index 00000000000..730f55f5fb2
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vectorscope.c
@@ -0,0 +1,730 @@
+/*
+ * Copyright (c) 2015 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/avassert.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+enum VectorscopeMode {
+ GRAY,
+ COLOR,
+ COLOR2,
+ COLOR3,
+ COLOR4,
+ MODE_NB
+};
+
+typedef struct VectorscopeContext {
+ const AVClass *class;
+ int mode;
+ int intensity;
+ float fintensity;
+ const uint8_t *bg_color;
+ int planewidth[4];
+ int planeheight[4];
+ int hsub, vsub;
+ int x, y, pd;
+ int is_yuv;
+ int size;
+ int mult;
+ int envelope;
+ uint8_t peak[1024][1024];
+
+ void (*vectorscope)(struct VectorscopeContext *s,
+ AVFrame *in, AVFrame *out, int pd);
+} VectorscopeContext;
+
+#define OFFSET(x) offsetof(VectorscopeContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption vectorscope_options[] = {
+ { "mode", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
+ { "m", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
+ { "gray", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAY}, 0, 0, FLAGS, "mode" },
+ { "color", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "mode" },
+ { "color2", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR2}, 0, 0, FLAGS, "mode" },
+ { "color3", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR3}, 0, 0, FLAGS, "mode" },
+ { "color4", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR4}, 0, 0, FLAGS, "mode" },
+ { "x", "set color component on X axis", OFFSET(x), AV_OPT_TYPE_INT, {.i64=1}, 0, 2, FLAGS},
+ { "y", "set color component on Y axis", OFFSET(y), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS},
+ { "intensity", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
+ { "i", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
+ { "envelope", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
+ { "e", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
+ { "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "envelope" },
+ { "instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "envelope" },
+ { "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "envelope" },
+ { "peak+instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "envelope" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(vectorscope);
+
+static const enum AVPixelFormat out_yuv8_pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat out_yuv9_pix_fmts[] = {
+ AV_PIX_FMT_YUV444P9,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat out_yuv10_pix_fmts[] = {
+ AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat out_rgb8_pix_fmts[] = {
+ AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat out_rgb9_pix_fmts[] = {
+ AV_PIX_FMT_GBRP9,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat out_rgb10_pix_fmts[] = {
+ AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat in1_pix_fmts[] = {
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat in2_pix_fmts[] = {
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ 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_NONE
+};
+
+static int query_formats(AVFilterContext *ctx)
+{
+ VectorscopeContext *s = ctx->priv;
+ const enum AVPixelFormat *out_pix_fmts;
+ const AVPixFmtDescriptor *desc;
+ AVFilterFormats *avff;
+ int depth, rgb, i;
+
+ if (!ctx->inputs[0]->in_formats ||
+ !ctx->inputs[0]->in_formats->nb_formats) {
+ return AVERROR(EAGAIN);
+ }
+
+ if (!ctx->inputs[0]->out_formats) {
+ const enum AVPixelFormat *in_pix_fmts;
+
+ if ((s->x == 1 && s->y == 2) || (s->x == 2 && s->y == 1))
+ in_pix_fmts = in2_pix_fmts;
+ else
+ in_pix_fmts = in1_pix_fmts;
+ ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->out_formats);
+ }
+
+ avff = ctx->inputs[0]->in_formats;
+ desc = av_pix_fmt_desc_get(avff->formats[0]);
+ rgb = desc->flags & AV_PIX_FMT_FLAG_RGB;
+ depth = desc->comp[0].depth;
+ for (i = 1; i < avff->nb_formats; i++) {
+ desc = av_pix_fmt_desc_get(avff->formats[i]);
+ if (rgb != (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
+ depth != desc->comp[0].depth)
+ return AVERROR(EAGAIN);
+ }
+
+ if (rgb && depth == 8)
+ out_pix_fmts = out_rgb8_pix_fmts;
+ else if (rgb && depth == 9)
+ out_pix_fmts = out_rgb9_pix_fmts;
+ else if (rgb && depth == 10)
+ out_pix_fmts = out_rgb10_pix_fmts;
+ else if (depth == 9)
+ out_pix_fmts = out_yuv9_pix_fmts;
+ else if (depth == 10)
+ out_pix_fmts = out_yuv10_pix_fmts;
+ else
+ out_pix_fmts = out_yuv8_pix_fmts;
+ ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats);
+
+ return 0;
+}
+
+static const uint8_t black_yuva_color[4] = { 0, 127, 127, 0 };
+static const uint8_t black_gbrp_color[4] = { 0, 0, 0, 0 };
+
+static int config_output(AVFilterLink *outlink)
+{
+ VectorscopeContext *s = outlink->src->priv;
+
+ s->intensity = s->fintensity * (s->size - 1);
+ outlink->h = outlink->w = s->size;
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+ return 0;
+}
+
+static void envelope_instant16(VectorscopeContext *s, AVFrame *out)
+{
+ const int dlinesize = out->linesize[0] / 2;
+ uint16_t *dpd = s->mode == COLOR || !s->is_yuv ? (uint16_t *)out->data[s->pd] : (uint16_t *)out->data[0];
+ const int max = s->size - 1;
+ int i, j;
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+ const int poa = (i - 1) * dlinesize + j;
+ const int pob = (i + 1) * dlinesize + j;
+
+ if (dpd[pos] && (((!j || !dpd[pos - 1]) || ((j == (out->width - 1)) || !dpd[pos + 1]))
+ || ((!i || !dpd[poa]) || ((i == (out->height - 1)) || !dpd[pob])))) {
+ dpd[pos] = max;
+ }
+ }
+ }
+}
+
+static void envelope_peak16(VectorscopeContext *s, AVFrame *out)
+{
+ const int dlinesize = out->linesize[0] / 2;
+ uint16_t *dpd = s->mode == COLOR || !s->is_yuv ? (uint16_t *)out->data[s->pd] : (uint16_t *)out->data[0];
+ const int max = s->size - 1;
+ int i, j;
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+
+ if (dpd[pos])
+ s->peak[i][j] = 1;
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant16(s, out);
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+
+ if (s->peak[i][j] && (((!j || !s->peak[i][j-1]) || ((j == (out->width - 1)) || !s->peak[i][j + 1]))
+ || ((!i || !s->peak[i-1][j]) || ((i == (out->height - 1)) || !s->peak[i + 1][j])))) {
+ dpd[pos] = max;
+ }
+ }
+ }
+}
+
+static void envelope_instant(VectorscopeContext *s, AVFrame *out)
+{
+ const int dlinesize = out->linesize[0];
+ uint8_t *dpd = s->mode == COLOR || !s->is_yuv ? out->data[s->pd] : out->data[0];
+ int i, j;
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+ const int poa = (i - 1) * dlinesize + j;
+ const int pob = (i + 1) * dlinesize + j;
+
+ if (dpd[pos] && (((!j || !dpd[pos - 1]) || ((j == (out->width - 1)) || !dpd[pos + 1]))
+ || ((!i || !dpd[poa]) || ((i == (out->height - 1)) || !dpd[pob])))) {
+ dpd[pos] = 255;
+ }
+ }
+ }
+}
+
+static void envelope_peak(VectorscopeContext *s, AVFrame *out)
+{
+ const int dlinesize = out->linesize[0];
+ uint8_t *dpd = s->mode == COLOR || !s->is_yuv ? out->data[s->pd] : out->data[0];
+ int i, j;
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+
+ if (dpd[pos])
+ s->peak[i][j] = 1;
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant(s, out);
+
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ const int pos = i * dlinesize + j;
+
+ if (s->peak[i][j] && (((!j || !s->peak[i][j-1]) || ((j == (out->width - 1)) || !s->peak[i][j + 1]))
+ || ((!i || !s->peak[i-1][j]) || ((i == (out->height - 1)) || !s->peak[i + 1][j])))) {
+ dpd[pos] = 255;
+ }
+ }
+ }
+}
+
+static void envelope16(VectorscopeContext *s, AVFrame *out)
+{
+ if (!s->envelope) {
+ return;
+ } else if (s->envelope == 1) {
+ envelope_instant16(s, out);
+ } else {
+ envelope_peak16(s, out);
+ }
+}
+
+static void envelope(VectorscopeContext *s, AVFrame *out)
+{
+ if (!s->envelope) {
+ return;
+ } else if (s->envelope == 1) {
+ envelope_instant(s, out);
+ } else {
+ envelope_peak(s, out);
+ }
+}
+
+static void vectorscope16(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
+{
+ const uint16_t * const *src = (const uint16_t * const *)in->data;
+ const int slinesizex = in->linesize[s->x] / 2;
+ const int slinesizey = in->linesize[s->y] / 2;
+ const int slinesized = in->linesize[pd] / 2;
+ const int dlinesize = out->linesize[0] / 2;
+ const int intensity = s->intensity;
+ const int px = s->x, py = s->y;
+ const int h = s->planeheight[py];
+ const int w = s->planewidth[px];
+ const uint16_t *spx = src[px];
+ const uint16_t *spy = src[py];
+ const uint16_t *spd = src[pd];
+ const int hsub = s->hsub;
+ const int vsub = s->vsub;
+ uint16_t **dst = (uint16_t **)out->data;
+ uint16_t *dpx = dst[px];
+ uint16_t *dpy = dst[py];
+ uint16_t *dpd = dst[pd];
+ const int max = s->size - 1;
+ const int mid = s->size / 2;
+ int i, j, k;
+
+ for (k = 0; k < 4 && dst[k]; k++) {
+ const int mult = s->mult;
+
+ for (i = 0; i < out->height ; i++)
+ for (j = 0; j < out->width; j++)
+ AV_WN16(out->data[k] + i * out->linesize[k] + j * 2,
+ s->mode == COLOR && k == s->pd ? 0 : s->bg_color[k] * mult);
+ }
+
+ switch (s->mode) {
+ case COLOR:
+ case GRAY:
+ if (s->is_yuv) {
+ for (i = 0; i < h; i++) {
+ const int iwx = i * slinesizex;
+ const int iwy = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = FFMIN(spx[iwx + j], max);
+ const int y = FFMIN(spy[iwy + j], max);
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMIN(dpd[pos] + intensity, max);
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ } else {
+ for (i = 0; i < h; i++) {
+ const int iwx = i * slinesizex;
+ const int iwy = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = FFMIN(spx[iwx + j], max);
+ const int y = FFMIN(spy[iwy + j], max);
+ const int pos = y * dlinesize + x;
+
+ dst[0][pos] = FFMIN(dst[0][pos] + intensity, max);
+ dst[1][pos] = FFMIN(dst[1][pos] + intensity, max);
+ dst[2][pos] = FFMIN(dst[2][pos] + intensity, max);
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ }
+ break;
+ case COLOR2:
+ if (s->is_yuv) {
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = FFMIN(spx[iw1 + j], max);
+ const int y = FFMIN(spy[iw2 + j], max);
+ const int pos = y * dlinesize + x;
+
+ if (!dpd[pos])
+ dpd[pos] = FFABS(mid - x) + FFABS(mid - y);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ } else {
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = FFMIN(spx[iw1 + j], max);
+ const int y = FFMIN(spy[iw2 + j], max);
+ const int pos = y * dlinesize + x;
+
+ if (!dpd[pos])
+ dpd[pos] = FFMIN(x + y, max);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ }
+ break;
+ case COLOR3:
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = FFMIN(spx[iw1 + j], max);
+ const int y = FFMIN(spy[iw2 + j], max);
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMIN(max, dpd[pos] + intensity);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ break;
+ case COLOR4:
+ for (i = 0; i < in->height; i++) {
+ const int iwx = (i >> vsub) * slinesizex;
+ const int iwy = (i >> vsub) * slinesizey;
+ const int iwd = i * slinesized;
+ for (j = 0; j < in->width; j++) {
+ const int x = FFMIN(spx[iwx + (j >> hsub)], max);
+ const int y = FFMIN(spy[iwy + (j >> hsub)], max);
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMAX(spd[iwd + j], dpd[pos]);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = max;
+ }
+ }
+ break;
+ default:
+ av_assert0(0);
+ }
+
+ envelope16(s, out);
+
+ if (s->mode == COLOR) {
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ if (!dpd[i * dlinesize + j]) {
+ dpx[i * dlinesize + j] = j;
+ dpy[i * dlinesize + j] = i;
+ dpd[i * dlinesize + j] = mid;
+ }
+ }
+ }
+ }
+}
+
+static void vectorscope8(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
+{
+ const uint8_t * const *src = (const uint8_t * const *)in->data;
+ const int slinesizex = in->linesize[s->x];
+ const int slinesizey = in->linesize[s->y];
+ const int slinesized = in->linesize[pd];
+ const int dlinesize = out->linesize[0];
+ const int intensity = s->intensity;
+ const int px = s->x, py = s->y;
+ const int h = s->planeheight[py];
+ const int w = s->planewidth[px];
+ const uint8_t *spx = src[px];
+ const uint8_t *spy = src[py];
+ const uint8_t *spd = src[pd];
+ const int hsub = s->hsub;
+ const int vsub = s->vsub;
+ uint8_t **dst = out->data;
+ uint8_t *dpx = dst[px];
+ uint8_t *dpy = dst[py];
+ uint8_t *dpd = dst[pd];
+ int i, j, k;
+
+ for (k = 0; k < 4 && dst[k]; k++)
+ for (i = 0; i < out->height ; i++)
+ memset(dst[k] + i * out->linesize[k],
+ s->mode == COLOR && k == s->pd ? 0 : s->bg_color[k], out->width);
+
+ switch (s->mode) {
+ case COLOR:
+ case GRAY:
+ if (s->is_yuv) {
+ for (i = 0; i < h; i++) {
+ const int iwx = i * slinesizex;
+ const int iwy = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = spx[iwx + j];
+ const int y = spy[iwy + j];
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMIN(dpd[pos] + intensity, 255);
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ } else {
+ for (i = 0; i < h; i++) {
+ const int iwx = i * slinesizex;
+ const int iwy = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = spx[iwx + j];
+ const int y = spy[iwy + j];
+ const int pos = y * dlinesize + x;
+
+ dst[0][pos] = FFMIN(dst[0][pos] + intensity, 255);
+ dst[1][pos] = FFMIN(dst[1][pos] + intensity, 255);
+ dst[2][pos] = FFMIN(dst[2][pos] + intensity, 255);
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ }
+ break;
+ case COLOR2:
+ if (s->is_yuv) {
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = spx[iw1 + j];
+ const int y = spy[iw2 + j];
+ const int pos = y * dlinesize + x;
+
+ if (!dpd[pos])
+ dpd[pos] = FFABS(128 - x) + FFABS(128 - y);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ } else {
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = spx[iw1 + j];
+ const int y = spy[iw2 + j];
+ const int pos = y * dlinesize + x;
+
+ if (!dpd[pos])
+ dpd[pos] = FFMIN(x + y, 255);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ }
+ break;
+ case COLOR3:
+ for (i = 0; i < h; i++) {
+ const int iw1 = i * slinesizex;
+ const int iw2 = i * slinesizey;
+ for (j = 0; j < w; j++) {
+ const int x = spx[iw1 + j];
+ const int y = spy[iw2 + j];
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMIN(255, dpd[pos] + intensity);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ break;
+ case COLOR4:
+ for (i = 0; i < in->height; i++) {
+ const int iwx = (i >> vsub) * slinesizex;
+ const int iwy = (i >> vsub) * slinesizey;
+ const int iwd = i * slinesized;
+ for (j = 0; j < in->width; j++) {
+ const int x = spx[iwx + (j >> hsub)];
+ const int y = spy[iwy + (j >> hsub)];
+ const int pos = y * dlinesize + x;
+
+ dpd[pos] = FFMAX(spd[iwd + j], dpd[pos]);
+ dpx[pos] = x;
+ dpy[pos] = y;
+ if (dst[3])
+ dst[3][pos] = 255;
+ }
+ }
+ break;
+ default:
+ av_assert0(0);
+ }
+
+ envelope(s, out);
+
+ if (s->mode == COLOR) {
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ if (!dpd[i * out->linesize[pd] + j]) {
+ dpx[i * out->linesize[px] + j] = j;
+ dpy[i * out->linesize[py] + j] = i;
+ dpd[i * out->linesize[pd] + j] = 128;
+ }
+ }
+ }
+ }
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ VectorscopeContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *out;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ out->pts = in->pts;
+
+ s->vectorscope(s, in, out, s->pd);
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, out);
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+ VectorscopeContext *s = inlink->dst->priv;
+
+ s->is_yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB);
+ s->size = 1 << desc->comp[0].depth;
+ s->mult = s->size / 256;
+
+ if (s->mode == GRAY && s->is_yuv)
+ s->pd = 0;
+ else {
+ if ((s->x == 1 && s->y == 2) || (s->x == 2 && s->y == 1))
+ s->pd = 0;
+ else if ((s->x == 0 && s->y == 2) || (s->x == 2 && s->y == 0))
+ s->pd = 1;
+ else if ((s->x == 0 && s->y == 1) || (s->x == 1 && s->y == 0))
+ s->pd = 2;
+ }
+
+ if (s->size == 256)
+ s->vectorscope = vectorscope8;
+ else
+ s->vectorscope = vectorscope16;
+
+ switch (inlink->format) {
+ case AV_PIX_FMT_GBRP10:
+ case AV_PIX_FMT_GBRP9:
+ case AV_PIX_FMT_GBRAP:
+ case AV_PIX_FMT_GBRP:
+ s->bg_color = black_gbrp_color;
+ break;
+ default:
+ s->bg_color = black_yuva_color;
+ }
+
+ s->hsub = desc->log2_chroma_w;
+ s->vsub = desc->log2_chroma_h;
+ s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+ s->planeheight[0] = s->planeheight[3] = inlink->h;
+ s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ s->planewidth[0] = s->planewidth[3] = inlink->w;
+
+ return 0;
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_vectorscope = {
+ .name = "vectorscope",
+ .description = NULL_IF_CONFIG_SMALL("Video vectorscope."),
+ .priv_size = sizeof(VectorscopeContext),
+ .priv_class = &vectorscope_class,
+ .query_formats = query_formats,
+ .inputs = inputs,
+ .outputs = outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
index 97e6661d37a..dac0a2d19e5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vidstabtransform.c
@@ -96,9 +96,9 @@ static const AVOption vidstabtransform_options[] = {
AV_OPT_TYPE_CONST, {.i64 = VS_BiCubic },0, 0, FLAGS, "interpol"},
{"tripod", "enable virtual tripod mode (same as relative=0:smoothing=0)", OFFSET(tripod),
- AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
+ AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS},
{"debug", "enable debug mode and writer global motions information to file", OFFSET(debug),
- AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
+ AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS},
{NULL}
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vignette.c b/chromium/third_party/ffmpeg/libavfilter/vf_vignette.c
index c1bafa8951d..54515e6087a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vignette.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vignette.c
@@ -90,7 +90,7 @@ static const AVOption vignette_options[] = {
{ "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, "eval" },
{ "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
{ "frame", "eval expressions for each frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
- { "dither", "set dithering", OFFSET(do_dither), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS },
+ { "dither", "set dithering", OFFSET(do_dither), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
{ "aspect", "set aspect ratio", OFFSET(aspect), AV_OPT_TYPE_RATIONAL, {.dbl = 1}, 0, DBL_MAX, .flags = FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_w3fdif.c b/chromium/third_party/ffmpeg/libavfilter/vf_w3fdif.c
index bb0316b3dc2..bbd8db00d31 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_w3fdif.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_w3fdif.c
@@ -40,7 +40,8 @@ typedef struct W3FDIFContext {
int eof;
int nb_planes;
AVFrame *prev, *cur, *next; ///< previous, current, next frames
- int32_t *work_line; ///< line we are calculating
+ int32_t **work_line; ///< lines we are calculating
+ int nb_threads;
} W3FDIFContext;
#define OFFSET(x) offsetof(W3FDIFContext, x)
@@ -82,9 +83,10 @@ static int query_formats(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
{
- W3FDIFContext *s = inlink->dst->priv;
+ AVFilterContext *ctx = inlink->dst;
+ W3FDIFContext *s = ctx->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- int ret;
+ int ret, i;
if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
return ret;
@@ -93,10 +95,17 @@ static int config_input(AVFilterLink *inlink)
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
- s->work_line = av_calloc(s->linesize[0], sizeof(*s->work_line));
+ s->nb_threads = ctx->graph->nb_threads;
+ s->work_line = av_calloc(s->nb_threads, sizeof(*s->work_line));
if (!s->work_line)
return AVERROR(ENOMEM);
+ for (i = 0; i < s->nb_threads; i++) {
+ s->work_line[i] = av_calloc(s->linesize[0], sizeof(*s->work_line[0]));
+ if (!s->work_line[i])
+ return AVERROR(ENOMEM);
+ }
+
return 0;
}
@@ -128,11 +137,20 @@ static const int8_t n_coef_hf[2] = { 3, 5 };
static const int32_t coef_hf[2][5] = {{ -4096, 8192, -4096, 0, 0},
{ 2032, -7602, 11140, -7602, 2032}};
-static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
- const AVFrame *cur, const AVFrame *adj,
- const int filter, const int plane)
+typedef struct ThreadData {
+ AVFrame *out, *cur, *adj;
+ int plane;
+} ThreadData;
+
+static int deinterlace_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
W3FDIFContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *out = td->out;
+ AVFrame *cur = td->cur;
+ AVFrame *adj = td->adj;
+ const int plane = td->plane;
+ const int filter = s->filter;
uint8_t *in_line, *in_lines_cur[5], *in_lines_adj[5];
uint8_t *out_line, *out_pixel;
int32_t *work_line, *work_pixel;
@@ -144,15 +162,17 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
const int cur_line_stride = cur->linesize[plane];
const int adj_line_stride = adj->linesize[plane];
const int dst_line_stride = out->linesize[plane];
+ const int start = (height * jobnr) / nb_jobs;
+ const int end = (height * (jobnr+1)) / nb_jobs;
int i, j, y_in, y_out;
/* copy unchanged the lines of the field */
- y_out = s->field == cur->top_field_first;
+ y_out = start + (s->field == cur->top_field_first) - (start & 1);
in_line = cur_data + (y_out * cur_line_stride);
out_line = dst_data + (y_out * dst_line_stride);
- while (y_out < height) {
+ while (y_out < end) {
memcpy(out_line, in_line, linesize);
y_out += 2;
in_line += cur_line_stride * 2;
@@ -160,13 +180,13 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
}
/* interpolate other lines of the field */
- y_out = s->field != cur->top_field_first;
+ y_out = start + (s->field != cur->top_field_first) - (start & 1);
out_line = dst_data + (y_out * dst_line_stride);
- while (y_out < height) {
+ while (y_out < end) {
/* clear workspace */
- memset(s->work_line, 0, sizeof(*s->work_line) * linesize);
+ memset(s->work_line[jobnr], 0, sizeof(*s->work_line[jobnr]) * linesize);
/* get low vertical frequencies from current field */
for (j = 0; j < n_coef_lf[filter]; j++) {
@@ -180,7 +200,7 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
in_lines_cur[j] = cur_data + (y_in * cur_line_stride);
}
- work_line = s->work_line;
+ work_line = s->work_line[jobnr];
switch (n_coef_lf[filter]) {
case 2:
for (i = 0; i < linesize; i++) {
@@ -210,7 +230,7 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
in_lines_adj[j] = adj_data + (y_in * adj_line_stride);
}
- work_line = s->work_line;
+ work_line = s->work_line[jobnr];
switch (n_coef_hf[filter]) {
case 3:
for (i = 0; i < linesize; i++) {
@@ -238,7 +258,7 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
}
/* save scaled result to the output frame, scaling down by 256 * 256 */
- work_pixel = s->work_line;
+ work_pixel = s->work_line[jobnr];
out_pixel = out_line;
for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
@@ -248,6 +268,8 @@ static void deinterlace_plane(AVFilterContext *ctx, AVFrame *out,
y_out += 2;
out_line += dst_line_stride * 2;
}
+
+ return 0;
}
static int filter(AVFilterContext *ctx, int is_second)
@@ -255,6 +277,7 @@ static int filter(AVFilterContext *ctx, int is_second)
W3FDIFContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out, *adj;
+ ThreadData td;
int plane;
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
@@ -278,8 +301,11 @@ static int filter(AVFilterContext *ctx, int is_second)
}
adj = s->field ? s->next : s->prev;
- for (plane = 0; plane < s->nb_planes; plane++)
- deinterlace_plane(ctx, out, s->cur, adj, s->filter, plane);
+ td.out = out; td.cur = s->cur; td.adj = adj;
+ for (plane = 0; plane < s->nb_planes; plane++) {
+ td.plane = plane;
+ ctx->internal->execute(ctx, deinterlace_slice, &td, NULL, FFMIN(s->planeheight[plane], s->nb_threads));
+ }
s->field = !s->field;
@@ -355,10 +381,15 @@ static int request_frame(AVFilterLink *outlink)
static av_cold void uninit(AVFilterContext *ctx)
{
W3FDIFContext *s = ctx->priv;
+ int i;
av_frame_free(&s->prev);
av_frame_free(&s->cur );
av_frame_free(&s->next);
+
+ for (i = 0; i < s->nb_threads; i++)
+ av_freep(&s->work_line[i]);
+
av_freep(&s->work_line);
}
@@ -391,5 +422,5 @@ AVFilter ff_vf_w3fdif = {
.query_formats = query_formats,
.inputs = w3fdif_inputs,
.outputs = w3fdif_outputs,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_waveform.c b/chromium/third_party/ffmpeg/libavfilter/vf_waveform.c
new file mode 100644
index 00000000000..b68d429fb86
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_waveform.c
@@ -0,0 +1,1357 @@
+/*
+ * Copyright (c) 2012-2015 Paul B Mahol
+ * Copyright (c) 2013 Marton Balint
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "video.h"
+
+enum FilterType {
+ LOWPASS,
+ FLAT,
+ AFLAT,
+ CHROMA,
+ ACHROMA,
+ COLOR,
+ NB_FILTERS
+};
+
+typedef struct WaveformContext {
+ const AVClass *class;
+ int mode;
+ int ncomp;
+ int pcomp;
+ const uint8_t *bg_color;
+ float fintensity;
+ int intensity;
+ int mirror;
+ int display;
+ int envelope;
+ int estart[4];
+ int eend[4];
+ int *emax[4][4];
+ int *emin[4][4];
+ int *peak;
+ int filter;
+ int bits;
+ int max;
+ int size;
+ void (*waveform)(struct WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column);
+ const AVPixFmtDescriptor *desc;
+} WaveformContext;
+
+#define OFFSET(x) offsetof(WaveformContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption waveform_options[] = {
+ { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "mode" },
+ { "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "mode" },
+ { "row", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode" },
+ { "column", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode" },
+ { "intensity", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 1, FLAGS },
+ { "i", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 1, FLAGS },
+ { "mirror", "set mirroring", OFFSET(mirror), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+ { "r", "set mirroring", OFFSET(mirror), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
+ { "display", "set display mode", OFFSET(display), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "display" },
+ { "d", "set display mode", OFFSET(display), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "display" },
+ { "overlay", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "display" },
+ { "parade", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "display" },
+ { "components", "set components to display", OFFSET(pcomp), AV_OPT_TYPE_INT, {.i64=1}, 1, 15, FLAGS },
+ { "c", "set components to display", OFFSET(pcomp), AV_OPT_TYPE_INT, {.i64=1}, 1, 15, FLAGS },
+ { "envelope", "set envelope to display", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope" },
+ { "e", "set envelope to display", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope" },
+ { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "envelope" },
+ { "instant", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "envelope" },
+ { "peak", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "envelope" },
+ { "peak+instant", NULL, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "envelope" },
+ { "filter", "set filter", OFFSET(filter), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_FILTERS-1, FLAGS, "filter" },
+ { "f", "set filter", OFFSET(filter), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_FILTERS-1, FLAGS, "filter" },
+ { "lowpass", NULL, 0, AV_OPT_TYPE_CONST, {.i64=LOWPASS}, 0, 0, FLAGS, "filter" },
+ { "flat" , NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAT}, 0, 0, FLAGS, "filter" },
+ { "aflat" , NULL, 0, AV_OPT_TYPE_CONST, {.i64=AFLAT}, 0, 0, FLAGS, "filter" },
+ { "chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64=CHROMA}, 0, 0, FLAGS, "filter" },
+ { "achroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ACHROMA}, 0, 0, FLAGS, "filter" },
+ { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "filter" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(waveform);
+
+static const enum AVPixelFormat lowpass_pix_fmts[] = {
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
+ AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9,
+ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
+ AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA420P10,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat flat_pix_fmts[] = {
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat color_pix_fmts[] = {
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_NONE
+};
+
+static int query_formats(AVFilterContext *ctx)
+{
+ WaveformContext *s = ctx->priv;
+ AVFilterFormats *fmts_list;
+ const enum AVPixelFormat *pix_fmts;
+
+ switch (s->filter) {
+ case LOWPASS: pix_fmts = lowpass_pix_fmts; break;
+ case FLAT:
+ case AFLAT:
+ case CHROMA:
+ case ACHROMA: pix_fmts = flat_pix_fmts; break;
+ case COLOR: pix_fmts = color_pix_fmts; break;
+ }
+
+ fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static void envelope_instant16(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ const int dst_linesize = out->linesize[component] / 2;
+ const int bg = s->bg_color[component] * (s->max / 256);
+ const int limit = s->max - 1;
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int dst_h = FF_CEIL_RSHIFT(out->height, shift_h);
+ const int dst_w = FF_CEIL_RSHIFT(out->width, shift_w);
+ const int start = s->estart[plane];
+ const int end = s->eend[plane];
+ uint16_t *dst;
+ int x, y;
+
+ if (s->mode) {
+ for (x = 0; x < dst_w; x++) {
+ for (y = start; y < end; y++) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ dst[0] = limit;
+ break;
+ }
+ }
+ for (y = end - 1; y >= start; y--) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ dst[0] = limit;
+ break;
+ }
+ }
+ }
+ } else {
+ for (y = 0; y < dst_h; y++) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize;
+ for (x = start; x < end; x++) {
+ if (dst[x] != bg) {
+ dst[x] = limit;
+ break;
+ }
+ }
+ for (x = end - 1; x >= start; x--) {
+ if (dst[x] != bg) {
+ dst[x] = limit;
+ break;
+ }
+ }
+ }
+ }
+}
+
+static void envelope_instant(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ const int dst_linesize = out->linesize[component];
+ const uint8_t bg = s->bg_color[component];
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int dst_h = FF_CEIL_RSHIFT(out->height, shift_h);
+ const int dst_w = FF_CEIL_RSHIFT(out->width, shift_w);
+ const int start = s->estart[plane];
+ const int end = s->eend[plane];
+ uint8_t *dst;
+ int x, y;
+
+ if (s->mode) {
+ for (x = 0; x < dst_w; x++) {
+ for (y = start; y < end; y++) {
+ dst = out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ dst[0] = 255;
+ break;
+ }
+ }
+ for (y = end - 1; y >= start; y--) {
+ dst = out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ dst[0] = 255;
+ break;
+ }
+ }
+ }
+ } else {
+ for (y = 0; y < dst_h; y++) {
+ dst = out->data[component] + y * dst_linesize;
+ for (x = start; x < end; x++) {
+ if (dst[x] != bg) {
+ dst[x] = 255;
+ break;
+ }
+ }
+ for (x = end - 1; x >= start; x--) {
+ if (dst[x] != bg) {
+ dst[x] = 255;
+ break;
+ }
+ }
+ }
+ }
+}
+
+static void envelope_peak16(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ const int dst_linesize = out->linesize[component] / 2;
+ const int bg = s->bg_color[component] * (s->max / 256);
+ const int limit = s->max - 1;
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int dst_h = FF_CEIL_RSHIFT(out->height, shift_h);
+ const int dst_w = FF_CEIL_RSHIFT(out->width, shift_w);
+ const int start = s->estart[plane];
+ const int end = s->eend[plane];
+ int *emax = s->emax[plane][component];
+ int *emin = s->emin[plane][component];
+ uint16_t *dst;
+ int x, y;
+
+ if (s->mode) {
+ for (x = 0; x < dst_w; x++) {
+ for (y = start; y < end && y < emin[x]; y++) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ emin[x] = y;
+ break;
+ }
+ }
+ for (y = end - 1; y >= start && y >= emax[x]; y--) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ emax[x] = y;
+ break;
+ }
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant16(s, out, plane, component);
+
+ for (x = 0; x < dst_w; x++) {
+ dst = (uint16_t *)out->data[component] + emin[x] * dst_linesize + x;
+ dst[0] = limit;
+ dst = (uint16_t *)out->data[component] + emax[x] * dst_linesize + x;
+ dst[0] = limit;
+ }
+ } else {
+ for (y = 0; y < dst_h; y++) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize;
+ for (x = start; x < end && x < emin[y]; x++) {
+ if (dst[x] != bg) {
+ emin[y] = x;
+ break;
+ }
+ }
+ for (x = end - 1; x >= start && x >= emax[y]; x--) {
+ if (dst[x] != bg) {
+ emax[y] = x;
+ break;
+ }
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant16(s, out, plane, component);
+
+ for (y = 0; y < dst_h; y++) {
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + emin[y];
+ dst[0] = limit;
+ dst = (uint16_t *)out->data[component] + y * dst_linesize + emax[y];
+ dst[0] = limit;
+ }
+ }
+}
+
+static void envelope_peak(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ const int dst_linesize = out->linesize[component];
+ const int bg = s->bg_color[component];
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int dst_h = FF_CEIL_RSHIFT(out->height, shift_h);
+ const int dst_w = FF_CEIL_RSHIFT(out->width, shift_w);
+ const int start = s->estart[plane];
+ const int end = s->eend[plane];
+ int *emax = s->emax[plane][component];
+ int *emin = s->emin[plane][component];
+ uint8_t *dst;
+ int x, y;
+
+ if (s->mode) {
+ for (x = 0; x < dst_w; x++) {
+ for (y = start; y < end && y < emin[x]; y++) {
+ dst = out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ emin[x] = y;
+ break;
+ }
+ }
+ for (y = end - 1; y >= start && y >= emax[x]; y--) {
+ dst = out->data[component] + y * dst_linesize + x;
+ if (dst[0] != bg) {
+ emax[x] = y;
+ break;
+ }
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant(s, out, plane, component);
+
+ for (x = 0; x < dst_w; x++) {
+ dst = out->data[component] + emin[x] * dst_linesize + x;
+ dst[0] = 255;
+ dst = out->data[component] + emax[x] * dst_linesize + x;
+ dst[0] = 255;
+ }
+ } else {
+ for (y = 0; y < dst_h; y++) {
+ dst = out->data[component] + y * dst_linesize;
+ for (x = start; x < end && x < emin[y]; x++) {
+ if (dst[x] != bg) {
+ emin[y] = x;
+ break;
+ }
+ }
+ for (x = end - 1; x >= start && x >= emax[y]; x--) {
+ if (dst[x] != bg) {
+ emax[y] = x;
+ break;
+ }
+ }
+ }
+
+ if (s->envelope == 3)
+ envelope_instant(s, out, plane, component);
+
+ for (y = 0; y < dst_h; y++) {
+ dst = out->data[component] + y * dst_linesize + emin[y];
+ dst[0] = 255;
+ dst = out->data[component] + y * dst_linesize + emax[y];
+ dst[0] = 255;
+ }
+ }
+}
+
+static void envelope16(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ if (s->envelope == 0) {
+ return;
+ } else if (s->envelope == 1) {
+ envelope_instant16(s, out, plane, component);
+ } else {
+ envelope_peak16(s, out, plane, component);
+ }
+}
+
+static void envelope(WaveformContext *s, AVFrame *out, int plane, int component)
+{
+ if (s->envelope == 0) {
+ return;
+ } else if (s->envelope == 1) {
+ envelope_instant(s, out, plane, component);
+ } else {
+ envelope_peak(s, out, plane, component);
+ }
+}
+
+static void update16(uint16_t *target, int max, int intensity, int limit)
+{
+ if (*target <= max)
+ *target += intensity;
+ else
+ *target = limit;
+}
+
+static void update(uint8_t *target, int max, int intensity)
+{
+ if (*target <= max)
+ *target += intensity;
+ else
+ *target = 255;
+}
+
+static void lowpass16(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int src_linesize = in->linesize[plane] / 2;
+ const int dst_linesize = out->linesize[plane] / 2;
+ const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
+ const int limit = s->max - 1;
+ const int max = limit - intensity;
+ const int src_h = FF_CEIL_RSHIFT(in->height, shift_h);
+ const int src_w = FF_CEIL_RSHIFT(in->width, shift_w);
+ const uint16_t *src_data = (const uint16_t *)in->data[plane];
+ uint16_t *dst_data = (uint16_t *)out->data[plane] + (column ? (offset >> shift_h) * dst_linesize : offset >> shift_w);
+ uint16_t * const dst_bottom_line = dst_data + dst_linesize * ((s->size >> shift_h) - 1);
+ uint16_t * const dst_line = (mirror ? dst_bottom_line : dst_data);
+ const uint16_t *p;
+ int y;
+
+ if (!column && mirror)
+ dst_data += s->size >> shift_w;
+
+ for (y = 0; y < src_h; y++) {
+ const uint16_t *src_data_end = src_data + src_w;
+ uint16_t *dst = dst_line;
+
+ for (p = src_data; p < src_data_end; p++) {
+ uint16_t *target;
+ int v = FFMIN(*p, limit);
+
+ if (column) {
+ target = dst++ + dst_signed_linesize * (v >> shift_h);
+ } else {
+ if (mirror)
+ target = dst_data - (v >> shift_w) - 1;
+ else
+ target = dst_data + (v >> shift_w);
+ }
+ update16(target, max, intensity, limit);
+ }
+ src_data += src_linesize;
+ dst_data += dst_linesize;
+ }
+
+ envelope16(s, out, plane, plane);
+}
+
+static void lowpass(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int is_chroma = (component == 1 || component == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int src_linesize = in->linesize[plane];
+ const int dst_linesize = out->linesize[plane];
+ const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
+ const int max = 255 - intensity;
+ const int src_h = FF_CEIL_RSHIFT(in->height, shift_h);
+ const int src_w = FF_CEIL_RSHIFT(in->width, shift_w);
+ const uint8_t *src_data = in->data[plane];
+ uint8_t *dst_data = out->data[plane] + (column ? (offset >> shift_h) * dst_linesize : offset >> shift_w);
+ uint8_t * const dst_bottom_line = dst_data + dst_linesize * ((s->size >> shift_h) - 1);
+ uint8_t * const dst_line = (mirror ? dst_bottom_line : dst_data);
+ const uint8_t *p;
+ int y;
+
+ if (!column && mirror)
+ dst_data += s->size >> shift_w;
+
+ for (y = 0; y < src_h; y++) {
+ const uint8_t *src_data_end = src_data + src_w;
+ uint8_t *dst = dst_line;
+
+ for (p = src_data; p < src_data_end; p++) {
+ uint8_t *target;
+ if (column) {
+ target = dst++ + dst_signed_linesize * (*p >> shift_h);
+ } else {
+ if (mirror)
+ target = dst_data - (*p >> shift_w) - 1;
+ else
+ target = dst_data + (*p >> shift_w);
+ }
+ update(target, max, intensity);
+ }
+ src_data += src_linesize;
+ dst_data += dst_linesize;
+ }
+
+ envelope(s, out, plane, plane);
+}
+
+static void flat(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int c0_linesize = in->linesize[ plane + 0 ];
+ const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
+ const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
+ const int d0_linesize = out->linesize[ plane + 0 ];
+ const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
+ const int max = 255 - intensity;
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (column) {
+ const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
+ const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
+
+ for (x = 0; x < src_w; x++) {
+ const uint8_t *c0_data = in->data[plane + 0];
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d0_data = out->data[plane] + offset * d0_linesize;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset * d1_linesize;
+ uint8_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
+ uint8_t * const d0 = (mirror ? d0_bottom_line : d0_data);
+ uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
+ uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data);
+
+ for (y = 0; y < src_h; y++) {
+ const int c0 = c0_data[x] + 256;
+ const int c1 = FFABS(c1_data[x] - 128) + FFABS(c2_data[x] - 128);
+ uint8_t *target;
+ int p;
+
+ target = d0 + x + d0_signed_linesize * c0;
+ update(target, max, intensity);
+
+ for (p = c0 - c1; p < c0 + c1; p++) {
+ target = d1 + x + d1_signed_linesize * p;
+ update(target, max, 1);
+ }
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ }
+ }
+ } else {
+ const uint8_t *c0_data = in->data[plane];
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d0_data = out->data[plane] + offset;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset;
+
+ if (mirror) {
+ d0_data += s->size - 1;
+ d1_data += s->size - 1;
+ }
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ int c0 = c0_data[x] + 256;
+ const int c1 = FFABS(c1_data[x] - 128) + FFABS(c2_data[x] - 128);
+ uint8_t *target;
+ int p;
+
+ if (mirror)
+ target = d0_data - c0;
+ else
+ target = d0_data + c0;
+
+ update(target, max, intensity);
+
+ for (p = c0 - c1; p < c0 + c1; p++) {
+ if (mirror)
+ target = d1_data - p;
+ else
+ target = d1_data + p;
+
+ update(target, max, 1);
+ }
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ }
+ }
+
+ envelope(s, out, plane, plane);
+ envelope(s, out, plane, (plane + 1) % s->ncomp);
+}
+
+static void aflat(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int c0_linesize = in->linesize[ plane + 0 ];
+ const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
+ const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
+ const int d0_linesize = out->linesize[ plane + 0 ];
+ const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
+ const int d2_linesize = out->linesize[(plane + 2) % s->ncomp];
+ const int max = 255 - intensity;
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (column) {
+ const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
+ const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
+ const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
+
+ for (x = 0; x < src_w; x++) {
+ const uint8_t *c0_data = in->data[plane + 0];
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d0_data = out->data[plane] + offset * d0_linesize;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset * d1_linesize;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset * d2_linesize;
+ uint8_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
+ uint8_t * const d0 = (mirror ? d0_bottom_line : d0_data);
+ uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
+ uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data);
+ uint8_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
+ uint8_t * const d2 = (mirror ? d2_bottom_line : d2_data);
+
+ for (y = 0; y < src_h; y++) {
+ const int c0 = c0_data[x] + 128;
+ const int c1 = c1_data[x] - 128;
+ const int c2 = c2_data[x] - 128;
+ uint8_t *target;
+ int p;
+
+ target = d0 + x + d0_signed_linesize * c0;
+ update(target, max, intensity);
+
+ for (p = c0 + c1; p < c0; p++) {
+ target = d1 + x + d1_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = c0 + c1 - 1; p > c0; p--) {
+ target = d1 + x + d1_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = c0 + c2; p < c0; p++) {
+ target = d2 + x + d2_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = c0 + c2 - 1; p > c0; p--) {
+ target = d2 + x + d2_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+ } else {
+ const uint8_t *c0_data = in->data[plane];
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d0_data = out->data[plane] + offset;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset;
+
+ if (mirror) {
+ d0_data += s->size - 1;
+ d1_data += s->size - 1;
+ d2_data += s->size - 1;
+ }
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c0 = c0_data[x] + 128;
+ const int c1 = c1_data[x] - 128;
+ const int c2 = c2_data[x] - 128;
+ uint8_t *target;
+ int p;
+
+ if (mirror)
+ target = d0_data - c0;
+ else
+ target = d0_data + c0;
+
+ update(target, max, intensity);
+
+ for (p = c0 + c1; p < c0; p++) {
+ if (mirror)
+ target = d1_data - p;
+ else
+ target = d1_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = c0 + 1; p < c0 + c1; p++) {
+ if (mirror)
+ target = d1_data - p;
+ else
+ target = d1_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = c0 + c2; p < c0; p++) {
+ if (mirror)
+ target = d2_data - p;
+ else
+ target = d2_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = c0 + 1; p < c0 + c2; p++) {
+ if (mirror)
+ target = d2_data - p;
+ else
+ target = d2_data + p;
+
+ update(target, max, 1);
+ }
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+
+ envelope(s, out, plane, (plane + 0) % s->ncomp);
+ envelope(s, out, plane, (plane + 1) % s->ncomp);
+ envelope(s, out, plane, (plane + 2) % s->ncomp);
+}
+
+static void chroma(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int c0_linesize = in->linesize[(plane + 1) % s->ncomp];
+ const int c1_linesize = in->linesize[(plane + 2) % s->ncomp];
+ const int dst_linesize = out->linesize[plane];
+ const int max = 255 - intensity;
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (column) {
+ const int dst_signed_linesize = dst_linesize * (mirror == 1 ? -1 : 1);
+
+ for (x = 0; x < src_w; x++) {
+ const uint8_t *c0_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c1_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *dst_data = out->data[plane] + offset * dst_linesize;
+ uint8_t * const dst_bottom_line = dst_data + dst_linesize * (s->size - 1);
+ uint8_t * const dst_line = (mirror ? dst_bottom_line : dst_data);
+ uint8_t *dst = dst_line;
+
+ for (y = 0; y < src_h; y++) {
+ const int sum = FFABS(c0_data[x] - 128) + FFABS(c1_data[x] - 128);
+ uint8_t *target;
+ int p;
+
+ for (p = 256 - sum; p < 256 + sum; p++) {
+ target = dst + x + dst_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ dst_data += dst_linesize;
+ }
+ }
+ } else {
+ const uint8_t *c0_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c1_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *dst_data = out->data[plane] + offset;
+
+ if (mirror)
+ dst_data += s->size - 1;
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int sum = FFABS(c0_data[x] - 128) + FFABS(c1_data[x] - 128);
+ uint8_t *target;
+ int p;
+
+ for (p = 256 - sum; p < 256 + sum; p++) {
+ if (mirror)
+ target = dst_data - p;
+ else
+ target = dst_data + p;
+
+ update(target, max, 1);
+ }
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ dst_data += dst_linesize;
+ }
+ }
+
+ envelope(s, out, plane, (plane + 0) % s->ncomp);
+}
+
+static void achroma(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
+ const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
+ const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
+ const int d2_linesize = out->linesize[(plane + 2) % s->ncomp];
+ const int max = 255 - intensity;
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (column) {
+ const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
+ const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
+
+ for (x = 0; x < src_w; x++) {
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset * d1_linesize;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset * d2_linesize;
+ uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
+ uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data);
+ uint8_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
+ uint8_t * const d2 = (mirror ? d2_bottom_line : d2_data);
+
+ for (y = 0; y < src_h; y++) {
+ const int c1 = c1_data[x] - 128;
+ const int c2 = c2_data[x] - 128;
+ uint8_t *target;
+ int p;
+
+ for (p = 128 + c1; p < 128; p++) {
+ target = d1 + x + d1_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = 128 + c1 - 1; p > 128; p--) {
+ target = d1 + x + d1_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = 128 + c2; p < 128; p++) {
+ target = d2 + x + d2_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ for (p = 128 + c2 - 1; p > 128; p--) {
+ target = d2 + x + d2_signed_linesize * p;
+ update(target, max, 1);
+ }
+
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+ } else {
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ uint8_t *d0_data = out->data[plane] + offset;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset;
+
+ if (mirror) {
+ d0_data += s->size - 1;
+ d1_data += s->size - 1;
+ d2_data += s->size - 1;
+ }
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c1 = c1_data[x] - 128;
+ const int c2 = c2_data[x] - 128;
+ uint8_t *target;
+ int p;
+
+ for (p = 128 + c1; p < 128; p++) {
+ if (mirror)
+ target = d1_data - p;
+ else
+ target = d1_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = 128 + 1; p < 128 + c1; p++) {
+ if (mirror)
+ target = d1_data - p;
+ else
+ target = d1_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = 128 + c2; p < 128; p++) {
+ if (mirror)
+ target = d2_data - p;
+ else
+ target = d2_data + p;
+
+ update(target, max, 1);
+ }
+
+ for (p = 128 + 1; p < 128 + c2; p++) {
+ if (mirror)
+ target = d2_data - p;
+ else
+ target = d2_data + p;
+
+ update(target, max, 1);
+ }
+ }
+
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+
+ envelope(s, out, plane, (plane + 1) % s->ncomp);
+ envelope(s, out, plane, (plane + 2) % s->ncomp);
+}
+
+static void color16(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const int limit = s->max - 1;
+ const uint16_t *c0_data = (const uint16_t *)in->data[plane + 0];
+ const uint16_t *c1_data = (const uint16_t *)in->data[(plane + 1) % s->ncomp];
+ const uint16_t *c2_data = (const uint16_t *)in->data[(plane + 2) % s->ncomp];
+ const int c0_linesize = in->linesize[ plane + 0 ] / 2;
+ const int c1_linesize = in->linesize[(plane + 1) % s->ncomp] / 2;
+ const int c2_linesize = in->linesize[(plane + 2) % s->ncomp] / 2;
+ const int d0_linesize = out->linesize[ plane + 0 ] / 2;
+ const int d1_linesize = out->linesize[(plane + 1) % s->ncomp] / 2;
+ const int d2_linesize = out->linesize[(plane + 2) % s->ncomp] / 2;
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (s->mode) {
+ const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
+ const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
+ const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
+ uint16_t *d0_data = (uint16_t *)out->data[plane] + offset * d0_linesize;
+ uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset * d1_linesize;
+ uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset * d2_linesize;
+ uint16_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
+ uint16_t * const d0 = (mirror ? d0_bottom_line : d0_data);
+ uint16_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
+ uint16_t * const d1 = (mirror ? d1_bottom_line : d1_data);
+ uint16_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
+ uint16_t * const d2 = (mirror ? d2_bottom_line : d2_data);
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c0 = FFMIN(c0_data[x], limit);
+ const int c1 = c1_data[x];
+ const int c2 = c2_data[x];
+
+ *(d0 + d0_signed_linesize * c0 + x) = c0;
+ *(d1 + d1_signed_linesize * c0 + x) = c1;
+ *(d2 + d2_signed_linesize * c0 + x) = c2;
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ } else {
+ uint16_t *d0_data = (uint16_t *)out->data[plane] + offset;
+ uint16_t *d1_data = (uint16_t *)out->data[(plane + 1) % s->ncomp] + offset;
+ uint16_t *d2_data = (uint16_t *)out->data[(plane + 2) % s->ncomp] + offset;
+
+ if (mirror) {
+ d0_data += s->size - 1;
+ d1_data += s->size - 1;
+ d2_data += s->size - 1;
+ }
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c0 = FFMIN(c0_data[x], limit);
+ const int c1 = c1_data[x];
+ const int c2 = c2_data[x];
+
+ if (mirror) {
+ *(d0_data - c0) = c0;
+ *(d1_data - c0) = c1;
+ *(d2_data - c0) = c2;
+ } else {
+ *(d0_data + c0) = c0;
+ *(d1_data + c0) = c1;
+ *(d2_data + c0) = c2;
+ }
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+
+ envelope16(s, out, plane, plane);
+}
+
+static void color(WaveformContext *s, AVFrame *in, AVFrame *out,
+ int component, int intensity, int offset, int column)
+{
+ const int plane = s->desc->comp[component].plane;
+ const int mirror = s->mirror;
+ const uint8_t *c0_data = in->data[plane + 0];
+ const uint8_t *c1_data = in->data[(plane + 1) % s->ncomp];
+ const uint8_t *c2_data = in->data[(plane + 2) % s->ncomp];
+ const int c0_linesize = in->linesize[ plane + 0 ];
+ const int c1_linesize = in->linesize[(plane + 1) % s->ncomp];
+ const int c2_linesize = in->linesize[(plane + 2) % s->ncomp];
+ const int d0_linesize = out->linesize[ plane + 0 ];
+ const int d1_linesize = out->linesize[(plane + 1) % s->ncomp];
+ const int d2_linesize = out->linesize[(plane + 2) % s->ncomp];
+ const int src_h = in->height;
+ const int src_w = in->width;
+ int x, y;
+
+ if (s->mode) {
+ const int d0_signed_linesize = d0_linesize * (mirror == 1 ? -1 : 1);
+ const int d1_signed_linesize = d1_linesize * (mirror == 1 ? -1 : 1);
+ const int d2_signed_linesize = d2_linesize * (mirror == 1 ? -1 : 1);
+ uint8_t *d0_data = out->data[plane] + offset * d0_linesize;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset * d1_linesize;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset * d2_linesize;
+ uint8_t * const d0_bottom_line = d0_data + d0_linesize * (s->size - 1);
+ uint8_t * const d0 = (mirror ? d0_bottom_line : d0_data);
+ uint8_t * const d1_bottom_line = d1_data + d1_linesize * (s->size - 1);
+ uint8_t * const d1 = (mirror ? d1_bottom_line : d1_data);
+ uint8_t * const d2_bottom_line = d2_data + d2_linesize * (s->size - 1);
+ uint8_t * const d2 = (mirror ? d2_bottom_line : d2_data);
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c0 = c0_data[x];
+ const int c1 = c1_data[x];
+ const int c2 = c2_data[x];
+
+ *(d0 + d0_signed_linesize * c0 + x) = c0;
+ *(d1 + d1_signed_linesize * c0 + x) = c1;
+ *(d2 + d2_signed_linesize * c0 + x) = c2;
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ } else {
+ uint8_t *d0_data = out->data[plane] + offset;
+ uint8_t *d1_data = out->data[(plane + 1) % s->ncomp] + offset;
+ uint8_t *d2_data = out->data[(plane + 2) % s->ncomp] + offset;
+
+ if (mirror) {
+ d0_data += s->size - 1;
+ d1_data += s->size - 1;
+ d2_data += s->size - 1;
+ }
+
+ for (y = 0; y < src_h; y++) {
+ for (x = 0; x < src_w; x++) {
+ const int c0 = c0_data[x];
+ const int c1 = c1_data[x];
+ const int c2 = c2_data[x];
+
+ if (mirror) {
+ *(d0_data - c0) = c0;
+ *(d1_data - c0) = c1;
+ *(d2_data - c0) = c2;
+ } else {
+ *(d0_data + c0) = c0;
+ *(d1_data + c0) = c1;
+ *(d2_data + c0) = c2;
+ }
+ }
+
+ c0_data += c0_linesize;
+ c1_data += c1_linesize;
+ c2_data += c2_linesize;
+ d0_data += d0_linesize;
+ d1_data += d1_linesize;
+ d2_data += d2_linesize;
+ }
+ }
+
+ envelope(s, out, plane, plane);
+}
+
+static const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 };
+static const uint8_t black_gbrp_color[4] = { 0, 0, 0, 255 };
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ WaveformContext *s = ctx->priv;
+
+ s->desc = av_pix_fmt_desc_get(inlink->format);
+ s->ncomp = s->desc->nb_components;
+ s->bits = s->desc->comp[0].depth;
+ s->max = 1 << s->bits;
+ s->intensity = s->fintensity * (s->max - 1);
+
+ switch (s->filter) {
+ case LOWPASS:
+ s->size = 256;
+ s->waveform = s->bits > 8 ? lowpass16 : lowpass; break;
+ case FLAT:
+ s->size = 256 * 3;
+ s->waveform = flat; break;
+ case AFLAT:
+ s->size = 256 * 2;
+ s->waveform = aflat; break;
+ case CHROMA:
+ s->size = 256 * 2;
+ s->waveform = chroma; break;
+ case ACHROMA:
+ s->size = 256;
+ s->waveform = achroma; break;
+ case COLOR:
+ s->size = 256;
+ s->waveform = s->bits > 8 ? color16 : color; break;
+ }
+
+ s->size = s->size << (s->bits - 8);
+
+ switch (inlink->format) {
+ case AV_PIX_FMT_GBRAP:
+ case AV_PIX_FMT_GBRP:
+ case AV_PIX_FMT_GBRP9:
+ case AV_PIX_FMT_GBRP10:
+ s->bg_color = black_gbrp_color;
+ break;
+ default:
+ s->bg_color = black_yuva_color;
+ }
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AVFilterLink *inlink = ctx->inputs[0];
+ WaveformContext *s = ctx->priv;
+ int comp = 0, i, j = 0, k, p, size, shift;
+
+ for (i = 0; i < s->ncomp; i++) {
+ if ((1 << i) & s->pcomp)
+ comp++;
+ }
+
+ av_freep(&s->peak);
+
+ if (s->mode) {
+ outlink->h = s->size * FFMAX(comp * s->display, 1);
+ size = inlink->w;
+ } else {
+ outlink->w = s->size * FFMAX(comp * s->display, 1);
+ size = inlink->h;
+ }
+
+ s->peak = av_malloc_array(size, 32 * sizeof(*s->peak));
+ if (!s->peak)
+ return AVERROR(ENOMEM);
+
+ for (p = 0; p < 4; p++) {
+ const int is_chroma = (p == 1 || p == 2);
+ const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
+ const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);
+ const int plane = s->desc->comp[p].plane;
+ int offset;
+
+ if (!((1 << p) & s->pcomp))
+ continue;
+
+ shift = s->mode ? shift_h : shift_w;
+
+ for (k = 0; k < 4; k++) {
+ s->emax[plane][k] = s->peak + size * (plane * 4 + k + 0);
+ s->emin[plane][k] = s->peak + size * (plane * 4 + k + 16);
+ }
+
+ offset = j++ * s->size * s->display;
+ s->estart[plane] = offset >> shift;
+ s->eend[plane] = (offset + s->size - 1) >> shift;
+ for (i = 0; i < size; i++) {
+ for (k = 0; k < 4; k++) {
+ s->emax[plane][k][i] = s->estart[plane];
+ s->emin[plane][k][i] = s->eend[plane];
+ }
+ }
+ }
+
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ WaveformContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *out;
+ int i, j, k;
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ out->pts = in->pts;
+
+ for (k = 0; k < s->ncomp; k++) {
+ const int is_chroma = (k == 1 || k == 2);
+ const int dst_h = FF_CEIL_RSHIFT(outlink->h, (is_chroma ? s->desc->log2_chroma_h : 0));
+ const int dst_w = FF_CEIL_RSHIFT(outlink->w, (is_chroma ? s->desc->log2_chroma_w : 0));
+ if (s->bits <= 8) {
+ for (i = 0; i < dst_h ; i++)
+ memset(out->data[s->desc->comp[k].plane] +
+ i * out->linesize[s->desc->comp[k].plane],
+ s->bg_color[k], dst_w);
+ } else {
+ const int mult = s->size / 256;
+ uint16_t *dst = (uint16_t *)out->data[s->desc->comp[k].plane];
+
+ for (i = 0; i < dst_h ; i++) {
+ for (j = 0; j < dst_w; j++)
+ dst[j] = s->bg_color[k] * mult;
+ dst += out->linesize[s->desc->comp[k].plane] / 2;
+ }
+ }
+ }
+
+ for (k = 0, i = 0; k < s->ncomp; k++) {
+ if ((1 << k) & s->pcomp) {
+ const int offset = i++ * s->size * s->display;
+ s->waveform(s, in, out, k, s->intensity, offset, s->mode);
+ }
+ }
+
+ av_frame_free(&in);
+ return ff_filter_frame(outlink, out);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ WaveformContext *s = ctx->priv;
+
+ av_freep(&s->peak);
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_waveform = {
+ .name = "waveform",
+ .description = NULL_IF_CONFIG_SMALL("Video waveform monitor."),
+ .priv_size = sizeof(WaveformContext),
+ .priv_class = &waveform_class,
+ .query_formats = query_formats,
+ .uninit = uninit,
+ .inputs = inputs,
+ .outputs = outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c b/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
index b32f38b57a7..7451832b101 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_yadif.c
@@ -186,7 +186,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
YADIFContext *s = ctx->priv;
ThreadData *td = arg;
int refs = s->cur->linesize[td->plane];
- int df = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;
+ int df = (s->csp->comp[td->plane].depth + 7) / 8;
int pix_3 = 3 * df;
int slice_start = (td->h * jobnr ) / nb_jobs;
int slice_end = (td->h * (jobnr+1)) / nb_jobs;
@@ -486,7 +486,7 @@ static int config_props(AVFilterLink *link)
}
s->csp = av_pix_fmt_desc_get(link->format);
- if (s->csp->comp[0].depth_minus1 / 8 == 1) {
+ if (s->csp->comp[0].depth > 8) {
s->filter_line = filter_line_c_16bit;
s->filter_edges = filter_edges_16bit;
} else {
diff --git a/chromium/third_party/ffmpeg/libavfilter/video.c b/chromium/third_party/ffmpeg/libavfilter/video.c
index 6a554834b39..0274fc18f7a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/video.c
+++ b/chromium/third_party/ffmpeg/libavfilter/video.c
@@ -59,53 +59,6 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
return frame;
}
-#if FF_API_AVFILTERBUFFER
-AVFilterBufferRef *
-avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
- int w, int h, enum AVPixelFormat format)
-{
- AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
- AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));
-
- if (!pic || !picref)
- goto fail;
-
- picref->buf = pic;
- picref->buf->free = ff_avfilter_default_free_buffer;
- if (!(picref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps))))
- goto fail;
-
- pic->w = picref->video->w = w;
- pic->h = picref->video->h = h;
-
- /* make sure the buffer gets read permission or it's useless for output */
- picref->perms = perms | AV_PERM_READ;
-
- pic->refcount = 1;
- picref->type = AVMEDIA_TYPE_VIDEO;
- pic->format = picref->format = format;
-
- memcpy(pic->data, data, 4*sizeof(data[0]));
- memcpy(pic->linesize, linesize, 4*sizeof(linesize[0]));
- memcpy(picref->data, pic->data, sizeof(picref->data));
- memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
-
- pic-> extended_data = pic->data;
- picref->extended_data = picref->data;
-
- picref->pts = AV_NOPTS_VALUE;
-
- return picref;
-
-fail:
- if (picref && picref->video)
- av_free(picref->video);
- av_free(picref);
- av_free(pic);
- return NULL;
-}
-#endif
-
AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)
{
AVFrame *ret = NULL;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_cellauto.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_cellauto.c
index 4f4b01c60df..06388252270 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_cellauto.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_cellauto.c
@@ -26,6 +26,7 @@
/* #define DEBUG */
#include "libavutil/file.h"
+#include "libavutil/internal.h"
#include "libavutil/lfg.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
@@ -73,10 +74,10 @@ static const AVOption cellauto_options[] = {
{ "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1, FLAGS },
{ "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
{ "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
- { "scroll", "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS },
- { "start_full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
- { "full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS },
- { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS },
+ { "scroll", "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
+ { "start_full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
+ { "full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
+ { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
{ NULL }
};
@@ -249,7 +250,7 @@ static void evolve(AVFilterContext *ctx)
v|= i+1 < cellauto->w ? prev_row[i+1] : 0;
}
row[i] = !!(cellauto->rule & (1<<v));
- av_dlog(ctx, "i:%d context:%c%c%c -> cell:%d\n", i,
+ ff_dlog(ctx, "i:%d context:%c%c%c -> cell:%d\n", i,
v&4?'@':' ', v&2?'@':' ', v&1?'@':' ', row[i]);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_life.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_life.c
index 47630add7d9..314746dc949 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_life.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_life.c
@@ -26,6 +26,7 @@
/* #define DEBUG */
#include "libavutil/file.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/lfg.h"
#include "libavutil/opt.h"
@@ -88,7 +89,7 @@ static const AVOption life_options[] = {
{ "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1/M_PHI}, 0, 1, FLAGS },
{ "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64=-1}, -1, UINT32_MAX, FLAGS },
{ "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.i64=-1}, -1, UINT32_MAX, FLAGS },
- { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+ { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ "mold", "set mold speed for dead cells", OFFSET(mold), AV_OPT_TYPE_INT, {.i64=0}, 0, 0xFF, FLAGS },
{ "life_color", "set life color", OFFSET( life_color), AV_OPT_TYPE_COLOR, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "death_color", "set death color", OFFSET(death_color), AV_OPT_TYPE_COLOR, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS },
@@ -334,7 +335,7 @@ static void evolve(AVFilterContext *ctx)
if (alive) *newbuf = ALIVE_CELL; // new cell is alive
else if (cell) *newbuf = cell - 1; // new cell is dead and in the process of mold
else *newbuf = 0; // new cell is definitely dead
- av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
+ ff_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
newbuf++;
}
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
index e26fecd968d..56d0503c2fe 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_mandelbrot.c
@@ -121,29 +121,29 @@ AVFILTER_DEFINE_CLASS(mandelbrot);
static av_cold int init(AVFilterContext *ctx)
{
- MBContext *mb = ctx->priv;
+ MBContext *s = ctx->priv;
- mb->bailout *= mb->bailout;
+ s->bailout *= s->bailout;
- mb->start_scale /=mb->h;
- mb->end_scale /=mb->h;
+ s->start_scale /=s->h;
+ s->end_scale /=s->h;
- mb->cache_allocated = mb->w * mb->h * 3;
- mb->cache_used = 0;
- mb->point_cache= av_malloc_array(mb->cache_allocated, sizeof(*mb->point_cache));
- mb-> next_cache= av_malloc_array(mb->cache_allocated, sizeof(*mb-> next_cache));
- mb-> zyklus = av_malloc_array(mb->maxiter + 16, sizeof(*mb->zyklus));
+ s->cache_allocated = s->w * s->h * 3;
+ s->cache_used = 0;
+ s->point_cache= av_malloc_array(s->cache_allocated, sizeof(*s->point_cache));
+ s-> next_cache= av_malloc_array(s->cache_allocated, sizeof(*s-> next_cache));
+ s-> zyklus = av_malloc_array(s->maxiter + 16, sizeof(*s->zyklus));
return 0;
}
static av_cold void uninit(AVFilterContext *ctx)
{
- MBContext *mb = ctx->priv;
+ MBContext *s = ctx->priv;
- av_freep(&mb->point_cache);
- av_freep(&mb-> next_cache);
- av_freep(&mb->zyklus);
+ av_freep(&s->point_cache);
+ av_freep(&s-> next_cache);
+ av_freep(&s->zyklus);
}
static int query_formats(AVFilterContext *ctx)
@@ -162,48 +162,48 @@ static int query_formats(AVFilterContext *ctx)
static int config_props(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->src;
- MBContext *mb = ctx->priv;
+ MBContext *s = ctx->priv;
- if (av_image_check_size(mb->w, mb->h, 0, ctx) < 0)
+ if (av_image_check_size(s->w, s->h, 0, ctx) < 0)
return AVERROR(EINVAL);
- inlink->w = mb->w;
- inlink->h = mb->h;
- inlink->time_base = av_inv_q(mb->frame_rate);
+ inlink->w = s->w;
+ inlink->h = s->h;
+ inlink->time_base = av_inv_q(s->frame_rate);
return 0;
}
static void fill_from_cache(AVFilterContext *ctx, uint32_t *color, int *in_cidx, int *out_cidx, double py, double scale){
- MBContext *mb = ctx->priv;
- if(mb->morphamp)
+ MBContext *s = ctx->priv;
+ if(s->morphamp)
return;
- for(; *in_cidx < mb->cache_used; (*in_cidx)++){
- Point *p= &mb->point_cache[*in_cidx];
+ for(; *in_cidx < s->cache_used; (*in_cidx)++){
+ Point *p= &s->point_cache[*in_cidx];
int x;
if(p->p[1] > py)
break;
- x= round((p->p[0] - mb->start_x) / scale + mb->w/2);
- if(x<0 || x >= mb->w)
+ x= round((p->p[0] - s->start_x) / scale + s->w/2);
+ if(x<0 || x >= s->w)
continue;
if(color) color[x] = p->val;
- if(out_cidx && *out_cidx < mb->cache_allocated)
- mb->next_cache[(*out_cidx)++]= *p;
+ if(out_cidx && *out_cidx < s->cache_allocated)
+ s->next_cache[(*out_cidx)++]= *p;
}
}
-static int interpol(MBContext *mb, uint32_t *color, int x, int y, int linesize)
+static int interpol(MBContext *s, uint32_t *color, int x, int y, int linesize)
{
uint32_t a,b,c,d, i;
uint32_t ipol=0xFF000000;
int dist;
- if(!x || !y || x+1==mb->w || y+1==mb->h)
+ if(!x || !y || x+1==s->w || y+1==s->h)
return 0;
- dist= FFMAX(FFABS(x-(mb->w>>1))*mb->h, FFABS(y-(mb->h>>1))*mb->w);
+ dist= FFMAX(FFABS(x-(s->w>>1))*s->h, FFABS(y-(s->h>>1))*s->w);
- if(dist<(mb->w*mb->h>>3))
+ if(dist<(s->w*s->h>>3))
return 0;
a=color[(x+1) + (y+0)*linesize];
@@ -248,50 +248,50 @@ static int interpol(MBContext *mb, uint32_t *color, int x, int y, int linesize)
static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize, int64_t pts)
{
- MBContext *mb = ctx->priv;
+ MBContext *s = ctx->priv;
int x,y,i, in_cidx=0, next_cidx=0, tmp_cidx;
- double scale= mb->start_scale*pow(mb->end_scale/mb->start_scale, pts/mb->end_pts);
+ double scale= s->start_scale*pow(s->end_scale/s->start_scale, pts/s->end_pts);
int use_zyklus=0;
- fill_from_cache(ctx, NULL, &in_cidx, NULL, mb->start_y+scale*(-mb->h/2-0.5), scale);
+ fill_from_cache(ctx, NULL, &in_cidx, NULL, s->start_y+scale*(-s->h/2-0.5), scale);
tmp_cidx= in_cidx;
- memset(color, 0, sizeof(*color)*mb->w);
- for(y=0; y<mb->h; y++){
+ memset(color, 0, sizeof(*color)*s->w);
+ for(y=0; y<s->h; y++){
int y1= y+1;
- const double ci=mb->start_y+scale*(y-mb->h/2);
+ const double ci=s->start_y+scale*(y-s->h/2);
fill_from_cache(ctx, NULL, &in_cidx, &next_cidx, ci, scale);
- if(y1<mb->h){
- memset(color+linesize*y1, 0, sizeof(*color)*mb->w);
+ if(y1<s->h){
+ memset(color+linesize*y1, 0, sizeof(*color)*s->w);
fill_from_cache(ctx, color+linesize*y1, &tmp_cidx, NULL, ci + 3*scale/2, scale);
}
- for(x=0; x<mb->w; x++){
+ for(x=0; x<s->w; x++){
float av_uninit(epsilon);
- const double cr=mb->start_x+scale*(x-mb->w/2);
+ const double cr=s->start_x+scale*(x-s->w/2);
double zr=cr;
double zi=ci;
uint32_t c=0;
- double dv= mb->dither / (double)(1LL<<32);
- mb->dither= mb->dither*1664525+1013904223;
+ double dv= s->dither / (double)(1LL<<32);
+ s->dither= s->dither*1664525+1013904223;
if(color[x + y*linesize] & 0xFF000000)
continue;
- if(!mb->morphamp){
- if(interpol(mb, color, x, y, linesize)){
- if(next_cidx < mb->cache_allocated){
- mb->next_cache[next_cidx ].p[0]= cr;
- mb->next_cache[next_cidx ].p[1]= ci;
- mb->next_cache[next_cidx++].val = color[x + y*linesize];
+ if(!s->morphamp){
+ if(interpol(s, color, x, y, linesize)){
+ if(next_cidx < s->cache_allocated){
+ s->next_cache[next_cidx ].p[0]= cr;
+ s->next_cache[next_cidx ].p[1]= ci;
+ s->next_cache[next_cidx++].val = color[x + y*linesize];
}
continue;
}
}else{
- zr += cos(pts * mb->morphxf) * mb->morphamp;
- zi += sin(pts * mb->morphyf) * mb->morphamp;
+ zr += cos(pts * s->morphxf) * s->morphamp;
+ zi += sin(pts * s->morphyf) * s->morphamp;
}
- use_zyklus= (x==0 || mb->inner!=BLACK ||color[x-1 + y*linesize] == 0xFF000000);
+ use_zyklus= (x==0 || s->inner!=BLACK ||color[x-1 + y*linesize] == 0xFF000000);
if(use_zyklus)
- epsilon= scale*1*sqrt(SQR(x-mb->w/2) + SQR(y-mb->h/2))/mb->w;
+ epsilon= scale*1*sqrt(SQR(x-s->w/2) + SQR(y-s->h/2))/s->w;
#define Z_Z2_C(outr,outi,inr,ini)\
outr= inr*inr - ini*ini + cr;\
@@ -300,15 +300,15 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
#define Z_Z2_C_ZYKLUS(outr,outi,inr,ini, Z)\
Z_Z2_C(outr,outi,inr,ini)\
if(use_zyklus){\
- if(Z && fabs(mb->zyklus[i>>1][0]-outr)+fabs(mb->zyklus[i>>1][1]-outi) <= epsilon)\
+ if(Z && fabs(s->zyklus[i>>1][0]-outr)+fabs(s->zyklus[i>>1][1]-outi) <= epsilon)\
break;\
}\
- mb->zyklus[i][0]= outr;\
- mb->zyklus[i][1]= outi;\
+ s->zyklus[i][0]= outr;\
+ s->zyklus[i][1]= outi;\
- for(i=0; i<mb->maxiter-8; i++){
+ for(i=0; i<s->maxiter-8; i++){
double t;
Z_Z2_C_ZYKLUS(t, zi, zr, zi, 0)
i++;
@@ -325,27 +325,27 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
Z_Z2_C_ZYKLUS(t, zi, zr, zi, 0)
i++;
Z_Z2_C_ZYKLUS(zr, zi, t, zi, 1)
- if(zr*zr + zi*zi > mb->bailout){
+ if(zr*zr + zi*zi > s->bailout){
i-= FFMIN(7, i);
- for(; i<mb->maxiter; i++){
- zr= mb->zyklus[i][0];
- zi= mb->zyklus[i][1];
- if(zr*zr + zi*zi > mb->bailout){
- switch(mb->outer){
+ for(; i<s->maxiter; i++){
+ zr= s->zyklus[i][0];
+ zi= s->zyklus[i][1];
+ if(zr*zr + zi*zi > s->bailout){
+ switch(s->outer){
case ITERATION_COUNT:
zr = i;
c = lrintf((sin(zr)+1)*127) + lrintf((sin(zr/1.234)+1)*127)*256*256 + lrintf((sin(zr/100)+1)*127)*256;
break;
case NORMALIZED_ITERATION_COUNT:
- zr = i + log2(log(mb->bailout) / log(zr*zr + zi*zi));
+ zr = i + log2(log(s->bailout) / log(zr*zr + zi*zi));
c = lrintf((sin(zr)+1)*127) + lrintf((sin(zr/1.234)+1)*127)*256*256 + lrintf((sin(zr/100)+1)*127)*256;
break;
case WHITE:
c = 0xFFFFFF;
break;
case OUTZ:
- zr /= mb->bailout;
- zi /= mb->bailout;
+ zr /= s->bailout;
+ zi /= s->bailout;
c = (((int)(zr*128+128))&0xFF)*256 + (((int)(zi*128+128))&0xFF);
}
break;
@@ -355,55 +355,55 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
}
}
if(!c){
- if(mb->inner==PERIOD){
+ if(s->inner==PERIOD){
int j;
for(j=i-1; j; j--)
- if(SQR(mb->zyklus[j][0]-zr) + SQR(mb->zyklus[j][1]-zi) < epsilon*epsilon*10)
+ if(SQR(s->zyklus[j][0]-zr) + SQR(s->zyklus[j][1]-zi) < epsilon*epsilon*10)
break;
if(j){
c= i-j;
c= ((c<<5)&0xE0) + ((c<<10)&0xE000) + ((c<<15)&0xE00000);
}
- }else if(mb->inner==CONVTIME){
- c= floor(i*255.0/mb->maxiter+dv)*0x010101;
- } else if(mb->inner==MINCOL){
+ }else if(s->inner==CONVTIME){
+ c= floor(i*255.0/s->maxiter+dv)*0x010101;
+ } else if(s->inner==MINCOL){
int j;
double closest=9999;
int closest_index=0;
for(j=i-1; j>=0; j--)
- if(SQR(mb->zyklus[j][0]) + SQR(mb->zyklus[j][1]) < closest){
- closest= SQR(mb->zyklus[j][0]) + SQR(mb->zyklus[j][1]);
+ if(SQR(s->zyklus[j][0]) + SQR(s->zyklus[j][1]) < closest){
+ closest= SQR(s->zyklus[j][0]) + SQR(s->zyklus[j][1]);
closest_index= j;
}
closest = sqrt(closest);
- c= lrintf((mb->zyklus[closest_index][0]/closest+1)*127+dv) + lrintf((mb->zyklus[closest_index][1]/closest+1)*127+dv)*256;
+ c= lrintf((s->zyklus[closest_index][0]/closest+1)*127+dv) + lrintf((s->zyklus[closest_index][1]/closest+1)*127+dv)*256;
}
}
c |= 0xFF000000;
color[x + y*linesize]= c;
- if(next_cidx < mb->cache_allocated){
- mb->next_cache[next_cidx ].p[0]= cr;
- mb->next_cache[next_cidx ].p[1]= ci;
- mb->next_cache[next_cidx++].val = c;
+ if(next_cidx < s->cache_allocated){
+ s->next_cache[next_cidx ].p[0]= cr;
+ s->next_cache[next_cidx ].p[1]= ci;
+ s->next_cache[next_cidx++].val = c;
}
}
fill_from_cache(ctx, NULL, &in_cidx, &next_cidx, ci + scale/2, scale);
}
- FFSWAP(void*, mb->next_cache, mb->point_cache);
- mb->cache_used = next_cidx;
- if(mb->cache_used == mb->cache_allocated)
+ FFSWAP(void*, s->next_cache, s->point_cache);
+ s->cache_used = next_cidx;
+ if(s->cache_used == s->cache_allocated)
av_log(ctx, AV_LOG_INFO, "Mandelbrot cache is too small!\n");
}
static int request_frame(AVFilterLink *link)
{
- MBContext *mb = link->src->priv;
- AVFrame *picref = ff_get_video_buffer(link, mb->w, mb->h);
+ MBContext *s = link->src->priv;
+ AVFrame *picref = ff_get_video_buffer(link, s->w, s->h);
if (!picref)
return AVERROR(ENOMEM);
picref->sample_aspect_ratio = (AVRational) {1, 1};
- picref->pts = mb->pts++;
+ picref->pts = s->pts++;
draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts);
return ff_filter_frame(link, picref);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c b/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
index 7f981bad236..f63c861186d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vsrc_testsrc.c
@@ -30,7 +30,7 @@
* rgbtestsrc is ported from MPlayer libmpcodecs/vf_rgbtest.c by
* Michael Niedermayer.
*
- * smptebars and smptehdbars are by Paul B Mahol.
+ * allyuv, smptebars and smptehdbars are by Paul B Mahol.
*/
#include <float.h>
@@ -801,35 +801,44 @@ AVFilter ff_vsrc_rgbtestsrc = {
#if CONFIG_SMPTEBARS_FILTER || CONFIG_SMPTEHDBARS_FILTER
static const uint8_t rainbow[7][4] = {
- { 180, 128, 128, 255 }, /* gray */
- { 168, 44, 136, 255 }, /* yellow */
- { 145, 147, 44, 255 }, /* cyan */
- { 133, 63, 52, 255 }, /* green */
- { 63, 193, 204, 255 }, /* magenta */
- { 51, 109, 212, 255 }, /* red */
- { 28, 212, 120, 255 }, /* blue */
+ { 180, 128, 128, 255 }, /* 75% white */
+ { 161, 44, 141, 255 }, /* 75% yellow */
+ { 131, 156, 44, 255 }, /* 75% cyan */
+ { 112, 72, 57, 255 }, /* 75% green */
+ { 83, 183, 198, 255 }, /* 75% magenta */
+ { 65, 99, 212, 255 }, /* 75% red */
+ { 34, 212, 114, 255 }, /* 75% blue */
+};
+
+static const uint8_t rainbowhd[7][4] = {
+ { 180, 128, 128, 255 }, /* 75% white */
+ { 168, 44, 136, 255 }, /* 75% yellow */
+ { 145, 147, 44, 255 }, /* 75% cyan */
+ { 133, 63, 52, 255 }, /* 75% green */
+ { 63, 193, 204, 255 }, /* 75% magenta */
+ { 51, 109, 212, 255 }, /* 75% red */
+ { 28, 212, 120, 255 }, /* 75% blue */
};
static const uint8_t wobnair[7][4] = {
- { 32, 240, 118, 255 }, /* blue */
+ { 34, 212, 114, 255 }, /* 75% blue */
{ 19, 128, 128, 255 }, /* 7.5% intensity black */
- { 54, 184, 198, 255 }, /* magenta */
+ { 83, 183, 198, 255 }, /* 75% magenta */
{ 19, 128, 128, 255 }, /* 7.5% intensity black */
- { 188, 154, 16, 255 }, /* cyan */
+ { 131, 156, 44, 255 }, /* 75% cyan */
{ 19, 128, 128, 255 }, /* 7.5% intensity black */
- { 191, 128, 128, 255 }, /* gray */
+ { 180, 128, 128, 255 }, /* 75% white */
};
static const uint8_t white[4] = { 235, 128, 128, 255 };
-static const uint8_t black[4] = { 19, 128, 128, 255 }; /* 7.5% intensity black */
/* pluge pulses */
-static const uint8_t neg4ire[4] = { 9, 128, 128, 255 }; /* 3.5% intensity black */
-static const uint8_t pos4ire[4] = { 29, 128, 128, 255 }; /* 11.5% intensity black */
+static const uint8_t neg4ire[4] = { 7, 128, 128, 255 };
+static const uint8_t pos4ire[4] = { 24, 128, 128, 255 };
/* fudged Q/-I */
-static const uint8_t i_pixel[4] = { 61, 153, 99, 255 };
-static const uint8_t q_pixel[4] = { 35, 174, 152, 255 };
+static const uint8_t i_pixel[4] = { 57, 156, 97, 255 };
+static const uint8_t q_pixel[4] = { 44, 171, 147, 255 };
static const uint8_t gray40[4] = { 104, 128, 128, 255 };
static const uint8_t gray15[4] = { 49, 128, 128, 255 };
@@ -843,7 +852,7 @@ static const uint8_t black4[4] = { 25, 128, 128, 255 };
static const uint8_t neg2[4] = { 12, 128, 128, 255 };
static void draw_bar(TestSourceContext *test, const uint8_t color[4],
- unsigned x, unsigned y, unsigned w, unsigned h,
+ int x, int y, int w, int h,
AVFrame *frame)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
@@ -865,9 +874,9 @@ static void draw_bar(TestSourceContext *test, const uint8_t color[4],
if (plane == 1 || plane == 2) {
px = x >> desc->log2_chroma_w;
- pw = w >> desc->log2_chroma_w;
+ pw = FF_CEIL_RSHIFT(w, desc->log2_chroma_w);
py = y >> desc->log2_chroma_h;
- ph = h >> desc->log2_chroma_h;
+ ph = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
} else {
px = x;
pw = w;
@@ -940,16 +949,16 @@ static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
draw_bar(test, q_pixel, x, r_h + w_h, p_w, p_h, picref);
x += p_w;
tmp = FFALIGN(5 * r_w - x, 1 << pixdesc->log2_chroma_w);
- draw_bar(test, black, x, r_h + w_h, tmp, p_h, picref);
+ draw_bar(test, black0, x, r_h + w_h, tmp, p_h, picref);
x += tmp;
tmp = FFALIGN(r_w / 3, 1 << pixdesc->log2_chroma_w);
draw_bar(test, neg4ire, x, r_h + w_h, tmp, p_h, picref);
x += tmp;
- draw_bar(test, black, x, r_h + w_h, tmp, p_h, picref);
+ draw_bar(test, black0, x, r_h + w_h, tmp, p_h, picref);
x += tmp;
draw_bar(test, pos4ire, x, r_h + w_h, tmp, p_h, picref);
x += tmp;
- draw_bar(test, black, x, r_h + w_h, test->w - x, p_h, picref);
+ draw_bar(test, black0, x, r_h + w_h, test->w - x, p_h, picref);
}
static av_cold int smptebars_init(AVFilterContext *ctx)
@@ -995,7 +1004,7 @@ static void smptehdbars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
r_w = FFALIGN((((test->w + 3) / 4) * 3) / 7, 1 << pixdesc->log2_chroma_w);
for (i = 0; i < 7; i++) {
- draw_bar(test, rainbow[i], x, 0, r_w, r_h, picref);
+ draw_bar(test, rainbowhd[i], x, 0, r_w, r_h, picref);
x += r_w;
}
draw_bar(test, gray40, x, 0, test->w - x, r_h, picref);
@@ -1006,7 +1015,7 @@ static void smptehdbars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
draw_bar(test, i_pixel, x, y, r_w, r_h, picref);
x += r_w;
tmp = r_w * 6;
- draw_bar(test, rainbow[0], x, y, tmp, r_h, picref);
+ draw_bar(test, rainbowhd[0], x, y, tmp, r_h, picref);
x += tmp;
l_w = x;
draw_bar(test, blue, x, y, test->w - x, r_h, picref);
@@ -1080,3 +1089,165 @@ AVFilter ff_vsrc_smptehdbars = {
#endif /* CONFIG_SMPTEHDBARS_FILTER */
#endif /* CONFIG_SMPTEBARS_FILTER || CONFIG_SMPTEHDBARS_FILTER */
+
+#if CONFIG_ALLYUV_FILTER
+
+static const AVOption allyuv_options[] = {
+ COMMON_OPTIONS_NOSIZE
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(allyuv);
+
+static void allyuv_fill_picture(AVFilterContext *ctx, AVFrame *frame)
+{
+ const int ys = frame->linesize[0];
+ const int us = frame->linesize[1];
+ const int vs = frame->linesize[2];
+ int x, y, j;
+
+ for (y = 0; y < 4096; y++) {
+ for (x = 0; x < 2048; x++) {
+ frame->data[0][y * ys + x] = ((x / 8) % 256);
+ frame->data[0][y * ys + 4095 - x] = ((x / 8) % 256);
+ }
+
+ for (x = 0; x < 2048; x+=8) {
+ for (j = 0; j < 8; j++) {
+ frame->data[1][vs * y + x + j] = (y%16 + (j % 8) * 16);
+ frame->data[1][vs * y + 4095 - x - j] = (128 + y%16 + (j % 8) * 16);
+ }
+ }
+
+ for (x = 0; x < 4096; x++)
+ frame->data[2][y * us + x] = 256 * y / 4096;
+ }
+}
+
+static av_cold int allyuv_init(AVFilterContext *ctx)
+{
+ TestSourceContext *test = ctx->priv;
+
+ test->w = test->h = 4096;
+ test->draw_once = 1;
+ test->fill_picture_fn = allyuv_fill_picture;
+ return init(ctx);
+}
+
+static int allyuv_query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_GBRP,
+ AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static const AVFilterPad avfilter_vsrc_allyuv_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = config_props,
+ },
+ { NULL }
+};
+
+AVFilter ff_vsrc_allyuv = {
+ .name = "allyuv",
+ .description = NULL_IF_CONFIG_SMALL("Generate all yuv colors."),
+ .priv_size = sizeof(TestSourceContext),
+ .priv_class = &allyuv_class,
+ .init = allyuv_init,
+ .uninit = uninit,
+ .query_formats = allyuv_query_formats,
+ .inputs = NULL,
+ .outputs = avfilter_vsrc_allyuv_outputs,
+};
+
+#endif /* CONFIG_ALLYUV_FILTER */
+
+#if CONFIG_ALLRGB_FILTER
+
+static const AVOption allrgb_options[] = {
+ COMMON_OPTIONS_NOSIZE
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(allrgb);
+
+static void allrgb_fill_picture(AVFilterContext *ctx, AVFrame *frame)
+{
+ unsigned x, y;
+ const int linesize = frame->linesize[0];
+ uint8_t *line = frame->data[0];
+
+ for (y = 0; y < 4096; y++) {
+ uint8_t *dst = line;
+
+ for (x = 0; x < 4096; x++) {
+ *dst++ = x;
+ *dst++ = y;
+ *dst++ = (x >> 8) | ((y >> 8) << 4);
+ }
+ line += linesize;
+ }
+}
+
+static av_cold int allrgb_init(AVFilterContext *ctx)
+{
+ TestSourceContext *test = ctx->priv;
+
+ test->w = test->h = 4096;
+ test->draw_once = 1;
+ test->fill_picture_fn = allrgb_fill_picture;
+ return init(ctx);
+}
+
+static int allrgb_config_props(AVFilterLink *outlink)
+{
+ TestSourceContext *test = outlink->src->priv;
+
+ ff_fill_rgba_map(test->rgba_map, outlink->format);
+ return config_props(outlink);
+}
+
+static int allrgb_query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
+ };
+
+ AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+ if (!fmts_list)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, fmts_list);
+}
+
+static const AVFilterPad avfilter_vsrc_allrgb_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .request_frame = request_frame,
+ .config_props = allrgb_config_props,
+ },
+ { NULL }
+};
+
+AVFilter ff_vsrc_allrgb = {
+ .name = "allrgb",
+ .description = NULL_IF_CONFIG_SMALL("Generate all RGB colors."),
+ .priv_size = sizeof(TestSourceContext),
+ .priv_class = &allrgb_class,
+ .init = allrgb_init,
+ .uninit = uninit,
+ .query_formats = allrgb_query_formats,
+ .inputs = NULL,
+ .outputs = avfilter_vsrc_allrgb_outputs,
+};
+
+#endif /* CONFIG_ALLRGB_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
index 49f45b630ee..5382027f704 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
@@ -6,8 +6,11 @@ OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet_init.o
OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace_init.o
OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o
OBJS-$(CONFIG_PP7_FILTER) += x86/vf_pp7_init.o
+OBJS-$(CONFIG_PSNR_FILTER) += x86/vf_psnr_init.o
OBJS-$(CONFIG_PULLUP_FILTER) += x86/vf_pullup_init.o
+OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += x86/vf_removegrain_init.o
OBJS-$(CONFIG_SPP_FILTER) += x86/vf_spp.o
+OBJS-$(CONFIG_SSIM_FILTER) += x86/vf_ssim_init.o
OBJS-$(CONFIG_TINTERLACE_FILTER) += x86/vf_tinterlace_init.o
OBJS-$(CONFIG_VOLUME_FILTER) += x86/af_volume_init.o
OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif_init.o
@@ -18,7 +21,12 @@ YASM-OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d.o
YASM-OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet.o
YASM-OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace.o
YASM-OBJS-$(CONFIG_PP7_FILTER) += x86/vf_pp7.o
+YASM-OBJS-$(CONFIG_PSNR_FILTER) += x86/vf_psnr.o
YASM-OBJS-$(CONFIG_PULLUP_FILTER) += x86/vf_pullup.o
+ifdef CONFIG_GPL
+YASM-OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += x86/vf_removegrain.o
+endif
+YASM-OBJS-$(CONFIG_SSIM_FILTER) += x86/vf_ssim.o
YASM-OBJS-$(CONFIG_TINTERLACE_FILTER) += x86/vf_interlace.o
YASM-OBJS-$(CONFIG_VOLUME_FILTER) += x86/af_volume.o
YASM-OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif.o x86/yadif-16.o x86/yadif-10.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/af_volume.asm b/chromium/third_party/ffmpeg/libavfilter/x86/af_volume.asm
index f4cbcbc5de5..723ab1f8fb6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/af_volume.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/af_volume.asm
@@ -29,7 +29,7 @@ pw_1: times 8 dw 1
pw_128: times 8 dw 128
pq_128: times 2 dq 128
-SECTION_TEXT
+SECTION .text
;------------------------------------------------------------------------------
; void ff_scale_samples_s16(uint8_t *dst, const uint8_t *src, int len,
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_idet.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_idet.asm
index 007e63deb9e..9596abd7e2b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_idet.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_idet.asm
@@ -23,7 +23,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
; Implementation that does 8-bytes at a time using single-word operations.
%macro IDET_FILTER_LINE 1
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_interlace.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_interlace.asm
index ce3dd813112..f70c700965c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_interlace.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_interlace.asm
@@ -37,7 +37,7 @@ cglobal lowpass_line, 5, 5, 7
pcmpeqb m6, m6
-.loop
+.loop:
mova m0, [r3+r1]
mova m1, [r3+r1+mmsize]
pavgb m0, [r4+r1]
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr.asm
new file mode 100644
index 00000000000..ef88d6f6942
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr.asm
@@ -0,0 +1,140 @@
+;*****************************************************************************
+;* x86-optimized functions for interlace filter
+;*
+;* Copyright (C) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;******************************************************************************
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION .text
+
+%macro SSE_LINE_FN 2 ; 8 or 16, byte or word
+INIT_XMM sse2
+%if ARCH_X86_32
+%if %1 == 8
+cglobal sse_line_%1 %+ bit, 0, 6, 8, res, buf, w, px1, px2, ref
+%else
+cglobal sse_line_%1 %+ bit, 0, 7, 8, res, buf, reshigh, w, px1, px2, ref
+%endif
+ mov bufq, r0mp
+ mov refq, r1mp
+ mov wd, r2m
+%else
+cglobal sse_line_%1 %+ bit, 3, 5, 8, buf, ref, w, px1, px2
+%endif
+ pxor m6, m6
+ pxor m7, m7
+ sub wd, mmsize*2
+ jl .end
+
+.loop:
+ movu m0, [bufq+mmsize*0]
+ movu m1, [bufq+mmsize*1]
+ movu m2, [refq+mmsize*0]
+ movu m3, [refq+mmsize*1]
+%if %1 == 8
+ add bufq, mmsize*2
+ add refq, mmsize*2
+ psubusb m4, m0, m2
+ psubusb m5, m1, m3
+ psubusb m2, m0
+ psubusb m3, m1
+ por m2, m4
+ por m3, m5
+ punpcklbw m0, m2, m6
+ punpcklbw m1, m3, m6
+ punpckhbw m2, m6
+ punpckhbw m3, m6
+%else
+ psubw m0, m2
+ psubw m1, m3
+ movu m2, [bufq+mmsize*2]
+ movu m3, [bufq+mmsize*3]
+ movu m4, [refq+mmsize*2]
+ movu m5, [refq+mmsize*3]
+ psubw m2, m4
+ psubw m3, m5
+ add bufq, mmsize*4
+ add refq, mmsize*4
+%endif
+ pmaddwd m0, m0
+ pmaddwd m1, m1
+ pmaddwd m2, m2
+ pmaddwd m3, m3
+ paddd m0, m1
+ paddd m2, m3
+%if %1 == 8
+ paddd m7, m0
+ paddd m7, m2
+%else
+ paddd m0, m2
+ punpckldq m2, m0, m6
+ punpckhdq m0, m6
+ paddq m7, m0
+ paddq m7, m2
+%endif
+ sub wd, mmsize*2
+ jge .loop
+
+.end:
+ add wd, mmsize*2
+ movhlps m0, m7
+%if %1 == 8
+ paddd m7, m0
+ pshufd m0, m7, 1
+ paddd m7, m0
+ movd eax, m7
+%else
+ paddq m7, m0
+%if ARCH_X86_32
+ movd eax, m7
+ psrldq m7, 4
+ movd edx, m7
+%else
+ movq rax, m7
+%endif
+%endif
+
+ ; deal with cases where w % 32 != 0
+ test wd, wd
+ jz .end_scalar
+.loop_scalar:
+ movzx px1d, %2 [bufq+wq*(%1/8)-(%1/8)]
+ movzx px2d, %2 [refq+wq*(%1/8)-(%1/8)]
+ sub px1d, px2d
+ imul px1d, px1d
+%if %1 == 8
+ add eax, px1d
+%elif ARCH_X86_64
+ add rax, px1q
+%else
+ add eax, px1d
+ adc edx, 0
+%endif
+ dec wd
+ jg .loop_scalar
+
+.end_scalar:
+ ; for %1=8, no need to zero edx on x86-32, since edx=wd, which is zero
+ RET
+%endmacro
+
+INIT_XMM sse2
+SSE_LINE_FN 8, byte
+SSE_LINE_FN 16, word
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr_init.c
new file mode 100644
index 00000000000..c3878122046
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_psnr_init.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/x86/cpu.h"
+
+#include "libavfilter/psnr.h"
+
+uint64_t ff_sse_line_8bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
+uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
+
+void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE2(cpu_flags)) {
+ if (bpp <= 8) {
+ dsp->sse_line = ff_sse_line_8bit_sse2;
+ } else if (bpp <= 15) {
+ dsp->sse_line = ff_sse_line_16bit_sse2;
+ }
+ }
+}
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_pullup.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_pullup.asm
index d3a195511e6..26c2a27d37d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_pullup.asm
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_pullup.asm
@@ -20,7 +20,7 @@
%include "libavutil/x86/x86util.asm"
-SECTION_TEXT
+SECTION .text
INIT_MMX mmx
cglobal pullup_filter_diff, 3, 5, 8, first, second, size
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain.asm
new file mode 100644
index 00000000000..0cc6e5fa7de
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain.asm
@@ -0,0 +1,1218 @@
+;*****************************************************************************
+;* x86-optimized functions for removegrain filter
+;*
+;* Copyright (C) 2015 James Darnley
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or modify
+;* it under the terms of the GNU General Public License as published by
+;* the Free Software Foundation; either version 2 of the License, or
+;* (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;* GNU General Public License for more details.
+;*
+;* You should have received a copy of the GNU General Public License along
+;* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+;*****************************************************************************
+
+; column: -1 0 +1
+; row -1: a1 a2 a3
+; row 0: a4 c a5
+; row +1: a6 a7 a8
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION_RODATA 32
+
+pw_4: times 16 dw 4
+pw_8: times 16 dw 8
+pw_div9: times 16 dw ((1<<16)+4)/9
+
+SECTION .text
+
+;*** Preprocessor helpers
+
+%define a1 srcq+stride_n-1
+%define a2 srcq+stride_n
+%define a3 srcq+stride_n+1
+%define a4 srcq-1
+%define c srcq
+%define a5 srcq+1
+%define a6 srcq+stride_p-1
+%define a7 srcq+stride_p
+%define a8 srcq+stride_p+1
+
+; %1 dest simd register
+; %2 source memory location
+; %3 zero location (simd register/memory)
+%macro LOAD 3
+ movh %1, %2
+ punpcklbw %1, %3
+%endmacro
+
+%macro LOAD_SQUARE 0
+ movu m1, [a1]
+ movu m2, [a2]
+ movu m3, [a3]
+ movu m4, [a4]
+ movu m0, [c]
+ movu m5, [a5]
+ movu m6, [a6]
+ movu m7, [a7]
+ movu m8, [a8]
+%endmacro
+
+; %1 zero location (simd register/memory)
+%macro LOAD_SQUARE_16 1
+ LOAD m1, [a1], %1
+ LOAD m2, [a2], %1
+ LOAD m3, [a3], %1
+ LOAD m4, [a4], %1
+ LOAD m0, [c], %1
+ LOAD m5, [a5], %1
+ LOAD m6, [a6], %1
+ LOAD m7, [a7], %1
+ LOAD m8, [a8], %1
+%endmacro
+
+; %1 data type
+; %2 simd register to hold maximums
+; %3 simd register to hold minimums
+; %4 temp location (simd register/memory)
+%macro SORT_PAIR 4
+ mova %4, %2
+ pmin%1 %2, %3
+ pmax%1 %3, %4
+%endmacro
+
+%macro SORT_AXIS 0
+ SORT_PAIR ub, m1, m8, m9
+ SORT_PAIR ub, m2, m7, m10
+ SORT_PAIR ub, m3, m6, m11
+ SORT_PAIR ub, m4, m5, m12
+%endmacro
+
+
+%macro SORT_AXIS_16 0
+ SORT_PAIR sw, m1, m8, m9
+ SORT_PAIR sw, m2, m7, m10
+ SORT_PAIR sw, m3, m6, m11
+ SORT_PAIR sw, m4, m5, m12
+%endmacro
+
+; The loop doesn't need to do all the iterations. It could stop when the right
+; pixels are in the right registers.
+%macro SORT_SQUARE 0
+ %assign k 7
+ %rep 7
+ %assign i 1
+ %assign j 2
+ %rep k
+ SORT_PAIR ub, m %+ i , m %+ j , m9
+ %assign i i+1
+ %assign j j+1
+ %endrep
+ %assign k k-1
+ %endrep
+%endmacro
+
+; %1 dest simd register
+; %2 source (simd register/memory)
+; %3 temp simd register
+%macro ABS_DIFF 3
+ mova %3, %2
+ psubusb %3, %1
+ psubusb %1, %2
+ por %1, %3
+%endmacro
+
+; %1 dest simd register
+; %2 source (simd register/memory)
+; %3 temp simd register
+%macro ABS_DIFF_W 3
+ mova %3, %2
+ psubusw %3, %1
+ psubusw %1, %2
+ por %1, %3
+%endmacro
+
+; %1 simd register that holds the "false" values and will hold the result
+; %2 simd register that holds the "true" values
+; %3 location (simd register/memory) that hold the mask
+%macro BLEND 3
+%if cpuflag(avx2)
+ vpblendvb %1, %1, %2, %3
+%else
+ pand %2, %3
+ pandn %3, %1
+ por %3, %2
+ SWAP %1, %3
+%endif
+%endmacro
+
+; Functions
+
+INIT_XMM sse2
+cglobal rg_fl_mode_1, 4, 5, 3, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ movu m0, [a1]
+ mova m1, m0
+
+ movu m2, [a2]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a3]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a4]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a5]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a6]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a7]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [a8]
+ pmaxub m0, m2
+ pminub m1, m2
+
+ movu m2, [c]
+ pminub m2, m0
+ pmaxub m2, m1
+
+ movu [dstq], m2
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+%if ARCH_X86_64
+cglobal rg_fl_mode_2, 4, 5, 10, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_SQUARE
+
+ CLIPUB m0, m2, m7
+
+ movu [dstq], m0
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_3, 4, 5, 10, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_SQUARE
+
+ CLIPUB m0, m3, m6
+
+ movu [dstq], m0
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_4, 4, 5, 10, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_SQUARE
+
+ CLIPUB m0, m4, m5
+
+ movu [dstq], m0
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_5, 4, 5, 13, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_AXIS
+
+ mova m9, m0
+ mova m10, m0
+ mova m11, m0
+ mova m12, m0
+
+ CLIPUB m9, m1, m8
+ CLIPUB m10, m2, m7
+ CLIPUB m11, m3, m6
+ CLIPUB m12, m4, m5
+
+ mova m8, m9 ; clip1
+ mova m7, m10 ; clip2
+ mova m6, m11 ; clip3
+ mova m5, m12 ; clip4
+
+ ABS_DIFF m9, m0, m1 ; c1
+ ABS_DIFF m10, m0, m2 ; c2
+ ABS_DIFF m11, m0, m3 ; c3
+ ABS_DIFF m12, m0, m4 ; c4
+
+ pminub m9, m10
+ pminub m9, m11
+ pminub m9, m12 ; mindiff
+
+ pcmpeqb m10, m9
+ pcmpeqb m11, m9
+ pcmpeqb m12, m9
+
+ ; Notice the order here: c1, c3, c2, c4
+ BLEND m8, m6, m11
+ BLEND m8, m7, m10
+ BLEND m8, m5, m12
+
+ movu [dstq], m8
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_6, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ ; Some register saving suggestions: the zero can be somewhere other than a
+ ; register, the center pixels could be on the stack.
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+ SORT_AXIS_16
+
+ mova m9, m0
+ mova m10, m0
+ mova m11, m0
+ mova m12, m0
+ CLIPW m9, m1, m8 ; clip1
+ CLIPW m10, m2, m7 ; clip2
+ CLIPW m11, m3, m6 ; clip3
+ CLIPW m12, m4, m5 ; clip4
+
+ psubw m8, m1 ; d1
+ psubw m7, m2 ; d2
+ psubw m6, m3 ; d3
+ psubw m5, m4 ; d4
+
+ mova m1, m9
+ mova m2, m10
+ mova m3, m11
+ mova m4, m12
+ ABS_DIFF_W m1, m0, m13
+ ABS_DIFF_W m2, m0, m14
+ ABS_DIFF_W m3, m0, m13
+ ABS_DIFF_W m4, m0, m14
+ psllw m1, 1
+ psllw m2, 1
+ psllw m3, 1
+ psllw m4, 1
+ paddw m1, m8 ; c1
+ paddw m2, m7 ; c2
+ paddw m3, m6 ; c3
+ paddw m4, m5 ; c4
+ ; As the differences (d1..d4) can only be postive, there is no need to
+ ; clip to zero. Also, the maximum positive value is less than 768.
+
+ pminsw m1, m2
+ pminsw m1, m3
+ pminsw m1, m4
+
+ pcmpeqw m2, m1
+ pcmpeqw m3, m1
+ pcmpeqw m4, m1
+
+ BLEND m9, m11, m3
+ BLEND m9, m10, m2
+ BLEND m9, m12, m4
+ packuswb m9, m9
+
+ movh [dstq], m9
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+; This is just copy-pasted straight from mode 6 with the left shifts removed.
+cglobal rg_fl_mode_7, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ ; Can this be done without unpacking?
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+ SORT_AXIS_16
+
+ mova m9, m0
+ mova m10, m0
+ mova m11, m0
+ mova m12, m0
+ CLIPW m9, m1, m8 ; clip1
+ CLIPW m10, m2, m7 ; clip2
+ CLIPW m11, m3, m6 ; clip3
+ CLIPW m12, m4, m5 ; clip4
+
+ psubw m8, m1 ; d1
+ psubw m7, m2 ; d2
+ psubw m6, m3 ; d3
+ psubw m5, m4 ; d4
+
+ mova m1, m9
+ mova m2, m10
+ mova m3, m11
+ mova m4, m12
+ ABS_DIFF_W m1, m0, m13
+ ABS_DIFF_W m2, m0, m14
+ ABS_DIFF_W m3, m0, m13
+ ABS_DIFF_W m4, m0, m14
+ paddw m1, m8 ; c1
+ paddw m2, m7 ; c2
+ paddw m3, m6 ; c3
+ paddw m4, m5 ; c4
+
+ pminsw m1, m2
+ pminsw m1, m3
+ pminsw m1, m4
+
+ pcmpeqw m2, m1
+ pcmpeqw m3, m1
+ pcmpeqw m4, m1
+
+ BLEND m9, m11, m3
+ BLEND m9, m10, m2
+ BLEND m9, m12, m4
+ packuswb m9, m9
+
+ movh [dstq], m9
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+; This is just copy-pasted straight from mode 6 with a few changes.
+cglobal rg_fl_mode_8, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+ SORT_AXIS_16
+
+ mova m9, m0
+ mova m10, m0
+ mova m11, m0
+ mova m12, m0
+ CLIPW m9, m1, m8 ; clip1
+ CLIPW m10, m2, m7 ; clip2
+ CLIPW m11, m3, m6 ; clip3
+ CLIPW m12, m4, m5 ; clip4
+
+ psubw m8, m1 ; d1
+ psubw m7, m2 ; d2
+ psubw m6, m3 ; d3
+ psubw m5, m4 ; d4
+ psllw m8, 1
+ psllw m7, 1
+ psllw m6, 1
+ psllw m5, 1
+
+ mova m1, m9
+ mova m2, m10
+ mova m3, m11
+ mova m4, m12
+ ABS_DIFF_W m1, m0, m13
+ ABS_DIFF_W m2, m0, m14
+ ABS_DIFF_W m3, m0, m13
+ ABS_DIFF_W m4, m0, m14
+ paddw m1, m8 ; c1
+ paddw m2, m7 ; c1
+ paddw m3, m6 ; c1
+ paddw m4, m5 ; c1
+ ; As the differences (d1..d4) can only be postive, there is no need to
+ ; clip to zero. Also, the maximum positive value is less than 768.
+
+ pminsw m1, m2
+ pminsw m1, m3
+ pminsw m1, m4
+
+ pcmpeqw m2, m1
+ pcmpeqw m3, m1
+ pcmpeqw m4, m1
+
+ BLEND m9, m11, m3
+ BLEND m9, m10, m2
+ BLEND m9, m12, m4
+ packuswb m9, m9
+
+ movh [dstq], m9
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_9, 4, 5, 13, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_AXIS
+
+ mova m9, m0
+ mova m10, m0
+ mova m11, m0
+ mova m12, m0
+ CLIPUB m9, m1, m8 ; clip1
+ CLIPUB m10, m2, m7 ; clip2
+ CLIPUB m11, m3, m6 ; clip3
+ CLIPUB m12, m4, m5 ; clip4
+
+ psubb m8, m1 ; d1
+ psubb m7, m2 ; d2
+ psubb m6, m3 ; d3
+ psubb m5, m4 ; d4
+
+ pminub m8, m7
+ pminub m8, m6
+ pminub m8, m5
+
+ pcmpeqb m7, m8
+ pcmpeqb m6, m8
+ pcmpeqb m5, m8
+
+ BLEND m9, m11, m6
+ BLEND m9, m10, m7
+ BLEND m9, m12, m5
+
+ movu [dstq], m9
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+%endif
+
+cglobal rg_fl_mode_10, 4, 5, 8, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ movu m0, [c]
+
+ movu m1, [a4]
+ mova m2, m1
+ ABS_DIFF m1, m0, m7
+
+ movu m3, [a5] ; load pixel
+ mova m4, m3
+ ABS_DIFF m4, m0, m7 ; absolute difference from center
+ pminub m1, m4 ; mindiff
+ pcmpeqb m4, m1 ; if (difference == mindiff)
+ BLEND m2, m3, m4 ; return pixel
+
+ movu m5, [a1]
+ mova m6, m5
+ ABS_DIFF m6, m0, m7
+ pminub m1, m6
+ pcmpeqb m6, m1
+ BLEND m2, m5, m6
+
+ movu m3, [a3]
+ mova m4, m3
+ ABS_DIFF m4, m0, m7
+ pminub m1, m4
+ pcmpeqb m4, m1
+ BLEND m2, m3, m4
+
+ movu m5, [a2]
+ mova m6, m5
+ ABS_DIFF m6, m0, m7
+ pminub m1, m6
+ pcmpeqb m6, m1
+ BLEND m2, m5, m6
+
+ movu m3, [a6]
+ mova m4, m3
+ ABS_DIFF m4, m0, m7
+ pminub m1, m4
+ pcmpeqb m4, m1
+ BLEND m2, m3, m4
+
+ movu m5, [a8]
+ mova m6, m5
+ ABS_DIFF m6, m0, m7
+ pminub m1, m6
+ pcmpeqb m6, m1
+ BLEND m2, m5, m6
+
+ movu m3, [a7]
+ mova m4, m3
+ ABS_DIFF m4, m0, m7
+ pminub m1, m4
+ pcmpeqb m4, m1
+ BLEND m2, m3, m4
+
+ movu [dstq], m2
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_11_12, 4, 5, 7, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m0, m0
+ .loop:
+ LOAD m1, [c], m0
+ LOAD m2, [a2], m0
+ LOAD m3, [a4], m0
+ LOAD m4, [a5], m0
+ LOAD m5, [a7], m0
+
+ psllw m1, 2
+ paddw m2, m3
+ paddw m4, m5
+ paddw m2, m4
+ psllw m2, 1
+
+ LOAD m3, [a1], m0
+ LOAD m4, [a3], m0
+ LOAD m5, [a6], m0
+ LOAD m6, [a8], m0
+ paddw m1, m2
+ paddw m3, m4
+ paddw m5, m6
+ paddw m1, m3
+ paddw m1, m5
+
+ paddw m1, [pw_8]
+ psraw m1, 4
+
+ packuswb m1, m1
+
+ movh [dstq], m1
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_13_14, 4, 5, 8, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ movu m1, [a1]
+ movu m2, [a8]
+ mova m0, m1
+ pavgb m1, m2
+ ABS_DIFF m0, m2, m6
+
+ movu m3, [a3]
+ movu m4, [a6]
+ mova m5, m3
+ pavgb m3, m4
+ ABS_DIFF m5, m4, m7
+ pminub m0, m5
+ pcmpeqb m5, m0
+ BLEND m1, m3, m5
+
+ movu m2, [a2]
+ movu m3, [a7]
+ mova m4, m2
+ pavgb m2, m3
+ ABS_DIFF m4, m3, m6
+ pminub m0, m4
+ pcmpeqb m4, m0
+ BLEND m1, m2, m4
+
+ movu [dstq], m1
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+%if ARCH_X86_64
+cglobal rg_fl_mode_15_16, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+
+ mova m9, m1
+ mova m10, m2
+ mova m11, m3
+ ABS_DIFF_W m9, m8, m12
+ ABS_DIFF_W m10, m7, m13
+ ABS_DIFF_W m11, m6, m14
+ pminsw m9, m10
+ pminsw m9, m11
+ pcmpeqw m10, m9
+ pcmpeqw m11, m9
+
+ mova m12, m2
+ mova m13, m1
+ mova m14, m6
+ paddw m12, m7
+ psllw m12, 1
+ paddw m13, m3
+ paddw m14, m8
+ paddw m12, [pw_4]
+ paddw m13, m14
+ paddw m12, m13
+ psrlw m12, 3
+
+ SORT_PAIR ub, m1, m8, m0
+ SORT_PAIR ub, m2, m7, m9
+ SORT_PAIR ub, m3, m6, m14
+ mova m4, m12
+ mova m5, m12
+ CLIPW m4, m1, m8
+ CLIPW m5, m2, m7
+ CLIPW m12, m3, m6
+
+ BLEND m4, m12, m11
+ BLEND m4, m5, m10
+ packuswb m4, m4
+
+ movh [dstq], m4
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_17, 4, 5, 9, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+ SORT_AXIS
+
+ pmaxub m1, m2
+ pmaxub m3, m4
+
+ pminub m8, m7
+ pminub m5, m6
+
+ pmaxub m1, m3
+ pminub m8, m5
+
+ mova m2, m1
+ pminub m1, m8
+ pmaxub m8, m2
+
+ CLIPUB m0, m1, m8
+
+ movu [dstq], m0
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_18, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ LOAD_SQUARE
+
+ mova m9, m1
+ mova m10, m8
+ ABS_DIFF m9, m0, m11
+ ABS_DIFF m10, m0, m12
+ pmaxub m9, m10 ; m9 = d1
+
+ mova m10, m2
+ mova m11, m7
+ ABS_DIFF m10, m0, m12
+ ABS_DIFF m11, m0, m13
+ pmaxub m10, m11 ; m10 = d2
+
+ mova m11, m3
+ mova m12, m6
+ ABS_DIFF m11, m0, m13
+ ABS_DIFF m12, m0, m14
+ pmaxub m11, m12 ; m11 = d3
+
+ mova m12, m4
+ mova m13, m5
+ ABS_DIFF m12, m0, m14
+ ABS_DIFF m13, m0, m15
+ pmaxub m12, m13 ; m12 = d4
+
+ mova m13, m9
+ pminub m13, m10
+ pminub m13, m11
+ pminub m13, m12 ; m13 = mindiff
+
+ pcmpeqb m10, m13
+ pcmpeqb m11, m13
+ pcmpeqb m12, m13
+
+ mova m14, m1
+ pminub m1, m8
+ pmaxub m8, m14
+
+ mova m13, m0
+ mova m14, m1
+ pminub m1, m8
+ pmaxub m8, m14
+ CLIPUB m13, m1, m8 ; m13 = ret...d1
+
+ mova m14, m0
+ mova m15, m3
+ pminub m3, m6
+ pmaxub m6, m15
+ CLIPUB m14, m3, m6
+ pand m14, m11
+ pandn m11, m13
+ por m14, m11 ; m14 = ret...d3
+
+ mova m15, m0
+ mova m1, m2
+ pminub m2, m7
+ pmaxub m7, m1
+ CLIPUB m15, m2, m7
+ pand m15, m10
+ pandn m10, m14
+ por m15, m10 ; m15 = ret...d2
+
+ mova m1, m0
+ mova m2, m4
+ pminub m4, m5
+ pmaxub m5, m2
+ CLIPUB m1, m4, m5
+ pand m1, m12
+ pandn m12, m15
+ por m1, m12 ; m15 = ret...d4
+
+ movu [dstq], m1
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+%endif
+
+cglobal rg_fl_mode_19, 4, 5, 7, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m0, m0
+ .loop:
+ LOAD m1, [a1], m0
+ LOAD m2, [a2], m0
+ paddw m1, m2
+
+ LOAD m3, [a3], m0
+ LOAD m4, [a4], m0
+ paddw m3, m4
+
+ LOAD m5, [a5], m0
+ LOAD m6, [a6], m0
+ paddw m5, m6
+
+ LOAD m2, [a7], m0
+ LOAD m4, [a8], m0
+ paddw m2, m4
+
+ paddw m1, m3
+ paddw m2, m5
+ paddw m1, m2
+
+ paddw m1, [pw_4]
+ psraw m1, 3
+
+ packuswb m1, m1
+
+ movh [dstq], m1
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_20, 4, 5, 7, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m0, m0
+ .loop:
+ LOAD m1, [a1], m0
+ LOAD m2, [a2], m0
+ paddw m1, m2
+
+ LOAD m3, [a3], m0
+ LOAD m4, [a4], m0
+ paddw m3, m4
+
+ LOAD m5, [a5], m0
+ LOAD m6, [a6], m0
+ paddw m5, m6
+
+ LOAD m2, [a7], m0
+ LOAD m4, [a8], m0
+ paddw m2, m4
+
+ LOAD m6, [c], m0
+ paddw m1, m3
+ paddw m2, m5
+ paddw m6, [pw_4]
+
+ paddw m1, m2
+ paddw m1, m6
+
+ pmulhuw m1, [pw_div9]
+
+ packuswb m1, m1
+
+ movh [dstq], m1
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_21, 4, 5, 8, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m0, m0
+ .loop:
+ movu m1, [a1]
+ movu m2, [a8]
+ pavgb m7, m1, m2
+ punpckhbw m3, m1, m0
+ punpcklbw m1, m0
+ punpckhbw m4, m2, m0
+ punpcklbw m2, m0
+ paddw m3, m4
+ paddw m1, m2
+ psrlw m3, 1
+ psrlw m1, 1
+ packuswb m1, m3
+
+ movu m2, [a2]
+ movu m3, [a7]
+ pavgb m6, m2, m3
+ punpckhbw m4, m2, m0
+ punpcklbw m2, m0
+ punpckhbw m5, m3, m0
+ punpcklbw m3, m0
+ paddw m4, m5
+ paddw m2, m3
+ psrlw m4, 1
+ psrlw m2, 1
+ packuswb m2, m4
+
+ pminub m1, m2
+ pmaxub m7, m6
+
+ movu m2, [a3]
+ movu m3, [a6]
+ pavgb m6, m2, m3
+ punpckhbw m4, m2, m0
+ punpcklbw m2, m0
+ punpckhbw m5, m3, m0
+ punpcklbw m3, m0
+ paddw m4, m5
+ paddw m2, m3
+ psrlw m4, 1
+ psrlw m2, 1
+ packuswb m2, m4
+
+ pminub m1, m2
+ pmaxub m7, m6
+
+ movu m2, [a4]
+ movu m3, [a5]
+ pavgb m6, m2, m3
+ punpckhbw m4, m2, m0
+ punpcklbw m2, m0
+ punpckhbw m5, m3, m0
+ punpcklbw m3, m0
+ paddw m4, m5
+ paddw m2, m3
+ psrlw m4, 1
+ psrlw m2, 1
+ packuswb m2, m4
+
+ pminub m1, m2
+ pmaxub m7, m6
+
+ movu m3, [c]
+ CLIPUB m3, m1, m7
+
+ movu [dstq], m3
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+cglobal rg_fl_mode_22, 4, 5, 8, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ .loop:
+ movu m0, [a1]
+ movu m1, [a8]
+ pavgb m0, m1
+ movu m2, [a2]
+ movu m3, [a7]
+ pavgb m2, m3
+ movu m4, [a3]
+ movu m5, [a6]
+ pavgb m4, m5
+ movu m6, [a4]
+ movu m7, [a5]
+ pavgb m6, m7
+
+ mova m1, m0
+ mova m3, m2
+ mova m5, m4
+ mova m7, m6
+ pminub m0, m2
+ pminub m4, m6
+ pmaxub m1, m3
+ pmaxub m5, m7
+ pminub m0, m4
+ pmaxub m1, m5
+
+ movu m2, [c]
+ CLIPUB m2, m0, m1
+
+ movu [dstq], m2
+ add srcq, mmsize
+ add dstq, mmsize
+ sub pixelsd, mmsize
+ jg .loop
+RET
+
+%if ARCH_X86_64
+cglobal rg_fl_mode_23, 4, 5, 16, 0, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+ SORT_AXIS_16
+
+ mova m9, m8
+ mova m10, m7
+ mova m11, m6
+ mova m12, m5
+ psubw m9, m1 ; linediff1
+ psubw m10, m2 ; linediff2
+ psubw m11, m3 ; linediff3
+ psubw m12, m4 ; linediff4
+
+ psubw m1, m0
+ psubw m2, m0
+ psubw m3, m0
+ psubw m4, m0
+ pminsw m1, m9 ; d1
+ pminsw m2, m10 ; d2
+ pminsw m3, m11 ; d3
+ pminsw m4, m12 ; d4
+ pmaxsw m1, m2
+ pmaxsw m3, m4
+ pmaxsw m1, m3
+ pmaxsw m1, m15 ; d
+
+ mova m13, m0
+ mova m14, m0
+ mova m2, m0
+ mova m4, m0
+ psubw m13, m8
+ psubw m14, m7
+ psubw m2, m6
+ psubw m4, m5
+ pminsw m9, m13 ; u1
+ pminsw m10, m14 ; u2
+ pminsw m11, m2 ; u3
+ pminsw m12, m4 ; u4
+ pmaxsw m9, m10
+ pmaxsw m11, m12
+ pmaxsw m9, m11
+ pmaxsw m9, m15 ; u
+
+ paddw m0, m1
+ psubw m0, m9
+ packuswb m0, m0
+
+ movh [dstq], m0
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+
+cglobal rg_fl_mode_24, 4, 5, 16, mmsize, dst, src, stride, pixels
+ mov r4q, strideq
+ neg r4q
+ %define stride_p strideq
+ %define stride_n r4q
+
+ pxor m15, m15
+ .loop:
+ LOAD_SQUARE_16 m15
+ mova [rsp], m0
+ SORT_AXIS_16
+
+ mova m9, m8
+ mova m10, m7
+ mova m11, m6
+ mova m12, m5
+ psubw m9, m1 ; linediff1
+ psubw m10, m2 ; linediff2
+ psubw m11, m3 ; linediff3
+ psubw m12, m4 ; linediff4
+
+ psubw m1, [rsp] ; td1
+ psubw m2, [rsp] ; td2
+ psubw m3, [rsp] ; td3
+ psubw m4, [rsp] ; td4
+ mova m0, m9
+ mova m13, m10
+ mova m14, m11
+ mova m15, m12
+ psubw m0, m1
+ psubw m13, m2
+ psubw m14, m3
+ psubw m15, m4
+ pminsw m1, m0 ; d1
+ pminsw m2, m13 ; d2
+ pminsw m3, m14 ; d3
+ pminsw m4, m15 ; d4
+ pmaxsw m1, m2
+ pmaxsw m3, m4
+
+ mova m0, [rsp]
+ mova m13, [rsp]
+ mova m14, [rsp]
+ mova m15, [rsp]
+ psubw m0, m8 ; tu1
+ psubw m13, m7 ; tu2
+ psubw m14, m6 ; tu3
+ psubw m15, m5 ; tu4
+ psubw m9, m0
+ psubw m10, m13
+ psubw m11, m14
+ psubw m12, m15
+ pminsw m9, m0 ; u1
+ pminsw m10, m13 ; u2
+ pminsw m11, m14 ; u3
+ pminsw m12, m15 ; u4
+ pmaxsw m9, m10
+ pmaxsw m11, m12
+
+ pmaxsw m1, m3 ; d without max(d,0)
+ pmaxsw m9, m11 ; u without max(u,0)
+ pxor m15, m15
+ pmaxsw m1, m15
+ pmaxsw m9, m15
+
+ mova m0, [rsp]
+ paddw m0, m1
+ psubw m0, m9
+ packuswb m0, m0
+
+ movh [dstq], m0
+ add srcq, mmsize/2
+ add dstq, mmsize/2
+ sub pixelsd, mmsize/2
+ jg .loop
+RET
+%endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain_init.c
new file mode 100644
index 00000000000..07314b32446
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_removegrain_init.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2015 James Darnley
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
+#include "libavfilter/removegrain.h"
+
+void ff_rg_fl_mode_1_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_10_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_11_12_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_13_14_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_19_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_20_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_21_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_22_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+#if ARCH_X86_64
+void ff_rg_fl_mode_2_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_3_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_5_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_6_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_7_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_8_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_9_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_15_16_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_17_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_18_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_23_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels);
+#endif
+
+av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
+{
+#if CONFIG_GPL
+ int cpu_flags = av_get_cpu_flags();
+ int i;
+
+ for (i = 0; i < rg->nb_planes; i++) {
+ if (EXTERNAL_SSE2(cpu_flags))
+ switch (rg->mode[i]) {
+ case 1: rg->fl[i] = ff_rg_fl_mode_1_sse2; break;
+ case 10: rg->fl[i] = ff_rg_fl_mode_10_sse2; break;
+ case 11: /* fall through */
+ case 12: rg->fl[i] = ff_rg_fl_mode_11_12_sse2; break;
+ case 13: /* fall through */
+ case 14: rg->fl[i] = ff_rg_fl_mode_13_14_sse2; break;
+ case 19: rg->fl[i] = ff_rg_fl_mode_19_sse2; break;
+ case 20: rg->fl[i] = ff_rg_fl_mode_20_sse2; break;
+ case 21: rg->fl[i] = ff_rg_fl_mode_21_sse2; break;
+ case 22: rg->fl[i] = ff_rg_fl_mode_22_sse2; break;
+#if ARCH_X86_64
+ case 2: rg->fl[i] = ff_rg_fl_mode_2_sse2; break;
+ case 3: rg->fl[i] = ff_rg_fl_mode_3_sse2; break;
+ case 4: rg->fl[i] = ff_rg_fl_mode_4_sse2; break;
+ case 5: rg->fl[i] = ff_rg_fl_mode_5_sse2; break;
+ case 6: rg->fl[i] = ff_rg_fl_mode_6_sse2; break;
+ case 7: rg->fl[i] = ff_rg_fl_mode_7_sse2; break;
+ case 8: rg->fl[i] = ff_rg_fl_mode_8_sse2; break;
+ case 9: rg->fl[i] = ff_rg_fl_mode_9_sse2; break;
+ case 15: /* fall through */
+ case 16: rg->fl[i] = ff_rg_fl_mode_15_16_sse2; break;
+ case 17: rg->fl[i] = ff_rg_fl_mode_17_sse2; break;
+ case 18: rg->fl[i] = ff_rg_fl_mode_18_sse2; break;
+ case 23: rg->fl[i] = ff_rg_fl_mode_23_sse2; break;
+ case 24: rg->fl[i] = ff_rg_fl_mode_24_sse2; break;
+#endif /* ARCH_x86_64 */
+ }
+ }
+#endif /* CONFIG_GPL */
+}
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_spp.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_spp.c
index 1cfb9e81f7c..45a9eb068c9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_spp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_spp.c
@@ -223,8 +223,10 @@ av_cold void ff_spp_init_x86(SPPContext *s)
int cpu_flags = av_get_cpu_flags();
if (cpu_flags & AV_CPU_FLAG_MMX) {
+ int64_t bps;
s->store_slice = store_slice_mmx;
- if (av_get_int(s->dct, "bits_per_sample", NULL) <= 8) {
+ av_opt_get_int(s->dct, "bits_per_sample", 0, &bps);
+ if (bps <= 8) {
switch (s->mode) {
case 0: s->requantize = hardthresh_mmx; break;
case 1: s->requantize = softthresh_mmx; break;
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim.asm
new file mode 100644
index 00000000000..3293e667012
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim.asm
@@ -0,0 +1,247 @@
+;*****************************************************************************
+;* x86-optimized functions for ssim filter
+;*
+;* Copyright (C) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;******************************************************************************
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION_RODATA
+
+pw_1: times 8 dw 1
+ssim_c1: times 4 dd 416 ;(.01*.01*255*255*64 + .5)
+ssim_c2: times 4 dd 235963 ;(.03*.03*255*255*64*63 + .5)
+
+SECTION .text
+
+%macro SSIM_4X4_LINE 1
+%if ARCH_X86_64
+cglobal ssim_4x4_line, 6, 8, %1, buf, buf_stride, ref, ref_stride, sums, w, buf_stride3, ref_stride3
+%else
+cglobal ssim_4x4_line, 5, 7, %1, buf, buf_stride, ref, ref_stride, sums, buf_stride3, ref_stride3
+%define wd r5mp
+%endif
+ lea ref_stride3q, [ref_strideq*3]
+ lea buf_stride3q, [buf_strideq*3]
+%if notcpuflag(xop)
+ pxor m7, m7
+ mova m15, [pw_1]
+%endif
+
+.loop:
+%if cpuflag(xop)
+ pmovzxbw m0, [bufq+buf_strideq*0]
+ pmovzxbw m1, [refq+ref_strideq*0]
+ pmaddwd m4, m0, m0
+ pmaddwd m6, m0, m1
+ pmovzxbw m2, [bufq+buf_strideq*1]
+ vpmadcswd m4, m1, m1, m4
+ pmovzxbw m3, [refq+ref_strideq*1]
+ paddw m0, m2
+ vpmadcswd m4, m2, m2, m4
+ vpmadcswd m6, m2, m3, m6
+ paddw m1, m3
+ vpmadcswd m4, m3, m3, m4
+
+ pmovzxbw m2, [bufq+buf_strideq*2]
+ pmovzxbw m3, [refq+ref_strideq*2]
+ vpmadcswd m4, m2, m2, m4
+ vpmadcswd m6, m2, m3, m6
+ pmovzxbw m5, [bufq+buf_stride3q]
+ pmovzxbw m7, [refq+ref_stride3q]
+ vpmadcswd m4, m3, m3, m4
+ vpmadcswd m6, m5, m7, m6
+ paddw m0, m2
+ paddw m1, m3
+ vpmadcswd m4, m5, m5, m4
+ paddw m0, m5
+ paddw m1, m7
+ vpmadcswd m4, m7, m7, m4
+%else
+ movh m0, [bufq+buf_strideq*0] ; a1
+ movh m1, [refq+ref_strideq*0] ; b1
+ movh m2, [bufq+buf_strideq*1] ; a2
+ movh m3, [refq+ref_strideq*1] ; b2
+ punpcklbw m0, m7 ; s1 [word]
+ punpcklbw m1, m7 ; s2 [word]
+ punpcklbw m2, m7 ; s1 [word]
+ punpcklbw m3, m7 ; s2 [word]
+ pmaddwd m4, m0, m0 ; a1 * a1
+ pmaddwd m5, m1, m1 ; b1 * b1
+ pmaddwd m8, m2, m2 ; a2 * a2
+ pmaddwd m9, m3, m3 ; b2 * b2
+ paddd m4, m5 ; ss
+ paddd m8, m9 ; ss
+ pmaddwd m6, m0, m1 ; a1 * b1 = ss12
+ pmaddwd m5, m2, m3 ; a2 * b2 = ss12
+ paddw m0, m2
+ paddw m1, m3
+ paddd m6, m5 ; s12
+ paddd m4, m8 ; ss
+
+ movh m2, [bufq+buf_strideq*2] ; a3
+ movh m3, [refq+ref_strideq*2] ; b3
+ movh m5, [bufq+buf_stride3q] ; a4
+ movh m8, [refq+ref_stride3q] ; b4
+ punpcklbw m2, m7 ; s1 [word]
+ punpcklbw m3, m7 ; s2 [word]
+ punpcklbw m5, m7 ; s1 [word]
+ punpcklbw m8, m7 ; s2 [word]
+ pmaddwd m9, m2, m2 ; a3 * a3
+ pmaddwd m10, m3, m3 ; b3 * b3
+ pmaddwd m12, m5, m5 ; a4 * a4
+ pmaddwd m13, m8, m8 ; b4 * b4
+ pmaddwd m11, m2, m3 ; a3 * b3 = ss12
+ pmaddwd m14, m5, m8 ; a4 * b4 = ss12
+ paddd m9, m10
+ paddd m12, m13
+ paddw m0, m2
+ paddw m1, m3
+ paddw m0, m5
+ paddw m1, m8
+ paddd m6, m11
+ paddd m4, m9
+ paddd m6, m14
+ paddd m4, m12
+%endif
+
+ ; m0 = [word] s1 a,a,a,a,b,b,b,b
+ ; m1 = [word] s2 a,a,a,a,b,b,b,b
+ ; m4 = [dword] ss a,a,b,b
+ ; m6 = [dword] s12 a,a,b,b
+
+%if cpuflag(xop)
+ vphaddwq m0, m0 ; [dword] s1 a, 0, b, 0
+ vphaddwq m1, m1 ; [dword] s2 a, 0, b, 0
+ vphadddq m4, m4 ; [dword] ss a, 0, b, 0
+ vphadddq m6, m6 ; [dword] s12 a, 0, b, 0
+ punpckhdq m2, m0, m1 ; [dword] s1 b, s2 b, 0, 0
+ punpckldq m0, m1 ; [dword] s1 a, s2 a, 0, 0
+ punpckhdq m3, m4, m6 ; [dword] ss b, s12 b, 0, 0
+ punpckldq m4, m6 ; [dword] ss a, s12 a, 0, 0
+ punpcklqdq m1, m2, m3 ; [dword] b s1, s2, ss, s12
+ punpcklqdq m0, m4 ; [dword] a s1, s2, ss, s12
+%else
+ pmaddwd m0, m15 ; [dword] s1 a,a,b,b
+ pmaddwd m1, m15 ; [dword] s2 a,a,b,b
+ phaddd m0, m4 ; [dword] s1 a, b, ss a, b
+ phaddd m1, m6 ; [dword] s2 a, b, s12 a, b
+ punpckhdq m2, m0, m1 ; [dword] ss a, s12 a, ss b, s12 b
+ punpckldq m0, m1 ; [dword] s1 a, s2 a, s1 b, s2 b
+ punpckhqdq m1, m0, m2 ; [dword] b s1, s2, ss, s12
+ punpcklqdq m0, m2 ; [dword] a s1, s2, ss, s12
+%endif
+
+ mova [sumsq+ 0], m0
+ mova [sumsq+mmsize], m1
+
+ add bufq, mmsize/2
+ add refq, mmsize/2
+ add sumsq, mmsize*2
+ sub wd, mmsize/8
+ jg .loop
+ RET
+%endmacro
+
+%if ARCH_X86_64
+INIT_XMM ssse3
+SSIM_4X4_LINE 16
+%endif
+%if HAVE_XOP_EXTERNAL
+INIT_XMM xop
+SSIM_4X4_LINE 8
+%endif
+
+INIT_XMM sse4
+cglobal ssim_end_line, 3, 3, 6, sum0, sum1, w
+ pxor m0, m0
+.loop:
+ mova m1, [sum0q+mmsize*0]
+ mova m2, [sum0q+mmsize*1]
+ mova m3, [sum0q+mmsize*2]
+ mova m4, [sum0q+mmsize*3]
+ paddd m1, [sum1q+mmsize*0]
+ paddd m2, [sum1q+mmsize*1]
+ paddd m3, [sum1q+mmsize*2]
+ paddd m4, [sum1q+mmsize*3]
+ paddd m1, m2
+ paddd m2, m3
+ paddd m3, m4
+ paddd m4, [sum0q+mmsize*4]
+ paddd m4, [sum1q+mmsize*4]
+ TRANSPOSE4x4D 1, 2, 3, 4, 5
+
+ ; m1 = fs1, m2 = fs2, m3 = fss, m4 = fs12
+ pslld m3, 6
+ pslld m4, 6
+ pmulld m5, m1, m2 ; fs1 * fs2
+ pmulld m1, m1 ; fs1 * fs1
+ pmulld m2, m2 ; fs2 * fs2
+ psubd m3, m1
+ psubd m4, m5 ; covariance
+ psubd m3, m2 ; variance
+
+ ; m1 = fs1 * fs1, m2 = fs2 * fs2, m3 = variance, m4 = covariance, m5 = fs1 * fs2
+ paddd m4, m4 ; 2 * covariance
+ paddd m5, m5 ; 2 * fs1 * fs2
+ paddd m1, m2 ; fs1 * fs1 + fs2 * fs2
+ paddd m3, [ssim_c2] ; variance + ssim_c2
+ paddd m4, [ssim_c2] ; 2 * covariance + ssim_c2
+ paddd m5, [ssim_c1] ; 2 * fs1 * fs2 + ssim_c1
+ paddd m1, [ssim_c1] ; fs1 * fs1 + fs2 * fs2 + ssim_c1
+
+ ; convert to float
+ cvtdq2ps m3, m3
+ cvtdq2ps m4, m4
+ cvtdq2ps m5, m5
+ cvtdq2ps m1, m1
+ mulps m4, m5
+ mulps m3, m1
+ divps m4, m3 ; ssim_endl
+ addps m0, m4 ; ssim
+ add sum0q, mmsize*4
+ add sum1q, mmsize*4
+ sub wd, 4
+ jg .loop
+
+ ; subps the ones we added too much
+ test wd, wd
+ jz .end
+ add wd, 4
+ test wd, 2
+ jz .skip2
+ psrldq m4, 8
+.skip2:
+ test wd, 1
+ jz .skip1
+ psrldq m4, 4
+.skip1:
+ subps m0, m4
+
+.end:
+ movhlps m4, m0
+ addps m0, m4
+ movss m4, m0
+ shufps m0, m0, 1
+ addss m0, m4
+%if ARCH_X86_32
+ movss r0m, m0
+ fld r0mp
+%endif
+ RET
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim_init.c
new file mode 100644
index 00000000000..599c928403a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_ssim_init.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015 Ronald S. Bultje <rsbultje@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/x86/cpu.h"
+
+#include "libavfilter/ssim.h"
+
+void ff_ssim_4x4_line_ssse3(const uint8_t *buf, ptrdiff_t buf_stride,
+ const uint8_t *ref, ptrdiff_t ref_stride,
+ int (*sums)[4], int w);
+void ff_ssim_4x4_line_xop (const uint8_t *buf, ptrdiff_t buf_stride,
+ const uint8_t *ref, ptrdiff_t ref_stride,
+ int (*sums)[4], int w);
+float ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w);
+
+void ff_ssim_init_x86(SSIMDSPContext *dsp)
+{
+ int cpu_flags = av_get_cpu_flags();
+
+ if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
+ dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+ if (EXTERNAL_SSE4(cpu_flags))
+ dsp->ssim_end_line = ff_ssim_end_line_sse4;
+ if (EXTERNAL_XOP(cpu_flags))
+ dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+}
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c
index 1460a642c38..c36a2d010ec 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_yadif_init.c
@@ -62,7 +62,7 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
{
int cpu_flags = av_get_cpu_flags();
int bit_depth = (!yadif->csp) ? 8
- : yadif->csp->comp[0].depth_minus1 + 1;
+ : yadif->csp->comp[0].depth;
if (bit_depth >= 15) {
#if ARCH_X86_32
diff --git a/chromium/third_party/ffmpeg/libavformat/4xm.c b/chromium/third_party/ffmpeg/libavformat/4xm.c
index 8fdad185f47..260e080962d 100644
--- a/chromium/third_party/ffmpeg/libavformat/4xm.c
+++ b/chromium/third_party/ffmpeg/libavformat/4xm.c
@@ -111,7 +111,7 @@ static int parse_vtrk(AVFormatContext *s,
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_4XM;
- st->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata_size = 4;
diff --git a/chromium/third_party/ffmpeg/libavformat/Makefile b/chromium/third_party/ffmpeg/libavformat/Makefile
index 993ec09837d..466da516ada 100644
--- a/chromium/third_party/ffmpeg/libavformat/Makefile
+++ b/chromium/third_party/ffmpeg/libavformat/Makefile
@@ -59,6 +59,7 @@ OBJS-$(CONFIG_SHARED) += log2_tab.o golomb_tab.o
# muxers/demuxers
OBJS-$(CONFIG_A64_MUXER) += a64.o rawenc.o
+OBJS-$(CONFIG_AA_DEMUXER) += aadec.o
OBJS-$(CONFIG_AAC_DEMUXER) += aacdec.o apetag.o img2.o rawdec.o
OBJS-$(CONFIG_AC3_DEMUXER) += ac3dec.o rawdec.o
OBJS-$(CONFIG_AC3_MUXER) += rawenc.o
@@ -82,7 +83,9 @@ OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o img2.o
OBJS-$(CONFIG_APNG_DEMUXER) += apngdec.o
OBJS-$(CONFIG_APNG_MUXER) += apngenc.o
OBJS-$(CONFIG_AQTITLE_DEMUXER) += aqtitledec.o subtitles.o
-OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o \
+OBJS-$(CONFIG_ASF_DEMUXER) += asfdec_f.o asf.o asfcrypt.o \
+ avlanguage.o
+OBJS-$(CONFIG_ASF_O_DEMUXER) += asfdec_o.o asf.o asfcrypt.o \
avlanguage.o
OBJS-$(CONFIG_ASF_MUXER) += asfenc.o asf.o
OBJS-$(CONFIG_ASS_DEMUXER) += assdec.o subtitles.o
@@ -200,6 +203,7 @@ OBJS-$(CONFIG_IMAGE2PIPE_MUXER) += img2enc.o img2.o
OBJS-$(CONFIG_IMAGE2_ALIAS_PIX_DEMUXER) += img2_alias_pix.o
OBJS-$(CONFIG_IMAGE2_BRENDER_PIX_DEMUXER) += img2_brender_pix.o
OBJS-$(CONFIG_IMAGE_BMP_PIPE_DEMUXER) += img2dec.o img2.o
+OBJS-$(CONFIG_IMAGE_DDS_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_DPX_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o
@@ -468,7 +472,7 @@ OBJS-$(CONFIG_WEBVTT_DEMUXER) += webvttdec.o subtitles.o
OBJS-$(CONFIG_WEBVTT_MUXER) += webvttenc.o
OBJS-$(CONFIG_WSAUD_DEMUXER) += westwood_aud.o
OBJS-$(CONFIG_WSVQA_DEMUXER) += westwood_vqa.o
-OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv_common.o asfdec.o asf.o asfcrypt.o \
+OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv_common.o asfdec_f.o asf.o asfcrypt.o \
avlanguage.o mpegts.o isom.o
OBJS-$(CONFIG_WTV_MUXER) += wtvenc.o wtv_common.o \
mpegtsenc.o asf.o
@@ -493,6 +497,7 @@ OBJS-$(CONFIG_LIBSSH_PROTOCOL) += libssh.o
OBJS-$(CONFIG_LIBSMBCLIENT_PROTOCOL) += libsmbclient.o
# protocols I/O
+OBJS-$(CONFIG_ASYNC_PROTOCOL) += async.o
OBJS-$(CONFIG_APPLEHTTP_PROTOCOL) += hlsproto.o
OBJS-$(CONFIG_BLURAY_PROTOCOL) += bluray.o
OBJS-$(CONFIG_CACHE_PROTOCOL) += cache.o
@@ -542,7 +547,8 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o
SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h
-TESTPROGS = seek \
+TESTPROGS = async \
+ seek \
srtp \
url \
diff --git a/chromium/third_party/ffmpeg/libavformat/aadec.c b/chromium/third_party/ffmpeg/libavformat/aadec.c
new file mode 100644
index 00000000000..266a8e85acd
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/aadec.c
@@ -0,0 +1,314 @@
+/*
+ * Audible AA demuxer
+ * Copyright (c) 2015 Vesselin Bontchev
+ *
+ * Header parsing is borrowed from https://github.com/jteeuwen/audible project.
+ * Copyright (c) 2001-2014, Jim Teeuwen
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "avformat.h"
+#include "internal.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/tea.h"
+#include "libavutil/opt.h"
+
+#define AA_MAGIC 1469084982 /* this identifies an audible .aa file */
+#define MAX_CODEC_SECOND_SIZE 3982
+#define MAX_TOC_ENTRIES 16
+#define MAX_DICTIONARY_ENTRIES 128
+#define TEA_BLOCK_SIZE 8
+
+typedef struct AADemuxContext {
+ AVClass *class;
+ uint8_t *aa_fixed_key;
+ int aa_fixed_key_len;
+ int codec_second_size;
+ int current_codec_second_size;
+ int chapter_idx;
+ struct AVTEA *tea_ctx;
+ uint8_t file_key[16];
+ int64_t current_chapter_size;
+} AADemuxContext;
+
+static int get_second_size(char *codec_name)
+{
+ int result = -1;
+
+ if (!strcmp(codec_name, "mp332")) {
+ result = 3982;
+ } else if (!strcmp(codec_name, "acelp16")) {
+ result = 2000;
+ } else if (!strcmp(codec_name, "acelp85")) {
+ result = 1045;
+ }
+
+ return result;
+}
+
+static int aa_read_header(AVFormatContext *s)
+{
+ int i, j, idx, largest_idx = -1;
+ uint32_t nkey, nval, toc_size, npairs, header_seed = 0, start;
+ char key[128], val[128], codec_name[64] = {0};
+ uint8_t output[24], dst[8], src[8];
+ int64_t largest_size = -1, current_size = -1;
+ struct toc_entry {
+ uint32_t offset;
+ uint32_t size;
+ } TOC[MAX_TOC_ENTRIES];
+ uint32_t header_key_part[4];
+ uint8_t header_key[16] = {0};
+ AADemuxContext *c = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVStream *st;
+
+ /* parse .aa header */
+ avio_skip(pb, 4); // file size
+ avio_skip(pb, 4); // magic string
+ toc_size = avio_rb32(pb); // TOC size
+ avio_skip(pb, 4); // unidentified integer
+ if (toc_size > MAX_TOC_ENTRIES)
+ return AVERROR_INVALIDDATA;
+ for (i = 0; i < toc_size; i++) { // read TOC
+ avio_skip(pb, 4); // TOC entry index
+ TOC[i].offset = avio_rb32(pb); // block offset
+ TOC[i].size = avio_rb32(pb); // block size
+ }
+ avio_skip(pb, 24); // header termination block (ignored)
+ npairs = avio_rb32(pb); // read dictionary entries
+ if (npairs > MAX_DICTIONARY_ENTRIES)
+ return AVERROR_INVALIDDATA;
+ for (i = 0; i < npairs; i++) {
+ memset(val, 0, sizeof(val));
+ memset(key, 0, sizeof(key));
+ avio_skip(pb, 1); // unidentified integer
+ nkey = avio_rb32(pb); // key string length
+ nval = avio_rb32(pb); // value string length
+ if (nkey > sizeof(key)) {
+ avio_skip(pb, nkey);
+ } else {
+ avio_read(pb, key, nkey); // key string
+ }
+ if (nval > sizeof(val)) {
+ avio_skip(pb, nval);
+ } else {
+ avio_read(pb, val, nval); // value string
+ }
+ if (!strcmp(key, "codec")) {
+ av_log(s, AV_LOG_DEBUG, "Codec is <%s>\n", val);
+ strncpy(codec_name, val, sizeof(codec_name) - 1);
+ }
+ if (!strcmp(key, "HeaderSeed")) {
+ av_log(s, AV_LOG_DEBUG, "HeaderSeed is <%s>\n", val);
+ header_seed = atoi(val);
+ }
+ if (!strcmp(key, "HeaderKey")) { // this looks like "1234567890 1234567890 1234567890 1234567890"
+ av_log(s, AV_LOG_DEBUG, "HeaderKey is <%s>\n", val);
+ sscanf(val, "%u%u%u%u", &header_key_part[0], &header_key_part[1], &header_key_part[2], &header_key_part[3]);
+ for (idx = 0; idx < 4; idx++) {
+ AV_WB32(&header_key[idx * 4], header_key_part[idx]); // convert each part to BE!
+ }
+ av_log(s, AV_LOG_DEBUG, "Processed HeaderKey is ");
+ for (i = 0; i < 16; i++)
+ av_log(s, AV_LOG_DEBUG, "%02x", header_key[i]);
+ av_log(s, AV_LOG_DEBUG, "\n");
+ }
+ }
+
+ /* verify fixed key */
+ if (c->aa_fixed_key_len != 16) {
+ av_log(s, AV_LOG_ERROR, "aa_fixed_key value needs to be 16 bytes!\n");
+ return AVERROR(EINVAL);
+ }
+
+ /* verify codec */
+ if ((c->codec_second_size = get_second_size(codec_name)) == -1) {
+ av_log(s, AV_LOG_ERROR, "unknown codec <%s>!\n", codec_name);
+ return AVERROR(EINVAL);
+ }
+
+ /* decryption key derivation */
+ c->tea_ctx = av_tea_alloc();
+ if (!c->tea_ctx)
+ return AVERROR(ENOMEM);
+ av_tea_init(c->tea_ctx, c->aa_fixed_key, 16);
+ output[0] = output[1] = 0; // purely for padding purposes
+ memcpy(output + 2, header_key, 16);
+ idx = 0;
+ for (i = 0; i < 3; i++) { // TEA CBC with weird mixed endianness
+ AV_WB32(src, header_seed);
+ AV_WB32(src + 4, header_seed + 1);
+ header_seed += 2;
+ av_tea_crypt(c->tea_ctx, dst, src, 1, NULL, 0); // TEA ECB encrypt
+ for (j = 0; j < TEA_BLOCK_SIZE && idx < 18; j+=1, idx+=1) {
+ output[idx] = output[idx] ^ dst[j];
+ }
+ }
+ memcpy(c->file_key, output + 2, 16); // skip first 2 bytes of output
+ av_log(s, AV_LOG_DEBUG, "File key is ");
+ for (i = 0; i < 16; i++)
+ av_log(s, AV_LOG_DEBUG, "%02x", c->file_key[i]);
+ av_log(s, AV_LOG_DEBUG, "\n");
+
+ /* decoder setup */
+ st = avformat_new_stream(s, NULL);
+ if (!st) {
+ av_freep(&c->tea_ctx);
+ return AVERROR(ENOMEM);
+ }
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ if (!strcmp(codec_name, "mp332")) {
+ st->codec->codec_id = AV_CODEC_ID_MP3;
+ st->codec->sample_rate = 22050;
+ st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
+ st->start_time = 0;
+ } else if (!strcmp(codec_name, "acelp85")) {
+ st->codec->codec_id = AV_CODEC_ID_SIPR;
+ st->codec->block_align = 19;
+ st->codec->channels = 1;
+ st->codec->sample_rate = 8500;
+ } else if (!strcmp(codec_name, "acelp16")) {
+ st->codec->codec_id = AV_CODEC_ID_SIPR;
+ st->codec->block_align = 20;
+ st->codec->channels = 1;
+ st->codec->sample_rate = 16000;
+ }
+
+ /* determine, and jump to audio start offset */
+ for (i = 1; i < toc_size; i++) { // skip the first entry!
+ current_size = TOC[i].size;
+ if (current_size > largest_size) {
+ largest_idx = i;
+ largest_size = current_size;
+ }
+ }
+ start = TOC[largest_idx].offset;
+ avio_seek(pb, start, SEEK_SET);
+ c->current_chapter_size = 0;
+
+ return 0;
+}
+
+static int aa_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ uint8_t dst[TEA_BLOCK_SIZE];
+ uint8_t src[TEA_BLOCK_SIZE];
+ int i;
+ int trailing_bytes;
+ int blocks;
+ uint8_t buf[MAX_CODEC_SECOND_SIZE * 2];
+ int written = 0;
+ int ret;
+ AADemuxContext *c = s->priv_data;
+
+ // are we at the start of a chapter?
+ if (c->current_chapter_size == 0) {
+ c->current_chapter_size = avio_rb32(s->pb);
+ if (c->current_chapter_size == 0) {
+ return AVERROR_EOF;
+ }
+ av_log(s, AV_LOG_DEBUG, "Chapter %d (%" PRId64 " bytes)\n", c->chapter_idx, c->current_chapter_size);
+ c->chapter_idx = c->chapter_idx + 1;
+ avio_skip(s->pb, 4); // data start offset
+ c->current_codec_second_size = c->codec_second_size;
+ }
+
+ // is this the last block in this chapter?
+ if (c->current_chapter_size / c->current_codec_second_size == 0) {
+ c->current_codec_second_size = c->current_chapter_size % c->current_codec_second_size;
+ }
+
+ // decrypt c->current_codec_second_size bytes
+ blocks = c->current_codec_second_size / TEA_BLOCK_SIZE;
+ for (i = 0; i < blocks; i++) {
+ avio_read(s->pb, src, TEA_BLOCK_SIZE);
+ av_tea_init(c->tea_ctx, c->file_key, 16);
+ av_tea_crypt(c->tea_ctx, dst, src, 1, NULL, 1);
+ memcpy(buf + written, dst, TEA_BLOCK_SIZE);
+ written = written + TEA_BLOCK_SIZE;
+ }
+ trailing_bytes = c->current_codec_second_size % TEA_BLOCK_SIZE;
+ if (trailing_bytes != 0) { // trailing bytes are left unencrypted!
+ avio_read(s->pb, src, trailing_bytes);
+ memcpy(buf + written, src, trailing_bytes);
+ written = written + trailing_bytes;
+ }
+
+ // update state
+ c->current_chapter_size = c->current_chapter_size - c->current_codec_second_size;
+ if (c->current_chapter_size <= 0)
+ c->current_chapter_size = 0;
+
+ ret = av_new_packet(pkt, written);
+ if (ret < 0)
+ return ret;
+ memcpy(pkt->data, buf, written);
+
+ return 0;
+}
+
+static int aa_probe(AVProbeData *p)
+{
+ uint8_t *buf = p->buf;
+
+ // first 4 bytes are file size, next 4 bytes are the magic
+ if (AV_RB32(buf+4) != AA_MAGIC)
+ return 0;
+
+ return AVPROBE_SCORE_MAX / 2;
+}
+
+static int aa_read_close(AVFormatContext *s)
+{
+ AADemuxContext *c = s->priv_data;
+
+ av_freep(&c->tea_ctx);
+
+ return 0;
+}
+
+#define OFFSET(x) offsetof(AADemuxContext, x)
+static const AVOption aa_options[] = {
+ { "aa_fixed_key", // extracted from libAAX_SDK.so and AAXSDKWin.dll files!
+ "Fixed key used for handling Audible AA files", OFFSET(aa_fixed_key),
+ AV_OPT_TYPE_BINARY, {.str="77214d4b196a87cd520045fd2a51d673"},
+ .flags = AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
+static const AVClass aa_class = {
+ .class_name = "aa",
+ .item_name = av_default_item_name,
+ .option = aa_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVInputFormat ff_aa_demuxer = {
+ .name = "aa",
+ .long_name = NULL_IF_CONFIG_SMALL("Audible AA format files"),
+ .priv_class = &aa_class,
+ .priv_data_size = sizeof(AADemuxContext),
+ .extensions = "aa",
+ .read_probe = aa_probe,
+ .read_header = aa_read_header,
+ .read_packet = aa_read_packet,
+ .read_close = aa_read_close,
+ .flags = AVFMT_GENERIC_INDEX,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/ac3dec.c b/chromium/third_party/ffmpeg/libavformat/ac3dec.c
index 58ef44d45a7..bef55cb6586 100644
--- a/chromium/third_party/ffmpeg/libavformat/ac3dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/ac3dec.c
@@ -80,7 +80,7 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
if(codec_id != expected_codec_id) return 0;
// keep this in sync with mp3 probe, both need to avoid
// issues with MPEG-files!
- if (first_frames>=4) return AVPROBE_SCORE_EXTENSION + 1;
+ if (first_frames>=7) return AVPROBE_SCORE_EXTENSION + 1;
else if(max_frames>200)return AVPROBE_SCORE_EXTENSION;
else if(max_frames>=4) return AVPROBE_SCORE_EXTENSION/2;
else if(max_frames>=1) return 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/act.c b/chromium/third_party/ffmpeg/libavformat/act.c
index 7b6b8406fc0..35aacbc4595 100644
--- a/chromium/third_party/ffmpeg/libavformat/act.c
+++ b/chromium/third_party/ffmpeg/libavformat/act.c
@@ -75,7 +75,7 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 16);
size=avio_rl32(pb);
- ff_get_wav_header(pb, st->codec, size, 0);
+ ff_get_wav_header(s, pb, st->codec, size, 0);
/*
8000Hz (Fine-rec) file format has 10 bytes long
diff --git a/chromium/third_party/ffmpeg/libavformat/aiffenc.c b/chromium/third_party/ffmpeg/libavformat/aiffenc.c
index e2828e7508b..3abd2840f25 100644
--- a/chromium/third_party/ffmpeg/libavformat/aiffenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/aiffenc.c
@@ -112,7 +112,7 @@ static int aiff_write_header(AVFormatContext *s)
if (aiff->audio_stream_idx < 0 && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
aiff->audio_stream_idx = i;
} else if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO) {
- av_log(s, AV_LOG_ERROR, "Only audio streams and pictures are allowed in AIFF.\n");
+ av_log(s, AV_LOG_ERROR, "AIFF allows only one audio stream and a picture.\n");
return AVERROR(EINVAL);
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/allformats.c b/chromium/third_party/ffmpeg/libavformat/allformats.c
index 306e0c9876d..0a24ac718b2 100644
--- a/chromium/third_party/ffmpeg/libavformat/allformats.c
+++ b/chromium/third_party/ffmpeg/libavformat/allformats.c
@@ -60,6 +60,7 @@ void av_register_all(void)
/* (de)muxers */
REGISTER_MUXER (A64, a64);
+ REGISTER_DEMUXER (AA, aa);
REGISTER_DEMUXER (AAC, aac);
REGISTER_MUXDEMUX(AC3, ac3);
REGISTER_DEMUXER (ACT, act);
@@ -77,6 +78,7 @@ void av_register_all(void)
REGISTER_MUXDEMUX(APNG, apng);
REGISTER_DEMUXER (AQTITLE, aqtitle);
REGISTER_MUXDEMUX(ASF, asf);
+ REGISTER_DEMUXER (ASF_O, asf_o);
REGISTER_MUXDEMUX(ASS, ass);
REGISTER_MUXDEMUX(AST, ast);
REGISTER_MUXER (ASF_STREAM, asf_stream);
@@ -334,6 +336,7 @@ void av_register_all(void)
/* image demuxers */
REGISTER_DEMUXER (IMAGE_BMP_PIPE, image_bmp_pipe);
+ REGISTER_DEMUXER (IMAGE_DDS_PIPE, image_dds_pipe);
REGISTER_DEMUXER (IMAGE_DPX_PIPE, image_dpx_pipe);
REGISTER_DEMUXER (IMAGE_EXR_PIPE, image_exr_pipe);
REGISTER_DEMUXER (IMAGE_J2K_PIPE, image_j2k_pipe);
@@ -349,6 +352,7 @@ void av_register_all(void)
/* protocols */
+ REGISTER_PROTOCOL(ASYNC, async);
REGISTER_PROTOCOL(BLURAY, bluray);
REGISTER_PROTOCOL(CACHE, cache);
REGISTER_PROTOCOL(CONCAT, concat);
diff --git a/chromium/third_party/ffmpeg/libavformat/anm.c b/chromium/third_party/ffmpeg/libavformat/anm.c
index f7187973109..23200474bd2 100644
--- a/chromium/third_party/ffmpeg/libavformat/anm.c
+++ b/chromium/third_party/ffmpeg/libavformat/anm.c
@@ -133,7 +133,7 @@ static int read_header(AVFormatContext *s)
/* color cycling and palette data */
st->codec->extradata_size = 16*8 + 4*256;
- st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
return AVERROR(ENOMEM);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/apetag.c b/chromium/third_party/ffmpeg/libavformat/apetag.c
index 26359205f83..2ee277f8642 100644
--- a/chromium/third_party/ffmpeg/libavformat/apetag.c
+++ b/chromium/third_party/ffmpeg/libavformat/apetag.c
@@ -55,7 +55,7 @@ static int ape_tag_read_field(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
return -1;
}
- if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (size > INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/apngdec.c b/chromium/third_party/ffmpeg/libavformat/apngdec.c
index 6deff3b66ba..84298aecfdd 100644
--- a/chromium/third_party/ffmpeg/libavformat/apngdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/apngdec.c
@@ -132,7 +132,7 @@ static int append_extradata(AVCodecContext *s, AVIOContext *pb, int len)
return AVERROR_INVALIDDATA;
new_size = previous_size + len;
- new_extradata = av_realloc(s->extradata, new_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ new_extradata = av_realloc(s->extradata, new_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!new_extradata)
return AVERROR(ENOMEM);
s->extradata = new_extradata;
@@ -178,7 +178,7 @@ static int apng_read_header(AVFormatContext *s)
return ret;
/* extradata will contain every chunk up to the first fcTL (excluded) */
- st->codec->extradata = av_malloc(len + 12 + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_malloc(len + 12 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata_size = len + 12;
diff --git a/chromium/third_party/ffmpeg/libavformat/apngenc.c b/chromium/third_party/ffmpeg/libavformat/apngenc.c
index dcf6b906e18..9b2c634b954 100644
--- a/chromium/third_party/ffmpeg/libavformat/apngenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/apngenc.c
@@ -173,7 +173,7 @@ static void flush_packet(AVFormatContext *format_context, AVPacket *packet)
"Frame rate is too high or specified too precisely. Unable to copy losslessly.\n");
apng->framerate_warned = 1;
}
- } else if (apng->last_delay.den > 0) {
+ } else if (apng->last_delay.num > 0) {
delay = apng->last_delay;
} else {
delay = apng->prev_delay;
diff --git a/chromium/third_party/ffmpeg/libavformat/aqtitledec.c b/chromium/third_party/ffmpeg/libavformat/aqtitledec.c
index 95087665aa1..7c864c8e10f 100644
--- a/chromium/third_party/ffmpeg/libavformat/aqtitledec.c
+++ b/chromium/third_party/ffmpeg/libavformat/aqtitledec.c
@@ -95,7 +95,7 @@ static int aqt_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&aqt->q);
+ ff_subtitles_queue_finalize(s, &aqt->q);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/asf.h b/chromium/third_party/ffmpeg/libavformat/asf.h
index 0c9598a8d8f..f98fc46edcb 100644
--- a/chromium/third_party/ffmpeg/libavformat/asf.h
+++ b/chromium/third_party/ffmpeg/libavformat/asf.h
@@ -28,37 +28,15 @@
#define PACKET_SIZE 3200
-typedef struct ASFPayload {
- uint8_t type;
- uint16_t size;
-} ASFPayload;
-
-typedef struct ASFStream {
- int num;
- unsigned char seq;
- /* use for reading */
- AVPacket pkt;
- int frag_offset;
- int packet_obj_size;
- int timestamp;
- int64_t duration;
- int skip_to_key;
- int pkt_clean;
-
- int ds_span; /* descrambling */
- int ds_packet_size;
- int ds_chunk_size;
-
- int64_t packet_pos;
-
- uint16_t stream_language_index;
-
- int palette_changed;
- uint32_t palette[256];
-
- int payload_ext_ct;
- ASFPayload payload[8];
-} ASFStream;
+typedef enum ASFDataType {
+ ASF_UNICODE = 0,
+ ASF_BYTE_ARRAY = 1,
+ ASF_BOOL = 2,
+ ASF_DWORD = 3,
+ ASF_QWORD = 4,
+ ASF_WORD = 5,
+ ASF_GUID = 6,
+}ASFDataType;
typedef struct ASFMainHeader {
ff_asf_guid guid; ///< generated by client computer
diff --git a/chromium/third_party/ffmpeg/libavformat/asfdec.c b/chromium/third_party/ffmpeg/libavformat/asfdec_f.c
index 92784348cba..7c31cfaee47 100644
--- a/chromium/third_party/ffmpeg/libavformat/asfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/asfdec_f.c
@@ -39,6 +39,38 @@
#include "asf.h"
#include "asfcrypt.h"
+typedef struct ASFPayload {
+ uint8_t type;
+ uint16_t size;
+} ASFPayload;
+
+typedef struct ASFStream {
+ int num;
+ unsigned char seq;
+ /* use for reading */
+ AVPacket pkt;
+ int frag_offset;
+ int packet_obj_size;
+ int timestamp;
+ int64_t duration;
+ int skip_to_key;
+ int pkt_clean;
+
+ int ds_span; /* descrambling */
+ int ds_packet_size;
+ int ds_chunk_size;
+
+ int64_t packet_pos;
+
+ uint16_t stream_language_index;
+
+ int palette_changed;
+ uint32_t palette[256];
+
+ int payload_ext_ct;
+ ASFPayload payload[8];
+} ASFStream;
+
typedef struct ASFContext {
const AVClass *class;
int asfid2avid[128]; ///< conversion table from asf ID 2 AVStream ID
@@ -81,6 +113,8 @@ typedef struct ASFContext {
int no_resync_search;
int export_xmp;
+
+ int uses_std_ecc;
} ASFContext;
static const AVOption options[] = {
@@ -100,8 +134,9 @@ static const AVClass asf_class = {
#include <assert.h>
#define ASF_MAX_STREAMS 127
-#define FRAME_HEADER_SIZE 16
-// Fix Me! FRAME_HEADER_SIZE may be different. (17 is known to be too large)
+#define FRAME_HEADER_SIZE 6
+// Fix Me! FRAME_HEADER_SIZE may be different.
+// (7 is known to be too large for GipsyGuitar.wmv)
#ifdef DEBUG
static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
@@ -294,12 +329,15 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len, int
if (!value)
goto finish;
- if (type == 0) { // UTF16-LE
+ switch (type) {
+ case ASF_UNICODE:
avio_get_str16le(s->pb, len, value, 2 * len + 1);
- } else if (type == -1) { // ASCII
+ break;
+ case -1: // ASCI
avio_read(s->pb, value, len);
value[len]=0;
- } else if (type == 1) { // byte array
+ break;
+ case ASF_BYTE_ARRAY:
if (!strcmp(key, "WM/Picture")) { // handle cover art
asf_read_picture(s, len);
} else if (!strcmp(key, "ID3")) { // handle ID3 tag
@@ -308,13 +346,18 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len, int
av_log(s, AV_LOG_VERBOSE, "Unsupported byte array in tag %s.\n", key);
}
goto finish;
- } else if (type > 1 && type <= 5) { // boolean or DWORD or QWORD or WORD
+ case ASF_BOOL:
+ case ASF_DWORD:
+ case ASF_QWORD:
+ case ASF_WORD: {
uint64_t num = get_value(s->pb, type, type2_size);
snprintf(value, LEN, "%"PRIu64, num);
- } else if (type == 6) { // (don't) handle GUID
+ break;
+ }
+ case ASF_GUID:
av_log(s, AV_LOG_DEBUG, "Unsupported GUID value in tag %s.\n", key);
goto finish;
- } else {
+ default:
av_log(s, AV_LOG_DEBUG,
"Unsupported value type %d in tag %s.\n", type, key);
goto finish;
@@ -429,7 +472,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
st->codec->codec_type = type;
if (type == AVMEDIA_TYPE_AUDIO) {
- int ret = ff_get_wav_header(pb, st->codec, type_specific_size, 0);
+ int ret = ff_get_wav_header(s, pb, st->codec, type_specific_size, 0);
if (ret < 0)
return ret;
if (is_dvr_ms_audio) {
@@ -474,7 +517,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
if (sizeX > 40) {
st->codec->extradata_size = ffio_limit(pb, sizeX - 40);
st->codec->extradata = av_mallocz(st->codec->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
avio_read(pb, st->codec->extradata, st->codec->extradata_size);
@@ -653,24 +696,29 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
{
AVIOContext *pb = s->pb;
ASFContext *asf = s->priv_data;
- int n, stream_num, name_len, value_len;
+ int n, stream_num, name_len_utf16, name_len_utf8, value_len;
int ret, i;
n = avio_rl16(pb);
for (i = 0; i < n; i++) {
- char name[1024];
+ uint8_t *name;
int value_type;
avio_rl16(pb); // lang_list_index
stream_num = avio_rl16(pb);
- name_len = avio_rl16(pb);
+ name_len_utf16 = avio_rl16(pb);
value_type = avio_rl16(pb); /* value_type */
value_len = avio_rl32(pb);
- if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
- avio_skip(pb, name_len - ret);
+ name_len_utf8 = 2*name_len_utf16 + 1;
+ name = av_malloc(name_len_utf8);
+ if (!name)
+ return AVERROR(ENOMEM);
+
+ if ((ret = avio_get_str16le(pb, name_len_utf16, name, name_len_utf8)) < name_len_utf16)
+ avio_skip(pb, name_len_utf16 - ret);
av_log(s, AV_LOG_TRACE, "%d stream %d name_len %2d type %d len %4d <%s>\n",
- i, stream_num, name_len, value_type, value_len, name);
+ i, stream_num, name_len_utf16, value_type, value_len, name);
if (!strcmp(name, "AspectRatioX")){
int aspect_x = get_value(s->pb, value_type, 16);
@@ -683,6 +731,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
} else {
get_tag(s, name, value_type, value_len, 16);
}
+ av_freep(&name);
}
return 0;
@@ -746,6 +795,7 @@ static int asf_read_header(AVFormatContext *s)
for (;;) {
uint64_t gpos = avio_tell(pb);
+ int ret = 0;
ff_get_guid(pb, &g);
gsize = avio_rl64(pb);
print_guid(&g);
@@ -762,13 +812,9 @@ static int asf_read_header(AVFormatContext *s)
if (gsize < 24)
return AVERROR_INVALIDDATA;
if (!ff_guidcmp(&g, &ff_asf_file_header)) {
- int ret = asf_read_file_properties(s, gsize);
- if (ret < 0)
- return ret;
+ ret = asf_read_file_properties(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_stream_header)) {
- int ret = asf_read_stream_properties(s, gsize);
- if (ret < 0)
- return ret;
+ ret = asf_read_stream_properties(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_comment_header)) {
asf_read_content_desc(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_language_guid)) {
@@ -797,7 +843,6 @@ static int asf_read_header(AVFormatContext *s)
if (!s->keylen) {
if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
unsigned int len;
- int ret;
AVPacket pkt;
av_log(s, AV_LOG_WARNING,
"DRM protected stream detected, decoding will likely fail!\n");
@@ -823,6 +868,9 @@ static int asf_read_header(AVFormatContext *s)
}
}
}
+ if (ret < 0)
+ return ret;
+
if (avio_tell(pb) != gpos + gsize)
av_log(s, AV_LOG_DEBUG,
"gpos mismatch our pos=%"PRIu64", end=%"PRId64"\n",
@@ -910,44 +958,67 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
int rsize = 8;
int c, d, e, off;
- // if we do not know packet size, allow skipping up to 32 kB
- off = 32768;
- if (asf->no_resync_search)
- off = 3;
- else if (s->packet_size > 0)
- off = (avio_tell(pb) - s->internal->data_offset) % s->packet_size + 3;
-
- c = d = e = -1;
- while (off-- > 0) {
- c = d;
- d = e;
- e = avio_r8(pb);
- if (c == 0x82 && !d && !e)
- break;
- }
+ if (asf->uses_std_ecc > 0) {
+ // if we do not know packet size, allow skipping up to 32 kB
+ off = 32768;
+ if (asf->no_resync_search)
+ off = 3;
+// else if (s->packet_size > 0 && !asf->uses_std_ecc)
+// off = (avio_tell(pb) - s->internal->data_offset) % s->packet_size + 3;
+
+ c = d = e = -1;
+ while (off-- > 0) {
+ c = d;
+ d = e;
+ e = avio_r8(pb);
+ if (c == 0x82 && !d && !e)
+ break;
+ }
- if (c != 0x82) {
- /* This code allows handling of -EAGAIN at packet boundaries (i.e.
- * if the packet sync code above triggers -EAGAIN). This does not
- * imply complete -EAGAIN handling support at random positions in
- * the stream. */
- if (pb->error == AVERROR(EAGAIN))
- return AVERROR(EAGAIN);
- if (!avio_feof(pb))
- av_log(s, AV_LOG_ERROR,
- "ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb));
- }
- if ((c & 0x8f) == 0x82) {
- if (d || e) {
+ if (c != 0x82) {
+ /* This code allows handling of -EAGAIN at packet boundaries (i.e.
+ * if the packet sync code above triggers -EAGAIN). This does not
+ * imply complete -EAGAIN handling support at random positions in
+ * the stream. */
+ if (pb->error == AVERROR(EAGAIN))
+ return AVERROR(EAGAIN);
if (!avio_feof(pb))
- av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
- return AVERROR_INVALIDDATA;
+ av_log(s, AV_LOG_ERROR,
+ "ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb));
+ }
+ if ((c & 0x8f) == 0x82) {
+ if (d || e) {
+ if (!avio_feof(pb))
+ av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
+ return AVERROR_INVALIDDATA;
+ }
+ c = avio_r8(pb);
+ d = avio_r8(pb);
+ rsize += 3;
+ } else if(!avio_feof(pb)) {
+ avio_seek(pb, -1, SEEK_CUR); // FIXME
}
- c = avio_r8(pb);
- d = avio_r8(pb);
- rsize += 3;
- } else if(!avio_feof(pb)) {
- avio_seek(pb, -1, SEEK_CUR); // FIXME
+ } else {
+ c = avio_r8(pb);
+ if (c & 0x80) {
+ rsize ++;
+ if (!(c & 0x60)) {
+ d = avio_r8(pb);
+ e = avio_r8(pb);
+ avio_seek(pb, (c & 0xF) - 2, SEEK_CUR);
+ rsize += c & 0xF;
+ }
+
+ if (c != 0x82)
+ avpriv_request_sample(s, "Invalid ECC byte\n");
+
+ if (!asf->uses_std_ecc)
+ asf->uses_std_ecc = (c == 0x82 && !d && !e) ? 1 : -1;
+
+ c = avio_r8(pb);
+ } else
+ asf->uses_std_ecc = -1;
+ d = avio_r8(pb);
}
asf->packet_flags = c;
@@ -1019,9 +1090,9 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
- av_log(asf, AV_LOG_TRACE, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n",
+ av_log(asf, AV_LOG_TRACE, "key:%d stream:%d seq:%d offset:%d replic_size:%d num:%X packet_property %X\n",
asf->packet_key_frame, asf->stream_index, asf->packet_seq,
- asf->packet_frag_offset, asf->packet_replic_size);
+ asf->packet_frag_offset, asf->packet_replic_size, num, asf->packet_property);
if (rsize+(int64_t)asf->packet_replic_size > asf->packet_size_left) {
av_log(s, AV_LOG_ERROR, "packet_replic_size %d is invalid\n", asf->packet_replic_size);
return AVERROR_INVALIDDATA;
@@ -1030,8 +1101,8 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
int64_t end = avio_tell(pb) + asf->packet_replic_size;
AVRational aspect;
asfst->packet_obj_size = avio_rl32(pb);
- if (asfst->packet_obj_size >= (1 << 24) || asfst->packet_obj_size <= 0) {
- av_log(s, AV_LOG_ERROR, "packet_obj_size invalid\n");
+ if (asfst->packet_obj_size >= (1 << 24) || asfst->packet_obj_size < 0) {
+ av_log(s, AV_LOG_ERROR, "packet_obj_size %d invalid\n", asfst->packet_obj_size);
asfst->packet_obj_size = 0;
return AVERROR_INVALIDDATA;
}
@@ -1100,8 +1171,8 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
return AVERROR_INVALIDDATA;
} else if (asf->packet_frag_size > asf->packet_size_left - rsize) {
if (asf->packet_frag_size > asf->packet_size_left - rsize + asf->packet_padsize) {
- av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid (%d-%d)\n",
- asf->packet_size_left, rsize);
+ av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid (%d>%d-%d+%d)\n",
+ asf->packet_frag_size, asf->packet_size_left, rsize, asf->packet_padsize);
return AVERROR_INVALIDDATA;
} else {
int diff = asf->packet_frag_size - (asf->packet_size_left - rsize);
@@ -1143,6 +1214,9 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
asf->packet_segments < 1 && asf->packet_time_start == 0) {
int ret = asf->packet_size_left + asf->packet_padsize;
+ if (asf->packet_size_left && asf->packet_size_left < FRAME_HEADER_SIZE)
+ av_log(s, AV_LOG_WARNING, "Skip due to FRAME_HEADER_SIZE\n");
+
assert(ret >= 0);
/* fail safe */
avio_skip(pb, ret);
@@ -1172,7 +1246,8 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
continue;
}
asf->asf_st = &asf->streams[s->streams[asf->stream_index]->id];
- asf->asf_st->skip_to_key = 0;
+ if (!asf->packet_frag_offset)
+ asf->asf_st->skip_to_key = 0;
}
asf_st = asf->asf_st;
av_assert0(asf_st);
@@ -1319,12 +1394,12 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
} else {
/* packet descrambling */
AVBufferRef *buf = av_buffer_alloc(asf_st->pkt.size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (buf) {
uint8_t *newdata = buf->data;
int offset = 0;
memset(newdata + asf_st->pkt.size, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
while (offset < asf_st->pkt.size) {
int off = offset / asf_st->ds_chunk_size;
int row = off / asf_st->ds_span;
@@ -1345,11 +1420,6 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
}
asf_st->frag_offset = 0;
*pkt = asf_st->pkt;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- asf_st->pkt.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
asf_st->pkt.buf = 0;
asf_st->pkt.size = 0;
asf_st->pkt.data = 0;
@@ -1476,6 +1546,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index,
// assert((asf_st->packet_pos - s->data_offset) % s->packet_size == 0);
pos = asf_st->packet_pos;
+ av_assert1(pkt->pos == asf_st->packet_pos);
av_add_index_entry(s->streams[i], pos, pts, pkt->size,
pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
diff --git a/chromium/third_party/ffmpeg/libavformat/asfdec_o.c b/chromium/third_party/ffmpeg/libavformat/asfdec_o.c
new file mode 100644
index 00000000000..cf2a01e6dbf
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/asfdec_o.c
@@ -0,0 +1,1755 @@
+/*
+ * Microsoft Advanced Streaming Format demuxer
+ * Copyright (c) 2014 Alexandra HĂ¡jkovĂ¡
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/attributes.h"
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/bswap.h"
+#include "libavutil/common.h"
+#include "libavutil/dict.h"
+#include "libavutil/internal.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
+#include "libavutil/time_internal.h"
+
+#include "avformat.h"
+#include "avio_internal.h"
+#include "avlanguage.h"
+#include "id3v2.h"
+#include "internal.h"
+#include "riff.h"
+#include "asf.h"
+#include "asfcrypt.h"
+
+#define ASF_BOOL 0x2
+#define ASF_WORD 0x5
+#define ASF_GUID 0x6
+#define ASF_DWORD 0x3
+#define ASF_QWORD 0x4
+#define ASF_UNICODE 0x0
+#define ASF_FLAG_BROADCAST 0x1
+#define ASF_BYTE_ARRAY 0x1
+#define ASF_TYPE_AUDIO 0x2
+#define ASF_TYPE_VIDEO 0x1
+#define ASF_STREAM_NUM 0x7F
+#define ASF_MAX_STREAMS 128
+#define BMP_HEADER_SIZE 40
+#define ASF_NUM_OF_PAYLOADS 0x3F
+#define ASF_ERROR_CORRECTION_LENGTH_TYPE 0x60
+#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
+
+typedef struct GUIDParseTable {
+ const char *name;
+ ff_asf_guid guid;
+ int (*read_object)(AVFormatContext *, const struct GUIDParseTable *);
+ int is_subobject;
+} GUIDParseTable;
+
+typedef struct ASFPacket {
+ AVPacket avpkt;
+ int64_t dts;
+ uint32_t frame_num; // ASF payloads with the same number are parts of the same frame
+ int flags;
+ int data_size;
+ int duration;
+ int size_left;
+ uint8_t stream_index;
+} ASFPacket;
+
+typedef struct ASFStream {
+ uint8_t stream_index; // from packet header
+ int index; // stream index in AVFormatContext, set in asf_read_stream_properties
+ int type;
+ int indexed; // added index entries from the Simple Index Object or not
+ int8_t span; // for deinterleaving
+ uint16_t virtual_pkt_len;
+ uint16_t virtual_chunk_len;
+ int16_t lang_idx;
+ ASFPacket pkt;
+} ASFStream;
+
+typedef struct ASFStreamData{
+ char langs[32];
+ AVDictionary *asf_met; // for storing per-stream metadata
+ AVRational aspect_ratio;
+} ASFStreamData;
+
+typedef struct ASFContext {
+ int data_reached;
+ int is_simple_index; // is simple index present or not 1/0
+ int is_header;
+
+ uint64_t preroll;
+ uint64_t nb_packets; // ASF packets
+ uint32_t packet_size;
+ int64_t send_time;
+ int duration;
+
+ uint32_t b_flags; // flags with broadcast flag
+ uint32_t prop_flags; // file properties object flags
+
+ uint64_t data_size; // data object size
+ uint64_t unknown_size; // size of the unknown object
+
+ int64_t offset; // offset of the current object
+
+ int64_t data_offset;
+ int64_t first_packet_offset; // packet offset
+ int64_t unknown_offset; // for top level header objects or subobjects without specified behavior
+
+ // ASF file must not contain more than 128 streams according to the specification
+ ASFStream *asf_st[ASF_MAX_STREAMS];
+ ASFStreamData asf_sd[ASF_MAX_STREAMS];
+ int nb_streams;
+
+ int stream_index; // from packet header, for the subpayload case
+
+ // packet parameteres
+ uint64_t sub_header_offset; // offset of subplayload header
+ int64_t sub_dts;
+ uint8_t dts_delta; // for subpayloads
+ uint32_t packet_size_internal; // packet size stored inside ASFPacket, can be 0
+ int64_t packet_offset; // offset of the current packet inside Data Object
+ uint32_t pad_len; // padding after payload
+ uint32_t rep_data_len;
+
+ // packet state
+ uint64_t sub_left; // subpayloads left or not
+ unsigned int nb_sub; // number of subpayloads read so far from the current ASF packet
+ uint16_t mult_sub_len; // total length of subpayloads array inside multiple payload
+ uint64_t nb_mult_left; // multiple payloads left
+ int return_subpayload;
+ enum {
+ PARSE_PACKET_HEADER,
+ READ_SINGLE,
+ READ_MULTI,
+ READ_MULTI_SUB
+ } state;
+} ASFContext;
+
+static int detect_unknown_subobject(AVFormatContext *s, int64_t offset, int64_t size);
+static const GUIDParseTable *find_guid(ff_asf_guid guid);
+
+static int asf_probe(AVProbeData *pd)
+{
+ /* check file header */
+ if (!ff_guidcmp(pd->buf, &ff_asf_header))
+ return AVPROBE_SCORE_MAX/2;
+ else
+ return 0;
+}
+
+static void swap_guid(ff_asf_guid guid)
+{
+ FFSWAP(unsigned char, guid[0], guid[3]);
+ FFSWAP(unsigned char, guid[1], guid[2]);
+ FFSWAP(unsigned char, guid[4], guid[5]);
+ FFSWAP(unsigned char, guid[6], guid[7]);
+}
+
+static void align_position(AVIOContext *pb, int64_t offset, uint64_t size)
+{
+ if (avio_tell(pb) != offset + size)
+ avio_seek(pb, offset + size, SEEK_SET);
+}
+
+static int asf_read_unknown(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size = avio_rl64(pb);
+ int ret;
+
+ if (asf->is_header)
+ asf->unknown_size = size;
+ asf->is_header = 0;
+ if (!g->is_subobject) {
+ if (!(ret = strcmp(g->name, "Header Extension")))
+ avio_skip(pb, 22); // skip reserved fields and Data Size
+ if ((ret = detect_unknown_subobject(s, asf->unknown_offset,
+ asf->unknown_size)) < 0)
+ return ret;
+ } else
+ avio_skip(pb, size - 24);
+
+ return 0;
+}
+
+static int get_asf_string(AVIOContext *pb, int maxlen, char *buf, int buflen)
+{
+ char *q = buf;
+ int ret = 0;
+ if (buflen <= 0)
+ return AVERROR(EINVAL);
+ while (ret + 1 < maxlen) {
+ uint8_t tmp;
+ uint32_t ch;
+ GET_UTF16(ch, (ret += 2) <= maxlen ? avio_rl16(pb) : 0, break;);
+ PUT_UTF8(ch, tmp, if (q - buf < buflen - 1) *q++ = tmp;)
+ }
+ *q = 0;
+
+ return ret;
+}
+
+static int asf_read_marker(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size = avio_rl64(pb);
+ int i, nb_markers, ret;
+ size_t len;
+ char name[1024];
+
+ avio_skip(pb, 8);
+ avio_skip(pb, 8); // skip reserved GUID
+ nb_markers = avio_rl32(pb);
+ avio_skip(pb, 2); // skip reserved field
+ len = avio_rl16(pb);
+ for (i = 0; i < len; i++)
+ avio_skip(pb, 1);
+
+ for (i = 0; i < nb_markers; i++) {
+ int64_t pts;
+
+ avio_skip(pb, 8);
+ pts = avio_rl64(pb);
+ pts -= asf->preroll * 10000;
+ avio_skip(pb, 2); // entry length
+ avio_skip(pb, 4); // send time
+ avio_skip(pb, 4); // flags
+ len = avio_rl32(pb);
+
+ if ((ret = avio_get_str16le(pb, len, name,
+ sizeof(name))) < len)
+ avio_skip(pb, len - ret);
+ avpriv_new_chapter(s, i, (AVRational) { 1, 10000000 }, pts,
+ AV_NOPTS_VALUE, name);
+ }
+ align_position(pb, asf->offset, size);
+
+ return 0;
+}
+
+static int asf_read_metadata(AVFormatContext *s, const char *title, uint16_t len,
+ unsigned char *ch, uint16_t buflen)
+{
+ AVIOContext *pb = s->pb;
+
+ avio_get_str16le(pb, len, ch, buflen);
+ if (ch[0]) {
+ if (av_dict_set(&s->metadata, title, ch, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ }
+
+ return 0;
+}
+
+static int asf_read_value(AVFormatContext *s, const uint8_t *name, uint16_t name_len,
+ uint16_t val_len, int type, AVDictionary **met)
+{
+ int ret;
+ uint8_t *value;
+ uint16_t buflen = 2 * val_len + 1;
+ AVIOContext *pb = s->pb;
+
+ value = av_malloc(buflen);
+ if (!value)
+ return AVERROR(ENOMEM);
+ if (type == ASF_UNICODE) {
+ // get_asf_string reads UTF-16 and converts it to UTF-8 which needs longer buffer
+ if ((ret = get_asf_string(pb, val_len, value, buflen)) < 0)
+ goto failed;
+ if (av_dict_set(met, name, value, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ } else {
+ char buf[256];
+ if (val_len > sizeof(buf)) {
+ ret = AVERROR_INVALIDDATA;
+ goto failed;
+ }
+ if ((ret = avio_read(pb, value, val_len)) < 0)
+ goto failed;
+ if (ret < 2 * val_len)
+ value[ret] = '\0';
+ else
+ value[2 * val_len - 1] = '\0';
+ snprintf(buf, sizeof(buf), "%s", value);
+ if (av_dict_set(met, name, buf, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ }
+ av_freep(&value);
+
+ return 0;
+
+failed:
+ av_freep(&value);
+ return ret;
+}
+static int asf_read_generic_value(AVIOContext *pb, int type, uint64_t *value)
+{
+
+ switch (type) {
+ case ASF_BOOL:
+ *value = avio_rl16(pb);
+ break;
+ case ASF_DWORD:
+ *value = avio_rl32(pb);
+ break;
+ case ASF_QWORD:
+ *value = avio_rl64(pb);
+ break;
+ case ASF_WORD:
+ *value = avio_rl16(pb);
+ break;
+ default:
+ return AVERROR_INVALIDDATA;
+ }
+
+ return 0;
+}
+
+static int asf_set_metadata(AVFormatContext *s, const uint8_t *name,
+ uint16_t name_len, int type, AVDictionary **met)
+{
+ AVIOContext *pb = s->pb;
+ uint64_t value;
+ char buf[32];
+ int ret;
+
+ ret = asf_read_generic_value(pb, type, &value);
+ if (ret < 0)
+ return ret;
+
+ snprintf(buf, sizeof(buf), "%"PRIu64, value);
+ if (av_dict_set(met, name, buf, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+
+ return 0;
+}
+
+/* MSDN claims that this should be "compatible with the ID3 frame, APIC",
+ * but in reality this is only loosely similar */
+static int asf_read_picture(AVFormatContext *s, int len)
+{
+ ASFContext *asf = s->priv_data;
+ AVPacket pkt = { 0 };
+ const CodecMime *mime = ff_id3v2_mime_tags;
+ enum AVCodecID id = AV_CODEC_ID_NONE;
+ char mimetype[64];
+ uint8_t *desc = NULL;
+ AVStream *st = NULL;
+ int ret, type, picsize, desc_len;
+ ASFStream *asf_st;
+
+ /* type + picsize + mime + desc */
+ if (len < 1 + 4 + 2 + 2) {
+ av_log(s, AV_LOG_ERROR, "Invalid attached picture size: %d.\n", len);
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* picture type */
+ type = avio_r8(s->pb);
+ len--;
+ if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) {
+ av_log(s, AV_LOG_WARNING, "Unknown attached picture type: %d.\n", type);
+ type = 0;
+ }
+
+ /* picture data size */
+ picsize = avio_rl32(s->pb);
+ len -= 4;
+
+ /* picture MIME type */
+ len -= avio_get_str16le(s->pb, len, mimetype, sizeof(mimetype));
+ while (mime->id != AV_CODEC_ID_NONE) {
+ if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
+ id = mime->id;
+ break;
+ }
+ mime++;
+ }
+ if (id == AV_CODEC_ID_NONE) {
+ av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
+ mimetype);
+ return 0;
+ }
+
+ if (picsize >= len) {
+ av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n",
+ picsize, len);
+ return AVERROR_INVALIDDATA;
+ }
+
+ /* picture description */
+ desc_len = (len - picsize) * 2 + 1;
+ desc = av_malloc(desc_len);
+ if (!desc)
+ return AVERROR(ENOMEM);
+ len -= avio_get_str16le(s->pb, len - picsize, desc, desc_len);
+
+ ret = av_get_packet(s->pb, &pkt, picsize);
+ if (ret < 0)
+ goto fail;
+
+ st = avformat_new_stream(s, NULL);
+ if (!st) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
+ asf_st = asf->asf_st[asf->nb_streams];
+ if (!asf_st) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
+ st->codec->codec_type = asf_st->type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = id;
+ st->attached_pic = pkt;
+ st->attached_pic.stream_index = asf_st->index = st->index;
+ st->attached_pic.flags |= AV_PKT_FLAG_KEY;
+
+ asf->nb_streams++;
+
+ if (*desc) {
+ if (av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ } else
+ av_freep(&desc);
+
+ if (av_dict_set(&st->metadata, "comment", ff_id3v2_picture_types[type], 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+
+ return 0;
+
+fail:
+ av_freep(&desc);
+ av_free_packet(&pkt);
+ return ret;
+}
+
+static void get_id3_tag(AVFormatContext *s, int len)
+{
+ ID3v2ExtraMeta *id3v2_extra_meta = NULL;
+
+ ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
+ if (id3v2_extra_meta)
+ ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ ff_id3v2_free_extra_meta(&id3v2_extra_meta);
+}
+
+static int process_metadata(AVFormatContext *s, const uint8_t *name, uint16_t name_len,
+ uint16_t val_len, uint16_t type, AVDictionary **met)
+{
+ int ret;
+ ff_asf_guid guid;
+
+ if (val_len) {
+ switch (type) {
+ case ASF_UNICODE:
+ asf_read_value(s, name, name_len, val_len, type, met);
+ break;
+ case ASF_BYTE_ARRAY:
+ if (!strcmp(name, "WM/Picture")) // handle cover art
+ asf_read_picture(s, val_len);
+ else if (!strcmp(name, "ID3")) // handle ID3 tag
+ get_id3_tag(s, val_len);
+ else
+ asf_read_value(s, name, name_len, val_len, type, met);
+ break;
+ case ASF_GUID:
+ ff_get_guid(s->pb, &guid);
+ break;
+ default:
+ if ((ret = asf_set_metadata(s, name, name_len, type, met)) < 0)
+ return ret;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static int asf_read_ext_content(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size = avio_rl64(pb);
+ uint16_t nb_desc = avio_rl16(pb);
+ int i, ret;
+
+ for (i = 0; i < nb_desc; i++) {
+ uint16_t name_len, type, val_len;
+ uint8_t *name = NULL;
+
+ name_len = avio_rl16(pb);
+ if (!name_len)
+ return AVERROR_INVALIDDATA;
+ name = av_malloc(name_len);
+ if (!name)
+ return AVERROR(ENOMEM);
+ avio_get_str16le(pb, name_len, name,
+ name_len);
+ type = avio_rl16(pb);
+ // BOOL values are 16 bits long in the Metadata Object
+ // but 32 bits long in the Extended Content Description Object
+ if (type == ASF_BOOL)
+ type = ASF_DWORD;
+ val_len = avio_rl16(pb);
+
+ ret = process_metadata(s, name, name_len, val_len, type, &s->metadata);
+ av_freep(&name);
+ if (ret < 0)
+ return ret;
+ }
+
+ align_position(pb, asf->offset, size);
+ return 0;
+}
+
+static AVStream *find_stream(AVFormatContext *s, uint16_t st_num)
+{
+ AVStream *st = NULL;
+ ASFContext *asf = s->priv_data;
+ int i;
+
+ for (i = 0; i < asf->nb_streams; i++) {
+ if (asf->asf_st[i]->stream_index == st_num) {
+ st = s->streams[asf->asf_st[i]->index];
+ break;
+ }
+ }
+
+ return st;
+}
+
+static int asf_store_aspect_ratio(AVFormatContext *s, uint8_t st_num, uint8_t *name, int type)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t value = 0;
+ int ret;
+
+ ret = asf_read_generic_value(pb, type, &value);
+ if (ret < 0)
+ return ret;
+
+ if (st_num < ASF_MAX_STREAMS) {
+ if (!strcmp(name, "AspectRatioX"))
+ asf->asf_sd[st_num].aspect_ratio.num = value;
+ else
+ asf->asf_sd[st_num].aspect_ratio.den = value;
+ }
+ return 0;
+}
+
+static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size = avio_rl64(pb);
+ uint16_t nb_recs = avio_rl16(pb); // number of records in the Description Records list
+ int i, ret;
+
+ for (i = 0; i < nb_recs; i++) {
+ uint16_t name_len, buflen, type, val_len, st_num;
+ uint8_t *name = NULL;
+
+ avio_skip(pb, 2); // skip reserved field
+ st_num = avio_rl16(pb);
+ name_len = avio_rl16(pb);
+ buflen = 2 * name_len + 1;
+ if (!name_len)
+ break;
+ type = avio_rl16(pb);
+ val_len = avio_rl32(pb);
+ name = av_malloc(buflen);
+ if (!name)
+ return AVERROR(ENOMEM);
+ avio_get_str16le(pb, name_len, name,
+ buflen);
+ if (!strcmp(name, "AspectRatioX") || !strcmp(name, "AspectRatioY")) {
+ ret = asf_store_aspect_ratio(s, st_num, name, type);
+ if (ret < 0) {
+ av_freep(&name);
+ break;
+ }
+ } else {
+ if (st_num < ASF_MAX_STREAMS) {
+ if ((ret = process_metadata(s, name, name_len, val_len, type,
+ &asf->asf_sd[st_num].asf_met)) < 0) {
+ av_freep(&name);
+ break;
+ }
+ }
+ }
+ av_freep(&name);
+ }
+
+ align_position(pb, asf->offset, size);
+ return 0;
+}
+
+static int asf_read_content_desc(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int i;
+ static const char *const titles[] =
+ { "Title", "Author", "Copyright", "Description", "Rate" };
+ uint16_t len[5], buflen[5] = { 0 };
+ uint8_t *ch;
+ uint64_t size = avio_rl64(pb);
+
+ for (i = 0; i < 5; i++) {
+ len[i] = avio_rl16(pb);
+ // utf8 string should be <= 2 * utf16 string, extra byte for the terminator
+ buflen[i] = 2 * len[i] + 1;
+ }
+
+ for (i = 0; i < 5; i++) {
+ ch = av_malloc(buflen[i]);
+ if (!ch)
+ return(AVERROR(ENOMEM));
+ asf_read_metadata(s, titles[i], len[i], ch, buflen[i]);
+ av_freep(&ch);
+ }
+ align_position(pb, asf->offset, size);
+
+ return 0;
+}
+
+static int asf_read_properties(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ time_t creation_time;
+
+ avio_rl64(pb); // read object size
+ avio_skip(pb, 16); // skip File ID
+ avio_skip(pb, 8); // skip File size
+ creation_time = avio_rl64(pb);
+ if (!(asf->b_flags & ASF_FLAG_BROADCAST)) {
+ struct tm tmbuf;
+ struct tm *tm;
+ char buf[64];
+
+ // creation date is in 100 ns units from 1 Jan 1601, conversion to s
+ creation_time /= 10000000;
+ // there are 11644473600 seconds between 1 Jan 1601 and 1 Jan 1970
+ creation_time -= 11644473600;
+ tm = gmtime_r(&creation_time, &tmbuf);
+ if (tm) {
+ if (!strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm))
+ buf[0] = '\0';
+ } else
+ buf[0] = '\0';
+ if (buf[0]) {
+ if (av_dict_set(&s->metadata, "creation_time", buf, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ }
+ }
+ asf->nb_packets = avio_rl64(pb);
+ asf->duration = avio_rl64(pb) / 10000; // stream duration
+ avio_skip(pb, 8); // skip send duration
+ asf->preroll = avio_rl64(pb);
+ asf->duration -= asf->preroll;
+ asf->b_flags = avio_rl32(pb);
+ avio_skip(pb, 4); // skip minimal packet size
+ asf->packet_size = avio_rl32(pb);
+ avio_skip(pb, 4); // skip max_bitrate
+
+ return 0;
+}
+
+static int parse_video_info(AVIOContext *pb, AVStream *st)
+{
+ uint16_t size;
+ unsigned int tag;
+
+ st->codec->width = avio_rl32(pb);
+ st->codec->height = avio_rl32(pb);
+ avio_skip(pb, 1); // skip reserved flags
+ size = avio_rl16(pb); // size of the Format Data
+ tag = ff_get_bmp_header(pb, st, NULL);
+ st->codec->codec_tag = tag;
+ st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag);
+
+ if (size > BMP_HEADER_SIZE) {
+ int ret;
+ st->codec->extradata_size = size - BMP_HEADER_SIZE;
+ if (!(st->codec->extradata = av_malloc(st->codec->extradata_size +
+ AV_INPUT_BUFFER_PADDING_SIZE))) {
+ st->codec->extradata_size = 0;
+ return AVERROR(ENOMEM);
+ }
+ memset(st->codec->extradata + st->codec->extradata_size , 0,
+ AV_INPUT_BUFFER_PADDING_SIZE);
+ if ((ret = avio_read(pb, st->codec->extradata,
+ st->codec->extradata_size)) < 0)
+ return ret;
+ }
+ return 0;
+}
+
+static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size;
+ uint32_t err_data_len, ts_data_len; // type specific data length
+ uint16_t flags;
+ ff_asf_guid stream_type;
+ enum AVMediaType type;
+ int i, ret;
+ uint8_t stream_index;
+ AVStream *st;
+ ASFStream *asf_st;
+
+ // ASF file must not contain more than 128 streams according to the specification
+ if (asf->nb_streams >= ASF_MAX_STREAMS)
+ return AVERROR_INVALIDDATA;
+
+ size = avio_rl64(pb);
+ ff_get_guid(pb, &stream_type);
+ if (!ff_guidcmp(&stream_type, &ff_asf_audio_stream))
+ type = AVMEDIA_TYPE_AUDIO;
+ else if (!ff_guidcmp(&stream_type, &ff_asf_video_stream))
+ type = AVMEDIA_TYPE_VIDEO;
+ else if (!ff_guidcmp(&stream_type, &ff_asf_jfif_media))
+ type = AVMEDIA_TYPE_VIDEO;
+ else if (!ff_guidcmp(&stream_type, &ff_asf_command_stream))
+ type = AVMEDIA_TYPE_DATA;
+ else if (!ff_guidcmp(&stream_type,
+ &ff_asf_ext_stream_embed_stream_header))
+ type = AVMEDIA_TYPE_UNKNOWN;
+ else
+ return AVERROR_INVALIDDATA;
+
+ ff_get_guid(pb, &stream_type); // error correction type
+ avio_skip(pb, 8); // skip the time offset
+ ts_data_len = avio_rl32(pb);
+ err_data_len = avio_rl32(pb);
+ flags = avio_rl16(pb); // bit 15 - Encrypted Content
+
+ stream_index = flags & ASF_STREAM_NUM;
+ for (i = 0; i < asf->nb_streams; i++)
+ if (stream_index == asf->asf_st[i]->stream_index) {
+ av_log(s, AV_LOG_WARNING,
+ "Duplicate stream found, this stream will be ignored.\n");
+ align_position(pb, asf->offset, size);
+ return 0;
+ }
+
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+ avpriv_set_pts_info(st, 32, 1, 1000); // pts should be dword, in milliseconds
+ st->codec->codec_type = type;
+ asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
+ if (!asf->asf_st[asf->nb_streams])
+ return AVERROR(ENOMEM);
+ asf_st = asf->asf_st[asf->nb_streams];
+ asf->nb_streams++;
+ asf_st->stream_index = stream_index;
+ asf_st->index = st->index;
+ asf_st->indexed = 0;
+ st->id = flags & ASF_STREAM_NUM;
+ av_init_packet(&asf_st->pkt.avpkt);
+ asf_st->pkt.data_size = 0;
+ avio_skip(pb, 4); // skip reserved field
+
+ switch (type) {
+ case AVMEDIA_TYPE_AUDIO:
+ asf_st->type = AVMEDIA_TYPE_AUDIO;
+ if ((ret = ff_get_wav_header(s, pb, st->codec, ts_data_len, 0)) < 0)
+ return ret;
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ asf_st->type = AVMEDIA_TYPE_VIDEO;
+ if ((ret = parse_video_info(pb, st)) < 0)
+ return ret;
+ break;
+ default:
+ avio_skip(pb, ts_data_len);
+ break;
+ }
+
+ if (err_data_len) {
+ if (type == AVMEDIA_TYPE_AUDIO) {
+ uint8_t span = avio_r8(pb);
+ if (span > 1) {
+ asf_st->span = span;
+ asf_st->virtual_pkt_len = avio_rl16(pb);
+ asf_st->virtual_chunk_len = avio_rl16(pb);
+ if (!asf_st->virtual_chunk_len || !asf_st->virtual_pkt_len)
+ return AVERROR_INVALIDDATA;
+ avio_skip(pb, err_data_len - 5);
+ } else
+ avio_skip(pb, err_data_len - 1);
+ } else
+ avio_skip(pb, err_data_len);
+ }
+
+ align_position(pb, asf->offset, size);
+
+ return 0;
+}
+
+static void set_language(AVFormatContext *s, const char *rfc1766, AVDictionary **met)
+{
+ // language abbr should contain at least 2 chars
+ if (rfc1766 && strlen(rfc1766) > 1) {
+ const char primary_tag[3] = { rfc1766[0], rfc1766[1], '\0' }; // ignore country code if any
+ const char *iso6392 = av_convert_lang_to(primary_tag,
+ AV_LANG_ISO639_2_BIBL);
+ if (iso6392)
+ if (av_dict_set(met, "language", iso6392, 0) < 0)
+ av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
+ }
+}
+
+static int asf_read_ext_stream_properties(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVStream *st = NULL;
+ ff_asf_guid guid;
+ uint16_t nb_st_name, nb_pay_exts, st_num, lang_idx;
+ int i, ret;
+ uint32_t bitrate;
+ uint64_t start_time, end_time, time_per_frame;
+ uint64_t size = avio_rl64(pb);
+
+ start_time = avio_rl64(pb);
+ end_time = avio_rl64(pb);
+ bitrate = avio_rl32(pb);
+ avio_skip(pb, 28); // skip some unused values
+ st_num = avio_rl16(pb);
+ st_num &= ASF_STREAM_NUM;
+ lang_idx = avio_rl16(pb); // Stream Language ID Index
+ for (i = 0; i < asf->nb_streams; i++) {
+ if (st_num == asf->asf_st[i]->stream_index) {
+ st = s->streams[asf->asf_st[i]->index];
+ asf->asf_st[i]->lang_idx = lang_idx;
+ break;
+ }
+ }
+ time_per_frame = avio_rl64(pb); // average time per frame
+ if (st) {
+ st->start_time = start_time;
+ st->duration = end_time - start_time;
+ st->codec->bit_rate = bitrate;
+ st->avg_frame_rate.num = 10000000;
+ st->avg_frame_rate.den = time_per_frame;
+ }
+ nb_st_name = avio_rl16(pb);
+ nb_pay_exts = avio_rl16(pb);
+ for (i = 0; i < nb_st_name; i++) {
+ uint16_t len;
+
+ avio_rl16(pb); // Language ID Index
+ len = avio_rl16(pb);
+ avio_skip(pb, len);
+ }
+
+ for (i = 0; i < nb_pay_exts; i++) {
+ uint32_t len;
+ avio_skip(pb, 16); // Extension System ID
+ avio_skip(pb, 2); // Extension Data Size
+ len = avio_rl32(pb);
+ avio_skip(pb, len);
+ }
+
+ if ((ret = ff_get_guid(pb, &guid)) < 0) {
+ align_position(pb, asf->offset, size);
+
+ return 0;
+ }
+
+ g = find_guid(guid);
+ if (g && !(strcmp(g->name, "Stream Properties"))) {
+ if ((ret = g->read_object(s, g)) < 0)
+ return ret;
+ }
+
+ align_position(pb, asf->offset, size);
+ return 0;
+}
+
+static int asf_read_language_list(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int i, ret;
+ uint64_t size = avio_rl64(pb);
+ uint16_t nb_langs = avio_rl16(pb);
+
+ if (nb_langs < ASF_MAX_STREAMS) {
+ for (i = 0; i < nb_langs; i++) {
+ size_t len;
+ len = avio_r8(pb);
+ if (!len)
+ len = 6;
+ if ((ret = get_asf_string(pb, len, asf->asf_sd[i].langs,
+ sizeof(asf->asf_sd[i].langs))) < 0) {
+ return ret;
+ }
+ }
+ }
+
+ align_position(pb, asf->offset, size);
+ return 0;
+}
+
+// returns data object offset when reading this object for the first time
+static int asf_read_data(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size = asf->data_size = avio_rl64(pb);
+ int i;
+
+ if (!asf->data_reached) {
+ asf->data_reached = 1;
+ asf->data_offset = asf->offset;
+ }
+
+ for (i = 0; i < asf->nb_streams; i++) {
+ if (!(asf->b_flags & ASF_FLAG_BROADCAST))
+ s->streams[i]->duration = asf->duration;
+ }
+ asf->nb_mult_left = 0;
+ asf->sub_left = 0;
+ asf->state = PARSE_PACKET_HEADER;
+ asf->return_subpayload = 0;
+ asf->packet_size_internal = 0;
+ avio_skip(pb, 16); // skip File ID
+ size = avio_rl64(pb); // Total Data Packets
+ if (size != asf->nb_packets)
+ av_log(s, AV_LOG_WARNING,
+ "Number of Packets from File Properties Object is not equal to Total"
+ "Datapackets value! num of packets %"PRIu64" total num %"PRIu64".\n",
+ size, asf->nb_packets);
+ avio_skip(pb, 2); // skip reserved field
+ asf->first_packet_offset = avio_tell(pb);
+ if (pb->seekable && !(asf->b_flags & ASF_FLAG_BROADCAST))
+ align_position(pb, asf->offset, asf->data_size);
+
+ return 0;
+}
+
+static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ AVStream *st = NULL;
+ uint64_t interval; // index entry time interval in 100 ns units, usually it's 1s
+ uint32_t pkt_num, nb_entries;
+ int32_t prev_pkt_num = -1;
+ int i;
+ uint64_t size = avio_rl64(pb);
+
+ // simple index objects should be ordered by stream number, this loop tries to find
+ // the first not indexed video stream
+ for (i = 0; i < asf->nb_streams; i++) {
+ if ((asf->asf_st[i]->type == AVMEDIA_TYPE_VIDEO) && !asf->asf_st[i]->indexed) {
+ asf->asf_st[i]->indexed = 1;
+ st = s->streams[asf->asf_st[i]->index];
+ break;
+ }
+ }
+ if (!st) {
+ avio_skip(pb, size - 24); // if there's no video stream, skip index object
+ return 0;
+ }
+ avio_skip(pb, 16); // skip File ID
+ interval = avio_rl64(pb);
+ avio_skip(pb, 4);
+ nb_entries = avio_rl32(pb);
+ for (i = 0; i < nb_entries; i++) {
+ pkt_num = avio_rl32(pb);
+ avio_skip(pb, 2);
+ if (prev_pkt_num != pkt_num) {
+ av_add_index_entry(st, asf->first_packet_offset + asf->packet_size *
+ pkt_num, av_rescale(interval, i, 10000),
+ asf->packet_size, 0, AVINDEX_KEYFRAME);
+ prev_pkt_num = pkt_num;
+ }
+ }
+ asf->is_simple_index = 1;
+ align_position(pb, asf->offset, size);
+
+ return 0;
+}
+
+static const GUIDParseTable gdef[] = {
+ { "Data", { 0x75, 0xB2, 0x26, 0x36, 0x66, 0x8E, 0x11, 0xCF, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C }, asf_read_data, 1 },
+ { "Simple Index", { 0x33, 0x00, 0x08, 0x90, 0xE5, 0xB1, 0x11, 0xCF, 0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB }, asf_read_simple_index, 1 },
+ { "Content Description", { 0x75, 0xB2, 0x26, 0x33, 0x66 ,0x8E, 0x11, 0xCF, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C }, asf_read_content_desc, 1 },
+ { "Extended Content Description", { 0xD2, 0xD0, 0xA4, 0x40, 0xE3, 0x07, 0x11, 0xD2, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5e, 0xA8, 0x50 }, asf_read_ext_content, 1 },
+ { "Stream Bitrate Properties", { 0x7B, 0xF8, 0x75, 0xCE, 0x46, 0x8D, 0x11, 0xD1, 0x8D, 0x82, 0x00, 0x60, 0x97, 0xC9, 0xA2, 0xB2 }, asf_read_unknown, 1 },
+ { "File Properties", { 0x8C, 0xAB, 0xDC, 0xA1, 0xA9, 0x47, 0x11, 0xCF, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 }, asf_read_properties, 1 },
+ { "Header Extension", { 0x5F, 0xBF, 0x03, 0xB5, 0xA9, 0x2E, 0x11, 0xCF, 0x8E, 0xE3, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 }, asf_read_unknown, 0 },
+ { "Stream Properties", { 0xB7, 0xDC, 0x07, 0x91, 0xA9, 0xB7, 0x11, 0xCF, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 }, asf_read_stream_properties, 1 },
+ { "Codec List", { 0x86, 0xD1, 0x52, 0x40, 0x31, 0x1D, 0x11, 0xD0, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 }, asf_read_unknown, 1 },
+ { "Marker", { 0xF4, 0x87, 0xCD, 0x01, 0xA9, 0x51, 0x11, 0xCF, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 }, asf_read_marker, 1 },
+ { "Script Command", { 0x1E, 0xFB, 0x1A, 0x30, 0x0B, 0x62, 0x11, 0xD0, 0xA3, 0x9B, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 }, asf_read_unknown, 1 },
+ { "Language List", { 0x7C, 0x43, 0x46, 0xa9, 0xef, 0xe0, 0x4B, 0xFC, 0xB2, 0x29, 0x39, 0x3e, 0xde, 0x41, 0x5c, 0x85 }, asf_read_language_list, 1},
+ { "Padding", { 0x18, 0x06, 0xD4, 0x74, 0xCA, 0xDF, 0x45, 0x09, 0xA4, 0xBA, 0x9A, 0xAB, 0xCB, 0x96, 0xAA, 0xE8 }, asf_read_unknown, 1 },
+ { "DRMv1 Header", { 0x22, 0x11, 0xB3, 0xFB, 0xBD, 0x23, 0x11, 0xD2, 0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E }, asf_read_unknown, 1 },
+ { "DRMv2 Header", { 0x29, 0x8A, 0xE6, 0x14, 0x26, 0x22, 0x4C, 0x17, 0xB9, 0x35, 0xDA, 0xE0, 0x7E, 0xE9, 0x28, 0x9c }, asf_read_unknown, 1 },
+ { "Index", { 0xD6, 0xE2, 0x29, 0xD3, 0x35, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Media Object Index", { 0xFE, 0xB1, 0x03, 0xF8, 0x12, 0xAD, 0x4C, 0x64, 0x84, 0x0F, 0x2A, 0x1D, 0x2F, 0x7A, 0xD4, 0x8C }, asf_read_unknown, 1 },
+ { "Timecode Index", { 0x3C, 0xB7, 0x3F, 0xD0, 0x0C, 0x4A, 0x48, 0x03, 0x95, 0x3D, 0xED, 0xF7, 0xB6, 0x22, 0x8F, 0x0C }, asf_read_unknown, 0 },
+ { "Bitrate_Mutual_Exclusion", { 0xD6, 0xE2, 0x29, 0xDC, 0x35, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Error Correction", { 0x75, 0xB2, 0x26, 0x35, 0x66, 0x8E, 0x11, 0xCF, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C }, asf_read_unknown, 1 },
+ { "Content Branding", { 0x22, 0x11, 0xB3, 0xFA, 0xBD, 0x23, 0x11, 0xD2, 0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E }, asf_read_unknown, 1 },
+ { "Content Encryption", { 0x22, 0x11, 0xB3, 0xFB, 0xBD, 0x23, 0x11, 0xD2, 0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E }, asf_read_unknown, 1 },
+ { "Extended Content Encryption", { 0x29, 0x8A, 0xE6, 0x14, 0x26, 0x22, 0x4C, 0x17, 0xB9, 0x35, 0xDA, 0xE0, 0x7E, 0xE9, 0x28, 0x9C }, asf_read_unknown, 1 },
+ { "Digital Signature", { 0x22, 0x11, 0xB3, 0xFC, 0xBD, 0x23, 0x11, 0xD2, 0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E }, asf_read_unknown, 1 },
+ { "Extended Stream Properties", { 0x14, 0xE6, 0xA5, 0xCB, 0xC6, 0x72, 0x43, 0x32, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A }, asf_read_ext_stream_properties, 1 },
+ { "Advanced Mutual Exclusion", { 0xA0, 0x86, 0x49, 0xCF, 0x47, 0x75, 0x46, 0x70, 0x8A, 0x16, 0x6E, 0x35, 0x35, 0x75, 0x66, 0xCD }, asf_read_unknown, 1 },
+ { "Group Mutual Exclusion", { 0xD1, 0x46, 0x5A, 0x40, 0x5A, 0x79, 0x43, 0x38, 0xB7, 0x1B, 0xE3, 0x6B, 0x8F, 0xD6, 0xC2, 0x49 }, asf_read_unknown, 1},
+ { "Stream Prioritization", { 0xD4, 0xFE, 0xD1, 0x5B, 0x88, 0xD3, 0x45, 0x4F, 0x81, 0xF0, 0xED, 0x5C, 0x45, 0x99, 0x9E, 0x24 }, asf_read_unknown, 1 },
+ { "Bandwidth Sharing Object", { 0xA6, 0x96, 0x09, 0xE6, 0x51, 0x7B, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
+ { "Metadata", { 0xC5, 0xF8, 0xCB, 0xEA, 0x5B, 0xAF, 0x48, 0x77, 0x84, 0x67, 0xAA, 0x8C, 0x44, 0xFA, 0x4C, 0xCA }, asf_read_metadata_obj, 1 },
+ { "Metadata Library", { 0x44, 0x23, 0x1C, 0x94, 0x94, 0x98, 0x49, 0xD1, 0xA1, 0x41, 0x1D, 0x13, 0x4E, 0x45, 0x70, 0x54 }, asf_read_metadata_obj, 1 },
+ { "Audio Spread", { 0xBF, 0xC3, 0xCD, 0x50, 0x61, 0x8F, 0x11, 0xCF, 0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20 }, asf_read_unknown, 1 },
+ { "Index Parameters", { 0xD6, 0xE2, 0x29, 0xDF, 0x35, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Content Encryption System Windows Media DRM Network Devices",
+ { 0x7A, 0x07, 0x9B, 0xB6, 0xDA, 0XA4, 0x4e, 0x12, 0xA5, 0xCA, 0x91, 0xD3, 0x8D, 0xC1, 0x1A, 0x8D }, asf_read_unknown, 1 },
+ { "Mutex Language", { 0xD6, 0xE2, 0x2A, 0x00, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Mutex Bitrate", { 0xD6, 0xE2, 0x2A, 0x01, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Mutex Unknown", { 0xD6, 0xE2, 0x2A, 0x02, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
+ { "Bandwith Sharing Exclusive", { 0xAF, 0x60, 0x60, 0xAA, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
+ { "Bandwith Sharing Partial", { 0xAF, 0x60, 0x60, 0xAB, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
+ { "Payload Extension System Timecode", { 0x39, 0x95, 0x95, 0xEC, 0x86, 0x67, 0x4E, 0x2D, 0x8F, 0xDB, 0x98, 0x81, 0x4C, 0xE7, 0x6C, 0x1E }, asf_read_unknown, 1 },
+ { "Payload Extension System File Name", { 0xE1, 0x65, 0xEC, 0x0E, 0x19, 0xED, 0x45, 0xD7, 0xB4, 0xA7, 0x25, 0xCB, 0xD1, 0xE2, 0x8E, 0x9B }, asf_read_unknown, 1 },
+ { "Payload Extension System Content Type", { 0xD5, 0x90, 0xDC, 0x20, 0x07, 0xBC, 0x43, 0x6C, 0x9C, 0xF7, 0xF3, 0xBB, 0xFB, 0xF1, 0xA4, 0xDC }, asf_read_unknown, 1 },
+ { "Payload Extension System Pixel Aspect Ratio", { 0x1, 0x1E, 0xE5, 0x54, 0xF9, 0xEA, 0x4B, 0xC8, 0x82, 0x1A, 0x37, 0x6B, 0x74, 0xE4, 0xC4, 0xB8 }, asf_read_unknown, 1 },
+ { "Payload Extension System Sample Duration", { 0xC6, 0xBD, 0x94, 0x50, 0x86, 0x7F, 0x49, 0x07, 0x83, 0xA3, 0xC7, 0x79, 0x21, 0xB7, 0x33, 0xAD }, asf_read_unknown, 1 },
+ { "Payload Extension System Encryption Sample ID", { 0x66, 0x98, 0xB8, 0x4E, 0x0A, 0xFA, 0x43, 0x30, 0xAE, 0xB2, 0x1C, 0x0A, 0x98, 0xD7, 0xA4, 0x4D }, asf_read_unknown, 1 },
+ { "Payload Extension System Degradable JPEG", { 0x00, 0xE1, 0xAF, 0x06, 0x7B, 0xEC, 0x11, 0xD1, 0xA5, 0x82, 0x00, 0xC0, 0x4F, 0xC2, 0x9C, 0xFB }, asf_read_unknown, 1 },
+};
+
+#define READ_LEN(flag, name, len) \
+ do { \
+ if ((flag) == name ## IS_BYTE) \
+ len = avio_r8(pb); \
+ else if ((flag) == name ## IS_WORD) \
+ len = avio_rl16(pb); \
+ else if ((flag) == name ## IS_DWORD) \
+ len = avio_rl32(pb); \
+ else \
+ len = 0; \
+ } while(0)
+
+static int asf_read_subpayload(AVFormatContext *s, AVPacket *pkt, int is_header)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint8_t sub_len;
+ int ret, i;
+
+ if (is_header) {
+ asf->dts_delta = avio_r8(pb);
+ if (asf->nb_mult_left) {
+ asf->mult_sub_len = avio_rl16(pb); // total
+ }
+ asf->sub_header_offset = avio_tell(pb);
+ asf->nb_sub = 0;
+ asf->sub_left = 1;
+ }
+ sub_len = avio_r8(pb);
+ if ((ret = av_get_packet(pb, pkt, sub_len)) < 0) // each subpayload is entire frame
+ return ret;
+ for (i = 0; i < asf->nb_streams; i++) {
+ if (asf->stream_index == asf->asf_st[i]->stream_index) {
+ pkt->stream_index = asf->asf_st[i]->index;
+ break;
+ }
+ }
+ asf->return_subpayload = 1;
+ if (!sub_len)
+ asf->return_subpayload = 0;
+
+ if (sub_len)
+ asf->nb_sub++;
+ pkt->dts = asf->sub_dts + (asf->nb_sub - 1) * asf->dts_delta - asf->preroll;
+ if (asf->nb_mult_left && (avio_tell(pb) >=
+ (asf->sub_header_offset + asf->mult_sub_len))) {
+ asf->sub_left = 0;
+ asf->nb_mult_left--;
+ }
+ if (avio_tell(pb) >= asf->packet_offset + asf->packet_size - asf->pad_len) {
+ asf->sub_left = 0;
+ if (!asf->nb_mult_left) {
+ avio_skip(pb, asf->pad_len);
+ if (avio_tell(pb) != asf->packet_offset + asf->packet_size) {
+ if (!asf->packet_size)
+ return AVERROR_INVALIDDATA;
+ av_log(s, AV_LOG_WARNING,
+ "Position %"PRId64" wrong, should be %"PRId64"\n",
+ avio_tell(pb), asf->packet_offset + asf->packet_size);
+ avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
+ }
+ }
+ }
+
+ return 0;
+}
+
+static void reset_packet(ASFPacket *asf_pkt)
+{
+ asf_pkt->size_left = 0;
+ asf_pkt->data_size = 0;
+ asf_pkt->duration = 0;
+ asf_pkt->flags = 0;
+ asf_pkt->dts = 0;
+ asf_pkt->duration = 0;
+ av_free_packet(&asf_pkt->avpkt);
+ av_init_packet(&asf_pkt->avpkt);
+}
+
+static int asf_read_replicated_data(AVFormatContext *s, ASFPacket *asf_pkt)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int ret;
+
+ if (!asf_pkt->data_size) {
+ asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size
+ if (asf_pkt->data_size <= 0)
+ return AVERROR_INVALIDDATA;
+ if ((ret = av_new_packet(&asf_pkt->avpkt, asf_pkt->data_size)) < 0)
+ return ret;
+ } else
+ avio_skip(pb, 4); // reading of media object size is already done
+ asf_pkt->dts = avio_rl32(pb); // read presentation time
+ if (asf->rep_data_len && (asf->rep_data_len >= 8))
+ avio_skip(pb, asf->rep_data_len - 8); // skip replicated data
+
+ return 0;
+}
+
+static int asf_read_multiple_payload(AVFormatContext *s, AVPacket *pkt,
+ ASFPacket *asf_pkt)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint16_t pay_len;
+ unsigned char *p;
+ int ret;
+ int skip = 0;
+
+ // if replicated lenght is 1, subpayloads are present
+ if (asf->rep_data_len == 1) {
+ asf->sub_left = 1;
+ asf->state = READ_MULTI_SUB;
+ pkt->flags = asf_pkt->flags;
+ if ((ret = asf_read_subpayload(s, pkt, 1)) < 0)
+ return ret;
+ } else {
+ if (asf->rep_data_len)
+ if ((ret = asf_read_replicated_data(s, asf_pkt)) < 0)
+ return ret;
+ pay_len = avio_rl16(pb); // payload length should be WORD
+ if (pay_len > asf->packet_size) {
+ av_log(s, AV_LOG_ERROR,
+ "Error: invalid data packet size, pay_len %"PRIu16", "
+ "asf->packet_size %"PRIu32", offset %"PRId64".\n",
+ pay_len, asf->packet_size, avio_tell(pb));
+ return AVERROR_INVALIDDATA;
+ }
+ p = asf_pkt->avpkt.data + asf_pkt->data_size - asf_pkt->size_left;
+ if (pay_len > asf_pkt->size_left) {
+ av_log(s, AV_LOG_ERROR,
+ "Error: invalid buffer size, pay_len %d, data size left %d.\n",
+ pay_len, asf_pkt->size_left);
+ skip = pay_len - asf_pkt->size_left;
+ pay_len = asf_pkt->size_left;
+ }
+ if (asf_pkt->size_left <= 0)
+ return AVERROR_INVALIDDATA;
+ if ((ret = avio_read(pb, p, pay_len)) < 0)
+ return ret;
+ if (s->key && s->keylen == 20)
+ ff_asfcrypt_dec(s->key, p, ret);
+ avio_skip(pb, skip);
+ asf_pkt->size_left -= pay_len;
+ asf->nb_mult_left--;
+ }
+
+ return 0;
+}
+
+static int asf_read_single_payload(AVFormatContext *s, AVPacket *pkt,
+ ASFPacket *asf_pkt)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int64_t offset;
+ uint64_t size;
+ unsigned char *p;
+ int ret;
+
+ if (!asf_pkt->data_size) {
+ asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size
+ if (asf_pkt->data_size <= 0)
+ return AVERROR_EOF;
+ if ((ret = av_new_packet(&asf_pkt->avpkt, asf_pkt->data_size)) < 0)
+ return ret;
+ } else
+ avio_skip(pb, 4); // skip media object size
+ asf_pkt->dts = avio_rl32(pb); // read presentation time
+ if (asf->rep_data_len >= 8)
+ avio_skip(pb, asf->rep_data_len - 8); // skip replicated data
+ offset = avio_tell(pb);
+
+ // size of the payload - size of the packet without header and padding
+ if (asf->packet_size_internal)
+ size = asf->packet_size_internal - offset + asf->packet_offset - asf->pad_len;
+ else
+ size = asf->packet_size - offset + asf->packet_offset - asf->pad_len;
+ if (size > asf->packet_size) {
+ av_log(s, AV_LOG_ERROR,
+ "Error: invalid data packet size, offset %"PRId64".\n",
+ avio_tell(pb));
+ return AVERROR_INVALIDDATA;
+ }
+ p = asf_pkt->avpkt.data + asf_pkt->data_size - asf_pkt->size_left;
+ if (size > asf_pkt->size_left || asf_pkt->size_left <= 0)
+ return AVERROR_INVALIDDATA;
+ if (asf_pkt->size_left > size)
+ asf_pkt->size_left -= size;
+ else
+ asf_pkt->size_left = 0;
+ if ((ret = avio_read(pb, p, size)) < 0)
+ return ret;
+ if (s->key && s->keylen == 20)
+ ff_asfcrypt_dec(s->key, p, ret);
+ if (asf->packet_size_internal)
+ avio_skip(pb, asf->packet_size - asf->packet_size_internal);
+ avio_skip(pb, asf->pad_len); // skip padding
+
+ return 0;
+}
+
+static int asf_read_payload(AVFormatContext *s, AVPacket *pkt)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int ret, i;
+ ASFPacket *asf_pkt = NULL;
+
+ if (!asf->sub_left) {
+ uint32_t off_len, media_len;
+ uint8_t stream_num;
+
+ stream_num = avio_r8(pb);
+ asf->stream_index = stream_num & ASF_STREAM_NUM;
+ for (i = 0; i < asf->nb_streams; i++) {
+ if (asf->stream_index == asf->asf_st[i]->stream_index) {
+ asf_pkt = &asf->asf_st[i]->pkt;
+ asf_pkt->stream_index = asf->asf_st[i]->index;
+ break;
+ }
+ }
+ if (!asf_pkt)
+ return AVERROR_INVALIDDATA;
+ if (stream_num >> 7)
+ asf_pkt->flags |= AV_PKT_FLAG_KEY;
+ READ_LEN(asf->prop_flags & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE,
+ ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_, media_len);
+ READ_LEN(asf->prop_flags & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE,
+ ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_, off_len);
+ READ_LEN(asf->prop_flags & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE,
+ ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_, asf->rep_data_len);
+ if (asf_pkt->size_left && (asf_pkt->frame_num != media_len)) {
+ av_log(s, AV_LOG_WARNING, "Unfinished frame will be ignored\n");
+ reset_packet(asf_pkt);
+ }
+ asf_pkt->frame_num = media_len;
+ asf->sub_dts = off_len;
+ if (asf->nb_mult_left) {
+ if ((ret = asf_read_multiple_payload(s, pkt, asf_pkt)) < 0)
+ return ret;
+ } else if (asf->rep_data_len == 1) {
+ asf->sub_left = 1;
+ asf->state = READ_SINGLE;
+ pkt->flags = asf_pkt->flags;
+ if ((ret = asf_read_subpayload(s, pkt, 1)) < 0)
+ return ret;
+ } else {
+ if ((ret = asf_read_single_payload(s, pkt, asf_pkt)) < 0)
+ return ret;
+ }
+ } else {
+ for (i = 0; i <= asf->nb_streams; i++) {
+ if (asf->stream_index == asf->asf_st[i]->stream_index) {
+ asf_pkt = &asf->asf_st[i]->pkt;
+ break;
+ }
+ }
+ if (!asf_pkt)
+ return AVERROR_INVALIDDATA;
+ pkt->flags = asf_pkt->flags;
+ pkt->dts = asf_pkt->dts;
+ pkt->stream_index = asf->asf_st[i]->index;
+ if ((ret = asf_read_subpayload(s, pkt, 0)) < 0) // read subpayload without its header
+ return ret;
+ }
+
+ return 0;
+}
+
+static int asf_read_packet_header(AVFormatContext *s)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ uint64_t size;
+ uint32_t av_unused seq;
+ unsigned char error_flags, len_flags, pay_flags;
+
+ asf->packet_offset = avio_tell(pb);
+ error_flags = avio_r8(pb); // read Error Correction Flags
+ if (error_flags & ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT) {
+ if (!(error_flags & ASF_ERROR_CORRECTION_LENGTH_TYPE)) {
+ size = error_flags & ASF_PACKET_ERROR_CORRECTION_DATA_SIZE;
+ avio_skip(pb, size);
+ }
+ len_flags = avio_r8(pb);
+ } else
+ len_flags = error_flags;
+ asf->prop_flags = avio_r8(pb);
+ READ_LEN(len_flags & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE,
+ ASF_PPI_FLAG_PACKET_LENGTH_FIELD_, asf->packet_size_internal);
+ READ_LEN(len_flags & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE,
+ ASF_PPI_FLAG_SEQUENCE_FIELD_, seq);
+ READ_LEN(len_flags & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE,
+ ASF_PPI_FLAG_PADDING_LENGTH_FIELD_, asf->pad_len );
+ asf->send_time = avio_rl32(pb); // send time
+ avio_skip(pb, 2); // skip duration
+ if (len_flags & ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT) { // Multiple Payloads present
+ pay_flags = avio_r8(pb);
+ asf->nb_mult_left = (pay_flags & ASF_NUM_OF_PAYLOADS);
+ }
+
+ return 0;
+}
+
+static int asf_deinterleave(AVFormatContext *s, ASFPacket *asf_pkt, int st_num)
+{
+ ASFContext *asf = s->priv_data;
+ ASFStream *asf_st = asf->asf_st[st_num];
+ unsigned char *p = asf_pkt->avpkt.data;
+ uint16_t pkt_len = asf->asf_st[st_num]->virtual_pkt_len;
+ uint16_t chunk_len = asf->asf_st[st_num]->virtual_chunk_len;
+ int nchunks = pkt_len / chunk_len;
+ AVPacket pkt;
+ int pos = 0, j, l, ret;
+
+
+ if ((ret = av_new_packet(&pkt, asf_pkt->data_size)) < 0)
+ return ret;
+
+ while (asf_pkt->data_size >= asf_st->span * pkt_len + pos) {
+ if (pos >= asf_pkt->data_size) {
+ break;
+ }
+ for (l = 0; l < pkt_len; l++) {
+ if (pos >= asf_pkt->data_size) {
+ break;
+ }
+ for (j = 0; j < asf_st->span; j++) {
+ if ((pos + chunk_len) >= asf_pkt->data_size)
+ break;
+ memcpy(pkt.data + pos,
+ p + (j * nchunks + l) * chunk_len,
+ chunk_len);
+ pos += chunk_len;
+ }
+ }
+ p += asf_st->span * pkt_len;
+ if (p > asf_pkt->avpkt.data + asf_pkt->data_size)
+ break;
+ }
+ av_free_packet(&asf_pkt->avpkt);
+ asf_pkt->avpkt = pkt;
+
+ return 0;
+}
+
+static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ int ret, i;
+
+ if ((avio_tell(pb) >= asf->data_offset + asf->data_size) &&
+ !(asf->b_flags & ASF_FLAG_BROADCAST))
+ return AVERROR_EOF;
+ while (!pb->eof_reached) {
+ if (asf->state == PARSE_PACKET_HEADER) {
+ asf_read_packet_header(s);
+ if (!asf->nb_mult_left)
+ asf->state = READ_SINGLE;
+ else
+ asf->state = READ_MULTI;
+ }
+ if ((ret = asf_read_payload(s, pkt)) < 0)
+ return ret;
+ switch (asf->state) {
+ case READ_SINGLE:
+ if (!asf->sub_left)
+ asf->state = PARSE_PACKET_HEADER;
+ break;
+ case READ_MULTI_SUB:
+ if (!asf->sub_left && !asf->nb_mult_left) {
+ asf->state = PARSE_PACKET_HEADER;
+ if (!asf->return_subpayload)
+ avio_skip(pb, asf->pad_len); // skip padding
+ if (asf->packet_offset + asf->packet_size > avio_tell(pb))
+ avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
+ } else if (!asf->sub_left)
+ asf->state = READ_MULTI;
+ break;
+ case READ_MULTI:
+ if (!asf->nb_mult_left) {
+ asf->state = PARSE_PACKET_HEADER;
+ if (!asf->return_subpayload) {
+ avio_skip(pb, asf->pad_len); // skip padding
+ }
+ if (asf->packet_offset + asf->packet_size > avio_tell(pb))
+ avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SET);
+ }
+ break;
+ }
+ if (asf->return_subpayload) {
+ asf->return_subpayload = 0;
+ return 0;
+ }
+ for (i = 0; i < s->nb_streams; i++) {
+ ASFPacket *asf_pkt = &asf->asf_st[i]->pkt;
+ if (asf_pkt && !asf_pkt->size_left && asf_pkt->data_size) {
+ if (asf->asf_st[i]->span > 1 &&
+ asf->asf_st[i]->type == AVMEDIA_TYPE_AUDIO)
+ if ((ret = asf_deinterleave(s, asf_pkt, i)) < 0)
+ return ret;
+ av_packet_move_ref(pkt, &asf_pkt->avpkt);
+ pkt->stream_index = asf->asf_st[i]->index;
+ pkt->flags = asf_pkt->flags;
+ pkt->dts = asf_pkt->dts - asf->preroll;
+ asf_pkt->data_size = 0;
+ asf_pkt->frame_num = 0;
+ return 0;
+ }
+ }
+ }
+
+ if (pb->eof_reached)
+ return AVERROR_EOF;
+
+ return 0;
+}
+
+static int asf_read_close(AVFormatContext *s)
+{
+ ASFContext *asf = s->priv_data;
+ int i;
+
+ for (i = 0; i < ASF_MAX_STREAMS; i++) {
+ av_dict_free(&asf->asf_sd[i].asf_met);
+ if (i < asf->nb_streams) {
+ av_free_packet(&asf->asf_st[i]->pkt.avpkt);
+ av_freep(&asf->asf_st[i]);
+ }
+ }
+
+ asf->nb_streams = 0;
+ return 0;
+}
+
+static void reset_packet_state(AVFormatContext *s)
+{
+ ASFContext *asf = s->priv_data;
+ int i;
+
+ asf->state = PARSE_PACKET_HEADER;
+ asf->offset = 0;
+ asf->return_subpayload = 0;
+ asf->sub_left = 0;
+ asf->sub_header_offset = 0;
+ asf->packet_offset = asf->first_packet_offset;
+ asf->pad_len = 0;
+ asf->rep_data_len = 0;
+ asf->dts_delta = 0;
+ asf->mult_sub_len = 0;
+ asf->nb_mult_left = 0;
+ asf->nb_sub = 0;
+ asf->prop_flags = 0;
+ asf->sub_dts = 0;
+ for (i = 0; i < asf->nb_streams; i++) {
+ ASFPacket *pkt = &asf->asf_st[i]->pkt;
+ pkt->size_left = 0;
+ pkt->data_size = 0;
+ pkt->duration = 0;
+ pkt->flags = 0;
+ pkt->dts = 0;
+ pkt->duration = 0;
+ av_free_packet(&pkt->avpkt);
+ av_init_packet(&pkt->avpkt);
+ }
+}
+
+/*
+ * Find a timestamp for the requested position within the payload
+ * where the pos (position) is the offset inside the Data Object.
+ * When position is not on the packet boundary, asf_read_timestamp tries
+ * to find the closest packet offset after this position. If this packet
+ * is a key frame, this packet timestamp is read and an index entry is created
+ * for the packet. If this packet belongs to the requested stream,
+ * asf_read_timestamp upgrades pos to the packet beginning offset and
+ * returns this packet's dts. So returned dts is the dts of the first key frame with
+ * matching stream number after given position.
+ */
+static int64_t asf_read_timestamp(AVFormatContext *s, int stream_index,
+ int64_t *pos, int64_t pos_limit)
+{
+ ASFContext *asf = s->priv_data;
+ int64_t pkt_pos = *pos, pkt_offset, dts = AV_NOPTS_VALUE, data_end;
+ AVPacket pkt;
+ int n;
+
+ data_end = asf->data_offset + asf->data_size;
+
+ n = (pkt_pos - asf->first_packet_offset + asf->packet_size - 1) /
+ asf->packet_size;
+ n = av_clip(n, 0, ((data_end - asf->first_packet_offset) / asf->packet_size - 1));
+ pkt_pos = asf->first_packet_offset + n * asf->packet_size;
+
+ avio_seek(s->pb, pkt_pos, SEEK_SET);
+ pkt_offset = pkt_pos;
+
+ reset_packet_state(s);
+ while (avio_tell(s->pb) < data_end) {
+
+ int i, ret, st_found;
+
+ av_init_packet(&pkt);
+ pkt_offset = avio_tell(s->pb);
+ if ((ret = asf_read_packet(s, &pkt)) < 0) {
+ dts = AV_NOPTS_VALUE;
+ return ret;
+ }
+ // ASFPacket may contain fragments of packets belonging to different streams,
+ // pkt_offset is the offset of the first fragment within it.
+ if ((pkt_offset >= (pkt_pos + asf->packet_size)))
+ pkt_pos += asf->packet_size;
+ for (i = 0; i < asf->nb_streams; i++) {
+ ASFStream *st = asf->asf_st[i];
+
+ st_found = 0;
+ if (pkt.flags & AV_PKT_FLAG_KEY) {
+ dts = pkt.dts;
+ if (dts) {
+ av_add_index_entry(s->streams[pkt.stream_index], pkt_pos,
+ dts, pkt.size, 0, AVINDEX_KEYFRAME);
+ if (stream_index == st->index) {
+ st_found = 1;
+ break;
+ }
+ }
+ }
+ }
+ if (st_found)
+ break;
+ av_free_packet(&pkt);
+ }
+ *pos = pkt_pos;
+
+ av_free_packet(&pkt);
+ return dts;
+}
+
+static int asf_read_seek(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
+{
+ ASFContext *asf = s->priv_data;
+ int idx, ret;
+
+ if (s->streams[stream_index]->nb_index_entries && asf->is_simple_index) {
+ idx = av_index_search_timestamp(s->streams[stream_index], timestamp, flags);
+ if (idx < 0 || idx >= s->streams[stream_index]->nb_index_entries)
+ return AVERROR_INVALIDDATA;
+ avio_seek(s->pb, s->streams[stream_index]->index_entries[idx].pos, SEEK_SET);
+ } else {
+ if ((ret = ff_seek_frame_binary(s, stream_index, timestamp, flags)) < 0)
+ return ret;
+ }
+
+ reset_packet_state(s);
+
+ return 0;
+}
+
+static const GUIDParseTable *find_guid(ff_asf_guid guid)
+{
+ int j, ret;
+ const GUIDParseTable *g;
+
+ swap_guid(guid);
+ g = gdef;
+ for (j = 0; j < FF_ARRAY_ELEMS(gdef); j++) {
+ if (!(ret = memcmp(guid, g->guid, sizeof(g->guid))))
+ return g;
+ g++;
+ }
+
+ return NULL;
+}
+
+static int detect_unknown_subobject(AVFormatContext *s, int64_t offset, int64_t size)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ const GUIDParseTable *g = NULL;
+ ff_asf_guid guid;
+ int ret;
+
+ while (avio_tell(pb) <= offset + size) {
+ if (avio_tell(pb) == asf->offset)
+ break;
+ asf->offset = avio_tell(pb);
+ if ((ret = ff_get_guid(pb, &guid)) < 0)
+ return ret;
+ g = find_guid(guid);
+ if (g) {
+ if ((ret = g->read_object(s, g)) < 0)
+ return ret;
+ } else {
+ GUIDParseTable g2;
+
+ g2.name = "Unknown";
+ g2.is_subobject = 1;
+ asf_read_unknown(s, &g2);
+ }
+ }
+
+ return 0;
+}
+
+static int asf_read_header(AVFormatContext *s)
+{
+ ASFContext *asf = s->priv_data;
+ AVIOContext *pb = s->pb;
+ const GUIDParseTable *g = NULL;
+ ff_asf_guid guid;
+ int i, ret;
+ uint64_t size;
+
+ asf->preroll = 0;
+ asf->is_simple_index = 0;
+ ff_get_guid(pb, &guid);
+ if (ff_guidcmp(&guid, &ff_asf_header))
+ return AVERROR_INVALIDDATA;
+ avio_skip(pb, 8); // skip header object size
+ avio_skip(pb, 6); // skip number of header objects and 2 reserved bytes
+ asf->data_reached = 0;
+
+ /* 1 is here instead of pb->eof_reached because (when not streaming), Data are skipped
+ * for the first time,
+ * Index object is processed and got eof and then seeking back to the Data is performed.
+ */
+ while (1) {
+ // for the cases when object size is invalid
+ if (avio_tell(pb) == asf->offset)
+ break;
+ asf->offset = avio_tell(pb);
+ if ((ret = ff_get_guid(pb, &guid)) < 0) {
+ if (ret == AVERROR_EOF && asf->data_reached)
+ break;
+ else
+ goto failed;
+ }
+ g = find_guid(guid);
+ if (g) {
+ asf->unknown_offset = asf->offset;
+ asf->is_header = 1;
+ if ((ret = g->read_object(s, g)) < 0)
+ goto failed;
+ } else {
+ size = avio_rl64(pb);
+ align_position(pb, asf->offset, size);
+ }
+ if (asf->data_reached && (!pb->seekable || (asf->b_flags & ASF_FLAG_BROADCAST)))
+ break;
+ }
+
+ if (!asf->data_reached) {
+ av_log(s, AV_LOG_ERROR, "Data Object was not found.\n");
+ ret = AVERROR_INVALIDDATA;
+ goto failed;
+ }
+ if (pb->seekable)
+ avio_seek(pb, asf->first_packet_offset, SEEK_SET);
+
+ for (i = 0; i < asf->nb_streams; i++) {
+ const char *rfc1766 = asf->asf_sd[asf->asf_st[i]->lang_idx].langs;
+ AVStream *st = s->streams[asf->asf_st[i]->index];
+ set_language(s, rfc1766, &st->metadata);
+ }
+
+ for (i = 0; i < ASF_MAX_STREAMS; i++) {
+ AVStream *st = NULL;
+
+ st = find_stream(s, i);
+ if (st) {
+ av_dict_copy(&st->metadata, asf->asf_sd[i].asf_met, AV_DICT_IGNORE_SUFFIX);
+ if (asf->asf_sd[i].aspect_ratio.num > 0 && asf->asf_sd[i].aspect_ratio.den > 0) {
+ st->sample_aspect_ratio.num = asf->asf_sd[i].aspect_ratio.num;
+ st->sample_aspect_ratio.den = asf->asf_sd[i].aspect_ratio.den;
+ }
+ }
+ }
+
+ return 0;
+
+failed:
+ asf_read_close(s);
+ return ret;
+}
+
+AVInputFormat ff_asf_o_demuxer = {
+ .name = "asf_o",
+ .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
+ .priv_data_size = sizeof(ASFContext),
+ .read_probe = asf_probe,
+ .read_header = asf_read_header,
+ .read_packet = asf_read_packet,
+ .read_close = asf_read_close,
+ .read_timestamp = asf_read_timestamp,
+ .read_seek = asf_read_seek,
+ .flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/asfenc.c b/chromium/third_party/ffmpeg/libavformat/asfenc.c
index 015c731cec8..32b726bb293 100644
--- a/chromium/third_party/ffmpeg/libavformat/asfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/asfenc.c
@@ -183,6 +183,38 @@
#define DATA_HEADER_SIZE 50
+typedef struct ASFPayload {
+ uint8_t type;
+ uint16_t size;
+} ASFPayload;
+
+typedef struct ASFStream {
+ int num;
+ unsigned char seq;
+ /* use for reading */
+ AVPacket pkt;
+ int frag_offset;
+ int packet_obj_size;
+ int timestamp;
+ int64_t duration;
+ int skip_to_key;
+ int pkt_clean;
+
+ int ds_span; /* descrambling */
+ int ds_packet_size;
+ int ds_chunk_size;
+
+ int64_t packet_pos;
+
+ uint16_t stream_language_index;
+
+ int palette_changed;
+ uint32_t palette[256];
+
+ int payload_ext_ct;
+ ASFPayload payload[8];
+} ASFStream;
+
typedef struct ASFContext {
uint32_t seqno;
int is_streamed;
diff --git a/chromium/third_party/ffmpeg/libavformat/assdec.c b/chromium/third_party/ffmpeg/libavformat/assdec.c
index c62e76f0ddb..5423c03f146 100644
--- a/chromium/third_party/ffmpeg/libavformat/assdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/assdec.c
@@ -152,7 +152,7 @@ static int ass_read_header(AVFormatContext *s)
if (res < 0)
goto end;
- ff_subtitles_queue_finalize(&ass->q);
+ ff_subtitles_queue_finalize(s, &ass->q);
end:
av_bprint_finalize(&header, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/async.c b/chromium/third_party/ffmpeg/libavformat/async.c
new file mode 100644
index 00000000000..003212d5b6c
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/async.c
@@ -0,0 +1,560 @@
+/*
+ * Input async protocol.
+ * Copyright (c) 2015 Zhang Rui <bbcallen@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Based on libavformat/cache.c by Michael Niedermayer
+ */
+
+ /**
+ * @TODO
+ * support timeout
+ * support backward short seek
+ * support work with concatdec, hls
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/error.h"
+#include "libavutil/fifo.h"
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+#include "url.h"
+#include <stdint.h>
+#include <pthread.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#define BUFFER_CAPACITY (4 * 1024 * 1024)
+#define SHORT_SEEK_THRESHOLD (256 * 1024)
+
+typedef struct Context {
+ AVClass *class;
+ URLContext *inner;
+
+ int seek_request;
+ int64_t seek_pos;
+ int seek_whence;
+ int seek_completed;
+ int64_t seek_ret;
+
+ int io_error;
+ int io_eof_reached;
+
+ int64_t logical_pos;
+ int64_t logical_size;
+ AVFifoBuffer *fifo;
+
+ pthread_cond_t cond_wakeup_main;
+ pthread_cond_t cond_wakeup_background;
+ pthread_mutex_t mutex;
+ pthread_t async_buffer_thread;
+
+ int abort_request;
+ AVIOInterruptCB interrupt_callback;
+} Context;
+
+static int async_check_interrupt(void *arg)
+{
+ URLContext *h = arg;
+ Context *c = h->priv_data;
+
+ if (c->abort_request)
+ return 1;
+
+ if (ff_check_interrupt(&c->interrupt_callback))
+ c->abort_request = 1;
+
+ return c->abort_request;
+}
+
+static void *async_buffer_task(void *arg)
+{
+ URLContext *h = arg;
+ Context *c = h->priv_data;
+ AVFifoBuffer *fifo = c->fifo;
+ int ret = 0;
+ int64_t seek_ret;
+
+ while (1) {
+ int fifo_space, to_copy;
+
+ pthread_mutex_lock(&c->mutex);
+ if (async_check_interrupt(h)) {
+ c->io_eof_reached = 1;
+ c->io_error = AVERROR_EXIT;
+ pthread_cond_signal(&c->cond_wakeup_main);
+ pthread_mutex_unlock(&c->mutex);
+ break;
+ }
+
+ if (c->seek_request) {
+ seek_ret = ffurl_seek(c->inner, c->seek_pos, c->seek_whence);
+ if (seek_ret < 0) {
+ c->io_eof_reached = 1;
+ c->io_error = (int)seek_ret;
+ } else {
+ c->io_eof_reached = 0;
+ c->io_error = 0;
+ }
+
+ c->seek_completed = 1;
+ c->seek_ret = seek_ret;
+ c->seek_request = 0;
+
+ av_fifo_reset(fifo);
+
+ pthread_cond_signal(&c->cond_wakeup_main);
+ pthread_mutex_unlock(&c->mutex);
+ continue;
+ }
+
+ fifo_space = av_fifo_space(fifo);
+ if (c->io_eof_reached || fifo_space <= 0) {
+ pthread_cond_signal(&c->cond_wakeup_main);
+ pthread_cond_wait(&c->cond_wakeup_background, &c->mutex);
+ pthread_mutex_unlock(&c->mutex);
+ continue;
+ }
+ pthread_mutex_unlock(&c->mutex);
+
+ to_copy = FFMIN(4096, fifo_space);
+ ret = av_fifo_generic_write(fifo, c->inner, to_copy, (void *)ffurl_read);
+
+ pthread_mutex_lock(&c->mutex);
+ if (ret <= 0) {
+ c->io_eof_reached = 1;
+ if (ret < 0) {
+ c->io_error = ret;
+ }
+ }
+
+ pthread_cond_signal(&c->cond_wakeup_main);
+ pthread_mutex_unlock(&c->mutex);
+ }
+
+ return NULL;
+}
+
+static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
+{
+ Context *c = h->priv_data;
+ int ret;
+ AVIOInterruptCB interrupt_callback = {.callback = async_check_interrupt, .opaque = h};
+
+ av_strstart(arg, "async:", &arg);
+
+ c->fifo = av_fifo_alloc(BUFFER_CAPACITY);
+ if (!c->fifo) {
+ ret = AVERROR(ENOMEM);
+ goto fifo_fail;
+ }
+
+ /* wrap interrupt callback */
+ c->interrupt_callback = h->interrupt_callback;
+ ret = ffurl_open(&c->inner, arg, flags, &interrupt_callback, options);
+ if (ret != 0) {
+ av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", av_err2str(ret), arg);
+ goto url_fail;
+ }
+
+ c->logical_size = ffurl_size(c->inner);
+ h->is_streamed = c->inner->is_streamed;
+
+ ret = pthread_mutex_init(&c->mutex, NULL);
+ if (ret != 0) {
+ av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", av_err2str(ret));
+ goto mutex_fail;
+ }
+
+ ret = pthread_cond_init(&c->cond_wakeup_main, NULL);
+ if (ret != 0) {
+ av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
+ goto cond_wakeup_main_fail;
+ }
+
+ ret = pthread_cond_init(&c->cond_wakeup_background, NULL);
+ if (ret != 0) {
+ av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
+ goto cond_wakeup_background_fail;
+ }
+
+ ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h);
+ if (ret) {
+ av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", av_err2str(ret));
+ goto thread_fail;
+ }
+
+ return 0;
+
+thread_fail:
+ pthread_cond_destroy(&c->cond_wakeup_background);
+cond_wakeup_background_fail:
+ pthread_cond_destroy(&c->cond_wakeup_main);
+cond_wakeup_main_fail:
+ pthread_mutex_destroy(&c->mutex);
+mutex_fail:
+ ffurl_close(c->inner);
+url_fail:
+ av_fifo_freep(&c->fifo);
+fifo_fail:
+ return ret;
+}
+
+static int async_close(URLContext *h)
+{
+ Context *c = h->priv_data;
+ int ret;
+
+ pthread_mutex_lock(&c->mutex);
+ c->abort_request = 1;
+ pthread_cond_signal(&c->cond_wakeup_background);
+ pthread_mutex_unlock(&c->mutex);
+
+ ret = pthread_join(c->async_buffer_thread, NULL);
+ if (ret != 0)
+ av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", av_err2str(ret));
+
+ pthread_cond_destroy(&c->cond_wakeup_background);
+ pthread_cond_destroy(&c->cond_wakeup_main);
+ pthread_mutex_destroy(&c->mutex);
+ ffurl_close(c->inner);
+ av_fifo_freep(&c->fifo);
+
+ return 0;
+}
+
+static int async_read_internal(URLContext *h, void *dest, int size, int read_complete,
+ void (*func)(void*, void*, int))
+{
+ Context *c = h->priv_data;
+ AVFifoBuffer *fifo = c->fifo;
+ int to_read = size;
+ int ret = 0;
+
+ pthread_mutex_lock(&c->mutex);
+
+ while (to_read > 0) {
+ int fifo_size, to_copy;
+ if (async_check_interrupt(h)) {
+ ret = AVERROR_EXIT;
+ break;
+ }
+ fifo_size = av_fifo_size(fifo);
+ to_copy = FFMIN(to_read, fifo_size);
+ if (to_copy > 0) {
+ av_fifo_generic_read(fifo, dest, to_copy, func);
+ if (!func)
+ dest = (uint8_t *)dest + to_copy;
+ c->logical_pos += to_copy;
+ to_read -= to_copy;
+ ret = size - to_read;
+
+ if (to_read <= 0 || !read_complete)
+ break;
+ } else if (c->io_eof_reached) {
+ if (ret <= 0)
+ ret = AVERROR_EOF;
+ break;
+ }
+ pthread_cond_signal(&c->cond_wakeup_background);
+ pthread_cond_wait(&c->cond_wakeup_main, &c->mutex);
+ }
+
+ pthread_cond_signal(&c->cond_wakeup_background);
+ pthread_mutex_unlock(&c->mutex);
+
+ return ret;
+}
+
+static int async_read(URLContext *h, unsigned char *buf, int size)
+{
+ return async_read_internal(h, buf, size, 0, NULL);
+}
+
+static void fifo_do_not_copy_func(void* dest, void* src, int size) {
+ // do not copy
+}
+
+static int64_t async_seek(URLContext *h, int64_t pos, int whence)
+{
+ Context *c = h->priv_data;
+ AVFifoBuffer *fifo = c->fifo;
+ int64_t ret;
+ int64_t new_logical_pos;
+ int fifo_size;
+
+ if (whence == AVSEEK_SIZE) {
+ av_log(h, AV_LOG_TRACE, "async_seek: AVSEEK_SIZE: %"PRId64"\n", (int64_t)c->logical_size);
+ return c->logical_size;
+ } else if (whence == SEEK_CUR) {
+ av_log(h, AV_LOG_TRACE, "async_seek: %"PRId64"\n", pos);
+ new_logical_pos = pos + c->logical_pos;
+ } else if (whence == SEEK_SET){
+ av_log(h, AV_LOG_TRACE, "async_seek: %"PRId64"\n", pos);
+ new_logical_pos = pos;
+ } else {
+ return AVERROR(EINVAL);
+ }
+ if (new_logical_pos < 0)
+ return AVERROR(EINVAL);
+
+ fifo_size = av_fifo_size(fifo);
+ if (new_logical_pos == c->logical_pos) {
+ /* current position */
+ return c->logical_pos;
+ } else if ((new_logical_pos > c->logical_pos) &&
+ (new_logical_pos < (c->logical_pos + fifo_size + SHORT_SEEK_THRESHOLD))) {
+ /* fast seek */
+ av_log(h, AV_LOG_TRACE, "async_seek: fask_seek %"PRId64" from %d dist:%d/%d\n",
+ new_logical_pos, (int)c->logical_pos,
+ (int)(new_logical_pos - c->logical_pos), fifo_size);
+ async_read_internal(h, NULL, (int)(new_logical_pos - c->logical_pos), 1, fifo_do_not_copy_func);
+ return c->logical_pos;
+ } else if (c->logical_size <= 0) {
+ /* can not seek */
+ return AVERROR(EINVAL);
+ } else if (new_logical_pos > c->logical_size) {
+ /* beyond end */
+ return AVERROR(EINVAL);
+ }
+
+ pthread_mutex_lock(&c->mutex);
+
+ c->seek_request = 1;
+ c->seek_pos = new_logical_pos;
+ c->seek_whence = SEEK_SET;
+ c->seek_completed = 0;
+ c->seek_ret = 0;
+
+ while (1) {
+ if (async_check_interrupt(h)) {
+ ret = AVERROR_EXIT;
+ break;
+ }
+ if (c->seek_completed) {
+ if (c->seek_ret >= 0)
+ c->logical_pos = c->seek_ret;
+ ret = c->seek_ret;
+ break;
+ }
+ pthread_cond_signal(&c->cond_wakeup_background);
+ pthread_cond_wait(&c->cond_wakeup_main, &c->mutex);
+ }
+
+ pthread_mutex_unlock(&c->mutex);
+
+ return ret;
+}
+
+#define OFFSET(x) offsetof(Context, x)
+#define D AV_OPT_FLAG_DECODING_PARAM
+
+static const AVOption options[] = {
+ {NULL},
+};
+
+static const AVClass async_context_class = {
+ .class_name = "Async",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+URLProtocol ff_async_protocol = {
+ .name = "async",
+ .url_open2 = async_open,
+ .url_read = async_read,
+ .url_seek = async_seek,
+ .url_close = async_close,
+ .priv_data_size = sizeof(Context),
+ .priv_data_class = &async_context_class,
+};
+
+#ifdef TEST
+
+#define TEST_SEEK_POS (1536)
+#define TEST_STREAM_SIZE (2048)
+
+typedef struct TestContext {
+ AVClass *class;
+ int64_t logical_pos;
+ int64_t logical_size;
+} TestContext;
+
+static int async_test_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
+{
+ TestContext *c = h->priv_data;
+ c->logical_pos = 0;
+ c->logical_size = TEST_STREAM_SIZE;
+ return 0;
+}
+
+static int async_test_close(URLContext *h)
+{
+ return 0;
+}
+
+static int async_test_read(URLContext *h, unsigned char *buf, int size)
+{
+ TestContext *c = h->priv_data;
+ int i;
+ int read_len = 0;
+
+ if (c->logical_pos >= c->logical_size)
+ return AVERROR_EOF;
+
+ for (i = 0; i < size; ++i) {
+ buf[i] = c->logical_pos & 0xFF;
+
+ c->logical_pos++;
+ read_len++;
+
+ if (c->logical_pos >= c->logical_size)
+ break;
+ }
+
+ return read_len;
+}
+
+static int64_t async_test_seek(URLContext *h, int64_t pos, int whence)
+{
+ TestContext *c = h->priv_data;
+ int64_t new_logical_pos;
+
+ if (whence == AVSEEK_SIZE) {
+ return c->logical_size;
+ } else if (whence == SEEK_CUR) {
+ new_logical_pos = pos + c->logical_pos;
+ } else if (whence == SEEK_SET){
+ new_logical_pos = pos;
+ } else {
+ return AVERROR(EINVAL);
+ }
+ if (new_logical_pos < 0)
+ return AVERROR(EINVAL);
+
+ c->logical_pos = new_logical_pos;
+ return new_logical_pos;
+}
+
+static const AVClass async_test_context_class = {
+ .class_name = "Async-Test",
+ .item_name = av_default_item_name,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+URLProtocol ff_async_test_protocol = {
+ .name = "async-test",
+ .url_open2 = async_test_open,
+ .url_read = async_test_read,
+ .url_seek = async_test_seek,
+ .url_close = async_test_close,
+ .priv_data_size = sizeof(TestContext),
+ .priv_data_class = &async_test_context_class,
+};
+
+int main(void)
+{
+ URLContext *h = NULL;
+ int i;
+ int ret;
+ int64_t size;
+ int64_t pos;
+ int64_t read_len;
+ unsigned char buf[4096];
+
+ ffurl_register_protocol(&ff_async_protocol);
+ ffurl_register_protocol(&ff_async_test_protocol);
+
+ ret = ffurl_open(&h, "async:async-test:", AVIO_FLAG_READ, NULL, NULL);
+ printf("open: %d\n", ret);
+
+ size = ffurl_size(h);
+ printf("size: %"PRId64"\n", size);
+
+ pos = ffurl_seek(h, 0, SEEK_CUR);
+ read_len = 0;
+ while (1) {
+ ret = ffurl_read(h, buf, sizeof(buf));
+ if (ret == AVERROR_EOF) {
+ printf("read-error: AVERROR_EOF at %"PRId64"\n", ffurl_seek(h, 0, SEEK_CUR));
+ break;
+ }
+ else if (ret == 0)
+ break;
+ else if (ret < 0) {
+ printf("read-error: %d at %"PRId64"\n", ret, ffurl_seek(h, 0, SEEK_CUR));
+ goto fail;
+ } else {
+ for (i = 0; i < ret; ++i) {
+ if (buf[i] != (pos & 0xFF)) {
+ printf("read-mismatch: actual %d, expecting %d, at %"PRId64"\n",
+ (int)buf[i], (int)(pos & 0xFF), pos);
+ break;
+ }
+ pos++;
+ }
+ }
+
+ read_len += ret;
+ }
+ printf("read: %"PRId64"\n", read_len);
+
+ ret = ffurl_read(h, buf, 1);
+ printf("read: %d\n", ret);
+
+ pos = ffurl_seek(h, TEST_SEEK_POS, SEEK_SET);
+ printf("seek: %"PRId64"\n", pos);
+
+ read_len = 0;
+ while (1) {
+ ret = ffurl_read(h, buf, sizeof(buf));
+ if (ret == AVERROR_EOF)
+ break;
+ else if (ret == 0)
+ break;
+ else if (ret < 0) {
+ printf("read-error: %d at %"PRId64"\n", ret, ffurl_seek(h, 0, SEEK_CUR));
+ goto fail;
+ } else {
+ for (i = 0; i < ret; ++i) {
+ if (buf[i] != (pos & 0xFF)) {
+ printf("read-mismatch: actual %d, expecting %d, at %"PRId64"\n",
+ (int)buf[i], (int)(pos & 0xFF), pos);
+ break;
+ }
+ pos++;
+ }
+ }
+
+ read_len += ret;
+ }
+ printf("read: %"PRId64"\n", read_len);
+
+ ret = ffurl_read(h, buf, 1);
+ printf("read: %d\n", ret);
+
+fail:
+ ffurl_close(h);
+ return 0;
+}
+
+#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_flacdec.c b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_flacdec.c
index 4207fd2bf6c..4c1f9435810 100644
--- a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_flacdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_flacdec.c
@@ -58,7 +58,7 @@ static int flac_read_header(AVFormatContext *s)
case FLAC_METADATA_TYPE_CUESHEET:
case FLAC_METADATA_TYPE_PICTURE:
case FLAC_METADATA_TYPE_VORBIS_COMMENT:
- buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buffer = av_mallocz(metadata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buffer) {
return AVERROR(ENOMEM);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_options.c b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_options.c
index d238dd5ab70..9918349703a 100644
--- a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_options.c
+++ b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_options.c
@@ -20,6 +20,8 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
/**
@@ -27,7 +29,9 @@
* Options definition for AVFormatContext.
*/
+FF_DISABLE_DEPRECATION_WARNINGS
#include "options_table.h"
+FF_ENABLE_DEPRECATION_WARNINGS
static const char* format_to_name(void* ptr)
{
diff --git a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_utils.c b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_utils.c
index caa15abbaed..24eacf39675 100644
--- a/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_utils.c
+++ b/chromium/third_party/ffmpeg/libavformat/autorename_libavformat_utils.c
@@ -116,7 +116,10 @@ MAKE_ACCESSORS(AVFormatContext, format, AVOpenCallback, open_cb)
int64_t av_stream_get_end_pts(const AVStream *st)
{
- return st->pts.val;
+ if (st->priv_pts) {
+ return st->priv_pts->val;
+ } else
+ return AV_NOPTS_VALUE;
}
struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
@@ -1262,12 +1265,6 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) {
out_pkt.buf = pkt->buf;
pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- out_pkt.destruct = pkt->destruct;
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
if ((ret = av_dup_packet(&out_pkt)) < 0)
goto fail;
@@ -1585,26 +1582,26 @@ int av_find_default_stream_index(AVFormatContext *s)
int i;
AVStream *st;
int best_stream = 0;
- int best_score = -1;
+ int best_score = INT_MIN;
if (s->nb_streams <= 0)
return -1;
for (i = 0; i < s->nb_streams; i++) {
int score = 0;
st = s->streams[i];
- if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
- !(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
- if (!st->codec->width && !st->codec->height && !st->codec_info_nb_frames)
- score += 25;
- else
- score += 100;
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+ score -= 400;
+ if (st->codec->width && st->codec->height)
+ score += 50;
+ score+= 25;
}
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- if (!st->codec->sample_rate && !st->codec_info_nb_frames)
- score += 12;
- else
+ if (st->codec->sample_rate)
score += 50;
}
+ if (st->codec_info_nb_frames)
+ score += 12;
if (st->discard != AVDISCARD_ALL)
score += 200;
@@ -1781,6 +1778,63 @@ int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
return m;
}
+void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance)
+{
+ int ist1, ist2;
+ int64_t pos_delta = 0;
+ int64_t skip = 0;
+ //We could use URLProtocol flags here but as many user applications do not use URLProtocols this would be unreliable
+ const char *proto = avio_find_protocol_name(s->filename);
+
+ if (!proto) {
+ av_log(s, AV_LOG_INFO,
+ "Protocol name not provided, cannot determine if input is local or "
+ "a network protocol, buffers and access patterns cannot be configured "
+ "optimally without knowing the protocol\n");
+ }
+
+ if (proto && !(strcmp(proto, "file") && strcmp(proto, "pipe") && strcmp(proto, "cache")))
+ return;
+
+ for (ist1 = 0; ist1 < s->nb_streams; ist1++) {
+ AVStream *st1 = s->streams[ist1];
+ for (ist2 = 0; ist2 < s->nb_streams; ist2++) {
+ AVStream *st2 = s->streams[ist2];
+ int i1, i2;
+
+ if (ist1 == ist2)
+ continue;
+
+ for (i1 = i2 = 0; i1 < st1->nb_index_entries; i1++) {
+ AVIndexEntry *e1 = &st1->index_entries[i1];
+ int64_t e1_pts = av_rescale_q(e1->timestamp, st1->time_base, AV_TIME_BASE_Q);
+
+ skip = FFMAX(skip, e1->size);
+ for (; i2 < st2->nb_index_entries; i2++) {
+ AVIndexEntry *e2 = &st2->index_entries[i2];
+ int64_t e2_pts = av_rescale_q(e2->timestamp, st2->time_base, AV_TIME_BASE_Q);
+ if (e2_pts - e1_pts < time_tolerance)
+ continue;
+ pos_delta = FFMAX(pos_delta, e1->pos - e2->pos);
+ break;
+ }
+ }
+ }
+ }
+
+ pos_delta *= 2;
+ /* XXX This could be adjusted depending on protocol*/
+ if (s->pb->buffer_size < pos_delta && pos_delta < (1<<24)) {
+ av_log(s, AV_LOG_VERBOSE, "Reconfiguring buffers to size %"PRId64"\n", pos_delta);
+ ffio_set_buf_size(s->pb, pos_delta);
+ s->pb->short_seek_threshold = FFMAX(s->pb->short_seek_threshold, pos_delta/2);
+ }
+
+ if (skip < (1<<23)) {
+ s->pb->short_seek_threshold = FFMAX(s->pb->short_seek_threshold, skip);
+ }
+}
+
int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags)
{
return ff_index_search_timestamp(st->index_entries, st->nb_index_entries,
@@ -2665,7 +2719,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
ret >= 0 &&
(!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) ||
(!st->codec_info_nb_frames &&
- st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) {
+ (st->codec->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)))) {
got_picture = 0;
switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
@@ -2865,14 +2919,14 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
{
int ret;
- if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (size < 0 || size >= INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
avctx->extradata = NULL;
avctx->extradata_size = 0;
return AVERROR(EINVAL);
}
- avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (avctx->extradata) {
- memset(avctx->extradata + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(avctx->extradata + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
avctx->extradata_size = size;
ret = 0;
} else {
@@ -3031,9 +3085,18 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
// new streams might appear, no options for those
int orig_nb_streams = ic->nb_streams;
int flush_codecs;
+#if FF_API_PROBESIZE_32
int64_t max_analyze_duration = ic->max_analyze_duration2;
+#else
+ int64_t max_analyze_duration = ic->max_analyze_duration;
+#endif
int64_t max_stream_analyze_duration;
+ int64_t max_subtitle_analyze_duration;
+#if FF_API_PROBESIZE_32
int64_t probesize = ic->probesize2;
+#else
+ int64_t probesize = ic->probesize;
+#endif
if (!max_analyze_duration)
max_analyze_duration = ic->max_analyze_duration;
@@ -3044,11 +3107,13 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
av_opt_set(ic, "skip_clear", "1", AV_OPT_SEARCH_CHILDREN);
max_stream_analyze_duration = max_analyze_duration;
+ max_subtitle_analyze_duration = max_analyze_duration;
if (!max_analyze_duration) {
max_stream_analyze_duration =
max_analyze_duration = 5*AV_TIME_BASE;
+ max_subtitle_analyze_duration = 30*AV_TIME_BASE;
if (!strcmp(ic->iformat->name, "flv"))
- max_stream_analyze_duration = 30*AV_TIME_BASE;
+ max_stream_analyze_duration = 90*AV_TIME_BASE;
}
if (ic->pb)
@@ -3264,6 +3329,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
if (st->codec_info_nb_frames>1) {
int64_t t = 0;
+ int64_t limit;
if (st->time_base.den > 0)
t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);
@@ -3276,10 +3342,14 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
&& st->info->fps_last_dts != AV_NOPTS_VALUE)
t = FFMAX(t, av_rescale_q(st->info->fps_last_dts - st->info->fps_first_dts, st->time_base, AV_TIME_BASE_Q));
- if (t >= (analyzed_all_streams ? max_analyze_duration : max_stream_analyze_duration)) {
- av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %"PRId64" reached at %"PRId64" microseconds\n",
- max_analyze_duration,
- t);
+ if (analyzed_all_streams) limit = max_analyze_duration;
+ else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) limit = max_subtitle_analyze_duration;
+ else limit = max_stream_analyze_duration;
+
+ if (t >= limit) {
+ av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %"PRId64" reached at %"PRId64" microseconds st:%d\n",
+ limit,
+ t, pkt->stream_index);
if (ic->flags & AVFMT_FLAG_NOBUFFER)
av_packet_unref(pkt);
break;
@@ -3308,7 +3378,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
* it takes longer and uses more memory. For MPEG-4, we need to
* decompress for QuickTime.
*
- * If CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
+ * If AV_CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
* least one frame of codec data, this makes sure the codec initializes
* the channel configuration and does not only trust the values from
* the container. */
@@ -3603,6 +3673,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
av_freep(&st->info->duration_error);
av_freep(&st->info);
av_freep(&st->recommended_encoder_configuration);
+ av_freep(&st->priv_pts);
av_freep(&s->streams[ --s->nb_streams ]);
}
@@ -4235,8 +4306,9 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
if (*spec <= '9' && *spec >= '0') /* opt:index */
return strtol(spec, NULL, 0) == st->index;
else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
- *spec == 't') { /* opt:[vasdt] */
+ *spec == 't' || *spec == 'V') { /* opt:[vasdtV] */
enum AVMediaType type;
+ int nopic = 0;
switch (*spec++) {
case 'v': type = AVMEDIA_TYPE_VIDEO; break;
@@ -4244,15 +4316,20 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
case 's': type = AVMEDIA_TYPE_SUBTITLE; break;
case 'd': type = AVMEDIA_TYPE_DATA; break;
case 't': type = AVMEDIA_TYPE_ATTACHMENT; break;
+ case 'V': type = AVMEDIA_TYPE_VIDEO; nopic = 1; break;
default: av_assert0(0);
}
if (type != st->codec->codec_type)
return 0;
+ if (nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC))
+ return 0;
if (*spec++ == ':') { /* possibly followed by :index */
int i, index = strtol(spec, NULL, 0);
for (i = 0; i < s->nb_streams; i++)
- if (s->streams[i]->codec->codec_type == type && index-- == 0)
- return i == st->index;
+ if (s->streams[i]->codec->codec_type == type &&
+ !(nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC)) &&
+ index-- == 0)
+ return i == st->index;
return 0;
}
return 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/avc.c b/chromium/third_party/ffmpeg/libavformat/avc.c
index 9d843e0ca4b..f7b8f38a00a 100644
--- a/chromium/third_party/ffmpeg/libavformat/avc.c
+++ b/chromium/third_party/ffmpeg/libavformat/avc.c
@@ -180,7 +180,7 @@ int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size)
if (11 + sps_size + pps_size > *size)
return AVERROR_INVALIDDATA;
out_size = 8 + sps_size + pps_size;
- out = av_mallocz(out_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ out = av_mallocz(out_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!out)
return AVERROR(ENOMEM);
AV_WB32(&out[0], 0x00000001);
diff --git a/chromium/third_party/ffmpeg/libavformat/avformat.h b/chromium/third_party/ffmpeg/libavformat/avformat.h
index fb69852f458..b7f18c16143 100644
--- a/chromium/third_party/ffmpeg/libavformat/avformat.h
+++ b/chromium/third_party/ffmpeg/libavformat/avformat.h
@@ -478,12 +478,7 @@ typedef struct AVProbeData {
#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */
#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */
#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
-#if LIBAVFORMAT_VERSION_MAJOR <= 54
-#define AVFMT_TS_NONSTRICT 0x8020000 //we try to be compatible to the ABIs of ffmpeg and major forks
-#else
-#define AVFMT_TS_NONSTRICT 0x20000
-#endif
- /**< Format does not require strictly
+#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
increasing timestamps, but they must
still be monotonic */
#define AVFMT_TS_NEGATIVE 0x40000 /**< Format allows muxing negative
@@ -1015,7 +1010,6 @@ typedef struct AVStream {
/**
* Number of packets to buffer for codec probing
*/
-#define MAX_PROBE_PACKETS 2500
int probe_packets;
/**
@@ -1171,6 +1165,8 @@ typedef struct AVStream {
* - decoding: Set by libavformat to calculate sample_aspect_ratio internally
*/
AVRational display_aspect_ratio;
+
+ struct FFFrac *priv_pts;
} AVStream;
AVRational av_stream_get_r_frame_rate(const AVStream *s);
@@ -1395,6 +1391,7 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate.
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
+#if FF_API_PROBESIZE_32
/**
* @deprecated deprecated in favor of probesize2
*/
@@ -1405,6 +1402,7 @@ typedef struct AVFormatContext {
*/
attribute_deprecated
int max_analyze_duration;
+#endif
const uint8_t *key;
int keylen;
@@ -1757,7 +1755,11 @@ typedef struct AVFormatContext {
* via AVOptions (NO direct access).
* Can be set to 0 to let avformat choose using a heuristic.
*/
+#if FF_API_PROBESIZE_32
int64_t max_analyze_duration2;
+#else
+ int64_t max_analyze_duration;
+#endif
/**
* Maximum size of the data read from input for determining
@@ -1765,7 +1767,11 @@ typedef struct AVFormatContext {
* Demuxing only, set by the caller before avformat_open_input()
* via AVOptions (NO direct access).
*/
+#if FF_API_PROBESIZE_32
int64_t probesize2;
+#else
+ int64_t probesize;
+#endif
/**
* dump format separator.
diff --git a/chromium/third_party/ffmpeg/libavformat/avidec.c b/chromium/third_party/ffmpeg/libavformat/avidec.c
index 5348b44b741..30b949770e6 100644
--- a/chromium/third_party/ffmpeg/libavformat/avidec.c
+++ b/chromium/third_party/ffmpeg/libavformat/avidec.c
@@ -823,7 +823,7 @@ static int avi_read_header(AVFormatContext *s)
st->codec->extradata_size += 9;
if ((ret = av_reallocp(&st->codec->extradata,
st->codec->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
+ AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
st->codec->extradata_size = 0;
return ret;
} else
@@ -835,7 +835,7 @@ static int avi_read_header(AVFormatContext *s)
// avio_skip(pb, size - 5 * 4);
break;
case AVMEDIA_TYPE_AUDIO:
- ret = ff_get_wav_header(pb, st->codec, size, 0);
+ ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0)
return ret;
ast->dshow_block_align = st->codec->block_align;
@@ -861,6 +861,9 @@ static int avi_read_header(AVFormatContext *s)
if (st->codec->codec_id == AV_CODEC_ID_AAC &&
st->codec->extradata_size)
st->need_parsing = AVSTREAM_PARSE_NONE;
+ // The flac parser does not work with AVSTREAM_PARSE_TIMESTAMPS
+ if (st->codec->codec_id == AV_CODEC_ID_FLAC)
+ st->need_parsing = AVSTREAM_PARSE_NONE;
/* AVI files with Xan DPCM audio (wrongly) declare PCM
* audio in the header but have Axan as stream_code_tag. */
if (ast->handler == AV_RL32("Axan")) {
@@ -872,8 +875,9 @@ static int avi_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_AMV;
ast->dshow_block_align = 0;
}
- if (st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align <= 4 && ast->dshow_block_align ||
- st->codec->codec_id == AV_CODEC_ID_MP2 && ast->dshow_block_align <= 4 && ast->dshow_block_align) {
+ if ((st->codec->codec_id == AV_CODEC_ID_AAC ||
+ st->codec->codec_id == AV_CODEC_ID_FLAC ||
+ st->codec->codec_id == AV_CODEC_ID_MP2 ) && ast->dshow_block_align <= 4 && ast->dshow_block_align) {
av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
ast->dshow_block_align = 0;
}
@@ -1304,9 +1308,6 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int err;
-#if FF_API_DESTRUCT_PACKET
- void *dstr;
-#endif
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
@@ -1423,18 +1424,8 @@ resync:
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
AVBufferRef *avbuf = pkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- dstr = pkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
pkt->data, pkt->size, pkt->pos);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dstr;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = avbuf;
pkt->flags |= AV_PKT_FLAG_KEY;
if (size < 0)
@@ -1681,9 +1672,13 @@ static int guess_ni_flag(AVFormatContext *s)
if (n >= 2) {
int64_t pos = st->index_entries[0].pos;
- avio_seek(s->pb, pos + 4, SEEK_SET);
+ unsigned tag[2];
+ avio_seek(s->pb, pos, SEEK_SET);
+ tag[0] = avio_r8(s->pb);
+ tag[1] = avio_r8(s->pb);
+ avio_rl16(s->pb);
size = avio_rl32(s->pb);
- if (pos + size > st->index_entries[1].pos)
+ if (get_stream_idx(tag) == i && pos + size > st->index_entries[1].pos)
last_start = INT64_MAX;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/avienc.c b/chromium/third_party/ffmpeg/libavformat/avienc.c
index e5609d998c3..649961d11cf 100644
--- a/chromium/third_party/ffmpeg/libavformat/avienc.c
+++ b/chromium/third_party/ffmpeg/libavformat/avienc.c
@@ -29,10 +29,12 @@
#include "mpegts.h"
#include "libavformat/avlanguage.h"
#include "libavutil/avstring.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavutil/avassert.h"
#include "libavutil/timestamp.h"
+#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/raw.h"
@@ -57,9 +59,11 @@ typedef struct AVIIndex {
} AVIIndex;
typedef struct AVIContext {
+ const AVClass *class;
int64_t riff_start, movi_list, odml_list;
int64_t frames_hdr_all;
int riff_id;
+ int write_channel_mask;
} AVIContext;
typedef struct AVIStream {
@@ -338,7 +342,7 @@ static int avi_write_header(AVFormatContext *s)
ff_end_tag(pb, strh);
if (enc->codec_type != AVMEDIA_TYPE_DATA) {
- int ret;
+ int ret, flags;
enum AVPixelFormat pix_fmt;
strf = ff_start_tag(pb, "strf");
@@ -366,7 +370,8 @@ static int avi_write_header(AVFormatContext *s)
av_get_pix_fmt_name(enc->pix_fmt));
break;
case AVMEDIA_TYPE_AUDIO:
- if ((ret = ff_put_wav_header(pb, enc, 0)) < 0)
+ flags = (avi->write_channel_mask == 0) ? FF_PUT_WAV_HEADER_SKIP_CHANNELMASK : 0;
+ if ((ret = ff_put_wav_header(pb, enc, flags)) < 0)
return ret;
break;
default:
@@ -618,7 +623,7 @@ static int write_skip_frames(AVFormatContext *s, int stream_index, int64_t dts)
AVIStream *avist = s->streams[stream_index]->priv_data;
AVCodecContext *enc = s->streams[stream_index]->codec;
- av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(dts), avist->packet_count, stream_index);
+ ff_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(dts), avist->packet_count, stream_index);
while (enc->block_align == 0 && dts != AV_NOPTS_VALUE &&
dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count) {
AVPacket empty_packet;
@@ -633,7 +638,7 @@ static int write_skip_frames(AVFormatContext *s, int stream_index, int64_t dts)
empty_packet.data = NULL;
empty_packet.stream_index = stream_index;
avi_write_packet(s, &empty_packet);
- av_dlog(s, "dup dts:%s packet_count:%d\n", av_ts2str(dts), avist->packet_count);
+ ff_dlog(s, "dup dts:%s packet_count:%d\n", av_ts2str(dts), avist->packet_count);
}
return 0;
@@ -781,6 +786,20 @@ static int avi_write_trailer(AVFormatContext *s)
return res;
}
+#define OFFSET(x) offsetof(AVIContext, x)
+#define ENC AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "write_channel_mask", "write channel mask into wave format header", OFFSET(write_channel_mask), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, ENC },
+ { NULL },
+};
+
+static const AVClass avi_muxer_class = {
+ .class_name = "AVI muxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVOutputFormat ff_avi_muxer = {
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
@@ -795,4 +814,5 @@ AVOutputFormat ff_avi_muxer = {
.codec_tag = (const AVCodecTag * const []) {
ff_codec_bmp_tags, ff_codec_wav_tags, 0
},
+ .priv_class = &avi_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/avio.c b/chromium/third_party/ffmpeg/libavformat/avio.c
index deeb87f9ecb..21713d9d5e6 100644
--- a/chromium/third_party/ffmpeg/libavformat/avio.c
+++ b/chromium/third_party/ffmpeg/libavformat/avio.c
@@ -211,6 +211,26 @@ int ffurl_connect(URLContext *uc, AVDictionary **options)
return 0;
}
+int ffurl_accept(URLContext *s, URLContext **c)
+{
+ av_assert0(!*c);
+ if (s->prot->url_accept)
+ return s->prot->url_accept(s, c);
+ return AVERROR(EBADF);
+}
+
+int ffurl_handshake(URLContext *c)
+{
+ int ret;
+ if (c->prot->url_handshake) {
+ ret = c->prot->url_handshake(c);
+ if (ret)
+ return ret;
+ }
+ c->is_connected = 1;
+ return 0;
+}
+
#define URL_SCHEME_CHARS \
"abcdefghijklmnopqrstuvwxyz" \
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
@@ -263,7 +283,7 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
*puc = NULL;
if (av_strstart(filename, "https:", NULL))
- av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile with "
+ av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile FFmpeg with "
"openssl, gnutls,\n"
"or securetransport enabled.\n");
return AVERROR_PROTOCOL_NOT_FOUND;
@@ -421,6 +441,44 @@ int avio_check(const char *url, int flags)
return ret;
}
+int avpriv_io_move(const char *url_src, const char *url_dst)
+{
+ URLContext *h_src, *h_dst;
+ int ret = ffurl_alloc(&h_src, url_src, AVIO_FLAG_READ_WRITE, NULL);
+ if (ret < 0)
+ return ret;
+ ret = ffurl_alloc(&h_dst, url_dst, AVIO_FLAG_WRITE, NULL);
+ if (ret < 0) {
+ ffurl_close(h_src);
+ return ret;
+ }
+
+ if (h_src->prot == h_dst->prot && h_src->prot->url_move)
+ ret = h_src->prot->url_move(h_src, h_dst);
+ else
+ ret = AVERROR(ENOSYS);
+
+ ffurl_close(h_src);
+ ffurl_close(h_dst);
+ return ret;
+}
+
+int avpriv_io_delete(const char *url)
+{
+ URLContext *h;
+ int ret = ffurl_alloc(&h, url, AVIO_FLAG_WRITE, NULL);
+ if (ret < 0)
+ return ret;
+
+ if (h->prot->url_delete)
+ ret = h->prot->url_delete(h);
+ else
+ ret = AVERROR(ENOSYS);
+
+ ffurl_close(h);
+ return ret;
+}
+
int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
{
URLContext *h = NULL;
@@ -447,6 +505,7 @@ int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
if (ret < 0)
goto fail;
+ h->is_connected = 1;
ctx->url_context = h;
*s = ctx;
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/avio.h b/chromium/third_party/ffmpeg/libavformat/avio.h
index 9f3a992307e..06dd7f5ef8e 100644
--- a/chromium/third_party/ffmpeg/libavformat/avio.h
+++ b/chromium/third_party/ffmpeg/libavformat/avio.h
@@ -230,6 +230,25 @@ const char *avio_find_protocol_name(const char *url);
int avio_check(const char *url, int flags);
/**
+ * Move or rename a resource.
+ *
+ * @note url_src and url_dst should share the same protocol and authority.
+ *
+ * @param url_src url to resource to be moved
+ * @param url_dst new url to resource if the operation succeeded
+ * @return >=0 on success or negative on error.
+ */
+int avpriv_io_move(const char *url_src, const char *url_dst);
+
+/**
+ * Delete a resource.
+ *
+ * @param url resource to be deleted.
+ * @return >=0 on success or negative on error.
+ */
+int avpriv_io_delete(const char *url);
+
+/**
* Open directory for reading.
*
* @param s directory read context. Pointer to a NULL pointer must be passed.
@@ -566,7 +585,7 @@ int avio_open_dyn_buf(AVIOContext **s);
/**
* Return the written size and a pointer to the buffer. The buffer
* must be freed with av_free().
- * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+ * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
*
* @param s IO context
* @param pbuffer pointer to a byte buffer
@@ -629,4 +648,33 @@ struct AVBPrint;
*/
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size);
+/**
+ * Accept and allocate a client context on a server context.
+ * @param s the server context
+ * @param c the client context, must be unallocated
+ * @return >= 0 on success or a negative value corresponding
+ * to an AVERROR on failure
+ */
+int avio_accept(AVIOContext *s, AVIOContext **c);
+
+/**
+ * Perform one step of the protocol handshake to accept a new client.
+ * This function must be called on a client returned by avio_accept() before
+ * using it as a read/write context.
+ * It is separate from avio_accept() because it may block.
+ * A step of the handshake is defined by places where the application may
+ * decide to change the proceedings.
+ * For example, on a protocol with a request header and a reply header, each
+ * one can constitute a step because the application may use the parameters
+ * from the request to change parameters in the reply; or each individual
+ * chunk of the request can constitute a step.
+ * If the handshake is already finished, avio_handshake() does nothing and
+ * returns 0 immediately.
+ *
+ * @param c the client context to perform the handshake on
+ * @return 0 on a complete and successful handshake
+ * > 0 if the handshake progressed, but is not complete
+ * < 0 for an AVERROR code
+ */
+int avio_handshake(AVIOContext *c);
#endif /* AVFORMAT_AVIO_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/aviobuf.c b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
index ff850813e67..1b3d5f5b80c 100644
--- a/chromium/third_party/ffmpeg/libavformat/aviobuf.c
+++ b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
@@ -1021,6 +1021,23 @@ int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size)
return 0;
}
+int avio_accept(AVIOContext *s, AVIOContext **c)
+{
+ int ret;
+ URLContext *sc = s->opaque;
+ URLContext *cc = NULL;
+ ret = ffurl_accept(sc, &cc);
+ if (ret < 0)
+ return ret;
+ return ffio_fdopen(c, cc);
+}
+
+int avio_handshake(AVIOContext *c)
+{
+ URLContext *cc = c->opaque;
+ return ffurl_handshake(cc);
+}
+
/* output in a dynamic buffer */
typedef struct DynBuffer {
@@ -1130,7 +1147,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{
DynBuffer *d;
int size;
- static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};
+ static const char padbuf[AV_INPUT_BUFFER_PADDING_SIZE] = {0};
int padding = 0;
if (!s) {
@@ -1141,7 +1158,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
/* don't attempt to pad fixed-size packet buffers */
if (!s->max_packet_size) {
avio_write(s, padbuf, sizeof(padbuf));
- padding = FF_INPUT_BUFFER_PADDING_SIZE;
+ padding = AV_INPUT_BUFFER_PADDING_SIZE;
}
avio_flush(s);
diff --git a/chromium/third_party/ffmpeg/libavformat/avisynth.c b/chromium/third_party/ffmpeg/libavformat/avisynth.c
index 7dc5ee7df62..45641c0fc1d 100644
--- a/chromium/third_party/ffmpeg/libavformat/avisynth.c
+++ b/chromium/third_party/ffmpeg/libavformat/avisynth.c
@@ -237,13 +237,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->codec->width = avs->vi->width;
st->codec->height = avs->vi->height;
- st->time_base = (AVRational) { avs->vi->fps_denominator,
- avs->vi->fps_numerator };
st->avg_frame_rate = (AVRational) { avs->vi->fps_numerator,
avs->vi->fps_denominator };
st->start_time = 0;
st->duration = avs->vi->num_frames;
st->nb_frames = avs->vi->num_frames;
+ avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator);
switch (avs->vi->pixel_type) {
#ifdef USING_AVISYNTH
@@ -311,9 +310,8 @@ static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->sample_rate = avs->vi->audio_samples_per_second;
st->codec->channels = avs->vi->nchannels;
- st->time_base = (AVRational) { 1,
- avs->vi->audio_samples_per_second };
st->duration = avs->vi->num_audio_samples;
+ avpriv_set_pts_info(st, 64, 1, avs->vi->audio_samples_per_second);
switch (avs->vi->sample_type) {
case AVS_SAMPLE_INT8:
diff --git a/chromium/third_party/ffmpeg/libavformat/brstm.c b/chromium/third_party/ffmpeg/libavformat/brstm.c
index 1eba943e51c..f2bc0388402 100644
--- a/chromium/third_party/ffmpeg/libavformat/brstm.c
+++ b/chromium/third_party/ffmpeg/libavformat/brstm.c
@@ -30,9 +30,12 @@ typedef struct BRSTMDemuxContext {
uint32_t current_block;
uint32_t samples_per_block;
uint32_t last_block_used_bytes;
+ uint32_t last_block_size;
+ uint32_t last_block_samples;
+ uint32_t data_start;
uint8_t *table;
uint8_t *adpc;
- int bfstm;
+ int little_endian;
} BRSTMDemuxContext;
static int probe(AVProbeData *p)
@@ -46,7 +49,8 @@ static int probe(AVProbeData *p)
static int probe_bfstm(AVProbeData *p)
{
- if (AV_RL32(p->buf) == MKTAG('F','S','T','M') &&
+ if ((AV_RL32(p->buf) == MKTAG('F','S','T','M') ||
+ AV_RL32(p->buf) == MKTAG('C','S','T','M')) &&
(AV_RL16(p->buf + 4) == 0xFFFE ||
AV_RL16(p->buf + 4) == 0xFEFF))
return AVPROBE_SCORE_MAX / 3 * 2;
@@ -63,16 +67,34 @@ static int read_close(AVFormatContext *s)
return 0;
}
+static av_always_inline unsigned int read16(AVFormatContext *s)
+{
+ BRSTMDemuxContext *b = s->priv_data;
+ if (b->little_endian)
+ return avio_rl16(s->pb);
+ else
+ return avio_rb16(s->pb);
+}
+
+static av_always_inline unsigned int read32(AVFormatContext *s)
+{
+ BRSTMDemuxContext *b = s->priv_data;
+ if (b->little_endian)
+ return avio_rl32(s->pb);
+ else
+ return avio_rb32(s->pb);
+}
+
static int read_header(AVFormatContext *s)
{
BRSTMDemuxContext *b = s->priv_data;
int bom, major, minor, codec, chunk;
- int64_t h1offset, pos, toffset, data_offset = 0;
- uint32_t size, start, asize;
+ int64_t h1offset, pos, toffset;
+ uint32_t size, asize, start = 0;
AVStream *st;
int ret = AVERROR_EOF;
-
- b->bfstm = !strcmp("bfstm", s->iformat->name);
+ int loop = 0;
+ int bfstm = !strcmp("bfstm", s->iformat->name);
st = avformat_new_stream(s, NULL);
if (!st)
@@ -86,16 +108,15 @@ static int read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "invalid byte order: %X\n", bom);
return AVERROR_INVALIDDATA;
}
- if (bom == 0xFFFE) {
- avpriv_request_sample(s, "little endian byte order");
- return AVERROR_PATCHWELCOME;
- }
- if (!b->bfstm) {
+ if (bom == 0xFFFE)
+ b->little_endian = 1;
+
+ if (!bfstm) {
major = avio_r8(s->pb);
minor = avio_r8(s->pb);
avio_skip(s->pb, 4); // size of file
- size = avio_rb16(s->pb);
+ size = read16(s);
if (size < 14)
return AVERROR_INVALIDDATA;
@@ -104,59 +125,58 @@ static int read_header(AVFormatContext *s)
if (avio_rl32(s->pb) != MKTAG('H','E','A','D'))
return AVERROR_INVALIDDATA;
} else {
- uint32_t info_offset = 0, info_size;
+ uint32_t info_offset = 0;
uint16_t section_count, header_size, i;
- header_size = avio_rb16(s->pb); // 6
+ header_size = read16(s); // 6
avio_skip(s->pb, 4); // Unknown constant 0x00030000
avio_skip(s->pb, 4); // size of file
- section_count = avio_rb16(s->pb);
+ section_count = read16(s);
avio_skip(s->pb, 2); // padding
for (i = 0; avio_tell(s->pb) < header_size
- && !(data_offset && info_offset)
+ && !(start && info_offset)
&& i < section_count; i++) {
- uint32_t flag = avio_rb32(s->pb);
+ uint16_t flag = read16(s);
+ avio_skip(s->pb, 2);
switch (flag) {
- case 0x40000000:
- info_offset = avio_rb32(s->pb);
- info_size = avio_rb32(s->pb);
+ case 0x4000:
+ info_offset = read32(s);
+ /*info_size =*/ read32(s);
break;
- case 0x40010000:
+ case 0x4001:
avio_skip(s->pb, 4); // seek offset
avio_skip(s->pb, 4); // seek size
break;
- case 0x40020000:
- data_offset = avio_rb32(s->pb);
- avio_skip(s->pb, 4); //data_size = avio_rb32(s->pb);
+ case 0x4002:
+ start = read32(s) + 8;
+ avio_skip(s->pb, 4); //data_size = read32(s);
break;
- case 0x40030000:
+ case 0x4003:
avio_skip(s->pb, 4); // REGN offset
avio_skip(s->pb, 4); // REGN size
break;
}
}
- if (!info_offset || !data_offset)
+ if (!info_offset || !start)
return AVERROR_INVALIDDATA;
- start = data_offset + 8;
-
avio_skip(s->pb, info_offset - avio_tell(s->pb));
pos = avio_tell(s->pb);
if (avio_rl32(s->pb) != MKTAG('I','N','F','O'))
return AVERROR_INVALIDDATA;
}
- size = avio_rb32(s->pb);
+ size = read32(s);
if (size < 192)
return AVERROR_INVALIDDATA;
avio_skip(s->pb, 4); // unknown
- h1offset = avio_rb32(s->pb);
+ h1offset = read32(s);
if (h1offset > size)
return AVERROR_INVALIDDATA;
avio_skip(s->pb, 12);
- toffset = avio_rb32(s->pb) + 16LL;
+ toffset = read32(s) + 16LL;
if (toffset > size)
return AVERROR_INVALIDDATA;
@@ -165,65 +185,77 @@ static int read_header(AVFormatContext *s)
switch (codec) {
case 0: codec = AV_CODEC_ID_PCM_S8_PLANAR; break;
- case 1: codec = AV_CODEC_ID_PCM_S16BE_PLANAR; break;
- case 2: codec = AV_CODEC_ID_ADPCM_THP; break;
+ case 1: codec = b->little_endian ?
+ AV_CODEC_ID_PCM_S16LE_PLANAR :
+ AV_CODEC_ID_PCM_S16BE_PLANAR; break;
+ case 2: codec = b->little_endian ?
+ AV_CODEC_ID_ADPCM_THP_LE :
+ AV_CODEC_ID_ADPCM_THP; break;
default:
avpriv_request_sample(s, "codec %d", codec);
return AVERROR_PATCHWELCOME;
}
- avio_skip(s->pb, 1); // loop flag
+ loop = avio_r8(s->pb); // loop flag
st->codec->codec_id = codec;
st->codec->channels = avio_r8(s->pb);
if (!st->codec->channels)
return AVERROR_INVALIDDATA;
avio_skip(s->pb, 1); // padding
- if (b->bfstm)
- avio_skip(s->pb, 2); // padding
- st->codec->sample_rate = avio_rb16(s->pb);
+ st->codec->sample_rate = bfstm ? read32(s) : read16(s);
if (!st->codec->sample_rate)
return AVERROR_INVALIDDATA;
- if (!b->bfstm)
+ if (!bfstm)
avio_skip(s->pb, 2); // padding
- avio_skip(s->pb, 4); // loop start sample
+
+ if (loop) {
+ if (av_dict_set_int(&s->metadata, "loop_start",
+ av_rescale(read32(s), AV_TIME_BASE,
+ st->codec->sample_rate),
+ 0) < 0)
+ return AVERROR(ENOMEM);
+ } else {
+ avio_skip(s->pb, 4);
+ }
+
st->start_time = 0;
- st->duration = avio_rb32(s->pb);
+ st->duration = read32(s);
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
- if (!b->bfstm)
- start = avio_rb32(s->pb);
+ if (!bfstm)
+ start = read32(s);
b->current_block = 0;
- b->block_count = avio_rb32(s->pb);
+ b->block_count = read32(s);
if (b->block_count > UINT16_MAX) {
av_log(s, AV_LOG_WARNING, "too many blocks: %u\n", b->block_count);
return AVERROR_INVALIDDATA;
}
- b->block_size = avio_rb32(s->pb);
- if (b->block_size > UINT16_MAX / st->codec->channels)
+ b->block_size = read32(s);
+ if (b->block_size > UINT32_MAX / st->codec->channels)
return AVERROR_INVALIDDATA;
- b->block_size *= st->codec->channels;
- b->samples_per_block = avio_rb32(s->pb);
- b->last_block_used_bytes = avio_rb32(s->pb);
- if (b->last_block_used_bytes > UINT16_MAX / st->codec->channels)
+ b->samples_per_block = read32(s);
+ b->last_block_used_bytes = read32(s);
+ b->last_block_samples = read32(s);
+ b->last_block_size = read32(s);
+ if (b->last_block_size > UINT32_MAX / st->codec->channels)
+ return AVERROR_INVALIDDATA;
+ if (b->last_block_used_bytes > b->last_block_size)
return AVERROR_INVALIDDATA;
- b->last_block_used_bytes *= st->codec->channels;
- avio_skip(s->pb, 4); // last block samples
- avio_skip(s->pb, 4); // last block size
- if (codec == AV_CODEC_ID_ADPCM_THP) {
+ if (codec == AV_CODEC_ID_ADPCM_THP || codec == AV_CODEC_ID_ADPCM_THP_LE) {
int ch;
avio_skip(s->pb, pos + toffset - avio_tell(s->pb));
- if (!b->bfstm)
- toffset = avio_rb32(s->pb) + 16LL;
+ if (!bfstm)
+ toffset = read32(s) + 16LL;
else
- toffset = toffset + avio_rb32(s->pb) + st->codec->channels * 8 - 8;
+ toffset = toffset + read32(s) + st->codec->channels * 8 - 8;
if (toffset > size)
return AVERROR_INVALIDDATA;
@@ -237,15 +269,7 @@ static int read_header(AVFormatContext *s)
ret = AVERROR_INVALIDDATA;
goto fail;
}
- avio_skip(s->pb, b->bfstm ? 14 : 24);
- }
-
- if (b->bfstm) {
- st->codec->extradata_size = 32 * st->codec->channels;
- st->codec->extradata = av_malloc(st->codec->extradata_size);
- if (!st->codec->extradata)
- return AVERROR(ENOMEM);
- memcpy(st->codec->extradata, b->table, st->codec->extradata_size);
+ avio_skip(s->pb, bfstm ? 14 : 24);
}
}
@@ -254,22 +278,21 @@ static int read_header(AVFormatContext *s)
goto fail;
}
- if (!b->bfstm)
- avio_skip(s->pb, size - (avio_tell(s->pb) - pos));
- else
- avio_skip(s->pb, data_offset - avio_tell(s->pb));
+ avio_skip(s->pb, size - (avio_tell(s->pb) - pos));
while (!avio_feof(s->pb)) {
chunk = avio_rl32(s->pb);
- size = avio_rb32(s->pb);
+ size = read32(s);
if (size < 8) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
size -= 8;
switch (chunk) {
+ case MKTAG('S','E','E','K'):
case MKTAG('A','D','P','C'):
- if (codec != AV_CODEC_ID_ADPCM_THP)
+ if (codec != AV_CODEC_ID_ADPCM_THP &&
+ codec != AV_CODEC_ID_ADPCM_THP_LE)
goto skip;
asize = b->block_count * st->codec->channels * 4;
@@ -286,19 +309,36 @@ static int read_header(AVFormatContext *s)
ret = AVERROR(ENOMEM);
goto fail;
}
- avio_read(s->pb, b->adpc, asize);
+ if (bfstm && codec != AV_CODEC_ID_ADPCM_THP_LE) {
+ // Big-endian BFSTMs have little-endian SEEK tables
+ // for some strange reason.
+ int i;
+ for (i = 0; i < asize; i += 2) {
+ b->adpc[i+1] = avio_r8(s->pb);
+ b->adpc[i] = avio_r8(s->pb);
+ }
+ } else {
+ avio_read(s->pb, b->adpc, asize);
+ }
avio_skip(s->pb, size - asize);
}
break;
case MKTAG('D','A','T','A'):
if ((start < avio_tell(s->pb)) ||
- (!b->adpc && codec == AV_CODEC_ID_ADPCM_THP && !b->bfstm)) {
+ (!b->adpc && (codec == AV_CODEC_ID_ADPCM_THP ||
+ codec == AV_CODEC_ID_ADPCM_THP_LE))) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
avio_skip(s->pb, start - avio_tell(s->pb));
- if ((major != 1 || minor) && !b->bfstm)
+ if (bfstm && (codec == AV_CODEC_ID_ADPCM_THP ||
+ codec == AV_CODEC_ID_ADPCM_THP_LE))
+ avio_skip(s->pb, 24);
+
+ b->data_start = avio_tell(s->pb);
+
+ if (!bfstm && (major != 1 || minor))
avpriv_request_sample(s, "Version %d.%d", major, minor);
return 0;
@@ -319,15 +359,25 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *codec = s->streams[0]->codec;
BRSTMDemuxContext *b = s->priv_data;
- uint32_t samples, size;
- int ret;
+ uint32_t samples, size, skip = 0;
+ int ret, i;
if (avio_feof(s->pb))
return AVERROR_EOF;
b->current_block++;
if (b->current_block == b->block_count) {
size = b->last_block_used_bytes;
- samples = size / (8 * codec->channels) * 14;
+ samples = b->last_block_samples;
+ skip = b->last_block_size - b->last_block_used_bytes;
+
+ if (samples < size * 14 / 8) {
+ uint32_t adjusted_size = samples / 14 * 8;
+ if (samples % 14)
+ adjusted_size += (samples % 14 + 1) / 2 + 1;
+
+ skip += size - adjusted_size;
+ size = adjusted_size;
+ }
} else if (b->current_block < b->block_count) {
size = b->block_size;
samples = b->samples_per_block;
@@ -335,23 +385,36 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF;
}
- if (codec->codec_id == AV_CODEC_ID_ADPCM_THP && !codec->extradata) {
+ if (codec->codec_id == AV_CODEC_ID_ADPCM_THP ||
+ codec->codec_id == AV_CODEC_ID_ADPCM_THP_LE) {
uint8_t *dst;
- if (av_new_packet(pkt, 8 + (32 + 4) * codec->channels + size) < 0)
+ if (av_new_packet(pkt, 8 + (32 + 4 + size) * codec->channels) < 0)
return AVERROR(ENOMEM);
dst = pkt->data;
- bytestream_put_be32(&dst, size);
- bytestream_put_be32(&dst, samples);
+ if (codec->codec_id == AV_CODEC_ID_ADPCM_THP_LE) {
+ bytestream_put_le32(&dst, size * codec->channels);
+ bytestream_put_le32(&dst, samples);
+ } else {
+ bytestream_put_be32(&dst, size * codec->channels);
+ bytestream_put_be32(&dst, samples);
+ }
bytestream_put_buffer(&dst, b->table, 32 * codec->channels);
bytestream_put_buffer(&dst, b->adpc + 4 * codec->channels *
(b->current_block - 1), 4 * codec->channels);
- ret = avio_read(s->pb, dst, size);
- if (ret != size)
- av_free_packet(pkt);
+ for (i = 0; i < codec->channels; i++) {
+ ret = avio_read(s->pb, dst, size);
+ dst += size;
+ avio_skip(s->pb, skip);
+ if (ret != size) {
+ av_free_packet(pkt);
+ break;
+ }
+ }
pkt->duration = samples;
} else {
+ size *= codec->channels;
ret = av_get_packet(s->pb, pkt, size);
}
@@ -363,6 +426,24 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
+static int read_seek(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
+{
+ AVStream *st = s->streams[stream_index];
+ BRSTMDemuxContext *b = s->priv_data;
+ int64_t ret = 0;
+
+ timestamp /= b->samples_per_block;
+ ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size *
+ st->codec->channels, SEEK_SET);
+ if (ret < 0)
+ return ret;
+
+ b->current_block = timestamp;
+ ff_update_cur_dts(s, st, timestamp * b->samples_per_block);
+ return 0;
+}
+
AVInputFormat ff_brstm_demuxer = {
.name = "brstm",
.long_name = NULL_IF_CONFIG_SMALL("BRSTM (Binary Revolution Stream)"),
@@ -371,6 +452,7 @@ AVInputFormat ff_brstm_demuxer = {
.read_header = read_header,
.read_packet = read_packet,
.read_close = read_close,
+ .read_seek = read_seek,
.extensions = "brstm",
};
@@ -382,5 +464,6 @@ AVInputFormat ff_bfstm_demuxer = {
.read_header = read_header,
.read_packet = read_packet,
.read_close = read_close,
- .extensions = "bfstm",
+ .read_seek = read_seek,
+ .extensions = "bfstm,bcstm",
};
diff --git a/chromium/third_party/ffmpeg/libavformat/caf.c b/chromium/third_party/ffmpeg/libavformat/caf.c
index c1ecc94425e..00854615ca3 100644
--- a/chromium/third_party/ffmpeg/libavformat/caf.c
+++ b/chromium/third_party/ffmpeg/libavformat/caf.c
@@ -61,6 +61,18 @@ const AVCodecTag ff_codec_caf_tags[] = {
/*{ MPEG4CELP MKTAG('c','e','l','p') },*/
/*{ MPEG4HVXC MKTAG('h','v','x','c') },*/
/*{ MPEG4TwinVQ MKTAG('t','w','v','q') },*/
+
+ { AV_CODEC_ID_PCM_S8, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S16LE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S16BE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S24LE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S24BE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S32LE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_S32BE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_F32LE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_F32BE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_F64LE, MKTAG('l','p','c','m') },
+ { AV_CODEC_ID_PCM_F64BE, MKTAG('l','p','c','m') },
{ AV_CODEC_ID_NONE, 0 },
};
diff --git a/chromium/third_party/ffmpeg/libavformat/cafdec.c b/chromium/third_party/ffmpeg/libavformat/cafdec.c
index cc6ed0ce9f6..bfbbb02627a 100644
--- a/chromium/third_party/ffmpeg/libavformat/cafdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/cafdec.c
@@ -101,7 +101,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
AVIOContext *pb = s->pb;
AVStream *st = s->streams[0];
- if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
+ if (size < 0 || size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
return -1;
if (st->codec->codec_id == AV_CODEC_ID_AAC) {
diff --git a/chromium/third_party/ffmpeg/libavformat/cafenc.c b/chromium/third_party/ffmpeg/libavformat/cafenc.c
index 1708275e11f..544bc4a114f 100644
--- a/chromium/third_party/ffmpeg/libavformat/cafenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/cafenc.c
@@ -120,21 +120,6 @@ static int caf_write_header(AVFormatContext *s)
return AVERROR_PATCHWELCOME;
}
- switch (enc->codec_id) {
- case AV_CODEC_ID_PCM_S8:
- case AV_CODEC_ID_PCM_S16LE:
- case AV_CODEC_ID_PCM_S16BE:
- case AV_CODEC_ID_PCM_S24LE:
- case AV_CODEC_ID_PCM_S24BE:
- case AV_CODEC_ID_PCM_S32LE:
- case AV_CODEC_ID_PCM_S32BE:
- case AV_CODEC_ID_PCM_F32LE:
- case AV_CODEC_ID_PCM_F32BE:
- case AV_CODEC_ID_PCM_F64LE:
- case AV_CODEC_ID_PCM_F64BE:
- codec_tag = MKTAG('l','p','c','m');
- }
-
if (!codec_tag) {
av_log(s, AV_LOG_ERROR, "unsupported codec\n");
return AVERROR_INVALIDDATA;
diff --git a/chromium/third_party/ffmpeg/libavformat/concatdec.c b/chromium/third_party/ffmpeg/libavformat/concatdec.c
index 07db9f96a39..88b6dbe6a44 100644
--- a/chromium/third_party/ffmpeg/libavformat/concatdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/concatdec.c
@@ -41,8 +41,13 @@ typedef struct ConcatStream {
typedef struct {
char *url;
int64_t start_time;
+ int64_t file_start_time;
+ int64_t file_inpoint;
int64_t duration;
ConcatStream *streams;
+ int64_t inpoint;
+ int64_t outpoint;
+ AVDictionary *metadata;
int nb_streams;
} ConcatFile;
@@ -54,6 +59,7 @@ typedef struct {
AVFormatContext *avf;
int safe;
int seekable;
+ int eof;
ConcatMatchMode stream_match_mode;
unsigned auto_convert;
} ConcatContext;
@@ -142,6 +148,8 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
file->url = url;
file->start_time = AV_NOPTS_VALUE;
file->duration = AV_NOPTS_VALUE;
+ file->inpoint = AV_NOPTS_VALUE;
+ file->outpoint = AV_NOPTS_VALUE;
return 0;
@@ -172,6 +180,8 @@ static int copy_stream_props(AVStream *st, AVStream *source_st)
st->avg_frame_rate = source_st->avg_frame_rate;
st->time_base = source_st->time_base;
st->sample_aspect_ratio = source_st->sample_aspect_ratio;
+
+ av_dict_copy(&st->metadata, source_st->metadata, 0);
return 0;
}
@@ -304,8 +314,14 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
file->start_time = !fileno ? 0 :
cat->files[fileno - 1].start_time +
cat->files[fileno - 1].duration;
+ file->file_start_time = (avf->start_time == AV_NOPTS_VALUE) ? 0 : avf->start_time;
+ file->file_inpoint = (file->inpoint == AV_NOPTS_VALUE) ? file->file_start_time : file->inpoint;
if ((ret = match_streams(avf)) < 0)
return ret;
+ if (file->inpoint != AV_NOPTS_VALUE) {
+ if ((ret = avformat_seek_file(cat->avf, -1, INT64_MIN, file->inpoint, file->inpoint, 0)) < 0)
+ return ret;
+ }
return 0;
}
@@ -319,6 +335,7 @@ static int concat_read_close(AVFormatContext *avf)
for (i = 0; i < cat->nb_files; i++) {
av_freep(&cat->files[i].url);
av_freep(&cat->files[i].streams);
+ av_dict_free(&cat->files[i].metadata);
}
av_freep(&cat->files);
return 0;
@@ -351,20 +368,43 @@ static int concat_read_header(AVFormatContext *avf)
}
if ((ret = add_file(avf, filename, &file, &nb_files_alloc)) < 0)
goto fail;
- } else if (!strcmp(keyword, "duration")) {
+ } else if (!strcmp(keyword, "duration") || !strcmp(keyword, "inpoint") || !strcmp(keyword, "outpoint")) {
char *dur_str = get_keyword(&cursor);
int64_t dur;
if (!file) {
- av_log(avf, AV_LOG_ERROR, "Line %d: duration without file\n",
- line);
+ av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
+ line, keyword);
FAIL(AVERROR_INVALIDDATA);
}
if ((ret = av_parse_time(&dur, dur_str, 1)) < 0) {
- av_log(avf, AV_LOG_ERROR, "Line %d: invalid duration '%s'\n",
- line, dur_str);
+ av_log(avf, AV_LOG_ERROR, "Line %d: invalid %s '%s'\n",
+ line, keyword, dur_str);
goto fail;
}
- file->duration = dur;
+ if (!strcmp(keyword, "duration"))
+ file->duration = dur;
+ else if (!strcmp(keyword, "inpoint"))
+ file->inpoint = dur;
+ else if (!strcmp(keyword, "outpoint"))
+ file->outpoint = dur;
+ } else if (!strcmp(keyword, "file_packet_metadata")) {
+ char *metadata;
+ metadata = av_get_token((const char **)&cursor, SPACE_CHARS);
+ if (!metadata) {
+ av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line);
+ FAIL(AVERROR_INVALIDDATA);
+ }
+ if (!file) {
+ av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
+ line, keyword);
+ FAIL(AVERROR_INVALIDDATA);
+ }
+ if ((ret = av_dict_parse_string(&file->metadata, metadata, "=", "", 0)) < 0) {
+ av_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata string\n", line);
+ av_freep(&metadata);
+ FAIL(AVERROR_INVALIDDATA);
+ }
+ av_freep(&metadata);
} else if (!strcmp(keyword, "stream")) {
if (!avformat_new_stream(avf, NULL))
FAIL(AVERROR(ENOMEM));
@@ -401,8 +441,11 @@ static int concat_read_header(AVFormatContext *avf)
cat->files[i].start_time = time;
else
time = cat->files[i].start_time;
- if (cat->files[i].duration == AV_NOPTS_VALUE)
- break;
+ if (cat->files[i].duration == AV_NOPTS_VALUE) {
+ if (cat->files[i].inpoint == AV_NOPTS_VALUE || cat->files[i].outpoint == AV_NOPTS_VALUE)
+ break;
+ cat->files[i].duration = cat->files[i].outpoint - cat->files[i].inpoint;
+ }
time += cat->files[i].duration;
}
if (i == cat->nb_files) {
@@ -426,11 +469,18 @@ static int open_next_file(AVFormatContext *avf)
ConcatContext *cat = avf->priv_data;
unsigned fileno = cat->cur_file - cat->files;
- if (cat->cur_file->duration == AV_NOPTS_VALUE)
+ if (cat->cur_file->duration == AV_NOPTS_VALUE) {
cat->cur_file->duration = cat->avf->duration;
+ if (cat->cur_file->inpoint != AV_NOPTS_VALUE)
+ cat->cur_file->duration -= (cat->cur_file->inpoint - cat->cur_file->file_start_time);
+ if (cat->cur_file->outpoint != AV_NOPTS_VALUE)
+ cat->cur_file->duration -= cat->avf->duration - (cat->cur_file->outpoint - cat->cur_file->file_start_time);
+ }
- if (++fileno >= cat->nb_files)
+ if (++fileno >= cat->nb_files) {
+ cat->eof = 1;
return AVERROR_EOF;
+ }
return open_file(avf, fileno);
}
@@ -474,20 +524,35 @@ static int filter_packet(AVFormatContext *avf, ConcatStream *cs, AVPacket *pkt)
return 0;
}
+/* Returns true if the packet dts is greater or equal to the specified outpoint. */
+static int packet_after_outpoint(ConcatContext *cat, AVPacket *pkt)
+{
+ if (cat->cur_file->outpoint != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE) {
+ return av_compare_ts(pkt->dts, cat->avf->streams[pkt->stream_index]->time_base,
+ cat->cur_file->outpoint, AV_TIME_BASE_Q) >= 0;
+ }
+ return 0;
+}
+
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
{
ConcatContext *cat = avf->priv_data;
int ret;
- int64_t file_start_time, delta;
+ int64_t delta;
ConcatStream *cs;
AVStream *st;
+ if (cat->eof)
+ return AVERROR_EOF;
+
if (!cat->avf)
return AVERROR(EIO);
while (1) {
ret = av_read_frame(cat->avf, pkt);
- if (ret == AVERROR_EOF) {
+ if (ret == AVERROR_EOF || packet_after_outpoint(cat, pkt)) {
+ if (ret == 0)
+ av_packet_unref(pkt);
if ((ret = open_next_file(avf)) < 0)
return ret;
continue;
@@ -515,10 +580,7 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
- file_start_time = cat->avf->start_time;
- if (file_start_time == AV_NOPTS_VALUE)
- file_start_time = 0;
- delta = av_rescale_q(cat->cur_file->start_time - file_start_time,
+ delta = av_rescale_q(cat->cur_file->start_time - cat->cur_file->file_inpoint,
AV_TIME_BASE_Q,
cat->avf->streams[pkt->stream_index]->time_base);
if (pkt->pts != AV_NOPTS_VALUE)
@@ -528,6 +590,19 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
av_log(avf, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n",
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base));
+ if (cat->cur_file->metadata) {
+ uint8_t* metadata;
+ int metadata_len;
+ char* packed_metadata = av_packet_pack_dictionary(cat->cur_file->metadata, &metadata_len);
+ if (!packed_metadata)
+ return AVERROR(ENOMEM);
+ if (!(metadata = av_packet_new_side_data(pkt, AV_PKT_DATA_STRINGS_METADATA, metadata_len))) {
+ av_freep(&packed_metadata);
+ return AVERROR(ENOMEM);
+ }
+ memcpy(metadata, packed_metadata, metadata_len);
+ av_freep(&packed_metadata);
+ }
return ret;
}
@@ -545,7 +620,7 @@ static int try_seek(AVFormatContext *avf, int stream,
int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
{
ConcatContext *cat = avf->priv_data;
- int64_t t0 = cat->cur_file->start_time - cat->avf->start_time;
+ int64_t t0 = cat->cur_file->start_time - cat->cur_file->file_inpoint;
ts -= t0;
min_ts = min_ts == INT64_MIN ? INT64_MIN : min_ts - t0;
@@ -616,6 +691,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
cat->cur_file = cur_file_saved;
} else {
avformat_close_input(&cur_avf_saved);
+ cat->eof = 0;
}
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/dnxhddec.c b/chromium/third_party/ffmpeg/libavformat/dnxhddec.c
index 910e6b6684e..37e52d54c27 100644
--- a/chromium/third_party/ffmpeg/libavformat/dnxhddec.c
+++ b/chromium/third_party/ffmpeg/libavformat/dnxhddec.c
@@ -37,7 +37,7 @@ static int dnxhd_probe(AVProbeData *p)
if (!w || !h)
return 0;
compression_id = AV_RB32(p->buf + 0x28);
- if (compression_id < 1235 || compression_id > 1258)
+ if (compression_id < 1235 || compression_id > 1260)
return 0;
return AVPROBE_SCORE_MAX;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/dtsdec.c b/chromium/third_party/ffmpeg/libavformat/dtsdec.c
index da0fb61a60a..ef283916e79 100644
--- a/chromium/third_party/ffmpeg/libavformat/dtsdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/dtsdec.c
@@ -34,7 +34,7 @@ static int dts_probe(AVProbeData *p)
int markers[4*16] = {0};
int sum, max, i;
int64_t diff = 0;
- uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
+ uint8_t hdr[12 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
buf = p->buf + FFMIN(4096, p->buf_size);
diff --git a/chromium/third_party/ffmpeg/libavformat/dump.c b/chromium/third_party/ffmpeg/libavformat/dump.c
index 6355b99f416..705da821489 100644
--- a/chromium/third_party/ffmpeg/libavformat/dump.c
+++ b/chromium/third_party/ffmpeg/libavformat/dump.c
@@ -377,6 +377,9 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
av_log(ctx, AV_LOG_INFO, "audio service type: ");
dump_audioservicetype(ctx, &sd);
break;
+ case AV_PKT_DATA_QUALITY_STATS:
+ av_log(ctx, AV_LOG_INFO, "quality factor: %d, pict_type: %c", AV_RL32(sd.data), av_get_picture_type_char(sd.data[4]));
+ break;
default:
av_log(ctx, AV_LOG_WARNING,
"unknown side data type %d (%d bytes)", sd.type, sd.size);
@@ -420,8 +423,8 @@ static void dump_stream_format(AVFormatContext *ic, int i,
av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
AVRational display_aspect_ratio;
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
- st->codec->width * st->sample_aspect_ratio.num,
- st->codec->height * st->sample_aspect_ratio.den,
+ st->codec->width * (int64_t)st->sample_aspect_ratio.num,
+ st->codec->height * (int64_t)st->sample_aspect_ratio.den,
1024 * 1024);
av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
@@ -509,7 +512,7 @@ void av_dump_format(AVFormatContext *ic, int index,
int secs, us;
av_log(NULL, AV_LOG_INFO, ", start: ");
secs = ic->start_time / AV_TIME_BASE;
- us = abs(ic->start_time % AV_TIME_BASE);
+ us = llabs(ic->start_time % AV_TIME_BASE);
av_log(NULL, AV_LOG_INFO, "%d.%06d",
secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
}
diff --git a/chromium/third_party/ffmpeg/libavformat/dv.c b/chromium/third_party/ffmpeg/libavformat/dv.c
index 85002289640..84c306114b6 100644
--- a/chromium/third_party/ffmpeg/libavformat/dv.c
+++ b/chromium/third_party/ffmpeg/libavformat/dv.c
@@ -553,12 +553,17 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
size = avpriv_dv_get_packet(c->dv_demux, pkt);
if (size < 0) {
+ int ret;
int64_t pos = avio_tell(s->pb);
if (!c->dv_demux->sys)
return AVERROR(EIO);
size = c->dv_demux->sys->frame_size;
- if (avio_read(s->pb, c->buf, size) <= 0)
+ ret = avio_read(s->pb, c->buf, size);
+ if (ret < 0) {
+ return ret;
+ } else if (ret == 0) {
return AVERROR(EIO);
+ }
size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/dxa.c b/chromium/third_party/ffmpeg/libavformat/dxa.c
index 44033563f8a..228e6fdca1a 100644
--- a/chromium/third_party/ffmpeg/libavformat/dxa.c
+++ b/chromium/third_party/ffmpeg/libavformat/dxa.c
@@ -106,7 +106,7 @@ static int dxa_read_header(AVFormatContext *s)
ast = avformat_new_stream(s, NULL);
if (!ast)
return AVERROR(ENOMEM);
- ret = ff_get_wav_header(pb, ast->codec, fsize, 0);
+ ret = ff_get_wav_header(s, pb, ast->codec, fsize, 0);
if (ret < 0)
return ret;
if (ast->codec->sample_rate > 0)
diff --git a/chromium/third_party/ffmpeg/libavformat/electronicarts.c b/chromium/third_party/ffmpeg/libavformat/electronicarts.c
index d6a396b1ef5..5d21d49c455 100644
--- a/chromium/third_party/ffmpeg/libavformat/electronicarts.c
+++ b/chromium/third_party/ffmpeg/libavformat/electronicarts.c
@@ -59,17 +59,25 @@
#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
#define MV0K_TAG MKTAG('M', 'V', '0', 'K')
#define MV0F_TAG MKTAG('M', 'V', '0', 'F')
+#define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
+#define AV0K_TAG MKTAG('A', 'V', '0', 'K')
+#define AV0F_TAG MKTAG('A', 'V', '0', 'F')
#define MVIh_TAG MKTAG('M', 'V', 'I', 'h') /* CMV header */
#define MVIf_TAG MKTAG('M', 'V', 'I', 'f') /* CMV I-frame */
+#define AVP6_TAG MKTAG('A', 'V', 'P', '6')
-typedef struct EaDemuxContext {
- int big_endian;
-
- enum AVCodecID video_codec;
+typedef struct VideoProperties {
+ enum AVCodecID codec;
AVRational time_base;
int width, height;
int nb_frames;
- int video_stream_index;
+ int stream_index;
+} VideoProperties;
+
+typedef struct EaDemuxContext {
+ int big_endian;
+
+ VideoProperties video, alpha;
enum AVCodecID audio_codec;
int audio_stream_index;
@@ -301,46 +309,43 @@ static void process_audio_header_sead(AVFormatContext *s)
ea->audio_codec = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
}
-static void process_video_header_mdec(AVFormatContext *s)
+static void process_video_header_mdec(AVFormatContext *s, VideoProperties *video)
{
- EaDemuxContext *ea = s->priv_data;
AVIOContext *pb = s->pb;
avio_skip(pb, 4);
- ea->width = avio_rl16(pb);
- ea->height = avio_rl16(pb);
- ea->time_base = (AVRational) { 1, 15 };
- ea->video_codec = AV_CODEC_ID_MDEC;
+ video->width = avio_rl16(pb);
+ video->height = avio_rl16(pb);
+ video->time_base = (AVRational) { 1, 15 };
+ video->codec = AV_CODEC_ID_MDEC;
}
-static int process_video_header_vp6(AVFormatContext *s)
+static int process_video_header_vp6(AVFormatContext *s, VideoProperties *video)
{
- EaDemuxContext *ea = s->priv_data;
- AVIOContext *pb = s->pb;
+ AVIOContext *pb = s->pb;
avio_skip(pb, 8);
- ea->nb_frames = avio_rl32(pb);
+ video->nb_frames = avio_rl32(pb);
avio_skip(pb, 4);
- ea->time_base.den = avio_rl32(pb);
- ea->time_base.num = avio_rl32(pb);
- if (ea->time_base.den <= 0 || ea->time_base.num <= 0) {
+ video->time_base.den = avio_rl32(pb);
+ video->time_base.num = avio_rl32(pb);
+ if (video->time_base.den <= 0 || video->time_base.num <= 0) {
av_log(s, AV_LOG_ERROR, "Timebase is invalid\n");
return AVERROR_INVALIDDATA;
}
- ea->video_codec = AV_CODEC_ID_VP6;
+ video->codec = AV_CODEC_ID_VP6;
return 1;
}
-static void process_video_header_cmv(AVFormatContext *s)
+static void process_video_header_cmv(AVFormatContext *s, VideoProperties *video)
{
- EaDemuxContext *ea = s->priv_data;
int fps;
avio_skip(s->pb, 10);
fps = avio_rl16(s->pb);
if (fps)
- ea->time_base = (AVRational) { 1, fps };
- ea->video_codec = AV_CODEC_ID_CMV;
+ video->time_base = (AVRational) { 1, fps };
+ video->codec = AV_CODEC_ID_CMV;
}
/* Process EA file header.
@@ -352,7 +357,7 @@ static int process_ea_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
int i;
- for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
+ for (i = 0; i < 5 && (!ea->audio_codec || !ea->video.codec); i++) {
uint64_t startpos = avio_tell(pb);
int err = 0;
@@ -394,40 +399,44 @@ static int process_ea_header(AVFormatContext *s)
break;
case MVIh_TAG:
- process_video_header_cmv(s);
+ process_video_header_cmv(s, &ea->video);
break;
case kVGT_TAG:
- ea->video_codec = AV_CODEC_ID_TGV;
+ ea->video.codec = AV_CODEC_ID_TGV;
break;
case mTCD_TAG:
- process_video_header_mdec(s);
+ process_video_header_mdec(s, &ea->video);
break;
case MPCh_TAG:
- ea->video_codec = AV_CODEC_ID_MPEG2VIDEO;
+ ea->video.codec = AV_CODEC_ID_MPEG2VIDEO;
break;
case pQGT_TAG:
case TGQs_TAG:
- ea->video_codec = AV_CODEC_ID_TGQ;
- ea->time_base = (AVRational) { 1, 15 };
+ ea->video.codec = AV_CODEC_ID_TGQ;
+ ea->video.time_base = (AVRational) { 1, 15 };
break;
case pIQT_TAG:
- ea->video_codec = AV_CODEC_ID_TQI;
- ea->time_base = (AVRational) { 1, 15 };
+ ea->video.codec = AV_CODEC_ID_TQI;
+ ea->video.time_base = (AVRational) { 1, 15 };
break;
case MADk_TAG:
- ea->video_codec = AV_CODEC_ID_MAD;
+ ea->video.codec = AV_CODEC_ID_MAD;
avio_skip(pb, 6);
- ea->time_base = (AVRational) { avio_rl16(pb), 1000 };
+ ea->video.time_base = (AVRational) { avio_rl16(pb), 1000 };
break;
case MVhd_TAG:
- err = process_video_header_vp6(s);
+ err = process_video_header_vp6(s, &ea->video);
+ break;
+
+ case AVhd_TAG:
+ err = process_video_header_vp6(s, &ea->alpha);
break;
}
@@ -458,6 +467,7 @@ static int ea_probe(AVProbeData *p)
case MPCh_TAG:
case MVhd_TAG:
case MVIh_TAG:
+ case AVP6_TAG:
break;
default:
return 0;
@@ -472,6 +482,34 @@ static int ea_probe(AVProbeData *p)
return AVPROBE_SCORE_MAX;
}
+static int init_video_stream(AVFormatContext *s, VideoProperties *video)
+{
+ AVStream *st;
+
+ if (!video->codec)
+ return 0;
+
+ /* initialize the video decoder stream */
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+ video->stream_index = st->index;
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codec->codec_id = video->codec;
+ // parsing is necessary to make FFmpeg generate correct timestamps
+ if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO)
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
+ st->codec->codec_tag = 0; /* no fourcc */
+ st->codec->width = video->width;
+ st->codec->height = video->height;
+ st->duration = st->nb_frames = video->nb_frames;
+ if (video->time_base.num)
+ avpriv_set_pts_info(st, 64, video->time_base.num, video->time_base.den);
+ st->r_frame_rate =
+ st->avg_frame_rate = av_inv_q(video->time_base);
+ return 0;
+}
+
static int ea_read_header(AVFormatContext *s)
{
EaDemuxContext *ea = s->priv_data;
@@ -480,26 +518,8 @@ static int ea_read_header(AVFormatContext *s)
if (process_ea_header(s)<=0)
return AVERROR(EIO);
- if (ea->video_codec) {
- /* initialize the video decoder stream */
- st = avformat_new_stream(s, NULL);
- if (!st)
- return AVERROR(ENOMEM);
- ea->video_stream_index = st->index;
- st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- st->codec->codec_id = ea->video_codec;
- // parsing is necessary to make FFmpeg generate correct timestamps
- if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO)
- st->need_parsing = AVSTREAM_PARSE_HEADERS;
- st->codec->codec_tag = 0; /* no fourcc */
- st->codec->width = ea->width;
- st->codec->height = ea->height;
- st->duration = st->nb_frames = ea->nb_frames;
- if (ea->time_base.num)
- avpriv_set_pts_info(st, 64, ea->time_base.num, ea->time_base.den);
- st->r_frame_rate =
- st->avg_frame_rate = av_inv_q(ea->time_base);
- }
+ if (init_video_stream(s, &ea->video) || init_video_stream(s, &ea->alpha))
+ return AVERROR(ENOMEM);
if (ea->audio_codec) {
if (ea->num_channels <= 0 || ea->num_channels > 2) {
@@ -659,10 +679,12 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
goto get_video_packet;
case MV0K_TAG:
+ case AV0K_TAG:
case MPCh_TAG:
case pIQT_TAG:
key = AV_PKT_FLAG_KEY;
case MV0F_TAG:
+ case AV0F_TAG:
get_video_packet:
if (!chunk_size)
continue;
@@ -676,7 +698,10 @@ get_video_packet:
break;
}
partial_packet = chunk_type == MVIh_TAG;
- pkt->stream_index = ea->video_stream_index;
+ if (chunk_type == AV0K_TAG || chunk_type == AV0F_TAG)
+ pkt->stream_index = ea->alpha.stream_index;
+ else
+ pkt->stream_index = ea->video.stream_index;
pkt->flags |= key;
packet_read = 1;
break;
diff --git a/chromium/third_party/ffmpeg/libavformat/ffmdec.c b/chromium/third_party/ffmpeg/libavformat/ffmdec.c
index 9b50c9f5a6f..110d31540f1 100644
--- a/chromium/third_party/ffmpeg/libavformat/ffmdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/ffmdec.c
@@ -21,6 +21,7 @@
#include <stdint.h>
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
@@ -160,7 +161,7 @@ static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)
pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);
pos = FFMAX(pos, FFM_PACKET_SIZE);
- av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
+ ff_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
return avio_seek(pb, pos, SEEK_SET);
}
@@ -172,7 +173,7 @@ static int64_t get_dts(AVFormatContext *s, int64_t pos)
ffm_seek1(s, pos);
avio_skip(pb, 4);
dts = avio_rb64(pb);
- av_dlog(s, "dts=%0.6f\n", dts / 1000000.0);
+ ff_dlog(s, "dts=%0.6f\n", dts / 1000000.0);
return dts;
}
@@ -326,7 +327,7 @@ static int ffm2_read_header(AVFormatContext *s)
codec->flags = avio_rb32(pb);
codec->flags2 = avio_rb32(pb);
codec->debug = avio_rb32(pb);
- if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0)
return AVERROR(ENOMEM);
}
@@ -573,7 +574,7 @@ static int ffm_read_header(AVFormatContext *s)
default:
goto fail;
}
- if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
if (ff_get_extradata(codec, pb, avio_rb32(pb)) < 0)
return AVERROR(ENOMEM);
}
@@ -608,7 +609,7 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
if ((ret = ffm_is_avail_data(s, FRAME_HEADER_SIZE+4)) < 0)
return ret;
- av_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
+ ff_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
avio_tell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
FRAME_HEADER_SIZE)
@@ -666,7 +667,7 @@ static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, in
int64_t pts_min, pts_max, pts;
double pos1;
- av_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
+ ff_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
/* find the position using linear interpolation (better than
dichotomy in typical cases) */
if (ffm->write_index && ffm->write_index < ffm->file_size) {
diff --git a/chromium/third_party/ffmpeg/libavformat/ffmenc.c b/chromium/third_party/ffmpeg/libavformat/ffmenc.c
index 3abbfdd08f4..f0b5743ea46 100644
--- a/chromium/third_party/ffmpeg/libavformat/ffmenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/ffmenc.c
@@ -268,7 +268,7 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->flags);
avio_wb32(pb, codec->flags2);
avio_wb32(pb, codec->debug);
- if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
+ if (codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
avio_wb32(pb, codec->extradata_size);
avio_write(pb, codec->extradata, codec->extradata_size);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/file.c b/chromium/third_party/ffmpeg/libavformat/file.c
index 6511328de7d..d59aa42b50b 100644
--- a/chromium/third_party/ffmpeg/libavformat/file.c
+++ b/chromium/third_party/ffmpeg/libavformat/file.c
@@ -23,6 +23,9 @@
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avformat.h"
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
#include <fcntl.h>
#if HAVE_IO_H
#include <io.h>
@@ -44,6 +47,24 @@
# endif
#endif
+/* Not available in POSIX.1-1996 */
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((m) & S_IFLNK) == S_IFLNK)
+# else
+# define S_ISLNK(m) 0
+# endif
+#endif
+
+/* Not available in POSIX.1-1996 */
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+# define S_ISSOCK(m) 0
+# endif
+#endif
+
/* standard file protocol */
typedef struct FileContext {
@@ -51,6 +72,9 @@ typedef struct FileContext {
int fd;
int trunc;
int blocksize;
+#if HAVE_DIRENT_H
+ DIR *dir;
+#endif
} FileContext;
static const AVOption file_options[] = {
@@ -81,19 +105,19 @@ static const AVClass pipe_class = {
static int file_read(URLContext *h, unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
- int r;
+ int ret;
size = FFMIN(size, c->blocksize);
- r = read(c->fd, buf, size);
- return (-1 == r)?AVERROR(errno):r;
+ ret = read(c->fd, buf, size);
+ return (ret == -1) ? AVERROR(errno) : ret;
}
static int file_write(URLContext *h, const unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
- int r;
+ int ret;
size = FFMIN(size, c->blocksize);
- r = write(c->fd, buf, size);
- return (-1 == r)?AVERROR(errno):r;
+ ret = write(c->fd, buf, size);
+ return (ret == -1) ? AVERROR(errno) : ret;
}
static int file_get_handle(URLContext *h)
@@ -131,6 +155,42 @@ static int file_check(URLContext *h, int mask)
return ret;
}
+static int file_delete(URLContext *h)
+{
+#if HAVE_UNISTD_H
+ int ret;
+ const char *filename = h->filename;
+ av_strstart(filename, "file:", &filename);
+
+ ret = rmdir(filename);
+ if (ret < 0 && errno == ENOTDIR)
+ ret = unlink(filename);
+ if (ret < 0)
+ return AVERROR(errno);
+
+ return ret;
+#else
+ return AVERROR(ENOSYS);
+#endif /* HAVE_UNISTD_H */
+}
+
+static int file_move(URLContext *h_src, URLContext *h_dst)
+{
+#if HAVE_UNISTD_H
+ const char *filename_src = h_src->filename;
+ const char *filename_dst = h_dst->filename;
+ av_strstart(filename_src, "file:", &filename_src);
+ av_strstart(filename_dst, "file:", &filename_dst);
+
+ if (rename(filename_src, filename_dst) < 0)
+ return AVERROR(errno);
+
+ return 0;
+#else
+ return AVERROR(ENOSYS);
+#endif /* HAVE_UNISTD_H */
+}
+
#if CONFIG_FILE_PROTOCOL
static int file_open(URLContext *h, const char *filename, int flags)
@@ -189,6 +249,90 @@ static int file_close(URLContext *h)
return close(c->fd);
}
+static int file_open_dir(URLContext *h)
+{
+#if HAVE_LSTAT
+ FileContext *c = h->priv_data;
+
+ c->dir = opendir(h->filename);
+ if (!c->dir)
+ return AVERROR(errno);
+
+ return 0;
+#else
+ return AVERROR(ENOSYS);
+#endif /* HAVE_LSTAT */
+}
+
+static int file_read_dir(URLContext *h, AVIODirEntry **next)
+{
+#if HAVE_LSTAT
+ FileContext *c = h->priv_data;
+ struct dirent *dir;
+ char *fullpath = NULL;
+
+ *next = ff_alloc_dir_entry();
+ if (!*next)
+ return AVERROR(ENOMEM);
+ do {
+ errno = 0;
+ dir = readdir(c->dir);
+ if (!dir) {
+ av_freep(next);
+ return AVERROR(errno);
+ }
+ } while (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."));
+
+ fullpath = av_append_path_component(h->filename, dir->d_name);
+ if (fullpath) {
+ struct stat st;
+ if (!lstat(fullpath, &st)) {
+ if (S_ISDIR(st.st_mode))
+ (*next)->type = AVIO_ENTRY_DIRECTORY;
+ else if (S_ISFIFO(st.st_mode))
+ (*next)->type = AVIO_ENTRY_NAMED_PIPE;
+ else if (S_ISCHR(st.st_mode))
+ (*next)->type = AVIO_ENTRY_CHARACTER_DEVICE;
+ else if (S_ISBLK(st.st_mode))
+ (*next)->type = AVIO_ENTRY_BLOCK_DEVICE;
+ else if (S_ISLNK(st.st_mode))
+ (*next)->type = AVIO_ENTRY_SYMBOLIC_LINK;
+ else if (S_ISSOCK(st.st_mode))
+ (*next)->type = AVIO_ENTRY_SOCKET;
+ else if (S_ISREG(st.st_mode))
+ (*next)->type = AVIO_ENTRY_FILE;
+ else
+ (*next)->type = AVIO_ENTRY_UNKNOWN;
+
+ (*next)->group_id = st.st_gid;
+ (*next)->user_id = st.st_uid;
+ (*next)->size = st.st_size;
+ (*next)->filemode = st.st_mode & 0777;
+ (*next)->modification_timestamp = INT64_C(1000000) * st.st_mtime;
+ (*next)->access_timestamp = INT64_C(1000000) * st.st_atime;
+ (*next)->status_change_timestamp = INT64_C(1000000) * st.st_ctime;
+ }
+ av_free(fullpath);
+ }
+
+ (*next)->name = av_strdup(dir->d_name);
+ return 0;
+#else
+ return AVERROR(ENOSYS);
+#endif /* HAVE_LSTAT */
+}
+
+static int file_close_dir(URLContext *h)
+{
+#if HAVE_LSTAT
+ FileContext *c = h->priv_data;
+ closedir(c->dir);
+ return 0;
+#else
+ return AVERROR(ENOSYS);
+#endif /* HAVE_LSTAT */
+}
+
URLProtocol ff_file_protocol = {
.name = "file",
.url_open = file_open,
@@ -198,8 +342,13 @@ URLProtocol ff_file_protocol = {
.url_close = file_close,
.url_get_file_handle = file_get_handle,
.url_check = file_check,
+ .url_delete = file_delete,
+ .url_move = file_move,
.priv_data_size = sizeof(FileContext),
.priv_data_class = &file_class,
+ .url_open_dir = file_open_dir,
+ .url_read_dir = file_read_dir,
+ .url_close_dir = file_close_dir,
};
#endif /* CONFIG_FILE_PROTOCOL */
diff --git a/chromium/third_party/ffmpeg/libavformat/flac_picture.c b/chromium/third_party/ffmpeg/libavformat/flac_picture.c
index 669fd2e7825..7bd98258e4f 100644
--- a/chromium/third_party/ffmpeg/libavformat/flac_picture.c
+++ b/chromium/third_party/ffmpeg/libavformat/flac_picture.c
@@ -108,10 +108,10 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
ret = AVERROR_INVALIDDATA;
goto fail;
}
- if (!(data = av_buffer_alloc(len + FF_INPUT_BUFFER_PADDING_SIZE))) {
+ if (!(data = av_buffer_alloc(len + AV_INPUT_BUFFER_PADDING_SIZE))) {
RETURN_ERROR(AVERROR(ENOMEM));
}
- memset(data->data + len, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(data->data + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
if (avio_read(pb, data->data, len) != len) {
av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n");
if (s->error_recognition & AV_EF_EXPLODE)
diff --git a/chromium/third_party/ffmpeg/libavformat/flacdec.c b/chromium/third_party/ffmpeg/libavformat/flacdec.c
index 4207fd2bf6c..4c1f9435810 100644
--- a/chromium/third_party/ffmpeg/libavformat/flacdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/flacdec.c
@@ -58,7 +58,7 @@ static int flac_read_header(AVFormatContext *s)
case FLAC_METADATA_TYPE_CUESHEET:
case FLAC_METADATA_TYPE_PICTURE:
case FLAC_METADATA_TYPE_VORBIS_COMMENT:
- buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ buffer = av_mallocz(metadata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buffer) {
return AVERROR(ENOMEM);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/flvdec.c b/chromium/third_party/ffmpeg/libavformat/flvdec.c
index 345be1ea7d2..826e0d7ea20 100644
--- a/chromium/third_party/ffmpeg/libavformat/flvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/flvdec.c
@@ -433,6 +433,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
case AMF_DATA_TYPE_UNSUPPORTED:
break; // these take up no additional space
case AMF_DATA_TYPE_MIXEDARRAY:
+ {
+ unsigned v;
avio_skip(ioc, 4); // skip 32-bit max array index
while (avio_tell(ioc) < max_pos - 2 &&
amf_get_string(ioc, str_val, sizeof(str_val)) > 0)
@@ -441,11 +443,13 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
if (amf_parse_object(s, astream, vstream, str_val, max_pos,
depth + 1) < 0)
return -1;
- if (avio_r8(ioc) != AMF_END_OF_OBJECT) {
- av_log(s, AV_LOG_ERROR, "Missing AMF_END_OF_OBJECT in AMF_DATA_TYPE_MIXEDARRAY\n");
+ v = avio_r8(ioc);
+ if (v != AMF_END_OF_OBJECT) {
+ av_log(s, AV_LOG_ERROR, "Missing AMF_END_OF_OBJECT in AMF_DATA_TYPE_MIXEDARRAY, found %d\n", v);
return -1;
}
break;
+ }
case AMF_DATA_TYPE_ARRAY:
{
unsigned int arraylen, i;
@@ -654,7 +658,7 @@ static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream,
{
av_free(flv->new_extradata[stream]);
flv->new_extradata[stream] = av_mallocz(size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!flv->new_extradata[stream])
return AVERROR(ENOMEM);
flv->new_extradata_size[stream] = size;
@@ -797,15 +801,16 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
int av_uninit(channels);
int av_uninit(sample_rate);
AVStream *st = NULL;
+ int last = -1;
/* pkt size is repeated at end. skip it */
- for (;; avio_skip(s->pb, 4)) {
+ for (;; last = avio_rb32(s->pb)) {
pos = avio_tell(s->pb);
type = (avio_r8(s->pb) & 0x1F);
size = avio_rb24(s->pb);
dts = avio_rb24(s->pb);
dts |= avio_r8(s->pb) << 24;
- av_log(s, AV_LOG_TRACE, "type:%d, size:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, dts, avio_tell(s->pb));
+ av_log(s, AV_LOG_TRACE, "type:%d, size:%d, last:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, last, dts, avio_tell(s->pb));
if (avio_feof(s->pb))
return AVERROR_EOF;
avio_skip(s->pb, 3); /* stream id, always 0 */
@@ -849,6 +854,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
meta_pos = avio_tell(s->pb);
type = flv_read_metabody(s, next);
if (type == 0 && dts == 0 || type < 0 || type == TYPE_UNKNOWN) {
+ if (type < 0 && flv->validate_count &&
+ flv->validate_index[0].pos > next &&
+ flv->validate_index[0].pos - 4 < next
+ ) {
+ av_log(s, AV_LOG_WARNING, "Adjusting next position due to index mismatch\n");
+ next = flv->validate_index[0].pos - 4;
+ }
goto skip;
} else if (type == TYPE_ONTEXTDATA) {
avpriv_request_sample(s, "OnTextData packet");
diff --git a/chromium/third_party/ffmpeg/libavformat/format.c b/chromium/third_party/ffmpeg/libavformat/format.c
index 7df06b70fc0..fd81d7a132a 100644
--- a/chromium/third_party/ffmpeg/libavformat/format.c
+++ b/chromium/third_party/ffmpeg/libavformat/format.c
@@ -261,8 +261,13 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
if (pb->av_class) {
uint8_t *mime_type_opt = NULL;
+ char *semi;
av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type_opt);
pd.mime_type = (const char *)mime_type_opt;
+ semi = pd.mime_type ? strchr(pd.mime_type, ';') : NULL;
+ if (semi) {
+ *semi = '\0';
+ }
}
#if 0
if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) {
diff --git a/chromium/third_party/ffmpeg/libavformat/ftp.c b/chromium/third_party/ffmpeg/libavformat/ftp.c
index 27a172e8ad7..dcb588dac29 100644
--- a/chromium/third_party/ffmpeg/libavformat/ftp.c
+++ b/chromium/third_party/ffmpeg/libavformat/ftp.c
@@ -19,6 +19,8 @@
*/
#include "libavutil/avstring.h"
+#include "libavutil/internal.h"
+#include "libavutil/parseutils.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"
@@ -26,15 +28,23 @@
#include "libavutil/bprint.h"
#define CONTROL_BUFFER_SIZE 1024
+#define DIR_BUFFER_SIZE 4096
typedef enum {
UNKNOWN,
READY,
DOWNLOADING,
UPLOADING,
+ LISTING_DIR,
DISCONNECTED
} FTPState;
+typedef enum {
+ UNKNOWN_METHOD,
+ NLST,
+ MLSD
+} FTPListingMethod;
+
typedef struct {
const AVClass *class;
URLContext *conn_control; /**< Control connection */
@@ -53,6 +63,12 @@ typedef struct {
const char *anonymous_password; /**< Password to be used for anonymous user. An email should be used. */
int write_seekable; /**< Control seekability, 0 = disable, 1 = enable. */
FTPState state; /**< State of data connection */
+ FTPListingMethod listing_method; /**< Called listing method */
+ char *features; /**< List of server's features represented as raw response */
+ char *dir_buffer;
+ size_t dir_buffer_size;
+ size_t dir_buffer_offset;
+ int utf8;
} FTPContext;
#define OFFSET(x) offsetof(FTPContext, x)
@@ -185,6 +201,8 @@ static int ftp_send_command(FTPContext *s, const char *command,
{
int err;
+ ff_dlog(s, "%s", command);
+
if (response)
*response = NULL;
@@ -266,7 +284,7 @@ static int ftp_passive_mode_epsv(FTPContext *s)
end[-1] = '\0';
s->server_data_port = atoi(start);
- av_dlog(s, "Server data port: %d\n", s->server_data_port);
+ ff_dlog(s, "Server data port: %d\n", s->server_data_port);
av_free(res);
return 0;
@@ -312,7 +330,7 @@ static int ftp_passive_mode(FTPContext *s)
start = av_strtok(end, ",", &end);
if (!start) goto fail;
s->server_data_port += atoi(start);
- av_dlog(s, "Server data port: %d\n", s->server_data_port);
+ ff_dlog(s, "Server data port: %d\n", s->server_data_port);
av_free(res);
return 0;
@@ -347,10 +365,7 @@ static int ftp_current_dir(FTPContext *s)
if (!end)
goto fail;
- if (end > res && end[-1] == '/') {
- end[-1] = '\0';
- } else
- *end = '\0';
+ *end = '\0';
s->path = av_strdup(start);
av_free(res);
@@ -434,19 +449,76 @@ static int ftp_restart(FTPContext *s, int64_t pos)
return 0;
}
+static int ftp_set_dir(FTPContext *s)
+{
+ static const int cwd_codes[] = {250, 550, 0}; /* 550 is incorrect code */
+ char command[MAX_URL_SIZE];
+
+ snprintf(command, sizeof(command), "CWD %s\r\n", s->path);
+ if (ftp_send_command(s, command, cwd_codes, NULL) != 250)
+ return AVERROR(EIO);
+ return 0;
+}
+
+static int ftp_list_mlsd(FTPContext *s)
+{
+ static const char *command = "MLSD\r\n";
+ static const int mlsd_codes[] = {150, 500, 0}; /* 500 is incorrect code */
+
+ if (ftp_send_command(s, command, mlsd_codes, NULL) != 150)
+ return AVERROR(ENOSYS);
+ s->listing_method = MLSD;
+ return 0;
+}
+
+static int ftp_list_nlst(FTPContext *s)
+{
+ static const char *command = "NLST\r\n";
+ static const int nlst_codes[] = {226, 425, 426, 451, 450, 550, 0};
+
+ if (ftp_send_command(s, command, nlst_codes, NULL) != 226)
+ return AVERROR(ENOSYS);
+ s->listing_method = NLST;
+ return 0;
+}
+
+static int ftp_has_feature(FTPContext *s, const char *feature_name);
+
+static int ftp_list(FTPContext *s)
+{
+ int ret;
+ s->state = LISTING_DIR;
+
+ if ((ret = ftp_list_mlsd(s)) < 0)
+ ret = ftp_list_nlst(s);
+
+ return ret;
+}
+
+static int ftp_has_feature(FTPContext *s, const char *feature_name)
+{
+ if (!s->features)
+ return 0;
+
+ return av_stristr(s->features, feature_name) != NULL;
+}
+
static int ftp_features(FTPContext *s)
{
static const char *feat_command = "FEAT\r\n";
static const char *enable_utf8_command = "OPTS UTF8 ON\r\n";
static const int feat_codes[] = {211, 0};
- static const int opts_codes[] = {200, 451};
- char *feat = NULL;
+ static const int opts_codes[] = {200, 451, 0};
- if (ftp_send_command(s, feat_command, feat_codes, &feat) == 211) {
- if (av_stristr(feat, "UTF8"))
- ftp_send_command(s, enable_utf8_command, opts_codes, NULL);
+ av_freep(&s->features);
+ if (ftp_send_command(s, feat_command, feat_codes, &s->features) != 211) {
+ av_freep(&s->features);
+ }
+
+ if (ftp_has_feature(s, "UTF8")) {
+ if (ftp_send_command(s, enable_utf8_command, opts_codes, NULL) == 200)
+ s->utf8 = 1;
}
- av_freep(&feat);
return 0;
}
@@ -570,20 +642,19 @@ static int ftp_abort(URLContext *h)
return 0;
}
-static int ftp_open(URLContext *h, const char *url, int flags)
+static int ftp_connect(URLContext *h, const char *url)
{
char proto[10], path[MAX_URL_SIZE], credencials[MAX_URL_SIZE], hostname[MAX_URL_SIZE];
const char *tok_user = NULL, *tok_pass = NULL;
- char *end = NULL;
+ char *end = NULL, *newpath = NULL;
int err;
- size_t pathlen;
FTPContext *s = h->priv_data;
- av_dlog(h, "ftp protocol open\n");
-
s->state = DISCONNECTED;
+ s->listing_method = UNKNOWN_METHOD;
s->filesize = -1;
s->position = 0;
+ s->features = NULL;
av_url_split(proto, sizeof(proto),
credencials, sizeof(credencials),
@@ -602,22 +673,36 @@ static int ftp_open(URLContext *h, const char *url, int flags)
s->password = av_strdup(tok_pass);
s->hostname = av_strdup(hostname);
if (!s->hostname || !s->user || (tok_pass && !s->password)) {
- err = AVERROR(ENOMEM);
- goto fail;
+ return AVERROR(ENOMEM);
}
if (s->server_control_port < 0 || s->server_control_port > 65535)
s->server_control_port = 21;
if ((err = ftp_connect_control_connection(h)) < 0)
- goto fail;
+ return err;
if ((err = ftp_current_dir(s)) < 0)
+ return err;
+
+ newpath = av_append_path_component(s->path, path);
+ if (!newpath)
+ return AVERROR(ENOMEM);
+ av_free(s->path);
+ s->path = newpath;
+
+ return 0;
+}
+
+static int ftp_open(URLContext *h, const char *url, int flags)
+{
+ FTPContext *s = h->priv_data;
+ int err;
+
+ ff_dlog(h, "ftp protocol open\n");
+
+ if ((err = ftp_connect(h, url)) < 0)
goto fail;
- pathlen = strlen(s->path) + strlen(path) + 1;
- if ((err = av_reallocp(&s->path, pathlen)) < 0)
- goto fail;
- av_strlcat(s->path + strlen(s->path), path, pathlen);
if (ftp_restart(s, 0) < 0) {
h->is_streamed = 1;
@@ -642,7 +727,7 @@ static int64_t ftp_seek(URLContext *h, int64_t pos, int whence)
int err;
int64_t new_pos, fake_pos;
- av_dlog(h, "ftp protocol seek %"PRId64" %d\n", pos, whence);
+ ff_dlog(h, "ftp protocol seek %"PRId64" %d\n", pos, whence);
switch(whence) {
case AVSEEK_SIZE:
@@ -684,7 +769,7 @@ static int ftp_read(URLContext *h, unsigned char *buf, int size)
FTPContext *s = h->priv_data;
int read, err, retry_done = 0;
- av_dlog(h, "ftp protocol read %d bytes\n", size);
+ ff_dlog(h, "ftp protocol read %d bytes\n", size);
retry:
if (s->state == DISCONNECTED) {
/* optimization */
@@ -742,7 +827,7 @@ static int ftp_write(URLContext *h, const unsigned char *buf, int size)
FTPContext *s = h->priv_data;
int written;
- av_dlog(h, "ftp protocol write %d bytes\n", size);
+ ff_dlog(h, "ftp protocol write %d bytes\n", size);
if (s->state == DISCONNECTED) {
if ((err = ftp_connect_data_connection(h)) < 0)
@@ -769,13 +854,14 @@ static int ftp_close(URLContext *h)
{
FTPContext *s = h->priv_data;
- av_dlog(h, "ftp protocol close\n");
+ ff_dlog(h, "ftp protocol close\n");
ftp_close_both_connections(s);
av_freep(&s->user);
av_freep(&s->password);
av_freep(&s->hostname);
av_freep(&s->path);
+ av_freep(&s->features);
return 0;
}
@@ -784,7 +870,7 @@ static int ftp_get_file_handle(URLContext *h)
{
FTPContext *s = h->priv_data;
- av_dlog(h, "ftp protocol get_file_handle\n");
+ ff_dlog(h, "ftp protocol get_file_handle\n");
if (s->conn_data)
return ffurl_get_file_handle(s->conn_data);
@@ -796,7 +882,7 @@ static int ftp_shutdown(URLContext *h, int flags)
{
FTPContext *s = h->priv_data;
- av_dlog(h, "ftp protocol shutdown\n");
+ ff_dlog(h, "ftp protocol shutdown\n");
if (s->conn_data)
return ffurl_shutdown(s->conn_data, flags);
@@ -804,6 +890,213 @@ static int ftp_shutdown(URLContext *h, int flags)
return AVERROR(EIO);
}
+static int ftp_open_dir(URLContext *h)
+{
+ FTPContext *s = h->priv_data;
+ int ret;
+
+ if ((ret = ftp_connect(h, h->filename)) < 0)
+ goto fail;
+ if ((ret = ftp_set_dir(s)) < 0)
+ goto fail;
+ if ((ret = ftp_connect_data_connection(h)) < 0)
+ goto fail;
+ if ((ret = ftp_list(s)) < 0)
+ goto fail;
+ s->dir_buffer = av_malloc(DIR_BUFFER_SIZE);
+ if (!s->dir_buffer) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ s->dir_buffer[0] = 0;
+ if (s->conn_data && s->state == LISTING_DIR)
+ return 0;
+ fail:
+ ffurl_closep(&s->conn_control);
+ ffurl_closep(&s->conn_data);
+ return ret;
+}
+
+static int64_t ftp_parse_date(const char *date)
+{
+ struct tm tv;
+ memset(&tv, 0, sizeof(struct tm));
+ av_small_strptime(date, "%Y%m%d%H%M%S", &tv);
+ return INT64_C(1000000) * av_timegm(&tv);
+}
+
+static int ftp_parse_entry_nlst(char *line, AVIODirEntry *next)
+{
+ next->name = av_strdup(line);
+ return 0;
+}
+
+static int ftp_parse_entry_mlsd(char *mlsd, AVIODirEntry *next)
+{
+ char *fact, *value;
+ ff_dlog(NULL, "%s\n", mlsd);
+ while(fact = av_strtok(mlsd, ";", &mlsd)) {
+ if (fact[0] == ' ') {
+ next->name = av_strdup(&fact[1]);
+ continue;
+ }
+ fact = av_strtok(fact, "=", &value);
+ if (!av_strcasecmp(fact, "type")) {
+ if (!av_strcasecmp(value, "cdir") || !av_strcasecmp(value, "pdir"))
+ return 1;
+ if (!av_strcasecmp(value, "dir"))
+ next->type = AVIO_ENTRY_DIRECTORY;
+ else if (!av_strcasecmp(value, "file"))
+ next->type = AVIO_ENTRY_FILE;
+ else if (!av_strcasecmp(value, "OS.unix=slink:"))
+ next->type = AVIO_ENTRY_SYMBOLIC_LINK;
+ } else if (!av_strcasecmp(fact, "modify")) {
+ next->modification_timestamp = ftp_parse_date(value);
+ } else if (!av_strcasecmp(fact, "UNIX.mode")) {
+ next->filemode = strtoumax(value, NULL, 8);
+ } else if (!av_strcasecmp(fact, "UNIX.uid") || !av_strcasecmp(fact, "UNIX.owner"))
+ next->user_id = strtoumax(value, NULL, 10);
+ else if (!av_strcasecmp(fact, "UNIX.gid") || !av_strcasecmp(fact, "UNIX.group"))
+ next->group_id = strtoumax(value, NULL, 10);
+ else if (!av_strcasecmp(fact, "size") || !av_strcasecmp(fact, "sizd"))
+ next->size = strtoll(value, NULL, 10);
+ }
+ return 0;
+}
+
+/**
+ * @return 0 on success, negative on error, positive on entry to discard.
+ */
+static int ftp_parse_entry(URLContext *h, char *line, AVIODirEntry *next)
+{
+ FTPContext *s = h->priv_data;
+
+ switch (s->listing_method) {
+ case MLSD:
+ return ftp_parse_entry_mlsd(line, next);
+ case NLST:
+ return ftp_parse_entry_nlst(line, next);
+ case UNKNOWN_METHOD:
+ default:
+ return -1;
+ }
+}
+
+static int ftp_read_dir(URLContext *h, AVIODirEntry **next)
+{
+ FTPContext *s = h->priv_data;
+ char *start, *found;
+ int ret, retried;
+
+ do {
+ retried = 0;
+ start = s->dir_buffer + s->dir_buffer_offset;
+ while (!(found = strstr(start, "\n"))) {
+ if (retried)
+ return AVERROR(EIO);
+ s->dir_buffer_size -= s->dir_buffer_offset;
+ s->dir_buffer_offset = 0;
+ if (s->dir_buffer_size)
+ memmove(s->dir_buffer, start, s->dir_buffer_size);
+ ret = ffurl_read(s->conn_data, s->dir_buffer + s->dir_buffer_size, DIR_BUFFER_SIZE - (s->dir_buffer_size + 1));
+ if (ret < 0)
+ return ret;
+ if (!ret) {
+ *next = NULL;
+ return 0;
+ }
+ s->dir_buffer_size += ret;
+ s->dir_buffer[s->dir_buffer_size] = 0;
+ start = s->dir_buffer;
+ retried = 1;
+ }
+ s->dir_buffer_offset += (found + 1 - start);
+ found[0] = 0;
+ if (found > start && found[-1] == '\r')
+ found[-1] = 0;
+
+ *next = ff_alloc_dir_entry();
+ if (!*next)
+ return AVERROR(ENOMEM);
+ (*next)->utf8 = s->utf8;
+ ret = ftp_parse_entry(h, start, *next);
+ if (ret) {
+ avio_free_directory_entry(next);
+ if (ret < 0)
+ return ret;
+ }
+ } while (ret > 0);
+ return 0;
+}
+
+static int ftp_close_dir(URLContext *h)
+{
+ FTPContext *s = h->priv_data;
+ av_freep(&s->dir_buffer);
+ ffurl_closep(&s->conn_control);
+ ffurl_closep(&s->conn_data);
+ return 0;
+}
+
+static int ftp_delete(URLContext *h)
+{
+ FTPContext *s = h->priv_data;
+ char command[MAX_URL_SIZE];
+ static const int del_codes[] = {250, 421, 450, 500, 501, 502, 530, 550, 0};
+ static const int rmd_codes[] = {250, 421, 500, 501, 502, 530, 550, 0};
+ int ret;
+
+ if ((ret = ftp_connect(h, h->filename)) < 0)
+ goto cleanup;
+
+ snprintf(command, sizeof(command), "DELE %s\r\n", s->path);
+ if (ftp_send_command(s, command, del_codes, NULL) == 250) {
+ ret = 0;
+ goto cleanup;
+ }
+
+ snprintf(command, sizeof(command), "RMD %s\r\n", s->path);
+ if (ftp_send_command(s, command, rmd_codes, NULL) == 250)
+ ret = 0;
+ else
+ ret = AVERROR(EIO);
+
+cleanup:
+ ftp_close(h);
+ return ret;
+}
+
+static int ftp_move(URLContext *h_src, URLContext *h_dst)
+{
+ FTPContext *s = h_src->priv_data;
+ char command[MAX_URL_SIZE], path[MAX_URL_SIZE];
+ static const int rnfr_codes[] = {350, 421, 450, 500, 501, 502, 503, 530, 0};
+ static const int rnto_codes[] = {250, 421, 500, 501, 502, 503, 530, 532, 553, 0};
+ int ret;
+
+ if ((ret = ftp_connect(h_src, h_src->filename)) < 0)
+ goto cleanup;
+
+ snprintf(command, sizeof(command), "RNFR %s\r\n", s->path);
+ if (ftp_send_command(s, command, rnfr_codes, NULL) != 350) {
+ ret = AVERROR(EIO);
+ goto cleanup;
+ }
+
+ av_url_split(0, 0, 0, 0, 0, 0, 0,
+ path, sizeof(path),
+ h_dst->filename);
+ snprintf(command, sizeof(command), "RNTO %s\r\n", path);
+ if (ftp_send_command(s, command, rnto_codes, NULL) == 250)
+ ret = 0;
+ else
+ ret = AVERROR(EIO);
+
+cleanup:
+ ftp_close(h_src);
+ return ret;
+}
+
URLProtocol ff_ftp_protocol = {
.name = "ftp",
.url_open = ftp_open,
@@ -815,5 +1108,10 @@ URLProtocol ff_ftp_protocol = {
.url_shutdown = ftp_shutdown,
.priv_data_size = sizeof(FTPContext),
.priv_data_class = &ftp_context_class,
+ .url_open_dir = ftp_open_dir,
+ .url_read_dir = ftp_read_dir,
+ .url_close_dir = ftp_close_dir,
+ .url_delete = ftp_delete,
+ .url_move = ftp_move,
.flags = URL_PROTOCOL_FLAG_NETWORK,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/gifdec.c b/chromium/third_party/ffmpeg/libavformat/gifdec.c
index bb4c6ec6e64..1ac47fee504 100644
--- a/chromium/third_party/ffmpeg/libavformat/gifdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/gifdec.c
@@ -52,6 +52,9 @@ typedef struct GIFDemuxContext {
int total_iter;
int iter_count;
int ignore_loop;
+
+ int nb_frames;
+ int last_duration;
} GIFDemuxContext;
/**
@@ -279,6 +282,9 @@ parse_keyframe:
pkt->stream_index = 0;
pkt->duration = gdc->delay;
+ gdc->nb_frames ++;
+ gdc->last_duration = pkt->duration;
+
/* Graphic Control Extension's scope is single frame.
* Remove its influence. */
gdc->delay = gdc->default_delay;
@@ -299,6 +305,9 @@ resync:
}
if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
+ if (gdc->nb_frames == 1) {
+ s->streams[0]->r_frame_rate = (AVRational) {100, gdc->last_duration};
+ }
/* This might happen when there is no image block
* between extension blocks and GIF_TRAILER or EOF */
if (!gdc->ignore_loop && (block_label == GIF_TRAILER || avio_feof(pb))
diff --git a/chromium/third_party/ffmpeg/libavformat/hevc.c b/chromium/third_party/ffmpeg/libavformat/hevc.c
index 643b71596ad..7c294ef8a24 100644
--- a/chromium/third_party/ffmpeg/libavformat/hevc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hevc.c
@@ -565,7 +565,10 @@ static int hvcc_parse_sps(GetBitContext *gb,
}
if (get_bits1(gb)) { // long_term_ref_pics_present_flag
- for (i = 0; i < get_ue_golomb_long(gb); i++) { // num_long_term_ref_pics_sps
+ unsigned num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
+ if (num_long_term_ref_pics_sps > 31U)
+ return AVERROR_INVALIDDATA;
+ for (i = 0; i < num_long_term_ref_pics_sps; i++) { // num_long_term_ref_pics_sps
int len = FFMIN(log2_max_pic_order_cnt_lsb_minus4 + 4, 16);
skip_bits (gb, len); // lt_ref_pic_poc_lsb_sps[i]
skip_bits1(gb); // used_by_curr_pic_lt_sps_flag[i]
@@ -616,11 +619,12 @@ static int hvcc_parse_pps(GetBitContext *gb,
get_se_golomb_long(gb); // pps_cr_qp_offset
/*
+ * pps_slice_chroma_qp_offsets_present_flag u(1)
* weighted_pred_flag u(1)
* weighted_bipred_flag u(1)
* transquant_bypass_enabled_flag u(1)
*/
- skip_bits(gb, 3);
+ skip_bits(gb, 4);
tiles_enabled_flag = get_bits1(gb);
entropy_coding_sync_enabled_flag = get_bits1(gb);
@@ -644,7 +648,7 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
uint8_t *dst;
uint32_t i, len;
- dst = av_malloc(src_len);
+ dst = av_malloc(src_len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!dst)
return NULL;
diff --git a/chromium/third_party/ffmpeg/libavformat/hls.c b/chromium/third_party/ffmpeg/libavformat/hls.c
index 3f1d97eb6f2..c16c7708f42 100644
--- a/chromium/third_party/ffmpeg/libavformat/hls.c
+++ b/chromium/third_party/ffmpeg/libavformat/hls.c
@@ -182,6 +182,7 @@ typedef struct HLSContext {
char *user_agent; ///< holds HTTP user agent set as an AVOption to the HTTP protocol context
char *cookies; ///< holds HTTP cookie values set in either the initial response or as an AVOption to the HTTP protocol context
char *headers; ///< holds HTTP headers set as an AVOption to the HTTP protocol context
+ AVDictionary *avio_opts;
} HLSContext;
static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
@@ -481,7 +482,9 @@ static void handle_rendition_args(struct rendition_info *info, const char *key,
/* used by parse_playlist to allocate a new variant+playlist when the
* playlist is detected to be a Media Playlist (not Master Playlist)
* and we have no parent Master Playlist (parsing of which would have
- * allocated the variant and playlist already) */
+ * allocated the variant and playlist already)
+ * *pls == NULL => Master Playlist or parentless Media Playlist
+ * *pls != NULL => parented Media Playlist, playlist+variant allocated */
static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url)
{
if (*pls)
@@ -492,8 +495,55 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url
return 0;
}
-/* pls = NULL => Master Playlist or parentless Media Playlist
- * pls = !NULL => parented Media Playlist, playlist+variant allocated */
+static int open_in(HLSContext *c, AVIOContext **in, const char *url)
+{
+ AVDictionary *tmp = NULL;
+ int ret;
+
+ av_dict_copy(&tmp, c->avio_opts, 0);
+
+ ret = avio_open2(in, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);
+
+ av_dict_free(&tmp);
+ return ret;
+}
+
+static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *opts2)
+{
+ AVDictionary *tmp = NULL;
+ int ret;
+
+ av_dict_copy(&tmp, opts, 0);
+ av_dict_copy(&tmp, opts2, 0);
+
+ if ((ret = av_opt_set_dict(pls->input, &tmp)) < 0)
+ goto fail;
+
+ if ((ret = ffurl_connect(pls->input, NULL)) < 0) {
+ ffurl_close(pls->input);
+ pls->input = NULL;
+ }
+
+fail:
+ av_dict_free(&tmp);
+ return ret;
+}
+
+static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionary *opts)
+{
+ AVDictionary *tmp = NULL;
+ int ret;
+
+ av_dict_copy(&tmp, c->avio_opts, 0);
+ av_dict_copy(&tmp, opts, 0);
+
+ ret = ffurl_open(uc, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);
+
+ av_dict_free(&tmp);
+
+ return ret;
+}
+
static int parse_playlist(HLSContext *c, const char *url,
struct playlist *pls, AVIOContext *in)
{
@@ -513,6 +563,7 @@ static int parse_playlist(HLSContext *c, const char *url,
char tmp_str[MAX_URL_SIZE];
if (!in) {
+#if 1
AVDictionary *opts = NULL;
close_in = 1;
/* Some HLS servers don't like being sent the range header */
@@ -528,6 +579,12 @@ static int parse_playlist(HLSContext *c, const char *url,
av_dict_free(&opts);
if (ret < 0)
return ret;
+#else
+ ret = open_in(c, &in, url);
+ if (ret < 0)
+ return ret;
+ close_in = 1;
+#endif
}
if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0)
@@ -752,7 +809,7 @@ static int id3_has_changed_values(struct playlist *pls, AVDictionary *metadata,
if (apic) {
int size = pls->ctx->streams[1]->attached_pic.size;
- if (size != apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE)
+ if (size != apic->buf->size - AV_INPUT_BUFFER_PADDING_SIZE)
return 1;
if (memcmp(apic->buf->data, pls->ctx->streams[1]->attached_pic.data, size) != 0)
@@ -940,15 +997,13 @@ static int open_input(HLSContext *c, struct playlist *pls)
seg->url, seg->url_offset, pls->index);
if (seg->key_type == KEY_NONE) {
- ret = ffurl_open(&pls->input, seg->url, AVIO_FLAG_READ,
- &pls->parent->interrupt_callback, &opts);
-
+ ret = open_url(pls->parent->priv_data, &pls->input, seg->url, opts);
} else if (seg->key_type == KEY_AES_128) {
+// HLSContext *c = var->parent->priv_data;
char iv[33], key[33], url[MAX_URL_SIZE];
if (strcmp(seg->key, pls->key_url)) {
URLContext *uc;
- if (ffurl_open(&uc, seg->key, AVIO_FLAG_READ,
- &pls->parent->interrupt_callback, &opts2) == 0) {
+ if (open_url(pls->parent->priv_data, &uc, seg->key, opts2) == 0) {
if (ffurl_read_complete(uc, pls->key, sizeof(pls->key))
!= sizeof(pls->key)) {
av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
@@ -970,15 +1025,14 @@ static int open_input(HLSContext *c, struct playlist *pls)
snprintf(url, sizeof(url), "crypto+%s", seg->url);
else
snprintf(url, sizeof(url), "crypto:%s", seg->url);
+
if ((ret = ffurl_alloc(&pls->input, url, AVIO_FLAG_READ,
&pls->parent->interrupt_callback)) < 0)
goto cleanup;
av_opt_set(pls->input->priv_data, "key", key, 0);
av_opt_set(pls->input->priv_data, "iv", iv, 0);
- if ((ret = ffurl_connect(pls->input, &opts)) < 0) {
- ffurl_close(pls->input);
- pls->input = NULL;
+ if ((ret = url_connect(pls, c->avio_opts, opts)) < 0) {
goto cleanup;
}
ret = 0;
@@ -1085,6 +1139,8 @@ reload:
ret = open_input(c, v);
if (ret < 0) {
+ if (ff_check_interrupt(c->interrupt_callback))
+ return AVERROR_EXIT;
av_log(v->parent, AV_LOG_WARNING, "Failed to open segment of playlist %d\n",
v->index);
v->cur_seq_no += 1;
@@ -1252,6 +1308,26 @@ static int select_cur_seq_no(HLSContext *c, struct playlist *pls)
return pls->start_seq_no;
}
+static int save_avio_options(AVFormatContext *s)
+{
+ HLSContext *c = s->priv_data;
+ const char *opts[] = { "headers", "user_agent", "user-agent", "cookies", NULL }, **opt = opts;
+ uint8_t *buf;
+ int ret = 0;
+
+ while (*opt) {
+ if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) {
+ ret = av_dict_set(&c->avio_opts, *opt, buf,
+ AV_DICT_DONT_STRDUP_VAL);
+ if (ret < 0)
+ return ret;
+ }
+ opt++;
+ }
+
+ return ret;
+}
+
static int hls_read_header(AVFormatContext *s)
{
URLContext *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
@@ -1279,6 +1355,12 @@ static int hls_read_header(AVFormatContext *s)
if ((ret = parse_playlist(c, s->filename, NULL, s->pb)) < 0)
goto fail;
+ if ((ret = save_avio_options(s)) < 0)
+ goto fail;
+
+ /* Some HLS servers don't like being sent the range header */
+ av_dict_set(&c->avio_opts, "seekable", "0", 0);
+
if (c->n_variants == 0) {
av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
ret = AVERROR_EOF;
@@ -1629,6 +1711,9 @@ static int hls_close(AVFormatContext *s)
free_playlist_list(c);
free_variant_list(c);
free_rendition_list(c);
+
+ av_dict_free(&c->avio_opts);
+
return 0;
}
@@ -1729,7 +1814,7 @@ static int hls_probe(AVProbeData *p)
#define FLAGS AV_OPT_FLAG_DECODING_PARAM
static const AVOption hls_options[] = {
{"live_start_index", "segment index to start live streams at (negative values are from the end)",
- OFFSET(live_start_index), FF_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
+ OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
{NULL}
};
diff --git a/chromium/third_party/ffmpeg/libavformat/hlsenc.c b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
index cf29f4f737f..473ca3a7223 100644
--- a/chromium/third_party/ffmpeg/libavformat/hlsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
@@ -32,6 +32,7 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"
+#include "libavutil/time_internal.h"
#include "avformat.h"
#include "internal.h"
@@ -42,6 +43,7 @@
typedef struct HLSSegment {
char filename[1024];
+ char sub_filename[1024];
double duration; /* in seconds */
int64_t pos;
int64_t size;
@@ -67,8 +69,10 @@ typedef struct HLSContext {
int64_t sequence;
int64_t start_sequence;
AVOutputFormat *oformat;
+ AVOutputFormat *vtt_oformat;
AVFormatContext *avf;
+ AVFormatContext *vtt_avf;
float time; // Set by a private option.
int max_nb_segments; // Set by a private option.
@@ -76,9 +80,11 @@ typedef struct HLSContext {
uint32_t flags; // enum HLSFlags
char *segment_filename;
+ int use_localtime; ///< flag to expand filename with localtime
int allowcache;
int64_t recording_time;
int has_video;
+ int has_subtitle;
int64_t start_pts;
int64_t end_pts;
double duration; // last segment duration computed so far, in seconds
@@ -92,8 +98,12 @@ typedef struct HLSContext {
HLSSegment *old_segments;
char *basename;
+ char *vtt_basename;
+ char *vtt_m3u8_name;
char *baseurl;
char *format_options_str;
+ char *vtt_format_options_str;
+ char *subtitle_filename;
AVDictionary *format_options;
char *key_info_file;
@@ -101,14 +111,19 @@ typedef struct HLSContext {
char key_uri[LINE_BUFFER_SIZE + 1];
char key_string[KEYSIZE*2 + 1];
char iv_string[KEYSIZE*2 + 1];
+ AVDictionary *vtt_format_options;
+
+ char *method;
+
} HLSContext;
static int hls_delete_old_segments(HLSContext *hls) {
HLSSegment *segment, *previous_segment = NULL;
float playlist_duration = 0.0f;
- int ret = 0, path_size;
- char *dirname = NULL, *p, *path;
+ int ret = 0, path_size, sub_path_size;
+ char *dirname = NULL, *p, *sub_path;
+ char *path = NULL;
segment = hls->segments;
while (segment) {
@@ -150,19 +165,35 @@ static int hls_delete_old_segments(HLSContext *hls) {
ret = AVERROR(ENOMEM);
goto fail;
}
+ sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
+ sub_path = av_malloc(sub_path_size);
+ if (!sub_path) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
av_strlcpy(path, dirname, path_size);
av_strlcat(path, segment->filename, path_size);
if (unlink(path) < 0) {
av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
path, strerror(errno));
}
- av_free(path);
+
+ av_strlcpy(sub_path, dirname, sub_path_size);
+ av_strlcat(sub_path, segment->sub_filename, sub_path_size);
+ if (unlink(sub_path) < 0) {
+ av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
+ sub_path, strerror(errno));
+ }
+ av_freep(&path);
+ av_free(sub_path);
previous_segment = segment;
segment = previous_segment->next;
av_free(previous_segment);
}
fail:
+ av_free(path);
av_free(dirname);
return ret;
@@ -226,6 +257,7 @@ static int hls_mux_init(AVFormatContext *s)
{
HLSContext *hls = s->priv_data;
AVFormatContext *oc;
+ AVFormatContext *vtt_oc = NULL;
int i, ret;
ret = avformat_alloc_output_context2(&hls->avf, hls->oformat, NULL, NULL);
@@ -238,9 +270,24 @@ static int hls_mux_init(AVFormatContext *s)
oc->max_delay = s->max_delay;
av_dict_copy(&oc->metadata, s->metadata, 0);
+ if(hls->vtt_oformat) {
+ ret = avformat_alloc_output_context2(&hls->vtt_avf, hls->vtt_oformat, NULL, NULL);
+ if (ret < 0)
+ return ret;
+ vtt_oc = hls->vtt_avf;
+ vtt_oc->oformat = hls->vtt_oformat;
+ av_dict_copy(&vtt_oc->metadata, s->metadata, 0);
+ }
+
for (i = 0; i < s->nb_streams; i++) {
AVStream *st;
- if (!(st = avformat_new_stream(oc, NULL)))
+ AVFormatContext *loc;
+ if (s->streams[i]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
+ loc = vtt_oc;
+ else
+ loc = oc;
+
+ if (!(st = avformat_new_stream(loc, NULL)))
return AVERROR(ENOMEM);
avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
@@ -263,6 +310,9 @@ static int hls_append_segment(HLSContext *hls, double duration, int64_t pos,
av_strlcpy(en->filename, av_basename(hls->avf->filename), sizeof(en->filename));
+ if(hls->has_subtitle)
+ av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), sizeof(en->sub_filename));
+
en->duration = duration;
en->pos = pos;
en->size = size;
@@ -310,6 +360,12 @@ static void hls_free_segments(HLSSegment *p)
}
}
+static void set_http_options(AVDictionary **options, HLSContext *c)
+{
+ if (c->method)
+ av_dict_set(options, "method", c->method, 0);
+}
+
static int hls_window(AVFormatContext *s, int last)
{
HLSContext *hls = s->priv_data;
@@ -317,6 +373,7 @@ static int hls_window(AVFormatContext *s, int last)
int target_duration = 0;
int ret = 0;
AVIOContext *out = NULL;
+ AVIOContext *sub_out = NULL;
char temp_filename[1024];
int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries);
int version = hls->flags & HLS_SINGLE_FILE ? 4 : 3;
@@ -325,13 +382,15 @@ static int hls_window(AVFormatContext *s, int last)
static unsigned warned_non_file;
char *key_uri = NULL;
char *iv_string = NULL;
+ AVDictionary *options = NULL;
if (!use_rename && !warned_non_file++)
av_log(s, AV_LOG_ERROR, "Cannot use rename on non file protocol, this may lead to races and temporarly partial files\n");
+ set_http_options(&options, hls);
snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", s->filename);
if ((ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE,
- &s->interrupt_callback, NULL)) < 0)
+ &s->interrupt_callback, &options)) < 0)
goto fail;
for (en = hls->segments; en; en = en->next) {
@@ -380,8 +439,40 @@ static int hls_window(AVFormatContext *s, int last)
if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)
avio_printf(out, "#EXT-X-ENDLIST\n");
+ if( hls->vtt_m3u8_name ) {
+ if ((ret = avio_open2(&sub_out, hls->vtt_m3u8_name, AVIO_FLAG_WRITE,
+ &s->interrupt_callback, &options)) < 0)
+ goto fail;
+ avio_printf(sub_out, "#EXTM3U\n");
+ avio_printf(sub_out, "#EXT-X-VERSION:%d\n", version);
+ if (hls->allowcache == 0 || hls->allowcache == 1) {
+ avio_printf(sub_out, "#EXT-X-ALLOW-CACHE:%s\n", hls->allowcache == 0 ? "NO" : "YES");
+ }
+ avio_printf(sub_out, "#EXT-X-TARGETDURATION:%d\n", target_duration);
+ avio_printf(sub_out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n", sequence);
+
+ av_log(s, AV_LOG_VERBOSE, "EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
+ sequence);
+
+ for (en = hls->segments; en; en = en->next) {
+ avio_printf(sub_out, "#EXTINF:%f,\n", en->duration);
+ if (hls->flags & HLS_SINGLE_FILE)
+ avio_printf(sub_out, "#EXT-X-BYTERANGE:%"PRIi64"@%"PRIi64"\n",
+ en->size, en->pos);
+ if (hls->baseurl)
+ avio_printf(sub_out, "%s", hls->baseurl);
+ avio_printf(sub_out, "%s\n", en->sub_filename);
+ }
+
+ if (last)
+ avio_printf(sub_out, "#EXT-X-ENDLIST\n");
+
+ }
+
fail:
+ av_dict_free(&options);
avio_closep(&out);
+ avio_closep(&sub_out);
if (ret >= 0 && use_rename)
ff_rename(temp_filename, s->filename, s);
return ret;
@@ -391,37 +482,60 @@ static int hls_start(AVFormatContext *s)
{
HLSContext *c = s->priv_data;
AVFormatContext *oc = c->avf;
+ AVFormatContext *vtt_oc = c->vtt_avf;
AVDictionary *options = NULL;
char *filename, iv_string[KEYSIZE*2 + 1];
int err = 0;
- if (c->flags & HLS_SINGLE_FILE)
+ if (c->flags & HLS_SINGLE_FILE) {
av_strlcpy(oc->filename, c->basename,
sizeof(oc->filename));
- else
- if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
+ if (c->vtt_basename)
+ av_strlcpy(vtt_oc->filename, c->vtt_basename,
+ sizeof(vtt_oc->filename));
+ } else {
+ if (c->use_localtime) {
+ time_t now0;
+ struct tm *tm, tmpbuf;
+ time(&now0);
+ tm = localtime_r(&now0, &tmpbuf);
+ if (!strftime(oc->filename, sizeof(oc->filename), c->basename, tm)) {
+ av_log(oc, AV_LOG_ERROR, "Could not get segment filename with use_localtime\n");
+ return AVERROR(EINVAL);
+ }
+ } else if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
c->basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0) {
- av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", c->basename);
+ av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' you can try use -use_localtime 1 with it\n", c->basename);
return AVERROR(EINVAL);
}
+ if( c->vtt_basename) {
+ if (av_get_frame_filename(vtt_oc->filename, sizeof(vtt_oc->filename),
+ c->vtt_basename, c->wrap ? c->sequence % c->wrap : c->sequence) < 0) {
+ av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", c->vtt_basename);
+ return AVERROR(EINVAL);
+ }
+ }
+ }
c->number++;
+ set_http_options(&options, c);
+
if (c->key_info_file) {
if ((err = hls_encryption_start(s)) < 0)
- return err;
+ goto fail;
if ((err = av_dict_set(&options, "encryption_key", c->key_string, 0))
< 0)
- return err;
+ goto fail;
err = av_strlcpy(iv_string, c->iv_string, sizeof(iv_string));
if (!err)
snprintf(iv_string, sizeof(iv_string), "%032"PRIx64, c->sequence);
if ((err = av_dict_set(&options, "encryption_iv", iv_string, 0)) < 0)
- return err;
+ goto fail;
filename = av_asprintf("crypto:%s", oc->filename);
if (!filename) {
- av_dict_free(&options);
- return AVERROR(ENOMEM);
+ err = AVERROR(ENOMEM);
+ goto fail;
}
err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, &options);
@@ -431,13 +545,27 @@ static int hls_start(AVFormatContext *s)
return err;
} else
if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
- &s->interrupt_callback, NULL)) < 0)
- return err;
+ &s->interrupt_callback, &options)) < 0)
+ goto fail;
+ if (c->vtt_basename) {
+ set_http_options(&options, c);
+ if ((err = avio_open2(&vtt_oc->pb, vtt_oc->filename, AVIO_FLAG_WRITE,
+ &s->interrupt_callback, &options)) < 0)
+ goto fail;
+ }
+ av_dict_free(&options);
if (oc->oformat->priv_class && oc->priv_data)
av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
+ if (c->vtt_basename)
+ avformat_write_header(vtt_oc,NULL);
+
return 0;
+fail:
+ av_dict_free(&options);
+
+ return err;
}
static int hls_write_header(AVFormatContext *s)
@@ -446,8 +574,11 @@ static int hls_write_header(AVFormatContext *s)
int ret, i;
char *p;
const char *pattern = "%d.ts";
+ const char *pattern_localtime_fmt = "-%s.ts";
+ const char *vtt_pattern = "%d.vtt";
AVDictionary *options = NULL;
int basename_size;
+ int vtt_basename_size;
hls->sequence = hls->start_sequence;
hls->recording_time = hls->time * AV_TIME_BASE;
@@ -461,9 +592,12 @@ static int hls_write_header(AVFormatContext *s)
}
}
- for (i = 0; i < s->nb_streams; i++)
+ for (i = 0; i < s->nb_streams; i++) {
hls->has_video +=
s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO;
+ hls->has_subtitle +=
+ s->streams[i]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE;
+ }
if (hls->has_video > 1)
av_log(s, AV_LOG_WARNING,
@@ -477,6 +611,14 @@ static int hls_write_header(AVFormatContext *s)
goto fail;
}
+ if(hls->has_subtitle) {
+ hls->vtt_oformat = av_guess_format("webvtt", NULL, NULL);
+ if (!hls->oformat) {
+ ret = AVERROR_MUXER_NOT_FOUND;
+ goto fail;
+ }
+ }
+
if (hls->segment_filename) {
hls->basename = av_strdup(hls->segment_filename);
if (!hls->basename) {
@@ -487,7 +629,11 @@ static int hls_write_header(AVFormatContext *s)
if (hls->flags & HLS_SINGLE_FILE)
pattern = ".ts";
- basename_size = strlen(s->filename) + strlen(pattern) + 1;
+ if (hls->use_localtime) {
+ basename_size = strlen(s->filename) + strlen(pattern_localtime_fmt) + 1;
+ } else {
+ basename_size = strlen(s->filename) + strlen(pattern) + 1;
+ }
hls->basename = av_malloc(basename_size);
if (!hls->basename) {
ret = AVERROR(ENOMEM);
@@ -499,7 +645,40 @@ static int hls_write_header(AVFormatContext *s)
p = strrchr(hls->basename, '.');
if (p)
*p = '\0';
- av_strlcat(hls->basename, pattern, basename_size);
+ if (hls->use_localtime) {
+ av_strlcat(hls->basename, pattern_localtime_fmt, basename_size);
+ } else {
+ av_strlcat(hls->basename, pattern, basename_size);
+ }
+ }
+
+ if(hls->has_subtitle) {
+
+ if (hls->flags & HLS_SINGLE_FILE)
+ vtt_pattern = ".vtt";
+ vtt_basename_size = strlen(s->filename) + strlen(vtt_pattern) + 1;
+ hls->vtt_basename = av_malloc(vtt_basename_size);
+ if (!hls->vtt_basename) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ hls->vtt_m3u8_name = av_malloc(vtt_basename_size);
+ if (!hls->vtt_m3u8_name ) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ av_strlcpy(hls->vtt_basename, s->filename, vtt_basename_size);
+ p = strrchr(hls->vtt_basename, '.');
+ if (p)
+ *p = '\0';
+
+ if( hls->subtitle_filename ) {
+ strcpy(hls->vtt_m3u8_name, hls->subtitle_filename);
+ } else {
+ strcpy(hls->vtt_m3u8_name, hls->vtt_basename);
+ av_strlcat(hls->vtt_m3u8_name, "_vtt.m3u8", vtt_basename_size);
+ }
+ av_strlcat(hls->vtt_basename, vtt_pattern, vtt_basename_size);
}
if ((ret = hls_mux_init(s)) < 0)
@@ -515,10 +694,19 @@ static int hls_write_header(AVFormatContext *s)
ret = AVERROR(EINVAL);
goto fail;
}
- av_assert0(s->nb_streams == hls->avf->nb_streams);
+ //av_assert0(s->nb_streams == hls->avf->nb_streams);
for (i = 0; i < s->nb_streams; i++) {
- AVStream *inner_st = hls->avf->streams[i];
+ AVStream *inner_st;
AVStream *outer_st = s->streams[i];
+ if (outer_st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
+ inner_st = hls->avf->streams[i];
+ else if (hls->vtt_avf)
+ inner_st = hls->vtt_avf->streams[0];
+ else {
+ /* We have a subtitle stream, when the user does not want one */
+ inner_st = NULL;
+ continue;
+ }
avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits, inner_st->time_base.num, inner_st->time_base.den);
}
fail:
@@ -526,8 +714,12 @@ fail:
av_dict_free(&options);
if (ret < 0) {
av_freep(&hls->basename);
+ av_freep(&hls->vtt_basename);
if (hls->avf)
avformat_free_context(hls->avf);
+ if (hls->vtt_avf)
+ avformat_free_context(hls->vtt_avf);
+
}
return ret;
}
@@ -535,12 +727,20 @@ fail:
static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
{
HLSContext *hls = s->priv_data;
- AVFormatContext *oc = hls->avf;
+ AVFormatContext *oc = NULL;
AVStream *st = s->streams[pkt->stream_index];
int64_t end_pts = hls->recording_time * hls->number;
int is_ref_pkt = 1;
int ret, can_split = 1;
+ int stream_index = 0;
+ if( st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE ) {
+ oc = hls->vtt_avf;
+ stream_index = 0;
+ } else {
+ oc = hls->avf;
+ stream_index = pkt->stream_index;
+ }
if (hls->start_pts == AV_NOPTS_VALUE) {
hls->start_pts = pkt->pts;
hls->end_pts = pkt->pts;
@@ -579,6 +779,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
hls->number++;
} else {
avio_closep(&oc->pb);
+ if (hls->vtt_avf)
+ avio_close(hls->vtt_avf->pb);
ret = hls_start(s);
}
@@ -586,13 +788,16 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
return ret;
+ if( st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE )
+ oc = hls->vtt_avf;
+ else
oc = hls->avf;
if ((ret = hls_window(s, 0)) < 0)
return ret;
}
- ret = ff_write_chained(oc, pkt->stream_index, pkt, s, 0);
+ ret = ff_write_chained(oc, stream_index, pkt, s, 0);
return ret;
}
@@ -601,6 +806,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
{
HLSContext *hls = s->priv_data;
AVFormatContext *oc = hls->avf;
+ AVFormatContext *vtt_oc = hls->vtt_avf;
av_write_trailer(oc);
if (oc->pb) {
@@ -608,8 +814,22 @@ static int hls_write_trailer(struct AVFormatContext *s)
avio_closep(&oc->pb);
hls_append_segment(hls, hls->duration, hls->start_pos, hls->size);
}
+
+ if (vtt_oc) {
+ if (vtt_oc->pb)
+ av_write_trailer(vtt_oc);
+ hls->size = avio_tell(hls->vtt_avf->pb) - hls->start_pos;
+ avio_closep(&vtt_oc->pb);
+ }
av_freep(&hls->basename);
avformat_free_context(oc);
+
+ if (vtt_oc) {
+ av_freep(&hls->vtt_basename);
+ av_freep(&hls->vtt_m3u8_name);
+ avformat_free_context(vtt_oc);
+ }
+
hls->avf = NULL;
hls_window(s, 1);
@@ -625,17 +845,21 @@ static const AVOption options[] = {
{"hls_time", "set segment length in seconds", OFFSET(time), AV_OPT_TYPE_FLOAT, {.dbl = 2}, 0, FLT_MAX, E},
{"hls_list_size", "set maximum number of playlist entries", OFFSET(max_nb_segments), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E},
{"hls_ts_options","set hls mpegts list of options for the container format used for hls", OFFSET(format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
+ {"hls_vtt_options","set hls vtt list of options for the container format used for hls", OFFSET(vtt_format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{"hls_wrap", "set number after which the index wraps", OFFSET(wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},
{"hls_allow_cache", "explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments", OFFSET(allowcache), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, E},
{"hls_base_url", "url to prepend to each playlist entry", OFFSET(baseurl), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{"hls_segment_filename", "filename template for segment files", OFFSET(segment_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{"hls_key_info_file", "file with key URI and key file path", OFFSET(key_info_file), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
+ {"hls_subtitle_path", "set path of hls subtitles", OFFSET(subtitle_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 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"},
{"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"},
{"omit_endlist", "Do not append an endlist when ending stream", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_OMIT_ENDLIST }, 0, UINT_MAX, E, "flags"},
+ { "use_localtime", "set filename expansion with strftime at segment creation", OFFSET(use_localtime), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, E },
+ {"method", "set the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
{ NULL },
};
@@ -655,6 +879,7 @@ AVOutputFormat ff_hls_muxer = {
.priv_data_size = sizeof(HLSContext),
.audio_codec = AV_CODEC_ID_AAC,
.video_codec = AV_CODEC_ID_H264,
+ .subtitle_codec = AV_CODEC_ID_WEBVTT,
.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
.write_header = hls_write_header,
.write_packet = hls_write_packet,
diff --git a/chromium/third_party/ffmpeg/libavformat/http.c b/chromium/third_party/ffmpeg/libavformat/http.c
index 676bfd5c5a8..075dda77b85 100644
--- a/chromium/third_party/ffmpeg/libavformat/http.c
+++ b/chromium/third_party/ffmpeg/libavformat/http.c
@@ -25,8 +25,10 @@
#include <zlib.h>
#endif /* CONFIG_ZLIB */
+#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
+#include "libavutil/time.h"
#include "avformat.h"
#include "http.h"
@@ -44,6 +46,14 @@
* path names). */
#define BUFFER_SIZE MAX_URL_SIZE
#define MAX_REDIRECTS 8
+#define HTTP_SINGLE 1
+#define HTTP_MUTLI 2
+typedef enum {
+ LOWER_PROTO,
+ READ_HEADERS,
+ WRITE_REPLY_HEADERS,
+ FINISH
+}HandshakeState;
typedef struct HTTPContext {
const AVClass *class;
@@ -96,7 +106,16 @@ typedef struct HTTPContext {
int send_expect_100;
char *method;
int reconnect;
+ int reconnect_at_eof;
+ int reconnect_streamed;
+ int reconnect_delay;
+ int reconnect_delay_max;
int listen;
+ char *resource;
+ int reply_code;
+ int is_multi_client;
+ HandshakeState handshake_step;
+ int is_connected_server;
} HTTPContext;
#define OFFSET(x) offsetof(HTTPContext, x)
@@ -128,7 +147,12 @@ static const AVOption options[] = {
{ "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D },
{ "method", "Override the HTTP method or set the expected HTTP method from a client", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D | E },
{ "reconnect", "auto reconnect after disconnect before EOF", OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
- { "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D | E },
+ { "reconnect_at_eof", "auto reconnect at EOF", OFFSET(reconnect_at_eof), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
+ { "reconnect_streamed", "auto reconnect streamed / non seekable streams", OFFSET(reconnect_streamed), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
+ { "reconnect_delay_max", "max reconnect delay in seconds after which to give up", OFFSET(reconnect_delay_max), AV_OPT_TYPE_INT, { .i64 = 120 }, 0, UINT_MAX/1000/1000, D },
+ { "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, D | E },
+ { "resource", "The resource requested by a client", OFFSET(resource), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
+ { "reply_code", "The http status code to return to a client", OFFSET(reply_code), AV_OPT_TYPE_INT, { .i64 = 200}, INT_MIN, 599, E},
{ NULL }
};
@@ -299,51 +323,143 @@ int ff_http_averror(int status_code, int default_averror)
return default_averror;
}
-static void handle_http_errors(URLContext *h, int error)
+static int http_write_reply(URLContext* h, int status_code)
{
- static const char bad_request[] = "HTTP/1.1 400 Bad Request\r\nContent-Type: text/plain\r\n\r\n400 Bad Request\r\n";
- static const char internal_server_error[] = "HTTP/1.1 500 Internal server error\r\nContent-Type: text/plain\r\n\r\n500 Internal server error\r\n";
+ int ret, body = 0, reply_code, message_len;
+ const char *reply_text, *content_type;
HTTPContext *s = h->priv_data;
- if (h->is_connected) {
- switch(error) {
- case AVERROR_HTTP_BAD_REQUEST:
- ffurl_write(s->hd, bad_request, strlen(bad_request));
- break;
- default:
- av_log(h, AV_LOG_ERROR, "Unhandled HTTP error.\n");
- ffurl_write(s->hd, internal_server_error, strlen(internal_server_error));
+ char message[BUFFER_SIZE];
+ content_type = "text/plain";
+
+ if (status_code < 0)
+ body = 1;
+ switch (status_code) {
+ case AVERROR_HTTP_BAD_REQUEST:
+ case 400:
+ reply_code = 400;
+ reply_text = "Bad Request";
+ break;
+ case AVERROR_HTTP_FORBIDDEN:
+ case 403:
+ reply_code = 403;
+ reply_text = "Forbidden";
+ break;
+ case AVERROR_HTTP_NOT_FOUND:
+ case 404:
+ reply_code = 404;
+ reply_text = "Not Found";
+ break;
+ case 200:
+ reply_code = 200;
+ reply_text = "OK";
+ content_type = "application/octet-stream";
+ break;
+ case AVERROR_HTTP_SERVER_ERROR:
+ case 500:
+ reply_code = 500;
+ reply_text = "Internal server error";
+ break;
+ default:
+ return AVERROR(EINVAL);
+ }
+ if (body) {
+ s->chunked_post = 0;
+ message_len = snprintf(message, sizeof(message),
+ "HTTP/1.1 %03d %s\r\n"
+ "Content-Type: %s\r\n"
+ "Content-Length: %zu\r\n"
+ "\r\n"
+ "%03d %s\r\n",
+ reply_code,
+ reply_text,
+ content_type,
+ strlen(reply_text) + 6, // 3 digit status code + space + \r\n
+ reply_code,
+ reply_text);
+ } else {
+ s->chunked_post = 1;
+ message_len = snprintf(message, sizeof(message),
+ "HTTP/1.1 %03d %s\r\n"
+ "Content-Type: %s\r\n"
+ "Transfer-Encoding: chunked\r\n"
+ "\r\n",
+ reply_code,
+ reply_text,
+ content_type);
+ }
+ av_log(h, AV_LOG_TRACE, "HTTP reply header: \n%s----\n", message);
+ if ((ret = ffurl_write(s->hd, message, message_len)) < 0)
+ return ret;
+ return 0;
+}
+
+static void handle_http_errors(URLContext *h, int error)
+{
+ av_assert0(error < 0);
+ http_write_reply(h, error);
+}
+
+static int http_handshake(URLContext *c)
+{
+ int ret, err, new_location;
+ HTTPContext *ch = c->priv_data;
+ URLContext *cl = ch->hd;
+ switch (ch->handshake_step) {
+ case LOWER_PROTO:
+ av_log(c, AV_LOG_TRACE, "Lower protocol\n");
+ if ((ret = ffurl_handshake(cl)) > 0)
+ return 2 + ret;
+ if (ret < 0)
+ return ret;
+ ch->handshake_step = READ_HEADERS;
+ ch->is_connected_server = 1;
+ return 2;
+ case READ_HEADERS:
+ av_log(c, AV_LOG_TRACE, "Read headers\n");
+ if ((err = http_read_header(c, &new_location)) < 0) {
+ handle_http_errors(c, err);
+ return err;
}
+ ch->handshake_step = WRITE_REPLY_HEADERS;
+ return 1;
+ case WRITE_REPLY_HEADERS:
+ av_log(c, AV_LOG_TRACE, "Reply code: %d\n", ch->reply_code);
+ if ((err = http_write_reply(c, ch->reply_code)) < 0)
+ return err;
+ ch->handshake_step = FINISH;
+ return 1;
+ case FINISH:
+ return 0;
}
+ // this should never be reached.
+ return AVERROR(EINVAL);
}
static int http_listen(URLContext *h, const char *uri, int flags,
AVDictionary **options) {
HTTPContext *s = h->priv_data;
int ret;
- static const char header[] = "HTTP/1.1 200 OK\r\nContent-Type: application/octet-stream\r\nTransfer-Encoding: chunked\r\n\r\n";
char hostname[1024], proto[10];
char lower_url[100];
const char *lower_proto = "tcp";
- int port, new_location;
- s->chunked_post = 1;
+ int port;
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
NULL, 0, uri);
if (!strcmp(proto, "https"))
lower_proto = "tls";
ff_url_join(lower_url, sizeof(lower_url), lower_proto, NULL, hostname, port,
NULL);
- av_dict_set(options, "listen", "1", 0);
+ if ((ret = av_dict_set_int(options, "listen", s->listen, 0)) < 0)
+ goto fail;
if ((ret = ffurl_open(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
&h->interrupt_callback, options)) < 0)
goto fail;
- if ((ret = http_read_header(h, &new_location)) < 0)
- goto fail;
- if ((ret = ffurl_write(s->hd, header, strlen(header))) < 0)
- goto fail;
- return 0;
-
+ s->handshake_step = LOWER_PROTO;
+ if (s->listen == HTTP_SINGLE) { /* single client */
+ s->reply_code = 200;
+ while ((ret = http_handshake(h)) > 0);
+ }
fail:
- handle_http_errors(h, ret);
av_dict_free(&s->chained_options);
return ret;
}
@@ -368,9 +484,16 @@ static int http_open(URLContext *h, const char *uri, int flags,
if (s->headers) {
int len = strlen(s->headers);
- if (len < 2 || strcmp("\r\n", s->headers + len - 2))
+ if (len < 2 || strcmp("\r\n", s->headers + len - 2)) {
av_log(h, AV_LOG_WARNING,
"No trailing CRLF found in HTTP header.\n");
+ ret = av_reallocp(&s->headers, len + 3);
+ if (ret < 0)
+ return ret;
+ s->headers[len] = '\r';
+ s->headers[len + 1] = '\n';
+ s->headers[len + 2] = '\0';
+ }
}
if (s->listen) {
@@ -382,6 +505,26 @@ static int http_open(URLContext *h, const char *uri, int flags,
return ret;
}
+static int http_accept(URLContext *s, URLContext **c)
+{
+ int ret;
+ HTTPContext *sc = s->priv_data;
+ HTTPContext *cc;
+ URLContext *sl = sc->hd;
+ URLContext *cl = NULL;
+
+ av_assert0(sc->listen);
+ if ((ret = ffurl_alloc(c, s->filename, s->flags, &sl->interrupt_callback)) < 0)
+ goto fail;
+ cc = (*c)->priv_data;
+ if ((ret = ffurl_accept(sl, &cl)) < 0)
+ goto fail;
+ cc->hd = cl;
+ cc->is_multi_client = 1;
+fail:
+ return ret;
+}
+
static int http_getc(HTTPContext *s)
{
int len;
@@ -576,10 +719,10 @@ static int process_line(URLContext *h, char *line, int line_count,
p = line;
if (line_count == 0) {
- if (s->listen) {
+ if (s->is_connected_server) {
// HTTP method
method = p;
- while (!av_isspace(*p))
+ while (*p && !av_isspace(*p))
p++;
*(p++) = '\0';
av_log(h, AV_LOG_TRACE, "Received method: %s\n", method);
@@ -597,6 +740,8 @@ static int process_line(URLContext *h, char *line, int line_count,
"(%s autodetected %s received)\n", auto_method, method);
return ff_http_averror(400, AVERROR(EIO));
}
+ if (!(s->method = av_strdup(method)))
+ return AVERROR(ENOMEM);
}
// HTTP resource
@@ -607,12 +752,14 @@ static int process_line(URLContext *h, char *line, int line_count,
p++;
*(p++) = '\0';
av_log(h, AV_LOG_TRACE, "Requested resource: %s\n", resource);
+ if (!(s->resource = av_strdup(resource)))
+ return AVERROR(ENOMEM);
// HTTP version
while (av_isspace(*p))
p++;
version = p;
- while (!av_isspace(*p))
+ while (*p && !av_isspace(*p))
p++;
*p = '\0';
if (av_strncasecmp(version, "HTTP/", 5)) {
@@ -1102,16 +1249,25 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
return http_buf_read_compressed(h, buf, size);
#endif /* CONFIG_ZLIB */
read_ret = http_buf_read(h, buf, size);
- if (read_ret < 0 && s->reconnect && !h->is_streamed && s->filesize > 0 && s->off < s->filesize) {
- av_log(h, AV_LOG_INFO, "Will reconnect at %"PRId64".\n", s->off);
- seek_ret = http_seek_internal(h, s->off, SEEK_SET, 1);
- if (seek_ret != s->off) {
- av_log(h, AV_LOG_ERROR, "Failed to reconnect at %"PRId64".\n", s->off);
+ if ( (read_ret < 0 && s->reconnect && (!h->is_streamed || s->reconnect_streamed) && s->filesize > 0 && s->off < s->filesize)
+ || (read_ret == 0 && s->reconnect_at_eof && (!h->is_streamed || s->reconnect_streamed))) {
+ int64_t target = h->is_streamed ? 0 : s->off;
+
+ if (s->reconnect_delay > s->reconnect_delay_max)
+ return AVERROR(EIO);
+
+ av_log(h, AV_LOG_INFO, "Will reconnect at %"PRId64" error=%s.\n", s->off, av_err2str(read_ret));
+ av_usleep(1000U*1000*s->reconnect_delay);
+ s->reconnect_delay = 1 + 2*s->reconnect_delay;
+ seek_ret = http_seek_internal(h, target, SEEK_SET, 1);
+ if (seek_ret != target) {
+ av_log(h, AV_LOG_ERROR, "Failed to reconnect at %"PRId64".\n", target);
return read_ret;
}
read_ret = http_buf_read(h, buf, size);
- }
+ } else
+ s->reconnect_delay = 0;
return read_ret;
}
@@ -1288,7 +1444,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
((whence == SEEK_CUR && off == 0) ||
(whence == SEEK_SET && off == s->off)))
return s->off;
- else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
+ else if ((s->filesize == -1 && whence == SEEK_END))
return AVERROR(ENOSYS);
if (whence == SEEK_CUR)
@@ -1301,6 +1457,9 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
return AVERROR(EINVAL);
s->off = off;
+ if (s->off && h->is_streamed)
+ return AVERROR(ENOSYS);
+
/* we save the old context in case the seek fails */
old_buf_size = s->buf_end - s->buf_ptr;
memcpy(old_buf, s->buf_ptr, old_buf_size);
@@ -1346,6 +1505,8 @@ HTTP_CLASS(http);
URLProtocol ff_http_protocol = {
.name = "http",
.url_open2 = http_open,
+ .url_accept = http_accept,
+ .url_handshake = http_handshake,
.url_read = http_read,
.url_write = http_write,
.url_seek = http_seek,
diff --git a/chromium/third_party/ffmpeg/libavformat/id3v2.c b/chromium/third_party/ffmpeg/libavformat/id3v2.c
index 2289bfc15a7..addf937afd2 100644
--- a/chromium/third_party/ffmpeg/libavformat/id3v2.c
+++ b/chromium/third_party/ffmpeg/libavformat/id3v2.c
@@ -535,6 +535,13 @@ static void free_apic(void *obj)
av_freep(&apic);
}
+static void rstrip_spaces(char *buf)
+{
+ size_t len = strlen(buf);
+ while (len > 0 && buf[len - 1] == ' ')
+ buf[--len] = 0;
+}
+
static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
const char *tag, ID3v2ExtraMeta **extra_meta,
int isv34)
@@ -598,16 +605,20 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
goto fail;
}
- apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
+ apic->buf = av_buffer_alloc(taglen + AV_INPUT_BUFFER_PADDING_SIZE);
if (!apic->buf || !taglen || avio_read(pb, apic->buf->data, taglen) != taglen)
goto fail;
- memset(apic->buf->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(apic->buf->data + taglen, 0, AV_INPUT_BUFFER_PADDING_SIZE);
new_extra->tag = "APIC";
new_extra->data = apic;
new_extra->next = *extra_meta;
*extra_meta = new_extra;
+ // The description must be unique, and some ID3v2 tag writers add spaces
+ // to write several APIC entries with the same description.
+ rstrip_spaces(apic->description);
+
return;
fail:
@@ -1083,6 +1094,9 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = apic->id;
+ if (AV_RB64(apic->buf->data) == 0x89504e470d0a1a0a)
+ st->codec->codec_id = AV_CODEC_ID_PNG;
+
if (apic->description[0])
av_dict_set(&st->metadata, "title", apic->description, 0);
@@ -1091,7 +1105,7 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
av_init_packet(&st->attached_pic);
st->attached_pic.buf = apic->buf;
st->attached_pic.data = apic->buf->data;
- st->attached_pic.size = apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE;
+ st->attached_pic.size = apic->buf->size - AV_INPUT_BUFFER_PADDING_SIZE;
st->attached_pic.stream_index = st->index;
st->attached_pic.flags |= AV_PKT_FLAG_KEY;
diff --git a/chromium/third_party/ffmpeg/libavformat/iff.c b/chromium/third_party/ffmpeg/libavformat/iff.c
index 7235bc1c9c1..8ea3b38ac62 100644
--- a/chromium/third_party/ffmpeg/libavformat/iff.c
+++ b/chromium/third_party/ffmpeg/libavformat/iff.c
@@ -455,7 +455,7 @@ static int iff_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
st->codec->extradata_size = data_size + IFF_EXTRA_VIDEO_SIZE;
- st->codec->extradata = av_malloc(data_size + IFF_EXTRA_VIDEO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_malloc(data_size + IFF_EXTRA_VIDEO_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
if (avio_read(pb, st->codec->extradata + IFF_EXTRA_VIDEO_SIZE, data_size) < 0)
@@ -682,7 +682,7 @@ static int iff_read_header(AVFormatContext *s)
if (!st->codec->extradata) {
st->codec->extradata_size = IFF_EXTRA_VIDEO_SIZE;
- st->codec->extradata = av_malloc(IFF_EXTRA_VIDEO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_malloc(IFF_EXTRA_VIDEO_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/img2.c b/chromium/third_party/ffmpeg/libavformat/img2.c
index cf8a47856f7..50352b53b20 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2.c
@@ -22,13 +22,9 @@
#include "libavutil/avstring.h"
#include "internal.h"
+#include "img2.h"
-typedef struct IdStrMap {
- enum AVCodecID id;
- const char *str;
-} IdStrMap;
-
-static const IdStrMap img_tags[] = {
+const IdStrMap ff_img_tags[] = {
{ AV_CODEC_ID_MJPEG, "jpeg" },
{ AV_CODEC_ID_MJPEG, "jpg" },
{ AV_CODEC_ID_MJPEG, "jps" },
@@ -45,6 +41,7 @@ static const IdStrMap img_tags[] = {
{ AV_CODEC_ID_PBM, "pbm" },
{ AV_CODEC_ID_PAM, "pam" },
{ AV_CODEC_ID_ALIAS_PIX, "pix" },
+ { AV_CODEC_ID_DDS, "dds" },
{ AV_CODEC_ID_MPEG1VIDEO, "mpg1-img" },
{ AV_CODEC_ID_MPEG2VIDEO, "mpg2-img" },
{ AV_CODEC_ID_MPEG4, "mpg4-img" },
@@ -102,5 +99,5 @@ static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str)
enum AVCodecID ff_guess_image2_codec(const char *filename)
{
- return av_str2id(img_tags, filename);
+ return av_str2id(ff_img_tags, filename);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/img2.h b/chromium/third_party/ffmpeg/libavformat/img2.h
index f6b9dd92205..deebcc34a76 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2.h
+++ b/chromium/third_party/ffmpeg/libavformat/img2.h
@@ -62,6 +62,13 @@ typedef struct VideoDemuxData {
int ts_from_file;
} VideoDemuxData;
+typedef struct IdStrMap {
+ enum AVCodecID id;
+ const char *str;
+} IdStrMap;
+
+extern const IdStrMap ff_img_tags[];
+
extern const AVOption ff_img_options[];
int ff_img_read_header(AVFormatContext *s1);
diff --git a/chromium/third_party/ffmpeg/libavformat/img2dec.c b/chromium/third_party/ffmpeg/libavformat/img2dec.c
index 0830f0073c7..70f0b09f180 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2dec.c
@@ -609,6 +609,17 @@ static int bmp_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION / 4;
}
+static int dds_probe(AVProbeData *p)
+{
+ const uint8_t *b = p->buf;
+
+ if ( AV_RB64(b) == 0x444453207c000000
+ && AV_RL32(b + 8)
+ && AV_RL32(b + 12))
+ return AVPROBE_SCORE_MAX - 1;
+ return 0;
+}
+
static int dpx_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
@@ -649,18 +660,14 @@ static int j2k_probe(AVProbeData *p)
static int jpeg_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
- int i, state = 0xD8, exif_size = 0;
+ int i, state = 0xD8;
if (AV_RB16(b) != 0xFFD8 ||
AV_RB32(b) == 0xFFD8FFF7)
return 0;
b += 2;
- if (AV_RB16(b) == 0xFFE1 && AV_RB32(b + 4) == AV_RB32("Exif")) {
- exif_size = AV_RB16(b + 2) + 2;
- b += exif_size;
- }
- for (i = 0; i + exif_size < p->buf_size - 2; i++) {
+ for (i = 0; i < p->buf_size - 3; i++) {
int c;
if (b[i] != 0xFF)
continue;
@@ -689,6 +696,24 @@ static int jpeg_probe(AVProbeData *p)
return 0;
state = 0xD9;
break;
+ case 0xE0:
+ case 0xE1:
+ case 0xE2:
+ case 0xE3:
+ case 0xE4:
+ case 0xE5:
+ case 0xE6:
+ case 0xE7:
+ case 0xE8:
+ case 0xE9:
+ case 0xEA:
+ case 0xEB:
+ case 0xEC:
+ case 0xED:
+ case 0xEE:
+ case 0xEF:
+ i += AV_RB16(&b[i + 2]) + 1;
+ break;
default:
if ( (c >= 0x02 && c <= 0xBF)
|| c == 0xC8)
@@ -714,9 +739,15 @@ static int qdraw_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
- if (!b[10] && AV_RB32(b+11) == 0x1102ff0c && !b[15] ||
- p->buf_size >= 528 && !b[522] && AV_RB32(b+523) == 0x1102ff0c && !b[527])
- return AVPROBE_SCORE_EXTENSION + 1;
+ if ( p->buf_size >= 528
+ && (AV_RB64(b + 520) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
+ && AV_RB16(b + 520)
+ && AV_RB16(b + 518))
+ return AVPROBE_SCORE_MAX * 3 / 4;
+ if ( (AV_RB64(b + 8) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
+ && AV_RB16(b + 8)
+ && AV_RB16(b + 6))
+ return AVPROBE_SCORE_EXTENSION / 4;
return 0;
}
@@ -799,6 +830,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
};
IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP)
+IMAGEAUTO_DEMUXER(dds, AV_CODEC_ID_DDS)
IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX)
IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR)
IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000)
diff --git a/chromium/third_party/ffmpeg/libavformat/img2enc.c b/chromium/third_party/ffmpeg/libavformat/img2enc.c
index f56c39e6d36..48454fe1d20 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2enc.c
@@ -30,6 +30,7 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "img2.h"
typedef struct VideoMuxData {
const AVClass *class; /**< Class for private options. */
@@ -116,7 +117,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if (img->split_planes) {
int ysize = codec->width * codec->height;
int usize = FF_CEIL_RSHIFT(codec->width, desc->log2_chroma_w) * FF_CEIL_RSHIFT(codec->height, desc->log2_chroma_h);
- if (desc->comp[0].depth_minus1 >= 8) {
+ if (desc->comp[0].depth >= 9) {
ysize *= 2;
usize *= 2;
}
@@ -172,6 +173,17 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int query_codec(enum AVCodecID id, int std_compliance)
+{
+ int i;
+ for (i = 0; ff_img_tags[i].id != AV_CODEC_ID_NONE; i++)
+ if (ff_img_tags[i].id == id)
+ return 1;
+
+ // Anything really can be stored in img2
+ return std_compliance < FF_COMPLIANCE_NORMAL;
+}
+
#define OFFSET(x) offsetof(VideoMuxData, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption muxoptions[] = {
@@ -200,6 +212,7 @@ AVOutputFormat ff_image2_muxer = {
.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
.write_packet = write_packet,
+ .query_codec = query_codec,
.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
.priv_class = &img2mux_class,
};
@@ -212,6 +225,7 @@ AVOutputFormat ff_image2pipe_muxer = {
.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
.write_packet = write_packet,
+ .query_codec = query_codec,
.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/internal.h b/chromium/third_party/ffmpeg/libavformat/internal.h
index f90df902421..bd8a0bcf8a9 100644
--- a/chromium/third_party/ffmpeg/libavformat/internal.h
+++ b/chromium/third_party/ffmpeg/libavformat/internal.h
@@ -31,6 +31,8 @@
#define PROBE_BUF_MIN 2048
#define PROBE_BUF_MAX (1 << 20)
+#define MAX_PROBE_PACKETS 2500
+
#ifdef DEBUG
# define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size)
#else
@@ -47,6 +49,18 @@ typedef struct CodecMime{
enum AVCodecID id;
} CodecMime;
+/*************************************************/
+/* fractional numbers for exact pts handling */
+
+/**
+ * The exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be 0 <= num < den.
+ */
+typedef struct FFFrac {
+ int64_t val, num, den;
+} FFFrac;
+
+
struct AVFormatInternal {
/**
* Number of streams relevant for interleaving.
@@ -254,6 +268,8 @@ int ff_add_index_entry(AVIndexEntry **index_entries,
unsigned int *index_entries_allocated_size,
int64_t pos, int64_t timestamp, int size, int distance, int flags);
+void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance);
+
/**
* Add a new chapter.
*
@@ -447,7 +463,7 @@ uint8_t *ff_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
int size);
/**
- * Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
+ * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0.
*
* @param size size of extradata
@@ -456,7 +472,7 @@ uint8_t *ff_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
int ff_alloc_extradata(AVCodecContext *avctx, int size);
/**
- * Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
+ * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0 and fill it from pb.
*
* @param size size of extradata
diff --git a/chromium/third_party/ffmpeg/libavformat/ipmovie.c b/chromium/third_party/ffmpeg/libavformat/ipmovie.c
index af518b59d3d..51aed323a24 100644
--- a/chromium/third_party/ffmpeg/libavformat/ipmovie.c
+++ b/chromium/third_party/ffmpeg/libavformat/ipmovie.c
@@ -78,7 +78,7 @@
#define PALETTE_COUNT 256
typedef struct IPMVEContext {
-
+ AVFormatContext *avf;
unsigned char *buf;
int buf_size;
@@ -212,6 +212,31 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
return chunk_type;
}
+static int init_audio(AVFormatContext *s)
+{
+ IPMVEContext *ipmovie = s->priv_data;
+ AVStream *st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+ avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
+ ipmovie->audio_stream_index = st->index;
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codec->codec_id = ipmovie->audio_type;
+ st->codec->codec_tag = 0; /* no tag */
+ st->codec->channels = ipmovie->audio_channels;
+ st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
+ AV_CH_LAYOUT_STEREO;
+ st->codec->sample_rate = ipmovie->audio_sample_rate;
+ st->codec->bits_per_coded_sample = ipmovie->audio_bits;
+ st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
+ st->codec->bits_per_coded_sample;
+ if (st->codec->codec_id == AV_CODEC_ID_INTERPLAY_DPCM)
+ st->codec->bit_rate /= 2;
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
+
+ return 0;
+}
+
/* This function loads and processes a single chunk in an IP movie file.
* It returns the type of chunk that was processed. */
static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
@@ -516,6 +541,9 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
}
}
+ if (s->avf->nb_streams == 1 && s->audio_type)
+ init_audio(s->avf);
+
/* make a note of where the stream is sitting */
s->next_chunk_offset = avio_tell(pb);
@@ -551,6 +579,8 @@ static int ipmovie_read_header(AVFormatContext *s)
int chunk_type, i;
uint8_t signature_buffer[sizeof(signature)];
+ ipmovie->avf = s;
+
avio_read(pb, signature_buffer, sizeof(signature_buffer));
while (memcmp(signature_buffer, signature, sizeof(signature))) {
memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
@@ -600,25 +630,9 @@ static int ipmovie_read_header(AVFormatContext *s)
st->codec->bits_per_coded_sample = ipmovie->video_bpp;
if (ipmovie->audio_type) {
- st = avformat_new_stream(s, NULL);
- if (!st)
- return AVERROR(ENOMEM);
- avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
- ipmovie->audio_stream_index = st->index;
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->codec_id = ipmovie->audio_type;
- st->codec->codec_tag = 0; /* no tag */
- st->codec->channels = ipmovie->audio_channels;
- st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
- AV_CH_LAYOUT_STEREO;
- st->codec->sample_rate = ipmovie->audio_sample_rate;
- st->codec->bits_per_coded_sample = ipmovie->audio_bits;
- st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
- st->codec->bits_per_coded_sample;
- if (st->codec->codec_id == AV_CODEC_ID_INTERPLAY_DPCM)
- st->codec->bit_rate /= 2;
- st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
- }
+ return init_audio(s);
+ } else
+ s->ctx_flags |= AVFMTCTX_NOHEADER;
return 0;
}
@@ -643,7 +657,7 @@ static int ipmovie_read_packet(AVFormatContext *s,
else if (ret == CHUNK_INIT_VIDEO || ret == CHUNK_INIT_AUDIO)
continue;
else
- ret = -1;
+ continue;
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/isom.c b/chromium/third_party/ffmpeg/libavformat/isom.c
index c99f2dc5db1..eff04ff8a22 100644
--- a/chromium/third_party/ffmpeg/libavformat/isom.c
+++ b/chromium/third_party/ffmpeg/libavformat/isom.c
@@ -110,7 +110,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_MJPEG, MKTAG('j', 'p', 'e', 'g') }, /* PhotoJPEG */
{ AV_CODEC_ID_MJPEG, MKTAG('m', 'j', 'p', 'a') }, /* Motion-JPEG (format A) */
- { AV_CODEC_ID_MJPEG, MKTAG('A', 'V', 'D', 'J') }, /* MJPEG with alpha-channel (AVID JFIF meridien compressed) */
+ { AV_CODEC_ID_AVRN , MKTAG('A', 'V', 'D', 'J') }, /* MJPEG with alpha-channel (AVID JFIF meridien compressed) */
/* { AV_CODEC_ID_MJPEG, MKTAG('A', 'V', 'R', 'n') }, *//* MJPEG with alpha-channel (AVID ABVB/Truevision NuVista) */
{ AV_CODEC_ID_MJPEG, MKTAG('d', 'm', 'b', '1') }, /* Motion JPEG OpenDML */
{ AV_CODEC_ID_MJPEGB, MKTAG('m', 'j', 'p', 'b') }, /* Motion-JPEG (format B) */
@@ -258,6 +258,13 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_AIC, MKTAG('i', 'c', 'o', 'd') },
+ { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', '1') },
+ { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', '5') },
+ { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', 'Y') },
+
+ { AV_CODEC_ID_DXV, MKTAG('D', 'X', 'D', '3') },
+ { AV_CODEC_ID_DXV, MKTAG('D', 'X', 'D', 'I') },
+
{ AV_CODEC_ID_NONE, 0 },
};
@@ -447,19 +454,24 @@ static const AVCodecTag mp4_audio_types[] = {
int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb)
{
enum AVCodecID codec_id;
+ unsigned v;
int len, tag;
int ret;
int object_type_id = avio_r8(pb);
avio_r8(pb); /* stream type */
avio_rb24(pb); /* buffer size db */
- avio_rb32(pb); /* max bitrate */
- avio_rb32(pb); /* avg bitrate */
if(avcodec_is_open(st->codec)) {
av_log(fc, AV_LOG_DEBUG, "codec open in read_dec_config_descr\n");
return -1;
}
+ v = avio_rb32(pb);
+ if (v < INT32_MAX)
+ st->codec->rc_max_rate = v;
+
+ st->codec->bit_rate = avio_rb32(pb); /* avg bitrate */
+
codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
if (codec_id)
st->codec->codec_id= codec_id;
diff --git a/chromium/third_party/ffmpeg/libavformat/isom.h b/chromium/third_party/ffmpeg/libavformat/isom.h
index 5d48989fd90..aee9d6e8c79 100644
--- a/chromium/third_party/ffmpeg/libavformat/isom.h
+++ b/chromium/third_party/ffmpeg/libavformat/isom.h
@@ -198,6 +198,14 @@ typedef struct MOVContext {
MOVFragmentIndex** fragment_index_data;
unsigned fragment_index_count;
int atom_depth;
+ unsigned int aax_mode; ///< 'aax' file has been detected
+ uint8_t file_key[20];
+ uint8_t file_iv[20];
+ void *activation_bytes;
+ int activation_bytes_size;
+ void *audible_fixed_key;
+ int audible_fixed_key_size;
+ struct AVAES *aes_decrypt;
} MOVContext;
int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/chromium/third_party/ffmpeg/libavformat/ivfenc.c b/chromium/third_party/ffmpeg/libavformat/ivfenc.c
index 1d76c5c7cb7..2053c509f9f 100644
--- a/chromium/third_party/ffmpeg/libavformat/ivfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/ivfenc.c
@@ -20,6 +20,11 @@
#include "avformat.h"
#include "libavutil/intreadwrite.h"
+typedef struct IVFEncContext {
+ unsigned frame_cnt;
+ uint64_t last_pts, sum_delta_pts;
+} IVFEncContext;
+
static int ivf_write_header(AVFormatContext *s)
{
AVCodecContext *ctx;
@@ -43,7 +48,7 @@ static int ivf_write_header(AVFormatContext *s)
avio_wl16(pb, ctx->height);
avio_wl32(pb, s->streams[0]->time_base.den);
avio_wl32(pb, s->streams[0]->time_base.num);
- avio_wl64(pb, s->streams[0]->duration); // TODO: duration or number of frames?!?
+ avio_wl64(pb, 0xFFFFFFFFFFFFFFFFULL);
return 0;
}
@@ -51,14 +56,36 @@ static int ivf_write_header(AVFormatContext *s)
static int ivf_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVIOContext *pb = s->pb;
+ IVFEncContext *ctx = s->priv_data;
+
avio_wl32(pb, pkt->size);
avio_wl64(pb, pkt->pts);
avio_write(pb, pkt->data, pkt->size);
+ if (ctx->frame_cnt)
+ ctx->sum_delta_pts += pkt->pts - ctx->last_pts;
+ ctx->frame_cnt++;
+ ctx->last_pts = pkt->pts;
+
+ return 0;
+}
+
+static int ivf_write_trailer(AVFormatContext *s)
+{
+ AVIOContext *pb = s->pb;
+ if (pb->seekable) {
+ IVFEncContext *ctx = s->priv_data;
+ size_t end = avio_tell(pb);
+
+ avio_seek(pb, 24, SEEK_SET);
+ avio_wl64(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1));
+ avio_seek(pb, end, SEEK_SET);
+ }
return 0;
}
AVOutputFormat ff_ivf_muxer = {
+ .priv_data_size = sizeof(IVFEncContext),
.name = "ivf",
.long_name = NULL_IF_CONFIG_SMALL("On2 IVF"),
.extensions = "ivf",
@@ -66,4 +93,5 @@ AVOutputFormat ff_ivf_muxer = {
.video_codec = AV_CODEC_ID_VP8,
.write_header = ivf_write_header,
.write_packet = ivf_write_packet,
+ .write_trailer = ivf_write_trailer,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/jacosubdec.c b/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
index 1ca00558774..5e543634fd3 100644
--- a/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
@@ -172,7 +172,7 @@ static int jacosub_read_header(AVFormatContext *s)
jacosub->timeres = 30;
- av_bprint_init(&header, 1024+FF_INPUT_BUFFER_PADDING_SIZE, 4096);
+ av_bprint_init(&header, 1024+AV_INPUT_BUFFER_PADDING_SIZE, 4096);
while (!avio_feof(pb)) {
int cmd_len;
@@ -240,7 +240,7 @@ static int jacosub_read_header(AVFormatContext *s)
AVPacket *sub = &jacosub->q.subs[i];
read_ts(jacosub, sub->data, &sub->pts, &sub->duration);
}
- ff_subtitles_queue_finalize(&jacosub->q);
+ ff_subtitles_queue_finalize(s, &jacosub->q);
return 0;
fail:
diff --git a/chromium/third_party/ffmpeg/libavformat/jvdec.c b/chromium/third_party/ffmpeg/libavformat/jvdec.c
index 64d31e0ee69..4d4f0c78c53 100644
--- a/chromium/third_party/ffmpeg/libavformat/jvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/jvdec.c
@@ -196,7 +196,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
if (ret < size) {
memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0,
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
pkt->flags |= AV_PKT_FLAG_CORRUPT;
}
pkt->size = ret + JV_PREAMBLE_SIZE;
diff --git a/chromium/third_party/ffmpeg/libavformat/latmenc.c b/chromium/third_party/ffmpeg/libavformat/latmenc.c
index 17dbf33b721..db6977e5853 100644
--- a/chromium/third_party/ffmpeg/libavformat/latmenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/latmenc.c
@@ -124,7 +124,8 @@ static void latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
if (!ctx->channel_conf) {
GetBitContext gb;
- init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ int ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size);
+ av_assert0(ret >= 0); // extradata size has been checked already, so this should not fail
skip_bits_long(&gb, ctx->off + 3);
avpriv_copy_pce_data(bs, &gb);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/libsmbclient.c b/chromium/third_party/ffmpeg/libavformat/libsmbclient.c
index 1af8163674c..84fef7f1620 100644
--- a/chromium/third_party/ffmpeg/libavformat/libsmbclient.c
+++ b/chromium/third_party/ffmpeg/libavformat/libsmbclient.c
@@ -287,6 +287,67 @@ static int libsmbc_close_dir(URLContext *h)
return 0;
}
+static int libsmbc_delete(URLContext *h)
+{
+ LIBSMBContext *libsmbc = h->priv_data;
+ int ret;
+ struct stat st;
+
+ if ((ret = libsmbc_connect(h)) < 0)
+ goto cleanup;
+
+ if ((libsmbc->fd = smbc_open(h->filename, O_WRONLY, 0666)) < 0) {
+ ret = AVERROR(errno);
+ goto cleanup;
+ }
+
+ if (smbc_fstat(libsmbc->fd, &st) < 0) {
+ ret = AVERROR(errno);
+ goto cleanup;
+ }
+
+ smbc_close(libsmbc->fd);
+ libsmbc->fd = -1;
+
+ if (S_ISDIR(st.st_mode)) {
+ if (smbc_rmdir(h->filename) < 0) {
+ ret = AVERROR(errno);
+ goto cleanup;
+ }
+ } else {
+ if (smbc_unlink(h->filename) < 0) {
+ ret = AVERROR(errno);
+ goto cleanup;
+ }
+ }
+
+ ret = 0;
+
+cleanup:
+ libsmbc_close(h);
+ return ret;
+}
+
+static int libsmbc_move(URLContext *h_src, URLContext *h_dst)
+{
+ LIBSMBContext *libsmbc = h_src->priv_data;
+ int ret;
+
+ if ((ret = libsmbc_connect(h_src)) < 0)
+ goto cleanup;
+
+ if ((libsmbc->dh = smbc_rename(h_src->filename, h_dst->filename)) < 0) {
+ ret = AVERROR(errno);
+ goto cleanup;
+ }
+
+ ret = 0;
+
+cleanup:
+ libsmbc_close(h_src);
+ return ret;
+}
+
#define OFFSET(x) offsetof(LIBSMBContext, x)
#define D AV_OPT_FLAG_DECODING_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
@@ -311,6 +372,8 @@ URLProtocol ff_libsmbclient_protocol = {
.url_write = libsmbc_write,
.url_seek = libsmbc_seek,
.url_close = libsmbc_close,
+ .url_delete = libsmbc_delete,
+ .url_move = libsmbc_move,
.url_open_dir = libsmbc_open_dir,
.url_read_dir = libsmbc_read_dir,
.url_close_dir = libsmbc_close_dir,
diff --git a/chromium/third_party/ffmpeg/libavformat/libssh.c b/chromium/third_party/ffmpeg/libavformat/libssh.c
index fac6114210c..3c056f874ad 100644
--- a/chromium/third_party/ffmpeg/libavformat/libssh.c
+++ b/chromium/third_party/ffmpeg/libavformat/libssh.c
@@ -24,6 +24,7 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/attributes.h"
+#include "libavformat/avio.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"
@@ -33,6 +34,7 @@ typedef struct {
ssh_session session;
sftp_session sftp;
sftp_file file;
+ sftp_dir dir;
int64_t filesize;
int rw_timeout;
int trunc;
@@ -187,11 +189,11 @@ static av_cold int libssh_close(URLContext *h)
return 0;
}
-static av_cold int libssh_open(URLContext *h, const char *url, int flags)
+static av_cold int libssh_connect(URLContext *h, const char *url, char *path, size_t path_size)
{
LIBSSHContext *libssh = h->priv_data;
- char proto[10], path[MAX_URL_SIZE], hostname[1024], credencials[1024];
- int port, ret;
+ char proto[10], hostname[1024], credencials[1024];
+ int port = 22, ret;
const char *user = NULL, *pass = NULL;
char *end = NULL;
@@ -199,23 +201,38 @@ static av_cold int libssh_open(URLContext *h, const char *url, int flags)
credencials, sizeof(credencials),
hostname, sizeof(hostname),
&port,
- path, sizeof(path),
+ path, path_size,
url);
+ if (!(*path))
+ av_strlcpy(path, "/", path_size);
+
// a port of 0 will use a port from ~/.ssh/config or the default value 22
if (port < 0 || port > 65535)
port = 0;
if ((ret = libssh_create_ssh_session(libssh, hostname, port)) < 0)
- goto fail;
+ return ret;
user = av_strtok(credencials, ":", &end);
pass = av_strtok(end, ":", &end);
if ((ret = libssh_authentication(libssh, user, pass)) < 0)
- goto fail;
+ return ret;
if ((ret = libssh_create_sftp_session(libssh)) < 0)
+ return ret;
+
+ return 0;
+}
+
+static av_cold int libssh_open(URLContext *h, const char *url, int flags)
+{
+ int ret;
+ LIBSSHContext *libssh = h->priv_data;
+ char path[MAX_URL_SIZE];
+
+ if ((ret = libssh_connect(h, url, path, sizeof(path))) < 0)
goto fail;
if ((ret = libssh_open_file(libssh, flags, path)) < 0)
@@ -293,6 +310,168 @@ static int libssh_write(URLContext *h, const unsigned char *buf, int size)
return bytes_written;
}
+static int libssh_open_dir(URLContext *h)
+{
+ LIBSSHContext *libssh = h->priv_data;
+ int ret;
+ char path[MAX_URL_SIZE];
+
+ if ((ret = libssh_connect(h, h->filename, path, sizeof(path))) < 0)
+ goto fail;
+
+ if (!(libssh->dir = sftp_opendir(libssh->sftp, path))) {
+ av_log(libssh, AV_LOG_ERROR, "Error opening sftp dir: %s\n", ssh_get_error(libssh->session));
+ ret = AVERROR(EIO);
+ goto fail;
+ }
+
+ return 0;
+
+ fail:
+ libssh_close(h);
+ return ret;
+}
+
+static int libssh_read_dir(URLContext *h, AVIODirEntry **next)
+{
+ LIBSSHContext *libssh = h->priv_data;
+ sftp_attributes attr = NULL;
+ AVIODirEntry *entry;
+
+ *next = entry = ff_alloc_dir_entry();
+ if (!entry)
+ return AVERROR(ENOMEM);
+
+ do {
+ if (attr)
+ sftp_attributes_free(attr);
+ attr = sftp_readdir(libssh->sftp, libssh->dir);
+ if (!attr) {
+ av_freep(next);
+ if (sftp_dir_eof(libssh->dir))
+ return 0;
+ return AVERROR(EIO);
+ }
+ } while (!strcmp(attr->name, ".") || !strcmp(attr->name, ".."));
+
+ entry->name = av_strdup(attr->name);
+ entry->group_id = attr->gid;
+ entry->user_id = attr->uid;
+ entry->size = attr->size;
+ entry->access_timestamp = INT64_C(1000000) * attr->atime;
+ entry->modification_timestamp = INT64_C(1000000) * attr->mtime;
+ entry->filemode = attr->permissions & 0777;
+ switch(attr->type) {
+ case SSH_FILEXFER_TYPE_REGULAR:
+ entry->type = AVIO_ENTRY_FILE;
+ break;
+ case SSH_FILEXFER_TYPE_DIRECTORY:
+ entry->type = AVIO_ENTRY_DIRECTORY;
+ break;
+ case SSH_FILEXFER_TYPE_SYMLINK:
+ entry->type = AVIO_ENTRY_SYMBOLIC_LINK;
+ break;
+ case SSH_FILEXFER_TYPE_SPECIAL:
+ /* Special type includes: sockets, char devices, block devices and pipes.
+ It is probably better to return unknown type, to not confuse anybody. */
+ case SSH_FILEXFER_TYPE_UNKNOWN:
+ default:
+ entry->type = AVIO_ENTRY_UNKNOWN;
+ }
+ sftp_attributes_free(attr);
+ return 0;
+}
+
+static int libssh_close_dir(URLContext *h)
+{
+ LIBSSHContext *libssh = h->priv_data;
+ if (libssh->dir)
+ sftp_closedir(libssh->dir);
+ libssh->dir = NULL;
+ libssh_close(h);
+ return 0;
+}
+
+static int libssh_delete(URLContext *h)
+{
+ int ret;
+ LIBSSHContext *libssh = h->priv_data;
+ sftp_attributes attr = NULL;
+ char path[MAX_URL_SIZE];
+
+ if ((ret = libssh_connect(h, h->filename, path, sizeof(path))) < 0)
+ goto cleanup;
+
+ if (!(attr = sftp_stat(libssh->sftp, path))) {
+ ret = AVERROR(sftp_get_error(libssh->sftp));
+ goto cleanup;
+ }
+
+ if (attr->type == SSH_FILEXFER_TYPE_DIRECTORY) {
+ if (sftp_rmdir(libssh->sftp, path) < 0) {
+ ret = AVERROR(sftp_get_error(libssh->sftp));
+ goto cleanup;
+ }
+ } else {
+ if (sftp_unlink(libssh->sftp, path) < 0) {
+ ret = AVERROR(sftp_get_error(libssh->sftp));
+ goto cleanup;
+ }
+ }
+
+ ret = 0;
+
+cleanup:
+ if (attr)
+ sftp_attributes_free(attr);
+ libssh_close(h);
+ return ret;
+}
+
+static int libssh_move(URLContext *h_src, URLContext *h_dst)
+{
+ int ret;
+ LIBSSHContext *libssh = h_src->priv_data;
+ char path_src[MAX_URL_SIZE], path_dst[MAX_URL_SIZE];
+ char hostname_src[1024], hostname_dst[1024];
+ char credentials_src[1024], credentials_dst[1024];
+ int port_src = 22, port_dst = 22;
+
+ av_url_split(NULL, 0,
+ credentials_src, sizeof(credentials_src),
+ hostname_src, sizeof(hostname_src),
+ &port_src,
+ path_src, sizeof(path_src),
+ h_src->filename);
+
+ av_url_split(NULL, 0,
+ credentials_dst, sizeof(credentials_dst),
+ hostname_dst, sizeof(hostname_dst),
+ &port_dst,
+ path_dst, sizeof(path_dst),
+ h_dst->filename);
+
+ if (strcmp(credentials_src, credentials_dst) ||
+ strcmp(hostname_src, hostname_dst) ||
+ port_src != port_dst) {
+ return AVERROR(EINVAL);
+ }
+
+ if ((ret = libssh_connect(h_src, h_src->filename, path_src, sizeof(path_src))) < 0)
+ goto cleanup;
+
+ if (sftp_rename(libssh->sftp, path_src, path_dst) < 0) {
+ ret = AVERROR(sftp_get_error(libssh->sftp));
+ goto cleanup;
+ }
+
+ ret = 0;
+
+cleanup:
+ libssh_close(h_src);
+ return ret;
+}
+
#define OFFSET(x) offsetof(LIBSSHContext, x)
#define D AV_OPT_FLAG_DECODING_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
@@ -317,6 +496,11 @@ URLProtocol ff_libssh_protocol = {
.url_write = libssh_write,
.url_seek = libssh_seek,
.url_close = libssh_close,
+ .url_delete = libssh_delete,
+ .url_move = libssh_move,
+ .url_open_dir = libssh_open_dir,
+ .url_read_dir = libssh_read_dir,
+ .url_close_dir = libssh_close_dir,
.priv_data_size = sizeof(LIBSSHContext),
.priv_data_class = &libssh_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
diff --git a/chromium/third_party/ffmpeg/libavformat/lrcdec.c b/chromium/third_party/ffmpeg/libavformat/lrcdec.c
index df61853d2b2..d3655fccd50 100644
--- a/chromium/third_party/ffmpeg/libavformat/lrcdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/lrcdec.c
@@ -210,7 +210,7 @@ static int lrc_read_header(AVFormatContext *s)
}
}
}
- ff_subtitles_queue_finalize(&lrc->q);
+ ff_subtitles_queue_finalize(s, &lrc->q);
ff_metadata_conv_ctx(s, NULL, ff_lrc_metadata_conv);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskadec.c b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
index 3edde1ec34d..756e49c2b9b 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskadec.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
@@ -812,7 +812,7 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num)
/* big-endian ordering; build up number */
while (n++ < size)
- *num = (*num << 8) | avio_r8(pb);
+ *num = ((uint64_t)*num << 8) | avio_r8(pb);
}
return 0;
@@ -1798,7 +1798,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
ffio_init_context(&b, track->codec_priv.data,
track->codec_priv.size,
0, NULL, NULL, NULL, NULL);
- ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size, 0);
+ ret = ff_get_wav_header(s, &b, st->codec, track->codec_priv.size, 0);
if (ret < 0)
return ret;
codec_id = st->codec->codec_id;
@@ -1859,7 +1859,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
} else if (codec_id == AV_CODEC_ID_AAC && !track->codec_priv.size) {
int profile = matroska_aac_profile(track->codec_id);
int sri = matroska_aac_sri(track->audio.samplerate);
- extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
+ extradata = av_mallocz(5 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata)
return AVERROR(ENOMEM);
extradata[0] = (profile << 3) | ((sri & 0x0E) >> 1);
@@ -1872,13 +1872,13 @@ static int matroska_parse_tracks(AVFormatContext *s)
extradata_size = 5;
} else
extradata_size = 2;
- } else if (codec_id == AV_CODEC_ID_ALAC && track->codec_priv.size && track->codec_priv.size < INT_MAX - 12 - FF_INPUT_BUFFER_PADDING_SIZE) {
+ } else if (codec_id == AV_CODEC_ID_ALAC && track->codec_priv.size && track->codec_priv.size < INT_MAX - 12 - AV_INPUT_BUFFER_PADDING_SIZE) {
/* Only ALAC's magic cookie is stored in Matroska's track headers.
* Create the "atom size", "tag", and "tag version" fields the
* decoder expects manually. */
extradata_size = 12 + track->codec_priv.size;
extradata = av_mallocz(extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata)
return AVERROR(ENOMEM);
AV_WB32(extradata, extradata_size);
@@ -1888,7 +1888,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
track->codec_priv.size);
} else if (codec_id == AV_CODEC_ID_TTA) {
extradata_size = 30;
- extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata)
return AVERROR(ENOMEM);
ffio_init_context(&b, extradata, extradata_size, 1,
@@ -2077,7 +2077,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
st->codec->channels = track->audio.channels;
if (!st->codec->bits_per_coded_sample)
st->codec->bits_per_coded_sample = track->audio.bitdepth;
- if (st->codec->codec_id != AV_CODEC_ID_AAC)
+ if (st->codec->codec_id == AV_CODEC_ID_MP3)
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+ else if (st->codec->codec_id != AV_CODEC_ID_AAC)
st->need_parsing = AVSTREAM_PARSE_HEADERS;
if (track->codec_delay > 0) {
st->codec->delay = av_rescale_q(track->codec_delay,
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
index 3b525ad4d4d..2b2d034e00c 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
@@ -44,6 +44,7 @@
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/random_seed.h"
+#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
#include "libavutil/sha.h"
#include "libavutil/stereo3d.h"
@@ -131,6 +132,9 @@ typedef struct MatroskaMuxContext {
int64_t last_track_timestamp[MAX_TRACKS];
+ int64_t* stream_durations;
+ int64_t* stream_duration_offsets;
+
int allow_raw_vfw;
} MatroskaMuxContext;
@@ -305,6 +309,23 @@ static void put_xiph_size(AVIOContext *pb, int size)
}
/**
+ * Free the members allocated in the mux context.
+ */
+static void mkv_free(MatroskaMuxContext *mkv) {
+ if (mkv->main_seekhead) {
+ av_freep(&mkv->main_seekhead->entries);
+ av_freep(&mkv->main_seekhead);
+ }
+ if (mkv->cues) {
+ av_freep(&mkv->cues->entries);
+ av_freep(&mkv->cues);
+ }
+ av_freep(&mkv->tracks);
+ av_freep(&mkv->stream_durations);
+ av_freep(&mkv->stream_duration_offsets);
+}
+
+/**
* Initialize a mkv_seekhead element to be ready to index level 1 Matroska
* elements. If a maximum number of elements is specified, enough space
* will be reserved at the current file location to write a seek head of
@@ -364,8 +385,9 @@ static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid
* @return The file offset where the seekhead was written,
* -1 if an error occurred.
*/
-static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
+static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv)
{
+ mkv_seekhead *seekhead = mkv->main_seekhead;
ebml_master metaseek, seekentry;
int64_t currentpos;
int i;
@@ -402,8 +424,8 @@ static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
currentpos = seekhead->filepos;
}
fail:
- av_freep(&seekhead->entries);
- av_free(seekhead);
+ av_freep(&mkv->main_seekhead->entries);
+ av_freep(&mkv->main_seekhead);
return currentpos;
}
@@ -1151,12 +1173,12 @@ static int mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
return 0;
}
-static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid,
- unsigned int uid, ebml_master *tags)
+static int mkv_write_tag_targets(AVFormatContext *s,
+ unsigned int elementid, unsigned int uid,
+ ebml_master *tags, ebml_master* tag)
{
MatroskaMuxContext *mkv = s->priv_data;
- ebml_master tag, targets;
- AVDictionaryEntry *t = NULL;
+ ebml_master targets;
int ret;
if (!tags->pos) {
@@ -1166,11 +1188,24 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme
*tags = start_ebml_master(s->pb, MATROSKA_ID_TAGS, 0);
}
- tag = start_ebml_master(s->pb, MATROSKA_ID_TAG, 0);
+ *tag = start_ebml_master(s->pb, MATROSKA_ID_TAG, 0);
targets = start_ebml_master(s->pb, MATROSKA_ID_TAGTARGETS, 0);
if (elementid)
put_ebml_uint(s->pb, elementid, uid);
end_ebml_master(s->pb, targets);
+ return 0;
+}
+
+static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid,
+ unsigned int uid, ebml_master *tags)
+{
+ ebml_master tag;
+ int ret;
+ AVDictionaryEntry *t = NULL;
+
+ ret = mkv_write_tag_targets(s, elementid, uid, tags, &tag);
+ if (ret < 0)
+ return ret;
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) {
if (av_strcasecmp(t->key, "title") &&
@@ -1220,6 +1255,25 @@ static int mkv_write_tags(AVFormatContext *s)
if (ret < 0) return ret;
}
+ if (!mkv->is_live) {
+ for (i = 0; i < s->nb_streams; i++) {
+ ebml_master tag_target;
+ ebml_master tag;
+
+ mkv_write_tag_targets(s, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tags, &tag_target);
+
+ tag = start_ebml_master(s->pb, MATROSKA_ID_SIMPLETAG, 0);
+ put_ebml_string(s->pb, MATROSKA_ID_TAGNAME, "DURATION");
+ mkv->stream_duration_offsets[i] = avio_tell(s->pb);
+
+ // Reserve space to write duration as a 20-byte string.
+ // 2 (ebml id) + 1 (data size) + 20 (data)
+ put_ebml_void(s->pb, 23);
+ end_ebml_master(s->pb, tag);
+ end_ebml_master(s->pb, tag_target);
+ }
+ }
+
for (i = 0; i < s->nb_chapters; i++) {
AVChapter *ch = s->chapters[i];
@@ -1361,9 +1415,10 @@ static int mkv_write_header(AVFormatContext *s)
}
mkv->tracks = av_mallocz_array(s->nb_streams, sizeof(*mkv->tracks));
- if (!mkv->tracks)
- return AVERROR(ENOMEM);
-
+ if (!mkv->tracks) {
+ 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);
@@ -1383,11 +1438,13 @@ static int mkv_write_header(AVFormatContext *s)
// 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)
- return AVERROR(ENOMEM);
+ if (!mkv->main_seekhead) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_INFO, avio_tell(pb));
- if (ret < 0) return ret;
+ if (ret < 0) goto fail;
segment_info = start_ebml_master(pb, MATROSKA_ID_INFO, 0);
put_ebml_uint(pb, MATROSKA_ID_TIMECODESCALE, 1000000);
@@ -1430,9 +1487,13 @@ static int mkv_write_header(AVFormatContext *s)
}
end_ebml_master(pb, segment_info);
+ // initialize stream_duration fields
+ mkv->stream_durations = av_mallocz(s->nb_streams * sizeof(int64_t));
+ mkv->stream_duration_offsets = av_mallocz(s->nb_streams * sizeof(int64_t));
+
ret = mkv_write_tracks(s);
if (ret < 0)
- return ret;
+ goto fail;
for (i = 0; i < s->nb_chapters; i++)
mkv->chapter_id_offset = FFMAX(mkv->chapter_id_offset, 1LL - s->chapters[i]->id);
@@ -1440,24 +1501,25 @@ static int mkv_write_header(AVFormatContext *s)
if (mkv->mode != MODE_WEBM) {
ret = mkv_write_chapters(s);
if (ret < 0)
- return ret;
+ goto fail;
ret = mkv_write_tags(s);
if (ret < 0)
- return ret;
+ goto fail;
ret = mkv_write_attachments(s);
if (ret < 0)
- return ret;
+ goto fail;
}
if (!s->pb->seekable && !mkv->is_live)
- mkv_write_seekhead(pb, mkv->main_seekhead);
+ mkv_write_seekhead(pb, mkv);
mkv->cues = mkv_start_cues(mkv->segment_offset);
- if (!mkv->cues)
- return AVERROR(ENOMEM);
-
+ if (!mkv->cues) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
if (pb->seekable && mkv->reserve_cues_space) {
mkv->cues_pos = avio_tell(pb);
put_ebml_void(pb, mkv->reserve_cues_space);
@@ -1484,6 +1546,9 @@ static int mkv_write_header(AVFormatContext *s)
}
return 0;
+fail:
+ mkv_free(mkv);
+ return ret;
}
static int mkv_blockgroup_size(int pkt_size)
@@ -1772,33 +1837,40 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
if (codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
mkv_write_block(s, pb, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe);
- if (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe || add_cue) {
+ if (s->pb->seekable && (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe || add_cue)) {
ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts, mkv->cluster_pos, relative_packet_pos, -1);
if (ret < 0) return ret;
}
} else {
- if (codec->codec_id == AV_CODEC_ID_WEBVTT) {
- duration = mkv_write_vtt_blocks(s, pb, pkt);
- } else {
- ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP,
- mkv_blockgroup_size(pkt->size));
- /* For backward compatibility, prefer convergence_duration. */
- if (pkt->convergence_duration > 0) {
- duration = pkt->convergence_duration;
+ if (codec->codec_id == AV_CODEC_ID_WEBVTT) {
+ duration = mkv_write_vtt_blocks(s, pb, pkt);
+ } else {
+ ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP,
+ mkv_blockgroup_size(pkt->size));
+ /* For backward compatibility, prefer convergence_duration. */
+ if (pkt->convergence_duration > 0) {
+ duration = pkt->convergence_duration;
+ }
+ /* All subtitle blocks are considered to be keyframes. */
+ mkv_write_block(s, pb, MATROSKA_ID_BLOCK, pkt, 1);
+ put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
+ end_ebml_master(pb, blockgroup);
}
- /* All subtitle blocks are considered to be keyframes. */
- mkv_write_block(s, pb, MATROSKA_ID_BLOCK, pkt, 1);
- put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
- end_ebml_master(pb, blockgroup);
- }
- ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts,
- mkv->cluster_pos, relative_packet_pos, duration);
- if (ret < 0)
- return ret;
+ if (s->pb->seekable) {
+ ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts,
+ mkv->cluster_pos, relative_packet_pos, duration);
+ if (ret < 0)
+ return ret;
+ }
}
mkv->duration = FFMAX(mkv->duration, ts + duration);
+
+ if (mkv->stream_durations)
+ mkv->stream_durations[pkt->stream_index] =
+ FFMAX(mkv->stream_durations[pkt->stream_index], ts + duration);
+
return 0;
}
@@ -1968,7 +2040,7 @@ static int mkv_write_trailer(AVFormatContext *s)
return ret;
}
- mkv_write_seekhead(pb, mkv->main_seekhead);
+ mkv_write_seekhead(pb, mkv);
// update the duration
av_log(s, AV_LOG_DEBUG, "end duration = %" PRIu64 "\n", mkv->duration);
@@ -1976,16 +2048,37 @@ static int mkv_write_trailer(AVFormatContext *s)
avio_seek(pb, mkv->duration_offset, SEEK_SET);
put_ebml_float(pb, MATROSKA_ID_DURATION, mkv->duration);
+ // update stream durations
+ if (mkv->stream_durations) {
+ int i;
+ for (i = 0; i < s->nb_streams; ++i) {
+ AVStream *st = s->streams[i];
+ double duration_sec = mkv->stream_durations[i] * av_q2d(st->time_base);
+ char duration_string[20] = "";
+
+ av_log(s, AV_LOG_DEBUG, "stream %d end duration = %" PRIu64 "\n", i,
+ mkv->stream_durations[i]);
+
+ if (!mkv->is_live && mkv->stream_duration_offsets[i] > 0) {
+ avio_seek(pb, mkv->stream_duration_offsets[i], SEEK_SET);
+
+ snprintf(duration_string, 20, "%02d:%02d:%012.9f",
+ (int) duration_sec / 3600, ((int) duration_sec / 60) % 60,
+ fmod(duration_sec, 60));
+
+ put_ebml_binary(pb, MATROSKA_ID_TAGSTRING, duration_string, 20);
+ }
+ }
+ }
+
avio_seek(pb, currentpos, SEEK_SET);
}
if (!mkv->is_live) {
end_ebml_master(pb, mkv->segment);
}
- av_freep(&mkv->tracks);
- av_freep(&mkv->cues->entries);
- av_freep(&mkv->cues);
+ mkv_free(mkv);
return 0;
}
@@ -2097,8 +2190,8 @@ AVOutputFormat ff_webm_muxer = {
.mime_type = "video/webm",
.extensions = "webm",
.priv_data_size = sizeof(MatroskaMuxContext),
- .audio_codec = AV_CODEC_ID_VORBIS,
- .video_codec = AV_CODEC_ID_VP8,
+ .audio_codec = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS,
+ .video_codec = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8,
.subtitle_codec = AV_CODEC_ID_WEBVTT,
.write_header = mkv_write_header,
.write_packet = mkv_write_flush_packet,
diff --git a/chromium/third_party/ffmpeg/libavformat/md5enc.c b/chromium/third_party/ffmpeg/libavformat/md5enc.c
index 8e87f095c99..e1a53684b6f 100644
--- a/chromium/third_party/ffmpeg/libavformat/md5enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/md5enc.c
@@ -107,7 +107,8 @@ AVOutputFormat ff_md5_muxer = {
.write_header = write_header,
.write_packet = write_packet,
.write_trailer = write_trailer,
- .flags = AVFMT_NOTIMESTAMPS,
+ .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
+ AVFMT_TS_NEGATIVE,
.priv_class = &md5enc_class,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/microdvddec.c b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
index a3839051a45..727ff947e7e 100644
--- a/chromium/third_party/ffmpeg/libavformat/microdvddec.c
+++ b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
@@ -141,7 +141,7 @@ static int microdvd_read_header(AVFormatContext *s)
sub->pts = get_pts(line);
sub->duration = get_duration(line);
}
- ff_subtitles_queue_finalize(&microdvd->q);
+ ff_subtitles_queue_finalize(s, &microdvd->q);
if (has_real_fps) {
/* export the FPS info only if set in the file */
microdvd->frame_rate = pts_info;
diff --git a/chromium/third_party/ffmpeg/libavformat/mlvdec.c b/chromium/third_party/ffmpeg/libavformat/mlvdec.c
index aa1ba60d37e..48a429eb23a 100644
--- a/chromium/third_party/ffmpeg/libavformat/mlvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mlvdec.c
@@ -143,7 +143,7 @@ static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int f
vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16);
size -= 164;
} else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) {
- ret = ff_get_wav_header(pb, ast->codec, 16, 0);
+ ret = ff_get_wav_header(avctx, pb, ast->codec, 16, 0);
if (ret < 0)
return ret;
size -= 16;
diff --git a/chromium/third_party/ffmpeg/libavformat/mov.c b/chromium/third_party/ffmpeg/libavformat/mov.c
index 5ea69328011..c57aaeb178d 100644
--- a/chromium/third_party/ffmpeg/libavformat/mov.c
+++ b/chromium/third_party/ffmpeg/libavformat/mov.c
@@ -29,6 +29,7 @@
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
@@ -37,6 +38,8 @@
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/opt.h"
+#include "libavutil/aes.h"
+#include "libavutil/sha.h"
#include "libavutil/timecode.h"
#include "libavcodec/ac3tab.h"
#include "avformat.h"
@@ -769,7 +772,7 @@ static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
- if ((ret = ff_get_wav_header(pb, st->codec, atom.size, 0)) < 0)
+ if ((ret = ff_get_wav_header(c->fc, pb, st->codec, atom.size, 0)) < 0)
av_log(c->fc, AV_LOG_WARNING, "get_wav_header failed\n");
return ret;
@@ -807,6 +810,120 @@ static int mov_read_mdat(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0; /* now go for moov */
}
+#define DRM_BLOB_SIZE 56
+
+static int mov_read_adrm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+ uint8_t intermediate_key[20];
+ uint8_t intermediate_iv[20];
+ uint8_t input[64];
+ uint8_t output[64];
+ uint8_t file_checksum[20];
+ uint8_t calculated_checksum[20];
+ struct AVSHA *sha;
+ int i;
+ int ret = 0;
+ uint8_t *activation_bytes = c->activation_bytes;
+ uint8_t *fixed_key = c->audible_fixed_key;
+
+ c->aax_mode = 1;
+
+ sha = av_sha_alloc();
+ if (!sha)
+ return AVERROR(ENOMEM);
+ c->aes_decrypt = av_aes_alloc();
+ if (!c->aes_decrypt) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ /* drm blob processing */
+ avio_read(pb, output, 8); // go to offset 8, absolute postion 0x251
+ avio_read(pb, input, DRM_BLOB_SIZE);
+ avio_read(pb, output, 4); // go to offset 4, absolute postion 0x28d
+ avio_read(pb, file_checksum, 20);
+
+ av_log(c->fc, AV_LOG_INFO, "[aax] file checksum == "); // required by external tools
+ for (i = 0; i < 20; i++)
+ av_log(sha, AV_LOG_INFO, "%02x", file_checksum[i]);
+ av_log(c->fc, AV_LOG_INFO, "\n");
+
+ /* verify activation data */
+ if (!activation_bytes) {
+ av_log(c->fc, AV_LOG_WARNING, "[aax] activation_bytes option is missing!\n");
+ ret = 0; /* allow ffprobe to continue working on .aax files */
+ goto fail;
+ }
+ if (c->activation_bytes_size != 4) {
+ av_log(c->fc, AV_LOG_FATAL, "[aax] activation_bytes value needs to be 4 bytes!\n");
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ /* verify fixed key */
+ if (c->audible_fixed_key_size != 16) {
+ av_log(c->fc, AV_LOG_FATAL, "[aax] audible_fixed_key value needs to be 16 bytes!\n");
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ /* AAX (and AAX+) key derivation */
+ av_sha_init(sha, 160);
+ av_sha_update(sha, fixed_key, 16);
+ av_sha_update(sha, activation_bytes, 4);
+ av_sha_final(sha, intermediate_key);
+ av_sha_init(sha, 160);
+ av_sha_update(sha, fixed_key, 16);
+ av_sha_update(sha, intermediate_key, 20);
+ av_sha_update(sha, activation_bytes, 4);
+ av_sha_final(sha, intermediate_iv);
+ av_sha_init(sha, 160);
+ av_sha_update(sha, intermediate_key, 16);
+ av_sha_update(sha, intermediate_iv, 16);
+ av_sha_final(sha, calculated_checksum);
+ if (memcmp(calculated_checksum, file_checksum, 20)) { // critical error
+ av_log(c->fc, AV_LOG_ERROR, "[aax] mismatch in checksums!\n");
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ av_aes_init(c->aes_decrypt, intermediate_key, 128, 1);
+ av_aes_crypt(c->aes_decrypt, output, input, DRM_BLOB_SIZE >> 4, intermediate_iv, 1);
+ for (i = 0; i < 4; i++) {
+ // file data (in output) is stored in big-endian mode
+ if (activation_bytes[i] != output[3 - i]) { // critical error
+ av_log(c->fc, AV_LOG_ERROR, "[aax] error in drm blob decryption!\n");
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ }
+ memcpy(c->file_key, output + 8, 16);
+ memcpy(input, output + 26, 16);
+ av_sha_init(sha, 160);
+ av_sha_update(sha, input, 16);
+ av_sha_update(sha, c->file_key, 16);
+ av_sha_update(sha, fixed_key, 16);
+ av_sha_final(sha, c->file_iv);
+
+fail:
+ av_free(sha);
+
+ return ret;
+}
+
+// Audible AAX (and AAX+) bytestream decryption
+static int aax_filter(uint8_t *input, int size, MOVContext *c)
+{
+ int blocks = 0;
+ unsigned char iv[16];
+
+ memcpy(iv, c->file_iv, 16); // iv is overwritten
+ blocks = size >> 4; // trailing bytes are not encrypted!
+ av_aes_init(c->aes_decrypt, c->file_key, 128, 1);
+ av_aes_crypt(c->aes_decrypt, input, input, blocks, iv, 1);
+
+ return 0;
+}
+
/* read major brand, minor version and compatible brands and store them as metadata */
static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
@@ -1024,7 +1141,7 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
char color_parameter_type[5] = { 0 };
- int color_primaries, color_trc, color_matrix;
+ uint16_t color_primaries, color_trc, color_matrix;
int ret;
if (c->fc->nb_streams < 1)
@@ -1130,14 +1247,14 @@ static int mov_read_fiel(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_realloc_extradata(AVCodecContext *codec, MOVAtom atom)
{
int err = 0;
- uint64_t size = (uint64_t)codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
+ uint64_t size = (uint64_t)codec->extradata_size + atom.size + 8 + AV_INPUT_BUFFER_PADDING_SIZE;
if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)
return AVERROR_INVALIDDATA;
if ((err = av_reallocp(&codec->extradata, size)) < 0) {
codec->extradata_size = 0;
return err;
}
- codec->extradata_size = size - FF_INPUT_BUFFER_PADDING_SIZE;
+ codec->extradata_size = size - AV_INPUT_BUFFER_PADDING_SIZE;
return 0;
}
@@ -1159,7 +1276,7 @@ static int64_t mov_read_atom_into_extradata(MOVContext *c, AVIOContext *pb, MOVA
codec->extradata_size -= atom.size - err;
result = err;
}
- memset(buf + 8 + err, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(buf + 8 + err, 0, AV_INPUT_BUFFER_PADDING_SIZE);
return result;
}
@@ -1277,7 +1394,7 @@ static int mov_read_aclr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c, AV_LOG_WARNING, "ignored unknown aclr value (%d)\n", range_value);
break;
}
- av_dlog(c, "color_range: %d\n", codec->color_range);
+ ff_dlog(c, "color_range: %d\n", codec->color_range);
} else {
/* For some reason the whole atom was not added to the extradata */
av_log(c, AV_LOG_ERROR, "aclr not decoded - incomplete atom\n");
@@ -1319,6 +1436,32 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (ret < 0)
return ret;
} else if (atom.size > 8) { /* to read frma, esds atoms */
+ if (st->codec->codec_id == AV_CODEC_ID_ALAC && atom.size >= 24) {
+ uint64_t buffer;
+ ret = ffio_ensure_seekback(pb, 8);
+ if (ret < 0)
+ return ret;
+ buffer = avio_rb64(pb);
+ atom.size -= 8;
+ if ( (buffer & 0xFFFFFFFF) == MKBETAG('f','r','m','a')
+ && buffer >> 32 <= atom.size
+ && buffer >> 32 >= 8) {
+ avio_skip(pb, -8);
+ atom.size += 8;
+ } else if (!st->codec->extradata_size) {
+#define ALAC_EXTRADATA_SIZE 36
+ st->codec->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ st->codec->extradata_size = ALAC_EXTRADATA_SIZE;
+ AV_WB32(st->codec->extradata , ALAC_EXTRADATA_SIZE);
+ AV_WB32(st->codec->extradata + 4, MKTAG('a','l','a','c'));
+ AV_WB64(st->codec->extradata + 12, buffer);
+ avio_read(pb, st->codec->extradata + 20, 16);
+ avio_skip(pb, atom.size - 24);
+ return 0;
+ }
+ }
if ((ret = mov_read_default(c, pb, atom)) < 0)
return ret;
} else
@@ -1567,7 +1710,7 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) {
/* for palette traversal */
unsigned int color_start, color_count, color_end;
- unsigned char a, r, g, b;
+ unsigned int a, r, g, b;
if (color_greyscale) {
int color_index, color_dec;
@@ -1669,6 +1812,15 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
ff_mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample,
flags);
}
+ if (version == 0 || (version == 1 && sc->audio_cid != -2)) {
+ /* can't correctly handle variable sized packet as audio unit */
+ switch (st->codec->codec_id) {
+ case AV_CODEC_ID_MP2:
+ case AV_CODEC_ID_MP3:
+ st->need_parsing = AVSTREAM_PARSE_FULL;
+ break;
+ }
+ }
}
switch (st->codec->codec_id) {
@@ -1774,7 +1926,7 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st)
av_freep(&st->codec->extradata);
st->codec->extradata_size = 0;
- st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);
+ st->codec->extradata = av_mallocz(strlen(buf) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata_size = strlen(buf);
@@ -1802,7 +1954,7 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
val = AV_RB32(st->codec->extradata + 4);
tmcd_ctx->tmcd_flags = val;
if (val & 1)
- st->codec->flags2 |= CODEC_FLAG2_DROP_FRAME_TIMECODE;
+ st->codec->flags2 |= AV_CODEC_FLAG2_DROP_FRAME_TIMECODE;
st->codec->time_base.den = st->codec->extradata[16]; /* number of frame */
st->codec->time_base.num = 1;
/* adjust for per frame dur in counter mode */
@@ -1889,7 +2041,6 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
case AV_CODEC_ID_MP3:
/* force type after stsd for m1a hdlr */
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->need_parsing = AVSTREAM_PARSE_FULL;
break;
case AV_CODEC_ID_GSM:
case AV_CODEC_ID_ADPCM_MS:
@@ -1985,9 +2136,10 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
id = mov_codec_id(st, format);
- av_log(c->fc, AV_LOG_TRACE, "size=%"PRId64" 4CC= %c%c%c%c codec_type=%d\n", size,
+ av_log(c->fc, AV_LOG_TRACE,
+ "size=%"PRId64" 4CC= %c%c%c%c/0x%08x codec_type=%d\n", size,
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
- (format >> 24) & 0xff, st->codec->codec_type);
+ (format >> 24) & 0xff, format, st->codec->codec_type);
if (st->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
st->codec->codec_id = id;
@@ -2211,7 +2363,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
num_bytes = (entries*field_size+4)>>3;
- buf = av_malloc(num_bytes+FF_INPUT_BUFFER_PADDING_SIZE);
+ buf = av_malloc(num_bytes+AV_INPUT_BUFFER_PADDING_SIZE);
if (!buf) {
av_freep(&sc->sample_sizes);
return AVERROR(ENOMEM);
@@ -2354,7 +2506,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_TRACE, "count=%d, duration=%d\n",
count, duration);
- if (FFABS(duration) > (1<<28) && i+2<entries) {
+ if (FFNABS(duration) < -(1<<28) && i+2<entries) {
av_log(c->fc, AV_LOG_WARNING, "CTTS invalid\n");
av_freep(&sc->ctts_data);
sc->ctts_count = 0;
@@ -2689,6 +2841,35 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
}
+static int test_same_origin(const char *src, const char *ref) {
+ char src_proto[64];
+ char ref_proto[64];
+ char src_auth[256];
+ char ref_auth[256];
+ char src_host[256];
+ char ref_host[256];
+ int src_port=-1;
+ int ref_port=-1;
+
+ av_url_split(src_proto, sizeof(src_proto), src_auth, sizeof(src_auth), src_host, sizeof(src_host), &src_port, NULL, 0, src);
+ av_url_split(ref_proto, sizeof(ref_proto), ref_auth, sizeof(ref_auth), ref_host, sizeof(ref_host), &ref_port, NULL, 0, ref);
+
+ if (strlen(src) == 0) {
+ return -1;
+ } else if (strlen(src_auth) + 1 >= sizeof(src_auth) ||
+ strlen(ref_auth) + 1 >= sizeof(ref_auth) ||
+ strlen(src_host) + 1 >= sizeof(src_host) ||
+ strlen(ref_host) + 1 >= sizeof(ref_host)) {
+ return 0;
+ } else if (strcmp(src_proto, ref_proto) ||
+ strcmp(src_auth, ref_auth) ||
+ strcmp(src_host, ref_host) ||
+ src_port != ref_port) {
+ return 0;
+ } else
+ return 1;
+}
+
static int mov_open_dref(MOVContext *c, AVIOContext **pb, const char *src, MOVDref *ref,
AVIOInterruptCB *int_cb)
{
@@ -2699,7 +2880,7 @@ static int mov_open_dref(MOVContext *c, AVIOContext **pb, const char *src, MOVDr
/* try relative path, we do not try the absolute because it can leak information about our
system to an attacker */
- if (ref->nlvl_to > 0 && ref->nlvl_from > 0 && ref->path[0] != '/') {
+ if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
char filename[1025];
const char *src_path;
int i, l;
@@ -2729,9 +2910,23 @@ static int mov_open_dref(MOVContext *c, AVIOContext **pb, const char *src, MOVDr
av_strlcat(filename, "../", sizeof(filename));
av_strlcat(filename, ref->path + l + 1, sizeof(filename));
- if (!c->use_absolute_path && !c->fc->open_cb)
- if(strstr(ref->path + l + 1, "..") || ref->nlvl_from > 1)
+ if (!c->use_absolute_path && !c->fc->open_cb) {
+ int same_origin = test_same_origin(src, filename);
+
+ if (!same_origin) {
+ av_log(c->fc, AV_LOG_ERROR,
+ "Reference with mismatching origin, %s not tried for security reasons, "
+ "set demuxer option use_absolute_path to allow it anyway\n",
+ ref->path);
+ return AVERROR(ENOENT);
+ }
+
+ if(strstr(ref->path + l + 1, "..") ||
+ strstr(ref->path + l + 1, ":") ||
+ (ref->nlvl_from > 1 && same_origin < 0) ||
+ (filename[0] == '/' && src_path == src))
return AVERROR(ENOENT);
+ }
if (strlen(filename) + 1 == sizeof(filename))
return AVERROR(ENOENT);
@@ -3233,7 +3428,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int64_t dts;
int data_offset = 0;
unsigned entries, first_sample_flags = frag->flags;
- int flags, distance, i, found_keyframe = 0, err;
+ int flags, distance, i, err;
for (i = 0; i < c->fc->nb_streams; i++) {
if (c->fc->streams[i]->id == frag->track_id) {
@@ -3320,8 +3515,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc->ctts_count++;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
keyframe = 1;
- else if (!found_keyframe)
- keyframe = found_keyframe =
+ else
+ keyframe =
!(sample_flags & (MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC |
MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES));
if (keyframe)
@@ -3585,6 +3780,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('e','l','s','t'), mov_read_elst },
{ MKTAG('e','n','d','a'), mov_read_enda },
{ MKTAG('f','i','e','l'), mov_read_fiel },
+{ MKTAG('a','d','r','m'), mov_read_adrm },
{ MKTAG('f','t','y','p'), mov_read_ftyp },
{ MKTAG('g','l','b','l'), mov_read_glbl },
{ MKTAG('h','d','l','r'), mov_read_hdlr },
@@ -3964,6 +4160,9 @@ static int mov_read_close(AVFormatContext *s)
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;
+ if (!sc)
+ continue;
+
av_freep(&sc->ctts_data);
for (j = 0; j < sc->drefs_count; j++) {
av_freep(&sc->drefs[j].path);
@@ -4003,6 +4202,8 @@ static int mov_read_close(AVFormatContext *s)
}
av_freep(&mov->fragment_index_data);
+ av_freep(&mov->aes_decrypt);
+
return 0;
}
@@ -4290,6 +4491,7 @@ static int mov_read_header(AVFormatContext *s)
break;
}
}
+ ff_configure_buffers_for_index(s, AV_TIME_BASE);
return 0;
}
@@ -4421,6 +4623,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0;
pkt->pos = sample->pos;
+ if (mov->aax_mode)
+ aax_filter(pkt->data, pkt->size, mov);
+
return 0;
}
@@ -4511,17 +4716,17 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
static const AVOption mov_options[] = {
{"use_absolute_path",
"allow using absolute path when opening alias, this is a possible security issue",
- OFFSET(use_absolute_path), FF_OPT_TYPE_INT, {.i64 = 0},
+ OFFSET(use_absolute_path), AV_OPT_TYPE_INT, {.i64 = 0},
0, 1, FLAGS},
{"seek_streams_individually",
"Seek each stream individually to the to the closest point",
OFFSET(seek_individually), AV_OPT_TYPE_INT, { .i64 = 1 },
0, 1, FLAGS},
- {"ignore_editlist", "", OFFSET(ignore_editlist), FF_OPT_TYPE_INT, {.i64 = 0},
+ {"ignore_editlist", "", OFFSET(ignore_editlist), AV_OPT_TYPE_INT, {.i64 = 0},
0, 1, FLAGS},
{"use_mfra_for",
"use mfra for fragment timestamps",
- OFFSET(use_mfra_for), FF_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
+ OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-1, FF_MOV_FLAG_MFRA_PTS, FLAGS,
"use_mfra_for"},
{"auto", "auto", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_MFRA_AUTO}, 0, 0,
@@ -4531,9 +4736,15 @@ static const AVOption mov_options[] = {
{"pts", "pts", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_MFRA_PTS}, 0, 0,
FLAGS, "use_mfra_for" },
{ "export_all", "Export unrecognized metadata entries", OFFSET(export_all),
- AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS },
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = FLAGS },
{ "export_xmp", "Export full XMP metadata", OFFSET(export_xmp),
- AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS },
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = FLAGS },
+ { "activation_bytes", "Secret bytes for Audible AAX files", OFFSET(activation_bytes),
+ AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_DECODING_PARAM },
+ { "audible_fixed_key", // extracted from libAAX_SDK.so and AAXSDKWin.dll files!
+ "Fixed key used for handling Audible AAX files", OFFSET(audible_fixed_key),
+ AV_OPT_TYPE_BINARY, {.str="77214d4b196a87cd520045fd20a51d67"},
+ .flags = AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavformat/movenc.c b/chromium/third_party/ffmpeg/libavformat/movenc.c
index adde4b2c230..08d0c2a7720 100644
--- a/chromium/third_party/ffmpeg/libavformat/movenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/movenc.c
@@ -66,6 +66,7 @@ static const AVOption options[] = {
{ "dash", "Write DASH compatible fragmented MP4", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_DASH}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
{ "frag_discont", "Signal that the next fragment is discontinuous from earlier ones", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_DISCONT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
{ "delay_moov", "Delay writing the initial moov until the first fragment is cut, or until the first fragment flush", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_DELAY_MOOV}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
+ { "global_sidx", "Write a global sidx index at the start of the file", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_GLOBAL_SIDX}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
{ "write_colr", "Write colr atom (Experimental, may be renamed or changed, do not use from scripts)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
{ "write_gama", "Write deprecated gama atom", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_WRITE_GAMA}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
@@ -733,7 +734,7 @@ static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
"dvc1 atom. Set the delay_moov flag to fix this.\n");
}
- unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE);
+ unescaped = av_mallocz(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!unescaped)
return AVERROR(ENOMEM);
start = find_next_marker(track->vos_data, end);
@@ -2573,7 +2574,7 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
int ret, size;
uint8_t *buf;
- if (!st || mov->fc->flags & AVFMT_FLAG_BITEXACT)
+ if (!st)
return 0;
ret = avio_open_dyn_buf(&pb_buf);
@@ -2919,9 +2920,10 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);
mov_write_string_metadata(s, pb, "\251alb", "album" , 1);
mov_write_string_metadata(s, pb, "\251day", "date" , 1);
- if (!mov->exact &&
- !mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1))
- mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
+ if (!mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1)) {
+ if (!(s->flags & AVFMT_FLAG_BITEXACT))
+ mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
+ }
mov_write_string_metadata(s, pb, "\251cmt", "comment" , 1);
mov_write_string_metadata(s, pb, "\251gen", "genre" , 1);
mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
@@ -3115,7 +3117,6 @@ static void mov_write_psp_udta_tag(AVIOContext *pb,
static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
{
- MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
int64_t pos, pos2;
@@ -3140,7 +3141,7 @@ static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
avio_wb16(pb, 0x0); /* ? */
avio_wb16(pb, 0x021C); /* data */
- if (!mov->exact)
+ if (!(s->flags & AVFMT_FLAG_BITEXACT))
mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
mov_write_psp_udta_tag(pb, title->value, "eng", 0x01);
mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
@@ -3275,7 +3276,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
avio_printf(pb, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
avio_printf(pb, "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
avio_printf(pb, "<head>\n");
- if (!mov->exact)
+ if (!(mov->fc->flags & AVFMT_FLAG_BITEXACT))
avio_printf(pb, "<meta name=\"creator\" content=\"%s\" />\n",
LIBAVFORMAT_IDENT);
avio_printf(pb, "</head>\n");
@@ -3680,6 +3681,8 @@ static int mov_write_sidx_tag(AVIOContext *pb,
}
} else {
entries = track->nb_frag_info;
+ if (entries <= 0)
+ return 0;
presentation_time = track->frag_info[0].time;
}
@@ -3763,7 +3766,7 @@ static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks,
mov_write_moof_tag_internal(avio_buf, mov, tracks, 0);
moof_size = ffio_close_null_buf(avio_buf);
- if (mov->flags & FF_MOV_FLAG_DASH && !(mov->flags & FF_MOV_FLAG_FASTSTART))
+ if (mov->flags & FF_MOV_FLAG_DASH && !(mov->flags & FF_MOV_FLAG_GLOBAL_SIDX))
mov_write_sidx_tags(pb, mov, tracks, moof_size + 8 + mdat_size);
if ((ret = mov_add_tfra_entries(pb, mov, tracks, moof_size + 8 + mdat_size)) < 0)
@@ -3903,7 +3906,7 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
else if (mov->mode == MODE_MP4)
ffio_wfourcc(pb, "mp41");
- if (mov->flags & FF_MOV_FLAG_DASH && mov->flags & FF_MOV_FLAG_FASTSTART)
+ if (mov->flags & FF_MOV_FLAG_DASH && mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
ffio_wfourcc(pb, "dash");
return update_size(pb, pos);
@@ -4165,8 +4168,8 @@ static int mov_flush_fragment(AVFormatContext *s)
return ret;
if (mov->flags & FF_MOV_FLAG_DELAY_MOOV) {
- if (mov->flags & FF_MOV_FLAG_FASTSTART)
- mov->reserved_moov_pos = avio_tell(s->pb);
+ if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
+ mov->reserved_header_pos = avio_tell(s->pb);
avio_flush(s->pb);
mov->moov_written = 1;
return 0;
@@ -4179,6 +4182,9 @@ static int mov_flush_fragment(AVFormatContext *s)
avio_write(s->pb, buf, buf_size);
av_free(buf);
+ if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
+ mov->reserved_header_pos = avio_tell(s->pb);
+
mov->moov_written = 1;
mov->mdat_size = 0;
for (i = 0; i < mov->nb_streams; i++) {
@@ -4455,7 +4461,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
* in sidx/tfrf/tfxd tags; make sure the sidx pts and duration match up with
* the next fragment. This means the cts of the first sample must
* be the same in all fragments. */
- if ((mov->flags & FF_MOV_FLAG_DASH && !(mov->flags & FF_MOV_FLAG_FASTSTART)) ||
+ if ((mov->flags & FF_MOV_FLAG_DASH && !(mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)) ||
mov->mode == MODE_ISM)
pkt->pts = pkt->dts + trk->end_pts - trk->cluster[trk->entry].dts;
} else {
@@ -4960,9 +4966,6 @@ static int mov_write_header(AVFormatContext *s)
else if (!strcmp("f4v", s->oformat->name)) mov->mode = MODE_F4V;
}
- if (s->flags & AVFMT_FLAG_BITEXACT)
- mov->exact = 1;
-
if (mov->flags & FF_MOV_FLAG_DELAY_MOOV)
mov->flags |= FF_MOV_FLAG_EMPTY_MOOV;
@@ -5230,7 +5233,7 @@ static int mov_write_header(AVFormatContext *s)
if (mov->reserved_moov_size){
- mov->reserved_moov_pos= avio_tell(pb);
+ mov->reserved_header_pos = avio_tell(pb);
if (mov->reserved_moov_size > 0)
avio_skip(pb, mov->reserved_moov_size);
}
@@ -5243,12 +5246,17 @@ static int mov_write_header(AVFormatContext *s)
mov->flags |= FF_MOV_FLAG_FRAG_KEYFRAME;
} else {
if (mov->flags & FF_MOV_FLAG_FASTSTART)
- mov->reserved_moov_pos = avio_tell(pb);
+ mov->reserved_header_pos = avio_tell(pb);
mov_write_mdat_tag(pb, mov);
}
- if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
+ if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
mov->time = ff_iso8601_to_unix_time(t->value);
+ if (mov->time < 0) {
+ av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", t->value);
+ mov->time = 0;
+ }
+ }
if (mov->time)
mov->time += 0x7C25B080; // 1970 based -> 1904 based
@@ -5297,8 +5305,8 @@ static int mov_write_header(AVFormatContext *s)
if ((ret = mov_write_moov_tag(pb, mov, s)) < 0)
return ret;
mov->moov_written = 1;
- if (mov->flags & FF_MOV_FLAG_FASTSTART)
- mov->reserved_moov_pos = avio_tell(pb);
+ if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
+ mov->reserved_header_pos = avio_tell(pb);
}
return 0;
@@ -5415,10 +5423,10 @@ static int shift_data(AVFormatContext *s)
/* mark the end of the shift to up to the last data we wrote, and get ready
* for writing */
pos_end = avio_tell(s->pb);
- avio_seek(s->pb, mov->reserved_moov_pos + moov_size, SEEK_SET);
+ avio_seek(s->pb, mov->reserved_header_pos + moov_size, SEEK_SET);
/* start reading at where the new moov will be placed */
- avio_seek(read_pb, mov->reserved_moov_pos, SEEK_SET);
+ avio_seek(read_pb, mov->reserved_header_pos, SEEK_SET);
pos = avio_tell(read_pb);
#define READ_BLOCK do { \
@@ -5492,13 +5500,13 @@ static int mov_write_trailer(AVFormatContext *s)
ffio_wfourcc(pb, "mdat");
avio_wb64(pb, mov->mdat_size + 16);
}
- avio_seek(pb, mov->reserved_moov_size > 0 ? mov->reserved_moov_pos : moov_pos, SEEK_SET);
+ avio_seek(pb, mov->reserved_moov_size > 0 ? mov->reserved_header_pos : moov_pos, SEEK_SET);
if (mov->flags & FF_MOV_FLAG_FASTSTART) {
av_log(s, AV_LOG_INFO, "Starting second pass: moving the moov atom to the beginning of the file\n");
res = shift_data(s);
if (res == 0) {
- avio_seek(pb, mov->reserved_moov_pos, SEEK_SET);
+ avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
goto error;
}
@@ -5506,7 +5514,7 @@ static int mov_write_trailer(AVFormatContext *s)
int64_t size;
if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
goto error;
- size = mov->reserved_moov_size - (avio_tell(pb) - mov->reserved_moov_pos);
+ size = mov->reserved_moov_size - (avio_tell(pb) - mov->reserved_header_pos);
if (size < 8){
av_log(s, AV_LOG_ERROR, "reserved_moov_size is too small, needed %"PRId64" additional\n", 8-size);
res = AVERROR(EINVAL);
@@ -5525,12 +5533,12 @@ static int mov_write_trailer(AVFormatContext *s)
mov_auto_flush_fragment(s);
for (i = 0; i < mov->nb_streams; i++)
mov->tracks[i].data_offset = 0;
- if (mov->flags & FF_MOV_FLAG_FASTSTART) {
+ if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX) {
av_log(s, AV_LOG_INFO, "Starting second pass: inserting sidx atoms\n");
res = shift_data(s);
if (res == 0) {
int64_t end = avio_tell(pb);
- avio_seek(pb, mov->reserved_moov_pos, SEEK_SET);
+ avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
mov_write_sidx_tags(pb, mov, -1, 0);
avio_seek(pb, end, SEEK_SET);
mov_write_mfra_tag(pb, mov);
@@ -5588,7 +5596,7 @@ MOV_CLASS(mp4)
AVOutputFormat ff_mp4_muxer = {
.name = "mp4",
.long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
- .mime_type = "application/mp4",
+ .mime_type = "video/mp4",
.extensions = "mp4",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = AV_CODEC_ID_AAC,
@@ -5642,7 +5650,7 @@ MOV_CLASS(ipod)
AVOutputFormat ff_ipod_muxer = {
.name = "ipod",
.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
- .mime_type = "application/mp4",
+ .mime_type = "video/mp4",
.extensions = "m4v,m4a",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = AV_CODEC_ID_AAC,
@@ -5660,7 +5668,7 @@ MOV_CLASS(ismv)
AVOutputFormat ff_ismv_muxer = {
.name = "ismv",
.long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
- .mime_type = "application/mp4",
+ .mime_type = "video/mp4",
.extensions = "ismv,isma",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = AV_CODEC_ID_AAC,
diff --git a/chromium/third_party/ffmpeg/libavformat/movenc.h b/chromium/third_party/ffmpeg/libavformat/movenc.h
index 744d14e5b2d..06adf2b1217 100644
--- a/chromium/third_party/ffmpeg/libavformat/movenc.h
+++ b/chromium/third_party/ffmpeg/libavformat/movenc.h
@@ -164,7 +164,6 @@ typedef struct MOVMuxContext {
int flags;
int rtp_flags;
- int exact;
int iods_skip;
int iods_video_profile;
@@ -182,7 +181,7 @@ typedef struct MOVMuxContext {
int video_track_timescale;
int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise
- int64_t reserved_moov_pos;
+ int64_t reserved_header_pos;
char *major_brand;
@@ -210,8 +209,9 @@ typedef struct MOVMuxContext {
#define FF_MOV_FLAG_DASH (1 << 11)
#define FF_MOV_FLAG_FRAG_DISCONT (1 << 12)
#define FF_MOV_FLAG_DELAY_MOOV (1 << 13)
-#define FF_MOV_FLAG_WRITE_COLR (1 << 14)
-#define FF_MOV_FLAG_WRITE_GAMA (1 << 15)
+#define FF_MOV_FLAG_GLOBAL_SIDX (1 << 14)
+#define FF_MOV_FLAG_WRITE_COLR (1 << 15)
+#define FF_MOV_FLAG_WRITE_GAMA (1 << 16)
int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
diff --git a/chromium/third_party/ffmpeg/libavformat/mp3dec.c b/chromium/third_party/ffmpeg/libavformat/mp3dec.c
index 4023c8223e6..7354c2841bb 100644
--- a/chromium/third_party/ffmpeg/libavformat/mp3dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mp3dec.c
@@ -54,7 +54,7 @@ typedef struct {
int is_cbr;
} MP3DecContext;
-static int check(AVFormatContext *s, int64_t pos);
+static int check(AVIOContext *pb, int64_t pos);
/* mp3 read */
@@ -98,7 +98,7 @@ static int mp3_read_probe(AVProbeData *p)
avcodec_free_context(&avctx);
// keep this in sync with ac3 probe, both need to avoid
// issues with MPEG-files!
- if (first_frames>=4) return AVPROBE_SCORE_EXTENSION + 1;
+ if (first_frames>=7) return AVPROBE_SCORE_EXTENSION + 1;
else if(max_frames>200)return AVPROBE_SCORE_EXTENSION;
else if(max_frames>=4 && max_frames >= p->buf_size/10000) return AVPROBE_SCORE_EXTENSION / 2;
else if(ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size)
@@ -148,6 +148,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
MP3DecContext *mp3 = s->priv_data;
static const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
+ uint64_t fsize = avio_size(s->pb);
+ fsize = fsize >= avio_tell(s->pb) ? fsize - avio_tell(s->pb) : 0;
/* Check for Xing / Info tag */
avio_skip(s->pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]);
@@ -161,6 +163,19 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
mp3->frames = avio_rb32(s->pb);
if (v & XING_FLAG_SIZE)
mp3->header_filesize = avio_rb32(s->pb);
+ if (fsize && mp3->header_filesize) {
+ uint64_t min, delta;
+ min = FFMIN(fsize, mp3->header_filesize);
+ delta = FFMAX(fsize, mp3->header_filesize) - min;
+ if (fsize > mp3->header_filesize && delta > min >> 4) {
+ mp3->frames = 0;
+ av_log(s, AV_LOG_WARNING,
+ "invalid concatenated file detected - using bitrate for duration\n");
+ } else if (delta > min >> 4) {
+ av_log(s, AV_LOG_WARNING,
+ "filesize and duration do not match (growing file?)\n");
+ }
+ }
if (v & XING_FLAG_TOC)
read_xing_toc(s, mp3->header_filesize, av_rescale_q(mp3->frames,
(AVRational){spf, c->sample_rate},
@@ -223,6 +238,14 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
st->first_discard_sample = -mp3->end_pad + 528 + 1 + mp3->frames * (int64_t)spf;
st->last_discard_sample = mp3->frames * (int64_t)spf;
}
+ // TODO(dalecurtis): Chrome expects to handle this start time change
+ // itself, instead of ffmpeg magically moving the start time into
+ // the future.
+ //
+ // if (!st->start_time)
+ // st->start_time = av_rescale_q(st->start_skip_samples,
+ // (AVRational){1, c->sample_rate},
+ // st->time_base);
av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad);
}
@@ -323,7 +346,7 @@ static int mp3_read_header(AVFormatContext *s)
int i;
if (mp3->usetoc < 0)
- mp3->usetoc = (s->flags & AVFMT_FLAG_FAST_SEEK) ? 0 : 2;
+ mp3->usetoc = (s->flags & AVFMT_FLAG_FAST_SEEK) ? 1 : 2;
st = avformat_new_stream(s, NULL);
if (!st)
@@ -357,7 +380,7 @@ static int mp3_read_header(AVFormatContext *s)
for (i = 0; i < 64 * 1024; i++) {
if (!(i&1023))
ffio_ensure_seekback(s->pb, i + 1024 + 4);
- if (check(s, off + i) >= 0) {
+ if (check(s->pb, off + i) >= 0) {
av_log(s, AV_LOG_INFO, "Skipping %d bytes of junk at %"PRId64".\n", i, off);
avio_seek(s->pb, off + i, SEEK_SET);
break;
@@ -396,73 +419,45 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
pkt->stream_index = 0;
- if (ret >= ID3v1_TAG_SIZE &&
- memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0)
- ret -= ID3v1_TAG_SIZE;
-
- /* note: we need to modify the packet size here to handle the last
- packet */
- pkt->size = ret;
return ret;
}
-static int check(AVFormatContext *s, int64_t pos)
+#define SEEK_WINDOW 4096
+
+static int check(AVIOContext *pb, int64_t pos)
{
- int64_t ret = avio_seek(s->pb, pos, SEEK_SET);
+ int64_t ret = avio_seek(pb, pos, SEEK_SET);
unsigned header;
MPADecodeHeader sd;
if (ret < 0)
return ret;
- header = avio_rb32(s->pb);
+
+ header = avio_rb32(pb);
if (ff_mpa_check_header(header) < 0)
return -1;
if (avpriv_mpegaudio_decode_header(&sd, header) == 1)
return -1;
+
return sd.frame_size;
}
-static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
- int flags)
+static int64_t mp3_sync(AVFormatContext *s, int64_t target_pos, int flags)
{
- MP3DecContext *mp3 = s->priv_data;
- AVIndexEntry *ie, ie1;
- AVStream *st = s->streams[0];
- int64_t ret = av_index_search_timestamp(st, timestamp, flags);
- int i, j;
int dir = (flags&AVSEEK_FLAG_BACKWARD) ? -1 : 1;
int64_t best_pos;
- int best_score;
+ int best_score, i, j;
+ int64_t ret;
- if (mp3->usetoc == 2)
- return -1; // generic index code
-
- if ( mp3->is_cbr
- && (mp3->usetoc == 0 || !mp3->xing_toc)
- && st->duration > 0
- && mp3->header_filesize > s->internal->data_offset) {
- ie = &ie1;
- timestamp = av_clip64(timestamp, 0, st->duration);
- ie->timestamp = timestamp;
- ie->pos = av_rescale(timestamp, mp3->header_filesize, st->duration) + s->internal->data_offset;
- } else if (mp3->xing_toc) {
- if (ret < 0)
- return ret;
-
- ie = &st->index_entries[ret];
- } else {
- return -1;
- }
-
- avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET);
- ret = avio_seek(s->pb, ie->pos, SEEK_SET);
+ avio_seek(s->pb, FFMAX(target_pos - SEEK_WINDOW, 0), SEEK_SET);
+ ret = avio_seek(s->pb, target_pos, SEEK_SET);
if (ret < 0)
return ret;
#define MIN_VALID 3
- best_pos = ie->pos;
+ best_pos = target_pos;
best_score = 999;
- for(i=0; i<4096; i++) {
- int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i);
+ for(i=0; i<SEEK_WINDOW; i++) {
+ int64_t pos = target_pos + (dir > 0 ? i - SEEK_WINDOW/4 : -i);
int64_t candidate = -1;
int score = 999;
@@ -470,10 +465,10 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
continue;
for(j=0; j<MIN_VALID; j++) {
- ret = check(s, pos);
+ ret = check(s->pb, pos);
if(ret < 0)
break;
- if ((ie->pos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) {
+ if ((target_pos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) {
candidate = pos;
score = abs(MIN_VALID/2-j);
}
@@ -487,11 +482,51 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
}
}
- ret = avio_seek(s->pb, best_pos, SEEK_SET);
- if (ret < 0)
- return ret;
+ return avio_seek(s->pb, best_pos, SEEK_SET);
+}
+
+static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
+ int flags)
+{
+ MP3DecContext *mp3 = s->priv_data;
+ AVIndexEntry *ie, ie1;
+ AVStream *st = s->streams[0];
+ int64_t ret = av_index_search_timestamp(st, timestamp, flags);
+ int64_t best_pos;
+ int fast_seek = (s->flags & AVFMT_FLAG_FAST_SEEK) ? 1 : 0;
+ int64_t filesize = mp3->header_filesize;
+
+ if (mp3->usetoc == 2)
+ return -1; // generic index code
+
+ if (filesize <= 0) {
+ int64_t size = avio_size(s->pb);
+ if (size > 0 && size > s->internal->data_offset)
+ filesize = size - s->internal->data_offset;
+ }
+
+ if ( (mp3->is_cbr || fast_seek)
+ && (mp3->usetoc == 0 || !mp3->xing_toc)
+ && st->duration > 0
+ && filesize > 0) {
+ ie = &ie1;
+ timestamp = av_clip64(timestamp, 0, st->duration);
+ ie->timestamp = timestamp;
+ ie->pos = av_rescale(timestamp, filesize, st->duration) + s->internal->data_offset;
+ } else if (mp3->xing_toc) {
+ if (ret < 0)
+ return ret;
+
+ ie = &st->index_entries[ret];
+ } else {
+ return -1;
+ }
+
+ best_pos = mp3_sync(s, ie->pos, flags);
+ if (best_pos < 0)
+ return best_pos;
- if (mp3->is_cbr && ie == &ie1) {
+ if (mp3->is_cbr && ie == &ie1 && mp3->frames) {
int frame_duration = av_rescale(st->duration, 1, mp3->frames);
ie1.timestamp = frame_duration * av_rescale(best_pos - s->internal->data_offset, mp3->frames, mp3->header_filesize);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mpc8.c b/chromium/third_party/ffmpeg/libavformat/mpc8.c
index 0cef65ff7d0..bf597b88a58 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpc8.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpc8.c
@@ -154,7 +154,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
av_log(s, AV_LOG_ERROR, "Bad seek table size\n");
return;
}
- if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
+ if(!(buf = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE)))
return;
ret = avio_read(s->pb, buf, size);
if (ret != size) {
@@ -162,7 +162,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
av_free(buf);
return;
}
- memset(buf+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(buf+size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&gb, buf, size * 8);
size = gb_get_v(&gb);
diff --git a/chromium/third_party/ffmpeg/libavformat/mpeg.c b/chromium/third_party/ffmpeg/libavformat/mpeg.c
index edb134f7405..223b6906d68 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpeg.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpeg.c
@@ -612,7 +612,7 @@ found:
if (st->discard >= AVDISCARD_ALL)
goto skip;
if (startcode >= 0xa0 && startcode <= 0xaf) {
- if (lpcm_header_len == 6 && st->codec->codec_id == AV_CODEC_ID_MLP) {
+ if (st->codec->codec_id == AV_CODEC_ID_MLP) {
if (len < 6)
goto skip;
avio_skip(s->pb, 6);
@@ -857,7 +857,7 @@ static int vobsub_read_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
vobsub->q[i].sort = SUB_SORT_POS_TS;
- ff_subtitles_queue_finalize(&vobsub->q[i]);
+ ff_subtitles_queue_finalize(s, &vobsub->q[i]);
}
if (!av_bprint_is_complete(&header)) {
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegenc.c b/chromium/third_party/ffmpeg/libavformat/mpegenc.c
index 2520f49db19..b3ee2a09b9d 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegenc.c
@@ -410,7 +410,9 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream->max_buffer_size = 16 * 1024;
break;
default:
- return -1;
+ av_log(ctx, AV_LOG_ERROR, "Invalid media type %s for output stream #%d\n",
+ av_get_media_type_string(st->codec->codec_type), i);
+ return AVERROR(EINVAL);
}
stream->fifo = av_fifo_alloc(16);
if (!stream->fifo)
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegts.c b/chromium/third_party/ffmpeg/libavformat/mpegts.c
index 84946e3cfd5..ed0a86b337d 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegts.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegts.c
@@ -21,6 +21,7 @@
#include "libavutil/buffer.h"
#include "libavutil/crc.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/dict.h"
@@ -161,19 +162,19 @@ struct MpegTSContext {
};
#define MPEGTS_OPTIONS \
- { "resync_size", "Size limit for looking up a new synchronization.", offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }
+ { "resync_size", "set size limit for looking up a new synchronization", offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }
static const AVOption options[] = {
MPEGTS_OPTIONS,
- {"fix_teletext_pts", "Try to fix pts values of dvb teletext streams.", offsetof(MpegTSContext, fix_teletext_pts), AV_OPT_TYPE_INT,
+ {"fix_teletext_pts", "try to fix pts values of dvb teletext streams", offsetof(MpegTSContext, fix_teletext_pts), AV_OPT_TYPE_INT,
{.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
- {"ts_packetsize", "Output option carrying the raw packet size.", offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT,
+ {"ts_packetsize", "output option carrying the raw packet size", offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT,
{.i64 = 0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
- {"scan_all_pmts", "Scan and combine all PMTs", offsetof(MpegTSContext, scan_all_pmts), AV_OPT_TYPE_INT,
+ {"scan_all_pmts", "scan and combine all PMTs", offsetof(MpegTSContext, scan_all_pmts), AV_OPT_TYPE_INT,
{ .i64 = -1}, -1, 1, AV_OPT_FLAG_DECODING_PARAM },
- {"skip_changes", "Skip changing / adding streams / programs.", offsetof(MpegTSContext, skip_changes), AV_OPT_TYPE_INT,
+ {"skip_changes", "skip changing / adding streams / programs", offsetof(MpegTSContext, skip_changes), AV_OPT_TYPE_INT,
{.i64 = 0}, 0, 1, 0 },
- {"skip_clear", "Skip clearing programs.", offsetof(MpegTSContext, skip_clear), AV_OPT_TYPE_INT,
+ {"skip_clear", "skip clearing programs", offsetof(MpegTSContext, skip_clear), AV_OPT_TYPE_INT,
{.i64 = 0}, 0, 1, 0 },
{ NULL },
};
@@ -187,10 +188,10 @@ static const AVClass mpegts_class = {
static const AVOption raw_options[] = {
MPEGTS_OPTIONS,
- { "compute_pcr", "Compute exact PCR for each transport stream packet.",
+ { "compute_pcr", "compute exact PCR for each transport stream packet",
offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
{ .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
- { "ts_packetsize", "Output option carrying the raw packet size.",
+ { "ts_packetsize", "output option carrying the raw packet size",
offsetof(MpegTSContext, raw_packet_size), AV_OPT_TYPE_INT,
{ .i64 = 0 }, 0, 0,
AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
@@ -698,6 +699,7 @@ static const StreamType ISO_types[] = {
#endif
{ 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 },
{ 0x20, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 },
+ { 0x21, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_JPEG2000 },
{ 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC },
{ 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS },
{ 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
@@ -716,6 +718,7 @@ static const StreamType HDMV_types[] = {
{ 0xa1, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 }, /* E-AC3 Secondary Audio */
{ 0xa2, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS Express Secondary Audio */
{ 0x90, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
+ { 0x92, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_HDMV_TEXT_SUBTITLE },
{ 0 },
};
@@ -838,7 +841,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
if ((st->codec->codec_id == AV_CODEC_ID_NONE ||
(st->request_probe > 0 && st->request_probe < AVPROBE_SCORE_STREAM_RETRY / 5)) &&
!avcodec_is_open(st->codec) &&
- stream_type == 6) {
+ stream_type == STREAM_TYPE_PRIVATE_DATA) {
st->codec->codec_type = AVMEDIA_TYPE_DATA;
st->codec->codec_id = AV_CODEC_ID_BIN_DATA;
st->request_probe = AVPROBE_SCORE_STREAM_RETRY / 5;
@@ -870,7 +873,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
av_log(pes->stream, AV_LOG_WARNING, "PES packet size mismatch\n");
pes->flags |= AV_PKT_FLAG_CORRUPT;
}
- memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
// Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
@@ -902,8 +905,8 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl,
int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
int dts_flag = -1, cts_flag = -1;
int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
- uint8_t buf_padded[128 + FF_INPUT_BUFFER_PADDING_SIZE];
- int buf_padded_size = FFMIN(buf_size, sizeof(buf_padded) - FF_INPUT_BUFFER_PADDING_SIZE);
+ uint8_t buf_padded[128 + AV_INPUT_BUFFER_PADDING_SIZE];
+ int buf_padded_size = FFMIN(buf_size, sizeof(buf_padded) - AV_INPUT_BUFFER_PADDING_SIZE);
memcpy(buf_padded, buf, buf_padded_size);
@@ -1035,7 +1038,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
/* allocate pes buffer */
pes->buffer = av_buffer_alloc(pes->total_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!pes->buffer)
return AVERROR(ENOMEM);
@@ -1052,6 +1055,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
pes->st->request_probe = 1;
}
} else {
+ pes->pes_header_size = 6;
pes->state = MPEGTS_PAYLOAD;
pes->data_index = 0;
}
@@ -1139,7 +1143,10 @@ skip:
p += 5;
buf_size -= 5;
}
- if (pes->ts->fix_teletext_pts && pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) {
+ if ( pes->ts->fix_teletext_pts
+ && ( pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT
+ || pes->st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
+ ) {
AVProgram *p = NULL;
while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) {
if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) {
@@ -1168,7 +1175,11 @@ skip:
pes->st->pts_wrap_behavior = st->pts_wrap_behavior;
if (pes->dts == AV_NOPTS_VALUE || pes->dts < pcr) {
pes->pts = pes->dts = pcr;
- } else if (pes->dts > pcr + 3654 + 9000) {
+ } else if (pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT &&
+ pes->dts > pcr + 3654 + 9000) {
+ pes->pts = pes->dts = pcr + 3654 + 9000;
+ } else if (pes->st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
+ pes->dts > pcr + 10*90000) { //10sec
pes->pts = pes->dts = pcr + 3654 + 9000;
}
break;
@@ -1186,7 +1197,7 @@ skip:
new_pes_packet(pes, ts->pkt);
pes->total_size = MAX_PES_PAYLOAD;
pes->buffer = av_buffer_alloc(pes->total_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!pes->buffer)
return AVERROR(ENOMEM);
ts->stop_parse = 1;
@@ -1643,9 +1654,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
if (language_count > 0) {
/* 4 bytes per language code (3 bytes) with comma or NUL byte should fit language buffer */
- if (language_count > sizeof(language) / 4) {
- language_count = sizeof(language) / 4;
- }
+ av_assert0(language_count <= sizeof(language) / 4);
if (st->codec->extradata == NULL) {
if (ff_alloc_extradata(st->codec, language_count * 2)) {
@@ -1695,9 +1704,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
uint8_t *extradata;
/* 4 bytes per language code (3 bytes) with comma or NUL byte should fit language buffer */
- if (language_count > sizeof(language) / 4) {
- language_count = sizeof(language) / 4;
- }
+ av_assert0(language_count <= sizeof(language) / 4);
if (st->codec->extradata == NULL) {
if (ff_alloc_extradata(st->codec, language_count * 5)) {
@@ -1789,7 +1796,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
ext_desc_tag == 0x80) { /* User defined (provisional Opus) */
if (!st->codec->extradata) {
st->codec->extradata = av_mallocz(sizeof(opus_default_extradata) +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
@@ -2378,7 +2385,7 @@ static void finished_reading_packet(AVFormatContext *s, int raw_packet_size)
static int handle_packets(MpegTSContext *ts, int64_t nb_packets)
{
AVFormatContext *s = ts->stream;
- uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
+ uint8_t packet[TS_PACKET_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
const uint8_t *data;
int64_t packet_num;
int ret = 0;
@@ -2405,7 +2412,7 @@ static int handle_packets(MpegTSContext *ts, int64_t nb_packets)
ts->stop_parse = 0;
packet_num = 0;
- memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(packet + TS_PACKET_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
for (;;) {
packet_num++;
if (nb_packets != 0 && packet_num >= nb_packets ||
@@ -2439,7 +2446,7 @@ static int mpegts_probe(AVProbeData *p)
#define CHECK_BLOCK 100
if (check_count < CHECK_COUNT)
- return AVERROR_INVALIDDATA;
+ return 0;
for (i = 0; i<check_count; i+=CHECK_BLOCK) {
int left = FFMIN(check_count - i, CHECK_BLOCK);
@@ -2454,12 +2461,12 @@ static int mpegts_probe(AVProbeData *p)
sumscore = sumscore * CHECK_COUNT / check_count;
maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;
- av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
+ ff_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
if (sumscore > 6) return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
else
- return AVERROR_INVALIDDATA;
+ return 0;
}
/* return the 90kHz PCR and the extension for the 27MHz PCR. return
@@ -2505,7 +2512,12 @@ static int mpegts_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
uint8_t buf[8 * 1024] = {0};
int len;
- int64_t pos, probesize = s->probesize ? s->probesize : s->probesize2;
+ int64_t pos, probesize =
+#if FF_API_PROBESIZE_32
+ s->probesize ? s->probesize : s->probesize2;
+#else
+ s->probesize;
+#endif
if (ffio_ensure_seekback(pb, probesize) < 0)
av_log(s, AV_LOG_WARNING, "Failed to allocate buffers for seekback\n");
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c b/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
index 9efa9fc3624..45bab1ce01a 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegtsenc.c
@@ -98,9 +98,14 @@ typedef struct MpegTSWrite {
int pcr_period;
#define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01
#define MPEGTS_FLAG_AAC_LATM 0x02
+#define MPEGTS_FLAG_PAT_PMT_AT_FRAMES 0x04
int flags;
int copyts;
int tables_version;
+ float pat_period;
+ float sdt_period;
+ int64_t last_pat_ts;
+ int64_t last_sdt_ts;
int omit_video_pes_length;
} MpegTSWrite;
@@ -783,6 +788,16 @@ static int mpegts_write_header(AVFormatContext *s)
service->pcr_packet_period = 1;
}
+ ts->last_pat_ts = AV_NOPTS_VALUE;
+ ts->last_sdt_ts = AV_NOPTS_VALUE;
+ // The user specified a period, use only it
+ if (ts->pat_period < INT_MAX/2) {
+ ts->pat_packet_period = INT_MAX;
+ }
+ if (ts->sdt_period < INT_MAX/2) {
+ ts->sdt_packet_period = INT_MAX;
+ }
+
// output a PCR as soon as possible
service->pcr_packet_count = service->pcr_packet_period;
ts->pat_packet_count = ts->pat_packet_period - 1;
@@ -833,17 +848,27 @@ fail:
}
/* send SDT, PAT and PMT tables regulary */
-static void retransmit_si_info(AVFormatContext *s, int force_pat)
+static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts)
{
MpegTSWrite *ts = s->priv_data;
int i;
- if (++ts->sdt_packet_count == ts->sdt_packet_period) {
+ if (++ts->sdt_packet_count == ts->sdt_packet_period ||
+ (dts != AV_NOPTS_VALUE && ts->last_sdt_ts == AV_NOPTS_VALUE) ||
+ (dts != AV_NOPTS_VALUE && dts - ts->last_sdt_ts >= ts->sdt_period*90000.0)
+ ) {
ts->sdt_packet_count = 0;
+ if (dts != AV_NOPTS_VALUE)
+ ts->last_sdt_ts = FFMAX(dts, ts->last_sdt_ts);
mpegts_write_sdt(s);
}
- if (++ts->pat_packet_count == ts->pat_packet_period || force_pat) {
+ if (++ts->pat_packet_count == ts->pat_packet_period ||
+ (dts != AV_NOPTS_VALUE && ts->last_pat_ts == AV_NOPTS_VALUE) ||
+ (dts != AV_NOPTS_VALUE && dts - ts->last_pat_ts >= ts->pat_period*90000.0) ||
+ force_pat) {
ts->pat_packet_count = 0;
+ if (dts != AV_NOPTS_VALUE)
+ ts->last_pat_ts = FFMAX(dts, ts->last_pat_ts);
mpegts_write_pat(s);
for (i = 0; i < ts->nb_services; i++)
mpegts_write_pmt(s, ts->services[i]);
@@ -971,9 +996,14 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE);
int force_pat = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && key && !ts_st->prev_payload_key;
+ av_assert0(ts_st->payload != buf || st->codec->codec_type != AVMEDIA_TYPE_VIDEO);
+ if (ts->flags & MPEGTS_FLAG_PAT_PMT_AT_FRAMES && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ force_pat = 1;
+ }
+
is_start = 1;
while (payload_size > 0) {
- retransmit_si_info(s, force_pat);
+ retransmit_si_info(s, force_pat, dts);
force_pat = 0;
write_pcr = 0;
@@ -1313,9 +1343,9 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
if (!ts_st->amux) {
av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
"and extradata missing\n");
- return AVERROR_INVALIDDATA;
- }
-
+ if (!st->nb_frames)
+ return AVERROR_INVALIDDATA;
+ } else {
av_init_packet(&pkt2);
pkt2.data = pkt->data;
pkt2.size = pkt->size;
@@ -1334,6 +1364,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
size = avio_close_dyn_buf(ts_st->amux->pb, &data);
ts_st->amux->pb = NULL;
buf = data;
+ }
}
} else if (st->codec->codec_id == AV_CODEC_ID_HEVC) {
int ret = check_hevc_startcode(s, st, pkt);
@@ -1504,6 +1535,9 @@ static const AVOption options[] = {
{ "latm", "Use LATM packetization for AAC",
0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_AAC_LATM }, 0, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" },
+ { "pat_pmt_at_frames", "Reemit PAT and PMT at each video frame",
+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_PAT_PMT_AT_FRAMES}, 0, INT_MAX,
+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" },
// backward compatibility
{ "resend_headers", "Reemit PAT/PMT before writing the next packet",
offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT,
@@ -1520,6 +1554,12 @@ static const AVOption options[] = {
{ "pcr_period", "PCR retransmission time",
offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_INT,
{ .i64 = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+ { "pat_period", "PAT/PMT retransmission time limit in seconds",
+ offsetof(MpegTSWrite, pat_period), AV_OPT_TYPE_FLOAT,
+ { .dbl = INT_MAX }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+ { "sdt_period", "SDT retransmission time limit in seconds",
+ offsetof(MpegTSWrite, sdt_period), AV_OPT_TYPE_FLOAT,
+ { .dbl = INT_MAX }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};
@@ -1541,6 +1581,6 @@ AVOutputFormat ff_mpegts_muxer = {
.write_header = mpegts_write_header,
.write_packet = mpegts_write_packet,
.write_trailer = mpegts_write_end,
- .flags = AVFMT_ALLOW_FLUSH,
+ .flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS,
.priv_class = &mpegts_muxer_class,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/mpjpeg.c b/chromium/third_party/ffmpeg/libavformat/mpjpeg.c
index 7b975e28d6c..3904ccb2b43 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpjpeg.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpjpeg.c
@@ -33,10 +33,7 @@ typedef struct MPJPEGContext {
static int mpjpeg_write_header(AVFormatContext *s)
{
MPJPEGContext *mpj = s->priv_data;
- uint8_t buf1[256];
-
- snprintf(buf1, sizeof(buf1), "--%s\r\n", mpj->boundary_tag);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "--%s\r\n", mpj->boundary_tag);
avio_flush(s->pb);
return 0;
}
@@ -44,17 +41,12 @@ static int mpjpeg_write_header(AVFormatContext *s)
static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MPJPEGContext *mpj = s->priv_data;
- uint8_t buf1[256];
-
- snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\r\n");
- avio_write(s->pb, buf1, strlen(buf1));
-
- snprintf(buf1, sizeof(buf1), "Content-length: %d\r\n\r\n", pkt->size);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "Content-type: image/jpeg\r\n");
+ avio_printf(s->pb, "Content-length: %d\r\n\r\n",
+ pkt->size);
avio_write(s->pb, pkt->data, pkt->size);
- snprintf(buf1, sizeof(buf1), "\r\n--%s\r\n", mpj->boundary_tag);
- avio_write(s->pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "\r\n--%s\r\n", mpj->boundary_tag);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mpjpegdec.c b/chromium/third_party/ffmpeg/libavformat/mpjpegdec.c
index 845e95cb744..d9553040e85 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpjpegdec.c
@@ -40,6 +40,19 @@ static int get_line(AVIOContext *pb, char *line, int line_size)
return 0;
}
+
+static void trim_right(char* p)
+{
+ char *end;
+ if (!p || !*p)
+ return;
+ end = p + strlen(p) - 1;
+ while (end != p && av_isspace(*end)) {
+ *end = '\0';
+ end--;
+ }
+}
+
static int split_tag_value(char **tag, char **value, char *line)
{
char *p = line;
@@ -51,6 +64,7 @@ static int split_tag_value(char **tag, char **value, char *line)
*p = '\0';
*tag = line;
+ trim_right(*tag);
p++;
@@ -58,6 +72,7 @@ static int split_tag_value(char **tag, char **value, char *line)
p++;
*value = p;
+ trim_right(*value);
return 0;
}
@@ -77,6 +92,8 @@ static int check_content_type(char *line)
return 0;
}
+static int parse_multipart_header(AVIOContext *pb, void *log_ctx);
+
static int mpjpeg_read_probe(AVProbeData *p)
{
AVIOContext *pb;
@@ -90,17 +107,7 @@ static int mpjpeg_read_probe(AVProbeData *p)
if (!pb)
return AVERROR(ENOMEM);
- while (!pb->eof_reached) {
- ret = get_line(pb, line, sizeof(line));
- if (ret < 0)
- break;
-
- ret = check_content_type(line);
- if (!ret) {
- ret = AVPROBE_SCORE_MAX;
- break;
- }
- }
+ ret = (parse_multipart_header(pb, NULL)>0)?AVPROBE_SCORE_MAX:0;
av_free(pb);
@@ -123,6 +130,8 @@ static int mpjpeg_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_MJPEG;
@@ -145,25 +154,28 @@ static int parse_content_length(const char *value)
return val;
}
-static int parse_multipart_header(AVFormatContext *s)
+static int parse_multipart_header(AVIOContext *pb, void *log_ctx)
{
char line[128];
int found_content_type = 0;
int ret, size = -1;
- ret = get_line(s->pb, line, sizeof(line));
+ ret = get_line(pb, line, sizeof(line));
if (ret < 0)
return ret;
if (strncmp(line, "--", 2))
return AVERROR_INVALIDDATA;
- while (!s->pb->eof_reached) {
+ while (!pb->eof_reached) {
char *tag, *value;
- ret = get_line(s->pb, line, sizeof(line));
- if (ret < 0)
+ ret = get_line(pb, line, sizeof(line));
+ if (ret < 0) {
+ if (ret == AVERROR_EOF)
+ break;
return ret;
+ }
if (line[0] == '\0')
break;
@@ -174,9 +186,12 @@ static int parse_multipart_header(AVFormatContext *s)
if (!av_strcasecmp(tag, "Content-type")) {
if (av_strcasecmp(value, "image/jpeg")) {
- av_log(s, AV_LOG_ERROR,
- "Unexpected %s : %s\n",
- tag, value);
+ if (log_ctx) {
+ av_log(log_ctx, AV_LOG_ERROR,
+ "Unexpected %s : %s\n",
+ tag, value);
+ }
+
return AVERROR_INVALIDDATA;
} else
found_content_type = 1;
@@ -197,7 +212,7 @@ static int parse_multipart_header(AVFormatContext *s)
static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret;
- int size = parse_multipart_header(s);
+ int size = parse_multipart_header(s->pb, s);
if (size < 0)
return size;
diff --git a/chromium/third_party/ffmpeg/libavformat/mpl2dec.c b/chromium/third_party/ffmpeg/libavformat/mpl2dec.c
index 260b7be0ecd..81cc0bbb2d9 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpl2dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpl2dec.c
@@ -108,7 +108,7 @@ static int mpl2_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&mpl2->q);
+ ff_subtitles_queue_finalize(s, &mpl2->q);
return res;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/mpsubdec.c b/chromium/third_party/ffmpeg/libavformat/mpsubdec.c
index 7c26d4f42ce..c5a50ecb5cf 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpsubdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpsubdec.c
@@ -103,7 +103,7 @@ static int mpsub_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_TEXT;
- ff_subtitles_queue_finalize(&mpsub->q);
+ ff_subtitles_queue_finalize(s, &mpsub->q);
end:
av_bprint_finalize(&buf, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/msnwc_tcp.c b/chromium/third_party/ffmpeg/libavformat/msnwc_tcp.c
index 60225af61cd..2ec18fb5542 100644
--- a/chromium/third_party/ffmpeg/libavformat/msnwc_tcp.c
+++ b/chromium/third_party/ffmpeg/libavformat/msnwc_tcp.c
@@ -67,7 +67,7 @@ static int msnwc_tcp_probe(AVProbeData *p)
}
}
- return -1;
+ return 0;
}
static int msnwc_tcp_read_header(AVFormatContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavformat/mux.c b/chromium/third_party/ffmpeg/libavformat/mux.c
index f1d7927b8ea..3856d8271a4 100644
--- a/chromium/third_party/ffmpeg/libavformat/mux.c
+++ b/chromium/third_party/ffmpeg/libavformat/mux.c
@@ -61,7 +61,7 @@
* @param num must be >= 0
* @param den must be >= 1
*/
-static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
+static void frac_init(FFFrac *f, int64_t val, int64_t num, int64_t den)
{
num += (den >> 1);
if (num >= den) {
@@ -79,7 +79,7 @@ static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
* @param f fractional number
* @param incr increment, can be positive or negative
*/
-static void frac_add(AVFrac *f, int64_t incr)
+static void frac_add(FFFrac *f, int64_t incr)
{
int64_t num, den;
@@ -250,10 +250,23 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
(ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0)
goto fail;
+ if (s->nb_streams && s->streams[0]->codec->flags & AV_CODEC_FLAG_BITEXACT) {
+ if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
#if FF_API_LAVF_BITEXACT
- if (s->nb_streams && s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)
- s->flags |= AVFMT_FLAG_BITEXACT;
+ av_log(s, AV_LOG_WARNING,
+ "Setting the AVFormatContext to bitexact mode, because "
+ "the AVCodecContext is in that mode. This behavior will "
+ "change in the future. To keep the current behavior, set "
+ "AVFormatContext.flags |= AVFMT_FLAG_BITEXACT.\n");
+ s->flags |= AVFMT_FLAG_BITEXACT;
+#else
+ av_log(s, AV_LOG_WARNING,
+ "The AVFormatContext is not in set to bitexact mode, only "
+ "the AVCodecContext. If this is not intended, set "
+ "AVFormatContext.flags |= AVFMT_FLAG_BITEXACT.\n");
#endif
+ }
+ }
// some sanity checks
if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
@@ -348,7 +361,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (of->flags & AVFMT_GLOBALHEADER &&
- !(codec->flags & CODEC_FLAG_GLOBAL_HEADER))
+ !(codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER))
av_log(s, AV_LOG_WARNING,
"Codec for stream %d does not use global headers "
"but container format requires global headers\n", i);
@@ -414,13 +427,19 @@ static int init_pts(AVFormatContext *s)
default:
break;
}
+
+ if (!st->priv_pts)
+ st->priv_pts = av_mallocz(sizeof(*st->priv_pts));
+ if (!st->priv_pts)
+ return AVERROR(ENOMEM);
+
if (den != AV_NOPTS_VALUE) {
if (den <= 0)
return AVERROR_INVALIDDATA;
#if FF_API_LAVF_FRAC
FF_DISABLE_DEPRECATION_WARNINGS
- frac_init(&st->pts, 0, 0, den);
+ frac_init(st->priv_pts, 0, 0, den);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
@@ -508,7 +527,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
FF_DISABLE_DEPRECATION_WARNINGS
pkt->dts =
// pkt->pts= st->cur_dts;
- pkt->pts = st->pts.val;
+ pkt->pts = st->priv_pts->val;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
@@ -548,7 +567,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
st->cur_dts = pkt->dts;
#if FF_API_LAVF_FRAC
FF_DISABLE_DEPRECATION_WARNINGS
- st->pts.val = pkt->dts;
+ st->priv_pts->val = pkt->dts;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
@@ -564,8 +583,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
* had the real timestamps from the encoder */
#if FF_API_LAVF_FRAC
FF_DISABLE_DEPRECATION_WARNINGS
- if (frame_size >= 0 && (pkt->size || st->pts.num != st->pts.den >> 1 || st->pts.val)) {
- frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
+ if (frame_size >= 0 && (pkt->size || st->priv_pts->num != st->priv_pts->den >> 1 || st->priv_pts->val)) {
+ frac_add(st->priv_pts, (int64_t)st->time_base.den * frame_size);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
@@ -573,7 +592,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
case AVMEDIA_TYPE_VIDEO:
#if FF_API_LAVF_FRAC
FF_DISABLE_DEPRECATION_WARNINGS
- frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num);
+ frac_add(st->priv_pts, (int64_t)st->time_base.den * st->codec->time_base.num);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
break;
@@ -661,8 +680,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
ret = s->oformat->write_packet(s, pkt);
}
- if (s->flush_packets && s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
- avio_flush(s->pb);
+ if (s->pb && ret >= 0) {
+ if (s->flush_packets && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
+ avio_flush(s->pb);
+ if (s->pb->error < 0)
+ ret = s->pb->error;
+ }
+
if (did_split)
av_packet_merge_side_data(pkt);
@@ -737,11 +761,6 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
if (!this_pktl)
return AVERROR(ENOMEM);
this_pktl->pkt = *pkt;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL; // do not free original but only the copy
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->side_data = NULL;
pkt->side_data_elems = 0;
@@ -1065,7 +1084,8 @@ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
pkt->buf = local_pkt.buf;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = local_pkt.destruct;
+ pkt->side_data = local_pkt.side_data;
+ pkt->side_data_elems = local_pkt.side_data_elems;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/mxf.c b/chromium/third_party/ffmpeg/libavformat/mxf.c
index ecfb8a23933..4d77ada71e9 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxf.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxf.c
@@ -42,6 +42,16 @@ const MXFCodecUL ff_mxf_codec_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x20,0x02,0x03 }, 14, AV_CODEC_ID_MPEG4 }, /* XDCAM proxy_pal030926.mxf */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x02,0x01,0x02,0x00 }, 13, AV_CODEC_ID_DVVIDEO }, /* DV25 IEC PAL */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x01,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 SP@LL */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x02,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 SP@ML */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x03,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 MP@LL */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x04,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 MP@ML */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x05,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 MP@HL */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x06,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 AP@L0 */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x07,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 AP@L1 */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x08,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 AP@L2 */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x09,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 AP@L3 */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x04,0x0A,0x00,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC1 AP@L4 */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x01,0x7F,0x00,0x00,0x00 }, 13, AV_CODEC_ID_RAWVIDEO }, /* Uncompressed */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x00 }, 15, AV_CODEC_ID_RAWVIDEO }, /* Uncompressed 422 8-bit */
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x71,0x00,0x00,0x00 }, 13, AV_CODEC_ID_DNXHD }, /* SMPTE VC-3/DNxHD */
@@ -69,6 +79,11 @@ const MXFCodecUL ff_mxf_pixel_format_uls[] = {
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_PIX_FMT_NONE },
};
+const MXFCodecUL ff_mxf_codec_tag_uls[] = {
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x03,0x01,0x01,0x03,0x01,0x00 }, 15, MKTAG('A', 'V', 'u', 'p') }, /* Avid 1:1 */
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, 0 },
+};
+
static const struct {
enum AVPixelFormat pix_fmt;
const char data[16];
diff --git a/chromium/third_party/ffmpeg/libavformat/mxf.h b/chromium/third_party/ffmpeg/libavformat/mxf.h
index 1763063a695..f3db1f939bb 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxf.h
+++ b/chromium/third_party/ffmpeg/libavformat/mxf.h
@@ -78,6 +78,7 @@ typedef struct {
extern const MXFCodecUL ff_mxf_data_definition_uls[];
extern const MXFCodecUL ff_mxf_codec_uls[];
extern const MXFCodecUL ff_mxf_pixel_format_uls[];
+extern const MXFCodecUL ff_mxf_codec_tag_uls[];
int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt);
const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base);
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfdec.c b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
index b3c25b765e5..00d420b4450 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
@@ -233,6 +233,7 @@ typedef struct MXFIndexTable {
int nb_segments;
MXFIndexTableSegment **segments; /* sorted by IndexStartPosition */
AVIndexEntry *fake_index; /* used for calling ff_index_search_timestamp() */
+ int8_t *offsets; /* temporal offsets for display order to stored order conversion */
} MXFIndexTable;
typedef struct MXFContext {
@@ -1120,7 +1121,11 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
static const MXFCodecUL mxf_picture_essence_container_uls[] = {
// video essence container uls
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0c,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 },
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x10,0x60,0x01 }, 14, AV_CODEC_ID_H264 }, /* H264 Frame wrapped */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x12,0x01,0x00 }, 14, AV_CODEC_ID_VC1 }, /* VC-1 Frame wrapped */
{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
+ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x04,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* Type D-10 mapping of 40Mbps 525/60-I */
{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14, AV_CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14, AV_CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
{ { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0xff,0x4b,0x46,0x41,0x41,0x00,0x0d,0x4d,0x4f }, 14, AV_CODEC_ID_RAWVIDEO }, /* Legacy ?? Uncompressed Picture */
@@ -1155,11 +1160,6 @@ static const MXFCodecUL mxf_data_essence_container_uls[] = {
{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
};
-static const MXFCodecUL mxf_codec_uls[] = {
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14, AV_CODEC_ID_JPEG2000 },
- { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE },
-};
-
static const char* const mxf_data_essence_descriptor[] = {
"vbi_vanc_smpte_436M",
};
@@ -1334,6 +1334,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
{
int i, j, x;
int8_t max_temporal_offset = -128;
+ uint8_t *flags;
/* first compute how many entries we have */
for (i = 0; i < index_table->nb_segments; i++) {
@@ -1352,8 +1353,12 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
return 0;
if (!(index_table->ptses = av_calloc(index_table->nb_ptses, sizeof(int64_t))) ||
- !(index_table->fake_index = av_calloc(index_table->nb_ptses, sizeof(AVIndexEntry)))) {
+ !(index_table->fake_index = av_calloc(index_table->nb_ptses, sizeof(AVIndexEntry))) ||
+ !(index_table->offsets = av_calloc(index_table->nb_ptses, sizeof(int8_t))) ||
+ !(flags = av_calloc(index_table->nb_ptses, sizeof(uint8_t)))) {
av_freep(&index_table->ptses);
+ av_freep(&index_table->fake_index);
+ av_freep(&index_table->offsets);
return AVERROR(ENOMEM);
}
@@ -1411,8 +1416,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
break;
}
- index_table->fake_index[x].timestamp = x;
- index_table->fake_index[x].flags = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;
+ flags[x] = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;
if (index < 0 || index >= index_table->nb_ptses) {
av_log(mxf->fc, AV_LOG_ERROR,
@@ -1421,11 +1425,20 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
continue;
}
+ index_table->offsets[x] = offset;
index_table->ptses[index] = x;
max_temporal_offset = FFMAX(max_temporal_offset, offset);
}
}
+ /* calculate the fake index table in display order */
+ for (x = 0; x < index_table->nb_ptses; x++) {
+ index_table->fake_index[x].timestamp = x;
+ if (index_table->ptses[x] != AV_NOPTS_VALUE)
+ index_table->fake_index[index_table->ptses[x]].flags = flags[x];
+ }
+ av_freep(&flags);
+
index_table->first_dts = -max_temporal_offset;
return 0;
@@ -1960,7 +1973,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul);
st->codec->codec_id = (enum AVCodecID)codec_ul->id;
if (st->codec->codec_id == AV_CODEC_ID_NONE) {
- codec_ul = mxf_get_codec_ul(mxf_codec_uls, &descriptor->codec_ul);
+ codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->codec_ul);
st->codec->codec_id = (enum AVCodecID)codec_ul->id;
}
@@ -1988,10 +2001,6 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
st->codec->width = descriptor->width;
st->codec->height = descriptor->height; /* Field height, not frame height */
switch (descriptor->frame_layout) {
- case SegmentedFrame:
- /* This one is a weird layout I don't fully understand. */
- av_log(mxf->fc, AV_LOG_INFO, "SegmentedFrame layout isn't currently supported\n");
- break;
case FullFrame:
st->codec->field_order = AV_FIELD_PROGRESSIVE;
break;
@@ -2003,6 +2012,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
It's also for compatibility with the old behavior. */
case MixedFields:
break;
+ case SegmentedFrame:
+ st->codec->field_order = AV_FIELD_PROGRESSIVE;
case SeparateFields:
switch (descriptor->field_dominance) {
case MXF_TFF:
@@ -2031,12 +2042,16 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
&descriptor->essence_codec_ul);
st->codec->pix_fmt = (enum AVPixelFormat)pix_fmt_ul->id;
if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
- /* support files created before RP224v10 by defaulting to UYVY422
- if subsampling is 4:2:2 and component depth is 8-bit */
- if (descriptor->horiz_subsampling == 2 &&
- descriptor->vert_subsampling == 1 &&
- descriptor->component_depth == 8) {
- st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
+ st->codec->codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls,
+ &descriptor->essence_codec_ul)->id;
+ if (!st->codec->codec_tag) {
+ /* support files created before RP224v10 by defaulting to UYVY422
+ if subsampling is 4:2:2 and component depth is 8-bit */
+ if (descriptor->horiz_subsampling == 2 &&
+ descriptor->vert_subsampling == 1 &&
+ descriptor->component_depth == 8) {
+ st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
+ }
}
}
}
@@ -3085,6 +3100,7 @@ static int mxf_read_close(AVFormatContext *s)
av_freep(&mxf->index_tables[i].segments);
av_freep(&mxf->index_tables[i].ptses);
av_freep(&mxf->index_tables[i].fake_index);
+ av_freep(&mxf->index_tables[i].offsets);
}
}
av_freep(&mxf->index_tables);
@@ -3158,6 +3174,8 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
/* behave as if we have a proper index */
if ((sample_time = ff_index_search_timestamp(t->fake_index, t->nb_ptses, sample_time, flags)) < 0)
return sample_time;
+ /* get the stored order index from the display order index */
+ sample_time += t->offsets[sample_time];
} else {
/* no IndexEntryArray (one or more CBR segments)
* make sure we don't seek past the end */
@@ -3191,6 +3209,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
AVInputFormat ff_mxf_demuxer = {
.name = "mxf",
.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
+ .flags = AVFMT_SEEK_TO_PTS,
.priv_data_size = sizeof(MXFContext),
.read_probe = mxf_probe,
.read_header = mxf_read_header,
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfenc.c b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
index db7d2bf4552..84ce979c610 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
@@ -21,6 +21,10 @@
*/
/*
+ * signal_standard, color_siting and klv_fill_key version fixes sponsored by NOA GmbH
+ */
+
+/*
* References
* SMPTE 336M KLV Data Encoding Protocol Using Key-Length-Value
* SMPTE 377M MXF File Format Specifications
@@ -2056,7 +2060,7 @@ static int mxf_write_header(AVFormatContext *s)
sc->color_siting = 0xFF;
if (pix_desc) {
- sc->component_depth = pix_desc->comp[0].depth_minus1 + 1;
+ sc->component_depth = pix_desc->comp[0].depth;
sc->h_chroma_sub_sample = 1 << pix_desc->log2_chroma_w;
}
switch (ff_choose_chroma_location(s, st)) {
diff --git a/chromium/third_party/ffmpeg/libavformat/mxg.c b/chromium/third_party/ffmpeg/libavformat/mxg.c
index 34977b8197d..45cc5b5284c 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxg.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxg.c
@@ -111,7 +111,7 @@ static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size)
soi_pos = mxg->soi_ptr - mxg->buffer;
buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size,
current_pos + cache_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!buffer)
return AVERROR(ENOMEM);
mxg->buffer = buffer;
@@ -171,18 +171,13 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->pts = pkt->dts = mxg->dts;
pkt->stream_index = 0;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
pkt->data = mxg->soi_ptr;
if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) {
if (mxg->cache_size > 0) {
- memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
+ memmove(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
}
mxg->buffer_ptr = mxg->buffer;
@@ -214,11 +209,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
/* time (GMT) of first sample in usec since 1970, little-endian */
pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
pkt->stream_index = 1;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->size = size - 14;
pkt->data = startmarker_ptr + 16;
diff --git a/chromium/third_party/ffmpeg/libavformat/network.c b/chromium/third_party/ffmpeg/libavformat/network.c
index 47ade8cb62f..7a326d2c4e1 100644
--- a/chromium/third_party/ffmpeg/libavformat/network.c
+++ b/chromium/third_party/ffmpeg/libavformat/network.c
@@ -187,12 +187,11 @@ int ff_socket(int af, int type, int proto)
return fd;
}
-int ff_listen_bind(int fd, const struct sockaddr *addr,
- socklen_t addrlen, int timeout, URLContext *h)
+int ff_listen(int fd, const struct sockaddr *addr,
+ socklen_t addrlen)
{
int ret;
int reuse = 1;
- struct pollfd lp = { fd, POLLIN, 0 };
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))) {
av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_REUSEADDR) failed\n");
}
@@ -203,6 +202,13 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
ret = listen(fd, 1);
if (ret)
return ff_neterrno();
+ return ret;
+}
+
+int ff_accept(int fd, int timeout, URLContext *h)
+{
+ int ret;
+ struct pollfd lp = { fd, POLLIN, 0 };
ret = ff_poll_interrupt(&lp, 1, timeout, &h->interrupt_callback);
if (ret < 0)
@@ -211,15 +217,24 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
ret = accept(fd, NULL, NULL);
if (ret < 0)
return ff_neterrno();
-
- closesocket(fd);
-
if (ff_socket_nonblock(ret, 1) < 0)
av_log(NULL, AV_LOG_DEBUG, "ff_socket_nonblock failed\n");
return ret;
}
+int ff_listen_bind(int fd, const struct sockaddr *addr,
+ socklen_t addrlen, int timeout, URLContext *h)
+{
+ int ret;
+ if ((ret = ff_listen(fd, addr, addrlen)) < 0)
+ return ret;
+ if ((ret = ff_accept(fd, timeout, h)) < 0)
+ return ret;
+ closesocket(fd);
+ return ret;
+}
+
int ff_listen_connect(int fd, const struct sockaddr *addr,
socklen_t addrlen, int timeout, URLContext *h,
int will_try_next)
diff --git a/chromium/third_party/ffmpeg/libavformat/network.h b/chromium/third_party/ffmpeg/libavformat/network.h
index 86fb6561647..f83c796a95a 100644
--- a/chromium/third_party/ffmpeg/libavformat/network.h
+++ b/chromium/third_party/ffmpeg/libavformat/network.h
@@ -255,6 +255,26 @@ int ff_listen_bind(int fd, const struct sockaddr *addr,
URLContext *h);
/**
+ * Bind to a file descriptor to an address without accepting connections.
+ * @param fd First argument of bind().
+ * @param addr Second argument of bind().
+ * @param addrlen Third argument of bind().
+ * @return 0 on success or an AVERROR on failure.
+ */
+int ff_listen(int fd, const struct sockaddr *addr, socklen_t addrlen);
+
+/**
+ * Poll for a single connection on the passed file descriptor.
+ * @param fd The listening socket file descriptor.
+ * @param timeout Polling timeout in milliseconds.
+ * @param h URLContext providing interrupt check
+ * callback and logging context.
+ * @return A non-blocking file descriptor on success
+ * or an AVERROR on failure.
+ */
+int ff_accept(int fd, int timeout, URLContext *h);
+
+/**
* Connect to a file descriptor and poll for result.
*
* @param fd First argument of connect(),
diff --git a/chromium/third_party/ffmpeg/libavformat/nutdec.c b/chromium/third_party/ffmpeg/libavformat/nutdec.c
index 13fb39924d2..63b0cd2fb95 100644
--- a/chromium/third_party/ffmpeg/libavformat/nutdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/nutdec.c
@@ -1005,6 +1005,9 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
AV_WL32(dst+4, skip_end);
}
+ if (avio_tell(bc) >= maxpos)
+ return AVERROR_INVALIDDATA;
+
return 0;
}
@@ -1277,6 +1280,8 @@ static int read_seek(AVFormatContext *s, int stream_index,
next_node[1]->pos, next_node[1]->pos,
next_node[0]->ts, next_node[1]->ts,
AVSEEK_FLAG_BACKWARD, &ts, nut_read_timestamp);
+ if (pos < 0)
+ return pos;
if (!(flags & AVSEEK_FLAG_BACKWARD)) {
dummy.pos = pos + 16;
diff --git a/chromium/third_party/ffmpeg/libavformat/nutenc.c b/chromium/third_party/ffmpeg/libavformat/nutenc.c
index 1522a0452fe..49d62bfbecc 100644
--- a/chromium/third_party/ffmpeg/libavformat/nutenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/nutenc.c
@@ -933,6 +933,7 @@ static int write_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
break;
case AV_PKT_DATA_METADATA_UPDATE:
case AV_PKT_DATA_STRINGS_METADATA:
+ case AV_PKT_DATA_QUALITY_STATS:
// belongs into meta, not side data
break;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/oggdec.c b/chromium/third_party/ffmpeg/libavformat/oggdec.c
index 4f4d085dbd1..ae56915b580 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggdec.c
@@ -60,6 +60,7 @@ static const struct ogg_codec * const ogg_codecs[] = {
static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts);
static int ogg_new_stream(AVFormatContext *s, uint32_t serial);
+static int ogg_restore(AVFormatContext *s, int discard);
//FIXME We could avoid some structure duplication
static int ogg_save(AVFormatContext *s)
@@ -68,6 +69,7 @@ static int ogg_save(AVFormatContext *s)
struct ogg_state *ost =
av_malloc(sizeof(*ost) + (ogg->nstreams - 1) * sizeof(*ogg->streams));
int i;
+ int ret = 0;
if (!ost)
return AVERROR(ENOMEM);
@@ -80,15 +82,21 @@ static int ogg_save(AVFormatContext *s)
for (i = 0; i < ogg->nstreams; i++) {
struct ogg_stream *os = ogg->streams + i;
- os->buf = av_mallocz(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
- memcpy(os->buf, ost->streams[i].buf, os->bufpos);
+ os->buf = av_mallocz(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (os->buf)
+ memcpy(os->buf, ost->streams[i].buf, os->bufpos);
+ else
+ ret = AVERROR(ENOMEM);
os->new_metadata = NULL;
os->new_metadata_size = 0;
}
ogg->state = ost;
- return 0;
+ if (ret < 0)
+ ogg_restore(s, 0);
+
+ return ret;
}
static int ogg_restore(AVFormatContext *s, int discard)
@@ -255,7 +263,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial)
memset(os, 0, sizeof(*os));
os->serial = serial;
os->bufsize = DECODER_BUFFER_SIZE;
- os->buf = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
+ os->buf = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
os->header = -1;
os->start_granule = OGG_NOGRANULE_VALUE;
if (!os->buf)
@@ -277,7 +285,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial)
static int ogg_new_buf(struct ogg *ogg, int idx)
{
struct ogg_stream *os = ogg->streams + idx;
- uint8_t *nb = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
+ uint8_t *nb = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
int size = os->bufpos - os->pstart;
if (!nb)
@@ -416,7 +424,7 @@ static int ogg_read_page(AVFormatContext *s, int *sid)
}
if (os->bufsize - os->bufpos < size) {
- uint8_t *nb = av_malloc((os->bufsize *= 2) + FF_INPUT_BUFFER_PADDING_SIZE);
+ uint8_t *nb = av_malloc((os->bufsize *= 2) + AV_INPUT_BUFFER_PADDING_SIZE);
if (!nb)
return AVERROR(ENOMEM);
memcpy(nb, os->buf, os->bufpos);
@@ -432,7 +440,7 @@ static int ogg_read_page(AVFormatContext *s, int *sid)
os->granule = gp;
os->flags = flags;
- memset(os->buf + os->bufpos, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(os->buf + os->bufpos, 0, AV_INPUT_BUFFER_PADDING_SIZE);
if (sid)
*sid = idx;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggenc.c b/chromium/third_party/ffmpeg/libavformat/oggenc.c
index 2c0a44e4559..49075129891 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggenc.c
@@ -260,7 +260,7 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
if (i == total_segments)
page->granule = granule;
- if (!header) {
+ {
AVStream *st = s->streams[page->stream_index];
int64_t start = av_rescale_q(page->start_granule, st->time_base,
@@ -268,10 +268,13 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
int64_t next = av_rescale_q(page->granule, st->time_base,
AV_TIME_BASE_Q);
- if (page->segments_count == 255 ||
- (ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
- (ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
+ if (page->segments_count == 255) {
ogg_buffer_page(s, oggstream);
+ } else if (!header) {
+ if ((ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
+ (ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
+ ogg_buffer_page(s, oggstream);
+ }
}
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsedirac.c b/chromium/third_party/ffmpeg/libavformat/oggparsedirac.c
index 35be6558214..ab40f96c631 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsedirac.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsedirac.c
@@ -31,16 +31,19 @@ static int dirac_header(AVFormatContext *s, int idx)
AVStream *st = s->streams[idx];
dirac_source_params source;
GetBitContext gb;
+ int ret;
// already parsed the header
if (st->codec->codec_id == AV_CODEC_ID_DIRAC)
return 0;
- if (init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8) < 0)
- return -1;
+ ret = init_get_bits8(&gb, os->buf + os->pstart + 13, (os->psize - 13));
+ if (ret < 0)
+ return ret;
- if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)
- return -1;
+ ret = avpriv_dirac_parse_sequence_header(st->codec, &gb, &source);
+ if (ret < 0)
+ return ret;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_DIRAC;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
index 54024e0a0ab..ae8c3c850cd 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
@@ -102,7 +102,7 @@ ogm_header(AVFormatContext *s, int idx)
size -= 4;
}
if (size > 52) {
- av_assert0(FF_INPUT_BUFFER_PADDING_SIZE <= 52);
+ av_assert0(AV_INPUT_BUFFER_PADDING_SIZE <= 52);
size -= 52;
ff_alloc_extradata(st->codec, size);
bytestream2_get_buffer(&p, st->codec->extradata, st->codec->extradata_size);
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c b/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
index 91c70dfec9f..e92d4c5170c 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsetheora.c
@@ -127,11 +127,11 @@ static int theora_header(AVFormatContext *s, int idx)
}
if ((err = av_reallocp(&st->codec->extradata,
- cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
+ cds + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
st->codec->extradata_size = 0;
return err;
}
- memset(st->codec->extradata + cds, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(st->codec->extradata + cds, 0, AV_INPUT_BUFFER_PADDING_SIZE);
cdp = st->codec->extradata + st->codec->extradata_size;
*cdp++ = os->psize >> 8;
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c b/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
index dd443374375..b96be989747 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparsevorbis.c
@@ -242,7 +242,7 @@ static int fixup_vorbis_headers(AVFormatContext *as,
offset += priv->len[i];
av_freep(&priv->packet[i]);
}
- if ((err = av_reallocp(buf, offset + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
+ if ((err = av_reallocp(buf, offset + AV_INPUT_BUFFER_PADDING_SIZE)) < 0)
return err;
return offset;
}
@@ -406,6 +406,9 @@ static int vorbis_packet(AVFormatContext *s, int idx)
struct oggvorbis_private *priv = os->private;
int duration, flags = 0;
+ if (!priv->vp)
+ return AVERROR_INVALIDDATA;
+
/* first packet handling
* here we parse the duration of each packet in the first page and compare
* the total duration to the page granule to find the encoder delay and
diff --git a/chromium/third_party/ffmpeg/libavformat/options.c b/chromium/third_party/ffmpeg/libavformat/options.c
index d238dd5ab70..9918349703a 100644
--- a/chromium/third_party/ffmpeg/libavformat/options.c
+++ b/chromium/third_party/ffmpeg/libavformat/options.c
@@ -20,6 +20,8 @@
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
/**
@@ -27,7 +29,9 @@
* Options definition for AVFormatContext.
*/
+FF_DISABLE_DEPRECATION_WARNINGS
#include "options_table.h"
+FF_ENABLE_DEPRECATION_WARNINGS
static const char* format_to_name(void* ptr)
{
diff --git a/chromium/third_party/ffmpeg/libavformat/options_table.h b/chromium/third_party/ffmpeg/libavformat/options_table.h
index 58670b0035d..773814a2b96 100644
--- a/chromium/third_party/ffmpeg/libavformat/options_table.h
+++ b/chromium/third_party/ffmpeg/libavformat/options_table.h
@@ -36,7 +36,11 @@
static const AVOption avformat_options[] = {
{"avioflags", NULL, OFFSET(avio_flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "avioflags"},
{"direct", "reduce buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVIO_FLAG_DIRECT }, INT_MIN, INT_MAX, D|E, "avioflags"},
+#if FF_API_PROBESIZE_32
{"probesize", "set probing size", OFFSET(probesize2), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
+#else
+{"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
+#endif
{"formatprobesize", "number of bytes to probe file format", OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, INT_MAX-1, D},
{"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E},
{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, D|E, "fflags"},
@@ -54,7 +58,11 @@ static const AVOption avformat_options[] = {
{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
{"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, D},
{"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
+#if FF_API_PROBESIZE_32
{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration2), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D},
+#else
+{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D},
+#endif
{"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D},
{"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), AV_OPT_TYPE_INT, {.i64 = 3041280 }, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */
diff --git a/chromium/third_party/ffmpeg/libavformat/os_support.c b/chromium/third_party/ffmpeg/libavformat/os_support.c
index 7950e448891..718bc6ce59b 100644
--- a/chromium/third_party/ffmpeg/libavformat/os_support.c
+++ b/chromium/third_party/ffmpeg/libavformat/os_support.c
@@ -340,3 +340,4 @@ int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout)
#endif /* !HAVE_POLL_H */
#endif /* CONFIG_NETWORK */
+
diff --git a/chromium/third_party/ffmpeg/libavformat/pjsdec.c b/chromium/third_party/ffmpeg/libavformat/pjsdec.c
index 5129b70e5fb..a88d5331928 100644
--- a/chromium/third_party/ffmpeg/libavformat/pjsdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/pjsdec.c
@@ -100,7 +100,7 @@ static int pjs_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&pjs->q);
+ ff_subtitles_queue_finalize(s, &pjs->q);
return res;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/psxstr.c b/chromium/third_party/ffmpeg/libavformat/psxstr.c
index fd50e549ae3..3aa08eb93f7 100644
--- a/chromium/third_party/ffmpeg/libavformat/psxstr.c
+++ b/chromium/third_party/ffmpeg/libavformat/psxstr.c
@@ -238,11 +238,6 @@ static int str_read_packet(AVFormatContext *s,
pkt->data= NULL;
pkt->size= -1;
pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/qcp.c b/chromium/third_party/ffmpeg/libavformat/qcp.c
index 9e2eedfe85d..ad4a8ae79c6 100644
--- a/chromium/third_party/ffmpeg/libavformat/qcp.c
+++ b/chromium/third_party/ffmpeg/libavformat/qcp.c
@@ -57,6 +57,11 @@ static const uint8_t guid_evrc[16] = {
0x91, 0xef, 0x73, 0x6a, 0x51, 0x00, 0xce, 0xb4
};
+static const uint8_t guid_4gv[16] = {
+ 0xca, 0x29, 0xfd, 0x3c, 0x53, 0xf6, 0xf5, 0x4e,
+ 0x90, 0xe9, 0xf4, 0x23, 0x6d, 0x59, 0x9b, 0x61
+};
+
/**
* SMV GUID as stored in the file
*/
@@ -106,6 +111,8 @@ static int qcp_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_EVRC;
} else if (!memcmp(buf, guid_smv, 16)) {
st->codec->codec_id = AV_CODEC_ID_SMV;
+ } else if (!memcmp(buf, guid_4gv, 16)) {
+ st->codec->codec_id = AV_CODEC_ID_4GV;
} else {
av_log(s, AV_LOG_ERROR, "Unknown codec GUID "FF_PRI_GUID".\n",
FF_ARG_GUID(buf));
diff --git a/chromium/third_party/ffmpeg/libavformat/rawdec.c b/chromium/third_party/ffmpeg/libavformat/rawdec.c
index b903e63fb48..7684e1dd9a0 100644
--- a/chromium/third_party/ffmpeg/libavformat/rawdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/rawdec.c
@@ -188,10 +188,10 @@ static int mjpeg_probe(AVProbeData *p)
}
if (nb_invalid*4 + 1 < nb_frames) {
- static const char ct_jpeg[] = "\r\nContent-Type: image/jpeg\r\n\r\n";
+ static const char ct_jpeg[] = "\r\nContent-Type: image/jpeg\r\n";
int i;
- for (i=0; i<FFMIN(p->buf_size - sizeof(ct_jpeg), 100); i++)
+ for (i=0; i<FFMIN(p->buf_size - (int)sizeof(ct_jpeg), 100); i++)
if (!memcmp(p->buf + i, ct_jpeg, sizeof(ct_jpeg) - 1))
return AVPROBE_SCORE_EXTENSION;
diff --git a/chromium/third_party/ffmpeg/libavformat/rawenc.c b/chromium/third_party/ffmpeg/libavformat/rawenc.c
index e59f1ae95e6..d65c7c79097 100644
--- a/chromium/third_party/ffmpeg/libavformat/rawenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/rawenc.c
@@ -56,6 +56,25 @@ AVOutputFormat ff_ac3_muxer = {
#endif
#if CONFIG_ADX_MUXER
+
+static int adx_write_trailer(AVFormatContext *s)
+{
+ AVIOContext *pb = s->pb;
+ AVCodecContext *avctx = s->streams[0]->codec;
+
+ if (pb->seekable) {
+ int64_t file_size = avio_tell(pb);
+ uint64_t sample_count = (file_size - 36) / avctx->channels / 18 * 32;
+ if (sample_count <= UINT32_MAX) {
+ avio_seek(pb, 12, SEEK_SET);
+ avio_wb32(pb, sample_count);
+ avio_seek(pb, file_size, SEEK_SET);
+ }
+ }
+
+ return 0;
+}
+
AVOutputFormat ff_adx_muxer = {
.name = "adx",
.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
@@ -64,6 +83,7 @@ AVOutputFormat ff_adx_muxer = {
.video_codec = AV_CODEC_ID_NONE,
.write_header = force_one_stream,
.write_packet = ff_raw_write_packet,
+ .write_trailer = adx_write_trailer,
.flags = AVFMT_NOTIMESTAMPS,
};
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/rdt.c b/chromium/third_party/ffmpeg/libavformat/rdt.c
index bb56a8ba817..046d2732a47 100644
--- a/chromium/third_party/ffmpeg/libavformat/rdt.c
+++ b/chromium/third_party/ffmpeg/libavformat/rdt.c
@@ -86,7 +86,7 @@ struct PayloadContext {
RMStream **rmst;
uint8_t *mlti_data;
unsigned int mlti_data_size;
- char buffer[RTP_MAX_PACKET_LENGTH + FF_INPUT_BUFFER_PADDING_SIZE];
+ char buffer[RTP_MAX_PACKET_LENGTH + AV_INPUT_BUFFER_PADDING_SIZE];
int audio_pkt_cnt; /**< remaining audio packets in rmdec */
};
@@ -398,7 +398,7 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p)
len -= 2; /* skip embracing " at start/end */
}
*target_len = len * 3 / 4;
- target = av_mallocz(*target_len + FF_INPUT_BUFFER_PADDING_SIZE);
+ target = av_mallocz(*target_len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!target)
return NULL;
av_base64_decode(target, p, *target_len);
diff --git a/chromium/third_party/ffmpeg/libavformat/realtextdec.c b/chromium/third_party/ffmpeg/libavformat/realtextdec.c
index fff85d6ba92..f13321c91a9 100644
--- a/chromium/third_party/ffmpeg/libavformat/realtextdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/realtextdec.c
@@ -115,7 +115,7 @@ static int realtext_read_header(AVFormatContext *s)
}
av_bprint_clear(&buf);
}
- ff_subtitles_queue_finalize(&rt->q);
+ ff_subtitles_queue_finalize(s, &rt->q);
end:
av_bprint_finalize(&buf, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/redspark.c b/chromium/third_party/ffmpeg/libavformat/redspark.c
index 13a7b37d254..66c2dc5aae1 100644
--- a/chromium/third_party/ffmpeg/libavformat/redspark.c
+++ b/chromium/third_party/ffmpeg/libavformat/redspark.c
@@ -67,7 +67,7 @@ static int redspark_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
codec = st->codec;
- header = av_malloc(HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ header = av_malloc(HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
if (!header)
return AVERROR(ENOMEM);
pbc = header;
diff --git a/chromium/third_party/ffmpeg/libavformat/riff.c b/chromium/third_party/ffmpeg/libavformat/riff.c
index ddfa829251d..768b406a1f9 100644
--- a/chromium/third_party/ffmpeg/libavformat/riff.c
+++ b/chromium/third_party/ffmpeg/libavformat/riff.c
@@ -149,6 +149,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_DVVIDEO, MKTAG('p', 'd', 'v', 'c') },
{ AV_CODEC_ID_DVVIDEO, MKTAG('S', 'L', '2', '5') },
{ AV_CODEC_ID_DVVIDEO, MKTAG('S', 'L', 'D', 'V') },
+ { AV_CODEC_ID_DVVIDEO, MKTAG('A', 'V', 'd', '1') },
{ AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
{ AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', '2') },
@@ -323,6 +324,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_JPEG2000, MKTAG('L', 'J', '2', 'C') },
{ AV_CODEC_ID_JPEG2000, MKTAG('L', 'J', '2', 'K') },
{ AV_CODEC_ID_JPEG2000, MKTAG('I', 'P', 'J', '2') },
+ { AV_CODEC_ID_JPEG2000, MKTAG('A', 'V', 'j', '2') }, /* Avid jpeg2000 */
{ AV_CODEC_ID_VMNC, MKTAG('V', 'M', 'n', 'c') },
{ AV_CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') },
{ AV_CODEC_ID_PNG, MKTAG('M', 'P', 'N', 'G') },
diff --git a/chromium/third_party/ffmpeg/libavformat/riff.h b/chromium/third_party/ffmpeg/libavformat/riff.h
index ae5ecef4c5a..d6d91ef52d6 100644
--- a/chromium/third_party/ffmpeg/libavformat/riff.h
+++ b/chromium/third_party/ffmpeg/libavformat/riff.h
@@ -53,6 +53,11 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX 0x00000001
/**
+ * Tell ff_put_wav_header() to write an empty channel mask.
+ */
+#define FF_PUT_WAV_HEADER_SKIP_CHANNELMASK 0x00000002
+
+/**
* Write WAVEFORMAT header structure.
*
* @param flags a combination of FF_PUT_WAV_HEADER_* constants
@@ -62,7 +67,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags);
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps);
-int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_endian);
+int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int size, int big_endian);
extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags()
extern const AVCodecTag ff_codec_wav_tags[];
diff --git a/chromium/third_party/ffmpeg/libavformat/riffdec.c b/chromium/third_party/ffmpeg/libavformat/riffdec.c
index f44df1e672c..7eecdb24b88 100644
--- a/chromium/third_party/ffmpeg/libavformat/riffdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/riffdec.c
@@ -31,10 +31,12 @@
int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
+ int ret;
av_assert0(sizeof(*g) == 16); //compiler will optimize this out
- if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) {
+ ret = avio_read(s, *g, sizeof(*g));
+ if (ret < (int)sizeof(*g)) {
memset(*g, 0, sizeof(*g));
- return AVERROR_INVALIDDATA;
+ return ret < 0 ? ret : AVERROR_INVALIDDATA;
}
return 0;
}
@@ -81,25 +83,29 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecContext *c)
}
/* "big_endian" values are needed for RIFX file format */
-int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_endian)
+int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
+ AVCodecContext *codec, int size, int big_endian)
{
int id;
+ uint64_t bitrate;
- if (size < 14)
+ if (size < 14) {
avpriv_request_sample(codec, "wav header size < 14");
+ return AVERROR_INVALIDDATA;
+ }
codec->codec_type = AVMEDIA_TYPE_AUDIO;
if (!big_endian) {
id = avio_rl16(pb);
codec->channels = avio_rl16(pb);
codec->sample_rate = avio_rl32(pb);
- codec->bit_rate = avio_rl32(pb) * 8;
+ bitrate = avio_rl32(pb) * 8LL;
codec->block_align = avio_rl16(pb);
} else {
id = avio_rb16(pb);
codec->channels = avio_rb16(pb);
codec->sample_rate = avio_rb32(pb);
- codec->bit_rate = avio_rb32(pb) * 8;
+ bitrate = avio_rb32(pb) * 8LL;
codec->block_align = avio_rb16(pb);
}
if (size == 14) { /* We're dealing with plain vanilla WAVEFORMAT */
@@ -142,8 +148,25 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_
if (size > 0)
avio_skip(pb, size);
}
+
+ if (bitrate > INT_MAX) {
+ if (s->error_recognition & AV_EF_EXPLODE) {
+ av_log(s, AV_LOG_ERROR,
+ "The bitrate %"PRIu64" is too large.\n",
+ bitrate);
+ return AVERROR_INVALIDDATA;
+ } else {
+ av_log(s, AV_LOG_WARNING,
+ "The bitrate %"PRIu64" is too large, resetting to 0.",
+ bitrate);
+ codec->bit_rate = 0;
+ }
+ } else {
+ codec->bit_rate = bitrate;
+ }
+
if (codec->sample_rate <= 0) {
- av_log(NULL, AV_LOG_ERROR,
+ av_log(s, AV_LOG_ERROR,
"Invalid sample rate: %d\n", codec->sample_rate);
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/riffenc.c b/chromium/third_party/ffmpeg/libavformat/riffenc.c
index 85c953f2efe..ceb27f272ca 100644
--- a/chromium/third_party/ffmpeg/libavformat/riffenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/riffenc.c
@@ -168,8 +168,9 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags)
}
/* write WAVEFORMATEXTENSIBLE extensions */
if (waveformatextensible) {
- int write_channel_mask = enc->strict_std_compliance < FF_COMPLIANCE_NORMAL ||
- enc->channel_layout < 0x40000;
+ int write_channel_mask = !(flags & FF_PUT_WAV_HEADER_SKIP_CHANNELMASK) &&
+ (enc->strict_std_compliance < FF_COMPLIANCE_NORMAL ||
+ enc->channel_layout < 0x40000);
/* 22 is WAVEFORMATEXTENSIBLE size */
avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
/* ValidBitsPerSample || SamplesPerBlock || Reserved */
diff --git a/chromium/third_party/ffmpeg/libavformat/rmdec.c b/chromium/third_party/ffmpeg/libavformat/rmdec.c
index 832f15daa45..59a80355e0d 100644
--- a/chromium/third_party/ffmpeg/libavformat/rmdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/rmdec.c
@@ -220,7 +220,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
if (version == 5)
avio_r8(pb);
codecdata_length = avio_rb32(pb);
- if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
+ if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
return -1;
}
@@ -250,7 +250,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
if (version == 5)
avio_r8(pb);
codecdata_length = avio_rb32(pb);
- if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
+ if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
return -1;
}
@@ -327,20 +327,6 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb,
codec_pos = avio_tell(pb);
v = avio_rb32(pb);
- if (v == MKBETAG('M', 'L', 'T', 'I')) {
- int number_of_streams = avio_rb16(pb);
- int number_of_mdpr;
- int i;
- for (i = 0; i<number_of_streams; i++)
- avio_rb16(pb);
- number_of_mdpr = avio_rb16(pb);
- if (number_of_mdpr != 1) {
- avpriv_request_sample(s, "MLTI with multiple MDPR");
- }
- avio_rb32(pb);
- v = avio_rb32(pb);
- }
-
if (v == MKTAG(0xfd, 'a', 'r', '.')) {
/* ra type header */
if (rm_read_audio_stream_info(s, pb, st, rst, 0))
@@ -514,6 +500,8 @@ static int rm_read_header(AVFormatContext *s)
char buf[128], mime[128];
int flags = 0;
int ret = -1;
+ unsigned size, v;
+ int64_t codec_pos;
tag = avio_rl32(pb);
if (tag == MKTAG('.', 'r', 'a', 0xfd)) {
@@ -584,9 +572,55 @@ static int rm_read_header(AVFormatContext *s)
st->priv_data = ff_rm_alloc_rmstream();
if (!st->priv_data)
return AVERROR(ENOMEM);
- if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data,
- avio_rb32(pb), mime) < 0)
- goto fail;
+
+ size = avio_rb32(pb);
+ codec_pos = avio_tell(pb);
+
+ ffio_ensure_seekback(pb, 4);
+ v = avio_rb32(pb);
+ if (v == MKBETAG('M', 'L', 'T', 'I')) {
+ int number_of_streams = avio_rb16(pb);
+ int number_of_mdpr;
+ int i;
+ unsigned size2;
+ for (i = 0; i<number_of_streams; i++)
+ avio_rb16(pb);
+ number_of_mdpr = avio_rb16(pb);
+ if (number_of_mdpr != 1) {
+ avpriv_request_sample(s, "MLTI with multiple (%d) MDPR", number_of_mdpr);
+ }
+ for (i = 0; i < number_of_mdpr; i++) {
+ AVStream *st2;
+ if (i > 0) {
+ st2 = avformat_new_stream(s, NULL);
+ if (!st2) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+ st2->id = st->id + (i<<16);
+ st2->codec->bit_rate = st->codec->bit_rate;
+ st2->start_time = st->start_time;
+ st2->duration = st->duration;
+ st2->codec->codec_type = AVMEDIA_TYPE_DATA;
+ st2->priv_data = ff_rm_alloc_rmstream();
+ if (!st2->priv_data)
+ return AVERROR(ENOMEM);
+ } else
+ st2 = st;
+
+ size2 = avio_rb32(pb);
+ if (ff_rm_read_mdpr_codecdata(s, s->pb, st2, st2->priv_data,
+ size2, mime) < 0)
+ goto fail;
+ }
+ avio_seek(pb, codec_pos + size, SEEK_SET);
+ } else {
+ avio_skip(pb, -4);
+ if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data,
+ size, mime) < 0)
+ goto fail;
+ }
+
break;
case MKTAG('D', 'A', 'T', 'A'):
goto header_end;
@@ -644,9 +678,11 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
while(!avio_feof(pb)){
int len, num, i;
+ int mlti_id;
*pos= avio_tell(pb) - 3;
if(rm->remaining_len > 0){
num= rm->current_stream;
+ mlti_id = 0;
len= rm->remaining_len;
*timestamp = AV_NOPTS_VALUE;
*flags= 0;
@@ -682,12 +718,13 @@ static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stre
num = avio_rb16(pb);
*timestamp = avio_rb32(pb);
- avio_r8(pb); /* reserved */
+ mlti_id = (avio_r8(pb)>>1)-1<<16;
+ mlti_id = FFMAX(mlti_id, 0);
*flags = avio_r8(pb); /* flags */
}
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
- if (num == st->id)
+ if (mlti_id + num == st->id)
break;
}
if (i == s->nb_streams) {
@@ -797,11 +834,6 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
vst->pkt.data= NULL;
vst->pkt.size= 0;
vst->pkt.buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- vst->pkt.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
vst->videobufpos - 1 - 8*vst->slices);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmp.h b/chromium/third_party/ffmpeg/libavformat/rtmp.h
index 8fc8040d89e..6600da74f01 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmp.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtmp.h
@@ -29,9 +29,6 @@
#define RTMP_HANDSHAKE_PACKET_SIZE 1536
-#define HMAC_IPAD_VAL 0x36
-#define HMAC_OPAD_VAL 0x5C
-
/**
* emulated Flash client version - 9.0.124.2 on Linux
* @{
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmppkt.c b/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
index c474fb3d588..0d693c27f7f 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtmppkt.c
@@ -440,6 +440,7 @@ int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)
case AMF_DATA_TYPE_STRING: return 3 + AV_RB16(data);
case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data);
case AMF_DATA_TYPE_NULL: return 1;
+ case AMF_DATA_TYPE_DATE: return 11;
case AMF_DATA_TYPE_ARRAY:
parse_key = 0;
case AMF_DATA_TYPE_MIXEDARRAY:
diff --git a/chromium/third_party/ffmpeg/libavformat/rtmpproto.c b/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
index 43ddfe8ecc4..51d9ac601c8 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtmpproto.c
@@ -27,12 +27,12 @@
#include "libavcodec/bytestream.h"
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
+#include "libavutil/hmac.h"
#include "libavutil/intfloat.h"
#include "libavutil/lfg.h"
#include "libavutil/md5.h"
#include "libavutil/opt.h"
#include "libavutil/random_seed.h"
-#include "libavutil/sha.h"
#include "avformat.h"
#include "internal.h"
@@ -49,8 +49,8 @@
#endif
#define APP_MAX_LENGTH 1024
-#define PLAYPATH_MAX_LENGTH 256
-#define TCURL_MAX_LENGTH 512
+#define PLAYPATH_MAX_LENGTH 512
+#define TCURL_MAX_LENGTH 1024
#define FLASHVER_MAX_LENGTH 64
#define RTMP_PKTDATA_DEFAULT_SIZE 4096
#define RTMP_HEADER 11
@@ -956,41 +956,22 @@ static int gen_fcsubscribe_stream(URLContext *s, RTMPContext *rt,
int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
const uint8_t *key, int keylen, uint8_t *dst)
{
- struct AVSHA *sha;
- uint8_t hmac_buf[64+32] = {0};
- int i;
+ AVHMAC *hmac;
- sha = av_sha_alloc();
- if (!sha)
+ hmac = av_hmac_alloc(AV_HMAC_SHA256);
+ if (!hmac)
return AVERROR(ENOMEM);
- if (keylen < 64) {
- memcpy(hmac_buf, key, keylen);
- } else {
- av_sha_init(sha, 256);
- av_sha_update(sha,key, keylen);
- av_sha_final(sha, hmac_buf);
- }
- for (i = 0; i < 64; i++)
- hmac_buf[i] ^= HMAC_IPAD_VAL;
-
- av_sha_init(sha, 256);
- av_sha_update(sha, hmac_buf, 64);
+ av_hmac_init(hmac, key, keylen);
if (gap <= 0) {
- av_sha_update(sha, src, len);
+ av_hmac_update(hmac, src, len);
} else { //skip 32 bytes used for storing digest
- av_sha_update(sha, src, gap);
- av_sha_update(sha, src + gap + 32, len - gap - 32);
+ av_hmac_update(hmac, src, gap);
+ av_hmac_update(hmac, src + gap + 32, len - gap - 32);
}
- av_sha_final(sha, hmac_buf + 64);
-
- for (i = 0; i < 64; i++)
- hmac_buf[i] ^= HMAC_IPAD_VAL ^ HMAC_OPAD_VAL; //reuse XORed key for opad
- av_sha_init(sha, 256);
- av_sha_update(sha, hmac_buf, 64+32);
- av_sha_final(sha, dst);
+ av_hmac_final(hmac, dst, 32);
- av_free(sha);
+ av_hmac_free(hmac);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
index 2ac79dbf5ee..b399be423e3 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_h264.c
@@ -119,7 +119,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s,
uint8_t *dest = av_realloc(*data_ptr,
packet_size + sizeof(start_sequence) +
*size_ptr +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!dest) {
av_log(s, AV_LOG_ERROR,
"Unable to allocate memory for extradata!\n");
@@ -132,7 +132,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s,
memcpy(dest + *size_ptr + sizeof(start_sequence),
decoded_packet, packet_size);
memset(dest + *size_ptr + sizeof(start_sequence) +
- packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ packet_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
*size_ptr += sizeof(start_sequence) + packet_size;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_hevc.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_hevc.c
index 51c2094882b..815a72c2b2a 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_hevc.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_hevc.c
@@ -152,7 +152,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index,
codec->extradata_size = hevc_data->vps_size + hevc_data->sps_size +
hevc_data->pps_size + hevc_data->sei_size;
codec->extradata = av_malloc(codec->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata) {
ret = AVERROR(ENOMEM);
codec->extradata_size = 0;
@@ -166,7 +166,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index,
pos += hevc_data->pps_size;
memcpy(codec->extradata + pos, hevc_data->sei, hevc_data->sei_size);
pos += hevc_data->sei_size;
- memset(codec->extradata + pos, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(codec->extradata + pos, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
av_freep(&hevc_data->vps);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_latm.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_latm.c
index 7db92f60fa3..aebba5741df 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_latm.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_latm.c
@@ -97,7 +97,7 @@ static int parse_fmtp_config(AVStream *st, const char *value)
int audio_mux_version, same_time_framing, num_programs, num_layers;
/* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
- config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
+ config = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!config)
return AVERROR(ENOMEM);
ff_hex_to_data(config, value);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_qt.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_qt.c
index ba701dc6cf3..e11303fe011 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_qt.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_qt.c
@@ -174,14 +174,14 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
if (qt->pkt.size > 0 && qt->timestamp == *timestamp) {
int err;
if ((err = av_reallocp(&qt->pkt.data, qt->pkt.size + alen +
- FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
+ AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
qt->pkt.size = 0;
return err;
}
} else {
av_freep(&qt->pkt.data);
av_init_packet(&qt->pkt);
- qt->pkt.data = av_realloc(NULL, alen + FF_INPUT_BUFFER_PADDING_SIZE);
+ qt->pkt.data = av_realloc(NULL, alen + AV_INPUT_BUFFER_PADDING_SIZE);
if (!qt->pkt.data)
return AVERROR(ENOMEM);
qt->pkt.size = 0;
@@ -198,7 +198,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
qt->pkt.data = NULL;
pkt->flags = keyframe ? AV_PKT_FLAG_KEY : 0;
pkt->stream_index = st->index;
- memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
return 0;
}
return AVERROR(EAGAIN);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c b/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
index eceb840580f..9ea3b193864 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpdec_xiph.c
@@ -262,8 +262,8 @@ parse_packed_headers(const uint8_t * packed_headers,
/* allocate extra space:
* -- length/255 +2 for xiphlacing
* -- one for the '2' marker
- * -- FF_INPUT_BUFFER_PADDING_SIZE required */
- extradata_alloc = length + length/255 + 3 + FF_INPUT_BUFFER_PADDING_SIZE;
+ * -- AV_INPUT_BUFFER_PADDING_SIZE required */
+ extradata_alloc = length + length/255 + 3 + AV_INPUT_BUFFER_PADDING_SIZE;
if (ff_alloc_extradata(codec, extradata_alloc)) {
av_log(codec, AV_LOG_ERROR, "Out of memory\n");
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpenc_chain.c b/chromium/third_party/ffmpeg/libavformat/rtpenc_chain.c
index 74f306eb96b..96e65efbaa9 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpenc_chain.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpenc_chain.c
@@ -58,7 +58,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
rtpctx->max_delay = s->max_delay;
/* Copy other stream parameters. */
rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
- rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM;
+ rtpctx->flags |= s->flags & (AVFMT_FLAG_MP4A_LATM | AVFMT_FLAG_BITEXACT);
/* Get the payload type from the codec */
if (st->id < RTP_PT_PRIVATE)
diff --git a/chromium/third_party/ffmpeg/libavformat/rtpenc_jpeg.c b/chromium/third_party/ffmpeg/libavformat/rtpenc_jpeg.c
index 7ee26c435e7..a6f2b32df4a 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtpenc_jpeg.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtpenc_jpeg.c
@@ -21,13 +21,14 @@
#include "libavcodec/bytestream.h"
#include "libavcodec/mjpeg.h"
+#include "libavcodec/jpegtables.h"
#include "libavutil/intreadwrite.h"
#include "rtpenc.h"
void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
{
RTPMuxContext *s = s1->priv_data;
- const uint8_t *qtables = NULL;
+ const uint8_t *qtables[4] = { NULL };
int nb_qtables = 0;
uint8_t type;
uint8_t w, h;
@@ -63,24 +64,50 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
continue;
if (buf[i + 1] == DQT) {
- if (buf[i + 4])
+ int tables, j;
+ if (buf[i + 4] & 0xF0)
av_log(s1, AV_LOG_WARNING,
"Only 8-bit precision is supported.\n");
/* a quantization table is 64 bytes long */
- nb_qtables = AV_RB16(&buf[i + 2]) / 65;
- if (i + 4 + nb_qtables * 65 > size) {
+ tables = AV_RB16(&buf[i + 2]) / 65;
+ if (i + 5 + tables * 65 > size) {
av_log(s1, AV_LOG_ERROR, "Too short JPEG header. Aborted!\n");
return;
}
+ if (nb_qtables + tables > 4) {
+ av_log(s1, AV_LOG_ERROR, "Invalid number of quantisation tables\n");
+ return;
+ }
- qtables = &buf[i + 4];
+ for (j = 0; j < tables; j++)
+ qtables[nb_qtables + j] = buf + i + 5 + j * 65;
+ nb_qtables += tables;
} else if (buf[i + 1] == SOF0) {
if (buf[i + 14] != 17 || buf[i + 17] != 17) {
av_log(s1, AV_LOG_ERROR,
"Only 1x1 chroma blocks are supported. Aborted!\n");
return;
}
+ } else if (buf[i + 1] == DHT) {
+ if ( AV_RB16(&buf[i + 2]) < 418
+ || i + 420 >= size
+ || buf[i + 4] != 0x00
+ || buf[i + 33] != 0x01
+ || buf[i + 62] != 0x10
+ || buf[i + 241] != 0x11
+ || memcmp(buf + i + 5, avpriv_mjpeg_bits_dc_luminance + 1, 16)
+ || memcmp(buf + i + 21, avpriv_mjpeg_val_dc, 12)
+ || memcmp(buf + i + 34, avpriv_mjpeg_bits_dc_chrominance + 1, 16)
+ || memcmp(buf + i + 50, avpriv_mjpeg_val_dc, 12)
+ || memcmp(buf + i + 63, avpriv_mjpeg_bits_ac_luminance + 1, 16)
+ || memcmp(buf + i + 79, avpriv_mjpeg_val_ac_luminance, 162)
+ || memcmp(buf + i + 242, avpriv_mjpeg_bits_ac_chrominance + 1, 16)
+ || memcmp(buf + i + 258, avpriv_mjpeg_val_ac_chrominance, 162)) {
+ av_log(s1, AV_LOG_ERROR,
+ "RFC 2435 requires standard Huffman tables for jpeg\n");
+ return;
+ }
} else if (buf[i + 1] == SOS) {
/* SOS is last marker in the header */
i += AV_RB16(&buf[i + 2]) + 2;
@@ -92,6 +119,10 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
break;
}
}
+ if (nb_qtables && nb_qtables != 2)
+ av_log(s1, AV_LOG_WARNING,
+ "RFC 2435 suggests two quantization tables, %d provided\n",
+ nb_qtables);
/* skip JPEG header */
buf += i;
@@ -130,7 +161,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
bytestream_put_be16(&p, 64 * nb_qtables);
for (i = 0; i < nb_qtables; i++)
- bytestream_put_buffer(&p, &qtables[65 * i + 1], 64);
+ bytestream_put_buffer(&p, qtables[i], 64);
}
/* copy payload data */
diff --git a/chromium/third_party/ffmpeg/libavformat/rtsp.c b/chromium/third_party/ffmpeg/libavformat/rtsp.c
index 98bd4cbe9ab..9aa66d24a4b 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtsp.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtsp.c
@@ -1136,6 +1136,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
unsigned char ch;
const char *p;
int ret, content_length, line_count = 0, request = 0;
+ int first_line = 1;
unsigned char *content = NULL;
start:
@@ -1155,8 +1156,7 @@ start:
return AVERROR_EOF;
if (ch == '\n')
break;
- if (ch == '$') {
- /* XXX: only parse it if first char on line ? */
+ if (ch == '$' && first_line && q == buf) {
if (return_on_interleaved_data) {
return 1;
} else
@@ -1167,6 +1167,7 @@ start:
}
}
*q = '\0';
+ first_line = 0;
av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);
diff --git a/chromium/third_party/ffmpeg/libavformat/samidec.c b/chromium/third_party/ffmpeg/libavformat/samidec.c
index 948e1ed8b13..11c674ce19b 100644
--- a/chromium/third_party/ffmpeg/libavformat/samidec.c
+++ b/chromium/third_party/ffmpeg/libavformat/samidec.c
@@ -68,11 +68,17 @@ static int sami_read_header(AVFormatContext *s)
while (!ff_text_eof(&tr)) {
AVPacket *sub;
const int64_t pos = ff_text_pos(&tr) - (c != 0);
- int is_sync, n = ff_smil_extract_next_text_chunk(&tr, &buf, &c);
+ int is_sync, is_body, n = ff_smil_extract_next_text_chunk(&tr, &buf, &c);
if (n == 0)
break;
+ is_body = !av_strncasecmp(buf.str, "</BODY", 6);
+ if (is_body) {
+ av_bprint_clear(&buf);
+ break;
+ }
+
is_sync = !av_strncasecmp(buf.str, "<SYNC", 5);
if (is_sync)
got_first_sync_point = 1;
@@ -99,7 +105,7 @@ static int sami_read_header(AVFormatContext *s)
if (res < 0)
goto end;
- ff_subtitles_queue_finalize(&sami->q);
+ ff_subtitles_queue_finalize(s, &sami->q);
end:
av_bprint_finalize(&buf, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/sdp.c b/chromium/third_party/ffmpeg/libavformat/sdp.c
index 4d621c7ffc9..45974b394fb 100644
--- a/chromium/third_party/ffmpeg/libavformat/sdp.c
+++ b/chromium/third_party/ffmpeg/libavformat/sdp.c
@@ -685,7 +685,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
const char *mode;
uint64_t vad_option;
- if (c->flags & CODEC_FLAG_QSCALE)
+ if (c->flags & AV_CODEC_FLAG_QSCALE)
mode = "on";
else if (!av_opt_get_int(c, "vad", AV_OPT_FLAG_ENCODING_PARAM, &vad_option) && vad_option)
mode = "vad";
diff --git a/chromium/third_party/ffmpeg/libavformat/segment.c b/chromium/third_party/ffmpeg/libavformat/segment.c
index 42471bb1906..36417f21923 100644
--- a/chromium/third_party/ffmpeg/libavformat/segment.c
+++ b/chromium/third_party/ffmpeg/libavformat/segment.c
@@ -33,6 +33,7 @@
#include "internal.h"
#include "libavutil/avassert.h"
+#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
@@ -113,6 +114,9 @@ typedef struct SegmentContext {
int reference_stream_index;
int break_non_keyframes;
+ int use_rename;
+ char temp_list_filename[1024];
+
SegmentListEntry cur_entry;
SegmentListEntry *segment_list_entries;
SegmentListEntry *segment_list_entries_end;
@@ -258,7 +262,8 @@ static int segment_list_open(AVFormatContext *s)
SegmentContext *seg = s->priv_data;
int ret;
- ret = avio_open2(&seg->list_pb, seg->list, AVIO_FLAG_WRITE,
+ snprintf(seg->temp_list_filename, sizeof(seg->temp_list_filename), seg->use_rename ? "%s.tmp" : "%s", seg->list);
+ ret = avio_open2(&seg->list_pb, seg->temp_list_filename, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Failed to open segment list '%s'\n", seg->list);
@@ -347,6 +352,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
/* append new element */
memcpy(entry, &seg->cur_entry, sizeof(*entry));
+ entry->filename = av_strdup(entry->filename);
if (!seg->segment_list_entries)
seg->segment_list_entries = seg->segment_list_entries_end = entry;
else
@@ -368,6 +374,8 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
if (seg->list_type == LIST_TYPE_M3U8 && is_last)
avio_printf(seg->list_pb, "#EXT-X-ENDLIST\n");
avio_closep(&seg->list_pb);
+ if (seg->use_rename)
+ ff_rename(seg->temp_list_filename, seg->list, s);
} else {
segment_list_print_entry(seg->list_pb, seg->list_type, &seg->cur_entry, s);
avio_flush(seg->list_pb);
@@ -644,9 +652,13 @@ static int seg_write_header(AVFormatContext *s)
else if (av_match_ext(seg->list, "ffcat,ffconcat")) seg->list_type = LIST_TYPE_FFCONCAT;
else seg->list_type = LIST_TYPE_FLAT;
}
- if (!seg->list_size && seg->list_type != LIST_TYPE_M3U8)
+ if (!seg->list_size && seg->list_type != LIST_TYPE_M3U8) {
if ((ret = segment_list_open(s)) < 0)
goto fail;
+ } else {
+ const char *proto = avio_find_protocol_name(s->filename);
+ seg->use_rename = proto && !strcmp(proto, "file");
+ }
}
if (seg->list_type == LIST_TYPE_EXT)
av_log(s, AV_LOG_WARNING, "'ext' list type option is deprecated in favor of 'csv'\n");
@@ -774,7 +786,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
- av_dlog(s, "packet stream:%d pts:%s pts_time:%s duration_time:%s is_key:%d frame:%d\n",
+ ff_dlog(s, "packet stream:%d pts:%s pts_time:%s duration_time:%s is_key:%d frame:%d\n",
pkt->stream_index, av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base),
av_ts2timestr(pkt->duration, &st->time_base),
pkt->flags & AV_PKT_FLAG_KEY,
@@ -875,6 +887,7 @@ fail:
av_opt_free(seg);
av_freep(&seg->times);
av_freep(&seg->frames);
+ av_freep(&seg->cur_entry.filename);
cur = seg->segment_list_entries;
while (cur) {
diff --git a/chromium/third_party/ffmpeg/libavformat/spdifenc.c b/chromium/third_party/ffmpeg/libavformat/spdifenc.c
index cdcff244212..b4608a1c7c5 100644
--- a/chromium/third_party/ffmpeg/libavformat/spdifenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/spdifenc.c
@@ -525,7 +525,7 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) {
avio_write(s->pb, ctx->out_buf, ctx->out_bytes & ~1);
} else {
- av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE);
+ av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ctx->buffer)
return AVERROR(ENOMEM);
ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
diff --git a/chromium/third_party/ffmpeg/libavformat/srtdec.c b/chromium/third_party/ffmpeg/libavformat/srtdec.c
index b35e50fc367..60d2f48517f 100644
--- a/chromium/third_party/ffmpeg/libavformat/srtdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/srtdec.c
@@ -134,7 +134,7 @@ static int srt_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&srt->q);
+ ff_subtitles_queue_finalize(s, &srt->q);
end:
av_bprint_finalize(&buf, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/stldec.c b/chromium/third_party/ffmpeg/libavformat/stldec.c
index b84c7e9eb0a..8b1f0a6d5bb 100644
--- a/chromium/third_party/ffmpeg/libavformat/stldec.c
+++ b/chromium/third_party/ffmpeg/libavformat/stldec.c
@@ -104,7 +104,7 @@ static int stl_read_header(AVFormatContext *s)
sub->duration = duration;
}
}
- ff_subtitles_queue_finalize(&stl->q);
+ ff_subtitles_queue_finalize(s, &stl->q);
return 0;
}
static int stl_read_packet(AVFormatContext *s, AVPacket *pkt)
diff --git a/chromium/third_party/ffmpeg/libavformat/subtitles.c b/chromium/third_party/ffmpeg/libavformat/subtitles.c
index 5bdbc8dc512..192043f9177 100644
--- a/chromium/third_party/ffmpeg/libavformat/subtitles.c
+++ b/chromium/third_party/ffmpeg/libavformat/subtitles.c
@@ -166,7 +166,34 @@ static int cmp_pkt_sub_pos_ts(const void *a, const void *b)
return s1->pos > s2->pos ? 1 : -1;
}
-void ff_subtitles_queue_finalize(FFDemuxSubtitlesQueue *q)
+static void drop_dups(void *log_ctx, FFDemuxSubtitlesQueue *q)
+{
+ int i, drop = 0;
+
+ for (i = 1; i < q->nb_subs; i++) {
+ const int last_id = i - 1 - drop;
+ const AVPacket *last = &q->subs[last_id];
+
+ if (q->subs[i].pts == last->pts &&
+ q->subs[i].duration == last->duration &&
+ q->subs[i].stream_index == last->stream_index &&
+ !strcmp(q->subs[i].data, last->data)) {
+
+ av_free_packet(&q->subs[i]);
+ drop++;
+ } else if (drop) {
+ q->subs[last_id + 1] = q->subs[i];
+ memset(&q->subs[i], 0, sizeof(q->subs[i])); // for safety
+ }
+ }
+
+ if (drop) {
+ q->nb_subs -= drop;
+ av_log(log_ctx, AV_LOG_WARNING, "Dropping %d duplicated subtitle events\n", drop);
+ }
+}
+
+void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
{
int i;
@@ -176,6 +203,8 @@ void ff_subtitles_queue_finalize(FFDemuxSubtitlesQueue *q)
for (i = 0; i < q->nb_subs; i++)
if (q->subs[i].duration == -1 && i < q->nb_subs - 1)
q->subs[i].duration = q->subs[i + 1].pts - q->subs[i].pts;
+
+ drop_dups(log_ctx, q);
}
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
diff --git a/chromium/third_party/ffmpeg/libavformat/subtitles.h b/chromium/third_party/ffmpeg/libavformat/subtitles.h
index 885285cc477..c70f6fffde6 100644
--- a/chromium/third_party/ffmpeg/libavformat/subtitles.h
+++ b/chromium/third_party/ffmpeg/libavformat/subtitles.h
@@ -119,9 +119,10 @@ AVPacket *ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q,
const uint8_t *event, size_t len, int merge);
/**
- * Set missing durations and sort subtitles by PTS, and then byte position.
+ * Set missing durations, sort subtitles by PTS (and then byte position), and
+ * drop duplicated events.
*/
-void ff_subtitles_queue_finalize(FFDemuxSubtitlesQueue *q);
+void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q);
/**
* Generic read_packet() callback for subtitles demuxers using this queue
diff --git a/chromium/third_party/ffmpeg/libavformat/subviewer1dec.c b/chromium/third_party/ffmpeg/libavformat/subviewer1dec.c
index 6b38533a882..93db4ebf21a 100644
--- a/chromium/third_party/ffmpeg/libavformat/subviewer1dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/subviewer1dec.c
@@ -86,7 +86,7 @@ static int subviewer1_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&subviewer1->q);
+ ff_subtitles_queue_finalize(s, &subviewer1->q);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/subviewerdec.c b/chromium/third_party/ffmpeg/libavformat/subviewerdec.c
index f1b0fdf0a5c..d4b2fdf4565 100644
--- a/chromium/third_party/ffmpeg/libavformat/subviewerdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/subviewerdec.c
@@ -153,7 +153,7 @@ static int subviewer_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&subviewer->q);
+ ff_subtitles_queue_finalize(s, &subviewer->q);
end:
av_bprint_finalize(&header, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/swfdec.c b/chromium/third_party/ffmpeg/libavformat/swfdec.c
index d34d3d90dff..68cd8561fb5 100644
--- a/chromium/third_party/ffmpeg/libavformat/swfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/swfdec.c
@@ -23,6 +23,7 @@
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/get_bits.h"
#include "swf.h"
@@ -67,7 +68,12 @@ static int swf_probe(AVProbeData *p)
&& AV_RB24(p->buf) != AV_RB24("FWS"))
return 0;
- init_get_bits8(&gb, p->buf + 3, p->buf_size - 3);
+ if ( AV_RB24(p->buf) == AV_RB24("CWS")
+ && p->buf[3] <= 20)
+ return AVPROBE_SCORE_MAX / 4 + 1;
+
+ if (init_get_bits8(&gb, p->buf + 3, p->buf_size - 3) < 0)
+ return 0;
skip_bits(&gb, 40);
len = get_bits(&gb, 5);
@@ -338,7 +344,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
out_len = colormapsize * colormapbpp + linesize * height;
- av_dlog(s, "bitmap: ch=%d fmt=%d %dx%d (linesize=%d) len=%d->%ld pal=%d\n",
+ ff_dlog(s, "bitmap: ch=%d fmt=%d %dx%d (linesize=%d) len=%d->%ld pal=%d\n",
ch_id, bmp_fmt, width, height, linesize, len, out_len, colormapsize);
zbuf = av_malloc(len);
@@ -407,10 +413,8 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
- res = AVERROR_PATCHWELCOME;
- goto bitmap_end;
- }
- st->codec->pix_fmt = pix_fmt;
+ } else
+ st->codec->pix_fmt = pix_fmt;
if (linesize * height > pkt->size) {
res = AVERROR_INVALIDDATA;
diff --git a/chromium/third_party/ffmpeg/libavformat/takdec.c b/chromium/third_party/ffmpeg/libavformat/takdec.c
index 3eb1a8ec2d4..970ab4a8b49 100644
--- a/chromium/third_party/ffmpeg/libavformat/takdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/takdec.c
@@ -82,10 +82,10 @@ static int tak_read_header(AVFormatContext *s)
if (size <= 3)
return AVERROR_INVALIDDATA;
- buffer = av_malloc(size - 3 + FF_INPUT_BUFFER_PADDING_SIZE);
+ buffer = av_malloc(size - 3 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!buffer)
return AVERROR(ENOMEM);
- memset(buffer + size - 3, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(buffer + size - 3, 0, AV_INPUT_BUFFER_PADDING_SIZE);
ffio_init_checksum(pb, tak_check_crc, 0xCE04B7U);
if (avio_read(pb, buffer, size - 3) != size - 3) {
diff --git a/chromium/third_party/ffmpeg/libavformat/tcp.c b/chromium/third_party/ffmpeg/libavformat/tcp.c
index f24cad2080d..e02c64b8001 100644
--- a/chromium/third_party/ffmpeg/libavformat/tcp.c
+++ b/chromium/third_party/ffmpeg/libavformat/tcp.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
+#include "libavutil/avassert.h"
#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
@@ -44,7 +45,7 @@ typedef struct TCPContext {
#define D AV_OPT_FLAG_DECODING_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "listen", "Listen for incoming connections", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = D|E },
+ { "listen", "Listen for incoming connections", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, .flags = D|E },
{ "timeout", "set timeout (in microseconds) of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
{ "listen_timeout", "Connection awaiting timeout (in milliseconds)", OFFSET(listen_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
{ NULL }
@@ -125,11 +126,16 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
goto fail;
}
- if (s->listen) {
+ if (s->listen == 2) {
+ // multi-client
+ if ((ret = ff_listen(fd, cur_ai->ai_addr, cur_ai->ai_addrlen)) < 0)
+ goto fail1;
+ } else if (s->listen == 1) {
+ // single client
if ((ret = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
- s->listen_timeout, h)) < 0) {
+ s->listen_timeout, h)) < 0)
goto fail1;
- }
+ // Socket descriptor already closed here. Safe to overwrite to client one.
fd = ret;
} else {
if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
@@ -163,6 +169,22 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
return ret;
}
+static int tcp_accept(URLContext *s, URLContext **c)
+{
+ TCPContext *sc = s->priv_data;
+ TCPContext *cc;
+ int ret;
+ av_assert0(sc->listen);
+ if ((ret = ffurl_alloc(c, s->filename, s->flags, &s->interrupt_callback)) < 0)
+ return ret;
+ cc = (*c)->priv_data;
+ ret = ff_accept(sc->fd, sc->listen_timeout, s);
+ if (ret < 0)
+ return ff_neterrno();
+ cc->fd = ret;
+ return 0;
+}
+
static int tcp_read(URLContext *h, uint8_t *buf, int size)
{
TCPContext *s = h->priv_data;
@@ -223,6 +245,7 @@ static int tcp_get_file_handle(URLContext *h)
URLProtocol ff_tcp_protocol = {
.name = "tcp",
.url_open = tcp_open,
+ .url_accept = tcp_accept,
.url_read = tcp_read,
.url_write = tcp_write,
.url_close = tcp_close,
diff --git a/chromium/third_party/ffmpeg/libavformat/tedcaptionsdec.c b/chromium/third_party/ffmpeg/libavformat/tedcaptionsdec.c
index fb578ebc036..b6dc5170737 100644
--- a/chromium/third_party/ffmpeg/libavformat/tedcaptionsdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/tedcaptionsdec.c
@@ -34,7 +34,7 @@ typedef struct {
static const AVOption tedcaptions_options[] = {
{ "start_time", "set the start time (offset) of the subtitles, in ms",
- offsetof(TEDCaptionsDemuxer, start_time), FF_OPT_TYPE_INT64,
+ offsetof(TEDCaptionsDemuxer, start_time), AV_OPT_TYPE_INT64,
{ .i64 = 15000 }, INT64_MIN, INT64_MAX,
AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
@@ -287,7 +287,7 @@ static av_cold int tedcaptions_read_header(AVFormatContext *avf)
ff_subtitles_queue_clean(&tc->subs);
return ret;
}
- ff_subtitles_queue_finalize(&tc->subs);
+ ff_subtitles_queue_finalize(avf, &tc->subs);
for (i = 0; i < tc->subs.nb_subs; i++)
tc->subs.subs[i].pts += tc->start_time;
diff --git a/chromium/third_party/ffmpeg/libavformat/tee.c b/chromium/third_party/ffmpeg/libavformat/tee.c
index e3d466a3eb7..c619eae5db1 100644
--- a/chromium/third_party/ffmpeg/libavformat/tee.c
+++ b/chromium/third_party/ffmpeg/libavformat/tee.c
@@ -396,7 +396,7 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
- if (ret == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
+ if (ret == 0 && new_pkt.data != pkt->data) {
if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)
break;
ret = 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c b/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
index 6388f37a8e0..4bf94485343 100644
--- a/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
+++ b/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
@@ -144,7 +144,7 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
if (ret < 0)
av_log(h, AV_LOG_ERROR, "%s\n", gnutls_strerror(ret));
}
-#if GNUTLS_VERSION_MAJOR >= 3
+#if GNUTLS_VERSION_NUMBER >= 0x030020
else
gnutls_certificate_set_x509_system_trust(p->cred);
#endif
diff --git a/chromium/third_party/ffmpeg/libavformat/url.h b/chromium/third_party/ffmpeg/libavformat/url.h
index 1a845b77e7c..391e3bca2af 100644
--- a/chromium/third_party/ffmpeg/libavformat/url.h
+++ b/chromium/third_party/ffmpeg/libavformat/url.h
@@ -58,6 +58,8 @@ typedef struct URLProtocol {
* for those nested protocols.
*/
int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options);
+ int (*url_accept)(URLContext *s, URLContext **c);
+ int (*url_handshake)(URLContext *c);
/**
* Read data from the protocol.
@@ -90,6 +92,8 @@ typedef struct URLProtocol {
int (*url_open_dir)(URLContext *h);
int (*url_read_dir)(URLContext *h, AVIODirEntry **next);
int (*url_close_dir)(URLContext *h);
+ int (*url_delete)(URLContext *h);
+ int (*url_move)(URLContext *h_src, URLContext *h_dst);
} URLProtocol;
/**
@@ -138,6 +142,29 @@ int ffurl_open(URLContext **puc, const char *filename, int flags,
const AVIOInterruptCB *int_cb, AVDictionary **options);
/**
+ * Accept an URLContext c on an URLContext s
+ *
+ * @param s server context
+ * @param c client context, must be unallocated.
+ * @return >= 0 on success, ff_neterrno() on failure.
+ */
+int ffurl_accept(URLContext *s, URLContext **c);
+
+/**
+ * Perform one step of the protocol handshake to accept a new client.
+ * See avio_handshake() for details.
+ * Implementations should try to return decreasing values.
+ * If the protocol uses an underlying protocol, the underlying handshake is
+ * usually the first step, and the return value can be:
+ * (largest value for this protocol) + (return value from other protocol)
+ *
+ * @param c the client context
+ * @return >= 0 on success or a negative value corresponding
+ * to an AVERROR code on failure
+ */
+int ffurl_handshake(URLContext *c);
+
+/**
* Read up to size bytes from the resource accessed by h, and store
* the read bytes in buf.
*
diff --git a/chromium/third_party/ffmpeg/libavformat/utils.c b/chromium/third_party/ffmpeg/libavformat/utils.c
index caa15abbaed..24eacf39675 100644
--- a/chromium/third_party/ffmpeg/libavformat/utils.c
+++ b/chromium/third_party/ffmpeg/libavformat/utils.c
@@ -116,7 +116,10 @@ MAKE_ACCESSORS(AVFormatContext, format, AVOpenCallback, open_cb)
int64_t av_stream_get_end_pts(const AVStream *st)
{
- return st->pts.val;
+ if (st->priv_pts) {
+ return st->priv_pts->val;
+ } else
+ return AV_NOPTS_VALUE;
}
struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
@@ -1262,12 +1265,6 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) {
out_pkt.buf = pkt->buf;
pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- out_pkt.destruct = pkt->destruct;
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
if ((ret = av_dup_packet(&out_pkt)) < 0)
goto fail;
@@ -1585,26 +1582,26 @@ int av_find_default_stream_index(AVFormatContext *s)
int i;
AVStream *st;
int best_stream = 0;
- int best_score = -1;
+ int best_score = INT_MIN;
if (s->nb_streams <= 0)
return -1;
for (i = 0; i < s->nb_streams; i++) {
int score = 0;
st = s->streams[i];
- if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
- !(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
- if (!st->codec->width && !st->codec->height && !st->codec_info_nb_frames)
- score += 25;
- else
- score += 100;
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+ score -= 400;
+ if (st->codec->width && st->codec->height)
+ score += 50;
+ score+= 25;
}
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- if (!st->codec->sample_rate && !st->codec_info_nb_frames)
- score += 12;
- else
+ if (st->codec->sample_rate)
score += 50;
}
+ if (st->codec_info_nb_frames)
+ score += 12;
if (st->discard != AVDISCARD_ALL)
score += 200;
@@ -1781,6 +1778,63 @@ int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
return m;
}
+void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance)
+{
+ int ist1, ist2;
+ int64_t pos_delta = 0;
+ int64_t skip = 0;
+ //We could use URLProtocol flags here but as many user applications do not use URLProtocols this would be unreliable
+ const char *proto = avio_find_protocol_name(s->filename);
+
+ if (!proto) {
+ av_log(s, AV_LOG_INFO,
+ "Protocol name not provided, cannot determine if input is local or "
+ "a network protocol, buffers and access patterns cannot be configured "
+ "optimally without knowing the protocol\n");
+ }
+
+ if (proto && !(strcmp(proto, "file") && strcmp(proto, "pipe") && strcmp(proto, "cache")))
+ return;
+
+ for (ist1 = 0; ist1 < s->nb_streams; ist1++) {
+ AVStream *st1 = s->streams[ist1];
+ for (ist2 = 0; ist2 < s->nb_streams; ist2++) {
+ AVStream *st2 = s->streams[ist2];
+ int i1, i2;
+
+ if (ist1 == ist2)
+ continue;
+
+ for (i1 = i2 = 0; i1 < st1->nb_index_entries; i1++) {
+ AVIndexEntry *e1 = &st1->index_entries[i1];
+ int64_t e1_pts = av_rescale_q(e1->timestamp, st1->time_base, AV_TIME_BASE_Q);
+
+ skip = FFMAX(skip, e1->size);
+ for (; i2 < st2->nb_index_entries; i2++) {
+ AVIndexEntry *e2 = &st2->index_entries[i2];
+ int64_t e2_pts = av_rescale_q(e2->timestamp, st2->time_base, AV_TIME_BASE_Q);
+ if (e2_pts - e1_pts < time_tolerance)
+ continue;
+ pos_delta = FFMAX(pos_delta, e1->pos - e2->pos);
+ break;
+ }
+ }
+ }
+ }
+
+ pos_delta *= 2;
+ /* XXX This could be adjusted depending on protocol*/
+ if (s->pb->buffer_size < pos_delta && pos_delta < (1<<24)) {
+ av_log(s, AV_LOG_VERBOSE, "Reconfiguring buffers to size %"PRId64"\n", pos_delta);
+ ffio_set_buf_size(s->pb, pos_delta);
+ s->pb->short_seek_threshold = FFMAX(s->pb->short_seek_threshold, pos_delta/2);
+ }
+
+ if (skip < (1<<23)) {
+ s->pb->short_seek_threshold = FFMAX(s->pb->short_seek_threshold, skip);
+ }
+}
+
int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags)
{
return ff_index_search_timestamp(st->index_entries, st->nb_index_entries,
@@ -2665,7 +2719,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
ret >= 0 &&
(!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) ||
(!st->codec_info_nb_frames &&
- st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) {
+ (st->codec->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)))) {
got_picture = 0;
switch (st->codec->codec_type) {
case AVMEDIA_TYPE_VIDEO:
@@ -2865,14 +2919,14 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
{
int ret;
- if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ if (size < 0 || size >= INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
avctx->extradata = NULL;
avctx->extradata_size = 0;
return AVERROR(EINVAL);
}
- avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ avctx->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (avctx->extradata) {
- memset(avctx->extradata + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(avctx->extradata + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
avctx->extradata_size = size;
ret = 0;
} else {
@@ -3031,9 +3085,18 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
// new streams might appear, no options for those
int orig_nb_streams = ic->nb_streams;
int flush_codecs;
+#if FF_API_PROBESIZE_32
int64_t max_analyze_duration = ic->max_analyze_duration2;
+#else
+ int64_t max_analyze_duration = ic->max_analyze_duration;
+#endif
int64_t max_stream_analyze_duration;
+ int64_t max_subtitle_analyze_duration;
+#if FF_API_PROBESIZE_32
int64_t probesize = ic->probesize2;
+#else
+ int64_t probesize = ic->probesize;
+#endif
if (!max_analyze_duration)
max_analyze_duration = ic->max_analyze_duration;
@@ -3044,11 +3107,13 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
av_opt_set(ic, "skip_clear", "1", AV_OPT_SEARCH_CHILDREN);
max_stream_analyze_duration = max_analyze_duration;
+ max_subtitle_analyze_duration = max_analyze_duration;
if (!max_analyze_duration) {
max_stream_analyze_duration =
max_analyze_duration = 5*AV_TIME_BASE;
+ max_subtitle_analyze_duration = 30*AV_TIME_BASE;
if (!strcmp(ic->iformat->name, "flv"))
- max_stream_analyze_duration = 30*AV_TIME_BASE;
+ max_stream_analyze_duration = 90*AV_TIME_BASE;
}
if (ic->pb)
@@ -3264,6 +3329,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
if (st->codec_info_nb_frames>1) {
int64_t t = 0;
+ int64_t limit;
if (st->time_base.den > 0)
t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);
@@ -3276,10 +3342,14 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
&& st->info->fps_last_dts != AV_NOPTS_VALUE)
t = FFMAX(t, av_rescale_q(st->info->fps_last_dts - st->info->fps_first_dts, st->time_base, AV_TIME_BASE_Q));
- if (t >= (analyzed_all_streams ? max_analyze_duration : max_stream_analyze_duration)) {
- av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %"PRId64" reached at %"PRId64" microseconds\n",
- max_analyze_duration,
- t);
+ if (analyzed_all_streams) limit = max_analyze_duration;
+ else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) limit = max_subtitle_analyze_duration;
+ else limit = max_stream_analyze_duration;
+
+ if (t >= limit) {
+ av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %"PRId64" reached at %"PRId64" microseconds st:%d\n",
+ limit,
+ t, pkt->stream_index);
if (ic->flags & AVFMT_FLAG_NOBUFFER)
av_packet_unref(pkt);
break;
@@ -3308,7 +3378,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
* it takes longer and uses more memory. For MPEG-4, we need to
* decompress for QuickTime.
*
- * If CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
+ * If AV_CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
* least one frame of codec data, this makes sure the codec initializes
* the channel configuration and does not only trust the values from
* the container. */
@@ -3603,6 +3673,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
av_freep(&st->info->duration_error);
av_freep(&st->info);
av_freep(&st->recommended_encoder_configuration);
+ av_freep(&st->priv_pts);
av_freep(&s->streams[ --s->nb_streams ]);
}
@@ -4235,8 +4306,9 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
if (*spec <= '9' && *spec >= '0') /* opt:index */
return strtol(spec, NULL, 0) == st->index;
else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
- *spec == 't') { /* opt:[vasdt] */
+ *spec == 't' || *spec == 'V') { /* opt:[vasdtV] */
enum AVMediaType type;
+ int nopic = 0;
switch (*spec++) {
case 'v': type = AVMEDIA_TYPE_VIDEO; break;
@@ -4244,15 +4316,20 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
case 's': type = AVMEDIA_TYPE_SUBTITLE; break;
case 'd': type = AVMEDIA_TYPE_DATA; break;
case 't': type = AVMEDIA_TYPE_ATTACHMENT; break;
+ case 'V': type = AVMEDIA_TYPE_VIDEO; nopic = 1; break;
default: av_assert0(0);
}
if (type != st->codec->codec_type)
return 0;
+ if (nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC))
+ return 0;
if (*spec++ == ':') { /* possibly followed by :index */
int i, index = strtol(spec, NULL, 0);
for (i = 0; i < s->nb_streams; i++)
- if (s->streams[i]->codec->codec_type == type && index-- == 0)
- return i == st->index;
+ if (s->streams[i]->codec->codec_type == type &&
+ !(nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC)) &&
+ index-- == 0)
+ return i == st->index;
return 0;
}
return 1;
diff --git a/chromium/third_party/ffmpeg/libavformat/version.h b/chromium/third_party/ffmpeg/libavformat/version.h
index 99b71906ba7..18be8b26b61 100644
--- a/chromium/third_party/ffmpeg/libavformat/version.h
+++ b/chromium/third_party/ffmpeg/libavformat/version.h
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
-#define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR 37
+#define LIBAVFORMAT_VERSION_MAJOR 57
+#define LIBAVFORMAT_VERSION_MINOR 0
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@@ -47,18 +47,26 @@
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
+ *
+ * @note, when bumping the major version it is recommended to manually
+ * disable each FF_API_* in its own commit instead of disabling them all
+ * at once through the bump. This improves the git bisect-ability of the change.
+ *
*/
#ifndef FF_API_LAVF_BITEXACT
-#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 57)
+#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_LAVF_FRAC
-#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 57)
+#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_LAVF_CODEC_TB
-#define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 57)
+#define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_URL_FEOF
-#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 57)
+#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58)
+#endif
+#ifndef FF_API_PROBESIZE_32
+#define FF_API_PROBESIZE_32 (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_R_FRAME_RATE
diff --git a/chromium/third_party/ffmpeg/libavformat/vplayerdec.c b/chromium/third_party/ffmpeg/libavformat/vplayerdec.c
index 619ccfd4f06..860b7785c9c 100644
--- a/chromium/third_party/ffmpeg/libavformat/vplayerdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/vplayerdec.c
@@ -90,7 +90,7 @@ static int vplayer_read_header(AVFormatContext *s)
}
}
- ff_subtitles_queue_finalize(&vplayer->q);
+ ff_subtitles_queue_finalize(s, &vplayer->q);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/wavdec.c b/chromium/third_party/ffmpeg/libavformat/wavdec.c
index 864185f989b..ef24e1672c7 100644
--- a/chromium/third_party/ffmpeg/libavformat/wavdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wavdec.c
@@ -134,7 +134,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
if (!*st)
return AVERROR(ENOMEM);
- ret = ff_get_wav_header(pb, (*st)->codec, size, wav->rifx);
+ ret = ff_get_wav_header(s, pb, (*st)->codec, size, wav->rifx);
if (ret < 0)
return ret;
handle_stream_probing(*st);
@@ -429,8 +429,29 @@ break_loop:
avio_seek(pb, data_ofs, SEEK_SET);
+ if (data_size > (INT64_MAX>>3)) {
+ av_log(s, AV_LOG_WARNING, "Data size %"PRId64" is too large\n", data_size);
+ data_size = 0;
+ }
+
+ if ( st->codec->bit_rate > 0 && data_size > 0
+ && st->codec->sample_rate > 0
+ && sample_count > 0 && st->codec->channels > 1
+ && sample_count % st->codec->channels == 0) {
+ if (fabs(8.0 * data_size * st->codec->channels * st->codec->sample_rate /
+ sample_count /st->codec->bit_rate - 1.0) < 0.3)
+ sample_count /= st->codec->channels;
+ }
+
if ( data_size > 0 && sample_count && st->codec->channels
- && data_size / sample_count / st->codec->channels > 8) {
+ && (data_size << 3) / sample_count / st->codec->channels > st->codec->bits_per_coded_sample + 1) {
+ av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
+ sample_count = 0;
+ }
+
+ /* G.729 hack (for Ticket4577)
+ * FIXME: Come up with cleaner, more general solution */
+ if (st->codec->codec_id == AV_CODEC_ID_G729 && sample_count && (data_size << 3) > sample_count) {
av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
sample_count = 0;
}
@@ -615,7 +636,7 @@ static int wav_read_seek(AVFormatContext *s,
#define OFFSET(x) offsetof(WAVDemuxContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption demux_options[] = {
- { "ignore_length", "Ignore length", OFFSET(ignore_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, DEC },
+ { "ignore_length", "Ignore length", OFFSET(ignore_length), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC },
{ NULL },
};
@@ -689,7 +710,7 @@ static int w64_read_header(AVFormatContext *s)
if (!memcmp(guid, ff_w64_guid_fmt, 16)) {
/* subtract chunk header size - normal wav file doesn't count it */
- ret = ff_get_wav_header(pb, st->codec, size - 24, 0);
+ ret = ff_get_wav_header(s, pb, st->codec, size - 24, 0);
if (ret < 0)
return ret;
avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
diff --git a/chromium/third_party/ffmpeg/libavformat/wavenc.c b/chromium/third_party/ffmpeg/libavformat/wavenc.c
index f89c91e8c73..0156f6e8a3b 100644
--- a/chromium/third_party/ffmpeg/libavformat/wavenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/wavenc.c
@@ -502,7 +502,7 @@ static int wav_write_trailer(AVFormatContext *s)
#define OFFSET(x) offsetof(WAVMuxContext, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "write_bext", "Write BEXT chunk.", OFFSET(write_bext), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, ENC },
+ { "write_bext", "Write BEXT chunk.", OFFSET(write_bext), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC },
{ "write_peak", "Write Peak Envelope chunk.", OFFSET(write_peak), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, ENC, "peak" },
{ "off", "Do not write peak chunk.", 0, AV_OPT_TYPE_CONST, { .i64 = PEAK_OFF }, 0, 0, ENC, "peak" },
{ "on", "Append peak chunk after wav data.", 0, AV_OPT_TYPE_CONST, { .i64 = PEAK_ON }, 0, 0, ENC, "peak" },
diff --git a/chromium/third_party/ffmpeg/libavformat/webmdashenc.c b/chromium/third_party/ffmpeg/libavformat/webmdashenc.c
index 76ea4237e2b..898e4641d37 100644
--- a/chromium/third_party/ffmpeg/libavformat/webmdashenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/webmdashenc.c
@@ -392,10 +392,10 @@ static int write_adaptation_set(AVFormatContext *s, int as_index)
if (w->is_live) {
AVDictionaryEntry *filename =
av_dict_get(s->streams[as->streams[i]]->metadata, FILENAME, NULL, 0);
- if (!filename ||
- (ret = parse_filename(filename->value, &representation_id, NULL, NULL))) {
+ if (!filename)
+ return AVERROR(EINVAL);
+ if (ret = parse_filename(filename->value, &representation_id, NULL, NULL))
return ret;
- }
} else {
representation_id = av_asprintf("%d", w->representation_id++);
if (!representation_id) return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavformat/webvttdec.c b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
index e457e8f6d21..43c2a639ad3 100644
--- a/chromium/third_party/ffmpeg/libavformat/webvttdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
@@ -161,7 +161,7 @@ static int webvtt_read_header(AVFormatContext *s)
SET_SIDE_DATA(settings, AV_PKT_DATA_WEBVTT_SETTINGS);
}
- ff_subtitles_queue_finalize(&webvtt->q);
+ ff_subtitles_queue_finalize(s, &webvtt->q);
end:
av_bprint_finalize(&cue, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/webvttenc.c b/chromium/third_party/ffmpeg/libavformat/webvttenc.c
index b93993d55ce..c3865387186 100644
--- a/chromium/third_party/ffmpeg/libavformat/webvttenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/webvttenc.c
@@ -46,8 +46,14 @@ static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
static int webvtt_write_header(AVFormatContext *ctx)
{
AVStream *s = ctx->streams[0];
+ AVCodecContext *avctx = ctx->streams[0]->codec;
AVIOContext *pb = ctx->pb;
+ if (ctx->nb_streams != 1 || avctx->codec_id != AV_CODEC_ID_WEBVTT) {
+ av_log(ctx, AV_LOG_ERROR, "Exactly one WebVTT stream is needed.\n");
+ return AVERROR(EINVAL);
+ }
+
avpriv_set_pts_info(s, 64, 1, 1000);
avio_printf(pb, "WEBVTT\n");
diff --git a/chromium/third_party/ffmpeg/libavformat/wtvdec.c b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
index e226690283c..e8f6196a5ed 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
@@ -670,7 +670,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
if (!st)
return NULL;
if (!ff_guidcmp(formattype, ff_format_waveformatex)) {
- int ret = ff_get_wav_header(pb, st->codec, size, 0);
+ int ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0)
return NULL;
} else {
diff --git a/chromium/third_party/ffmpeg/libavformat/xwma.c b/chromium/third_party/ffmpeg/libavformat/xwma.c
index 683d3d0d4d2..9edad7d75ac 100644
--- a/chromium/third_party/ffmpeg/libavformat/xwma.c
+++ b/chromium/third_party/ffmpeg/libavformat/xwma.c
@@ -75,7 +75,7 @@ static int xwma_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
- ret = ff_get_wav_header(pb, st->codec, size, 0);
+ ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0)
return ret;
st->need_parsing = AVSTREAM_PARSE_NONE;
diff --git a/chromium/third_party/ffmpeg/libavformat/yop.c b/chromium/third_party/ffmpeg/libavformat/yop.c
index 81b3cc2b32b..64779d4fb75 100644
--- a/chromium/third_party/ffmpeg/libavformat/yop.c
+++ b/chromium/third_party/ffmpeg/libavformat/yop.c
@@ -132,11 +132,6 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
*pkt = yop->video_packet;
yop->video_packet.data = NULL;
yop->video_packet.buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- yop->video_packet.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
yop->video_packet.size = 0;
pkt->data[0] = yop->odd_frame;
pkt->flags |= AV_PKT_FLAG_KEY;
diff --git a/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.h b/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.h
index 750f4984076..eba7337fe6c 100644
--- a/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.h
+++ b/chromium/third_party/ffmpeg/libavformat/yuv4mpeg.h
@@ -23,5 +23,6 @@
#define Y4M_MAGIC "YUV4MPEG2"
#define Y4M_FRAME_MAGIC "FRAME"
+#define Y4M_FRAME_MAGIC_LEN 6
#endif /* AVFORMAT_YUV4MPEG_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/yuv4mpegdec.c b/chromium/third_party/ffmpeg/libavformat/yuv4mpegdec.c
index 7613c3cdc36..0db42f5933b 100644
--- a/chromium/third_party/ffmpeg/libavformat/yuv4mpegdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/yuv4mpegdec.c
@@ -256,6 +256,12 @@ static int yuv4_read_header(AVFormatContext *s)
st->sample_aspect_ratio = (AVRational){ aspectn, aspectd };
st->codec->chroma_sample_location = chroma_sample_location;
st->codec->field_order = field_order;
+ s->packet_size = avpicture_get_size(st->codec->pix_fmt, width, height) + Y4M_FRAME_MAGIC_LEN;
+ if ((int) s->packet_size < 0)
+ return s->packet_size;
+ s->internal->data_offset = avio_tell(pb);
+
+ st->duration = (avio_size(pb) - avio_tell(pb)) / s->packet_size;
return 0;
}
@@ -264,8 +270,8 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int i;
char header[MAX_FRAME_HEADER+1];
- int packet_size, width, height, ret;
- AVStream *st = s->streams[0];
+ int ret;
+ int64_t off = avio_tell(s->pb);
for (i = 0; i < MAX_FRAME_HEADER; i++) {
header[i] = avio_r8(s->pb);
@@ -284,20 +290,22 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC)))
return AVERROR_INVALIDDATA;
- width = st->codec->width;
- height = st->codec->height;
-
- packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
- if (packet_size < 0)
- return packet_size;
-
- ret = av_get_packet(s->pb, pkt, packet_size);
+ ret = av_get_packet(s->pb, pkt, s->packet_size - Y4M_FRAME_MAGIC_LEN);
if (ret < 0)
return ret;
- else if (ret != packet_size)
+ else if (ret != s->packet_size - Y4M_FRAME_MAGIC_LEN)
return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);
pkt->stream_index = 0;
+ pkt->pts = (off - s->internal->data_offset) / s->packet_size;
+ pkt->duration = 1;
+ return 0;
+}
+
+static int yuv4_read_seek(AVFormatContext *s, int stream_index,
+ int64_t pts, int flags)
+{
+ avio_seek(s->pb, pts * s->packet_size + s->internal->data_offset, SEEK_SET);
return 0;
}
@@ -316,5 +324,6 @@ AVInputFormat ff_yuv4mpegpipe_demuxer = {
.read_probe = yuv4_probe,
.read_header = yuv4_read_header,
.read_packet = yuv4_read_packet,
+ .read_seek = yuv4_read_seek,
.extensions = "y4m",
};
diff --git a/chromium/third_party/ffmpeg/libavformat/yuv4mpegenc.c b/chromium/third_party/ffmpeg/libavformat/yuv4mpegenc.c
index cc954fcc630..c15ea1de0cb 100644
--- a/chromium/third_party/ffmpeg/libavformat/yuv4mpegenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/yuv4mpegenc.c
@@ -143,7 +143,6 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
int width, height, h_chroma_shift, v_chroma_shift;
int i;
char buf2[Y4M_LINE_MAX + 1];
- char buf1[20];
uint8_t *ptr, *ptr1, *ptr2;
memcpy(&picture_tmp, pkt->data, sizeof(AVPicture));
@@ -163,8 +162,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
/* construct frame header */
- snprintf(buf1, sizeof(buf1), "%s\n", Y4M_FRAME_MAGIC);
- avio_write(pb, buf1, strlen(buf1));
+ avio_printf(s->pb, "%s\n", Y4M_FRAME_MAGIC);
width = st->codec->width;
height = st->codec->height;
diff --git a/chromium/third_party/ffmpeg/libavresample/resample.c b/chromium/third_party/ffmpeg/libavresample/resample.c
index 01fc50014db..3e9b0db5623 100644
--- a/chromium/third_party/ffmpeg/libavresample/resample.c
+++ b/chromium/third_party/ffmpeg/libavresample/resample.c
@@ -243,62 +243,8 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
return AVERROR(EINVAL);
if (!avr->resample_needed) {
-#if FF_API_RESAMPLE_CLOSE_OPEN
- /* if resampling was not enabled previously, re-initialize the
- AVAudioResampleContext and force resampling */
- int fifo_samples;
- int restore_matrix = 0;
- double matrix[AVRESAMPLE_MAX_CHANNELS * AVRESAMPLE_MAX_CHANNELS] = { 0 };
-
- /* buffer any remaining samples in the output FIFO before closing */
- fifo_samples = av_audio_fifo_size(avr->out_fifo);
- if (fifo_samples > 0) {
- fifo_buf = ff_audio_data_alloc(avr->out_channels, fifo_samples,
- avr->out_sample_fmt, NULL);
- if (!fifo_buf)
- return AVERROR(EINVAL);
- ret = ff_audio_data_read_from_fifo(avr->out_fifo, fifo_buf,
- fifo_samples);
- if (ret < 0)
- goto reinit_fail;
- }
- /* save the channel mixing matrix */
- if (avr->am) {
- ret = avresample_get_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
- if (ret < 0)
- goto reinit_fail;
- restore_matrix = 1;
- }
-
- /* close the AVAudioResampleContext */
- avresample_close(avr);
-
- avr->force_resampling = 1;
-
- /* restore the channel mixing matrix */
- if (restore_matrix) {
- ret = avresample_set_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
- if (ret < 0)
- goto reinit_fail;
- }
-
- /* re-open the AVAudioResampleContext */
- ret = avresample_open(avr);
- if (ret < 0)
- goto reinit_fail;
-
- /* restore buffered samples to the output FIFO */
- if (fifo_samples > 0) {
- ret = ff_audio_data_add_to_fifo(avr->out_fifo, fifo_buf, 0,
- fifo_samples);
- if (ret < 0)
- goto reinit_fail;
- ff_audio_data_free(&fifo_buf);
- }
-#else
av_log(avr, AV_LOG_ERROR, "Unable to set resampling compensation\n");
return AVERROR(EINVAL);
-#endif
}
c = avr->resample;
c->compensation_distance = compensation_distance;
@@ -310,7 +256,6 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
}
return 0;
-reinit_fail:
ff_audio_data_free(&fifo_buf);
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavresample/version.h b/chromium/third_party/ffmpeg/libavresample/version.h
index 33ff2a2afa5..b5b0e2d7aa4 100644
--- a/chromium/third_party/ffmpeg/libavresample/version.h
+++ b/chromium/third_party/ffmpeg/libavresample/version.h
@@ -27,8 +27,8 @@
#include "libavutil/version.h"
-#define LIBAVRESAMPLE_VERSION_MAJOR 2
-#define LIBAVRESAMPLE_VERSION_MINOR 1
+#define LIBAVRESAMPLE_VERSION_MAJOR 3
+#define LIBAVRESAMPLE_VERSION_MINOR 0
#define LIBAVRESAMPLE_VERSION_MICRO 0
#define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
@@ -47,8 +47,4 @@
* the public API and may change, break or disappear at any time.
*/
-#ifndef FF_API_RESAMPLE_CLOSE_OPEN
-#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 3)
-#endif
-
#endif /* AVRESAMPLE_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/audio_convert.asm b/chromium/third_party/ffmpeg/libavresample/x86/audio_convert.asm
index 3e21f268a71..c6a50152829 100644
--- a/chromium/third_party/ffmpeg/libavresample/x86/audio_convert.asm
+++ b/chromium/third_party/ffmpeg/libavresample/x86/audio_convert.asm
@@ -36,7 +36,7 @@ pb_interleave_words: SHUFFLE_MASK_W 0, 4, 1, 5, 2, 6, 3, 7
pb_deinterleave_words: SHUFFLE_MASK_W 0, 2, 4, 6, 1, 3, 5, 7
pw_zero_even: times 4 dw 0x0000, 0xffff
-SECTION_TEXT
+SECTION .text
;------------------------------------------------------------------------------
; void ff_conv_s16_to_s32(int32_t *dst, const int16_t *src, int len);
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/audio_mix.asm b/chromium/third_party/ffmpeg/libavresample/x86/audio_mix.asm
index 64ab0399f86..fe27d6a6c9a 100644
--- a/chromium/third_party/ffmpeg/libavresample/x86/audio_mix.asm
+++ b/chromium/third_party/ffmpeg/libavresample/x86/audio_mix.asm
@@ -22,7 +22,7 @@
%include "libavutil/x86/x86util.asm"
%include "util.asm"
-SECTION_TEXT
+SECTION .text
;-----------------------------------------------------------------------------
; void ff_mix_2_to_1_fltp_flt(float **src, float **matrix, int len,
diff --git a/chromium/third_party/ffmpeg/libavresample/x86/dither.asm b/chromium/third_party/ffmpeg/libavresample/x86/dither.asm
index 757f2800bce..d677c7179a4 100644
--- a/chromium/third_party/ffmpeg/libavresample/x86/dither.asm
+++ b/chromium/third_party/ffmpeg/libavresample/x86/dither.asm
@@ -28,7 +28,7 @@ pf_dither_scale: times 8 dd 2.32830643762e-10
pf_s16_scale: times 4 dd 32753.0
-SECTION_TEXT
+SECTION .text
;------------------------------------------------------------------------------
; void ff_quantize(int16_t *dst, float *src, float *dither, int len);
diff --git a/chromium/third_party/ffmpeg/libavutil/Makefile b/chromium/third_party/ffmpeg/libavutil/Makefile
index abfd10f8bd4..74397501a28 100644
--- a/chromium/third_party/ffmpeg/libavutil/Makefile
+++ b/chromium/third_party/ffmpeg/libavutil/Makefile
@@ -6,7 +6,6 @@ HEADERS = adler32.h \
aes.h \
attributes.h \
audio_fifo.h \
- audioconvert.h \
avassert.h \
avstring.h \
avutil.h \
@@ -42,7 +41,6 @@ HEADERS = adler32.h \
motion_vector.h \
murmur3.h \
dict.h \
- old_pix_fmts.h \
opt.h \
parseutils.h \
pixdesc.h \
@@ -63,6 +61,7 @@ HEADERS = adler32.h \
twofish.h \
version.h \
xtea.h \
+ tea.h \
HEADERS-$(CONFIG_LZO) += lzo.h
@@ -78,7 +77,6 @@ BUILT_HEADERS = avconfig.h \
OBJS = adler32.o \
aes.o \
- atomic.o \
audio_fifo.o \
avstring.o \
base64.o \
@@ -121,12 +119,12 @@ OBJS = adler32.o \
pixelutils.o \
random_seed.o \
rational.o \
+ reverse.o \
rc4.o \
ripemd.o \
samplefmt.o \
sha.o \
sha512.o \
- softfloat.o \
stereo3d.o \
threadmessage.o \
time.o \
@@ -136,6 +134,9 @@ OBJS = adler32.o \
utils.o \
xga_font_data.o \
xtea.o \
+ tea.o \
+
+OBJS-$(!HAVE_ATOMICS_NATIVE) += atomic.o \
OBJS-$(CONFIG_LZO) += lzo.o
OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o
@@ -145,8 +146,6 @@ OBJS += $(COMPAT_OBJS:%=../compat/%)
# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o
-SKIPHEADERS = old_pix_fmts.h
-
SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h
SKIPHEADERS-$(HAVE_ATOMICS_SUNCC) += atomic_suncc.h
SKIPHEADERS-$(HAVE_ATOMICS_WIN32) += atomic_win32.h
@@ -191,6 +190,7 @@ TESTPROGS = adler32 \
twofish \
utf8 \
xtea \
+ tea \
TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
diff --git a/chromium/third_party/ffmpeg/libavutil/adler32.c b/chromium/third_party/ffmpeg/libavutil/adler32.c
index 579d0229787..64c8767ca09 100644
--- a/chromium/third_party/ffmpeg/libavutil/adler32.c
+++ b/chromium/third_party/ffmpeg/libavutil/adler32.c
@@ -108,7 +108,7 @@ static volatile int checksum;
int main(int argc, char **argv)
{
int i;
- char data[LEN];
+ uint8_t data[LEN];
av_log_set_level(AV_LOG_DEBUG);
diff --git a/chromium/third_party/ffmpeg/libavutil/aes.c b/chromium/third_party/ffmpeg/libavutil/aes.c
index fd8706089cf..8d4bbbb7fa8 100644
--- a/chromium/third_party/ffmpeg/libavutil/aes.c
+++ b/chromium/third_party/ffmpeg/libavutil/aes.c
@@ -311,8 +311,8 @@ int main(int argc, char **argv)
AVAES ae, ad;
AVLFG prng;
- av_aes_init(&ae, "PI=3.141592654..", 128, 0);
- av_aes_init(&ad, "PI=3.141592654..", 128, 1);
+ av_aes_init(&ae, (const uint8_t*)"PI=3.141592654..", 128, 0);
+ av_aes_init(&ad, (const uint8_t*)"PI=3.141592654..", 128, 1);
av_lfg_init(&prng, 1);
for (i = 0; i < 10000; i++) {
diff --git a/chromium/third_party/ffmpeg/libavutil/arm/intmath.h b/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
index 77bcfd101e1..07e3901df57 100644
--- a/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
+++ b/chromium/third_party/ffmpeg/libavutil/arm/intmath.h
@@ -31,9 +31,9 @@
#if HAVE_ARMV6_INLINE
#define av_clip_uint8 av_clip_uint8_arm
-static av_always_inline av_const unsigned av_clip_uint8_arm(int a)
+static av_always_inline av_const int av_clip_uint8_arm(int a)
{
- unsigned x;
+ int x;
__asm__ ("usat %0, #8, %1" : "=r"(x) : "r"(a));
return x;
}
@@ -47,9 +47,9 @@ static av_always_inline av_const int av_clip_int8_arm(int a)
}
#define av_clip_uint16 av_clip_uint16_arm
-static av_always_inline av_const unsigned av_clip_uint16_arm(int a)
+static av_always_inline av_const int av_clip_uint16_arm(int a)
{
- unsigned x;
+ int x;
__asm__ ("usat %0, #16, %1" : "=r"(x) : "r"(a));
return x;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/audio_fifo.c b/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
index 574907aa32c..d5298cce4d0 100644
--- a/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
+++ b/chromium/third_party/ffmpeg/libavutil/audio_fifo.c
@@ -136,6 +136,25 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
return nb_samples;
}
+int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
+{
+ int i, ret, size;
+
+ if (nb_samples < 0)
+ return AVERROR(EINVAL);
+ nb_samples = FFMIN(nb_samples, af->nb_samples);
+ if (!nb_samples)
+ return 0;
+
+ size = nb_samples * af->sample_size;
+ for (i = 0; i < af->nb_buffers; i++) {
+ if ((ret = av_fifo_generic_peek(af->buf[i], data[i], size, NULL)) < 0)
+ return AVERROR_BUG;
+ }
+
+ return nb_samples;
+}
+
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
{
int i, ret, size;
diff --git a/chromium/third_party/ffmpeg/libavutil/audio_fifo.h b/chromium/third_party/ffmpeg/libavutil/audio_fifo.h
index d21e6a1318d..d93be2aeb08 100644
--- a/chromium/third_party/ffmpeg/libavutil/audio_fifo.h
+++ b/chromium/third_party/ffmpeg/libavutil/audio_fifo.h
@@ -94,6 +94,22 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
/**
+ * Peek data from an AVAudioFifo.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param af AVAudioFifo to read from
+ * @param data audio data plane pointers
+ * @param nb_samples number of samples to peek
+ * @return number of samples actually peek, or negative AVERROR code
+ * on failure. The number of samples actually peek will not
+ * be greater than nb_samples, and will only be less than
+ * nb_samples if av_audio_fifo_size is less than nb_samples.
+ */
+int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
+
+/**
* Read data from an AVAudioFifo.
*
* @see enum AVSampleFormat
diff --git a/chromium/third_party/ffmpeg/libavutil/audioconvert.h b/chromium/third_party/ffmpeg/libavutil/audioconvert.h
deleted file mode 100644
index 300a67cd3d5..00000000000
--- a/chromium/third_party/ffmpeg/libavutil/audioconvert.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#include "version.h"
-
-#if FF_API_AUDIOCONVERT
-#include "channel_layout.h"
-#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/avstring.c b/chromium/third_party/ffmpeg/libavutil/avstring.c
index f7858160631..24d1bb98e96 100644
--- a/chromium/third_party/ffmpeg/libavutil/avstring.c
+++ b/chromium/third_party/ffmpeg/libavutil/avstring.c
@@ -408,7 +408,7 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
goto end;
}
- if (code >= 1<<31) {
+ if (code >= 1U<<31) {
ret = AVERROR(EILSEQ); /* out-of-range value */
goto end;
}
@@ -502,7 +502,7 @@ int main(void)
printf("Testing av_append_path_component()\n");
#define TEST_APPEND_PATH_COMPONENT(path, component, expected) \
fullpath = av_append_path_component((path), (component)); \
- printf("%s = %s\n", fullpath, expected); \
+ printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
av_free(fullpath);
TEST_APPEND_PATH_COMPONENT(NULL, NULL, "(null)")
TEST_APPEND_PATH_COMPONENT("path", NULL, "path");
diff --git a/chromium/third_party/ffmpeg/libavutil/avutil.h b/chromium/third_party/ffmpeg/libavutil/avutil.h
index e6ebb6c43c2..9bcf6741263 100644
--- a/chromium/third_party/ffmpeg/libavutil/avutil.h
+++ b/chromium/third_party/ffmpeg/libavutil/avutil.h
@@ -138,14 +138,6 @@
*
* @{
*
- * @defgroup lavu_internal Internal
- *
- * Not exported functions, for internal usage only
- *
- * @{
- *
- * @}
- *
* @defgroup preproc_misc Preprocessor String Macros
*
* @{
@@ -171,6 +163,13 @@
unsigned avutil_version(void);
/**
+ * Return an informative version string. This usually is the actual release
+ * version number or a git commit description. This string has no fixed format
+ * and can change any time. It should never be parsed by code.
+ */
+const char *av_version_info(void);
+
+/**
* Return the libavutil build-time configuration.
*/
const char *avutil_configuration(void);
diff --git a/chromium/third_party/ffmpeg/libavutil/blowfish.c b/chromium/third_party/ffmpeg/libavutil/blowfish.c
index 38214275706..4f7e4dfd6cb 100644
--- a/chromium/third_party/ffmpeg/libavutil/blowfish.c
+++ b/chromium/third_party/ffmpeg/libavutil/blowfish.c
@@ -24,8 +24,18 @@
#include "avutil.h"
#include "common.h"
#include "intreadwrite.h"
+#include "mem.h"
#include "blowfish.h"
+#if !FF_API_CRYPTO_CONTEXT
+#define AV_BF_ROUNDS 16
+
+struct AVBlowfish {
+ uint32_t p[AV_BF_ROUNDS + 2];
+ uint32_t s[4][256];
+};
+#endif
+
static const uint32_t orig_p[AV_BF_ROUNDS + 2] = {
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
@@ -300,6 +310,11 @@ static const uint32_t orig_s[4][256] = {
+ ctx->s[3][ Xl & 0xFF])\
^ P;
+AVBlowfish *av_blowfish_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVBlowfish));
+}
+
av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len)
{
uint32_t data, data_l, data_r;
diff --git a/chromium/third_party/ffmpeg/libavutil/blowfish.h b/chromium/third_party/ffmpeg/libavutil/blowfish.h
index 0b004532dee..d163fd3578b 100644
--- a/chromium/third_party/ffmpeg/libavutil/blowfish.h
+++ b/chromium/third_party/ffmpeg/libavutil/blowfish.h
@@ -23,6 +23,7 @@
#define AVUTIL_BLOWFISH_H
#include <stdint.h>
+#include "version.h"
/**
* @defgroup lavu_blowfish Blowfish
@@ -30,12 +31,21 @@
* @{
*/
+#if FF_API_CRYPTO_CONTEXT
#define AV_BF_ROUNDS 16
typedef struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256];
} AVBlowfish;
+#else
+typedef struct AVBlowfish AVBlowfish;
+#endif
+
+/**
+ * Allocate an AVBlowfish context.
+ */
+AVBlowfish *av_blowfish_alloc(void);
/**
* Initialize an AVBlowfish context.
diff --git a/chromium/third_party/ffmpeg/libavutil/channel_layout.c b/chromium/third_party/ffmpeg/libavutil/channel_layout.c
index cd5cf426d4f..a59ba4610f2 100644
--- a/chromium/third_party/ffmpeg/libavutil/channel_layout.c
+++ b/chromium/third_party/ffmpeg/libavutil/channel_layout.c
@@ -102,14 +102,11 @@ static const struct {
{ "7.1(wide)", 8, AV_CH_LAYOUT_7POINT1_WIDE_BACK },
{ "7.1(wide-side)", 8, AV_CH_LAYOUT_7POINT1_WIDE },
{ "octagonal", 8, AV_CH_LAYOUT_OCTAGONAL },
+ { "hexadecagonal", 16, AV_CH_LAYOUT_HEXADECAGONAL },
{ "downmix", 2, AV_CH_LAYOUT_STEREO_DOWNMIX, },
};
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
-static uint64_t get_channel_layout_single(const char *name, int name_len, int compat)
-#else
static uint64_t get_channel_layout_single(const char *name, int name_len)
-#endif
{
int i;
char *end;
@@ -127,27 +124,8 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
return (int64_t)1 << i;
i = strtol(name, &end, 10);
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
- if (compat) {
- if (end - name == name_len ||
- (end + 1 - name == name_len && *end == 'c')) {
- layout = av_get_default_channel_layout(i);
- if (end - name == name_len) {
- av_log(NULL, AV_LOG_WARNING,
- "Single channel layout '%.*s' is interpreted as a number of channels, "
- "switch to the syntax '%.*sc' otherwise it will be interpreted as a "
- "channel layout number in a later version\n",
- name_len, name, name_len, name);
- }
- return layout;
- }
- } else {
-#endif
if ((end + 1 - name == name_len && *end == 'c'))
return av_get_default_channel_layout(i);
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
- }
-#endif
layout = strtoll(name, &end, 0);
if (end - name == name_len)
@@ -155,11 +133,7 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
return 0;
}
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
-uint64_t ff_get_channel_layout(const char *name, int compat)
-#else
uint64_t av_get_channel_layout(const char *name)
-#endif
{
const char *n, *e;
const char *name_end = name + strlen(name);
@@ -167,11 +141,7 @@ uint64_t av_get_channel_layout(const char *name)
for (n = name; n < name_end; n = e + 1) {
for (e = n; e < name_end && *e != '+' && *e != '|'; e++);
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
- layout_single = get_channel_layout_single(n, e - n, compat);
-#else
layout_single = get_channel_layout_single(n, e - n);
-#endif
if (!layout_single)
return 0;
layout |= layout_single;
@@ -179,13 +149,6 @@ uint64_t av_get_channel_layout(const char *name)
return layout;
}
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
-uint64_t av_get_channel_layout(const char *name)
-{
- return ff_get_channel_layout(name, 1);
-}
-#endif
-
void av_bprint_channel_layout(struct AVBPrint *bp,
int nb_channels, uint64_t channel_layout)
{
diff --git a/chromium/third_party/ffmpeg/libavutil/channel_layout.h b/chromium/third_party/ffmpeg/libavutil/channel_layout.h
index dea4d6093d9..ec7effead1d 100644
--- a/chromium/third_party/ffmpeg/libavutil/channel_layout.h
+++ b/chromium/third_party/ffmpeg/libavutil/channel_layout.h
@@ -108,6 +108,7 @@
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
enum AVMatrixEncoding {
diff --git a/chromium/third_party/ffmpeg/libavutil/color_utils.c b/chromium/third_party/ffmpeg/libavutil/color_utils.c
index 59146be8c25..b68b4026ebc 100644
--- a/chromium/third_party/ffmpeg/libavutil/color_utils.c
+++ b/chromium/third_party/ffmpeg/libavutil/color_utils.c
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <stddef.h>
+#include <math.h>
+
#include "libavutil/color_utils.h"
#include "libavutil/pixfmt.h"
@@ -50,3 +53,166 @@ double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
}
return gamma;
}
+
+#define BT709_alpha 1.099296826809442
+#define BT709_beta 0.018053968510807
+
+static double avpriv_trc_bt709(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow(Lc, 0.45) - (a - 1.0);
+}
+
+static double avpriv_trc_gamma22(double Lc)
+{
+ return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2);
+}
+
+static double avpriv_trc_gamma28(double Lc)
+{
+ return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8);
+}
+
+static double avpriv_trc_smpte240M(double Lc)
+{
+ const double a = 1.1115;
+ const double b = 0.0228;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 4.000 * Lc
+ : a * pow(Lc, 0.45) - (a - 1.0);
+}
+
+static double avpriv_trc_linear(double Lc)
+{
+ return Lc;
+}
+
+static double avpriv_trc_log(double Lc)
+{
+ return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0;
+}
+
+static double avpriv_trc_log_sqrt(double Lc)
+{
+ // sqrt(10) / 1000
+ return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5;
+}
+
+static double avpriv_trc_iec61966_2_4(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (-b >= Lc) ? -a * pow(-Lc, 0.45) + (a - 1.0)
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow( Lc, 0.45) - (a - 1.0);
+}
+
+static double avpriv_trc_bt1361(double Lc)
+{
+ const double a = BT709_alpha;
+ const double b = BT709_beta;
+
+ return (-0.0045 >= Lc) ? -(a * pow(-4.0 * Lc, 0.45) + (a - 1.0)) / 4.0
+ : ( b > Lc) ? 4.500 * Lc
+ : a * pow( Lc, 0.45) - (a - 1.0);
+}
+
+static double avpriv_trc_iec61966_2_1(double Lc)
+{
+ const double a = 1.055;
+ const double b = 0.0031308;
+
+ return (0.0 > Lc) ? 0.0
+ : ( b > Lc) ? 12.92 * Lc
+ : a * pow(Lc, 1.0 / 2.4) - (a - 1.0);
+}
+
+static double avpriv_trc_smpte_st2084(double Lc)
+{
+ const double c1 = 3424.0 / 4096.0; // c3-c2 + 1
+ const double c2 = 32.0 * 2413.0 / 4096.0;
+ const double c3 = 32.0 * 2392.0 / 4096.0;
+ const double m = 128.0 * 2523.0 / 4096.0;
+ const double n = 0.25 * 2610.0 / 4096.0;
+ const double L = Lc / 10000.0;
+ const double Ln = pow(L, n);
+
+ return (0.0 > Lc) ? 0.0
+ : pow((c1 + c2 * Ln) / (1.0 + c3 * Ln), m);
+
+}
+
+static double avpriv_trc_smpte_st428_1(double Lc)
+{
+ return (0.0 > Lc) ? 0.0
+ : pow(48.0 * Lc / 52.37, 1.0 / 2.6);
+}
+
+avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc)
+{
+ avpriv_trc_function func = NULL;
+ switch (trc) {
+ case AVCOL_TRC_BT709:
+ case AVCOL_TRC_SMPTE170M:
+ case AVCOL_TRC_BT2020_10:
+ case AVCOL_TRC_BT2020_12:
+ func = avpriv_trc_bt709;
+ break;
+
+ case AVCOL_TRC_GAMMA22:
+ func = avpriv_trc_gamma22;
+ break;
+ case AVCOL_TRC_GAMMA28:
+ func = avpriv_trc_gamma28;
+ break;
+
+ case AVCOL_TRC_SMPTE240M:
+ func = avpriv_trc_smpte240M;
+ break;
+
+ case AVCOL_TRC_LINEAR:
+ func = avpriv_trc_linear;
+ break;
+
+ case AVCOL_TRC_LOG:
+ func = avpriv_trc_log;
+ break;
+
+ case AVCOL_TRC_LOG_SQRT:
+ func = avpriv_trc_log_sqrt;
+ break;
+
+ case AVCOL_TRC_IEC61966_2_4:
+ func = avpriv_trc_iec61966_2_4;
+ break;
+
+ case AVCOL_TRC_BT1361_ECG:
+ func = avpriv_trc_bt1361;
+ break;
+
+ case AVCOL_TRC_IEC61966_2_1:
+ func = avpriv_trc_iec61966_2_1;
+ break;
+
+ case AVCOL_TRC_SMPTEST2084:
+ func = avpriv_trc_smpte_st2084;
+ break;
+
+ case AVCOL_TRC_SMPTEST428_1:
+ func = avpriv_trc_smpte_st428_1;
+ break;
+
+ case AVCOL_TRC_RESERVED0:
+ case AVCOL_TRC_UNSPECIFIED:
+ case AVCOL_TRC_RESERVED:
+ default:
+ break;
+ }
+ return func;
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/color_utils.h b/chromium/third_party/ffmpeg/libavutil/color_utils.h
index 3600a72d10a..9529006452c 100644
--- a/chromium/third_party/ffmpeg/libavutil/color_utils.h
+++ b/chromium/third_party/ffmpeg/libavutil/color_utils.h
@@ -36,4 +36,21 @@
*/
double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc);
+
+typedef double (*avpriv_trc_function)(double);
+
+/**
+ * Determine the function needed to apply the given
+ * AVColorTransferCharacteristic to linear input.
+ *
+ * The function returned should expect a nominal domain and range of [0.0-1.0]
+ * values outside of this range maybe valid depending on the chosen
+ * characteristic function.
+ *
+ * @return Will return pointer to the function matching the
+ * supplied Transfer Characteristic. If unspecified will
+ * return NULL:
+ */
+avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc);
+
#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/common.h b/chromium/third_party/ffmpeg/libavutil/common.h
index 3e62b6d5b7d..6594f7dcbf2 100644
--- a/chromium/third_party/ffmpeg/libavutil/common.h
+++ b/chromium/third_party/ffmpeg/libavutil/common.h
@@ -58,9 +58,24 @@
: ((a) + (1<<(b)) - 1) >> (b))
#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
+
+/**
+ * Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they
+ * are not representable as absolute values of their type. This is the same
+ * as with *abs()
+ * @see FFNABS()
+ */
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+/**
+ * Negative Absolute value.
+ * this works for all integers of all types.
+ * As with many macros, this evaluates its argument twice, it thus must not have
+ * a sideeffect, that is FFNABS(x++) has undefined behavior.
+ */
+#define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
+
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
@@ -72,13 +87,6 @@
/* misc math functions */
-/**
- * Reverse the order of the bits of an 8-bits unsigned integer.
- */
-#if FF_API_AV_REVERSE
-extern attribute_deprecated const uint8_t av_reverse[256];
-#endif
-
#ifdef HAVE_AV_CONFIG_H
# include "config.h"
# include "intmath.h"
diff --git a/chromium/third_party/ffmpeg/libavutil/cpu.h b/chromium/third_party/ffmpeg/libavutil/cpu.h
index 471f7866f3e..9403eca8d7e 100644
--- a/chromium/third_party/ffmpeg/libavutil/cpu.h
+++ b/chromium/third_party/ffmpeg/libavutil/cpu.h
@@ -46,11 +46,7 @@
#define AV_CPU_FLAG_AVXSLOW 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer)
#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions
#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions
-// #if LIBAVUTIL_VERSION_MAJOR <52
-#define AV_CPU_FLAG_CMOV 0x1001000 ///< supports cmov instruction
-// #else
-// #define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction
-// #endif
+#define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction
#define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions
#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
diff --git a/chromium/third_party/ffmpeg/libavutil/crc.c b/chromium/third_party/ffmpeg/libavutil/crc.c
index d8b1c99d1cb..e432843dfd7 100644
--- a/chromium/third_party/ffmpeg/libavutil/crc.c
+++ b/chromium/third_party/ffmpeg/libavutil/crc.c
@@ -383,7 +383,8 @@ int main(void)
{
uint8_t buf[1999];
int i;
- int p[6][3] = { { AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
+ unsigned
+ p[6][3] = { { AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
{ AV_CRC_32_IEEE , 0x04C11DB7, 0xC0F5BAE0 },
{ AV_CRC_24_IEEE , 0x864CFB , 0xB704CE },
{ AV_CRC_16_ANSI_LE, 0xA001 , 0xBFD8 },
diff --git a/chromium/third_party/ffmpeg/libavutil/des.c b/chromium/third_party/ffmpeg/libavutil/des.c
index 57ad0a4fffc..e7e91780784 100644
--- a/chromium/third_party/ffmpeg/libavutil/des.c
+++ b/chromium/third_party/ffmpeg/libavutil/des.c
@@ -22,9 +22,15 @@
#include "avutil.h"
#include "common.h"
#include "intreadwrite.h"
+#include "mem.h"
#include "des.h"
-typedef struct AVDES AVDES;
+#if !FF_API_CRYPTO_CONTEXT
+struct AVDES {
+ uint64_t round_keys[3][16];
+ int triple_des;
+};
+#endif
#define T(a, b, c, d, e, f, g, h) 64-a,64-b,64-c,64-d,64-e,64-f,64-g,64-h
static const uint8_t IP_shuffle[] = {
@@ -286,6 +292,11 @@ static uint64_t des_encdec(uint64_t in, uint64_t K[16], int decrypt) {
return in;
}
+AVDES *av_des_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVDES));
+}
+
int av_des_init(AVDES *d, const uint8_t *key, int key_bits, av_unused int decrypt) {
if (key_bits != 64 && key_bits != 192)
return -1;
diff --git a/chromium/third_party/ffmpeg/libavutil/des.h b/chromium/third_party/ffmpeg/libavutil/des.h
index 2feb0468db7..32f3a80fabd 100644
--- a/chromium/third_party/ffmpeg/libavutil/des.h
+++ b/chromium/third_party/ffmpeg/libavutil/des.h
@@ -23,17 +23,34 @@
#define AVUTIL_DES_H
#include <stdint.h>
+#include "version.h"
-struct AVDES {
+/**
+ * @defgroup lavu_des DES
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CRYPTO_CONTEXT
+typedef struct AVDES {
uint64_t round_keys[3][16];
int triple_des;
-};
+} AVDES;
+#else
+typedef struct AVDES AVDES;
+#endif
+
+/**
+ * Allocate an AVDES context.
+ */
+AVDES *av_des_alloc(void);
/**
* @brief Initializes an AVDES context.
*
* @param key_bits must be 64 or 192
* @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
+ * @return zero on success, negative value otherwise
*/
int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
@@ -58,4 +75,8 @@ void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count,
*/
void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
+/**
+ * @}
+ */
+
#endif /* AVUTIL_DES_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/eval.c b/chromium/third_party/ffmpeg/libavutil/eval.c
index 1dfcbef7bb3..7642b919cb1 100644
--- a/chromium/third_party/ffmpeg/libavutil/eval.c
+++ b/chromium/third_party/ffmpeg/libavutil/eval.c
@@ -31,6 +31,7 @@
#include "avutil.h"
#include "common.h"
#include "eval.h"
+#include "internal.h"
#include "log.h"
#include "mathematics.h"
#include "time.h"
@@ -244,7 +245,7 @@ static double eval_expr(Parser *p, AVExpr *e)
double x_max = eval_expr(p, e->param[1]);
for(i=-1; i<1024; i++) {
if(i<255) {
- p->var[0] = av_reverse[i&255]*x_max/255;
+ p->var[0] = ff_reverse[i&255]*x_max/255;
} else {
p->var[0] = x_max*pow(0.9, i-255);
if (i&1) p->var[0] *= -1;
diff --git a/chromium/third_party/ffmpeg/libavutil/fifo.c b/chromium/third_party/ffmpeg/libavutil/fifo.c
index 4ff3194c5fd..07fb4ec8114 100644
--- a/chromium/third_party/ffmpeg/libavutil/fifo.c
+++ b/chromium/third_party/ffmpeg/libavutil/fifo.c
@@ -129,7 +129,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size,
do {
int len = FFMIN(f->end - wptr, size);
if (func) {
- if (func(src, wptr, len) <= 0)
+ len = func(src, wptr, len);
+ if (len <= 0)
break;
} else {
memcpy(wptr, src, len);
@@ -147,6 +148,32 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size,
return total - size;
}
+int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size,
+ void (*func)(void *, void *, int))
+{
+// Read memory barrier needed for SMP here in theory
+ uint8_t *rptr = f->rptr;
+ uint32_t rndx = f->rndx;
+
+ do {
+ int len = FFMIN(f->end - f->rptr, buf_size);
+ if (func)
+ func(dest, f->rptr, len);
+ else {
+ memcpy(dest, f->rptr, len);
+ dest = (uint8_t *)dest + len;
+ }
+// memory barrier needed for SMP here in theory
+ av_fifo_drain(f, len);
+ buf_size -= len;
+ } while (buf_size > 0);
+
+ f->rptr = rptr;
+ f->rndx = rndx;
+
+ return 0;
+}
+
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size,
void (*func)(void *, void *, int))
{
diff --git a/chromium/third_party/ffmpeg/libavutil/fifo.h b/chromium/third_party/ffmpeg/libavutil/fifo.h
index f3bdcbceb4c..0e4070b99e8 100644
--- a/chromium/third_party/ffmpeg/libavutil/fifo.h
+++ b/chromium/third_party/ffmpeg/libavutil/fifo.h
@@ -85,6 +85,16 @@ int av_fifo_space(const AVFifoBuffer *f);
/**
* Feed data from an AVFifoBuffer to a user-supplied callback.
+ * Similar as av_fifo_gereric_read but without discarding data.
+ * @param f AVFifoBuffer to read from
+ * @param buf_size number of bytes to read
+ * @param func generic read function
+ * @param dest data destination
+ */
+int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
+
+/**
+ * Feed data from an AVFifoBuffer to a user-supplied callback.
* @param f AVFifoBuffer to read from
* @param buf_size number of bytes to read
* @param func generic read function
diff --git a/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c
index 8b25156c059..c2f270d453c 100644
--- a/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c
+++ b/chromium/third_party/ffmpeg/libavutil/fixed_dsp.c
@@ -121,7 +121,7 @@ static void vector_fmul_c(int *dst, const int *src0, const int *src1, int len)
}
}
-static int ff_scalarproduct_fixed_c(const int *v1, const int *v2, int len)
+static int scalarproduct_fixed_c(const int *v1, const int *v2, int len)
{
/** p is initialized with 0x40000000 so that the proper rounding will occur
* at the end */
@@ -158,7 +158,7 @@ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
fdsp->vector_fmul_add = vector_fmul_add_c;
fdsp->vector_fmul_reverse = vector_fmul_reverse_c;
fdsp->butterflies_fixed = butterflies_fixed_c;
- fdsp->scalarproduct_fixed = ff_scalarproduct_fixed_c;
+ fdsp->scalarproduct_fixed = scalarproduct_fixed_c;
return fdsp;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/float_dsp.c b/chromium/third_party/ffmpeg/libavutil/float_dsp.c
index 467d7a74c13..337708e8472 100644
--- a/chromium/third_party/ffmpeg/libavutil/float_dsp.c
+++ b/chromium/third_party/ffmpeg/libavutil/float_dsp.c
@@ -431,7 +431,7 @@ int main(int argc, char **argv)
fill_double_array(&lfg, dbl_src1, LEN);
avpriv_float_dsp_init(&fdsp, 1);
- av_set_cpu_flags_mask(0);
+ av_force_cpu_flags(0);
avpriv_float_dsp_init(&cdsp, 1);
if (test_vector_fmul(&fdsp, &cdsp, src0, src1))
diff --git a/chromium/third_party/ffmpeg/libavutil/frame.c b/chromium/third_party/ffmpeg/libavutil/frame.c
index 4596927f97c..7b4177bc953 100644
--- a/chromium/third_party/ffmpeg/libavutil/frame.c
+++ b/chromium/third_party/ffmpeg/libavutil/frame.c
@@ -46,29 +46,35 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range)
AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame) {return &frame->metadata;};
+#if FF_API_FRAME_QP
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
{
av_buffer_unref(&f->qp_table_buf);
f->qp_table_buf = buf;
+FF_DISABLE_DEPRECATION_WARNINGS
f->qscale_table = buf->data;
f->qstride = stride;
f->qscale_type = qp_type;
+FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
{
+FF_DISABLE_DEPRECATION_WARNINGS
*stride = f->qstride;
*type = f->qscale_type;
+FF_ENABLE_DEPRECATION_WARNINGS
if (!f->qp_table_buf)
return NULL;
return f->qp_table_buf->data;
}
+#endif
const char *av_get_colorspace_name(enum AVColorSpace val)
{
@@ -289,9 +295,6 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
dst->palette_has_changed = src->palette_has_changed;
dst->sample_rate = src->sample_rate;
dst->opaque = src->opaque;
-#if FF_API_AVFRAME_LAVC
- dst->type = src->type;
-#endif
dst->pkt_pts = src->pkt_pts;
dst->pkt_dts = src->pkt_dts;
dst->pkt_pos = src->pkt_pos;
@@ -345,6 +348,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
}
+#if FF_API_FRAME_QP
+FF_DISABLE_DEPRECATION_WARNINGS
dst->qscale_table = NULL;
dst->qstride = 0;
dst->qscale_type = 0;
@@ -356,6 +361,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
dst->qscale_type = src->qscale_type;
}
}
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
return 0;
}
@@ -463,6 +470,9 @@ void av_frame_unref(AVFrame *frame)
{
int i;
+ if (!frame)
+ return;
+
wipe_side_data(frame);
for (i = 0; i < FF_ARRAY_ELEMS(frame->buf); i++)
@@ -471,7 +481,9 @@ void av_frame_unref(AVFrame *frame)
av_buffer_unref(&frame->extended_buf[i]);
av_freep(&frame->extended_buf);
av_dict_free(&frame->metadata);
+#if FF_API_FRAME_QP
av_buffer_unref(&frame->qp_table_buf);
+#endif
get_frame_defaults(frame);
}
diff --git a/chromium/third_party/ffmpeg/libavutil/frame.h b/chromium/third_party/ffmpeg/libavutil/frame.h
index e910b517e2b..5270798c55f 100644
--- a/chromium/third_party/ffmpeg/libavutil/frame.h
+++ b/chromium/third_party/ffmpeg/libavutil/frame.h
@@ -241,11 +241,6 @@ typedef struct AVFrame {
*/
enum AVPictureType pict_type;
-#if FF_API_AVFRAME_LAVC
- attribute_deprecated
- uint8_t *base[AV_NUM_DATA_POINTERS];
-#endif
-
/**
* Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
*/
@@ -282,64 +277,6 @@ typedef struct AVFrame {
*/
int quality;
-#if FF_API_AVFRAME_LAVC
- attribute_deprecated
- int reference;
-
- /**
- * QP table
- */
- attribute_deprecated
- int8_t *qscale_table;
- /**
- * QP store stride
- */
- attribute_deprecated
- int qstride;
-
- attribute_deprecated
- int qscale_type;
-
- /**
- * mbskip_table[mb]>=1 if MB didn't change
- * stride= mb_width = (width+15)>>4
- */
- attribute_deprecated
- uint8_t *mbskip_table;
-
- /**
- * motion vector table
- * @code
- * example:
- * int mv_sample_log2= 4 - motion_subsample_log2;
- * int mb_width= (width+15)>>4;
- * int mv_stride= (mb_width << mv_sample_log2) + 1;
- * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
- * @endcode
- */
- int16_t (*motion_val[2])[2];
-
- /**
- * macroblock type table
- * mb_type_base + mb_width + 2
- */
- attribute_deprecated
- uint32_t *mb_type;
-
- /**
- * DCT coefficients
- */
- attribute_deprecated
- short *dct_coeff;
-
- /**
- * motion reference frame index
- * the order in which these are stored can depend on the codec.
- */
- attribute_deprecated
- int8_t *ref_index[2];
-#endif
-
/**
* for some private data of the user
*/
@@ -350,11 +287,6 @@ typedef struct AVFrame {
*/
uint64_t error[AV_NUM_DATA_POINTERS];
-#if FF_API_AVFRAME_LAVC
- attribute_deprecated
- int type;
-#endif
-
/**
* When decoding, this signals how much the picture must be delayed.
* extra_delay = repeat_pict / (2*fps)
@@ -376,17 +308,6 @@ typedef struct AVFrame {
*/
int palette_has_changed;
-#if FF_API_AVFRAME_LAVC
- attribute_deprecated
- int buffer_hints;
-
- /**
- * Pan scan.
- */
- attribute_deprecated
- struct AVPanScan *pan_scan;
-#endif
-
/**
* reordered opaque 64bit (generally an integer or a double precision float
* PTS but can be anything).
@@ -398,24 +319,6 @@ typedef struct AVFrame {
*/
int64_t reordered_opaque;
-#if FF_API_AVFRAME_LAVC
- /**
- * @deprecated this field is unused
- */
- attribute_deprecated void *hwaccel_picture_private;
-
- attribute_deprecated
- struct AVCodecContext *owner;
- attribute_deprecated
- void *thread_opaque;
-
- /**
- * log2 of the size of the block which a single vector in motion_val represents:
- * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
- */
- uint8_t motion_subsample_log2;
-#endif
-
/**
* Sample rate of the audio data.
*/
@@ -507,7 +410,7 @@ typedef struct AVFrame {
/**
* frame timestamp estimated using various heuristics, in stream time base
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_best_effort_timestamp(frame)
* - encoding: unused
* - decoding: set by libavcodec, read by user.
@@ -516,7 +419,7 @@ typedef struct AVFrame {
/**
* reordered pos from the last AVPacket that has been input into the decoder
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_pkt_pos(frame)
* - encoding: unused
* - decoding: Read by user.
@@ -526,7 +429,7 @@ typedef struct AVFrame {
/**
* duration of the corresponding packet, expressed in
* AVStream->time_base units, 0 if unknown.
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_pkt_duration(frame)
* - encoding: unused
* - decoding: Read by user.
@@ -535,7 +438,7 @@ typedef struct AVFrame {
/**
* metadata.
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_metadata(frame)
* - encoding: Set by user.
* - decoding: Set by libavcodec.
@@ -546,7 +449,7 @@ typedef struct AVFrame {
* decode error flags of the frame, set to a combination of
* FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
* were errors during the decoding.
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_decode_error_flags(frame)
* - encoding: unused
* - decoding: set by libavcodec, read by user.
@@ -557,7 +460,7 @@ typedef struct AVFrame {
/**
* number of audio channels, only used for audio.
- * Code outside libavcodec should access this field using:
+ * Code outside libavutil should access this field using:
* av_frame_get_channels(frame)
* - encoding: unused
* - decoding: Read by user.
@@ -574,16 +477,34 @@ typedef struct AVFrame {
*/
int pkt_size;
+#if FF_API_FRAME_QP
+ /**
+ * QP table
+ * Not to be accessed directly from outside libavutil
+ */
+ attribute_deprecated
+ int8_t *qscale_table;
+ /**
+ * QP store stride
+ * Not to be accessed directly from outside libavutil
+ */
+ attribute_deprecated
+ int qstride;
+
+ attribute_deprecated
+ int qscale_type;
+
/**
* Not to be accessed directly from outside libavutil
*/
AVBufferRef *qp_table_buf;
+#endif
} AVFrame;
/**
* Accessors for some AVFrame fields.
* The position of these field in the structure is not part of the ABI,
- * they should not be accessed directly outside libavcodec.
+ * they should not be accessed directly outside libavutil.
*/
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
@@ -604,8 +525,10 @@ void av_frame_set_decode_error_flags (AVFrame *frame, int val);
int av_frame_get_pkt_size(const AVFrame *frame);
void av_frame_set_pkt_size(AVFrame *frame, int val);
AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame);
+#if FF_API_FRAME_QP
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
+#endif
enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
diff --git a/chromium/third_party/ffmpeg/libavutil/hmac.c b/chromium/third_party/ffmpeg/libavutil/hmac.c
index b63d1b250e1..3e11509a278 100644
--- a/chromium/third_party/ffmpeg/libavutil/hmac.c
+++ b/chromium/third_party/ffmpeg/libavutil/hmac.c
@@ -207,7 +207,8 @@ static void test(AVHMAC *hmac, const uint8_t *key, int keylen,
int main(void)
{
uint8_t key1[20], key3[131], data3[50];
- enum AVHMACType i = AV_HMAC_SHA224;
+ AVHMAC *hmac;
+ enum AVHMACType i;
static const uint8_t key2[] = "Jefe";
static const uint8_t data1[] = "Hi There";
static const uint8_t data2[] = "what do ya want for nothing?";
@@ -216,34 +217,39 @@ int main(void)
static const uint8_t data6[] = "This is a test using a larger than block-size key and a larger "
"than block-size data. The key needs to be hashed before being used"
" by the HMAC algorithm.";
- AVHMAC *hmac = av_hmac_alloc(AV_HMAC_MD5);
- if (!hmac)
- return 1;
memset(key1, 0x0b, sizeof(key1));
memset(key3, 0xaa, sizeof(key3));
memset(data3, 0xdd, sizeof(data3));
- // RFC 2202 test vectors
- test(hmac, key1, 16, data1, sizeof(data1));
- test(hmac, key2, sizeof(key2), data2, sizeof(data2));
- test(hmac, key3, 16, data3, sizeof(data3));
- test(hmac, key3, 80, data4, sizeof(data4));
- test(hmac, key3, 80, data5, sizeof(data5));
- av_hmac_free(hmac);
- /* SHA-1 */
- hmac = av_hmac_alloc(AV_HMAC_SHA1);
- if (!hmac)
- return 1;
- // RFC 2202 test vectors
- test(hmac, key1, sizeof(key1), data1, sizeof(data1));
- test(hmac, key2, sizeof(key2), data2, sizeof(data2));
- test(hmac, key3, 20, data3, sizeof(data3));
- test(hmac, key3, 80, data4, sizeof(data4));
- test(hmac, key3, 80, data5, sizeof(data5));
- av_hmac_free(hmac);
+ /* MD5, SHA-1 */
+ for (i = AV_HMAC_MD5; i <= AV_HMAC_SHA1; i++) {
+ hmac = av_hmac_alloc(i);
+ if (!hmac)
+ return 1;
+ // RFC 2202 test vectors
+ test(hmac, key1, hmac->hashlen, data1, sizeof(data1));
+ test(hmac, key2, sizeof(key2), data2, sizeof(data2));
+ test(hmac, key3, hmac->hashlen, data3, sizeof(data3));
+ test(hmac, key3, 80, data4, sizeof(data4));
+ test(hmac, key3, 80, data5, sizeof(data5));
+ av_hmac_free(hmac);
+ }
/* SHA-2 */
- while (i <= AV_HMAC_SHA512) {
+ for (i = AV_HMAC_SHA224; i <= AV_HMAC_SHA256; i++) {
+ hmac = av_hmac_alloc(i);
+ if (!hmac)
+ return 1;
+ // RFC 4231 test vectors
+ test(hmac, key1, sizeof(key1), data1, sizeof(data1));
+ test(hmac, key2, sizeof(key2), data2, sizeof(data2));
+ test(hmac, key3, 20, data3, sizeof(data3));
+ test(hmac, key3, sizeof(key3), data4, sizeof(data4));
+ test(hmac, key3, sizeof(key3), data6, sizeof(data6));
+ av_hmac_free(hmac);
+ }
+
+ for (i = AV_HMAC_SHA384; i <= AV_HMAC_SHA512; i++) {
hmac = av_hmac_alloc(i);
if (!hmac)
return 1;
@@ -254,7 +260,6 @@ int main(void)
test(hmac, key3, sizeof(key3), data4, sizeof(data4));
test(hmac, key3, sizeof(key3), data6, sizeof(data6));
av_hmac_free(hmac);
- i++;
}
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/hmac.h b/chromium/third_party/ffmpeg/libavutil/hmac.h
index d36d4de19ec..576a0a4fb96 100644
--- a/chromium/third_party/ffmpeg/libavutil/hmac.h
+++ b/chromium/third_party/ffmpeg/libavutil/hmac.h
@@ -23,6 +23,7 @@
#include <stdint.h>
+#include "version.h"
/**
* @defgroup lavu_hmac HMAC
* @ingroup lavu_crypto
@@ -32,9 +33,9 @@
enum AVHMACType {
AV_HMAC_MD5,
AV_HMAC_SHA1,
- AV_HMAC_SHA224 = 10,
+ AV_HMAC_SHA224,
AV_HMAC_SHA256,
- AV_HMAC_SHA384,
+ AV_HMAC_SHA384 = 12,
AV_HMAC_SHA512,
};
diff --git a/chromium/third_party/ffmpeg/libavutil/imgutils.c b/chromium/third_party/ffmpeg/libavutil/imgutils.c
index 9c8216e827b..8956ae31ec3 100644
--- a/chromium/third_party/ffmpeg/libavutil/imgutils.c
+++ b/chromium/third_party/ffmpeg/libavutil/imgutils.c
@@ -41,8 +41,8 @@ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
for (i = 0; i < 4; i++) {
const AVComponentDescriptor *comp = &(pixdesc->comp[i]);
- if ((comp->step_minus1+1) > max_pixsteps[comp->plane]) {
- max_pixsteps[comp->plane] = comp->step_minus1+1;
+ if (comp->step > max_pixsteps[comp->plane]) {
+ max_pixsteps[comp->plane] = comp->step;
if (max_pixstep_comps)
max_pixstep_comps[comp->plane] = i;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/internal.h b/chromium/third_party/ffmpeg/libavutil/internal.h
index 8817ec3b0e3..13dbd3b966e 100644
--- a/chromium/third_party/ffmpeg/libavutil/internal.h
+++ b/chromium/third_party/ffmpeg/libavutil/internal.h
@@ -238,8 +238,8 @@ void avpriv_request_sample(void *avc,
#if HAVE_LIBC_MSVCRT
#include <crtversion.h>
#if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14
-#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")
-#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")
+#pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_strtod")
+#pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_snprintf")
#endif
#define avpriv_open ff_open
@@ -250,6 +250,12 @@ void avpriv_request_sample(void *avc,
#define SIZE_SPECIFIER "zu"
#endif
+#ifdef DEBUG
+# define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+# define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
+#endif
+
/**
* A wrapper for open() setting O_CLOEXEC.
*/
@@ -270,10 +276,8 @@ static av_always_inline av_const int avpriv_mirror(int x, int w)
return x;
}
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
-uint64_t ff_get_channel_layout(const char *name, int compat);
-#endif
-
void ff_check_pixfmt_descriptors(void);
+extern const uint8_t ff_reverse[256];
+
#endif /* AVUTIL_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/intmath.h b/chromium/third_party/ffmpeg/libavutil/intmath.h
index f5ecc77b7de..08d54a64ad2 100644
--- a/chromium/third_party/ffmpeg/libavutil/intmath.h
+++ b/chromium/third_party/ffmpeg/libavutil/intmath.h
@@ -33,28 +33,23 @@
# include "x86/intmath.h"
#endif
-/**
- * @addtogroup lavu_internal
- * @{
- */
-
#if HAVE_FAST_CLZ
-#if AV_GCC_VERSION_AT_LEAST(3,4)
+#if defined( __INTEL_COMPILER )
#ifndef ff_log2
-# define ff_log2(x) (31 - __builtin_clz((x)|1))
+# define ff_log2(x) (_bit_scan_reverse((x)|1))
# ifndef ff_log2_16bit
# define ff_log2_16bit av_log2
# endif
#endif /* ff_log2 */
-#elif defined( __INTEL_COMPILER )
+#elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_log2
-# define ff_log2(x) (_bit_scan_reverse((x)|1))
+# define ff_log2(x) (31 - __builtin_clz((x)|1))
# ifndef ff_log2_16bit
# define ff_log2_16bit av_log2
# endif
#endif /* ff_log2 */
-#endif
#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
+#endif
extern const uint8_t ff_log2_tab[256];
@@ -106,22 +101,18 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
#define av_log2_16bit ff_log2_16bit
/**
- * @}
- */
-
-/**
* @addtogroup lavu_math
* @{
*/
#if HAVE_FAST_CLZ
-#if AV_GCC_VERSION_AT_LEAST(3,4)
+#if defined( __INTEL_COMPILER )
#ifndef ff_ctz
-#define ff_ctz(v) __builtin_ctz(v)
+#define ff_ctz(v) _bit_scan_forward(v)
#endif
-#elif defined( __INTEL_COMPILER )
+#elif AV_GCC_VERSION_AT_LEAST(3,4)
#ifndef ff_ctz
-#define ff_ctz(v) _bit_scan_forward(v)
+#define ff_ctz(v) __builtin_ctz(v)
#endif
#endif
#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/log.h b/chromium/third_party/ffmpeg/libavutil/log.h
index db7eb3f7194..321748cd80e 100644
--- a/chromium/third_party/ffmpeg/libavutil/log.h
+++ b/chromium/third_party/ffmpeg/libavutil/log.h
@@ -196,13 +196,13 @@ typedef struct AVClass {
*/
#define AV_LOG_DEBUG 48
-#define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET)
-
/**
* Extremely verbose debugging, useful for libav* development.
*/
#define AV_LOG_TRACE 56
+#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET)
+
/**
* @}
*/
diff --git a/chromium/third_party/ffmpeg/libavutil/mathematics.c b/chromium/third_party/ffmpeg/libavutil/mathematics.c
index 126cffc3f0c..252794e4600 100644
--- a/chromium/third_party/ffmpeg/libavutil/mathematics.c
+++ b/chromium/third_party/ffmpeg/libavutil/mathematics.c
@@ -31,27 +31,6 @@
#include "avassert.h"
#include "version.h"
-#if FF_API_AV_REVERSE
-const uint8_t av_reverse[256] = {
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-#endif
-
int64_t av_gcd(int64_t a, int64_t b)
{
if (b)
diff --git a/chromium/third_party/ffmpeg/libavutil/mem.c b/chromium/third_party/ffmpeg/libavutil/mem.c
index d990df619aa..117d7517a13 100644
--- a/chromium/third_party/ffmpeg/libavutil/mem.c
+++ b/chromium/third_party/ffmpeg/libavutil/mem.c
@@ -59,6 +59,8 @@ void free(void *ptr);
#endif /* MALLOC_PREFIX */
+#include "mem_internal.h"
+
#define ALIGN (HAVE_AVX ? 32 : 16)
/* NOTE: if you want to override these functions with your own
@@ -481,7 +483,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
if (min_size < *size)
return ptr;
- min_size = FFMAX(17 * min_size / 16 + 32, min_size);
+ min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
ptr = av_realloc(ptr, min_size);
/* we could set this to the unmodified min_size but this is safer
@@ -495,22 +497,6 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
return ptr;
}
-static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
-{
- void *val;
-
- if (min_size < *size)
- return 0;
- min_size = FFMAX(17 * min_size / 16 + 32, min_size);
- av_freep(ptr);
- val = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
- memcpy(ptr, &val, sizeof(val));
- if (!val)
- min_size = 0;
- *size = min_size;
- return 1;
-}
-
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
{
ff_fast_malloc(ptr, size, min_size, 0);
diff --git a/chromium/third_party/ffmpeg/libavutil/mem_internal.h b/chromium/third_party/ffmpeg/libavutil/mem_internal.h
new file mode 100644
index 00000000000..6fdbcb016e7
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/mem_internal.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2002 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MEM_INTERNAL_H
+#define AVUTIL_MEM_INTERNAL_H
+
+#include "avassert.h"
+#include "mem.h"
+
+static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
+{
+ void *val;
+
+ memcpy(&val, ptr, sizeof(val));
+ if (min_size <= *size) {
+ av_assert0(val || !min_size);
+ return 0;
+ }
+ min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
+ av_freep(ptr);
+ val = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
+ memcpy(ptr, &val, sizeof(val));
+ if (!val)
+ min_size = 0;
+ *size = min_size;
+ return 1;
+}
+#endif /* AVUTIL_MEM_INTERNAL_H */
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 0ee88d2253b..b1d18dd9d3b 100644
--- a/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
+++ b/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
@@ -24,6 +24,9 @@
#include <stdint.h>
#include <msa.h>
+#define ALIGNMENT 16
+#define ALLOC_ALIGNED(align) __attribute__ ((aligned((align) << 1)))
+
#define LD_B(RTYPE, psrc) *((RTYPE *)(psrc))
#define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
#define LD_SB(...) LD_B(v16i8, __VA_ARGS__)
@@ -333,6 +336,7 @@
LD_B4(RTYPE, (psrc), stride, out0, out1, out2, out3); \
LD_B2(RTYPE, (psrc) + 4 * stride, stride, out4, out5); \
}
+#define LD_UB6(...) LD_B6(v16u8, __VA_ARGS__)
#define LD_SB6(...) LD_B6(v16i8, __VA_ARGS__)
#define LD_B7(RTYPE, psrc, stride, \
@@ -341,6 +345,7 @@
LD_B5(RTYPE, (psrc), stride, out0, out1, out2, out3, out4); \
LD_B2(RTYPE, (psrc) + 5 * stride, stride, out5, out6); \
}
+#define LD_UB7(...) LD_B7(v16u8, __VA_ARGS__)
#define LD_SB7(...) LD_B7(v16i8, __VA_ARGS__)
#define LD_B8(RTYPE, psrc, stride, \
@@ -505,6 +510,14 @@
ST_SW(in0, (pdst)); \
ST_SW(in1, (pdst) + stride); \
}
+#define ST_SW8(in0, in1, in2, in3, in4, in5, in6, in7, \
+ pdst, stride) \
+{ \
+ ST_SW2(in0, in1, (pdst), stride); \
+ ST_SW2(in2, in3, (pdst) + 2 * stride, stride); \
+ ST_SW2(in4, in5, (pdst) + 4 * stride, stride); \
+ ST_SW2(in6, in7, (pdst) + 6 * stride, stride); \
+}
/* Description : Store as 2x4 byte block to destination memory from input vector
Arguments : Inputs - in, stidx, pdst, stride
@@ -804,6 +817,15 @@
#define SLDI_B2_0_SB(...) SLDI_B2_0(v16i8, __VA_ARGS__)
#define SLDI_B2_0_SW(...) SLDI_B2_0(v4i32, __VA_ARGS__)
+#define SLDI_B3_0(RTYPE, in0, in1, in2, out0, out1, out2, slide_val) \
+{ \
+ v16i8 zero_m = { 0 }; \
+ SLDI_B2_0(RTYPE, in0, in1, out0, out1, slide_val); \
+ out2 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in2, slide_val); \
+}
+#define SLDI_B3_0_UB(...) SLDI_B3_0(v16u8, __VA_ARGS__)
+#define SLDI_B3_0_SB(...) SLDI_B3_0(v16i8, __VA_ARGS__)
+
#define SLDI_B4_0(RTYPE, in0, in1, in2, in3, \
out0, out1, out2, out3, slide_val) \
{ \
@@ -830,6 +852,14 @@
#define SLDI_B2_SB(...) SLDI_B2(v16i8, __VA_ARGS__)
#define SLDI_B2_SH(...) SLDI_B2(v8i16, __VA_ARGS__)
+#define SLDI_B3(RTYPE, in0_0, in0_1, in0_2, in1_0, in1_1, in1_2, \
+ out0, out1, out2, slide_val) \
+{ \
+ SLDI_B2(RTYPE, in0_0, in0_1, in1_0, in1_1, out0, out1, slide_val) \
+ out2 = (RTYPE) __msa_sldi_b((v16i8) in0_2, (v16i8) in1_2, slide_val); \
+}
+#define SLDI_B3_SB(...) SLDI_B3(v16i8, __VA_ARGS__)
+#define SLDI_B3_UH(...) SLDI_B3(v8u16, __VA_ARGS__)
/* Description : Shuffle byte vector elements as per mask vector
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
@@ -1027,6 +1057,27 @@
}
#define DPADD_SB4_SH(...) DPADD_SB4(v8i16, __VA_ARGS__)
+/* Description : Dot product & addition of byte vector elements
+ Arguments : Inputs - mult0, mult1
+ cnst0, cnst1
+ Outputs - out0, out1
+ Return Type - unsigned halfword
+ Details : Unsigned byte elements from mult0 are multiplied with
+ unsigned byte elements from cnst0 producing a result
+ twice the size of input i.e. unsigned halfword.
+ Then this multiplication results of adjacent odd-even elements
+ are added to the out vector
+ (2 unsigned halfword results)
+*/
+#define DPADD_UB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
+{ \
+ out0 = (RTYPE) __msa_dpadd_u_h((v8u16) out0, \
+ (v16u8) mult0, (v16u8) cnst0); \
+ out1 = (RTYPE) __msa_dpadd_u_h((v8u16) out1, \
+ (v16u8) mult1, (v16u8) cnst1); \
+}
+#define DPADD_UB2_UH(...) DPADD_UB2(v8u16, __VA_ARGS__)
+
/* Description : Dot product & addition of halfword vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
@@ -1056,6 +1107,28 @@
}
#define DPADD_SH4_SW(...) DPADD_SH4(v4i32, __VA_ARGS__)
+/* Description : Minimum values between unsigned elements of
+ either vector are copied to the output vector
+ Arguments : Inputs - in0, in1, min_vec
+ Outputs - in0, in1, (in place)
+ Return Type - unsigned halfword
+ Details : Minimum of unsigned halfword element values from 'in0' and
+ 'min_value' are written to output vector 'in0'
+*/
+#define MIN_UH2(RTYPE, in0, in1, min_vec) \
+{ \
+ in0 = (RTYPE) __msa_min_u_h((v8u16) in0, min_vec); \
+ in1 = (RTYPE) __msa_min_u_h((v8u16) in1, min_vec); \
+}
+#define MIN_UH2_UH(...) MIN_UH2(v8u16, __VA_ARGS__)
+
+#define MIN_UH4(RTYPE, in0, in1, in2, in3, min_vec) \
+{ \
+ MIN_UH2(RTYPE, in0, in1, min_vec); \
+ MIN_UH2(RTYPE, in2, in3, min_vec); \
+}
+#define MIN_UH4_UH(...) MIN_UH4(v8u16, __VA_ARGS__)
+
/* Description : Clips all halfword elements of input vector between min & max
out = ((in) < (min)) ? (min) : (((in) > (max)) ? (max) : (in))
Arguments : Inputs - in (input vector)
@@ -1115,6 +1188,46 @@
out_m; \
} )
+/* Description : Addition of 4 signed word elements
+ 4 signed word elements of input vector are added together and
+ resulted integer sum is returned
+ Arguments : Inputs - in (signed word vector)
+ Outputs - sum_m (i32 sum)
+ Return Type - signed word
+*/
+#define HADD_SW_S32(in) \
+( { \
+ v2i64 res0_m, res1_m; \
+ int32_t sum_m; \
+ \
+ res0_m = __msa_hadd_s_d((v4i32) in, (v4i32) in); \
+ res1_m = __msa_splati_d(res0_m, 1); \
+ res0_m = res0_m + res1_m; \
+ sum_m = __msa_copy_s_w((v4i32) res0_m, 0); \
+ sum_m; \
+} )
+
+/* Description : Addition of 8 unsigned halfword elements
+ 8 unsigned halfword elements of input vector are added
+ together and resulted integer sum is returned
+ Arguments : Inputs - in (unsigned halfword vector)
+ Outputs - sum_m (u32 sum)
+ Return Type - unsigned word
+*/
+#define HADD_UH_U32(in) \
+( { \
+ v4u32 res_m; \
+ v2u64 res0_m, res1_m; \
+ uint32_t sum_m; \
+ \
+ res_m = __msa_hadd_u_w((v8u16) in, (v8u16) in); \
+ res0_m = __msa_hadd_u_d(res_m, res_m); \
+ res1_m = (v2u64) __msa_splati_d((v2i64) res0_m, 1); \
+ res0_m = res0_m + res1_m; \
+ sum_m = __msa_copy_u_w((v4i32) res0_m, 0); \
+ sum_m; \
+} )
+
/* Description : Horizontal addition of signed byte vector elements
Arguments : Inputs - in0, in1
Outputs - out0, out1
@@ -1153,6 +1266,22 @@
}
#define HADD_UB2_UH(...) HADD_UB2(v8u16, __VA_ARGS__)
+#define HADD_UB3(RTYPE, in0, in1, in2, out0, out1, out2) \
+{ \
+ HADD_UB2(RTYPE, in0, in1, out0, out1); \
+ out2 = (RTYPE) __msa_hadd_u_h((v16u8) in2, (v16u8) in2); \
+}
+#define HADD_UB3_UH(...) HADD_UB3(v8u16, __VA_ARGS__)
+
+#define HADD_UB4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \
+{ \
+ HADD_UB2(RTYPE, in0, in1, out0, out1); \
+ HADD_UB2(RTYPE, in2, in3, out2, out3); \
+}
+#define HADD_UB4_UB(...) HADD_UB4(v16u8, __VA_ARGS__)
+#define HADD_UB4_UH(...) HADD_UB4(v8u16, __VA_ARGS__)
+#define HADD_UB4_SH(...) HADD_UB4(v8i16, __VA_ARGS__)
+
/* Description : Horizontal subtraction of unsigned byte vector elements
Arguments : Inputs - in0, in1
Outputs - out0, out1
@@ -1169,6 +1298,37 @@
#define HSUB_UB2_UH(...) HSUB_UB2(v8u16, __VA_ARGS__)
#define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__)
+#define HSUB_UB4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \
+{ \
+ HSUB_UB2(RTYPE, in0, in1, out0, out1); \
+ HSUB_UB2(RTYPE, in2, in3, out2, out3); \
+}
+#define HSUB_UB4_UH(...) HSUB_UB4(v8u16, __VA_ARGS__)
+#define HSUB_UB4_SH(...) HSUB_UB4(v8i16, __VA_ARGS__)
+
+/* Description : SAD (Sum of Absolute Difference)
+ Arguments : Inputs - in0, in1, ref0, ref1 (unsigned byte src & ref)
+ Outputs - sad_m (halfword vector with sad)
+ Return Type - unsigned halfword
+ Details : Absolute difference of all the byte elements from 'in0' with
+ 'ref0' is calculated and preserved in 'diff0'. From the 16
+ unsigned absolute diff values, even-odd pairs are added
+ together to generate 8 halfword results.
+*/
+#define SAD_UB2_UH(in0, in1, ref0, ref1) \
+( { \
+ v16u8 diff0_m, diff1_m; \
+ v8u16 sad_m = { 0 }; \
+ \
+ diff0_m = __msa_asub_u_b((v16u8) in0, (v16u8) ref0); \
+ diff1_m = __msa_asub_u_b((v16u8) in1, (v16u8) ref1); \
+ \
+ sad_m += __msa_hadd_u_h((v16u8) diff0_m, (v16u8) diff0_m); \
+ sad_m += __msa_hadd_u_h((v16u8) diff1_m, (v16u8) diff1_m); \
+ \
+ sad_m; \
+} )
+
/* Description : Insert specified word elements from input vectors to 1
destination vector
Arguments : Inputs - in0, in1, in2, in3 (4 input vectors)
@@ -1260,7 +1420,10 @@
out0 = (RTYPE) __msa_ilvev_w((v4i32) in1, (v4i32) in0); \
out1 = (RTYPE) __msa_ilvev_w((v4i32) in3, (v4i32) in2); \
}
+#define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__)
#define ILVEV_W2_SB(...) ILVEV_W2(v16i8, __VA_ARGS__)
+#define ILVEV_W2_UH(...) ILVEV_W2(v8u16, __VA_ARGS__)
+#define ILVEV_W2_SD(...) ILVEV_W2(v2i64, __VA_ARGS__)
/* Description : Interleave even double word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
@@ -1294,7 +1457,9 @@
out0 = (RTYPE) __msa_ilvl_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_ilvl_b((v16i8) in2, (v16i8) in3); \
}
+#define ILVL_B2_UB(...) ILVL_B2(v16u8, __VA_ARGS__)
#define ILVL_B2_SB(...) ILVL_B2(v16i8, __VA_ARGS__)
+#define ILVL_B2_UH(...) ILVL_B2(v8u16, __VA_ARGS__)
#define ILVL_B2_SH(...) ILVL_B2(v8i16, __VA_ARGS__)
#define ILVL_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
@@ -1303,6 +1468,7 @@
ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVL_B2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
+#define ILVL_B4_UB(...) ILVL_B4(v16u8, __VA_ARGS__)
#define ILVL_B4_SB(...) ILVL_B4(v16i8, __VA_ARGS__)
#define ILVL_B4_UH(...) ILVL_B4(v8u16, __VA_ARGS__)
#define ILVL_B4_SH(...) ILVL_B4(v8i16, __VA_ARGS__)
@@ -1331,6 +1497,7 @@
ILVL_H2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVL_H4_SH(...) ILVL_H4(v8i16, __VA_ARGS__)
+#define ILVL_H4_SW(...) ILVL_H4(v4i32, __VA_ARGS__)
/* Description : Interleave left half of word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
@@ -1346,7 +1513,9 @@
out0 = (RTYPE) __msa_ilvl_w((v4i32) in0, (v4i32) in1); \
out1 = (RTYPE) __msa_ilvl_w((v4i32) in2, (v4i32) in3); \
}
+#define ILVL_W2_UB(...) ILVL_W2(v16u8, __VA_ARGS__)
#define ILVL_W2_SB(...) ILVL_W2(v16i8, __VA_ARGS__)
+#define ILVL_W2_SH(...) ILVL_W2(v8i16, __VA_ARGS__)
/* Description : Interleave right half of byte elements from vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
@@ -1433,6 +1602,7 @@
ILVR_H2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_H4_SH(...) ILVR_H4(v8i16, __VA_ARGS__)
+#define ILVR_H4_SW(...) ILVR_H4(v4i32, __VA_ARGS__)
#define ILVR_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
@@ -1441,6 +1611,7 @@
}
#define ILVR_W2_UB(...) ILVR_W2(v16u8, __VA_ARGS__)
#define ILVR_W2_SB(...) ILVR_W2(v16i8, __VA_ARGS__)
+#define ILVR_W2_SH(...) ILVR_W2(v8i16, __VA_ARGS__)
#define ILVR_W4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
@@ -1449,6 +1620,7 @@
ILVR_W2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_W4_SB(...) ILVR_W4(v16i8, __VA_ARGS__)
+#define ILVR_W4_UB(...) ILVR_W4(v16u8, __VA_ARGS__)
/* Description : Interleave right half of double word elements from vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
@@ -1482,6 +1654,7 @@
ILVR_D2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_D4_SB(...) ILVR_D4(v16i8, __VA_ARGS__)
+#define ILVR_D4_UB(...) ILVR_D4(v16u8, __VA_ARGS__)
/* Description : Interleave both left and right half of input vectors
Arguments : Inputs - in0, in1
@@ -1534,6 +1707,7 @@
in0 = (RTYPE) __msa_maxi_s_h((v8i16) in0, (max_val)); \
in1 = (RTYPE) __msa_maxi_s_h((v8i16) in1, (max_val)); \
}
+#define MAXI_SH2_UH(...) MAXI_SH2(v8u16, __VA_ARGS__)
#define MAXI_SH2_SH(...) MAXI_SH2(v8i16, __VA_ARGS__)
#define MAXI_SH4(RTYPE, in0, in1, in2, in3, max_val) \
@@ -1559,6 +1733,7 @@
in1 = (RTYPE) __msa_sat_u_h((v8u16) in1, sat_val); \
}
#define SAT_UH2_UH(...) SAT_UH2(v8u16, __VA_ARGS__)
+#define SAT_UH2_SH(...) SAT_UH2(v8i16, __VA_ARGS__)
#define SAT_UH4(RTYPE, in0, in1, in2, in3, sat_val) \
{ \
@@ -1639,6 +1814,15 @@
#define SPLATI_H2_SB(...) SPLATI_H2(v16i8, __VA_ARGS__)
#define SPLATI_H2_SH(...) SPLATI_H2(v8i16, __VA_ARGS__)
+#define SPLATI_H3(RTYPE, in, idx0, idx1, idx2, \
+ out0, out1, out2) \
+{ \
+ SPLATI_H2(RTYPE, in, idx0, idx1, out0, out1); \
+ out2 = (RTYPE) __msa_splati_h((v8i16) in, idx2); \
+}
+#define SPLATI_H3_SB(...) SPLATI_H3(v16i8, __VA_ARGS__)
+#define SPLATI_H3_SH(...) SPLATI_H3(v8i16, __VA_ARGS__)
+
#define SPLATI_H4(RTYPE, in, idx0, idx1, idx2, idx3, \
out0, out1, out2, out3) \
{ \
@@ -2088,6 +2272,13 @@
out0 = in0 - in1; \
out1 = in2 - in3; \
}
+#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \
+{ \
+ out0 = in0 - in1; \
+ out1 = in2 - in3; \
+ out2 = in4 - in5; \
+ out3 = in6 - in7; \
+}
/* Description : Sign extend halfword elements from right half of the vector
Arguments : Inputs - in (input halfword vector)
@@ -2202,6 +2393,35 @@
out7 = in0 - in7; \
}
+/* Description : Butterfly of 16 input vectors
+ Arguments : Inputs - in0 ... in15
+ Outputs - out0 .. out15
+ Details : Butterfly operation
+*/
+#define BUTTERFLY_16(in0, in1, in2, in3, in4, in5, in6, in7, \
+ in8, in9, in10, in11, in12, in13, in14, in15, \
+ out0, out1, out2, out3, out4, out5, out6, out7, \
+ out8, out9, out10, out11, out12, out13, out14, out15) \
+{ \
+ out0 = in0 + in15; \
+ out1 = in1 + in14; \
+ out2 = in2 + in13; \
+ out3 = in3 + in12; \
+ out4 = in4 + in11; \
+ out5 = in5 + in10; \
+ out6 = in6 + in9; \
+ out7 = in7 + in8; \
+ \
+ out8 = in7 - in8; \
+ out9 = in6 - in9; \
+ out10 = in5 - in10; \
+ out11 = in4 - in11; \
+ out12 = in3 - in12; \
+ out13 = in2 - in13; \
+ out14 = in1 - in14; \
+ out15 = in0 - in15; \
+}
+
/* Description : Transposes input 4x4 byte block
Arguments : Inputs - in0, in1, in2, in3 (input 4x4 byte block)
Outputs - out0, out1, out2, out3 (output 4x4 byte block)
@@ -2272,6 +2492,42 @@
}
#define TRANSPOSE8x8_UB_UB(...) TRANSPOSE8x8_UB(v16u8, __VA_ARGS__)
#define TRANSPOSE8x8_UB_UH(...) TRANSPOSE8x8_UB(v8u16, __VA_ARGS__)
+
+/* Description : Transposes 16x4 block into 4x16 with byte elements in vectors
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7,
+ in8, in9, in10, in11, in12, in13, in14, in15
+ Outputs - out0, out1, out2, out3
+ Return Type - unsigned byte
+ Details :
+*/
+#define TRANSPOSE16x4_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ in8, in9, in10, in11, in12, in13, in14, in15, \
+ out0, out1, out2, out3) \
+{ \
+ v2i64 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ \
+ ILVEV_W2_SD(in0, in4, in8, in12, tmp0_m, tmp1_m); \
+ out1 = (v16u8) __msa_ilvev_d(tmp1_m, tmp0_m); \
+ \
+ ILVEV_W2_SD(in1, in5, in9, in13, tmp0_m, tmp1_m); \
+ out3 = (v16u8) __msa_ilvev_d(tmp1_m, tmp0_m); \
+ \
+ ILVEV_W2_SD(in2, in6, in10, in14, tmp0_m, tmp1_m); \
+ \
+ tmp2_m = __msa_ilvev_d(tmp1_m, tmp0_m); \
+ ILVEV_W2_SD(in3, in7, in11, in15, tmp0_m, tmp1_m); \
+ \
+ tmp3_m = __msa_ilvev_d(tmp1_m, tmp0_m); \
+ ILVEV_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \
+ out0 = (v16u8) __msa_ilvev_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
+ out2 = (v16u8) __msa_ilvod_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
+ \
+ tmp0_m = (v2i64) __msa_ilvod_b((v16i8) out3, (v16i8) out1); \
+ tmp1_m = (v2i64) __msa_ilvod_b((v16i8) tmp3_m, (v16i8) tmp2_m); \
+ out1 = (v16u8) __msa_ilvev_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
+ out3 = (v16u8) __msa_ilvod_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
+}
+
/* Description : Transposes 16x8 block into 8x16 with byte elements in vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7,
in8, in9, in10, in11, in12, in13, in14, in15
@@ -2387,6 +2643,67 @@
out3 = (v4i32) __msa_ilvl_d((v2i64) s3_m, (v2i64) s1_m); \
}
+/* Description : Average byte elements from pair of vectors and store 8x4 byte
+ block in destination memory
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
+ Outputs -
+ Return Type -
+ Details : Each byte element from input vector pair 'in0' and 'in1' are
+ averaged (a + b)/2 and stored in 'tmp0_m'
+ Each byte element from input vector pair 'in2' and 'in3' are
+ averaged (a + b)/2 and stored in 'tmp1_m'
+ Each byte element from input vector pair 'in4' and 'in5' are
+ averaged (a + b)/2 and stored in 'tmp2_m'
+ Each byte element from input vector pair 'in6' and 'in7' are
+ averaged (a + b)/2 and stored in 'tmp3_m'
+ The half vector results from all 4 vectors are stored in
+ destination memory as 8x4 byte block
+*/
+#define AVE_ST8x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
+{ \
+ uint64_t out0_m, out1_m, out2_m, out3_m; \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ \
+ tmp0_m = __msa_ave_u_b((v16u8) in0, (v16u8) in1); \
+ tmp1_m = __msa_ave_u_b((v16u8) in2, (v16u8) in3); \
+ tmp2_m = __msa_ave_u_b((v16u8) in4, (v16u8) in5); \
+ tmp3_m = __msa_ave_u_b((v16u8) in6, (v16u8) in7); \
+ \
+ out0_m = __msa_copy_u_d((v2i64) tmp0_m, 0); \
+ out1_m = __msa_copy_u_d((v2i64) tmp1_m, 0); \
+ out2_m = __msa_copy_u_d((v2i64) tmp2_m, 0); \
+ out3_m = __msa_copy_u_d((v2i64) tmp3_m, 0); \
+ SD4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
+}
+
+/* Description : Average byte elements from pair of vectors and store 16x4 byte
+ block in destination memory
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
+ Outputs -
+ Return Type -
+ Details : Each byte element from input vector pair 'in0' and 'in1' are
+ averaged (a + b)/2 and stored in 'tmp0_m'
+ Each byte element from input vector pair 'in2' and 'in3' are
+ averaged (a + b)/2 and stored in 'tmp1_m'
+ Each byte element from input vector pair 'in4' and 'in5' are
+ averaged (a + b)/2 and stored in 'tmp2_m'
+ Each byte element from input vector pair 'in6' and 'in7' are
+ averaged (a + b)/2 and stored in 'tmp3_m'
+ The results from all 4 vectors are stored in destination
+ memory as 16x4 byte block
+*/
+#define AVE_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
+{ \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ \
+ tmp0_m = __msa_ave_u_b((v16u8) in0, (v16u8) in1); \
+ tmp1_m = __msa_ave_u_b((v16u8) in2, (v16u8) in3); \
+ tmp2_m = __msa_ave_u_b((v16u8) in4, (v16u8) in5); \
+ tmp3_m = __msa_ave_u_b((v16u8) in6, (v16u8) in7); \
+ \
+ ST_UB4(tmp0_m, tmp1_m, tmp2_m, tmp3_m, pdst, stride); \
+}
+
/* Description : Average rounded byte elements from pair of vectors and store
8x4 byte block in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
@@ -2418,6 +2735,91 @@
SD4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
}
+/* Description : Average rounded byte elements from pair of vectors and store
+ 16x4 byte block in destination memory
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
+ Outputs -
+ Return Type -
+ Details : Each byte element from input vector pair 'in0' and 'in1' are
+ average rounded (a + b + 1)/2 and stored in 'tmp0_m'
+ Each byte element from input vector pair 'in2' and 'in3' are
+ average rounded (a + b + 1)/2 and stored in 'tmp1_m'
+ Each byte element from input vector pair 'in4' and 'in5' are
+ average rounded (a + b + 1)/2 and stored in 'tmp2_m'
+ Each byte element from input vector pair 'in6' and 'in7' are
+ average rounded (a + b + 1)/2 and stored in 'tmp3_m'
+ The vector results from all 4 vectors are stored in
+ destination memory as 16x4 byte block
+*/
+#define AVER_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
+{ \
+ v16u8 t0_m, t1_m, t2_m, t3_m; \
+ \
+ AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ t0_m, t1_m, t2_m, t3_m); \
+ ST_UB4(t0_m, t1_m, t2_m, t3_m, pdst, stride); \
+}
+
+/* Description : Average rounded byte elements from pair of vectors,
+ average rounded with destination and store 8x4 byte block
+ in destination memory
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
+ Outputs -
+ Return Type -
+ Details : Each byte element from input vector pair 'in0' and 'in1' are
+ average rounded (a + b + 1)/2 and stored in 'tmp0_m'
+ Each byte element from input vector pair 'in2' and 'in3' are
+ average rounded (a + b + 1)/2 and stored in 'tmp1_m'
+ Each byte element from input vector pair 'in4' and 'in5' are
+ average rounded (a + b + 1)/2 and stored in 'tmp2_m'
+ Each byte element from input vector pair 'in6' and 'in7' are
+ average rounded (a + b + 1)/2 and stored in 'tmp3_m'
+ The half vector results from all 4 vectors are stored in
+ destination memory as 8x4 byte block
+*/
+#define AVER_DST_ST8x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ pdst, stride) \
+{ \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
+ \
+ LD_UB4(pdst, stride, dst0_m, dst1_m, dst2_m, dst3_m); \
+ AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ AVER_ST8x4_UB(dst0_m, tmp0_m, dst1_m, tmp1_m, \
+ dst2_m, tmp2_m, dst3_m, tmp3_m, pdst, stride); \
+}
+
+/* Description : Average rounded byte elements from pair of vectors,
+ average rounded with destination and store 16x4 byte block
+ in destination memory
+ Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
+ Outputs -
+ Return Type -
+ Details : Each byte element from input vector pair 'in0' and 'in1' are
+ average rounded (a + b + 1)/2 and stored in 'tmp0_m'
+ Each byte element from input vector pair 'in2' and 'in3' are
+ average rounded (a + b + 1)/2 and stored in 'tmp1_m'
+ Each byte element from input vector pair 'in4' and 'in5' are
+ average rounded (a + b + 1)/2 and stored in 'tmp2_m'
+ Each byte element from input vector pair 'in6' and 'in7' are
+ average rounded (a + b + 1)/2 and stored in 'tmp3_m'
+ The vector results from all 4 vectors are stored in
+ destination memory as 16x4 byte block
+*/
+#define AVER_DST_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ pdst, stride) \
+{ \
+ v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
+ v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
+ \
+ LD_UB4(pdst, stride, dst0_m, dst1_m, dst2_m, dst3_m); \
+ AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
+ tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
+ AVER_ST16x4_UB(dst0_m, tmp0_m, dst1_m, tmp1_m, \
+ dst2_m, tmp2_m, dst3_m, tmp3_m, pdst, stride); \
+}
+
/* Description : Add block 4x4
Arguments : Inputs - in0, in1, in2, in3, pdst, stride
Outputs -
@@ -2538,4 +2940,20 @@
tmp_m = __msa_pckev_b((v16i8) in1, (v16i8) in0); \
ST_SB(tmp_m, (pdst)); \
}
+
+/* Description : Horizontal 2 tap filter kernel code
+ Arguments : Inputs - in0, in1, mask, coeff, shift
+*/
+#define HORIZ_2TAP_FILT_UH(in0, in1, mask, coeff, shift) \
+( { \
+ v16i8 tmp0_m; \
+ v8u16 tmp1_m; \
+ \
+ tmp0_m = __msa_vshf_b((v16i8) mask, (v16i8) in1, (v16i8) in0); \
+ tmp1_m = __msa_dotp_u_h((v16u8) tmp0_m, (v16u8) coeff); \
+ tmp1_m = (v8u16) __msa_srari_h((v8i16) tmp1_m, shift); \
+ tmp1_m = __msa_sat_u_h(tmp1_m, shift); \
+ \
+ tmp1_m; \
+} )
#endif /* AVUTIL_MIPS_GENERIC_MACROS_MSA_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/old_pix_fmts.h b/chromium/third_party/ffmpeg/libavutil/old_pix_fmts.h
deleted file mode 100644
index cd1ed7c19fd..00000000000
--- a/chromium/third_party/ffmpeg/libavutil/old_pix_fmts.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * copyright (c) 2006-2012 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_OLD_PIX_FMTS_H
-#define AVUTIL_OLD_PIX_FMTS_H
-
-/*
- * This header exists to prevent new pixel formats from being accidentally added
- * to the deprecated list.
- * Do not include it directly. It will be removed on next major bump
- *
- * Do not add new items to this list. Use the AVPixelFormat enum instead.
- */
- PIX_FMT_NONE = AV_PIX_FMT_NONE,
- PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
- PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
- PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-#if FF_API_XVMC
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
- PIX_FMT_XVMC_MPEG2_IDCT,
-#endif /* FF_API_XVMC */
- PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
- PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
-
- PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
- PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
- PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
- PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
- PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-#if FF_API_VDPAU
- PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
- PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
- PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
- PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
- PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
- PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
- PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
- PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
- PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
- PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
- PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
- PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
- PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
- PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
- PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-#if FF_API_VDPAU
- PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
- PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
- PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
- PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
- PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
- PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
- PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
- PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
- PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-
- //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
- //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
- //is better
- PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
-
-#ifdef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
-#endif
- PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
- PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
- PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
- PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
- PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
- PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
- PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
-
-#ifndef AV_PIX_FMT_ABI_GIT_MASTER
- PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
-#endif
- PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
- PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
- PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
- PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
- PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
- PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
-
- PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
- PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
- PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
- PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
- PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
- PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
- PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
- PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
- PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
-
- 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
-#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/opt.c b/chromium/third_party/ffmpeg/libavutil/opt.c
index 62db1b50b7b..ce80de05967 100644
--- a/chromium/third_party/ffmpeg/libavutil/opt.c
+++ b/chromium/third_party/ffmpeg/libavutil/opt.c
@@ -41,14 +41,7 @@
#include <float.h>
-#if FF_API_OLD_AVOPTIONS
-const AVOption *av_next_option(FF_CONST_AVUTIL55 void *obj, const AVOption *last)
-{
- return av_opt_next(obj, last);
-}
-#endif
-
-const AVOption *av_opt_next(FF_CONST_AVUTIL55 void *obj, const AVOption *last)
+const AVOption *av_opt_next(const void *obj, const AVOption *last)
{
const AVClass *class;
if (!obj)
@@ -67,6 +60,7 @@ static int read_number(const AVOption *o, const void *dst, double *num, int *den
case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
case AV_OPT_TYPE_PIXEL_FMT: *intnum = *(enum AVPixelFormat *)dst;return 0;
case AV_OPT_TYPE_SAMPLE_FMT:*intnum = *(enum AVSampleFormat*)dst;return 0;
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
case AV_OPT_TYPE_CHANNEL_LAYOUT:
case AV_OPT_TYPE_DURATION:
@@ -103,6 +97,7 @@ static int write_number(void *obj, const AVOption *o, void *dst, double num, int
switch (o->type) {
case AV_OPT_TYPE_PIXEL_FMT: *(enum AVPixelFormat *)dst = llrint(num/den) * intnum; break;
case AV_OPT_TYPE_SAMPLE_FMT:*(enum AVSampleFormat*)dst = llrint(num/den) * intnum; break;
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_FLAGS:
case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
case AV_OPT_TYPE_DURATION:
@@ -304,6 +299,44 @@ static int set_string_color(void *obj, const AVOption *o, const char *val, uint8
return 0;
}
+static const char *get_bool_name(int val)
+{
+ if (val < 0)
+ return "auto";
+ return val ? "true" : "false";
+}
+
+static int set_string_bool(void *obj, const AVOption *o, const char *val, int *dst)
+{
+ int n;
+
+ if (!val)
+ return 0;
+
+ if (!strcmp(val, "auto")) {
+ n = -1;
+ } else if (av_match_name(val, "true,y,yes,enable,enabled,on")) {
+ n = 1;
+ } else if (av_match_name(val, "false,n,no,disable,disabled,off")) {
+ n = 0;
+ } else {
+ char *end = NULL;
+ n = strtol(val, &end, 10);
+ if (val + strlen(val) != end)
+ goto fail;
+ }
+
+ if (n < o->min || n > o->max)
+ goto fail;
+
+ *dst = n;
+ return 0;
+
+fail:
+ av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as boolean\n", val);
+ return AVERROR(EINVAL);
+}
+
static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst,
int fmt_nb, int ((*get_fmt)(const char *)), const char *desc)
{
@@ -356,16 +389,6 @@ static int set_string_sample_fmt(void *obj, const AVOption *o, const char *val,
AV_SAMPLE_FMT_NB, av_get_sample_fmt, "sample format");
}
-#if FF_API_OLD_AVOPTIONS
-int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)
-{
- const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
- if (o_out)
- *o_out = o;
- return av_opt_set(obj, name, val, 0);
-}
-#endif
-
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
{
int ret = 0;
@@ -377,7 +400,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
o->type != AV_OPT_TYPE_PIXEL_FMT && o->type != AV_OPT_TYPE_SAMPLE_FMT &&
o->type != AV_OPT_TYPE_IMAGE_SIZE && o->type != AV_OPT_TYPE_VIDEO_RATE &&
o->type != AV_OPT_TYPE_DURATION && o->type != AV_OPT_TYPE_COLOR &&
- o->type != AV_OPT_TYPE_CHANNEL_LAYOUT))
+ o->type != AV_OPT_TYPE_CHANNEL_LAYOUT && o->type != AV_OPT_TYPE_BOOL))
return AVERROR(EINVAL);
if (o->flags & AV_OPT_FLAG_READONLY)
@@ -385,6 +408,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
dst = ((uint8_t*)target_obj) + o->offset;
switch (o->type) {
+ case AV_OPT_TYPE_BOOL: return set_string_bool(obj, o, val, dst);
case AV_OPT_TYPE_STRING: return set_string(obj, o, val, dst);
case AV_OPT_TYPE_BINARY: return set_string_binary(obj, o, val, dst);
case AV_OPT_TYPE_FLAGS:
@@ -412,11 +436,7 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
if (!val || !strcmp(val, "none")) {
*(int64_t *)dst = 0;
} else {
-#if FF_API_GET_CHANNEL_LAYOUT_COMPAT
- int64_t cl = ff_get_channel_layout(val, 0);
-#else
int64_t cl = av_get_channel_layout(val);
-#endif
if (!cl) {
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as channel layout\n", val);
ret = AVERROR(EINVAL);
@@ -462,32 +482,6 @@ static int set_number(void *obj, const char *name, double num, int den, int64_t
return write_number(obj, o, dst, num, den, intnum);
}
-#if FF_API_OLD_AVOPTIONS
-const AVOption *av_set_double(void *obj, const char *name, double n)
-{
- const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
- if (set_number(obj, name, n, 1, 1, 0) < 0)
- return NULL;
- return o;
-}
-
-const AVOption *av_set_q(void *obj, const char *name, AVRational n)
-{
- const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
- if (set_number(obj, name, n.num, n.den, 1, 0) < 0)
- return NULL;
- return o;
-}
-
-const AVOption *av_set_int(void *obj, const char *name, int64_t n)
-{
- const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
- if (set_number(obj, name, 1, 1, n, 0) < 0)
- return NULL;
- return o;
-}
-#endif
-
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
{
return set_number(obj, name, 1, 1, val, search_flags);
@@ -627,47 +621,6 @@ int av_opt_set_channel_layout(void *obj, const char *name, int64_t cl, int searc
return 0;
}
-#if FF_API_OLD_AVOPTIONS
-/**
- *
- * @param buf a buffer which is used for returning non string values as strings, can be NULL
- * @param buf_len allocated length in bytes of buf
- */
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)
-{
- const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN);
- void *dst;
- uint8_t *bin;
- int len, i;
- if (!o)
- return NULL;
- if (o->type != AV_OPT_TYPE_STRING && (!buf || !buf_len))
- return NULL;
-
- dst= ((uint8_t*)obj) + o->offset;
- if (o_out) *o_out= o;
-
- switch (o->type) {
- case AV_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
- case AV_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break;
- case AV_OPT_TYPE_INT64: snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break;
- case AV_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break;
- case AV_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break;
- case AV_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
- case AV_OPT_TYPE_CONST: snprintf(buf, buf_len, "%f" , o->default_val.dbl);break;
- case AV_OPT_TYPE_STRING: return *(void**)dst;
- case AV_OPT_TYPE_BINARY:
- len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
- if (len >= (buf_len + 1)/2) return NULL;
- bin = *(uint8_t**)dst;
- for (i = 0; i < len; i++) snprintf(buf + i*2, 3, "%02X", bin[i]);
- break;
- default: return NULL;
- }
- return buf;
-}
-#endif
-
int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, int search_flags)
{
void *target_obj;
@@ -701,6 +654,9 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
buf[0] = 0;
switch (o->type) {
+ case AV_OPT_TYPE_BOOL:
+ ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(get_bool_name(*(int *)dst), "invalid"));
+ break;
case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break;
case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break;
case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break;
@@ -782,44 +738,6 @@ error:
return -1;
}
-#if FF_API_OLD_AVOPTIONS
-double av_get_double(void *obj, const char *name, const AVOption **o_out)
-{
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
- return NAN;
- return num*intnum/den;
-}
-
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
-{
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
- return (AVRational){0, 0};
- if (num == 1.0 && (int)intnum == intnum)
- return (AVRational){intnum, den};
- else
- return av_d2q(num*intnum/den, 1<<24);
-}
-
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out)
-{
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
- return -1;
- return num*intnum/den;
-}
-#endif
-
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
{
int64_t intnum = 1;
@@ -1076,6 +994,9 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
case AV_OPT_TYPE_CHANNEL_LAYOUT:
av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "<channel_layout>");
break;
+ case AV_OPT_TYPE_BOOL:
+ av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "<boolean>");
+ break;
case AV_OPT_TYPE_CONST:
default:
av_log(av_log_obj, AV_LOG_INFO, "%-12s ", "");
@@ -1121,6 +1042,9 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
!opt->default_val.str)) {
av_log(av_log_obj, AV_LOG_INFO, " (default ");
switch (opt->type) {
+ case AV_OPT_TYPE_BOOL:
+ av_log(av_log_obj, AV_LOG_INFO, "%s", (char *)av_x_if_null(get_bool_name(opt->default_val.i64), "invalid"));
+ break;
case AV_OPT_TYPE_FLAGS:
av_log(av_log_obj, AV_LOG_INFO, "%"PRIX64, opt->default_val.i64);
break;
@@ -1177,20 +1101,17 @@ int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
void av_opt_set_defaults(void *s)
{
-#if FF_API_OLD_AVOPTIONS
av_opt_set_defaults2(s, 0, 0);
}
void av_opt_set_defaults2(void *s, int mask, int flags)
{
-#endif
const AVOption *opt = NULL;
while ((opt = av_opt_next(s, opt))) {
void *dst = ((uint8_t*)s) + opt->offset;
-#if FF_API_OLD_AVOPTIONS
+
if ((opt->flags & mask) != flags)
continue;
-#endif
if (opt->flags & AV_OPT_FLAG_READONLY)
continue;
@@ -1199,13 +1120,16 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
case AV_OPT_TYPE_CONST:
/* Nothing to be done here */
break;
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_FLAGS:
case AV_OPT_TYPE_INT:
case AV_OPT_TYPE_INT64:
case AV_OPT_TYPE_DURATION:
case AV_OPT_TYPE_CHANNEL_LAYOUT:
+ case AV_OPT_TYPE_PIXEL_FMT:
+ case AV_OPT_TYPE_SAMPLE_FMT:
write_number(s, opt, dst, 1, 1, opt->default_val.i64);
- break;
+ break;
case AV_OPT_TYPE_DOUBLE:
case AV_OPT_TYPE_FLOAT: {
double val;
@@ -1231,12 +1155,6 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
case AV_OPT_TYPE_VIDEO_RATE:
set_string_video_rate(s, opt, opt->default_val.str, dst);
break;
- case AV_OPT_TYPE_PIXEL_FMT:
- write_number(s, opt, dst, 1, 1, opt->default_val.i64);
- break;
- case AV_OPT_TYPE_SAMPLE_FMT:
- write_number(s, opt, dst, 1, 1, opt->default_val.i64);
- break;
case AV_OPT_TYPE_BINARY:
set_string_binary(s, opt, opt->default_val.str, dst);
break;
@@ -1557,6 +1475,7 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
static int opt_size(enum AVOptionType type)
{
switch(type) {
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_INT:
case AV_OPT_TYPE_FLAGS: return sizeof(int);
case AV_OPT_TYPE_DURATION:
@@ -1576,7 +1495,7 @@ static int opt_size(enum AVOptionType type)
return 0;
}
-int av_opt_copy(void *dst, FF_CONST_AVUTIL55 void *src)
+int av_opt_copy(void *dst, const void *src)
{
const AVOption *o = NULL;
const AVClass *c;
@@ -1674,6 +1593,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
range->value_max = field->max;
switch (field->type) {
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_INT:
case AV_OPT_TYPE_INT64:
case AV_OPT_TYPE_PIXEL_FMT:
@@ -1757,6 +1677,7 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o)
switch (o->type) {
case AV_OPT_TYPE_CONST:
return 1;
+ case AV_OPT_TYPE_BOOL:
case AV_OPT_TYPE_FLAGS:
case AV_OPT_TYPE_PIXEL_FMT:
case AV_OPT_TYPE_SAMPLE_FMT:
@@ -1920,6 +1841,9 @@ typedef struct TestContext
float flt;
double dbl;
char *escape;
+ int bool1;
+ int bool2;
+ int bool3;
} TestContext;
#define OFFSET(x) offsetof(TestContext, x)
@@ -1951,6 +1875,9 @@ static const AVOption test_options[]= {
{"num64", "set num 64bit", OFFSET(num64), AV_OPT_TYPE_INT64, {.i64 = 1}, 0, 100, 1 },
{"flt", "set float", OFFSET(flt), AV_OPT_TYPE_FLOAT, {.dbl = 1.0/3}, 0, 100, 1},
{"dbl", "set double", OFFSET(dbl), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0/3}, 0, 100, 1 },
+{"bool1", "set boolean value", OFFSET(bool1), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 1 },
+{"bool2", "set boolean value", OFFSET(bool2), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, 1 },
+{"bool3", "set boolean value", OFFSET(bool3), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 1 },
{NULL},
};
@@ -2116,6 +2043,8 @@ int main(void)
"dbl=2.2",
"dbl=-1",
"dbl=101",
+ "bool1=true",
+ "bool2=auto",
};
test_ctx.class = &test_class;
diff --git a/chromium/third_party/ffmpeg/libavutil/opt.h b/chromium/third_party/ffmpeg/libavutil/opt.h
index 0bc0d309726..d6d8df36ff5 100644
--- a/chromium/third_party/ffmpeg/libavutil/opt.h
+++ b/chromium/third_party/ffmpeg/libavutil/opt.h
@@ -236,17 +236,7 @@ enum AVOptionType{
AV_OPT_TYPE_DURATION = MKBETAG('D','U','R',' '),
AV_OPT_TYPE_COLOR = MKBETAG('C','O','L','R'),
AV_OPT_TYPE_CHANNEL_LAYOUT = MKBETAG('C','H','L','A'),
-#if FF_API_OLD_AVOPTIONS
- FF_OPT_TYPE_FLAGS = 0,
- FF_OPT_TYPE_INT,
- FF_OPT_TYPE_INT64,
- FF_OPT_TYPE_DOUBLE,
- FF_OPT_TYPE_FLOAT,
- FF_OPT_TYPE_STRING,
- FF_OPT_TYPE_RATIONAL,
- FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
- FF_OPT_TYPE_CONST=128,
-#endif
+ AV_OPT_TYPE_BOOL = MKBETAG('B','O','O','L'),
};
/**
@@ -378,48 +368,6 @@ typedef struct AVOptionRanges {
int nb_components;
} AVOptionRanges;
-
-#if FF_API_OLD_AVOPTIONS
-/**
- * Set the field of obj with the given name to value.
- *
- * @param[in] obj A struct whose first element is a pointer to an
- * AVClass.
- * @param[in] name the name of the field to set
- * @param[in] val The value to set. If the field is not of a string
- * type, then the given string is parsed.
- * SI postfixes and some named scalars are supported.
- * If the field is of a numeric type, it has to be a numeric or named
- * scalar. Behavior with more than one scalar and +- infix operators
- * is undefined.
- * If the field is of a flags type, it has to be a sequence of numeric
- * scalars or named flags separated by '+' or '-'. Prefixing a flag
- * with '+' causes it to be set without affecting the other flags;
- * similarly, '-' unsets a flag.
- * @param[out] o_out if non-NULL put here a pointer to the AVOption
- * found
- * @param alloc this parameter is currently ignored
- * @return 0 if the value has been set, or an AVERROR code in case of
- * error:
- * AVERROR_OPTION_NOT_FOUND if no matching option exists
- * AVERROR(ERANGE) if the value is out of range
- * AVERROR(EINVAL) if the value is not valid
- * @deprecated use av_opt_set()
- */
-attribute_deprecated
-int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
-
-attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
-attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
-attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
-
-double av_get_double(void *obj, const char *name, const AVOption **o_out);
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
-attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
-attribute_deprecated const AVOption *av_next_option(FF_CONST_AVUTIL55 void *obj, const AVOption *last);
-#endif
-
/**
* Show the obj options.
*
@@ -438,10 +386,16 @@ int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
*/
void av_opt_set_defaults(void *s);
-#if FF_API_OLD_AVOPTIONS
-attribute_deprecated
+/**
+ * Set the values of all AVOption fields to their default values. Only these
+ * AVOption fields for which (opt->flags & mask) == flags will have their
+ * default applied to s.
+ *
+ * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
+ * @param mask combination of AV_OPT_FLAG_*
+ * @param flags combination of AV_OPT_FLAG_*
+ */
void av_opt_set_defaults2(void *s, int mask, int flags);
-#endif
/**
* Parse the key/value pairs list in opts. For each key/value pair
@@ -674,7 +628,7 @@ const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
* or NULL
* @return next AVOption or NULL
*/
-const AVOption *av_opt_next(FF_CONST_AVUTIL55 void *obj, const AVOption *prev);
+const AVOption *av_opt_next(const void *obj, const AVOption *prev);
/**
* Iterate over AVOptions-enabled children of obj.
@@ -826,7 +780,7 @@ int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags
* @param src Object to copy into
* @return 0 on success, negative on error
*/
-int av_opt_copy(void *dest, FF_CONST_AVUTIL55 void *src);
+int av_opt_copy(void *dest, const void *src);
/**
* Get a default list of allowed ranges for the given option.
diff --git a/chromium/third_party/ffmpeg/libavutil/parseutils.c b/chromium/third_party/ffmpeg/libavutil/parseutils.c
index 98858394ea0..9fb8d0adb78 100644
--- a/chromium/third_party/ffmpeg/libavutil/parseutils.c
+++ b/chromium/third_party/ffmpeg/libavutil/parseutils.c
@@ -111,9 +111,11 @@ static const VideoSizeAbbr video_size_abbrs[] = {
{ "hd720", 1280, 720 },
{ "hd1080", 1920,1080 },
{ "2k", 2048,1080 }, /* Digital Cinema System Specification */
+ { "2kdci", 2048,1080 },
{ "2kflat", 1998,1080 },
{ "2kscope", 2048, 858 },
{ "4k", 4096,2160 }, /* Digital Cinema System Specification */
+ { "4kdci", 4096,2160 },
{ "4kflat", 3996,2160 },
{ "4kscope", 4096,1716 },
{ "nhd", 640,360 },
@@ -122,6 +124,8 @@ static const VideoSizeAbbr video_size_abbrs[] = {
{ "fwqvga", 432,240 },
{ "hvga", 480,320 },
{ "qhd", 960,540 },
+ { "uhd2160", 3840,2160 },
+ { "uhd4320", 7680,4320 },
};
static const VideoRateAbbr video_rate_abbrs[]= {
diff --git a/chromium/third_party/ffmpeg/libavutil/pixdesc.c b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
index 32dc4b80ab4..72d0470ae13 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixdesc.c
+++ b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
@@ -39,14 +39,14 @@ void av_read_image_line(uint16_t *dst,
{
AVComponentDescriptor comp = desc->comp[c];
int plane = comp.plane;
- int depth = comp.depth_minus1 + 1;
+ int depth = comp.depth;
int mask = (1 << depth) - 1;
int shift = comp.shift;
- int step = comp.step_minus1 + 1;
+ int step = comp.step;
int flags = desc->flags;
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
- int skip = x * step + comp.offset_plus1 - 1;
+ int skip = x * step + comp.offset;
const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
int shift = 8 - depth - (skip & 7);
@@ -61,7 +61,7 @@ void av_read_image_line(uint16_t *dst,
}
} else {
const uint8_t *p = data[plane] + y * linesize[plane] +
- x * step + comp.offset_plus1 - 1;
+ x * step + comp.offset;
int is_8bit = shift + depth <= 8;
if (is_8bit)
@@ -86,12 +86,12 @@ void av_write_image_line(const uint16_t *src,
{
AVComponentDescriptor comp = desc->comp[c];
int plane = comp.plane;
- int depth = comp.depth_minus1 + 1;
- int step = comp.step_minus1 + 1;
+ int depth = comp.depth;
+ int step = comp.step;
int flags = desc->flags;
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
- int skip = x * step + comp.offset_plus1 - 1;
+ int skip = x * step + comp.offset;
uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
int shift = 8 - depth - (skip & 7);
@@ -104,7 +104,7 @@ void av_write_image_line(const uint16_t *src,
} else {
int shift = comp.shift;
uint8_t *p = data[plane] + y * linesize[plane] +
- x * step + comp.offset_plus1 - 1;
+ x * step + comp.offset;
if (shift + depth <= 8) {
p += !!(flags & AV_PIX_FMT_FLAG_BE);
@@ -127,19 +127,19 @@ void av_write_image_line(const uint16_t *src,
}
}
-#if !FF_API_PIX_FMT_DESC
-static
+#if FF_API_PLUS1_MINUS1
+FF_DISABLE_DEPRECATION_WARNINGS
#endif
-const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
+static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUV420P] = {
.name = "yuv420p",
.nb_components = 3,
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -149,9 +149,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 7 }, /* Y */
- { 0, 3, 2, 0, 7 }, /* U */
- { 0, 3, 4, 0, 7 }, /* V */
+ { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* U */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */
},
},
[AV_PIX_FMT_YVYU422] = {
@@ -160,9 +160,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 7 }, /* Y */
- { 0, 3, 2, 0, 7 }, /* V */
- { 0, 3, 4, 0, 7 }, /* U */
+ { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* U */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
},
},
[AV_PIX_FMT_RGB24] = {
@@ -171,9 +171,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 2, 1, 0, 7 }, /* R */
- { 0, 2, 2, 0, 7 }, /* G */
- { 0, 2, 3, 0, 7 }, /* B */
+ { 0, 3, 0, 0, 8, 2, 7, 1 }, /* R */
+ { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
+ { 0, 3, 2, 0, 8, 2, 7, 3 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -183,9 +183,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 2, 3, 0, 7 }, /* R */
- { 0, 2, 2, 0, 7 }, /* G */
- { 0, 2, 1, 0, 7 }, /* B */
+ { 0, 3, 2, 0, 8, 2, 7, 3 }, /* R */
+ { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
+ { 0, 3, 0, 0, 8, 2, 7, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -195,9 +195,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -207,9 +207,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -219,9 +219,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 2,
.log2_chroma_h = 2,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -231,9 +231,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 2,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -243,9 +243,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 2,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -255,7 +255,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
},
.flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
.alias = "gray8,y8",
@@ -266,7 +266,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 0 }, /* Y */
+ { 0, 1, 0, 0, 1, 0, 0, 1 }, /* Y */
},
.flags = AV_PIX_FMT_FLAG_BITSTREAM,
},
@@ -276,7 +276,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 7, 0 }, /* Y */
+ { 0, 1, 0, 7, 1, 0, 0, 1 }, /* Y */
},
.flags = AV_PIX_FMT_FLAG_BITSTREAM,
},
@@ -286,7 +286,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 },
+ { 0, 1, 0, 0, 8, 0, 7, 1 },
},
.flags = AV_PIX_FMT_FLAG_PAL,
},
@@ -296,9 +296,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -308,9 +308,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -320,9 +320,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -348,9 +348,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 2, 0, 7 }, /* Y */
- { 0, 3, 1, 0, 7 }, /* U */
- { 0, 3, 3, 0, 7 }, /* V */
+ { 0, 2, 1, 0, 8, 1, 7, 2 }, /* Y */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* U */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* V */
},
},
[AV_PIX_FMT_UYYVYY411] = {
@@ -359,9 +359,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 2,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 2, 0, 7 }, /* Y */
- { 0, 5, 1, 0, 7 }, /* U */
- { 0, 5, 4, 0, 7 }, /* V */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */
+ { 0, 6, 0, 0, 8, 5, 7, 1 }, /* U */
+ { 0, 6, 3, 0, 8, 5, 7, 4 }, /* V */
},
},
[AV_PIX_FMT_BGR8] = {
@@ -370,9 +370,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 2 }, /* R */
- { 0, 0, 1, 3, 2 }, /* G */
- { 0, 0, 1, 6, 1 }, /* B */
+ { 0, 1, 0, 0, 3, 0, 2, 1 }, /* R */
+ { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
+ { 0, 1, 0, 6, 2, 0, 1, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
},
@@ -382,9 +382,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 4, 0, 0 }, /* R */
- { 0, 3, 2, 0, 1 }, /* G */
- { 0, 3, 1, 0, 0 }, /* B */
+ { 0, 4, 3, 0, 1, 3, 0, 4 }, /* R */
+ { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
+ { 0, 4, 0, 0, 1, 3, 0, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
},
@@ -394,9 +394,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 0 }, /* R */
- { 0, 0, 1, 1, 1 }, /* G */
- { 0, 0, 1, 3, 0 }, /* B */
+ { 0, 1, 0, 0, 1, 0, 0, 1 }, /* R */
+ { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
+ { 0, 1, 0, 3, 1, 0, 0, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
},
@@ -406,9 +406,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 6, 1 }, /* R */
- { 0, 0, 1, 3, 2 }, /* G */
- { 0, 0, 1, 0, 2 }, /* B */
+ { 0, 1, 0, 6, 2, 0, 1, 1 }, /* R */
+ { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
+ { 0, 1, 0, 0, 3, 0, 2, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
},
@@ -418,9 +418,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 1, 0, 0 }, /* R */
- { 0, 3, 2, 0, 1 }, /* G */
- { 0, 3, 4, 0, 0 }, /* B */
+ { 0, 4, 0, 0, 1, 3, 0, 1 }, /* R */
+ { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
+ { 0, 4, 3, 0, 1, 3, 0, 4 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
},
@@ -430,9 +430,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 3, 0 }, /* R */
- { 0, 0, 1, 1, 1 }, /* G */
- { 0, 0, 1, 0, 0 }, /* B */
+ { 0, 1, 0, 3, 1, 0, 0, 1 }, /* R */
+ { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
+ { 0, 1, 0, 0, 1, 0, 0, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
},
@@ -442,9 +442,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 1, 1, 0, 7 }, /* U */
- { 1, 1, 2, 0, 7 }, /* V */
+ { 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,
},
@@ -454,9 +454,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 1, 2, 0, 7 }, /* U */
- { 1, 1, 1, 0, 7 }, /* V */
+ { 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,
},
@@ -466,10 +466,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 2, 0, 7 }, /* R */
- { 0, 3, 3, 0, 7 }, /* G */
- { 0, 3, 4, 0, 7 }, /* B */
- { 0, 3, 1, 0, 7 }, /* A */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -479,10 +479,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 1, 0, 7 }, /* R */
- { 0, 3, 2, 0, 7 }, /* G */
- { 0, 3, 3, 0, 7 }, /* B */
- { 0, 3, 4, 0, 7 }, /* A */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -492,10 +492,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 4, 0, 7 }, /* R */
- { 0, 3, 3, 0, 7 }, /* G */
- { 0, 3, 2, 0, 7 }, /* B */
- { 0, 3, 1, 0, 7 }, /* A */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -505,10 +505,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 3, 3, 0, 7 }, /* R */
- { 0, 3, 2, 0, 7 }, /* G */
- { 0, 3, 1, 0, 7 }, /* B */
- { 0, 3, 4, 0, 7 }, /* A */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -518,9 +518,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
- { 0, 3, 2, 0, 7 }, /* R */
- { 0, 3, 3, 0, 7 }, /* G */
- { 0, 3, 4, 0, 7 }, /* B */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -530,9 +530,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
- { 0, 3, 1, 0, 7 }, /* R */
- { 0, 3, 2, 0, 7 }, /* G */
- { 0, 3, 3, 0, 7 }, /* B */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -542,9 +542,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
- { 0, 3, 4, 0, 7 }, /* R */
- { 0, 3, 3, 0, 7 }, /* G */
- { 0, 3, 2, 0, 7 }, /* B */
+ { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -554,9 +554,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0,
.log2_chroma_h= 0,
.comp = {
- { 0, 3, 3, 0, 7 }, /* R */
- { 0, 3, 2, 0, 7 }, /* G */
- { 0, 3, 1, 0, 7 }, /* B */
+ { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
+ { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
+ { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -566,7 +566,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
},
.flags = AV_PIX_FMT_FLAG_BE,
.alias = "y16be",
@@ -577,7 +577,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
},
.alias = "y16le",
},
@@ -587,9 +587,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -599,9 +599,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -611,9 +611,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -623,9 +623,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -635,9 +635,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -647,9 +647,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -659,10 +659,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
- { 3, 0, 1, 0, 7 }, /* A */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
+ { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -672,10 +672,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
- { 3, 0, 1, 0, 7 }, /* A */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
+ { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -685,10 +685,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 0, 1, 0, 7 }, /* U */
- { 2, 0, 1, 0, 7 }, /* V */
- { 3, 0, 1, 0, 7 }, /* A */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
+ { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -698,10 +698,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -711,10 +711,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -724,10 +724,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -737,10 +737,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -750,10 +750,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -763,10 +763,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
- { 3, 1, 1, 0, 8 }, /* A */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
+ { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -776,10 +776,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -789,10 +789,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -802,10 +802,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -815,10 +815,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -828,10 +828,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -841,10 +841,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
- { 3, 1, 1, 0, 9 }, /* A */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
+ { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -854,10 +854,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -867,10 +867,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -880,10 +880,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -893,10 +893,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -906,10 +906,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -919,10 +919,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -970,9 +970,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 1, 0, 15 }, /* R */
- { 0, 5, 3, 0, 15 }, /* G */
- { 0, 5, 5, 0, 15 }, /* B */
+ { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
+ { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
+ { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
},
@@ -982,9 +982,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 1, 0, 15 }, /* R */
- { 0, 5, 3, 0, 15 }, /* G */
- { 0, 5, 5, 0, 15 }, /* B */
+ { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
+ { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
+ { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -994,10 +994,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 7, 1, 0, 15 }, /* R */
- { 0, 7, 3, 0, 15 }, /* G */
- { 0, 7, 5, 0, 15 }, /* B */
- { 0, 7, 7, 0, 15 }, /* A */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -1007,10 +1007,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 7, 1, 0, 15 }, /* R */
- { 0, 7, 3, 0, 15 }, /* G */
- { 0, 7, 5, 0, 15 }, /* B */
- { 0, 7, 7, 0, 15 }, /* A */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -1020,9 +1020,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 0, 3, 4 }, /* R */
- { 0, 1, 1, 5, 5 }, /* G */
- { 0, 1, 1, 0, 4 }, /* B */
+ { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
+ { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1032,9 +1032,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 2, 3, 4 }, /* R */
- { 0, 1, 1, 5, 5 }, /* G */
- { 0, 1, 1, 0, 4 }, /* B */
+ { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
+ { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1044,9 +1044,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 0, 2, 4 }, /* R */
- { 0, 1, 1, 5, 4 }, /* G */
- { 0, 1, 1, 0, 4 }, /* B */
+ { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
+ { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1056,9 +1056,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 2, 2, 4 }, /* R */
- { 0, 1, 1, 5, 4 }, /* G */
- { 0, 1, 1, 0, 4 }, /* B */
+ { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
+ { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1068,9 +1068,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 0, 0, 3 }, /* R */
- { 0, 1, 1, 4, 3 }, /* G */
- { 0, 1, 1, 0, 3 }, /* B */
+ { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
+ { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
+ { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1080,9 +1080,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 2, 0, 3 }, /* R */
- { 0, 1, 1, 4, 3 }, /* G */
- { 0, 1, 1, 0, 3 }, /* B */
+ { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
+ { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
+ { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1092,9 +1092,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 5, 0, 15 }, /* R */
- { 0, 5, 3, 0, 15 }, /* G */
- { 0, 5, 1, 0, 15 }, /* B */
+ { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
+ { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
+ { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1104,9 +1104,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 5, 0, 15 }, /* R */
- { 0, 5, 3, 0, 15 }, /* G */
- { 0, 5, 1, 0, 15 }, /* B */
+ { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
+ { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
+ { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1116,10 +1116,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 7, 5, 0, 15 }, /* R */
- { 0, 7, 3, 0, 15 }, /* G */
- { 0, 7, 1, 0, 15 }, /* B */
- { 0, 7, 7, 0, 15 }, /* A */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -1129,10 +1129,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 7, 5, 0, 15 }, /* R */
- { 0, 7, 3, 0, 15 }, /* G */
- { 0, 7, 1, 0, 15 }, /* B */
- { 0, 7, 7, 0, 15 }, /* A */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
},
@@ -1142,9 +1142,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 4 }, /* R */
- { 0, 1, 1, 5, 5 }, /* G */
- { 0, 1, 0, 3, 4 }, /* B */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
+ { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
+ { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1154,9 +1154,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 4 }, /* R */
- { 0, 1, 1, 5, 5 }, /* G */
- { 0, 1, 2, 3, 4 }, /* B */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
+ { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
+ { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1166,9 +1166,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 4 }, /* R */
- { 0, 1, 1, 5, 4 }, /* G */
- { 0, 1, 0, 2, 4 }, /* B */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
+ { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
+ { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1178,9 +1178,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 4 }, /* R */
- { 0, 1, 1, 5, 4 }, /* G */
- { 0, 1, 2, 2, 4 }, /* B */
+ { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
+ { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
+ { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
@@ -1190,9 +1190,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 3 }, /* R */
- { 0, 1, 1, 4, 3 }, /* G */
- { 0, 1, 0, 0, 3 }, /* B */
+ { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
+ { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
+ { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
},
@@ -1202,12 +1202,13 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 3 }, /* R */
- { 0, 1, 1, 4, 3 }, /* G */
- { 0, 1, 2, 0, 3 }, /* B */
+ { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
+ { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
+ { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_RGB,
},
+#if FF_API_VAAPI
[AV_PIX_FMT_VAAPI_MOCO] = {
.name = "vaapi_moco",
.log2_chroma_w = 1,
@@ -1226,15 +1227,23 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_h = 1,
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
+#else
+ [AV_PIX_FMT_VAAPI] = {
+ .name = "vaapi",
+ .log2_chroma_w = 1,
+ .log2_chroma_h = 1,
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
+#endif
[AV_PIX_FMT_YUV420P9LE] = {
.name = "yuv420p9le",
.nb_components = 3,
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1244,9 +1253,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1256,9 +1265,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1268,9 +1277,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1280,9 +1289,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1292,9 +1301,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1304,9 +1313,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1316,9 +1325,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1328,9 +1337,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1340,9 +1349,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1352,9 +1361,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1364,9 +1373,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1376,9 +1385,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1388,9 +1397,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1400,9 +1409,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1412,9 +1421,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1424,9 +1433,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1436,9 +1445,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1448,9 +1457,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1460,9 +1469,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1472,9 +1481,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1484,9 +1493,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 15 }, /* Y */
- { 1, 1, 1, 0, 15 }, /* U */
- { 2, 1, 1, 0, 15 }, /* V */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1496,9 +1505,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1508,9 +1517,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 1, 1, 0, 9 }, /* U */
- { 2, 1, 1, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1520,9 +1529,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1532,9 +1541,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 8 }, /* Y */
- { 1, 1, 1, 0, 8 }, /* U */
- { 2, 1, 1, 0, 8 }, /* V */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1544,9 +1553,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1556,9 +1565,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 11 }, /* Y */
- { 1, 1, 1, 0, 11 }, /* U */
- { 2, 1, 1, 0, 11 }, /* V */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1568,9 +1577,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1580,9 +1589,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 13 }, /* Y */
- { 1, 1, 1, 0, 13 }, /* U */
- { 2, 1, 1, 0, 13 }, /* V */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* Y */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* U */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1608,8 +1617,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "ya8",
.nb_components = 2,
.comp = {
- { 0, 1, 1, 0, 7 }, /* Y */
- { 0, 1, 2, 0, 7 }, /* A */
+ { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
+ { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_ALPHA,
.alias = "gray8a",
@@ -1618,8 +1627,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "ya16le",
.nb_components = 2,
.comp = {
- { 0, 3, 1, 0, 15 }, /* Y */
- { 0, 3, 3, 0, 15 }, /* A */
+ { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
+ { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_ALPHA,
},
@@ -1627,20 +1636,24 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "ya16be",
.nb_components = 2,
.comp = {
- { 0, 3, 1, 0, 15 }, /* Y */
- { 0, 3, 3, 0, 15 }, /* A */
+ { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
+ { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
},
+ [AV_PIX_FMT_VIDEOTOOLBOX] = {
+ .name = "videotoolbox_vld",
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
[AV_PIX_FMT_GBRP] = {
.name = "gbrp",
.nb_components = 3,
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 0, 1, 0, 7 }, /* R */
- { 0, 0, 1, 0, 7 }, /* G */
- { 1, 0, 1, 0, 7 }, /* B */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1650,9 +1663,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 8 }, /* R */
- { 0, 1, 1, 0, 8 }, /* G */
- { 1, 1, 1, 0, 8 }, /* B */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1662,9 +1675,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 8 }, /* R */
- { 0, 1, 1, 0, 8 }, /* G */
- { 1, 1, 1, 0, 8 }, /* B */
+ { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
+ { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
+ { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1674,9 +1687,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 9 }, /* R */
- { 0, 1, 1, 0, 9 }, /* G */
- { 1, 1, 1, 0, 9 }, /* B */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1686,9 +1699,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 9 }, /* R */
- { 0, 1, 1, 0, 9 }, /* G */
- { 1, 1, 1, 0, 9 }, /* B */
+ { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
+ { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1698,9 +1711,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 11 }, /* R */
- { 0, 1, 1, 0, 11 }, /* G */
- { 1, 1, 1, 0, 11 }, /* B */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1710,9 +1723,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 11 }, /* R */
- { 0, 1, 1, 0, 11 }, /* G */
- { 1, 1, 1, 0, 11 }, /* B */
+ { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
+ { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
+ { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1722,9 +1735,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 13 }, /* R */
- { 0, 1, 1, 0, 13 }, /* G */
- { 1, 1, 1, 0, 13 }, /* B */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1734,9 +1747,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 13 }, /* R */
- { 0, 1, 1, 0, 13 }, /* G */
- { 1, 1, 1, 0, 13 }, /* B */
+ { 2, 2, 0, 0, 14, 1, 13, 1 }, /* R */
+ { 0, 2, 0, 0, 14, 1, 13, 1 }, /* G */
+ { 1, 2, 0, 0, 14, 1, 13, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1746,9 +1759,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 15 }, /* R */
- { 0, 1, 1, 0, 15 }, /* G */
- { 1, 1, 1, 0, 15 }, /* B */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1758,9 +1771,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 15 }, /* R */
- { 0, 1, 1, 0, 15 }, /* G */
- { 1, 1, 1, 0, 15 }, /* B */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
},
@@ -1770,10 +1783,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 0, 1, 0, 7 }, /* R */
- { 0, 0, 1, 0, 7 }, /* G */
- { 1, 0, 1, 0, 7 }, /* B */
- { 3, 0, 1, 0, 7 }, /* A */
+ { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
+ { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
+ { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
AV_PIX_FMT_FLAG_ALPHA,
@@ -1784,10 +1797,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 15 }, /* R */
- { 0, 1, 1, 0, 15 }, /* G */
- { 1, 1, 1, 0, 15 }, /* B */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
AV_PIX_FMT_FLAG_ALPHA,
@@ -1798,10 +1811,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 2, 1, 1, 0, 15 }, /* R */
- { 0, 1, 1, 0, 15 }, /* G */
- { 1, 1, 1, 0, 15 }, /* B */
- { 3, 1, 1, 0, 15 }, /* A */
+ { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
+ { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
+ { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
+ { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
@@ -1818,9 +1831,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 1, 4, 11 }, /* X */
- { 0, 5, 3, 4, 11 }, /* Y */
- { 0, 5, 5, 4, 11 }, /* Z */
+ { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
+ { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
+ { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
},
/*.flags = -- not used*/
},
@@ -1830,9 +1843,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
- { 0, 5, 1, 4, 11 }, /* X */
- { 0, 5, 3, 4, 11 }, /* Y */
- { 0, 5, 5, 4, 11 }, /* Z */
+ { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
+ { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
+ { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
},
.flags = AV_PIX_FMT_FLAG_BE,
},
@@ -1842,9 +1855,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0, \
.log2_chroma_h= 0, \
.comp = { \
- {0,0,0,0,1}, \
- {0,0,0,0,3}, \
- {0,0,0,0,1}, \
+ {0,1,0,0,2,0,1,1},\
+ {0,1,0,0,4,0,3,1},\
+ {0,1,0,0,2,0,1,1},\
}, \
#define BAYER16_DESC_COMMON \
@@ -1852,9 +1865,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w= 0, \
.log2_chroma_h= 0, \
.comp = { \
- {0,1,0,0, 3}, \
- {0,1,0,0, 7}, \
- {0,1,0,0, 3}, \
+ {0,2,0,0,4,1,3,1},\
+ {0,2,0,0,8,1,7,1},\
+ {0,2,0,0,4,1,3,1},\
}, \
[AV_PIX_FMT_BAYER_BGGR8] = {
@@ -1923,9 +1936,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 0, 1, 0, 7 }, /* Y */
- { 1, 1, 1, 0, 7 }, /* U */
- { 1, 1, 2, 0, 7 }, /* V */
+ { 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,
},
@@ -1935,9 +1948,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 3, 1, 0, 9 }, /* U */
- { 1, 3, 3, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
+ { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
@@ -1947,9 +1960,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.log2_chroma_w = 1,
.log2_chroma_h = 0,
.comp = {
- { 0, 1, 1, 0, 9 }, /* Y */
- { 1, 3, 1, 0, 9 }, /* U */
- { 1, 3, 3, 0, 9 }, /* V */
+ { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
+ { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
+ { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
},
@@ -1965,7 +1978,36 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "mmal",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
+ [AV_PIX_FMT_AYUV64LE] = {
+ .name = "ayuv64le",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_ALPHA,
+ },
+ [AV_PIX_FMT_AYUV64BE] = {
+ .name = "ayuv64be",
+ .nb_components = 4,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 8, 2, 0, 16, 7, 15, 3 }, /* Y */
+ { 0, 8, 4, 0, 16, 7, 15, 5 }, /* U */
+ { 0, 8, 6, 0, 16, 7, 15, 7 }, /* V */
+ { 0, 8, 0, 0, 16, 7, 15, 1 }, /* A */
+ },
+ .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
+ },
};
+#if FF_API_PLUS1_MINUS1
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
static const char *color_range_names[AVCOL_RANGE_NB] = {
"unknown", "tv", "pc",
@@ -1974,13 +2016,14 @@ static const char *color_range_names[AVCOL_RANGE_NB] = {
static const char *color_primaries_names[AVCOL_PRI_NB] = {
"reserved", "bt709", "unknown", "reserved", "bt470m",
"bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
+ "smpte428-1",
};
static const char *color_transfer_names[AVCOL_TRC_NB] = {
"reserved", "bt709", "unknown", "reserved", "bt470m",
"bt470bg", "smpte170m", "smpte240m", "linear", "log100",
"log316", "iec61966-2-4", "bt1361e", "iec61966-2-1",
- "bt2020-10", "bt2020-20",
+ "bt2020-10", "bt2020-20", "smpte2084", "smpte428-1",
};
static const char *color_space_names[AVCOL_SPC_NB] = {
@@ -2046,7 +2089,7 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
for (c = 0; c < pixdesc->nb_components; c++) {
int s = c == 1 || c == 2 ? 0 : log2_pixels;
- bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
+ bits += pixdesc->comp[c].depth << s;
}
return bits >> log2_pixels;
@@ -2061,7 +2104,7 @@ int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
for (c = 0; c < pixdesc->nb_components; c++) {
const AVComponentDescriptor *comp = &pixdesc->comp[c];
int s = c == 1 || c == 2 ? 0 : log2_pixels;
- steps[comp->plane] = (comp->step_minus1 + 1) << s;
+ steps[comp->plane] = comp->step << s;
}
for (c = 0; c < 4; c++)
bits += steps[c];
@@ -2165,19 +2208,19 @@ void ff_check_pixfmt_descriptors(void){
for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
const AVComponentDescriptor *c = &d->comp[j];
if(j>=d->nb_components) {
- av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
+ av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
continue;
}
if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
- av_assert0(c->step_minus1 >= c->depth_minus1);
+ av_assert0(c->step >= c->depth);
} else {
- av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
+ av_assert0(8*c->step >= c->depth);
}
if (!strncmp(d->name, "bayer_", 6))
continue;
av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
av_assert0(tmp[0] == 0 && tmp[1] == 0);
- tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
+ tmp[0] = tmp[1] = (1<<c->depth) - 1;
av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
}
}
@@ -2244,8 +2287,8 @@ static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
*min = INT_MAX, *max = -INT_MAX;
for (i = 0; i < desc->nb_components; i++) {
- *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
- *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
+ *min = FFMIN(desc->comp[i].depth, *min);
+ *max = FFMAX(desc->comp[i].depth, *max);
}
return 0;
}
@@ -2283,8 +2326,8 @@ static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
for (i = 0; i < nb_components; i++) {
- int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : dst_desc->comp[i].depth_minus1;
- if (src_desc->comp[i].depth_minus1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
+ int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1);
+ if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
loss |= FF_LOSS_DEPTH;
score -= 65536 >> depth_minus1;
}
@@ -2334,7 +2377,7 @@ static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
break;
}
if(loss & FF_LOSS_COLORSPACE)
- score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
+ score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth - 1, src_desc->comp[0].depth - 1);
if (dst_color == FF_COLOR_GRAY &&
src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
diff --git a/chromium/third_party/ffmpeg/libavutil/pixdesc.h b/chromium/third_party/ffmpeg/libavutil/pixdesc.h
index 78f8d559c4e..a6056fe1c02 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixdesc.h
+++ b/chromium/third_party/ffmpeg/libavutil/pixdesc.h
@@ -26,35 +26,47 @@
#include "attributes.h"
#include "pixfmt.h"
+#include "version.h"
typedef struct AVComponentDescriptor {
/**
* Which of the 4 planes contains the component.
*/
- uint16_t plane : 2;
+ int plane;
/**
- * Number of elements between 2 horizontally consecutive pixels minus 1.
+ * Number of elements between 2 horizontally consecutive pixels.
* Elements are bits for bitstream formats, bytes otherwise.
*/
- uint16_t step_minus1 : 3;
+ int step;
/**
- * Number of elements before the component of the first pixel plus 1.
+ * Number of elements before the component of the first pixel.
* Elements are bits for bitstream formats, bytes otherwise.
*/
- uint16_t offset_plus1 : 3;
+ int offset;
/**
* Number of least significant bits that must be shifted away
* to get the value.
*/
- uint16_t shift : 3;
+ int shift;
/**
- * Number of bits in the component minus 1.
+ * Number of bits in the component.
*/
- uint16_t depth_minus1 : 4;
+ int depth;
+
+#if FF_API_PLUS1_MINUS1
+ /** deprecated, use step instead */
+ attribute_deprecated int step_minus1;
+
+ /** deprecated, use depth instead */
+ attribute_deprecated int depth_minus1;
+
+ /** deprecated, use offset instead */
+ attribute_deprecated int offset_plus1;
+#endif
} AVComponentDescriptor;
/**
@@ -87,15 +99,20 @@ typedef struct AVPixFmtDescriptor {
* This value only refers to the chroma components.
*/
uint8_t log2_chroma_h;
- uint8_t flags;
+
+ /**
+ * Combination of AV_PIX_FMT_FLAG_... flags.
+ */
+ uint64_t flags;
/**
* Parameters that describe how pixels are packed.
- * If the format has 2 or 4 components, then alpha is last.
* If the format has 1 or 2 components, then luma is 0.
* If the format has 3 or 4 components:
* if the RGB flag is set then 0 is red, 1 is green and 2 is blue;
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
+ *
+ * If present, the Alpha channel is always the last component.
*/
AVComponentDescriptor comp[4];
@@ -155,27 +172,6 @@ typedef struct AVPixFmtDescriptor {
*/
#define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
-#if FF_API_PIX_FMT
-/**
- * @deprecated use the AV_PIX_FMT_FLAG_* flags
- */
-#define PIX_FMT_BE AV_PIX_FMT_FLAG_BE
-#define PIX_FMT_PAL AV_PIX_FMT_FLAG_PAL
-#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
-#define PIX_FMT_HWACCEL AV_PIX_FMT_FLAG_HWACCEL
-#define PIX_FMT_PLANAR AV_PIX_FMT_FLAG_PLANAR
-#define PIX_FMT_RGB AV_PIX_FMT_FLAG_RGB
-#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
-#define PIX_FMT_ALPHA AV_PIX_FMT_FLAG_ALPHA
-#endif
-
-#if FF_API_PIX_FMT_DESC
-/**
- * The array of all the pixel format descriptors.
- */
-extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-#endif
-
/**
* Read a line from an image, and write the values of the
* pixel format component c to dst.
diff --git a/chromium/third_party/ffmpeg/libavutil/pixfmt.h b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
index eef64449b2c..32044f07785 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixfmt.h
+++ b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
@@ -121,9 +121,21 @@ enum AVPixelFormat {
AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
+#if FF_API_VAAPI
+ /** @name Deprecated pixel formats */
+ /**@{*/
AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ /**@}*/
+ AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD,
+#else
+ /**
+ * Hardware acceleration through VA-API, data[3] contains a
+ * VASurfaceID.
+ */
+ AV_PIX_FMT_VAAPI,
+#endif
AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@@ -166,13 +178,6 @@ enum AVPixelFormat {
AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
-
-#ifdef AV_PIX_FMT_ABI_GIT_MASTER
- AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
-#endif
AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian
AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian
@@ -180,15 +185,8 @@ enum AVPixelFormat {
AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian
AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian
AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian
-
- /**
- * duplicated pixel formats for compatibility with libav.
- * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55)
- * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85)
- */
- AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
- AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
-
+ AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+ AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
@@ -216,16 +214,10 @@ enum AVPixelFormat {
AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
- /**
- * duplicated pixel formats for compatibility with libav.
- * FFmpeg supports these formats since Sat Sep 24 06:01:45 2011 +0200 (commits 9569a3c9f41387a8c7d1ce97d8693520477a66c3)
- * also see Fri Nov 25 01:38:21 2011 +0100 92afb431621c79155fcb7171d26f137eb1bee028
- * Libav added them Sun Mar 16 23:05:47 2014 +0100 with incompatible values (commit 1481d24c3a0abf81e1d7a514547bd5305232be30)
- */
- AV_PIX_FMT_RGBA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_RGBA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- AV_PIX_FMT_BGRA64BE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_BGRA64LE_LIBAV, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+ AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+ AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+ AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
+ AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
@@ -234,14 +226,9 @@ enum AVPixelFormat {
AV_PIX_FMT_YA16BE, ///< 16bit gray, 16bit alpha (big-endian)
AV_PIX_FMT_YA16LE, ///< 16bit gray, 16bit alpha (little-endian)
- /**
- * duplicated pixel formats for compatibility with libav.
- * FFmpeg supports these formats since May 3 2013 (commit e6d4e687558d08187e7a415a7725e4b1a416f782)
- * Libav added them Jan 14 2015 with incompatible values (commit 0e6c7dfa650e8b0497bfa7a06394b7a462ddc33a)
- */
- AV_PIX_FMT_GBRAP_LIBAV, ///< planar GBRA 4:4:4:4 32bpp
- AV_PIX_FMT_GBRAP16BE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, big-endian
- AV_PIX_FMT_GBRAP16LE_LIBAV, ///< planar GBRA 4:4:4:4 64bpp, little-endian
+ AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp
+ AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian
+ AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian
/**
* HW acceleration through QSV, data[3] contains a pointer to the
* mfxFrameSurface1 structure.
@@ -255,18 +242,10 @@ enum AVPixelFormat {
AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer
-#ifndef AV_PIX_FMT_ABI_GIT_MASTER
- AV_PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
- AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
- AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
-#endif
AV_PIX_FMT_0RGB=0x123+4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
- AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
- AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@@ -284,9 +263,6 @@ enum AVPixelFormat {
AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian
AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian
AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian
- AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp
- AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian
- AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian
AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range
AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */
@@ -308,27 +284,14 @@ enum AVPixelFormat {
AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
+ AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
+ AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
- 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
+ AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox
-#if FF_API_PIX_FMT
-#include "old_pix_fmts.h"
-#endif
+ 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
};
-#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
-#define AV_PIX_FMT_YUVA422P AV_PIX_FMT_YUVA422P_LIBAV
-#define AV_PIX_FMT_YUVA444P AV_PIX_FMT_YUVA444P_LIBAV
-#define AV_PIX_FMT_RGBA64BE AV_PIX_FMT_RGBA64BE_LIBAV
-#define AV_PIX_FMT_RGBA64LE AV_PIX_FMT_RGBA64LE_LIBAV
-#define AV_PIX_FMT_BGRA64BE AV_PIX_FMT_BGRA64BE_LIBAV
-#define AV_PIX_FMT_BGRA64LE AV_PIX_FMT_BGRA64LE_LIBAV
-#define AV_PIX_FMT_GBRAP AV_PIX_FMT_GBRAP_LIBAV
-#define AV_PIX_FMT_GBRAP16BE AV_PIX_FMT_GBRAP16BE_LIBAV
-#define AV_PIX_FMT_GBRAP16LE AV_PIX_FMT_GBRAP16LE_LIBAV
-#endif
-
-
#define AV_PIX_FMT_Y400A AV_PIX_FMT_GRAY8A
#define AV_PIX_FMT_GBR24P AV_PIX_FMT_GBRP
@@ -401,74 +364,25 @@ enum AVPixelFormat {
#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE)
-
-
-#if FF_API_PIX_FMT
-#define PixelFormat AVPixelFormat
-
-#define PIX_FMT_Y400A AV_PIX_FMT_Y400A
-#define PIX_FMT_GBR24P AV_PIX_FMT_GBR24P
-
-#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
-
-#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
-#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
-#define PIX_FMT_BGR32 AV_PIX_FMT_BGR32
-#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
-#define PIX_FMT_0RGB32 AV_PIX_FMT_0RGB32
-#define PIX_FMT_0BGR32 AV_PIX_FMT_0BGR32
-
-#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
-#define PIX_FMT_RGB48 AV_PIX_FMT_RGB48
-#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
-#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
-#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
-#define PIX_FMT_BGR48 AV_PIX_FMT_BGR48
-#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
-#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
-#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
-
-#define PIX_FMT_YUV420P9 AV_PIX_FMT_YUV420P9
-#define PIX_FMT_YUV422P9 AV_PIX_FMT_YUV422P9
-#define PIX_FMT_YUV444P9 AV_PIX_FMT_YUV444P9
-#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
-#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
-#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
-#define PIX_FMT_YUV420P12 AV_PIX_FMT_YUV420P12
-#define PIX_FMT_YUV422P12 AV_PIX_FMT_YUV422P12
-#define PIX_FMT_YUV444P12 AV_PIX_FMT_YUV444P12
-#define PIX_FMT_YUV420P14 AV_PIX_FMT_YUV420P14
-#define PIX_FMT_YUV422P14 AV_PIX_FMT_YUV422P14
-#define PIX_FMT_YUV444P14 AV_PIX_FMT_YUV444P14
-#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
-#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
-#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
-
-#define PIX_FMT_RGBA64 AV_PIX_FMT_RGBA64
-#define PIX_FMT_BGRA64 AV_PIX_FMT_BGRA64
-#define PIX_FMT_GBRP9 AV_PIX_FMT_GBRP9
-#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
-#define PIX_FMT_GBRP12 AV_PIX_FMT_GBRP12
-#define PIX_FMT_GBRP14 AV_PIX_FMT_GBRP14
-#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
-#endif
+#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE)
/**
* Chromaticity coordinates of the source primaries.
*/
enum AVColorPrimaries {
AVCOL_PRI_RESERVED0 = 0,
- AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
+ AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_RESERVED = 3,
- AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
-
- AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
- AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
- AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above
- AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C
- AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020
- AVCOL_PRI_NB, ///< Not part of ABI
+ AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
+
+ AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
+ AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
+ AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above
+ AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C
+ AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020
+ AVCOL_PRI_SMPTEST428_1= 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
+ AVCOL_PRI_NB, ///< Not part of ABI
};
/**
@@ -491,6 +405,8 @@ enum AVColorTransferCharacteristic {
AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC)
AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system
AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system
+ AVCOL_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10, 12, 14 and 16 bit systems
+ AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1
AVCOL_TRC_NB, ///< Not part of ABI
};
diff --git a/chromium/third_party/ffmpeg/libavutil/rc4.c b/chromium/third_party/ffmpeg/libavutil/rc4.c
index 4e52ba5ac11..e507b4a1ab5 100644
--- a/chromium/third_party/ffmpeg/libavutil/rc4.c
+++ b/chromium/third_party/ffmpeg/libavutil/rc4.c
@@ -22,9 +22,20 @@
*/
#include "avutil.h"
#include "common.h"
+#include "mem.h"
#include "rc4.h"
-typedef struct AVRC4 AVRC4;
+#if !FF_API_CRYPTO_CONTEXT
+struct AVRC4 {
+ uint8_t state[256];
+ int x, y;
+};
+#endif
+
+AVRC4 *av_rc4_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVRC4));
+}
int av_rc4_init(AVRC4 *r, const uint8_t *key, int key_bits, int decrypt) {
int i, j;
diff --git a/chromium/third_party/ffmpeg/libavutil/rc4.h b/chromium/third_party/ffmpeg/libavutil/rc4.h
index 9362fd8880c..47c9793df14 100644
--- a/chromium/third_party/ffmpeg/libavutil/rc4.h
+++ b/chromium/third_party/ffmpeg/libavutil/rc4.h
@@ -22,17 +22,34 @@
#define AVUTIL_RC4_H
#include <stdint.h>
+#include "version.h"
-struct AVRC4 {
+/**
+ * @defgroup lavu_rc4 RC4
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CRYPTO_CONTEXT
+typedef struct AVRC4 {
uint8_t state[256];
int x, y;
-};
+} AVRC4;
+#else
+typedef struct AVRC4 AVRC4;
+#endif
+
+/**
+ * Allocate an AVRC4 context.
+ */
+AVRC4 *av_rc4_alloc(void);
/**
* @brief Initializes an AVRC4 context.
*
* @param key_bits must be a multiple of 8
* @param decrypt 0 for encryption, 1 for decryption, currently has no effect
+ * @return zero on success, negative value otherwise
*/
int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
@@ -47,4 +64,8 @@ int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
*/
void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
+/**
+ * @}
+ */
+
#endif /* AVUTIL_RC4_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/reverse.c b/chromium/third_party/ffmpeg/libavutil/reverse.c
new file mode 100644
index 00000000000..105eb03dda4
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/reverse.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+const uint8_t ff_reverse[256] = {
+0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
+0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
+0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
+0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
+0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
+0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
+0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
+0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
+0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
+0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
+0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
+0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
+0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
+0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
+0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
+0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
+};
diff --git a/chromium/third_party/ffmpeg/libavutil/softfloat.c b/chromium/third_party/ffmpeg/libavutil/softfloat.c
index 28bea583e1f..a9d1b0c319f 100644
--- a/chromium/third_party/ffmpeg/libavutil/softfloat.c
+++ b/chromium/third_party/ffmpeg/libavutil/softfloat.c
@@ -23,55 +23,6 @@
#include "common.h"
#include "log.h"
-void av_sincos_sf(int a, int *s, int *c)
-{
- int idx, sign;
- int sv, cv;
- int st, ct;
-
- idx = a >> 26;
- sign = (idx << 27) >> 31;
- cv = av_costbl_1_sf[idx & 0xf];
- cv = (cv ^ sign) - sign;
-
- idx -= 8;
- sign = (idx << 27) >> 31;
- sv = av_costbl_1_sf[idx & 0xf];
- sv = (sv ^ sign) - sign;
-
- idx = a >> 21;
- ct = av_costbl_2_sf[idx & 0x1f];
- st = av_sintbl_2_sf[idx & 0x1f];
-
- idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30);
-
- sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
-
- cv = idx;
-
- idx = a >> 16;
- ct = av_costbl_3_sf[idx & 0x1f];
- st = av_sintbl_3_sf[idx & 0x1f];
-
- idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30);
-
- sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
- cv = idx;
-
- idx = a >> 11;
-
- ct = (int)(((int64_t)av_costbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
- (int64_t)av_costbl_4_sf[(idx & 0x1f)+1]*(a & 0x7ff) +
- 0x400) >> 11);
- st = (int)(((int64_t)av_sintbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
- (int64_t)av_sintbl_4_sf[(idx & 0x1f) + 1] * (a & 0x7ff) +
- 0x400) >> 11);
-
- *c = (int)(((int64_t)cv * ct + (int64_t)sv * st + 0x20000000) >> 30);
-
- *s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
-}
-
#ifdef TEST
#include <stdio.h>
@@ -146,6 +97,18 @@ int main(void){
sf1 = av_int2sf(0xE0000001, 0);
printf("test4 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp);
+ for(i= 0; i<4*36; i++){
+ int s, c;
+ double errs, errc;
+
+ av_sincos_sf(i*(1ULL<<32)/36/4, &s, &c);
+ errs = (double)s/ (1<<30) - sin(i*M_PI/36);
+ errc = (double)c/ (1<<30) - cos(i*M_PI/36);
+ if (fabs(errs) > 0.00000002 || fabs(errc) >0.001) {
+ printf("sincos FAIL %d %f %f %f %f\n", i, (float)s/ (1<<30), (float)c/ (1<<30), sin(i*M_PI/36), cos(i*M_PI/36));
+ }
+
+ }
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/softfloat.h b/chromium/third_party/ffmpeg/libavutil/softfloat.h
index 42723634891..00ff4a1db1b 100644
--- a/chromium/third_party/ffmpeg/libavutil/softfloat.h
+++ b/chromium/third_party/ffmpeg/libavutil/softfloat.h
@@ -36,6 +36,14 @@ typedef struct SoftFloat{
int32_t exp;
}SoftFloat;
+static const SoftFloat FLOAT_0 = { 0, 0};
+static const SoftFloat FLOAT_05 = { 0x20000000, 0};
+static const SoftFloat FLOAT_1 = { 0x20000000, 1};
+static const SoftFloat FLOAT_EPSILON = { 0x29F16B12, -16};
+static const SoftFloat FLOAT_1584893192 = { 0x32B771ED, 1};
+static const SoftFloat FLOAT_100000 = { 0x30D40000, 17};
+static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0};
+
static inline av_const double av_sf2double(SoftFloat v) {
v.exp -= ONE_BITS +1;
if(v.exp > 0) return (double)v.mant * (double)(1 << v.exp);
@@ -181,6 +189,53 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val)
/**
* Rounding-to-nearest used.
*/
-void av_sincos_sf(int a, int *s, int *c);
+static av_unused void av_sincos_sf(int a, int *s, int *c)
+{
+ int idx, sign;
+ int sv, cv;
+ int st, ct;
+
+ idx = a >> 26;
+ sign = (idx << 27) >> 31;
+ cv = av_costbl_1_sf[idx & 0xf];
+ cv = (cv ^ sign) - sign;
+
+ idx -= 8;
+ sign = (idx << 27) >> 31;
+ sv = av_costbl_1_sf[idx & 0xf];
+ sv = (sv ^ sign) - sign;
+
+ idx = a >> 21;
+ ct = av_costbl_2_sf[idx & 0x1f];
+ st = av_sintbl_2_sf[idx & 0x1f];
+
+ idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30);
+
+ sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
+
+ cv = idx;
+
+ idx = a >> 16;
+ ct = av_costbl_3_sf[idx & 0x1f];
+ st = av_sintbl_3_sf[idx & 0x1f];
+
+ idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30);
+
+ sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
+ cv = idx;
+
+ idx = a >> 11;
+
+ ct = (int)(((int64_t)av_costbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
+ (int64_t)av_costbl_4_sf[(idx & 0x1f)+1]*(a & 0x7ff) +
+ 0x400) >> 11);
+ st = (int)(((int64_t)av_sintbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
+ (int64_t)av_sintbl_4_sf[(idx & 0x1f) + 1] * (a & 0x7ff) +
+ 0x400) >> 11);
+
+ *c = (int)(((int64_t)cv * ct + (int64_t)sv * st + 0x20000000) >> 30);
+
+ *s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30);
+}
#endif /* AVUTIL_SOFTFLOAT_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/tea.c b/chromium/third_party/ffmpeg/libavutil/tea.c
new file mode 100644
index 00000000000..bf767188f48
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/tea.c
@@ -0,0 +1,213 @@
+/*
+ * A 32-bit implementation of the TEA algorithm
+ * Copyright (c) 2015 Vesselin Bontchev
+ *
+ * Loosely based on the implementation of David Wheeler and Roger Needham,
+ * https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm#Reference_code
+ *
+ * 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 "avutil.h"
+#include "common.h"
+#include "intreadwrite.h"
+#include "tea.h"
+
+typedef struct AVTEA {
+ uint32_t key[16];
+ int rounds;
+} AVTEA;
+
+struct AVTEA *av_tea_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVTEA));
+}
+
+const int av_tea_size = sizeof(AVTEA);
+
+void av_tea_init(AVTEA *ctx, const uint8_t key[16], int rounds)
+{
+ int i;
+
+ for (i = 0; i < 4; i++)
+ ctx->key[i] = AV_RB32(key + (i << 2));
+
+ ctx->rounds = rounds;
+}
+
+static void tea_crypt_ecb(AVTEA *ctx, uint8_t *dst, const uint8_t *src,
+ int decrypt, uint8_t *iv)
+{
+ uint32_t v0, v1;
+ int rounds = ctx->rounds;
+ uint32_t k0, k1, k2, k3;
+ k0 = ctx->key[0];
+ k1 = ctx->key[1];
+ k2 = ctx->key[2];
+ k3 = ctx->key[3];
+
+ v0 = AV_RB32(src);
+ v1 = AV_RB32(src + 4);
+
+ if (decrypt) {
+ int i;
+ uint32_t delta = 0x9E3779B9U, sum = delta * (rounds / 2);
+
+ for (i = 0; i < rounds / 2; i++) {
+ v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
+ v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
+ sum -= delta;
+ }
+ if (iv) {
+ v0 ^= AV_RB32(iv);
+ v1 ^= AV_RB32(iv + 4);
+ memcpy(iv, src, 8);
+ }
+ } else {
+ int i;
+ uint32_t sum = 0, delta = 0x9E3779B9U;
+
+ for (i = 0; i < rounds / 2; i++) {
+ sum += delta;
+ v0 += ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
+ v1 += ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
+ }
+ }
+
+ AV_WB32(dst, v0);
+ AV_WB32(dst + 4, v1);
+}
+
+void av_tea_crypt(AVTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
+ uint8_t *iv, int decrypt)
+{
+ int i;
+
+ if (decrypt) {
+ while (count--) {
+ tea_crypt_ecb(ctx, dst, src, decrypt, iv);
+
+ src += 8;
+ dst += 8;
+ }
+ } else {
+ while (count--) {
+ if (iv) {
+ for (i = 0; i < 8; i++)
+ dst[i] = src[i] ^ iv[i];
+ tea_crypt_ecb(ctx, dst, dst, decrypt, NULL);
+ memcpy(iv, dst, 8);
+ } else {
+ tea_crypt_ecb(ctx, dst, src, decrypt, NULL);
+ }
+ src += 8;
+ dst += 8;
+ }
+ }
+}
+
+#ifdef TEST
+#include <stdio.h>
+
+#define TEA_NUM_TESTS 4
+
+// https://github.com/logandrews/TeaCrypt/blob/master/tea/tea_test.go
+static const uint8_t tea_test_key[TEA_NUM_TESTS][16] = {
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
+ },
+ { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
+ }
+};
+
+static const uint8_t tea_test_pt[TEA_NUM_TESTS][8] = {
+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
+ { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
+ { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }
+};
+
+static const uint8_t tea_test_ct[TEA_NUM_TESTS][8] = {
+ { 0x41, 0xEA, 0x3A, 0x0A, 0x94, 0xBA, 0xA9, 0x40 },
+ { 0x6A, 0x2F, 0x9C, 0xF3, 0xFC, 0xCF, 0x3C, 0x55 },
+ { 0xDE, 0xB1, 0xC0, 0xA2, 0x7E, 0x74, 0x5D, 0xB3 },
+ { 0x12, 0x6C, 0x6B, 0x92, 0xC0, 0x65, 0x3A, 0x3E }
+};
+
+static void test_tea(AVTEA *ctx, uint8_t *dst, const uint8_t *src,
+ const uint8_t *ref, int len, uint8_t *iv, int dir,
+ const char *test)
+{
+ av_tea_crypt(ctx, dst, src, len, iv, dir);
+ if (memcmp(dst, ref, 8*len)) {
+ int i;
+ printf("%s failed\ngot ", test);
+ for (i = 0; i < 8*len; i++)
+ printf("%02x ", dst[i]);
+ printf("\nexpected ");
+ for (i = 0; i < 8*len; i++)
+ printf("%02x ", ref[i]);
+ printf("\n");
+ exit(1);
+ }
+}
+
+int main(void)
+{
+ AVTEA *ctx;
+ uint8_t buf[8], iv[8];
+ int i;
+ static const uint8_t src[32] = "HelloWorldHelloWorldHelloWorld";
+ uint8_t ct[32];
+ uint8_t pl[32];
+
+ ctx = av_tea_alloc();
+ if (!ctx)
+ return 1;
+
+ for (i = 0; i < TEA_NUM_TESTS; i++) {
+ av_tea_init(ctx, tea_test_key[i], 64);
+
+ test_tea(ctx, buf, tea_test_pt[i], tea_test_ct[i], 1, NULL, 0, "encryption");
+ test_tea(ctx, buf, tea_test_ct[i], tea_test_pt[i], 1, NULL, 1, "decryption");
+
+ /* encrypt */
+ memcpy(iv, "HALLO123", 8);
+ av_tea_crypt(ctx, ct, src, 4, iv, 0);
+
+ /* decrypt into pl */
+ memcpy(iv, "HALLO123", 8);
+ test_tea(ctx, pl, ct, src, 4, iv, 1, "CBC decryption");
+
+ memcpy(iv, "HALLO123", 8);
+ test_tea(ctx, ct, ct, src, 4, iv, 1, "CBC inplace decryption");
+ }
+
+ printf("Test encryption/decryption success.\n");
+ av_free(ctx);
+
+ return 0;
+}
+
+#endif
diff --git a/chromium/third_party/ffmpeg/libavutil/tea.h b/chromium/third_party/ffmpeg/libavutil/tea.h
new file mode 100644
index 00000000000..dd929bdafdc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/tea.h
@@ -0,0 +1,71 @@
+/*
+ * A 32-bit implementation of the TEA algorithm
+ * Copyright (c) 2015 Vesselin Bontchev
+ *
+ * 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_TEA_H
+#define AVUTIL_TEA_H
+
+#include <stdint.h>
+
+/**
+ * @file
+ * @brief Public header for libavutil TEA algorithm
+ * @defgroup lavu_tea TEA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+extern const int av_tea_size;
+
+struct AVTEA;
+
+/**
+ * Allocate an AVTEA context
+ * To free the struct: av_free(ptr)
+ */
+struct AVTEA *av_tea_alloc(void);
+
+/**
+ * Initialize an AVTEA context.
+ *
+ * @param ctx an AVTEA context
+ * @param key a key of 16 bytes used for encryption/decryption
+ * @param rounds the number of rounds in TEA (64 is the "standard")
+ */
+void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVTEA context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src,
+ int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_TEA_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/utils.c b/chromium/third_party/ffmpeg/libavutil/utils.c
index 0b765ed0def..e337c835662 100644
--- a/chromium/third_party/ffmpeg/libavutil/utils.c
+++ b/chromium/third_party/ffmpeg/libavutil/utils.c
@@ -30,13 +30,20 @@
#include "libavutil/ffversion.h"
const char av_util_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+const char *av_version_info(void)
+{
+ return FFMPEG_VERSION;
+}
+
unsigned avutil_version(void)
{
static int checks_done;
if (checks_done)
return LIBAVUTIL_VERSION_INT;
+#if FF_API_VDPAU
av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not had anything inserted or removed by mistake
+#endif
av_assert0(AV_SAMPLE_FMT_DBLP == 9);
av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
av_assert0(AV_PICTURE_TYPE_BI == 7);
diff --git a/chromium/third_party/ffmpeg/libavutil/version.h b/chromium/third_party/ffmpeg/libavutil/version.h
index 215729ec18c..306372cf387 100644
--- a/chromium/third_party/ffmpeg/libavutil/version.h
+++ b/chromium/third_party/ffmpeg/libavutil/version.h
@@ -55,8 +55,8 @@
* @{
*/
-#define LIBAVUTIL_VERSION_MAJOR 54
-#define LIBAVUTIL_VERSION_MINOR 27
+#define LIBAVUTIL_VERSION_MAJOR 55
+#define LIBAVUTIL_VERSION_MINOR 2
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -77,59 +77,38 @@
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*
+ * @note, when bumping the major version it is recommended to manually
+ * disable each FF_API_* in its own commit instead of disabling them all
+ * at once through the bump. This improves the git bisect-ability of the change.
+ *
* @{
*/
-#ifndef FF_API_OLD_AVOPTIONS
-#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_PIX_FMT
-#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_CONTEXT_SIZE
-#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_PIX_FMT_DESC
-#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_AV_REVERSE
-#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_AUDIOCONVERT
-#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_CPU_FLAG_MMX2
-#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_LLS_PRIVATE
-#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_AVFRAME_LAVC
-#define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
#ifndef FF_API_VDPAU
-#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 55)
-#endif
-#ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
-#define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)
+#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_XVMC
-#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 55)
+#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_OPT_TYPE_METADATA
-#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55)
+#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_DLOG
-#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55)
+#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
-
-#ifndef FF_CONST_AVUTIL55
-#if LIBAVUTIL_VERSION_MAJOR >= 55
-#define FF_CONST_AVUTIL55 const
-#else
-#define FF_CONST_AVUTIL55
+#ifndef FF_API_CRYPTO_CONTEXT
+#define FF_API_CRYPTO_CONTEXT (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_VAAPI
+#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
+#ifndef FF_API_FRAME_QP
+#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_PLUS1_MINUS1
+#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 56)
+#endif
+
/**
* @}
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/asm.h b/chromium/third_party/ffmpeg/libavutil/x86/asm.h
index 616ad6c96fc..109b65e542e 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/asm.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/asm.h
@@ -38,7 +38,8 @@ typedef struct ymm_reg { uint64_t a, b, c, d; } ymm_reg;
# define PTR_SIZE "8"
typedef int64_t x86_reg;
-# define REG_SP "rsp"
+/* REG_SP is defined in Solaris sys headers, so use REG_sp */
+# define REG_sp "rsp"
# define REG_BP "rbp"
# define REGBP rbp
# define REGa rax
@@ -59,7 +60,7 @@ typedef int64_t x86_reg;
# define PTR_SIZE "4"
typedef int32_t x86_reg;
-# define REG_SP "esp"
+# define REG_sp "esp"
# define REG_BP "ebp"
# define REGBP ebp
# define REGa eax
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/bswap.h b/chromium/third_party/ffmpeg/libavutil/x86/bswap.h
index 08e2a625207..67f1747af69 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/bswap.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/bswap.h
@@ -39,7 +39,7 @@ static av_always_inline av_const unsigned av_bswap16(unsigned x)
}
#endif /* !AV_GCC_VERSION_AT_LEAST(4,1) */
-#if !AV_GCC_VERSION_AT_LEAST(4,5)
+#if !AV_GCC_VERSION_AT_LEAST(4,5) || defined(__INTEL_COMPILER)
#define av_bswap32 av_bswap32
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
{
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
index ec3d22b230b..87229d4374b 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/float_dsp.asm
@@ -203,7 +203,7 @@ cglobal vector_fmul_window, 5, 6, 6, dst, src0, src1, win, len, len1
add dstq, lenq
add winq, lenq
neg lenq
-.loop
+.loop:
mova m0, [winq + lenq]
mova m4, [src0q + lenq]
%if cpuflag(sse)
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/intmath.h b/chromium/third_party/ffmpeg/libavutil/x86/intmath.h
index c42fa8352b2..fefad205e63 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/intmath.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/intmath.h
@@ -39,6 +39,12 @@
#if defined(__BMI2__)
+#if AV_GCC_VERSION_AT_LEAST(5,1)
+#define av_mod_uintp2 __builtin_ia32_bzhi_si
+#elif HAVE_INLINE_ASM
+/* GCC releases before 5.1.0 have a broken bzhi builtin, so for those we
+ * implement it using inline assembly
+ */
#define av_mod_uintp2 av_mod_uintp2_bmi2
static av_always_inline av_const unsigned av_mod_uintp2_bmi2(unsigned a, unsigned p)
{
@@ -50,6 +56,7 @@ static av_always_inline av_const unsigned av_mod_uintp2_bmi2(unsigned a, unsigne
return x;
}
}
+#endif /* AV_GCC_VERSION_AT_LEAST */
#endif /* __BMI2__ */
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/pixelutils.asm b/chromium/third_party/ffmpeg/libavutil/x86/pixelutils.asm
index 7522f24a42d..7af3007d0c4 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/pixelutils.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/pixelutils.asm
@@ -23,7 +23,7 @@
%include "x86util.asm"
-SECTION_TEXT
+SECTION .text
;-------------------------------------------------------------------------------
; int ff_pixelutils_sad_8x8_mmx(const uint8_t *src1, ptrdiff_t stride1,
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/timer.h b/chromium/third_party/ffmpeg/libavutil/x86/timer.h
index 5b24b511c1f..4d1e88def0d 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/timer.h
+++ b/chromium/third_party/ffmpeg/libavutil/x86/timer.h
@@ -31,7 +31,12 @@
static inline uint64_t read_time(void)
{
uint32_t a, d;
- __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
+ __asm__ volatile(
+#if ARCH_X86_64 || defined(__SSE2__)
+ "lfence \n\t"
+#endif
+ "rdtsc \n\t"
+ : "=a" (a), "=d" (d));
return ((uint64_t)d << 32) + a;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm b/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
index 4d8c4a5ab77..bcffbe412d8 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/x86inc.asm
@@ -1,7 +1,7 @@
;*****************************************************************************
;* x86inc.asm: x264asm abstraction layer
;*****************************************************************************
-;* Copyright (C) 2005-2013 x264 project
+;* Copyright (C) 2005-2015 x264 project
;*
;* Authors: Loren Merritt <lorenm@u.washington.edu>
;* Anton Mitrofanov <BugMaster@narod.ru>
@@ -42,6 +42,17 @@
%define public_prefix private_prefix
%endif
+%if HAVE_ALIGNED_STACK
+ %define STACK_ALIGNMENT 16
+%endif
+%ifndef STACK_ALIGNMENT
+ %if ARCH_X86_64
+ %define STACK_ALIGNMENT 16
+ %else
+ %define STACK_ALIGNMENT 4
+ %endif
+%endif
+
%define WIN64 0
%define UNIX64 0
%if ARCH_X86_64
@@ -56,6 +67,15 @@
%endif
%endif
+%define FORMAT_ELF 0
+%ifidn __OUTPUT_FORMAT__,elf
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf32
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf64
+ %define FORMAT_ELF 1
+%endif
+
%ifdef PREFIX
%define mangle(x) _ %+ x
%else
@@ -73,14 +93,6 @@
%endif
%endmacro
-%macro SECTION_TEXT 0-1 16
- %ifidn __OUTPUT_FORMAT__,aout
- SECTION .text
- %else
- SECTION .text align=%1
- %endif
-%endmacro
-
%if WIN64
%define PIC
%elif ARCH_X86_64 == 0
@@ -108,8 +120,9 @@
; %1 = number of arguments. loads them from stack if needed.
; %2 = number of registers used. pushes callee-saved regs if needed.
; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed.
-; %4 = (optional) stack size to be allocated. If not aligned (x86-32 ICC 10.x,
-; MSVC or YMM), the stack will be manually aligned (to 16 or 32 bytes),
+; %4 = (optional) stack size to be allocated. The stack will be aligned before
+; allocating the specified stack size. If the required stack alignment is
+; larger than the known stack alignment the stack will be manually aligned
; and an extra register will be allocated to hold the original stack
; pointer (to not invalidate r0m etc.). To prevent the use of an extra
; register as stack pointer, request a negative stack size.
@@ -117,8 +130,10 @@
; PROLOGUE can also be invoked by adding the same options to cglobal
; e.g.
-; cglobal foo, 2,3,0, dst, src, tmp
-; declares a function (foo), taking two args (dst and src) and one local variable (tmp)
+; cglobal foo, 2,3,7,0x40, dst, src, tmp
+; declares a function (foo) that automatically loads two arguments (dst and
+; src) into registers, uses one additional register (tmp) plus 7 vector
+; registers (m0-m6) and allocates 0x40 bytes of stack space.
; TODO Some functions can use some args directly from the stack. If they're the
; last args then you can just not declare them, but if they're in the middle
@@ -319,26 +334,28 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
%assign n_arg_names %0
%endmacro
+%define required_stack_alignment ((mmsize + 15) & ~15)
+
%macro ALLOC_STACK 1-2 0 ; stack_size, n_xmm_regs (for win64 only)
%ifnum %1
%if %1 != 0
- %assign %%stack_alignment ((mmsize + 15) & ~15)
+ %assign %%pad 0
%assign stack_size %1
%if stack_size < 0
%assign stack_size -stack_size
%endif
- %assign stack_size_padded stack_size
%if WIN64
- %assign stack_size_padded stack_size_padded + 32 ; reserve 32 bytes for shadow space
+ %assign %%pad %%pad + 32 ; shadow space
%if mmsize != 8
%assign xmm_regs_used %2
%if xmm_regs_used > 8
- %assign stack_size_padded stack_size_padded + (xmm_regs_used-8)*16
+ %assign %%pad %%pad + (xmm_regs_used-8)*16 ; callee-saved xmm registers
%endif
%endif
%endif
- %if mmsize <= 16 && HAVE_ALIGNED_STACK
- %assign stack_size_padded stack_size_padded + %%stack_alignment - gprsize - (stack_offset & (%%stack_alignment - 1))
+ %if required_stack_alignment <= STACK_ALIGNMENT
+ ; maintain the current stack alignment
+ %assign stack_size_padded stack_size + %%pad + ((-%%pad-stack_offset-gprsize) & (STACK_ALIGNMENT-1))
SUB rsp, stack_size_padded
%else
%assign %%reg_num (regs_used - 1)
@@ -347,17 +364,17 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
; it, i.e. in [rsp+stack_size_padded], so we can restore the
; stack in a single instruction (i.e. mov rsp, rstk or mov
; rsp, [rsp+stack_size_padded])
- mov rstk, rsp
%if %1 < 0 ; need to store rsp on stack
- sub rsp, gprsize+stack_size_padded
- and rsp, ~(%%stack_alignment-1)
- %xdefine rstkm [rsp+stack_size_padded]
- mov rstkm, rstk
+ %xdefine rstkm [rsp + stack_size + %%pad]
+ %assign %%pad %%pad + gprsize
%else ; can keep rsp in rstk during whole function
- sub rsp, stack_size_padded
- and rsp, ~(%%stack_alignment-1)
%xdefine rstkm rstk
%endif
+ %assign stack_size_padded stack_size + ((%%pad + required_stack_alignment-1) & ~(required_stack_alignment-1))
+ mov rstk, rsp
+ and rsp, ~(required_stack_alignment-1)
+ sub rsp, stack_size_padded
+ movifnidn rstkm, rstk
%endif
WIN64_PUSH_XMM
%endif
@@ -366,7 +383,7 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
%macro SETUP_STACK_POINTER 1
%ifnum %1
- %if %1 != 0 && (HAVE_ALIGNED_STACK == 0 || mmsize == 32)
+ %if %1 != 0 && required_stack_alignment > STACK_ALIGNMENT
%if %1 > 0
%assign regs_used (regs_used + 1)
%elif ARCH_X86_64 && regs_used == num_args && num_args <= 4 + UNIX64 * 2
@@ -440,7 +457,9 @@ DECLARE_REG 14, R15, 120
%assign xmm_regs_used %1
ASSERT xmm_regs_used <= 16
%if xmm_regs_used > 8
- %assign stack_size_padded (xmm_regs_used-8)*16 + (~stack_offset&8) + 32
+ ; Allocate stack space for callee-saved xmm registers plus shadow space and align the stack.
+ %assign %%pad (xmm_regs_used-8)*16 + 32
+ %assign stack_size_padded %%pad + ((-%%pad-stack_offset-gprsize) & (STACK_ALIGNMENT-1))
SUB rsp, stack_size_padded
%endif
WIN64_PUSH_XMM
@@ -456,7 +475,7 @@ DECLARE_REG 14, R15, 120
%endrep
%endif
%if stack_size_padded > 0
- %if stack_size > 0 && (mmsize == 32 || HAVE_ALIGNED_STACK == 0)
+ %if stack_size > 0 && required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add %1, stack_size_padded
@@ -522,7 +541,7 @@ DECLARE_REG 14, R15, 72
%macro RET 0
%if stack_size_padded > 0
-%if mmsize == 32 || HAVE_ALIGNED_STACK == 0
+%if required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add rsp, stack_size_padded
@@ -578,7 +597,7 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
%macro RET 0
%if stack_size_padded > 0
-%if mmsize == 32 || HAVE_ALIGNED_STACK == 0
+%if required_stack_alignment > STACK_ALIGNMENT
mov rsp, rstkm
%else
add rsp, stack_size_padded
@@ -690,7 +709,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%xdefine current_function %2
; Chromium patch to ensure symbols are correctly hidden for macho files,
; normal yasm does not have a private_extern flag.
- %ifidn __OUTPUT_FORMAT__,elf
+ %if FORMAT_ELF
global %2:function %%VISIBILITY
%elifidn __OUTPUT_FORMAT__,elf32
global %2:function %%VISIBILITY
@@ -726,14 +745,16 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
; like cextern, but without the prefix
%macro cextern_naked 1
- %xdefine %1 mangle(%1)
+ %ifdef PREFIX
+ %xdefine %1 mangle(%1)
+ %endif
CAT_XDEFINE cglobaled_, %1, 1
extern %1
%endmacro
%macro const 1-2+
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
- %ifidn __OUTPUT_FORMAT__,elf
+ %if FORMAT_ELF
global %1:data hidden
%else
global %1
@@ -741,16 +762,11 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%1: %2
%endmacro
-; This is needed for ELF, otherwise the GNU linker assumes the stack is
-; executable by default.
-%ifidn __OUTPUT_FORMAT__,elf
-[section .note.GNU-stack noalloc noexec nowrite progbits]
+; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default.
+%if FORMAT_ELF
+ [SECTION .note.GNU-stack noalloc noexec nowrite progbits]
%endif
-; Overrides the default .text section.
-; Silences warnings when defining structures.
-%define __SECT__
-
; cpuflags
%assign cpuflags_mmx (1<<0)
@@ -767,8 +783,8 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%assign cpuflags_avx (1<<11)| cpuflags_sse42
%assign cpuflags_xop (1<<12)| cpuflags_avx
%assign cpuflags_fma4 (1<<13)| cpuflags_avx
-%assign cpuflags_avx2 (1<<14)| cpuflags_avx
-%assign cpuflags_fma3 (1<<15)| cpuflags_avx
+%assign cpuflags_fma3 (1<<14)| cpuflags_avx
+%assign cpuflags_avx2 (1<<15)| cpuflags_fma3
%assign cpuflags_cache32 (1<<16)
%assign cpuflags_cache64 (1<<17)
@@ -817,7 +833,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%endif
%endif
- %if cpuflag(sse2)
+ %if ARCH_X86_64 || cpuflag(sse2)
CPUNOP amdnop
%else
CPUNOP basicnop
@@ -1439,6 +1455,24 @@ AVX_INSTR pfmul, 3dnow, 1, 0, 1
%undef i
%undef j
+%macro FMA_INSTR 3
+ %macro %1 4-7 %1, %2, %3
+ %if cpuflag(xop)
+ v%5 %1, %2, %3, %4
+ %elifnidn %1, %4
+ %6 %1, %2, %3
+ %7 %1, %4
+ %else
+ %error non-xop emulation of ``%5 %1, %2, %3, %4'' is not supported
+ %endif
+ %endmacro
+%endmacro
+
+FMA_INSTR pmacsww, pmullw, paddw
+FMA_INSTR pmacsdd, pmulld, paddd ; sse4 emulation
+FMA_INSTR pmacsdql, pmuldq, paddq ; sse4 emulation
+FMA_INSTR pmadcswd, pmaddwd, paddd
+
; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf.
; This lets us use tzcnt without bumping the yasm version requirement yet.
%define tzcnt rep bsf
@@ -1485,13 +1519,15 @@ FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps
FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd
FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss
-; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug
-%if ARCH_X86_64 == 0
-%macro vpbroadcastq 2
-%if sizeof%1 == 16
- movddup %1, %2
-%else
- vbroadcastsd %1, %2
-%endif
-%endmacro
+; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0)
+%ifdef __YASM_VER__
+ %if __YASM_VERSION_ID__ < 0x01030000 && ARCH_X86_64 == 0
+ %macro vpbroadcastq 2
+ %if sizeof%1 == 16
+ movddup %1, %2
+ %else
+ vbroadcastsd %1, %2
+ %endif
+ %endmacro
+ %endif
%endif
diff --git a/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm b/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
index d6702c1466f..b09fa813e22 100644
--- a/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
+++ b/chromium/third_party/ffmpeg/libavutil/x86/x86util.asm
@@ -210,13 +210,13 @@
%endif
%endmacro
-%macro PSIGNW_MMX 2
+%macro PSIGNW 2
+%if cpuflag(ssse3)
+ psignw %1, %2
+%else
pxor %1, %2
psubw %1, %2
-%endmacro
-
-%macro PSIGNW_SSSE3 2
- psignw %1, %2
+%endif
%endmacro
%macro ABS1 2
@@ -765,25 +765,6 @@
%endif
%endmacro
-%macro PMA_EMU 4
- %macro %1 5-8 %2, %3, %4
- %if cpuflag(xop)
- v%6 %1, %2, %3, %4
- %elifidn %1, %4
- %7 %5, %2, %3
- %8 %1, %4, %5
- %else
- %7 %1, %2, %3
- %8 %1, %4
- %endif
- %endmacro
-%endmacro
-
-PMA_EMU PMACSWW, pmacsww, pmullw, paddw
-PMA_EMU PMACSDD, pmacsdd, pmulld, paddd ; sse4 emulation
-PMA_EMU PMACSDQL, pmacsdql, pmuldq, paddq ; sse4 emulation
-PMA_EMU PMADCSWD, pmadcswd, pmaddwd, paddd
-
; Wrapper for non-FMA version of fmaddps
%macro FMULADD_PS 5
%if cpuflag(fma3) || cpuflag(fma4)
diff --git a/chromium/third_party/ffmpeg/libavutil/xtea.c b/chromium/third_party/ffmpeg/libavutil/xtea.c
index 1750cbc45ac..b95f32239ef 100644
--- a/chromium/third_party/ffmpeg/libavutil/xtea.c
+++ b/chromium/third_party/ffmpeg/libavutil/xtea.c
@@ -31,8 +31,20 @@
#include "avutil.h"
#include "common.h"
#include "intreadwrite.h"
+#include "mem.h"
#include "xtea.h"
+#if !FF_API_CRYPTO_CONTEXT
+struct AVXTEA {
+ uint32_t key[16];
+};
+#endif
+
+AVXTEA *av_xtea_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVXTEA));
+}
+
void av_xtea_init(AVXTEA *ctx, const uint8_t key[16])
{
int i;
diff --git a/chromium/third_party/ffmpeg/libavutil/xtea.h b/chromium/third_party/ffmpeg/libavutil/xtea.h
index 6f1e71e345d..4281fd8c8f2 100644
--- a/chromium/third_party/ffmpeg/libavutil/xtea.h
+++ b/chromium/third_party/ffmpeg/libavutil/xtea.h
@@ -23,6 +23,7 @@
#define AVUTIL_XTEA_H
#include <stdint.h>
+#include "version.h"
/**
* @file
@@ -32,9 +33,18 @@
* @{
*/
+#if FF_API_CRYPTO_CONTEXT
typedef struct AVXTEA {
uint32_t key[16];
} AVXTEA;
+#else
+typedef struct AVXTEA AVXTEA;
+#endif
+
+/**
+ * Allocate an AVXTEA context.
+ */
+AVXTEA *av_xtea_alloc(void);
/**
* Initialize an AVXTEA context.
diff --git a/chromium/third_party/ffmpeg/libpostproc/postprocess.c b/chromium/third_party/ffmpeg/libpostproc/postprocess.c
index 92cc4367d01..3b86f93980f 100644
--- a/chromium/third_party/ffmpeg/libpostproc/postprocess.c
+++ b/chromium/third_party/ffmpeg/libpostproc/postprocess.c
@@ -76,6 +76,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
#include "config.h"
#include "libavutil/avutil.h"
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -997,7 +998,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
int i;
const int count= FFMAX(mbHeight * QPStride, mbWidth);
for(i=0; i<(count>>2); i++){
- ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F;
+ AV_WN32(c->nonBQPTable + (i<<2), AV_RN32(QP_store + (i<<2)) & 0x3F3F3F3F);
}
for(i<<=2; i<count; i++){
c->nonBQPTable[i] = QP_store[i] & 0x3F;
diff --git a/chromium/third_party/ffmpeg/libpostproc/postprocess.h b/chromium/third_party/ffmpeg/libpostproc/postprocess.h
index e00ed968d77..2b55ed67b06 100644
--- a/chromium/third_party/ffmpeg/libpostproc/postprocess.h
+++ b/chromium/third_party/ffmpeg/libpostproc/postprocess.h
@@ -51,7 +51,9 @@ const char *postproc_license(void);
#define PP_QUALITY_MAX 6
-#define QP_STORE_T int8_t
+#if FF_API_QP_TYPE
+#define QP_STORE_T int8_t //deprecated
+#endif
#include <inttypes.h>
@@ -69,7 +71,7 @@ extern const char pp_help[]; ///< a simple help text
void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
uint8_t * dst[3], const int dstStride[3],
int horizontalSize, int verticalSize,
- const QP_STORE_T *QP_store, int QP_stride,
+ const int8_t *QP_store, int QP_stride,
pp_mode *mode, pp_context *ppContext, int pict_type);
diff --git a/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c b/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
index 5694cc5c28c..b01be58de6d 100644
--- a/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
+++ b/chromium/third_party/ffmpeg/libpostproc/postprocess_template.c
@@ -1317,7 +1317,7 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,
"1: \n\t"
: : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp)
NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b02,b08)
- : "%"REG_a, "%"REG_d, "%"REG_SP
+ : "%"REG_a, "%"REG_d, "%"REG_sp
);
#else // HAVE_7REGS && (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW)
int y;
diff --git a/chromium/third_party/ffmpeg/libpostproc/version.h b/chromium/third_party/ffmpeg/libpostproc/version.h
index 59c24660f83..db557a5b815 100644
--- a/chromium/third_party/ffmpeg/libpostproc/version.h
+++ b/chromium/third_party/ffmpeg/libpostproc/version.h
@@ -28,8 +28,8 @@
#include "libavutil/avutil.h"
-#define LIBPOSTPROC_VERSION_MAJOR 53
-#define LIBPOSTPROC_VERSION_MINOR 3
+#define LIBPOSTPROC_VERSION_MAJOR 54
+#define LIBPOSTPROC_VERSION_MINOR 0
#define LIBPOSTPROC_VERSION_MICRO 100
#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
@@ -42,4 +42,8 @@
#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
+#ifndef FF_API_QP_TYPE
+#define FF_API_QP_TYPE (LIBPOSTPROC_VERSION_MAJOR < 55)
+#endif
+
#endif /* POSTPROC_POSTPROCESS_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/library.mak b/chromium/third_party/ffmpeg/library.mak
index 7c260245a42..6f95f63410f 100644
--- a/chromium/third_party/ffmpeg/library.mak
+++ b/chromium/third_party/ffmpeg/library.mak
@@ -34,6 +34,7 @@ $(SUBDIR)x86/%.o: $(SUBDIR)x86/%$(YASMD).asm
LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
$(TESTOBJS) $(TESTOBJS:.o=.i): CPPFLAGS += -DTEST
+$(TESTOBJS) $(TESTOBJS:.o=.i): CFLAGS += -Umain
$(SUBDIR)$(LIBNAME): $(OBJS)
$(RM) $@
@@ -57,7 +58,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
- $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
+ $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDLIBFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
$(SLIB_EXTRA_CMD)
ifdef SUBDIR
diff --git a/chromium/third_party/ffmpeg/libswresample/dither.c b/chromium/third_party/ffmpeg/libswresample/dither.c
index 248062aab8c..08c793d4cf8 100644
--- a/chromium/third_party/ffmpeg/libswresample/dither.c
+++ b/chromium/third_party/ffmpeg/libswresample/dither.c
@@ -109,7 +109,7 @@ av_cold int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AV
memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
for (i=0; filters[i].coefs; i++) {
const filter_t *f = &filters[i];
- if (fabs(s->out_sample_rate - f->rate) / f->rate <= .05 && f->name == s->dither.method) {
+ if (llabs(s->out_sample_rate - f->rate)*20 <= f->rate && f->name == s->dither.method) {
int j;
s->dither.ns_taps = f->len;
for (j=0; j<f->len; j++)
diff --git a/chromium/third_party/ffmpeg/libswresample/options.c b/chromium/third_party/ffmpeg/libswresample/options.c
index de846728343..1bc1a705101 100644
--- a/chromium/third_party/ffmpeg/libswresample/options.c
+++ b/chromium/third_party/ffmpeg/libswresample/options.c
@@ -49,8 +49,8 @@ static const AVOption options[]={
{"in_sample_fmt" , "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
{"osf" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
{"out_sample_fmt" , "set output sample format" , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
-{"tsf" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
-{"internal_sample_fmt" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"tsf" , "set internal sample format" , OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
+{"internal_sample_fmt" , "set internal sample format" , OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM},
{"icl" , "set input channel layout" , OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
{"in_channel_layout" , "set input channel layout" , OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
{"ocl" , "set output channel layout" , OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"},
diff --git a/chromium/third_party/ffmpeg/libswresample/soxr_resample.c b/chromium/third_party/ffmpeg/libswresample/soxr_resample.c
index 0f75bc554c1..535e9cee07d 100644
--- a/chromium/third_party/ffmpeg/libswresample/soxr_resample.c
+++ b/chromium/third_party/ffmpeg/libswresample/soxr_resample.c
@@ -67,7 +67,17 @@ static void destroy(struct ResampleContext * *c){
}
static int flush(struct SwrContext *s){
+ s->delayed_samples_fixup = soxr_delay((soxr_t)s->resample);
+
soxr_process((soxr_t)s->resample, NULL, 0, NULL, NULL, 0, NULL);
+
+ {
+ float f;
+ size_t idone, odone;
+ soxr_process((soxr_t)s->resample, &f, 0, &idone, &f, 0, &odone);
+ s->delayed_samples_fixup -= soxr_delay((soxr_t)s->resample);
+ }
+
return 0;
}
@@ -87,18 +97,34 @@ static int process(
}
static int64_t get_delay(struct SwrContext *s, int64_t base){
- double delay_s = soxr_delay((soxr_t)s->resample) / s->out_sample_rate;
+ double delayed_samples = soxr_delay((soxr_t)s->resample);
+ double delay_s;
+
+ if (s->flushed)
+ delayed_samples += s->delayed_samples_fixup;
+
+ delay_s = delayed_samples / s->out_sample_rate;
+
return (int64_t)(delay_s * base + .5);
}
static int invert_initial_buffer(struct ResampleContext *c, AudioData *dst, const AudioData *src,
- int in_count, int *out_idx, int *out_sz)
-{
+ int in_count, int *out_idx, int *out_sz){
return 0;
}
+static int64_t get_out_samples(struct SwrContext *s, int in_samples){
+ double out_samples = (double)s->out_sample_rate / s->in_sample_rate * in_samples;
+ double delayed_samples = soxr_delay((soxr_t)s->resample);
+
+ if (s->flushed)
+ delayed_samples += s->delayed_samples_fixup;
+
+ return (int64_t)(out_samples + delayed_samples + 1 + .5);
+}
+
struct Resampler const swri_soxr_resampler={
create, destroy, process, flush, NULL /* set_compensation */, get_delay,
- invert_initial_buffer,
+ invert_initial_buffer, get_out_samples
};
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample-test.c b/chromium/third_party/ffmpeg/libswresample/swresample-test.c
index 7e2854da7c3..47c54a109b1 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample-test.c
+++ b/chromium/third_party/ffmpeg/libswresample/swresample-test.c
@@ -108,7 +108,7 @@ static const int rates[] = {
48000,
};
-uint64_t layouts[]={
+static const uint64_t layouts[]={
AV_CH_LAYOUT_MONO ,
AV_CH_LAYOUT_STEREO ,
AV_CH_LAYOUT_2_1 ,
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.c b/chromium/third_party/ffmpeg/libswresample/swresample.c
index ab02bac89a5..8e238998e96 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.c
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.c
@@ -133,6 +133,7 @@ static void clear_context(SwrContext *s){
swri_audio_convert_free(&s->full_convert);
swri_rematrix_free(s);
+ s->delayed_samples_fixup = 0;
s->flushed = 0;
}
@@ -173,6 +174,8 @@ av_cold int swr_init(struct SwrContext *s){
s-> in_ch_layout = s-> user_in_ch_layout;
s->out_ch_layout = s->user_out_ch_layout;
+ s->int_sample_fmt= s->user_int_sample_fmt;
+
if(av_get_channel_layout_nb_channels(s-> in_ch_layout) > SWR_CH_MAX) {
av_log(s, AV_LOG_WARNING, "Input channel layout 0x%"PRIx64" is invalid or unsupported.\n", s-> in_ch_layout);
s->in_ch_layout = 0;
@@ -210,7 +213,13 @@ av_cold int swr_init(struct SwrContext *s){
s->rematrix_custom;
if(s->int_sample_fmt == AV_SAMPLE_FMT_NONE){
- if(av_get_planar_sample_fmt(s->in_sample_fmt) <= AV_SAMPLE_FMT_S16P){
+ if( av_get_planar_sample_fmt(s-> in_sample_fmt) <= AV_SAMPLE_FMT_S16P
+ && av_get_planar_sample_fmt(s->out_sample_fmt) <= AV_SAMPLE_FMT_S16P){
+ s->int_sample_fmt= AV_SAMPLE_FMT_S16P;
+ }else if( av_get_planar_sample_fmt(s-> in_sample_fmt) <= AV_SAMPLE_FMT_S16P
+ && !s->rematrix
+ && s->out_sample_rate==s->in_sample_rate
+ && !(s->flags & SWR_FLAG_RESAMPLE)){
s->int_sample_fmt= AV_SAMPLE_FMT_S16P;
}else if( av_get_planar_sample_fmt(s-> in_sample_fmt) == AV_SAMPLE_FMT_S32P
&& av_get_planar_sample_fmt(s->out_sample_fmt) == AV_SAMPLE_FMT_S32P
@@ -220,10 +229,10 @@ av_cold int swr_init(struct SwrContext *s){
}else if(av_get_planar_sample_fmt(s->in_sample_fmt) <= AV_SAMPLE_FMT_FLTP){
s->int_sample_fmt= AV_SAMPLE_FMT_FLTP;
}else{
- av_log(s, AV_LOG_DEBUG, "Using double precision mode\n");
s->int_sample_fmt= AV_SAMPLE_FMT_DBLP;
}
}
+ av_log(s, AV_LOG_DEBUG, "Using %s internally between filters\n", av_get_sample_fmt_name(s->int_sample_fmt));
if( s->int_sample_fmt != AV_SAMPLE_FMT_S16P
&&s->int_sample_fmt != AV_SAMPLE_FMT_S32P
@@ -641,7 +650,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return ret;
if(ret)
for(ch=0; ch<s->dither.noise.ch_count; ch++)
- if((ret=swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, 12345678913579<<ch, s->dither.noise.fmt))<0)
+ if((ret=swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, (12345678913579ULL*ch + 3141592) % 2718281828U, s->dither.noise.fmt))<0)
return ret;
av_assert0(s->dither.noise.ch_count == preout->ch_count);
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample_internal.h b/chromium/third_party/ffmpeg/libswresample/swresample_internal.h
index 7595588f410..ce5eef4d9f5 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample_internal.h
+++ b/chromium/third_party/ffmpeg/libswresample/swresample_internal.h
@@ -25,7 +25,7 @@
#include "libavutil/channel_layout.h"
#include "config.h"
-#define SWR_CH_MAX 32
+#define SWR_CH_MAX 64
#define SQRT3_2 1.22474487139158904909 /* sqrt(3/2) */
@@ -119,6 +119,7 @@ struct SwrContext {
int user_used_ch_count; ///< User set used channel count
int64_t user_in_ch_layout; ///< User set input channel layout
int64_t user_out_ch_layout; ///< User set output channel layout
+ enum AVSampleFormat user_int_sample_fmt; ///< User set internal sample format
struct DitherContext dither;
@@ -157,6 +158,7 @@ struct SwrContext {
int64_t outpts; ///< output PTS
int64_t firstpts; ///< first PTS
int drop_output; ///< number of output samples to drop
+ double delayed_samples_fixup; ///< soxr 0.1.1: needed to fixup delayed_samples after flush has been called.
struct AudioConvert *in_convert; ///< input conversion context
struct AudioConvert *out_convert; ///< output conversion context
diff --git a/chromium/third_party/ffmpeg/libswresample/version.h b/chromium/third_party/ffmpeg/libswresample/version.h
index 94ac9c52d04..12b32826dbe 100644
--- a/chromium/third_party/ffmpeg/libswresample/version.h
+++ b/chromium/third_party/ffmpeg/libswresample/version.h
@@ -28,8 +28,8 @@
#include "libavutil/avutil.h"
-#define LIBSWRESAMPLE_VERSION_MAJOR 1
-#define LIBSWRESAMPLE_VERSION_MINOR 2
+#define LIBSWRESAMPLE_VERSION_MAJOR 2
+#define LIBSWRESAMPLE_VERSION_MINOR 0
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/audio_convert.asm b/chromium/third_party/ffmpeg/libswresample/x86/audio_convert.asm
index 69e4f0538b7..e9a9acf2dbd 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/audio_convert.asm
+++ b/chromium/third_party/ffmpeg/libswresample/x86/audio_convert.asm
@@ -44,7 +44,7 @@ cglobal pack_2ch_%2_to_%1_%3, 3, 4, 6, dst, src, len, src2
test src2q, mmsize-1
jne pack_2ch_%2_to_%1_u_int %+ SUFFIX
%else
-pack_2ch_%2_to_%1_u_int %+ SUFFIX
+pack_2ch_%2_to_%1_u_int %+ SUFFIX:
%endif
lea srcq , [srcq + (1<<%5)*lenq]
lea src2q, [src2q + (1<<%5)*lenq]
@@ -101,7 +101,7 @@ cglobal unpack_2ch_%2_to_%1_%3, 3, 4, 7, dst, src, len, dst2
test dst2q, mmsize-1
jne unpack_2ch_%2_to_%1_u_int %+ SUFFIX
%else
-unpack_2ch_%2_to_%1_u_int %+ SUFFIX
+unpack_2ch_%2_to_%1_u_int %+ SUFFIX:
%endif
lea srcq , [srcq + (2<<%5)*lenq]
lea dstq , [dstq + (1<<%4)*lenq]
@@ -170,7 +170,7 @@ cglobal %2_to_%1_%3, 3, 3, 6, dst, src, len
test srcq, mmsize-1
jne %2_to_%1_u_int %+ SUFFIX
%else
-%2_to_%1_u_int %+ SUFFIX
+%2_to_%1_u_int %+ SUFFIX:
%endif
lea srcq , [srcq + (1<<%5)*lenq]
lea dstq , [dstq + (1<<%4)*lenq]
@@ -232,7 +232,7 @@ cglobal pack_6ch_%2_to_%1_%3, 2,8,7, dst, src, src1, src2, src3, src4, src5, len
test src5q, mmsize-1
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
%else
-pack_6ch_%2_to_%1_u_int %+ SUFFIX
+pack_6ch_%2_to_%1_u_int %+ SUFFIX:
%endif
sub src1q, srcq
sub src2q, srcq
@@ -335,7 +335,7 @@ cglobal unpack_6ch_%2_to_%1_%3, 2, 8, 8, dst, src, dst1, dst2, dst3, dst4, dst5,
test dst5q, mmsize-1
jne unpack_6ch_%2_to_%1_u_int %+ SUFFIX
%else
-unpack_6ch_%2_to_%1_u_int %+ SUFFIX
+unpack_6ch_%2_to_%1_u_int %+ SUFFIX:
%endif
sub dst1q, dstq
sub dst2q, dstq
@@ -443,7 +443,7 @@ cglobal pack_8ch_%2_to_%1_%3, 2,PACK_8CH_GPRS,10, ARCH_X86_32*48, dst, src, len,
%endif
jne pack_8ch_%2_to_%1_u_int %+ SUFFIX
%else
-pack_8ch_%2_to_%1_u_int %+ SUFFIX
+pack_8ch_%2_to_%1_u_int %+ SUFFIX:
%endif
sub src1q, srcq
sub src2q, srcq
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/rematrix.asm b/chromium/third_party/ffmpeg/libswresample/x86/rematrix.asm
index f0ae9599a29..7984b9a729b 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/rematrix.asm
+++ b/chromium/third_party/ffmpeg/libswresample/x86/rematrix.asm
@@ -37,7 +37,7 @@ cglobal mix_2_1_%1_float, 7, 7, 6, out, in1, in2, coeffp, index1, index2, len
test outq, mmsize-1
jne mix_2_1_float_u_int %+ SUFFIX
%else
-mix_2_1_float_u_int %+ SUFFIX
+mix_2_1_float_u_int %+ SUFFIX:
%endif
VBROADCASTSS m4, [coeffpq + 4*index1q]
VBROADCASTSS m5, [coeffpq + 4*index2q]
@@ -79,7 +79,7 @@ cglobal mix_1_1_%1_float, 5, 5, 3, out, in, coeffp, index, len
test outq, mmsize-1
jne mix_1_1_float_u_int %+ SUFFIX
%else
-mix_1_1_float_u_int %+ SUFFIX
+mix_1_1_float_u_int %+ SUFFIX:
%endif
VBROADCASTSS m2, [coeffpq + 4*indexq]
shl lenq , 2
@@ -111,7 +111,7 @@ cglobal mix_1_1_%1_int16, 5, 5, 6, out, in, coeffp, index, len
test outq, mmsize-1
jne mix_1_1_int16_u_int %+ SUFFIX
%else
-mix_1_1_int16_u_int %+ SUFFIX
+mix_1_1_int16_u_int %+ SUFFIX:
%endif
movd m4, [coeffpq + 4*indexq]
SPLATW m5, m4
@@ -166,7 +166,7 @@ cglobal mix_2_1_%1_int16, 7, 7, 8, out, in1, in2, coeffp, index1, index2, len
test outq, mmsize-1
jne mix_2_1_int16_u_int %+ SUFFIX
%else
-mix_2_1_int16_u_int %+ SUFFIX
+mix_2_1_int16_u_int %+ SUFFIX:
%endif
movd m4, [coeffpq + 4*index1q]
movd m6, [coeffpq + 4*index2q]
diff --git a/chromium/third_party/ffmpeg/libswresample/x86/resample.asm b/chromium/third_party/ffmpeg/libswresample/x86/resample.asm
index a57ff37bb99..4989aa69915 100644
--- a/chromium/third_party/ffmpeg/libswresample/x86/resample.asm
+++ b/chromium/third_party/ffmpeg/libswresample/x86/resample.asm
@@ -176,7 +176,12 @@ cglobal resample_common_%1, 1, 7, 2, ctx, phase_shift, dst, frac, \
.inner_loop:
movu m1, [srcq+min_filter_count_x4q*1]
%ifidn %1, int16
- PMADCSWD m0, m1, [filterq+min_filter_count_x4q*1], m0, m1
+%if cpuflag(xop)
+ vpmadcswd m0, m1, [filterq+min_filter_count_x4q*1], m0
+%else
+ pmaddwd m1, [filterq+min_filter_count_x4q*1]
+ paddd m0, m1
+%endif
%else ; float/double
%if cpuflag(fma4) || cpuflag(fma3)
fmaddp%4 m0, m1, [filterq+min_filter_count_x4q*1], m0
diff --git a/chromium/third_party/ffmpeg/libswscale/Makefile b/chromium/third_party/ffmpeg/libswscale/Makefile
index a60b05748d3..a9f9e03b258 100644
--- a/chromium/third_party/ffmpeg/libswscale/Makefile
+++ b/chromium/third_party/ffmpeg/libswscale/Makefile
@@ -5,7 +5,8 @@ NAME = swscale
HEADERS = swscale.h \
version.h \
-OBJS = hscale_fast_bilinear.o \
+OBJS = alphablend.o \
+ hscale_fast_bilinear.o \
input.o \
options.o \
output.o \
@@ -14,6 +15,10 @@ OBJS = hscale_fast_bilinear.o \
swscale_unscaled.o \
utils.o \
yuv2rgb.o \
+ slice.o \
+ hscale.o \
+ vscale.o \
+ gamma.o \
OBJS-$(CONFIG_SHARED) += log2_tab.o
diff --git a/chromium/third_party/ffmpeg/libswscale/alphablend.c b/chromium/third_party/ffmpeg/libswscale/alphablend.c
new file mode 100644
index 00000000000..1f63493bdcc
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/alphablend.c
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2015 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "swscale_internal.h"
+
+int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
+ int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *dst[], int dstStride[])
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+ int nb_components = desc->nb_components;
+ int plane, x, y;
+ int plane_count = isGray(c->srcFormat) ? 1 : 3;
+ int sixteen_bits = desc->comp[0].depth >= 9;
+ unsigned off = 1<<(desc->comp[0].depth - 1);
+ unsigned shift = desc->comp[0].depth;
+ unsigned max = (1<<shift) - 1;
+ int target_table[2][3];
+
+ for (plane = 0; plane < plane_count; plane++) {
+ int a = 0, b = 0;
+ if (c->alphablend == SWS_ALPHA_BLEND_CHECKERBOARD) {
+ a = (1<<(desc->comp[0].depth - 1))/2;
+ b = 3*(1<<(desc->comp[0].depth-1))/2;
+ }
+ target_table[0][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<(desc->comp[0].depth - 1) : a;
+ target_table[1][plane] = plane && !(desc->flags & AV_PIX_FMT_FLAG_RGB) ? 1<<(desc->comp[0].depth - 1) : b;
+ }
+
+ av_assert0(plane_count == nb_components - 1);
+ if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
+ for (plane = 0; plane < plane_count; plane++) {
+ int w = plane ? c->chrSrcW : c->srcW;
+ int x_subsample = plane ? desc->log2_chroma_w: 0;
+ int y_subsample = plane ? desc->log2_chroma_h: 0;
+ for (y = srcSliceY >> y_subsample; y < FF_CEIL_RSHIFT(srcSliceH, y_subsample); y++) {
+ if (x_subsample || y_subsample) {
+ int alpha;
+ unsigned u;
+ if (sixteen_bits) {
+ ptrdiff_t alpha_step = srcStride[plane_count] >> 1;
+ const uint16_t *s = (const uint16_t *)(src[plane ] + srcStride[plane ] * y);
+ const uint16_t *a = (const uint16_t *)(src[plane_count] + (srcStride[plane_count] * y << y_subsample));
+ uint16_t *d = ( uint16_t *)(dst[plane ] + dstStride[plane ] * y);
+ if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+ for (x = 0; x < w; x++) {
+ if (y_subsample) {
+ alpha = (a[2*x] + a[2*x + 1] + 2 +
+ a[2*x + alpha_step] + a[2*x + alpha_step + 1]) >> 2;
+ } else
+ alpha = (a[2*x] + a[2*x + 1]) >> 1;
+ u = s[x]*alpha + target_table[((x^y)>>5)&1][plane]*(max-alpha) + off;
+ d[x] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ } else {
+ for (x = 0; x < w; x++) {
+ if (y_subsample) {
+ alpha = (av_bswap16(a[2*x]) + av_bswap16(a[2*x + 1]) + 2 +
+ av_bswap16(a[2*x + alpha_step]) + av_bswap16(a[2*x + alpha_step + 1])) >> 2;
+ } else
+ alpha = (av_bswap16(a[2*x]) + av_bswap16(a[2*x + 1])) >> 1;
+ u = av_bswap16(s[x])*alpha + target_table[((x^y)>>5)&1][plane]*(max-alpha) + off;
+ d[x] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ }
+ } else {
+ ptrdiff_t alpha_step = srcStride[plane_count];
+ const uint8_t *s = src[plane ] + srcStride[plane] * y;
+ const uint8_t *a = src[plane_count] + (srcStride[plane_count] * y << y_subsample);
+ uint8_t *d = dst[plane ] + dstStride[plane] * y;
+ for (x = 0; x < w; x++) {
+ if (y_subsample) {
+ alpha = (a[2*x] + a[2*x + 1] + 2 +
+ a[2*x + alpha_step] + a[2*x + alpha_step + 1]) >> 2;
+ } else
+ alpha = (a[2*x] + a[2*x + 1]) >> 1;
+ u = s[x]*alpha + target_table[((x^y)>>5)&1][plane]*(255-alpha) + 128;
+ d[x] = (257*u) >> 16;
+ }
+ }
+ } else {
+ if (sixteen_bits) {
+ const uint16_t *s = (const uint16_t *)(src[plane ] + srcStride[plane ] * y);
+ const uint16_t *a = (const uint16_t *)(src[plane_count] + srcStride[plane_count] * y);
+ uint16_t *d = ( uint16_t *)(dst[plane ] + dstStride[plane ] * y);
+ if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+ for (x = 0; x < w; x++) {
+ unsigned u = s[x]*a[x] + target_table[((x^y)>>5)&1][plane]*(max-a[x]) + off;
+ d[x] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ } else {
+ for (x = 0; x < w; x++) {
+ unsigned aswap =av_bswap16(a[x]);
+ unsigned u = av_bswap16(s[x])*aswap + target_table[((x^y)>>5)&1][plane]*(max-aswap) + off;
+ d[x] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ }
+ } else {
+ const uint8_t *s = src[plane ] + srcStride[plane] * y;
+ const uint8_t *a = src[plane_count] + srcStride[plane_count] * y;
+ uint8_t *d = dst[plane ] + dstStride[plane] * y;
+ for (x = 0; x < w; x++) {
+ unsigned u = s[x]*a[x] + target_table[((x^y)>>5)&1][plane]*(255-a[x]) + 128;
+ d[x] = (257*u) >> 16;
+ }
+ }
+ }
+ }
+ }
+ } else {
+ int alpha_pos = desc->comp[plane_count].offset;
+ int w = c->srcW;
+ for (y = srcSliceY; y < srcSliceH; y++) {
+ if (sixteen_bits) {
+ const uint16_t *s = (const uint16_t *)(src[0] + srcStride[0] * y + 2*!alpha_pos);
+ const uint16_t *a = (const uint16_t *)(src[0] + srcStride[0] * y + alpha_pos);
+ uint16_t *d = ( uint16_t *)(dst[0] + dstStride[0] * y);
+ if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+ for (x = 0; x < w; x++) {
+ for (plane = 0; plane < plane_count; plane++) {
+ int x_index = (plane_count + 1) * x;
+ unsigned u = s[x_index + plane]*a[x_index] + target_table[((x^y)>>5)&1][plane]*(max-a[x_index]) + off;
+ d[plane_count*x + plane] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ }
+ } else {
+ for (x = 0; x < w; x++) {
+ for (plane = 0; plane < plane_count; plane++) {
+ int x_index = (plane_count + 1) * x;
+ unsigned aswap =av_bswap16(a[x_index]);
+ unsigned u = av_bswap16(s[x_index + plane])*aswap + target_table[((x^y)>>5)&1][plane]*(max-aswap) + off;
+ d[plane_count*x + plane] = av_clip((u + (u >> shift)) >> shift, 0, max);
+ }
+ }
+ }
+ } else {
+ const uint8_t *s = src[0] + srcStride[0] * y + !alpha_pos;
+ const uint8_t *a = src[0] + srcStride[0] * y + alpha_pos;
+ uint8_t *d = dst[0] + dstStride[0] * y;
+ for (x = 0; x < w; x++) {
+ for (plane = 0; plane < plane_count; plane++) {
+ int x_index = (plane_count + 1) * x;
+ unsigned u = s[x_index + plane]*a[x_index] + target_table[((x^y)>>5)&1][plane]*(255-a[x_index]) + 128;
+ d[plane_count*x + plane] = (257*u) >> 16;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libswscale/gamma.c b/chromium/third_party/ffmpeg/libswscale/gamma.c
new file mode 100644
index 00000000000..d7470cb1c97
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/gamma.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 Pedro Arthur <bygrandao@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "swscale_internal.h"
+
+typedef struct GammaContext
+{
+ uint16_t *table;
+} GammaContext;
+
+// gamma_convert expects 16 bit rgb format
+// it writes directly in src slice thus it must be modifiable (done through cascade context)
+static int gamma_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ GammaContext *instance = desc->instance;
+ uint16_t *table = instance->table;
+ int srcW = desc->src->width;
+
+ int i;
+ for (i = 0; i < sliceH; ++i) {
+ uint8_t ** src = desc->src->plane[0].line;
+ int src_pos = sliceY+i - desc->src->plane[0].sliceY;
+
+ uint16_t *src1 = (uint16_t*)*(src+src_pos);
+ int j;
+ for (j = 0; j < srcW; ++j) {
+ uint16_t r = AV_RL16(src1 + j*4 + 0);
+ uint16_t g = AV_RL16(src1 + j*4 + 1);
+ uint16_t b = AV_RL16(src1 + j*4 + 2);
+
+ AV_WL16(src1 + j*4 + 0, table[r]);
+ AV_WL16(src1 + j*4 + 1, table[g]);
+ AV_WL16(src1 + j*4 + 2, table[b]);
+ }
+
+ }
+ return sliceH;
+}
+
+
+int ff_init_gamma_convert(SwsFilterDescriptor *desc, SwsSlice * src, uint16_t *table)
+{
+ GammaContext *li = av_malloc(sizeof(GammaContext));
+ if (!li)
+ return AVERROR(ENOMEM);
+ li->table = table;
+
+ desc->instance = li;
+ desc->src = src;
+ desc->dst = NULL;
+ desc->process = &gamma_convert;
+
+ return 0;
+}
+
diff --git a/chromium/third_party/ffmpeg/libswscale/hscale.c b/chromium/third_party/ffmpeg/libswscale/hscale.c
new file mode 100644
index 00000000000..ca095761964
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/hscale.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2015 Pedro Arthur <bygrandao@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "swscale_internal.h"
+
+static int lum_h_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ FilterContext *instance = desc->instance;
+ int srcW = desc->src->width;
+ int dstW = desc->dst->width;
+ int xInc = instance->xInc;
+
+ int i;
+ for (i = 0; i < sliceH; ++i) {
+ uint8_t ** src = desc->src->plane[0].line;
+ uint8_t ** dst = desc->dst->plane[0].line;
+ int src_pos = sliceY+i - desc->src->plane[0].sliceY;
+ int dst_pos = sliceY+i - desc->dst->plane[0].sliceY;
+
+
+ if (c->hyscale_fast) {
+ c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+ } else {
+ c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+ instance->filter_pos, instance->filter_size);
+ }
+
+ if (c->lumConvertRange)
+ c->lumConvertRange((int16_t*)dst[dst_pos], dstW);
+
+ desc->dst->plane[0].sliceH += 1;
+
+ if (desc->alpha) {
+ src = desc->src->plane[3].line;
+ dst = desc->dst->plane[3].line;
+
+ src_pos = sliceY+i - desc->src->plane[3].sliceY;
+ dst_pos = sliceY+i - desc->dst->plane[3].sliceY;
+
+ desc->dst->plane[3].sliceH += 1;
+
+ if (c->hyscale_fast) {
+ c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+ } else {
+ c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+ instance->filter_pos, instance->filter_size);
+ }
+ }
+ }
+
+ return sliceH;
+}
+
+static int lum_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ int srcW = desc->src->width;
+ ColorContext * instance = desc->instance;
+ uint32_t * pal = instance->pal;
+ int i;
+
+ desc->dst->plane[0].sliceY = sliceY;
+ desc->dst->plane[0].sliceH = sliceH;
+ desc->dst->plane[3].sliceY = sliceY;
+ desc->dst->plane[3].sliceH = sliceH;
+
+ for (i = 0; i < sliceH; ++i) {
+ int sp0 = sliceY+i - desc->src->plane[0].sliceY;
+ int sp1 = ((sliceY+i) >> desc->src->v_chr_sub_sample) - desc->src->plane[1].sliceY;
+ const uint8_t * src[4] = { desc->src->plane[0].line[sp0],
+ desc->src->plane[1].line[sp1],
+ desc->src->plane[2].line[sp1],
+ desc->src->plane[3].line[sp0]};
+ uint8_t * dst = desc->dst->plane[0].line[i];
+
+ if (c->lumToYV12) {
+ c->lumToYV12(dst, src[0], src[1], src[2], srcW, pal);
+ } else if (c->readLumPlanar) {
+ c->readLumPlanar(dst, src, srcW, c->input_rgb2yuv_table);
+ }
+
+
+ if (desc->alpha) {
+ dst = desc->dst->plane[3].line[i];
+ if (c->alpToYV12) {
+ c->alpToYV12(dst, src[3], src[1], src[2], srcW, pal);
+ } else if (c->readAlpPlanar) {
+ c->readAlpPlanar(dst, src, srcW, NULL);
+ }
+ }
+ }
+
+ return sliceH;
+}
+
+int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal)
+{
+ ColorContext * li = av_malloc(sizeof(ColorContext));
+ if (!li)
+ return AVERROR(ENOMEM);
+ li->pal = pal;
+ desc->instance = li;
+
+ desc->alpha = isALPHA(src->fmt) && isALPHA(dst->fmt);
+ desc->src =src;
+ desc->dst = dst;
+ desc->process = &lum_convert;
+
+ return 0;
+}
+
+
+int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc)
+{
+ FilterContext *li = av_malloc(sizeof(FilterContext));
+ if (!li)
+ return AVERROR(ENOMEM);
+
+ li->filter = filter;
+ li->filter_pos = filter_pos;
+ li->filter_size = filter_size;
+ li->xInc = xInc;
+
+ desc->instance = li;
+
+ desc->alpha = isALPHA(src->fmt) && isALPHA(dst->fmt);
+ desc->src = src;
+ desc->dst = dst;
+
+ desc->process = &lum_h_scale;
+
+ return 0;
+}
+
+static int chr_h_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ FilterContext *instance = desc->instance;
+ int srcW = FF_CEIL_RSHIFT(desc->src->width, desc->src->h_chr_sub_sample);
+ int dstW = FF_CEIL_RSHIFT(desc->dst->width, desc->dst->h_chr_sub_sample);
+ int xInc = instance->xInc;
+
+ uint8_t ** src1 = desc->src->plane[1].line;
+ uint8_t ** dst1 = desc->dst->plane[1].line;
+ uint8_t ** src2 = desc->src->plane[2].line;
+ uint8_t ** dst2 = desc->dst->plane[2].line;
+
+ int src_pos1 = sliceY - desc->src->plane[1].sliceY;
+ int dst_pos1 = sliceY - desc->dst->plane[1].sliceY;
+
+ int src_pos2 = sliceY - desc->src->plane[2].sliceY;
+ int dst_pos2 = sliceY - desc->dst->plane[2].sliceY;
+
+ int i;
+ for (i = 0; i < sliceH; ++i) {
+ if (c->hcscale_fast) {
+ c->hcscale_fast(c, (uint16_t*)dst1[dst_pos1+i], (uint16_t*)dst2[dst_pos2+i], dstW, src1[src_pos1+i], src2[src_pos2+i], srcW, xInc);
+ } else {
+ c->hcScale(c, (uint16_t*)dst1[dst_pos1+i], dstW, src1[src_pos1+i], instance->filter, instance->filter_pos, instance->filter_size);
+ c->hcScale(c, (uint16_t*)dst2[dst_pos2+i], dstW, src2[src_pos2+i], instance->filter, instance->filter_pos, instance->filter_size);
+ }
+
+ if (c->chrConvertRange)
+ c->chrConvertRange((uint16_t*)dst1[dst_pos1+i], (uint16_t*)dst2[dst_pos2+i], dstW);
+
+ desc->dst->plane[1].sliceH += 1;
+ desc->dst->plane[2].sliceH += 1;
+ }
+ return sliceH;
+}
+
+static int chr_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ int srcW = FF_CEIL_RSHIFT(desc->src->width, desc->src->h_chr_sub_sample);
+ ColorContext * instance = desc->instance;
+ uint32_t * pal = instance->pal;
+
+ int sp0 = (sliceY - (desc->src->plane[0].sliceY >> desc->src->v_chr_sub_sample)) << desc->src->v_chr_sub_sample;
+ int sp1 = sliceY - desc->src->plane[1].sliceY;
+
+ int i;
+
+ desc->dst->plane[1].sliceY = sliceY;
+ desc->dst->plane[1].sliceH = sliceH;
+ desc->dst->plane[2].sliceY = sliceY;
+ desc->dst->plane[2].sliceH = sliceH;
+
+ for (i = 0; i < sliceH; ++i) {
+ const uint8_t * src[4] = { desc->src->plane[0].line[sp0+i],
+ desc->src->plane[1].line[sp1+i],
+ desc->src->plane[2].line[sp1+i],
+ desc->src->plane[3].line[sp0+i]};
+
+ uint8_t * dst1 = desc->dst->plane[1].line[i];
+ uint8_t * dst2 = desc->dst->plane[2].line[i];
+ if (c->chrToYV12) {
+ c->chrToYV12(dst1, dst2, src[0], src[1], src[2], srcW, pal);
+ } else if (c->readChrPlanar) {
+ c->readChrPlanar(dst1, dst2, src, srcW, c->input_rgb2yuv_table);
+ }
+ }
+ return sliceH;
+}
+
+int ff_init_desc_cfmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal)
+{
+ ColorContext * li = av_malloc(sizeof(ColorContext));
+ if (!li)
+ return AVERROR(ENOMEM);
+ li->pal = pal;
+ desc->instance = li;
+
+ desc->src =src;
+ desc->dst = dst;
+ desc->process = &chr_convert;
+
+ return 0;
+}
+
+int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc)
+{
+ FilterContext *li = av_malloc(sizeof(FilterContext));
+ if (!li)
+ return AVERROR(ENOMEM);
+
+ li->filter = filter;
+ li->filter_pos = filter_pos;
+ li->filter_size = filter_size;
+ li->xInc = xInc;
+
+ desc->instance = li;
+
+ desc->alpha = isALPHA(src->fmt) && isALPHA(dst->fmt);
+ desc->src = src;
+ desc->dst = dst;
+
+ desc->process = &chr_h_scale;
+
+ return 0;
+}
+
+static int no_chr_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ desc->dst->plane[1].sliceY = sliceY + sliceH - desc->dst->plane[1].available_lines;
+ desc->dst->plane[1].sliceH = desc->dst->plane[1].available_lines;
+ desc->dst->plane[2].sliceY = sliceY + sliceH - desc->dst->plane[2].available_lines;
+ desc->dst->plane[2].sliceH = desc->dst->plane[2].available_lines;
+ return 0;
+}
+
+int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst)
+{
+ desc->src = src;
+ desc->dst = dst;
+ desc->alpha = 0;
+ desc->instance = NULL;
+ desc->process = &no_chr_scale;
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libswscale/input.c b/chromium/third_party/ffmpeg/libswscale/input.c
index 1f04fc27523..5906ea86e71 100644
--- a/chromium/third_party/ffmpeg/libswscale/input.c
+++ b/chromium/third_party/ffmpeg/libswscale/input.c
@@ -607,6 +607,33 @@ static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t
AV_WN16(dst + i * 2, AV_RB16(src + i * 4 + 2));
}
+static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
+ uint32_t *unused2)
+{
+ int i;
+ for (i = 0; i < width; i++)
+ AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2));
+}
+
+
+static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src,
+ const uint8_t *unused1, int width, uint32_t *unused2)
+{
+ int i;
+ for (i = 0; i < width; i++) {
+ AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 4));
+ AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6));
+ }
+}
+
+static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width,
+ uint32_t *unused2)
+{
+ int i;
+ for (i = 0; i < width; i++)
+ AV_WN16(dst + i * 2, AV_RL16(src + i * 8));
+}
+
/* This is almost identical to the previous, end exists only because
* yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
@@ -987,6 +1014,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->chrToYV12 = bswap16UV_c;
break;
#endif
+ case AV_PIX_FMT_AYUV64LE:
+ c->chrToYV12 = read_ayuv64le_UV_c;
+ break;
}
if (c->chrSrcHSubSample) {
switch (srcFormat) {
@@ -1271,6 +1301,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YA16BE:
c->lumToYV12 = read_ya16be_gray_c;
break;
+ case AV_PIX_FMT_AYUV64LE:
+ c->lumToYV12 = read_ayuv64le_Y_c;
+ break;
case AV_PIX_FMT_YUYV422:
case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_YA8:
@@ -1397,6 +1430,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YA16BE:
c->alpToYV12 = read_ya16be_alpha_c;
break;
+ case AV_PIX_FMT_AYUV64LE:
+ c->alpToYV12 = read_ayuv64le_A_c;
+ break;
case AV_PIX_FMT_PAL8 :
c->alpToYV12 = palToA_c;
break;
diff --git a/chromium/third_party/ffmpeg/libswscale/options.c b/chromium/third_party/ffmpeg/libswscale/options.c
index f08267c6096..ac35af7bd85 100644
--- a/chromium/third_party/ffmpeg/libswscale/options.c
+++ b/chromium/third_party/ffmpeg/libswscale/options.c
@@ -75,9 +75,11 @@ static const AVOption swscale_options[] = {
{ "ed", "error diffusion", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_ED }, INT_MIN, INT_MAX, VE, "sws_dither" },
{ "a_dither", "arithmetic addition dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_A_DITHER}, INT_MIN, INT_MAX, VE, "sws_dither" },
{ "x_dither", "arithmetic xor dither", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_DITHER_X_DITHER}, INT_MIN, INT_MAX, VE, "sws_dither" },
- { "gamma", "gamma correct scaling", OFFSET(gamma_flag), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE, "gamma" },
- { "true", "enable", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "gamma" },
- { "false", "disable", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "gamma" },
+ { "gamma", "gamma correct scaling", OFFSET(gamma_flag),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+ { "alphablend", "mode for alpha -> non alpha", OFFSET(alphablend),AV_OPT_TYPE_INT, { .i64 = SWS_ALPHA_BLEND_NONE}, 0, SWS_ALPHA_BLEND_NB-1, VE, "alphablend" },
+ { "none", "ignore alpha", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_ALPHA_BLEND_NONE}, INT_MIN, INT_MAX, VE, "alphablend" },
+ { "uniform_color", "blend onto a uniform color", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_ALPHA_BLEND_UNIFORM},INT_MIN, INT_MAX, VE, "alphablend" },
+ { "checkerboard", "blend onto a checkerboard", 0, AV_OPT_TYPE_CONST, { .i64 = SWS_ALPHA_BLEND_CHECKERBOARD},INT_MIN, INT_MAX, VE, "alphablend" },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libswscale/output.c b/chromium/third_party/ffmpeg/libswscale/output.c
index f63af3b2108..3188baadf9e 100644
--- a/chromium/third_party/ffmpeg/libswscale/output.c
+++ b/chromium/third_party/ffmpeg/libswscale/output.c
@@ -1845,7 +1845,7 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
int i;
int hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) && alpSrc;
uint16_t **dest16 = (uint16_t**)dest;
- int SH = 22 + 7 - desc->comp[0].depth_minus1;
+ int SH = 22 + 8 - desc->comp[0].depth;
int A = 0; // init to silence warning
for (i = 0; i < dstW; i++) {
@@ -1917,6 +1917,146 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
}
}
+static void
+yuv2ya8_1_c(SwsContext *c, const int16_t *buf0,
+ const int16_t *ubuf[2], const int16_t *vbuf[2],
+ const int16_t *abuf0, uint8_t *dest, int dstW,
+ int uvalpha, int y)
+{
+ int hasAlpha = !!abuf0;
+ int i;
+
+ for (i = 0; i < dstW; i++) {
+ int Y = (buf0[i] + 64) >> 7;
+ int A;
+
+ Y = av_clip_uint8(Y);
+
+ if (hasAlpha) {
+ A = (abuf0[i] + 64) >> 7;
+ if (A & 0x100)
+ A = av_clip_uint8(A);
+ }
+
+ dest[i * 2 ] = Y;
+ dest[i * 2 + 1] = hasAlpha ? A : 255;
+ }
+}
+
+static void
+yuv2ya8_2_c(SwsContext *c, const int16_t *buf[2],
+ const int16_t *ubuf[2], const int16_t *vbuf[2],
+ const int16_t *abuf[2], uint8_t *dest, int dstW,
+ int yalpha, int uvalpha, int y)
+{
+ int hasAlpha = abuf && abuf[0] && abuf[1];
+ const int16_t *buf0 = buf[0], *buf1 = buf[1],
+ *abuf0 = hasAlpha ? abuf[0] : NULL,
+ *abuf1 = hasAlpha ? abuf[1] : NULL;
+ int yalpha1 = 4096 - yalpha;
+ int i;
+
+ for (i = 0; i < dstW; i++) {
+ int Y = (buf0[i] * yalpha1 + buf1[i] * yalpha) >> 19;
+ int A;
+
+ Y = av_clip_uint8(Y);
+
+ if (hasAlpha) {
+ A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha) >> 19;
+ A = av_clip_uint8(A);
+ }
+
+ dest[i * 2 ] = Y;
+ dest[i * 2 + 1] = hasAlpha ? A : 255;
+ }
+}
+
+static void
+yuv2ya8_X_c(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+ int hasAlpha = !!alpSrc;
+ int i;
+
+ for (i = 0; i < dstW; i++) {
+ int j;
+ int Y = 1 << 18, A = 1 << 18;
+
+ for (j = 0; j < lumFilterSize; j++)
+ Y += lumSrc[j][i] * lumFilter[j];
+
+ Y >>= 19;
+ if (Y & 0x100)
+ Y = av_clip_uint8(Y);
+
+ if (hasAlpha) {
+ for (j = 0; j < lumFilterSize; j++)
+ A += alpSrc[j][i] * lumFilter[j];
+
+ A >>= 19;
+
+ if (A & 0x100)
+ A = av_clip_uint8(A);
+ }
+
+ dest[2 * i ] = Y;
+ dest[2 * i + 1] = hasAlpha ? A : 255;
+ }
+}
+
+static void
+yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **_lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **_chrUSrc,
+ const int16_t **_chrVSrc, int chrFilterSize,
+ const int16_t **_alpSrc, uint8_t *dest, int dstW, int y)
+{
+ const int32_t **lumSrc = (const int32_t **) _lumSrc,
+ **chrUSrc = (const int32_t **) _chrUSrc,
+ **chrVSrc = (const int32_t **) _chrVSrc,
+ **alpSrc = (const int32_t **) _alpSrc;
+ int hasAlpha = !!alpSrc;
+ int i;
+
+ for (i = 0; i < dstW; i++) {
+ int Y = 1 << 14, U = 1 << 14;
+ int V = 1 << 14, A = 1 << 14;
+ int j;
+
+ Y -= 0x40000000;
+ U -= 0x40000000;
+ V -= 0x40000000;
+ A -= 0x40000000;
+
+ for (j = 0; j < lumFilterSize; j++)
+ Y += lumSrc[j][i] * (unsigned)lumFilter[j];
+
+ for (j = 0; j < chrFilterSize; j++)
+ U += chrUSrc[j][i] * (unsigned)chrFilter[j];
+
+ for (j = 0; j < chrFilterSize; j++)
+ V += chrVSrc[j][i] * (unsigned)chrFilter[j];
+
+ if (hasAlpha)
+ for (j = 0; j < lumFilterSize; j++)
+ A += alpSrc[j][i] * (unsigned)lumFilter[j];
+
+ Y = 0x8000 + av_clip_int16(Y >> 15);
+ U = 0x8000 + av_clip_int16(U >> 15);
+ V = 0x8000 + av_clip_int16(V >> 15);
+ A = 0x8000 + av_clip_int16(A >> 15);
+
+ AV_WL16(dest + 8 * i, hasAlpha ? A : 65535);
+ AV_WL16(dest + 8 * i + 2, Y);
+ AV_WL16(dest + 8 * i + 4, U);
+ AV_WL16(dest + 8 * i + 6, V);
+ }
+}
+
av_cold void ff_sws_init_output_funcs(SwsContext *c,
yuv2planar1_fn *yuv2plane1,
yuv2planarX_fn *yuv2planeX,
@@ -1933,16 +2073,16 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
} else if (is9_OR_10BPS(dstFormat)) {
- if (desc->comp[0].depth_minus1 == 8) {
+ if (desc->comp[0].depth == 9) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
- } else if (desc->comp[0].depth_minus1 == 9) {
+ } else if (desc->comp[0].depth == 10) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_10LE_c;
- } else if (desc->comp[0].depth_minus1 == 11) {
+ } else if (desc->comp[0].depth == 12) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_12BE_c : yuv2planeX_12LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_12BE_c : yuv2plane1_12LE_c;
- } else if (desc->comp[0].depth_minus1 == 13) {
+ } else if (desc->comp[0].depth == 14) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_14BE_c : yuv2planeX_14LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_14BE_c : yuv2plane1_14LE_c;
} else
@@ -2361,5 +2501,13 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
*yuv2packed2 = yuv2uyvy422_2_c;
*yuv2packedX = yuv2uyvy422_X_c;
break;
+ case AV_PIX_FMT_YA8:
+ *yuv2packed1 = yuv2ya8_1_c;
+ *yuv2packed2 = yuv2ya8_2_c;
+ *yuv2packedX = yuv2ya8_X_c;
+ break;
+ case AV_PIX_FMT_AYUV64LE:
+ *yuv2packedX = yuv2ayuv64le_X_c;
+ break;
}
}
diff --git a/chromium/third_party/ffmpeg/libswscale/ppc/yuv2rgb_altivec.c b/chromium/third_party/ffmpeg/libswscale/ppc/yuv2rgb_altivec.c
index 25282bf1008..638706f0278 100644
--- a/chromium/third_party/ffmpeg/libswscale/ppc/yuv2rgb_altivec.c
+++ b/chromium/third_party/ffmpeg/libswscale/ppc/yuv2rgb_altivec.c
@@ -222,6 +222,7 @@ static const vector unsigned char
* optimized for JPEG decoding.
*/
+#if HAVE_BIGENDIAN
#define vec_unh(x) \
(vector signed short) \
vec_perm(x, (__typeof__(x)) { 0 }, \
@@ -235,6 +236,10 @@ static const vector unsigned char
((vector unsigned char) { \
0x10, 0x08, 0x10, 0x09, 0x10, 0x0A, 0x10, 0x0B, \
0x10, 0x0C, 0x10, 0x0D, 0x10, 0x0E, 0x10, 0x0F }))
+#else
+#define vec_unh(x)(vector signed short) vec_mergeh(x,(__typeof__(x)) { 0 })
+#define vec_unl(x)(vector signed short) vec_mergel(x,(__typeof__(x)) { 0 })
+#endif
#define vec_clip_s16(x) \
vec_max(vec_min(x, ((vector signed short) { \
diff --git a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
index 5b1fcf73ca6..340174fd659 100644
--- a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
+++ b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.c
@@ -51,6 +51,7 @@ void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size);
void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size);
void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size);
+void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size);
void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
@@ -333,7 +334,6 @@ void shuffle_bytes_ ## a ## b ## c ## d(const uint8_t *src, \
} \
}
-DEFINE_SHUFFLE_BYTES(0, 3, 2, 1)
DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
diff --git a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.h b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.h
index 5df5dea4209..8faebe6a438 100644
--- a/chromium/third_party/ffmpeg/libswscale/rgb2rgb.h
+++ b/chromium/third_party/ffmpeg/libswscale/rgb2rgb.h
@@ -50,6 +50,7 @@ extern void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size);
extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
+extern void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size);
extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size);
@@ -71,7 +72,6 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size);
void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size);
-void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, int src_size);
void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, int src_size);
void shuffle_bytes_3012(const uint8_t *src, uint8_t *dst, int src_size);
void shuffle_bytes_3210(const uint8_t *src, uint8_t *dst, int src_size);
diff --git a/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c b/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
index f9a98a87010..1cc28cdd13f 100644
--- a/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/rgb2rgb_template.c
@@ -322,12 +322,26 @@ static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst,
uint8_t *d = dst - idx;
for (; idx < 15; idx += 4) {
- register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
+ register unsigned v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
v &= 0xff00ff;
*(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16);
}
}
+static inline void shuffle_bytes_0321_c(const uint8_t *src, uint8_t *dst,
+ int src_size)
+{
+ int idx = 15 - src_size;
+ const uint8_t *s = src - idx;
+ uint8_t *d = dst - idx;
+
+ for (; idx < 15; idx += 4) {
+ register unsigned v = *(const uint32_t *)&s[idx], g = v & 0x00ff00ff;
+ v &= 0xff00ff00;
+ *(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16);
+ }
+}
+
static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size)
{
unsigned i;
@@ -929,7 +943,13 @@ static av_cold void rgb2rgb_init_c(void)
rgb24to15 = rgb24to15_c;
rgb24to16 = rgb24to16_c;
rgb24tobgr24 = rgb24tobgr24_c;
+#if HAVE_BIGENDIAN
+ shuffle_bytes_0321 = shuffle_bytes_2103_c;
+ shuffle_bytes_2103 = shuffle_bytes_0321_c;
+#else
+ shuffle_bytes_0321 = shuffle_bytes_0321_c;
shuffle_bytes_2103 = shuffle_bytes_2103_c;
+#endif
rgb32tobgr16 = rgb32tobgr16_c;
rgb32tobgr15 = rgb32tobgr15_c;
yv12toyuy2 = yv12toyuy2_c;
diff --git a/chromium/third_party/ffmpeg/libswscale/slice.c b/chromium/third_party/ffmpeg/libswscale/slice.c
new file mode 100644
index 00000000000..94841e5776f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/slice.c
@@ -0,0 +1,347 @@
+/*
+ * Copyright (C) 2015 Pedro Arthur <bygrandao@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "swscale_internal.h"
+
+static void free_lines(SwsSlice *s)
+{
+ int i;
+ for (i = 0; i < 2; ++i) {
+ int n = s->plane[i].available_lines;
+ int j;
+ for (j = 0; j < n; ++j) {
+ av_freep(&s->plane[i].line[j]);
+ if (s->is_ring)
+ s->plane[i].line[j+n] = NULL;
+ }
+ }
+
+ for (i = 0; i < 4; ++i)
+ memset(s->plane[i].line, 0, sizeof(uint8_t*) * s->plane[i].available_lines * (s->is_ring ? 3 : 1));
+ s->should_free_lines = 0;
+}
+
+/*
+ slice lines contains extra bytes for vetorial code thus @size
+ is the allocated memory size and @width is the number of pixels
+*/
+static int alloc_lines(SwsSlice *s, int size, int width)
+{
+ int i;
+ int idx[2] = {3, 2};
+
+ s->should_free_lines = 1;
+ s->width = width;
+
+ for (i = 0; i < 2; ++i) {
+ int n = s->plane[i].available_lines;
+ int j;
+ int ii = idx[i];
+
+ av_assert0(n == s->plane[ii].available_lines);
+ for (j = 0; j < n; ++j) {
+ // chroma plane line U and V are expected to be contiguous in memory
+ // by mmx vertical scaler code
+ s->plane[i].line[j] = av_malloc(size * 2 + 32);
+ if (!s->plane[i].line[j]) {
+ free_lines(s);
+ return AVERROR(ENOMEM);
+ }
+ s->plane[ii].line[j] = s->plane[i].line[j] + size + 16;
+ if (s->is_ring) {
+ s->plane[i].line[j+n] = s->plane[i].line[j];
+ s->plane[ii].line[j+n] = s->plane[ii].line[j];
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int alloc_slice(SwsSlice *s, enum AVPixelFormat fmt, int lumLines, int chrLines, int h_sub_sample, int v_sub_sample, int ring)
+{
+ int i;
+ int size[4] = { lumLines,
+ chrLines,
+ chrLines,
+ lumLines };
+
+ s->h_chr_sub_sample = h_sub_sample;
+ s->v_chr_sub_sample = v_sub_sample;
+ s->fmt = fmt;
+ s->is_ring = ring;
+ s->should_free_lines = 0;
+
+ for (i = 0; i < 4; ++i) {
+ int n = size[i] * ( ring == 0 ? 1 : 3);
+ s->plane[i].line = av_mallocz_array(sizeof(uint8_t*), n);
+ if (!s->plane[i].line)
+ return AVERROR(ENOMEM);
+
+ s->plane[i].tmp = ring ? s->plane[i].line + size[i] * 2 : NULL;
+ s->plane[i].available_lines = size[i];
+ s->plane[i].sliceY = 0;
+ s->plane[i].sliceH = 0;
+ }
+ return 0;
+}
+
+static void free_slice(SwsSlice *s)
+{
+ int i;
+ if (s) {
+ if (s->should_free_lines)
+ free_lines(s);
+ for (i = 0; i < 4; ++i) {
+ av_freep(&s->plane[i].line);
+ s->plane[i].tmp = NULL;
+ }
+ }
+}
+
+int ff_rotate_slice(SwsSlice *s, int lum, int chr)
+{
+ int i;
+ if (lum) {
+ for (i = 0; i < 4; i+=3) {
+ int n = s->plane[i].available_lines;
+ int l = lum - s->plane[i].sliceY;
+
+ if (l >= n * 2) {
+ s->plane[i].sliceY += n;
+ s->plane[i].sliceH -= n;
+ }
+ }
+ }
+ if (chr) {
+ for (i = 1; i < 3; ++i) {
+ int n = s->plane[i].available_lines;
+ int l = chr - s->plane[i].sliceY;
+
+ if (l >= n * 2) {
+ s->plane[i].sliceY += n;
+ s->plane[i].sliceH -= n;
+ }
+ }
+ }
+ return 0;
+}
+
+int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH)
+{
+ int i = 0;
+
+ const int start[4] = {lumY,
+ chrY,
+ chrY,
+ lumY};
+
+ const int end[4] = {lumY +lumH,
+ chrY + chrH,
+ chrY + chrH,
+ lumY + lumH};
+
+ s->width = srcW;
+
+ for (i = 0; i < 4; ++i) {
+ int j;
+ int lines = end[i];
+ lines = s->plane[i].available_lines < lines ? s->plane[i].available_lines : lines;
+
+ if (end[i] > s->plane[i].sliceY+s->plane[i].sliceH) {
+ if (start[i] <= s->plane[i].sliceY+1)
+ s->plane[i].sliceY = FFMIN(start[i], s->plane[i].sliceY);
+ else
+ s->plane[i].sliceY = start[i];
+ s->plane[i].sliceH = end[i] - s->plane[i].sliceY;
+ } else {
+ if (end[i] >= s->plane[i].sliceY)
+ s->plane[i].sliceH = s->plane[i].sliceY + s->plane[i].sliceH - start[i];
+ else
+ s->plane[i].sliceH = end[i] - start[i];
+ s->plane[i].sliceY = start[i];
+ }
+
+ for (j = start[i]; j < lines; j+= 1)
+ s->plane[i].line[j] = src[i] + (start[i] + j) * stride[i];
+
+ }
+
+ return 0;
+}
+
+static void fill_ones(SwsSlice *s, int n, int is16bit)
+{
+ int i;
+ for (i = 0; i < 4; ++i) {
+ int j;
+ int size = s->plane[i].available_lines;
+ for (j = 0; j < size; ++j) {
+ int k;
+ int end = is16bit ? n>>1: n;
+ // fill also one extra element
+ end += 1;
+ if (is16bit)
+ for (k = 0; k < end; ++k)
+ ((int32_t*)(s->plane[i].line[j]))[k] = 1<<18;
+ else
+ for (k = 0; k < end; ++k)
+ ((int16_t*)(s->plane[i].line[j]))[k] = 1<<14;
+ }
+ }
+}
+
+int ff_init_filters(SwsContext * c)
+{
+ int i;
+ int index;
+ int num_ydesc;
+ int num_cdesc;
+ int num_vdesc = isPlanarYUV(c->dstFormat) && !isGray(c->dstFormat) ? 2 : 1;
+ int need_lum_conv = c->lumToYV12 || c->readLumPlanar || c->alpToYV12 || c->readAlpPlanar;
+ int need_chr_conv = c->chrToYV12 || c->readChrPlanar;
+ int need_gamma = c->is_internal_gamma;
+ int srcIdx, dstIdx;
+ int dst_stride = FFALIGN(c->dstW * sizeof(int16_t) + 66, 16);
+
+ uint32_t * pal = usePal(c->srcFormat) ? c->pal_yuv : (uint32_t*)c->input_rgb2yuv_table;
+ int res = 0;
+
+ if (c->dstBpc == 16)
+ dst_stride <<= 1;
+
+ num_ydesc = need_lum_conv ? 2 : 1;
+ num_cdesc = need_chr_conv ? 2 : 1;
+
+ c->numSlice = FFMAX(num_ydesc, num_cdesc) + 2;
+ c->numDesc = num_ydesc + num_cdesc + num_vdesc + (need_gamma ? 2 : 0);
+ c->descIndex[0] = num_ydesc + (need_gamma ? 1 : 0);
+ c->descIndex[1] = num_ydesc + num_cdesc + (need_gamma ? 1 : 0);
+
+
+
+ c->desc = av_mallocz_array(sizeof(SwsFilterDescriptor), c->numDesc);
+ if (!c->desc)
+ return AVERROR(ENOMEM);
+ c->slice = av_mallocz_array(sizeof(SwsSlice), c->numSlice);
+
+
+ res = alloc_slice(&c->slice[0], c->srcFormat, c->srcH, c->chrSrcH, c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
+ if (res < 0) goto cleanup;
+ for (i = 1; i < c->numSlice-2; ++i) {
+ res = alloc_slice(&c->slice[i], c->srcFormat, c->vLumFilterSize + MAX_LINES_AHEAD, c->vChrFilterSize + MAX_LINES_AHEAD, c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
+ if (res < 0) goto cleanup;
+ res = alloc_lines(&c->slice[i], FFALIGN(c->srcW*2+78, 16), c->srcW);
+ if (res < 0) goto cleanup;
+ }
+ // horizontal scaler output
+ res = alloc_slice(&c->slice[i], c->srcFormat, c->vLumFilterSize + MAX_LINES_AHEAD, c->vChrFilterSize + MAX_LINES_AHEAD, c->chrDstHSubSample, c->chrDstVSubSample, 1);
+ if (res < 0) goto cleanup;
+ res = alloc_lines(&c->slice[i], dst_stride, c->dstW);
+ if (res < 0) goto cleanup;
+
+ fill_ones(&c->slice[i], dst_stride>>1, c->dstBpc == 16);
+
+ // vertical scaler output
+ ++i;
+ res = alloc_slice(&c->slice[i], c->dstFormat, c->dstH, c->chrDstH, c->chrDstHSubSample, c->chrDstVSubSample, 0);
+ if (res < 0) goto cleanup;
+
+ index = 0;
+ srcIdx = 0;
+ dstIdx = 1;
+
+ if (need_gamma) {
+ res = ff_init_gamma_convert(c->desc + index, c->slice + srcIdx, c->inv_gamma);
+ if (res < 0) goto cleanup;
+ ++index;
+ }
+
+ if (need_lum_conv) {
+ res = ff_init_desc_fmt_convert(&c->desc[index], &c->slice[srcIdx], &c->slice[dstIdx], pal);
+ if (res < 0) goto cleanup;
+ c->desc[index].alpha = c->alpPixBuf != 0;
+ ++index;
+ srcIdx = dstIdx;
+ }
+
+
+ dstIdx = FFMAX(num_ydesc, num_cdesc);
+ res = ff_init_desc_hscale(&c->desc[index], &c->slice[srcIdx], &c->slice[dstIdx], c->hLumFilter, c->hLumFilterPos, c->hLumFilterSize, c->lumXInc);
+ if (res < 0) goto cleanup;
+ c->desc[index].alpha = c->alpPixBuf != 0;
+
+
+ ++index;
+ {
+ srcIdx = 0;
+ dstIdx = 1;
+ if (need_chr_conv) {
+ res = ff_init_desc_cfmt_convert(&c->desc[index], &c->slice[srcIdx], &c->slice[dstIdx], pal);
+ if (res < 0) goto cleanup;
+ ++index;
+ srcIdx = dstIdx;
+ }
+
+ dstIdx = FFMAX(num_ydesc, num_cdesc);
+ if (c->needs_hcscale)
+ res = ff_init_desc_chscale(&c->desc[index], &c->slice[srcIdx], &c->slice[dstIdx], c->hChrFilter, c->hChrFilterPos, c->hChrFilterSize, c->chrXInc);
+ else
+ res = ff_init_desc_no_chr(&c->desc[index], &c->slice[srcIdx], &c->slice[dstIdx]);
+ if (res < 0) goto cleanup;
+ }
+
+ ++index;
+ {
+ srcIdx = c->numSlice - 2;
+ dstIdx = c->numSlice - 1;
+ res = ff_init_vscale(c, c->desc + index, c->slice + srcIdx, c->slice + dstIdx);
+ if (res < 0) goto cleanup;
+ }
+
+ ++index;
+ if (need_gamma) {
+ res = ff_init_gamma_convert(c->desc + index, c->slice + dstIdx, c->gamma);
+ if (res < 0) goto cleanup;
+ }
+
+ return 0;
+
+cleanup:
+ ff_free_filters(c);
+ return res;
+}
+
+int ff_free_filters(SwsContext *c)
+{
+ int i;
+ if (c->desc) {
+ for (i = 0; i < c->numDesc; ++i)
+ av_freep(&c->desc[i].instance);
+ av_freep(&c->desc);
+ }
+
+ if (c->slice) {
+ for (i = 0; i < c->numSlice; ++i)
+ free_slice(&c->slice[i]);
+ av_freep(&c->slice);
+ }
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale-test.c b/chromium/third_party/ffmpeg/libswscale/swscale-test.c
index 661ff5b7b23..b79bb2373ac 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale-test.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale-test.c
@@ -399,7 +399,7 @@ bad_option:
for (y = 0; y < H; y++)
for (x = 0; x < W * 4; x++)
rgb_data[ x + y * 4 * W] = av_lfg_get(&rand);
- sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
+ sws_scale(sws, rgb_src, rgb_stride, 0, H / 12, src, stride);
sws_freeContext(sws);
av_free(rgb_data);
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale.c b/chromium/third_party/ffmpeg/libswscale/swscale.c
index 1945e1dc9bb..9558048a561 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale.c
@@ -87,10 +87,10 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
int i;
int32_t *dst = (int32_t *) _dst;
const uint16_t *src = (const uint16_t *) _src;
- int bits = desc->comp[0].depth_minus1;
+ int bits = desc->comp[0].depth - 1;
int sh = bits - 4;
- if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth_minus1<15)
+ if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16)
sh= 9;
for (i = 0; i < dstW; i++) {
@@ -113,10 +113,10 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW,
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
int i;
const uint16_t *src = (const uint16_t *) _src;
- int sh = desc->comp[0].depth_minus1;
+ int sh = desc->comp[0].depth - 1;
if(sh<15)
- sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : desc->comp[0].depth_minus1;
+ sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
for (i = 0; i < dstW; i++) {
int j;
@@ -321,35 +321,46 @@ static int swscale(SwsContext *c, const uint8_t *src[],
{
/* load a few things into local vars to make the code more readable?
* and faster */
+#ifndef NEW_FILTER
const int srcW = c->srcW;
+#endif
const int dstW = c->dstW;
const int dstH = c->dstH;
+#ifndef NEW_FILTER
const int chrDstW = c->chrDstW;
const int chrSrcW = c->chrSrcW;
const int lumXInc = c->lumXInc;
const int chrXInc = c->chrXInc;
+#endif
const enum AVPixelFormat dstFormat = c->dstFormat;
const int flags = c->flags;
int32_t *vLumFilterPos = c->vLumFilterPos;
int32_t *vChrFilterPos = c->vChrFilterPos;
+#ifndef NEW_FILTER
int32_t *hLumFilterPos = c->hLumFilterPos;
int32_t *hChrFilterPos = c->hChrFilterPos;
int16_t *hLumFilter = c->hLumFilter;
int16_t *hChrFilter = c->hChrFilter;
int32_t *lumMmxFilter = c->lumMmxFilter;
int32_t *chrMmxFilter = c->chrMmxFilter;
+#endif
const int vLumFilterSize = c->vLumFilterSize;
const int vChrFilterSize = c->vChrFilterSize;
+#ifndef NEW_FILTER
const int hLumFilterSize = c->hLumFilterSize;
const int hChrFilterSize = c->hChrFilterSize;
int16_t **lumPixBuf = c->lumPixBuf;
int16_t **chrUPixBuf = c->chrUPixBuf;
int16_t **chrVPixBuf = c->chrVPixBuf;
+#endif
int16_t **alpPixBuf = c->alpPixBuf;
const int vLumBufSize = c->vLumBufSize;
const int vChrBufSize = c->vChrBufSize;
+#ifndef NEW_FILTER
uint8_t *formatConvBuffer = c->formatConvBuffer;
uint32_t *pal = c->pal_yuv;
+ int perform_gamma = c->is_internal_gamma;
+#endif
yuv2planar1_fn yuv2plane1 = c->yuv2plane1;
yuv2planarX_fn yuv2planeX = c->yuv2planeX;
yuv2interleavedX_fn yuv2nv12cX = c->yuv2nv12cX;
@@ -369,12 +380,28 @@ static int swscale(SwsContext *c, const uint8_t *src[],
int chrBufIndex = c->chrBufIndex;
int lastInLumBuf = c->lastInLumBuf;
int lastInChrBuf = c->lastInChrBuf;
- int perform_gamma = c->is_internal_gamma;
+#ifdef NEW_FILTER
+ int lumStart = 0;
+ int lumEnd = c->descIndex[0];
+ int chrStart = lumEnd;
+ int chrEnd = c->descIndex[1];
+ int vStart = chrEnd;
+ int vEnd = c->numDesc;
+ SwsSlice *src_slice = &c->slice[lumStart];
+ SwsSlice *hout_slice = &c->slice[c->numSlice-2];
+ SwsSlice *vout_slice = &c->slice[c->numSlice-1];
+ SwsFilterDescriptor *desc = c->desc;
+
+ int hasLumHoles = 1;
+ int hasChrHoles = 1;
+#endif
+#ifndef NEW_FILTER
if (!usePal(c->srcFormat)) {
pal = c->input_rgb2yuv_table;
}
+#endif
if (isPacked(c->srcFormat)) {
src[0] =
@@ -439,14 +466,39 @@ static int swscale(SwsContext *c, const uint8_t *src[],
}
lastDstY = dstY;
+#ifdef NEW_FILTER
+ ff_init_vscale_pfn(c, yuv2plane1, yuv2planeX, yuv2nv12cX,
+ yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, c->use_mmx_vfilter);
+
+ ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW,
+ srcSliceY, srcSliceH, chrSrcSliceY, chrSrcSliceH);
+
+ ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW,
+ dstY, dstH, dstY >> c->chrDstVSubSample,
+ FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample));
+
+ hout_slice->plane[0].sliceY = lastInLumBuf + 1;
+ hout_slice->plane[1].sliceY = lastInChrBuf + 1;
+ hout_slice->plane[2].sliceY = lastInChrBuf + 1;
+ hout_slice->plane[3].sliceY = lastInLumBuf + 1;
+
+ hout_slice->plane[0].sliceH =
+ hout_slice->plane[1].sliceH =
+ hout_slice->plane[2].sliceH =
+ hout_slice->plane[3].sliceH = 0;
+ hout_slice->width = dstW;
+#endif
+
for (; dstY < dstH; dstY++) {
const int chrDstY = dstY >> c->chrDstVSubSample;
+#ifndef NEW_FILTER
uint8_t *dest[4] = {
dst[0] + dstStride[0] * dstY,
dst[1] + dstStride[1] * chrDstY,
dst[2] + dstStride[2] * chrDstY,
(CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3] + dstStride[3] * dstY : NULL,
};
+#endif
int use_mmx_vfilter= c->use_mmx_vfilter;
// First line needed as input
@@ -460,12 +512,36 @@ static int swscale(SwsContext *c, const uint8_t *src[],
int lastLumSrcY2 = FFMIN(c->srcH, firstLumSrcY2 + vLumFilterSize) - 1;
int lastChrSrcY = FFMIN(c->chrSrcH, firstChrSrcY + vChrFilterSize) - 1;
int enough_lines;
+#ifdef NEW_FILTER
+ int i;
+ int posY, cPosY, firstPosY, lastPosY, firstCPosY, lastCPosY;
+#endif
// handle holes (FAST_BILINEAR & weird filters)
- if (firstLumSrcY > lastInLumBuf)
+ if (firstLumSrcY > lastInLumBuf) {
+#ifdef NEW_FILTER
+ hasLumHoles = lastInLumBuf != firstLumSrcY - 1;
+ if (hasLumHoles) {
+ hout_slice->plane[0].sliceY = lastInLumBuf + 1;
+ hout_slice->plane[3].sliceY = lastInLumBuf + 1;
+ hout_slice->plane[0].sliceH =
+ hout_slice->plane[3].sliceH = 0;
+ }
+#endif
lastInLumBuf = firstLumSrcY - 1;
- if (firstChrSrcY > lastInChrBuf)
+ }
+ if (firstChrSrcY > lastInChrBuf) {
+#ifdef NEW_FILTER
+ hasChrHoles = lastInChrBuf != firstChrSrcY - 1;
+ if (hasChrHoles) {
+ hout_slice->plane[1].sliceY = lastInChrBuf + 1;
+ hout_slice->plane[2].sliceY = lastInChrBuf + 1;
+ hout_slice->plane[1].sliceH =
+ hout_slice->plane[2].sliceH = 0;
+ }
+#endif
lastInChrBuf = firstChrSrcY - 1;
+ }
av_assert0(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1);
av_assert0(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1);
@@ -486,6 +562,44 @@ static int swscale(SwsContext *c, const uint8_t *src[],
lastLumSrcY, lastChrSrcY);
}
+#ifdef NEW_FILTER
+ posY = hout_slice->plane[0].sliceY + hout_slice->plane[0].sliceH;
+ if (posY <= lastLumSrcY && !hasLumHoles) {
+ firstPosY = FFMAX(firstLumSrcY, posY);
+ lastPosY = FFMIN(lastLumSrcY + MAX_LINES_AHEAD, srcSliceY + srcSliceH - 1);
+ } else {
+ firstPosY = lastInLumBuf + 1;
+ lastPosY = lastLumSrcY;
+ }
+
+ cPosY = hout_slice->plane[1].sliceY + hout_slice->plane[1].sliceH;
+ if (cPosY <= lastChrSrcY && !hasChrHoles) {
+ firstCPosY = FFMAX(firstChrSrcY, cPosY);
+ lastCPosY = FFMIN(lastChrSrcY + MAX_LINES_AHEAD, FF_CEIL_RSHIFT(srcSliceY + srcSliceH, c->chrSrcVSubSample) - 1);
+ } else {
+ firstCPosY = lastInChrBuf + 1;
+ lastCPosY = lastChrSrcY;
+ }
+
+ ff_rotate_slice(hout_slice, lastPosY, lastCPosY);
+
+ if (posY < lastLumSrcY + 1) {
+ for (i = lumStart; i < lumEnd; ++i)
+ desc[i].process(c, &desc[i], firstPosY, lastPosY - firstPosY + 1);
+ }
+
+ lumBufIndex += lastLumSrcY - lastInLumBuf;
+ lastInLumBuf = lastLumSrcY;
+
+ if (cPosY < lastChrSrcY + 1) {
+ for (i = chrStart; i < chrEnd; ++i)
+ desc[i].process(c, &desc[i], firstCPosY, lastCPosY - firstCPosY + 1);
+ }
+
+ chrBufIndex += lastChrSrcY - lastInChrBuf;
+ lastInChrBuf = lastChrSrcY;
+
+#else
// Do horizontal scaling
while (lastInLumBuf < lastLumSrcY) {
const uint8_t *src1[4] = {
@@ -535,6 +649,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n",
chrBufIndex, lastInChrBuf);
}
+#endif
// wrap buf index around to stay inside the ring buffer
if (lumBufIndex >= vLumBufSize)
lumBufIndex -= vLumBufSize;
@@ -557,9 +672,15 @@ static int swscale(SwsContext *c, const uint8_t *src[],
ff_sws_init_output_funcs(c, &yuv2plane1, &yuv2planeX, &yuv2nv12cX,
&yuv2packed1, &yuv2packed2, &yuv2packedX, &yuv2anyX);
use_mmx_vfilter= 0;
+ ff_init_vscale_pfn(c, yuv2plane1, yuv2planeX, yuv2nv12cX,
+ yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, use_mmx_vfilter);
}
{
+#ifdef NEW_FILTER
+ for (i = vStart; i < vEnd; ++i)
+ desc[i].process(c, &desc[i], dstY, 1);
+#else
const int16_t **lumSrcPtr = (const int16_t **)(void*) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
const int16_t **chrVSrcPtr = (const int16_t **)(void*) chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
@@ -665,6 +786,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
}
if (perform_gamma)
gamma_convert(dest, dstW, c->gamma);
+#endif
}
}
if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) {
@@ -674,7 +796,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
if (is16BPS(dstFormat) || isNBPS(dstFormat)) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
fillPlane16(dst[3], dstStride[3], length, height, lastDstY,
- 1, desc->comp[3].depth_minus1,
+ 1, desc->comp[3].depth,
isBE(dstFormat));
} else
fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255);
@@ -1151,4 +1273,3 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
av_free(rgb0_tmp);
return ret;
}
-
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale.h b/chromium/third_party/ffmpeg/libswscale/swscale.h
index 903e1203fd9..ff3f630ec14 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale.h
+++ b/chromium/third_party/ffmpeg/libswscale/swscale.h
@@ -82,22 +82,6 @@ const char *swscale_license(void);
#define SWS_BITEXACT 0x80000
#define SWS_ERROR_DIFFUSION 0x800000
-#if FF_API_SWS_CPU_CAPS
-/**
- * CPU caps are autodetected now, those flags
- * are only provided for API compatibility.
- */
-#define SWS_CPU_CAPS_MMX 0x80000000
-#define SWS_CPU_CAPS_MMXEXT 0x20000000
-#define SWS_CPU_CAPS_MMX2 0x20000000
-#define SWS_CPU_CAPS_3DNOW 0x40000000
-#define SWS_CPU_CAPS_ALTIVEC 0x10000000
-#if FF_API_ARCH_BFIN
-#define SWS_CPU_CAPS_BFIN 0x01000000
-#endif
-#define SWS_CPU_CAPS_SSE2 0x02000000
-#endif
-
#define SWS_MAX_REDUCE_CUTOFF 0.002
#define SWS_CS_ITU709 1
@@ -185,6 +169,12 @@ void sws_freeContext(struct SwsContext *swsContext);
* @param dstH the height of the destination image
* @param dstFormat the destination image format
* @param flags specify which algorithm and options to use for rescaling
+ * @param param extra parameters to tune the used scaler
+ * For SWS_BICUBIC param[0] and [1] tune the shape of the basis
+ * function, param[0] tunes f(1) and param[1] f´(1)
+ * For SWS_GAUSS param[0] tunes the exponent and thus cutoff
+ * frequency
+ * For SWS_LANCZOS param[0] tunes the width of the window function
* @return a pointer to an allocated context, or NULL in case of error
* @note this function is to be removed after a saner alternative is
* written
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale_internal.h b/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
index 2299aa5c875..721a9cafaab 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
+++ b/chromium/third_party/ffmpeg/libswscale/swscale_internal.h
@@ -75,6 +75,13 @@ typedef enum SwsDither {
NB_SWS_DITHER,
} SwsDither;
+typedef enum SwsAlphaBlend {
+ SWS_ALPHA_BLEND_NONE = 0,
+ SWS_ALPHA_BLEND_UNIFORM,
+ SWS_ALPHA_BLEND_CHECKERBOARD,
+ SWS_ALPHA_BLEND_NB,
+} SwsAlphaBlend;
+
typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[]);
@@ -269,6 +276,9 @@ typedef void (*yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter,
const int16_t **alpSrc, uint8_t **dest,
int dstW, int y);
+struct SwsSlice;
+struct SwsFilterDescriptor;
+
/* This struct should be aligned on at least a 32-byte boundary. */
typedef struct SwsContext {
/**
@@ -312,6 +322,7 @@ typedef struct SwsContext {
uint8_t *cascaded_tmp[4];
int cascaded1_tmpStride[4];
uint8_t *cascaded1_tmp[4];
+ int cascaded_mainindex;
double gamma_value;
int gamma_flag;
@@ -319,6 +330,12 @@ typedef struct SwsContext {
uint16_t *gamma;
uint16_t *inv_gamma;
+ int numDesc;
+ int descIndex[2];
+ int numSlice;
+ struct SwsSlice *slice;
+ struct SwsFilterDescriptor *desc;
+
uint32_t pal_yuv[256];
uint32_t pal_rgb[256];
@@ -611,6 +628,8 @@ typedef struct SwsContext {
int needs_hcscale; ///< Set if there are chroma planes to be converted.
SwsDither dither;
+
+ SwsAlphaBlend alphablend;
} SwsContext;
//FIXME check init (where 0)
@@ -633,14 +652,14 @@ static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
av_assert0(desc);
- return desc->comp[0].depth_minus1 == 15;
+ return desc->comp[0].depth == 16;
}
static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
av_assert0(desc);
- return desc->comp[0].depth_minus1 >= 8 && desc->comp[0].depth_minus1 <= 13;
+ return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 14;
}
#define isNBPS(x) is9_OR_10BPS(x)
@@ -790,6 +809,8 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
|| (x)==AV_PIX_FMT_YA8 \
|| (x)==AV_PIX_FMT_YA16LE \
|| (x)==AV_PIX_FMT_YA16BE \
+ || (x)==AV_PIX_FMT_AYUV64LE \
+ || (x)==AV_PIX_FMT_AYUV64BE \
|| isRGBinInt(x) \
|| isBGRinInt(x) \
)
@@ -888,12 +909,27 @@ void ff_hcscale_fast_mmxext(SwsContext *c, int16_t *dst1, int16_t *dst2,
int dstWidth, const uint8_t *src1,
const uint8_t *src2, int srcW, int xInc);
+/**
+ * Allocate and return an SwsContext.
+ * This is like sws_getContext() but does not perform the init step, allowing
+ * the user to set additional AVOptions.
+ *
+ * @see sws_getContext()
+ */
+struct SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat,
+ int dstW, int dstH, enum AVPixelFormat dstFormat,
+ int flags, const double *param);
+
+int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[],
+ int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *dst[], int dstStride[]);
+
static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y,
int alpha, int bits, const int big_endian)
{
int i, j;
uint8_t *ptr = plane + stride * y;
- int v = alpha ? 0xFFFF>>(15-bits) : (1<<bits);
+ int v = alpha ? 0xFFFF>>(16-bits) : (1<<(bits-1));
for (i = 0; i < height; i++) {
#define FILL(wfunc) \
for (j = 0; j < width; j++) {\
@@ -908,4 +944,120 @@ static inline void fillPlane16(uint8_t *plane, int stride, int width, int height
}
}
+#define MAX_SLICE_PLANES 4
+
+/// Slice plane
+typedef struct SwsPlane
+{
+ int available_lines; ///< max number of lines that can be hold by this plane
+ int sliceY; ///< index of first line
+ int sliceH; ///< number of lines
+ uint8_t **line; ///< line buffer
+ uint8_t **tmp; ///< Tmp line buffer used by mmx code
+} SwsPlane;
+
+/**
+ * Struct which defines a slice of an image to be scaled or a output for
+ * a scaled slice.
+ * A slice can also be used as intermediate ring buffer for scaling steps.
+ */
+typedef struct SwsSlice
+{
+ int width; ///< Slice line width
+ int h_chr_sub_sample; ///< horizontal chroma subsampling factor
+ int v_chr_sub_sample; ///< vertical chroma subsampling factor
+ int is_ring; ///< flag to identify if this slice is a ring buffer
+ int should_free_lines; ///< flag to identify if there are dynamic allocated lines
+ enum AVPixelFormat fmt; ///< planes pixel format
+ SwsPlane plane[MAX_SLICE_PLANES]; ///< color planes
+} SwsSlice;
+
+/**
+ * Struct which holds all necessary data for processing a slice.
+ * A processing step can be a color conversion or horizontal/vertical scaling.
+ */
+typedef struct SwsFilterDescriptor
+{
+ SwsSlice *src; ///< Source slice
+ SwsSlice *dst; ///< Output slice
+
+ int alpha; ///< Flag for processing alpha channel
+ void *instance; ///< Filter instance data
+
+ /// Function for processing input slice sliceH lines starting from line sliceY
+ int (*process)(SwsContext *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH);
+} SwsFilterDescriptor;
+
+/// Color conversion instance data
+typedef struct ColorContext
+{
+ uint32_t *pal;
+} ColorContext;
+
+/// Scaler instance data
+typedef struct FilterContext
+{
+ uint16_t *filter;
+ int *filter_pos;
+ int filter_size;
+ int xInc;
+} FilterContext;
+
+typedef struct VScalerContext
+{
+ uint16_t *filter[2];
+ int32_t *filter_pos;
+ int filter_size;
+ int isMMX;
+ void *pfn;
+} VScalerContext;
+
+// warp input lines in the form (src + width*i + j) to slice format (line[i][j])
+int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH);
+
+// Initialize scaler filter descriptor chain
+int ff_init_filters(SwsContext *c);
+
+// Free all filter data
+int ff_free_filters(SwsContext *c);
+
+/*
+ function for applying ring buffer logic into slice s
+ It checks if the slice can hold more @lum lines, if yes
+ do nothing otherwise remove @lum least used lines.
+ It applies the same procedure for @chr lines.
+*/
+int ff_rotate_slice(SwsSlice *s, int lum, int chr);
+
+/// initializes gamma conversion descriptor
+int ff_init_gamma_convert(SwsFilterDescriptor *desc, SwsSlice * src, uint16_t *table);
+
+/// initializes lum pixel format conversion descriptor
+int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal);
+
+/// initializes lum horizontal scaling descriptor
+int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
+
+/// initializes chr pixel format conversion descriptor
+int ff_init_desc_cfmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal);
+
+/// initializes chr horizontal scaling descriptor
+int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
+
+int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst);
+
+/// initializes vertical scaling descriptors
+int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst);
+
+/// setup vertical scaler functions
+void ff_init_vscale_pfn(SwsContext *c, yuv2planar1_fn yuv2plane1, yuv2planarX_fn yuv2planeX,
+ yuv2interleavedX_fn yuv2nv12cX, yuv2packed1_fn yuv2packed1, yuv2packed2_fn yuv2packed2,
+ yuv2packedX_fn yuv2packedX, yuv2anyX_fn yuv2anyX, int use_mmx);
+
+//number of extra lines to process
+#define MAX_LINES_AHEAD 4
+
+// enable use of refactored scaler code
+#define NEW_FILTER
+
#endif /* SWSCALE_SWSCALE_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
index b426fa188bb..f387f52df4c 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
@@ -554,7 +554,7 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const uint8_t *src[],
int stride1023[] = { dstStride[1], dstStride[0], dstStride[2], dstStride[3] };
const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
- int bpc = dst_format->comp[0].depth_minus1 + 1;
+ int bpc = dst_format->comp[0].depth;
int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;
int swap = 0;
if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
@@ -725,7 +725,7 @@ static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[],
int stride201[] = { srcStride[2], srcStride[0], srcStride[1], srcStride[3] };
const AVPixFmtDescriptor *src_format = av_pix_fmt_desc_get(c->srcFormat);
const AVPixFmtDescriptor *dst_format = av_pix_fmt_desc_get(c->dstFormat);
- int bits_per_sample = src_format->comp[0].depth_minus1 + 1;
+ int bits_per_sample = src_format->comp[0].depth;
int swap = 0;
if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
!HAVE_BIGENDIAN && src_format->flags & AV_PIX_FMT_FLAG_BE)
@@ -1243,6 +1243,11 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) && !isRGBA32(srcFormat) && ALT32_CORR<0)
return NULL;
+ // Maintain symmetry between endianness
+ if (c->flags & SWS_BITEXACT)
+ if ((dstFormat == AV_PIX_FMT_RGB32 || dstFormat == AV_PIX_FMT_BGR32 ) && !isRGBA32(srcFormat) && ALT32_CORR>0)
+ return NULL;
+
return conv;
}
@@ -1412,7 +1417,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
if (!src[plane] || (plane == 1 && !src[2])) {
if (is16BPS(c->dstFormat) || isNBPS(c->dstFormat)) {
fillPlane16(dst[plane], dstStride[plane], length, height, y,
- plane == 3, desc_dst->comp[plane].depth_minus1,
+ plane == 3, desc_dst->comp[plane].depth,
isBE(c->dstFormat));
} else {
fillPlane(dst[plane], dstStride[plane], length, height, y,
@@ -1422,8 +1427,8 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
if(isNBPS(c->srcFormat) || isNBPS(c->dstFormat)
|| (is16BPS(c->srcFormat) != is16BPS(c->dstFormat))
) {
- const int src_depth = desc_src->comp[plane].depth_minus1 + 1;
- const int dst_depth = desc_dst->comp[plane].depth_minus1 + 1;
+ const int src_depth = desc_src->comp[plane].depth;
+ const int dst_depth = desc_dst->comp[plane].depth;
const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
uint16_t *dstPtr2 = (uint16_t*)dstPtr;
@@ -1538,7 +1543,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
} else {
if (is16BPS(c->srcFormat) && is16BPS(c->dstFormat))
length *= 2;
- else if (!desc_src->comp[0].depth_minus1)
+ else if (desc_src->comp[0].depth == 1)
length >>= 3; // monowhite/black
for (i = 0; i < height; i++) {
memcpy(dstPtr, srcPtr, length);
@@ -1643,7 +1648,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE))
c->swscale = planarRgb16ToRgb16Wrapper;
- if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 &&
+ if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth == 8 &&
isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP)
c->swscale = rgbToPlanarRgbWrapper;
@@ -1671,6 +1676,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YA16) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_AYUV64) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP9) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP10) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GBRP12) ||
diff --git a/chromium/third_party/ffmpeg/libswscale/utils.c b/chromium/third_party/ffmpeg/libswscale/utils.c
index 074f8c0d13f..eb1c9403715 100644
--- a/chromium/third_party/ffmpeg/libswscale/utils.c
+++ b/chromium/third_party/ffmpeg/libswscale/utils.c
@@ -166,7 +166,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_RGB444BE] = { 1, 1 },
[AV_PIX_FMT_BGR444LE] = { 1, 1 },
[AV_PIX_FMT_BGR444BE] = { 1, 1 },
- [AV_PIX_FMT_YA8] = { 1, 0 },
+ [AV_PIX_FMT_YA8] = { 1, 1 },
[AV_PIX_FMT_YA16BE] = { 1, 0 },
[AV_PIX_FMT_YA16LE] = { 1, 0 },
[AV_PIX_FMT_BGR48BE] = { 1, 1 },
@@ -225,6 +225,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_BAYER_GRBG16BE] = { 1, 0 },
[AV_PIX_FMT_XYZ12BE] = { 1, 1, 1 },
[AV_PIX_FMT_XYZ12LE] = { 1, 1, 1 },
+ [AV_PIX_FMT_AYUV64LE] = { 1, 1},
};
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
@@ -854,12 +855,80 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
if (need_reinit && (c->srcBpc == 8 || !isYUV(c->srcFormat)))
ff_sws_init_range_convert(c);
- if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))
- return -1;
-
c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
+ if (c->cascaded_context[c->cascaded_mainindex])
+ return sws_setColorspaceDetails(c->cascaded_context[c->cascaded_mainindex],inv_table, srcRange,table, dstRange, brightness, contrast, saturation);
+
+ if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) {
+ if (!c->cascaded_context[0] &&
+ memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) &&
+ c->srcW && c->srcH && c->dstW && c->dstH) {
+ enum AVPixelFormat tmp_format;
+ int tmp_width, tmp_height;
+ int srcW = c->srcW;
+ int srcH = c->srcH;
+ int dstW = c->dstW;
+ int dstH = c->dstH;
+ int ret;
+ av_log(c, AV_LOG_VERBOSE, "YUV color matrix differs for YUV->YUV, using intermediate RGB to convert\n");
+
+ if (isNBPS(c->dstFormat) || is16BPS(c->dstFormat)) {
+ if (isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) {
+ tmp_format = AV_PIX_FMT_BGRA64;
+ } else {
+ tmp_format = AV_PIX_FMT_BGR48;
+ }
+ } else {
+ if (isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) {
+ tmp_format = AV_PIX_FMT_BGRA;
+ } else {
+ tmp_format = AV_PIX_FMT_BGR24;
+ }
+ }
+
+ if (srcW*srcH > dstW*dstH) {
+ tmp_width = dstW;
+ tmp_height = dstH;
+ } else {
+ tmp_width = srcW;
+ tmp_height = srcH;
+ }
+
+ ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
+ tmp_width, tmp_height, tmp_format, 64);
+ if (ret < 0)
+ return ret;
+
+ c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, c->srcFormat,
+ tmp_width, tmp_height, tmp_format,
+ c->flags, c->param);
+ if (!c->cascaded_context[0])
+ return -1;
+
+ c->cascaded_context[0]->alphablend = c->alphablend;
+ ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
+ if (ret < 0)
+ return ret;
+ //we set both src and dst depending on that the RGB side will be ignored
+ sws_setColorspaceDetails(c->cascaded_context[0], inv_table,
+ srcRange, table, dstRange,
+ brightness, contrast, saturation);
+
+ c->cascaded_context[1] = sws_getContext(tmp_width, tmp_height, tmp_format,
+ dstW, dstH, c->dstFormat,
+ c->flags, NULL, NULL, c->param);
+ if (!c->cascaded_context[1])
+ return -1;
+ sws_setColorspaceDetails(c->cascaded_context[1], inv_table,
+ srcRange, table, dstRange,
+ 0, 1 << 16, 1 << 16);
+ return 0;
+ }
+ return -1;
+ }
+
if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {
ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
contrast, saturation);
@@ -912,8 +981,11 @@ static int handle_jpeg(enum AVPixelFormat *format)
*format = AV_PIX_FMT_YUV440P;
return 1;
case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_YA8:
case AV_PIX_FMT_GRAY16LE:
case AV_PIX_FMT_GRAY16BE:
+ case AV_PIX_FMT_YA16BE:
+ case AV_PIX_FMT_YA16LE:
return 1;
default:
return 0;
@@ -978,6 +1050,58 @@ static uint16_t * alloc_gamma_tbl(double e)
return tbl;
}
+static enum AVPixelFormat alphaless_fmt(enum AVPixelFormat fmt)
+{
+ switch(fmt) {
+ case AV_PIX_FMT_ARGB: return AV_PIX_FMT_RGB24;
+ case AV_PIX_FMT_RGBA: return AV_PIX_FMT_RGB24;
+ case AV_PIX_FMT_ABGR: return AV_PIX_FMT_BGR24;
+ case AV_PIX_FMT_BGRA: return AV_PIX_FMT_BGR24;
+ case AV_PIX_FMT_YA8: return AV_PIX_FMT_GRAY8;
+
+ case AV_PIX_FMT_YUVA420P: return AV_PIX_FMT_YUV420P;
+ case AV_PIX_FMT_YUVA422P: return AV_PIX_FMT_YUV422P;
+ case AV_PIX_FMT_YUVA444P: return AV_PIX_FMT_YUV444P;
+
+ case AV_PIX_FMT_GBRAP: return AV_PIX_FMT_GBRP;
+
+ case AV_PIX_FMT_GBRAP16LE: return AV_PIX_FMT_GBRP16;
+ case AV_PIX_FMT_GBRAP16BE: return AV_PIX_FMT_GBRP16;
+
+ case AV_PIX_FMT_RGBA64LE: return AV_PIX_FMT_RGB48;
+ case AV_PIX_FMT_RGBA64BE: return AV_PIX_FMT_RGB48;
+ case AV_PIX_FMT_BGRA64LE: return AV_PIX_FMT_BGR48;
+ case AV_PIX_FMT_BGRA64BE: return AV_PIX_FMT_BGR48;
+
+ case AV_PIX_FMT_YA16BE: return AV_PIX_FMT_GRAY16;
+ case AV_PIX_FMT_YA16LE: return AV_PIX_FMT_GRAY16;
+
+ case AV_PIX_FMT_YUVA420P9BE: return AV_PIX_FMT_YUV420P9;
+ case AV_PIX_FMT_YUVA422P9BE: return AV_PIX_FMT_YUV422P9;
+ case AV_PIX_FMT_YUVA444P9BE: return AV_PIX_FMT_YUV444P9;
+ case AV_PIX_FMT_YUVA420P9LE: return AV_PIX_FMT_YUV420P9;
+ case AV_PIX_FMT_YUVA422P9LE: return AV_PIX_FMT_YUV422P9;
+ case AV_PIX_FMT_YUVA444P9LE: return AV_PIX_FMT_YUV444P9;
+ case AV_PIX_FMT_YUVA420P10BE: return AV_PIX_FMT_YUV420P10;
+ case AV_PIX_FMT_YUVA422P10BE: return AV_PIX_FMT_YUV422P10;
+ case AV_PIX_FMT_YUVA444P10BE: return AV_PIX_FMT_YUV444P10;
+ case AV_PIX_FMT_YUVA420P10LE: return AV_PIX_FMT_YUV420P10;
+ case AV_PIX_FMT_YUVA422P10LE: return AV_PIX_FMT_YUV422P10;
+ case AV_PIX_FMT_YUVA444P10LE: return AV_PIX_FMT_YUV444P10;
+ case AV_PIX_FMT_YUVA420P16BE: return AV_PIX_FMT_YUV420P16;
+ case AV_PIX_FMT_YUVA422P16BE: return AV_PIX_FMT_YUV422P16;
+ case AV_PIX_FMT_YUVA444P16BE: return AV_PIX_FMT_YUV444P16;
+ case AV_PIX_FMT_YUVA420P16LE: return AV_PIX_FMT_YUV420P16;
+ case AV_PIX_FMT_YUVA422P16LE: return AV_PIX_FMT_YUV422P16;
+ case AV_PIX_FMT_YUVA444P16LE: return AV_PIX_FMT_YUV444P16;
+
+// case AV_PIX_FMT_AYUV64LE:
+// case AV_PIX_FMT_AYUV64BE:
+// case AV_PIX_FMT_PAL8:
+ default: return AV_PIX_FMT_NONE;
+ }
+}
+
av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
SwsFilter *dstFilter)
{
@@ -1023,6 +1147,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
desc_src = av_pix_fmt_desc_get(srcFormat);
desc_dst = av_pix_fmt_desc_get(dstFormat);
+ // If the source has no alpha then disable alpha blendaway
+ if (c->src0Alpha)
+ c->alphablend = SWS_ALPHA_BLEND_NONE;
+
if (!(unscaled && sws_isSupportedEndiannessConversion(srcFormat) &&
av_pix_fmt_swap_endianness(srcFormat) == dstFormat)) {
if (!sws_isSupportedInput(srcFormat)) {
@@ -1214,10 +1342,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
FF_ALLOCZ_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
- c->srcBpc = 1 + desc_src->comp[0].depth_minus1;
+ c->srcBpc = desc_src->comp[0].depth;
if (c->srcBpc < 8)
c->srcBpc = 8;
- c->dstBpc = 1 + desc_dst->comp[0].depth_minus1;
+ c->dstBpc = desc_dst->comp[0].depth;
if (c->dstBpc < 8)
c->dstBpc = 8;
if (isAnyRGB(srcFormat) || srcFormat == AV_PIX_FMT_PAL8)
@@ -1298,6 +1426,15 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
if (!c2->gamma || !c2->inv_gamma)
return AVERROR(ENOMEM);
+ // is_internal_flag is set after creating the context
+ // to properly create the gamma convert FilterDescriptor
+ // we have to re-initialize it
+ ff_free_filters(c2);
+ if (ff_init_filters(c2) < 0) {
+ sws_freeContext(c2);
+ return -1;
+ }
+
c->cascaded_context[2] = NULL;
if (dstFormat != tmpFmt) {
ret = av_image_alloc(c->cascaded1_tmp, c->cascaded1_tmpStride,
@@ -1339,6 +1476,47 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
}
}
+ if (CONFIG_SWSCALE_ALPHA && isALPHA(srcFormat) && !isALPHA(dstFormat)) {
+ enum AVPixelFormat tmpFormat = alphaless_fmt(srcFormat);
+
+ if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != SWS_ALPHA_BLEND_NONE)
+ if (!unscaled ||
+ dstFormat != tmpFormat ||
+ usesHFilter || usesVFilter ||
+ c->srcRange != c->dstRange
+ ) {
+ c->cascaded_mainindex = 1;
+ ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
+ srcW, srcH, tmpFormat, 64);
+ if (ret < 0)
+ return ret;
+
+ c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat,
+ srcW, srcH, tmpFormat,
+ flags, c->param);
+ if (!c->cascaded_context[0])
+ return -1;
+ c->cascaded_context[0]->alphablend = c->alphablend;
+ ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
+ if (ret < 0)
+ return ret;
+
+ c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat,
+ dstW, dstH, dstFormat,
+ flags, c->param);
+ if (!c->cascaded_context[1])
+ return -1;
+
+ c->cascaded_context[1]->srcRange = c->srcRange;
+ c->cascaded_context[1]->dstRange = c->dstRange;
+ ret = sws_init_context(c->cascaded_context[1], srcFilter , dstFilter);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+ }
+
#define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
/* precalculate horizontal scaler filter coefficients */
@@ -1496,9 +1674,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
/* Allocate pixbufs (we use dynamic allocation because otherwise we would
* need to allocate several megabytes to handle all possible cases) */
- FF_ALLOC_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail);
- FF_ALLOC_OR_GOTO(c, c->chrUPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
- FF_ALLOC_OR_GOTO(c, c->chrVPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->chrUPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
+ FF_ALLOCZ_OR_GOTO(c, c->chrVPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat))
FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail);
/* Note we need at least one pixel more at the end because of the MMX code
@@ -1528,7 +1706,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
// try to avoid drawing green stuff between the right end and the stride end
for (i = 0; i < c->vChrBufSize; i++)
- if(desc_dst->comp[0].depth_minus1 == 15){
+ if(desc_dst->comp[0].depth == 16){
av_assert0(c->dstBpc > 14);
for(j=0; j<dst_stride/2+1; j++)
((int32_t*)(c->chrUPixBuf[i]))[j] = 1<<18;
@@ -1585,6 +1763,22 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->chrXInc, c->chrYInc);
}
+ /* alpha blend special case, note this has been split via cascaded contexts if its scaled */
+ if (unscaled && !usesHFilter && !usesVFilter &&
+ c->alphablend != SWS_ALPHA_BLEND_NONE &&
+ isALPHA(srcFormat) &&
+ (c->srcRange == c->dstRange || isAnyRGB(dstFormat)) &&
+ alphaless_fmt(srcFormat) == dstFormat
+ ) {
+ c->swscale = ff_sws_alphablendaway;
+
+ if (flags & SWS_PRINT_INFO)
+ av_log(c, AV_LOG_INFO,
+ "using alpha blendaway %s -> %s special converter\n",
+ av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
+ return 0;
+ }
+
/* unscaled special cases */
if (unscaled && !usesHFilter && !usesVFilter &&
(c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
@@ -1600,7 +1794,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
}
c->swscale = ff_getSwsFunc(c);
- return 0;
+ return ff_init_filters(c);
fail: // FIXME replace things by appropriate error codes
if (ret == RETCODE_USE_CASCADE) {
int tmpW = sqrt(srcW * (int64_t)dstW);
@@ -1631,10 +1825,9 @@ fail: // FIXME replace things by appropriate error codes
return -1;
}
-SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
- int dstW, int dstH, enum AVPixelFormat dstFormat,
- int flags, SwsFilter *srcFilter,
- SwsFilter *dstFilter, const double *param)
+SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat,
+ int dstW, int dstH, enum AVPixelFormat dstFormat,
+ int flags, const double *param)
{
SwsContext *c;
@@ -1654,6 +1847,22 @@ SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
c->param[1] = param[1];
}
+ return c;
+}
+
+SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
+ int dstW, int dstH, enum AVPixelFormat dstFormat,
+ int flags, SwsFilter *srcFilter,
+ SwsFilter *dstFilter, const double *param)
+{
+ SwsContext *c;
+
+ c = sws_alloc_set_opts(srcW, srcH, srcFormat,
+ dstW, dstH, dstFormat,
+ flags, param);
+ if (!c)
+ return NULL;
+
if (sws_init_context(c, srcFilter, dstFilter) < 0) {
sws_freeContext(c);
return NULL;
@@ -2102,6 +2311,7 @@ void sws_freeContext(SwsContext *c)
av_freep(&c->gamma);
av_freep(&c->inv_gamma);
+ ff_free_filters(c);
av_free(c);
}
diff --git a/chromium/third_party/ffmpeg/libswscale/version.h b/chromium/third_party/ffmpeg/libswscale/version.h
index 228c5770eb9..24908b89313 100644
--- a/chromium/third_party/ffmpeg/libswscale/version.h
+++ b/chromium/third_party/ffmpeg/libswscale/version.h
@@ -26,9 +26,9 @@
#include "libavutil/version.h"
-#define LIBSWSCALE_VERSION_MAJOR 3
-#define LIBSWSCALE_VERSION_MINOR 1
-#define LIBSWSCALE_VERSION_MICRO 101
+#define LIBSWSCALE_VERSION_MAJOR 4
+#define LIBSWSCALE_VERSION_MINOR 0
+#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
@@ -46,11 +46,4 @@
* the public API and may change, break or disappear at any time.
*/
-#ifndef FF_API_SWS_CPU_CAPS
-#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 4)
-#endif
-#ifndef FF_API_ARCH_BFIN
-#define FF_API_ARCH_BFIN (LIBSWSCALE_VERSION_MAJOR < 4)
-#endif
-
#endif /* SWSCALE_VERSION_H */
diff --git a/chromium/third_party/ffmpeg/libswscale/vscale.c b/chromium/third_party/ffmpeg/libswscale/vscale.c
new file mode 100644
index 00000000000..3d6e81a70f1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libswscale/vscale.c
@@ -0,0 +1,287 @@
+/*
+ * Copyright (C) 2015 Pedro Arthur <bygrandao@gmail.com>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include "swscale_internal.h"
+
+static int lum_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ VScalerContext *inst = desc->instance;
+ int dstW = desc->dst->width;
+
+ int first = FFMAX(1-inst->filter_size, inst->filter_pos[sliceY]);
+ int sp = first - desc->src->plane[0].sliceY;
+ int dp = sliceY - desc->dst->plane[0].sliceY;
+ uint8_t **src = desc->src->plane[0].line + sp;
+ uint8_t **dst = desc->dst->plane[0].line + dp;
+ uint16_t *filter = inst->filter[0] + (inst->isMMX ? 0 : sliceY * inst->filter_size);
+
+ if (inst->filter_size == 1)
+ ((yuv2planar1_fn)inst->pfn)((const int16_t*)src[0], dst[0], dstW, c->lumDither8, 0);
+ else
+ ((yuv2planarX_fn)inst->pfn)(filter, inst->filter_size, (const int16_t**)src, dst[0], dstW, c->lumDither8, 0);
+
+ if (desc->alpha) {
+ int sp = first - desc->src->plane[3].sliceY;
+ int dp = sliceY - desc->dst->plane[3].sliceY;
+ uint8_t **src = desc->src->plane[3].line + sp;
+ uint8_t **dst = desc->dst->plane[3].line + dp;
+ uint16_t *filter = inst->filter[1] + (inst->isMMX ? 0 : sliceY * inst->filter_size);
+
+ if (inst->filter_size == 1)
+ ((yuv2planar1_fn)inst->pfn)((const int16_t*)src[0], dst[0], dstW, c->lumDither8, 0);
+ else
+ ((yuv2planarX_fn)inst->pfn)(filter, inst->filter_size, (const int16_t**)src, dst[0], dstW, c->lumDither8, 0);
+ }
+
+ return 1;
+}
+
+static int chr_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ const int chrSkipMask = (1 << desc->dst->v_chr_sub_sample) - 1;
+ if (sliceY & chrSkipMask)
+ return 0;
+ else {
+ VScalerContext *inst = desc->instance;
+ int dstW = FF_CEIL_RSHIFT(desc->dst->width, desc->dst->h_chr_sub_sample);
+ int chrSliceY = sliceY >> desc->dst->v_chr_sub_sample;
+
+ int first = FFMAX(1-inst->filter_size, inst->filter_pos[chrSliceY]);
+ int sp1 = first - desc->src->plane[1].sliceY;
+ int sp2 = first - desc->src->plane[2].sliceY;
+ int dp1 = chrSliceY - desc->dst->plane[1].sliceY;
+ int dp2 = chrSliceY - desc->dst->plane[2].sliceY;
+ uint8_t **src1 = desc->src->plane[1].line + sp1;
+ uint8_t **src2 = desc->src->plane[2].line + sp2;
+ uint8_t **dst1 = desc->dst->plane[1].line + dp1;
+ uint8_t **dst2 = desc->dst->plane[2].line + dp2;
+ uint16_t *filter = inst->filter[0] + (inst->isMMX ? 0 : chrSliceY * inst->filter_size);
+
+ if (c->yuv2nv12cX) {
+ ((yuv2interleavedX_fn)inst->pfn)(c, filter, inst->filter_size, (const int16_t**)src1, (const int16_t**)src2, dst1[0], dstW);
+ } else if (inst->filter_size == 1) {
+ ((yuv2planar1_fn)inst->pfn)((const int16_t*)src1[0], dst1[0], dstW, c->chrDither8, 0);
+ ((yuv2planar1_fn)inst->pfn)((const int16_t*)src2[0], dst2[0], dstW, c->chrDither8, 3);
+ } else {
+ ((yuv2planarX_fn)inst->pfn)(filter, inst->filter_size, (const int16_t**)src1, dst1[0], dstW, c->chrDither8, 0);
+ ((yuv2planarX_fn)inst->pfn)(filter, inst->filter_size, (const int16_t**)src2, dst2[0], dstW, c->chrDither8, inst->isMMX ? (c->uv_offx2 >> 1) : 3);
+ }
+ }
+
+ return 1;
+}
+
+static int packed_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ VScalerContext *inst = desc->instance;
+ int dstW = desc->dst->width;
+ int chrSliceY = sliceY >> desc->dst->v_chr_sub_sample;
+
+ int lum_fsize = inst[0].filter_size;
+ int chr_fsize = inst[1].filter_size;
+ uint16_t *lum_filter = inst[0].filter[0];
+ uint16_t *chr_filter = inst[1].filter[0];
+
+ int firstLum = FFMAX(1-lum_fsize, inst[0].filter_pos[chrSliceY]);
+ int firstChr = FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
+
+ int sp0 = firstLum - desc->src->plane[0].sliceY;
+ int sp1 = firstChr - desc->src->plane[1].sliceY;
+ int sp2 = firstChr - desc->src->plane[2].sliceY;
+ int sp3 = firstLum - desc->src->plane[3].sliceY;
+ int dp = sliceY - desc->dst->plane[0].sliceY;
+ uint8_t **src0 = desc->src->plane[0].line + sp0;
+ uint8_t **src1 = desc->src->plane[1].line + sp1;
+ uint8_t **src2 = desc->src->plane[2].line + sp2;
+ uint8_t **src3 = desc->alpha ? desc->src->plane[3].line + sp3 : NULL;
+ uint8_t **dst = desc->dst->plane[0].line + dp;
+
+
+ if (c->yuv2packed1 && lum_fsize == 1 && chr_fsize <= 2) { // unscaled RGB
+ int chrAlpha = chr_fsize == 1 ? 0 : chr_filter[2 * sliceY + 1];
+ ((yuv2packed1_fn)inst->pfn)(c, (const int16_t*)*src0, (const int16_t**)src1, (const int16_t**)src2, (const int16_t*)(desc->alpha ? *src3 : NULL), *dst, dstW, chrAlpha, sliceY);
+ } else if (c->yuv2packed2 && lum_fsize == 2 && chr_fsize == 2) { // bilinear upscale RGB
+ int lumAlpha = lum_filter[2 * sliceY + 1];
+ int chrAlpha = chr_filter[2 * sliceY + 1];
+ c->lumMmxFilter[2] =
+ c->lumMmxFilter[3] = lum_filter[2 * sliceY] * 0x10001;
+ c->chrMmxFilter[2] =
+ c->chrMmxFilter[3] = chr_filter[2 * chrSliceY] * 0x10001;
+ ((yuv2packed2_fn)inst->pfn)(c, (const int16_t**)src0, (const int16_t**)src1, (const int16_t**)src2, (const int16_t**)src3,
+ *dst, dstW, lumAlpha, chrAlpha, sliceY);
+ } else { // general RGB
+ ((yuv2packedX_fn)inst->pfn)(c, lum_filter + sliceY * lum_fsize,
+ (const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
+ (const int16_t**)src1, (const int16_t**)src2, chr_fsize, (const int16_t**)src3, *dst, dstW, sliceY);
+ }
+ return 1;
+}
+
+static int any_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+ VScalerContext *inst = desc->instance;
+ int dstW = desc->dst->width;
+ int chrSliceY = sliceY >> desc->dst->v_chr_sub_sample;
+
+ int lum_fsize = inst[0].filter_size;
+ int chr_fsize = inst[1].filter_size;
+ uint16_t *lum_filter = inst[0].filter[0];
+ uint16_t *chr_filter = inst[1].filter[0];
+
+ int firstLum = FFMAX(1-lum_fsize, inst[0].filter_pos[chrSliceY]);
+ int firstChr = FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
+
+ int sp0 = firstLum - desc->src->plane[0].sliceY;
+ int sp1 = firstChr - desc->src->plane[1].sliceY;
+ int sp2 = firstChr - desc->src->plane[2].sliceY;
+ int sp3 = firstLum - desc->src->plane[3].sliceY;
+ int dp0 = sliceY - desc->dst->plane[0].sliceY;
+ int dp1 = chrSliceY - desc->dst->plane[1].sliceY;
+ int dp2 = chrSliceY - desc->dst->plane[2].sliceY;
+ int dp3 = sliceY - desc->dst->plane[3].sliceY;
+
+ uint8_t **src0 = desc->src->plane[0].line + sp0;
+ uint8_t **src1 = desc->src->plane[1].line + sp1;
+ uint8_t **src2 = desc->src->plane[2].line + sp2;
+ uint8_t **src3 = desc->alpha ? desc->src->plane[3].line + sp3 : NULL;
+ uint8_t *dst[4] = { desc->dst->plane[0].line[dp0],
+ desc->dst->plane[1].line[dp1],
+ desc->dst->plane[2].line[dp2],
+ desc->alpha ? desc->dst->plane[3].line[dp3] : NULL };
+
+ av_assert1(!c->yuv2packed1 && !c->yuv2packed2);
+ ((yuv2anyX_fn)inst->pfn)(c, lum_filter + sliceY * lum_fsize,
+ (const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
+ (const int16_t**)src1, (const int16_t**)src2, chr_fsize, (const int16_t**)src3, dst, dstW, sliceY);
+
+ return 1;
+
+}
+
+int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst)
+{
+ VScalerContext *lumCtx = NULL;
+ VScalerContext *chrCtx = NULL;
+
+ if (isPlanarYUV(c->dstFormat) || (isGray(c->dstFormat) && !isALPHA(c->dstFormat))) {
+ lumCtx = av_mallocz(sizeof(VScalerContext));
+ if (!lumCtx)
+ return AVERROR(ENOMEM);
+
+
+ desc[0].process = lum_planar_vscale;
+ desc[0].instance = lumCtx;
+ desc[0].src = src;
+ desc[0].dst = dst;
+ desc[0].alpha = c->alpPixBuf != 0;
+
+ if (!isGray(c->dstFormat)) {
+ chrCtx = av_mallocz(sizeof(VScalerContext));
+ if (!chrCtx)
+ return AVERROR(ENOMEM);
+ desc[1].process = chr_planar_vscale;
+ desc[1].instance = chrCtx;
+ desc[1].src = src;
+ desc[1].dst = dst;
+ }
+ } else {
+ lumCtx = av_mallocz_array(sizeof(VScalerContext), 2);
+ if (!lumCtx)
+ return AVERROR(ENOMEM);
+ chrCtx = &lumCtx[1];
+
+ desc[0].process = c->yuv2packedX ? packed_vscale : any_vscale;
+ desc[0].instance = lumCtx;
+ desc[0].src = src;
+ desc[0].dst = dst;
+ desc[0].alpha = c->alpPixBuf != 0;
+ }
+
+ ff_init_vscale_pfn(c, c->yuv2plane1, c->yuv2planeX, c->yuv2nv12cX,
+ c->yuv2packed1, c->yuv2packed2, c->yuv2packedX, c->yuv2anyX, c->use_mmx_vfilter);
+ return 0;
+}
+
+void ff_init_vscale_pfn(SwsContext *c,
+ yuv2planar1_fn yuv2plane1,
+ yuv2planarX_fn yuv2planeX,
+ yuv2interleavedX_fn yuv2nv12cX,
+ yuv2packed1_fn yuv2packed1,
+ yuv2packed2_fn yuv2packed2,
+ yuv2packedX_fn yuv2packedX,
+ yuv2anyX_fn yuv2anyX, int use_mmx)
+{
+ VScalerContext *lumCtx = NULL;
+ VScalerContext *chrCtx = NULL;
+ int idx = c->numDesc - (c->is_internal_gamma ? 2 : 1);
+
+ if (isPlanarYUV(c->dstFormat) || (isGray(c->dstFormat) && !isALPHA(c->dstFormat))) {
+ if (!isGray(c->dstFormat)) {
+ chrCtx = c->desc[idx].instance;
+
+ chrCtx->filter[0] = use_mmx ? (int16_t*)c->chrMmxFilter : c->vChrFilter;
+ chrCtx->filter_size = c->vChrFilterSize;
+ chrCtx->filter_pos = c->vChrFilterPos;
+ chrCtx->isMMX = use_mmx;
+
+ --idx;
+ if (yuv2nv12cX) chrCtx->pfn = yuv2nv12cX;
+ else if (c->vChrFilterSize == 1) chrCtx->pfn = yuv2plane1;
+ else chrCtx->pfn = yuv2planeX;
+ }
+
+ lumCtx = c->desc[idx].instance;
+
+ lumCtx->filter[0] = use_mmx ? (int16_t*)c->lumMmxFilter : c->vLumFilter;
+ lumCtx->filter[1] = use_mmx ? (int16_t*)c->alpMmxFilter : c->vLumFilter;
+ lumCtx->filter_size = c->vLumFilterSize;
+ lumCtx->filter_pos = c->vLumFilterPos;
+ lumCtx->isMMX = use_mmx;
+
+ if (c->vLumFilterSize == 1) lumCtx->pfn = yuv2plane1;
+ else lumCtx->pfn = yuv2planeX;
+
+ } else {
+ lumCtx = c->desc[idx].instance;
+ chrCtx = &lumCtx[1];
+
+ lumCtx->filter[0] = c->vLumFilter;
+ lumCtx->filter_size = c->vLumFilterSize;
+ lumCtx->filter_pos = c->vLumFilterPos;
+
+ chrCtx->filter[0] = c->vChrFilter;
+ chrCtx->filter_size = c->vChrFilterSize;
+ chrCtx->filter_pos = c->vChrFilterPos;
+
+ lumCtx->isMMX = use_mmx;
+ chrCtx->isMMX = use_mmx;
+
+ if (yuv2packedX) {
+ if (c->yuv2packed1 && c->vLumFilterSize == 1 && c->vChrFilterSize <= 2)
+ lumCtx->pfn = yuv2packed1;
+ else if (c->yuv2packed2 && c->vLumFilterSize == 2 && c->vChrFilterSize == 2)
+ lumCtx->pfn = yuv2packed2;
+ else
+ lumCtx->pfn = yuv2packedX;
+ } else
+ lumCtx->pfn = yuv2anyX;
+ }
+}
+
+
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
index e71c7ebfe3a..e97ba4fe828 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/rgb2rgb_template.c
@@ -1090,7 +1090,7 @@ static inline void RENAME(shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst,
: "r" (s), "r" (d), "m" (mask32b), "m" (mask32r), "m" (mmx_one)
: "memory");
for (; idx<15; idx+=4) {
- register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
+ register unsigned v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
v &= 0xff00ff;
*(uint32_t *)&d[idx] = (v>>16) + g + (v<<16);
}
@@ -1905,7 +1905,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
"cmp %3, %%"REG_a" \n\t"
" jb 1b \n\t"
::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
- : "memory", "%"REG_a""
+ : "memory", XMM_CLOBBERS("xmm0", "xmm1", "xmm2",) "%"REG_a
);
#else
__asm__(
@@ -1943,7 +1943,9 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
src2 += src2Stride;
}
__asm__(
+#if !COMPILE_TEMPLATE_SSE2
EMMS" \n\t"
+#endif
SFENCE" \n\t"
::: "memory"
);
@@ -1971,7 +1973,9 @@ static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t
dst2 += dst2Stride;
}
__asm__(
+#if !COMPILE_TEMPLATE_SSE2
EMMS" \n\t"
+#endif
SFENCE" \n\t"
::: "memory"
);
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/swscale.c b/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
index d611b76c73c..66ac7d5e56b 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/swscale.c
@@ -85,11 +85,18 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
{
const int dstH= c->dstH;
const int flags= c->flags;
+#ifdef NEW_FILTER
+ SwsPlane *lumPlane = &c->slice[c->numSlice-2].plane[0];
+ SwsPlane *chrUPlane = &c->slice[c->numSlice-2].plane[1];
+ SwsPlane *alpPlane = &c->slice[c->numSlice-2].plane[3];
+#else
int16_t **lumPixBuf= c->lumPixBuf;
int16_t **chrUPixBuf= c->chrUPixBuf;
int16_t **alpPixBuf= c->alpPixBuf;
const int vLumBufSize= c->vLumBufSize;
const int vChrBufSize= c->vChrBufSize;
+#endif
+ int hasAlpha = c->alpPixBuf != NULL;
int32_t *vLumFilterPos= c->vLumFilterPos;
int32_t *vChrFilterPos= c->vChrFilterPos;
int16_t *vLumFilter= c->vLumFilter;
@@ -110,13 +117,22 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
c->greenDither= ff_dither4[dstY&1];
c->redDither= ff_dither8[(dstY+1)&1];
if (dstY < dstH - 2) {
+#ifdef NEW_FILTER
+ const int16_t **lumSrcPtr = (const int16_t **)(void*) lumPlane->line + firstLumSrcY - lumPlane->sliceY;
+ const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPlane->line + firstChrSrcY - chrUPlane->sliceY;
+ const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) ? (const int16_t **)(void*) alpPlane->line + firstLumSrcY - alpPlane->sliceY : NULL;
+#else
const int16_t **lumSrcPtr= (const int16_t **)(void*) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
const int16_t **chrUSrcPtr= (const int16_t **)(void*) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **)(void*) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
+#endif
int i;
-
if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) {
+#ifdef NEW_FILTER
+ const int16_t **tmpY = (const int16_t **) lumPlane->tmp;
+#else
const int16_t **tmpY = (const int16_t **) lumPixBuf + 2 * vLumBufSize;
+#endif
int neg = -firstLumSrcY, i, end = FFMIN(c->srcH - firstLumSrcY, vLumFilterSize);
for (i = 0; i < neg; i++)
tmpY[i] = lumSrcPtr[neg];
@@ -127,7 +143,11 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
lumSrcPtr = tmpY;
if (alpSrcPtr) {
+#ifdef NEW_FILTER
+ const int16_t **tmpA = (const int16_t **) alpPlane->tmp;
+#else
const int16_t **tmpA = (const int16_t **) alpPixBuf + 2 * vLumBufSize;
+#endif
for (i = 0; i < neg; i++)
tmpA[i] = alpSrcPtr[neg];
for ( ; i < end; i++)
@@ -138,7 +158,11 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
}
}
if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) {
+#ifdef NEW_FILTER
+ const int16_t **tmpU = (const int16_t **) chrUPlane->tmp;
+#else
const int16_t **tmpU = (const int16_t **) chrUPixBuf + 2 * vChrBufSize;
+#endif
int neg = -firstChrSrcY, i, end = FFMIN(c->chrSrcH - firstChrSrcY, vChrFilterSize);
for (i = 0; i < neg; i++) {
tmpU[i] = chrUSrcPtr[neg];
@@ -160,7 +184,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
lumMmxFilter[s*i+APCK_COEF/4 ]=
lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ]
+ (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
- if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
+ if (CONFIG_SWSCALE_ALPHA && hasAlpha) {
*(const void**)&alpMmxFilter[s*i ]= alpSrcPtr[i ];
*(const void**)&alpMmxFilter[s*i+APCK_PTR2/4 ]= alpSrcPtr[i+(vLumFilterSize>1)];
alpMmxFilter[s*i+APCK_COEF/4 ]=
@@ -180,7 +204,7 @@ void ff_updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrB
lumMmxFilter[4*i+2]=
lumMmxFilter[4*i+3]=
((uint16_t)vLumFilter[dstY*vLumFilterSize + i])*0x10001U;
- if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
+ if (CONFIG_SWSCALE_ALPHA && hasAlpha) {
*(const void**)&alpMmxFilter[4*i+0]= alpSrcPtr[i];
alpMmxFilter[4*i+2]=
alpMmxFilter[4*i+3]= lumMmxFilter[4*i+2];
@@ -410,7 +434,7 @@ av_cold void ff_sws_init_swscale_x86(SwsContext *c)
} else if (c->srcBpc == 12) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
ff_hscale12to19_ ## filtersize ## _ ## opt1; \
- } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth_minus1<15)) { \
+ } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth<16)) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
ff_hscale14to19_ ## filtersize ## _ ## opt1; \
} else { /* c->srcBpc == 16 */ \
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
index 36a606c5b20..bbda6d086e1 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
@@ -399,6 +399,35 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
}
}
+static void RENAME(yuv2bgr32_X)(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc,
+ int chrFilterSize, const int16_t **alpSrc,
+ uint8_t *dest, int dstW, int dstY)
+{
+ x86_reg dummy=0;
+ x86_reg dstW_reg = dstW;
+ x86_reg uv_off = c->uv_offx2;
+
+ if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
+ YSCALEYUV2PACKEDX
+ YSCALEYUV2RGBX
+ YSCALEYUV2PACKEDX_YA(ALP_MMX_FILTER_OFFSET, %%mm0, %%mm3, %%mm6, %%mm1, %%mm7)
+ "psraw $3, %%mm1 \n\t"
+ "psraw $3, %%mm7 \n\t"
+ "packuswb %%mm7, %%mm1 \n\t"
+ WRITEBGR32(%4, "%5", %%REGa, %%mm5, %%mm4, %%mm2, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
+ YSCALEYUV2PACKEDX_END
+ } else {
+ YSCALEYUV2PACKEDX
+ YSCALEYUV2RGBX
+ "pcmpeqd %%mm7, %%mm7 \n\t"
+ WRITEBGR32(%4, "%5", %%REGa, %%mm5, %%mm4, %%mm2, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
+ YSCALEYUV2PACKEDX_END
+ }
+}
+
#define REAL_WRITERGB16(dst, dstw, index) \
"pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\
"pand "MANGLE(bFC)", %%mm4 \n\t" /* G */\
@@ -1491,6 +1520,7 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
+ case AV_PIX_FMT_BGR32: c->yuv2packedX = RENAME(yuv2bgr32_X); break;
#if HAVE_6REGS
case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
#endif
diff --git a/chromium/third_party/ffmpeg/tools/crypto_bench.c b/chromium/third_party/ffmpeg/tools/crypto_bench.c
index 79629bcaf84..b3b24a6fe7e 100644
--- a/chromium/third_party/ffmpeg/tools/crypto_bench.c
+++ b/chromium/third_party/ffmpeg/tools/crypto_bench.c
@@ -75,9 +75,12 @@ struct hash_impl {
#include "libavutil/sha512.h"
#include "libavutil/ripemd.h"
#include "libavutil/aes.h"
+#include "libavutil/blowfish.h"
#include "libavutil/camellia.h"
#include "libavutil/cast5.h"
#include "libavutil/twofish.h"
+#include "libavutil/rc4.h"
+#include "libavutil/xtea.h"
#define IMPL_USE_lavu IMPL_USE
@@ -102,6 +105,7 @@ static void run_lavu_ ## suffix(uint8_t *output, \
DEFINE_LAVU_MD(sha1, AVSHA, sha, 160);
DEFINE_LAVU_MD(sha256, AVSHA, sha, 256);
DEFINE_LAVU_MD(sha512, AVSHA512, sha512, 512);
+DEFINE_LAVU_MD(ripemd128, AVRIPEMD, ripemd, 128);
DEFINE_LAVU_MD(ripemd160, AVRIPEMD, ripemd, 160);
static void run_lavu_aes128(uint8_t *output,
@@ -114,6 +118,16 @@ static void run_lavu_aes128(uint8_t *output,
av_aes_crypt(aes, output, input, size >> 4, NULL, 0);
}
+static void run_lavu_blowfish(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ static struct AVBlowfish *blowfish;
+ if (!blowfish && !(blowfish = av_blowfish_alloc()))
+ fatal_error("out of memory");
+ av_blowfish_init(blowfish, hardcoded_key, 16);
+ av_blowfish_crypt(blowfish, output, input, size >> 3, NULL, 0);
+}
+
static void run_lavu_camellia(uint8_t *output,
const uint8_t *input, unsigned size)
{
@@ -143,6 +157,27 @@ static void run_lavu_twofish(uint8_t *output,
av_twofish_init(twofish, hardcoded_key, 128);
av_twofish_crypt(twofish, output, input, size >> 4, NULL, 0);
}
+
+static void run_lavu_rc4(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ static struct AVRC4 *rc4;
+ if (!rc4 && !(rc4 = av_rc4_alloc()))
+ fatal_error("out of memory");
+ av_rc4_init(rc4, hardcoded_key, 128, 0);
+ av_rc4_crypt(rc4, output, input, size, NULL, 0);
+}
+
+static void run_lavu_xtea(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ static struct AVXTEA *xtea;
+ if (!xtea && !(xtea = av_xtea_alloc()))
+ fatal_error("out of memory");
+ av_xtea_init(xtea, hardcoded_key);
+ av_xtea_crypt(xtea, output, input, size >> 3, NULL, 0);
+}
+
/***************************************************************************
* crypto: OpenSSL's libcrypto
***************************************************************************/
@@ -153,8 +188,10 @@ static void run_lavu_twofish(uint8_t *output,
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <openssl/aes.h>
+#include <openssl/blowfish.h>
#include <openssl/camellia.h>
#include <openssl/cast.h>
+#include <openssl/rc4.h>
#define DEFINE_CRYPTO_WRAPPER(suffix, function) \
static void run_crypto_ ## suffix(uint8_t *output, \
@@ -181,6 +218,17 @@ static void run_crypto_aes128(uint8_t *output,
AES_encrypt(input + i, output + i, &aes);
}
+static void run_crypto_blowfish(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ BF_KEY blowfish;
+ unsigned i;
+
+ BF_set_key(&blowfish, 16, hardcoded_key);
+ for (i = 0; i < size; i += 8)
+ BF_ecb_encrypt(input + i, output + i, &blowfish, 1);
+}
+
static void run_crypto_camellia(uint8_t *output,
const uint8_t *input, unsigned size)
{
@@ -204,6 +252,15 @@ static void run_crypto_cast128(uint8_t *output,
CAST_ecb_encrypt(input + i, output + i, &cast, 1);
}
+static void run_crypto_rc4(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ RC4_KEY rc4;
+
+ RC4_set_key(&rc4, 16, hardcoded_key);
+ RC4(&rc4, size, input, output);
+}
+
#define IMPL_USE_crypto(...) IMPL_USE(__VA_ARGS__)
#else
#define IMPL_USE_crypto(...) /* ignore */
@@ -240,6 +297,16 @@ static void run_gcrypt_aes128(uint8_t *output,
gcry_cipher_encrypt(aes, output, size, input, size);
}
+static void run_gcrypt_blowfish(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ static gcry_cipher_hd_t blowfish;
+ if (!blowfish)
+ gcry_cipher_open(&blowfish, GCRY_CIPHER_BLOWFISH, GCRY_CIPHER_MODE_ECB, 0);
+ gcry_cipher_setkey(blowfish, hardcoded_key, 16);
+ gcry_cipher_encrypt(blowfish, output, size, input, size);
+}
+
static void run_gcrypt_camellia(uint8_t *output,
const uint8_t *input, unsigned size)
{
@@ -297,6 +364,7 @@ DEFINE_TOMCRYPT_WRAPPER(md5, md5, MD5)
DEFINE_TOMCRYPT_WRAPPER(sha1, sha1, SHA1)
DEFINE_TOMCRYPT_WRAPPER(sha256, sha256, SHA256)
DEFINE_TOMCRYPT_WRAPPER(sha512, sha512, SHA512)
+DEFINE_TOMCRYPT_WRAPPER(ripemd128, rmd128, RIPEMD128)
DEFINE_TOMCRYPT_WRAPPER(ripemd160, rmd160, RIPEMD160)
static void run_tomcrypt_aes128(uint8_t *output,
@@ -311,6 +379,17 @@ static void run_tomcrypt_aes128(uint8_t *output,
aes_ecb_encrypt(input + i, output + i, &aes);
}
+static void run_tomcrypt_blowfish(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ symmetric_key blowfish;
+ unsigned i;
+
+ blowfish_setup(hardcoded_key, 16, 0, &blowfish);
+ for (i = 0; i < size; i += 8)
+ blowfish_ecb_encrypt(input + i, output + i, &blowfish);
+}
+
static void run_tomcrypt_camellia(uint8_t *output,
const uint8_t *input, unsigned size)
{
@@ -346,6 +425,17 @@ static void run_tomcrypt_twofish(uint8_t *output,
twofish_ecb_encrypt(input + i, output + i, &twofish);
}
+static void run_tomcrypt_xtea(uint8_t *output,
+ const uint8_t *input, unsigned size)
+{
+ symmetric_key xtea;
+ unsigned i;
+
+ xtea_setup(hardcoded_key, 16, 0, &xtea);
+ for (i = 0; i < size; i += 8)
+ xtea_ecb_encrypt(input + i, output + i, &xtea);
+}
+
#define IMPL_USE_tomcrypt(...) IMPL_USE(__VA_ARGS__)
#else
@@ -427,13 +517,20 @@ struct hash_impl implementations[] = {
IMPL_ALL("SHA-256", sha256, "14028ac673b3087e51a1d407fbf0df4deeec8f217119e13b07bf2138f93db8c5")
IMPL_ALL("SHA-512", sha512, "3afdd44a80d99af15c87bd724cb717243193767835ce866dd5d58c02d674bb57"
"7c25b9e118c200a189fcd5a01ef106a4e200061f3e97dbf50ba065745fd46bef")
+ IMPL(lavu, "RIPEMD-128", ripemd128, "9ab8bfba2ddccc5d99c9d4cdfb844a5f")
+ IMPL(tomcrypt, "RIPEMD-128", ripemd128, "9ab8bfba2ddccc5d99c9d4cdfb844a5f")
IMPL_ALL("RIPEMD-160", ripemd160, "62a5321e4fc8784903bb43ab7752c75f8b25af00")
IMPL_ALL("AES-128", aes128, "crc:ff6bc888")
IMPL_ALL("CAMELLIA", camellia, "crc:7abb59a7")
IMPL_ALL("CAST-128", cast128, "crc:456aa584")
+ IMPL_ALL("BLOWFISH", blowfish, "crc:33e8aa74")
IMPL(lavu, "TWOFISH", twofish, "crc:9edbd5c1")
IMPL(gcrypt, "TWOFISH", twofish, "crc:9edbd5c1")
IMPL(tomcrypt, "TWOFISH", twofish, "crc:9edbd5c1")
+ IMPL(lavu, "RC4", rc4, "crc:538d37b2")
+ IMPL(crypto, "RC4", rc4, "crc:538d37b2")
+ IMPL(lavu, "XTEA", xtea, "crc:931fc270")
+ IMPL(tomcrypt, "XTEA", xtea, "crc:931fc270")
};
int main(int argc, char **argv)
diff --git a/chromium/third_party/ffmpeg/tools/graph2dot.c b/chromium/third_party/ffmpeg/tools/graph2dot.c
index 23c7331dc31..21d0795e881 100644
--- a/chromium/third_party/ffmpeg/tools/graph2dot.c
+++ b/chromium/third_party/ffmpeg/tools/graph2dot.c
@@ -79,7 +79,8 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
fprintf(outfile, "\"%s\" -> \"%s\" [ label= \"inpad:%s -> outpad:%s\\n",
filter_ctx_label, dst_filter_ctx_label,
- link->srcpad->name, link->dstpad->name);
+ avfilter_pad_get_name(link->srcpad, 0),
+ avfilter_pad_get_name(link->dstpad, 0));
if (link->type == AVMEDIA_TYPE_VIDEO) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
diff --git a/chromium/third_party/ffmpeg/tools/ismindex.c b/chromium/third_party/ffmpeg/tools/ismindex.c
index 8636c966e84..dfef118653a 100644
--- a/chromium/third_party/ffmpeg/tools/ismindex.c
+++ b/chromium/third_party/ffmpeg/tools/ismindex.c
@@ -378,7 +378,7 @@ static int read_tfra(struct Tracks *tracks, int start_index, AVIOContext *f)
// Now try and read the actual durations from the trun sample data.
for (i = 0; i < track->chunks; i++) {
int64_t duration = read_moof_duration(f, track->offsets[i].offset);
- if (duration > 0 && abs(duration - track->offsets[i].duration) > 3) {
+ if (duration > 0 && llabs(duration - track->offsets[i].duration) > 3) {
// 3 allows for integer duration to drift a few units,
// e.g., for 1/3 durations
track->offsets[i].duration = duration;